当前位置: 首页>>代码示例>>Java>>正文


Java Marker.getTag方法代码示例

本文整理汇总了Java中com.google.android.gms.maps.model.Marker.getTag方法的典型用法代码示例。如果您正苦于以下问题:Java Marker.getTag方法的具体用法?Java Marker.getTag怎么用?Java Marker.getTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.android.gms.maps.model.Marker的用法示例。


在下文中一共展示了Marker.getTag方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onMarkerClick

import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
@Override
public boolean onMarkerClick(Marker marker) {
    Object markerTag = marker.getTag();
    if (markerTag instanceof Cluster) {
        //noinspection unchecked
        Cluster<T> cluster = (Cluster<T>) marker.getTag();
        //noinspection ConstantConditions
        List<T> clusterItems = cluster.getItems();

        if (mCallbacks != null) {
            if (clusterItems.size() > 1) {
                return mCallbacks.onClusterClick(cluster);
            } else {
                return mCallbacks.onClusterItemClick(clusterItems.get(0));
            }
        }
    }

    return false;
}
 
开发者ID:sharewire,项目名称:google-maps-clustering,代码行数:21,代码来源:ClusterRenderer.java

示例2: showSpawnLocations

import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
private static void showSpawnLocations(GoogleMap googleMap, LatLng latLng, String description, String time) {
    Marker marker = googleMap.addMarker(new MarkerOptions().position(latLng));
    marker.setSnippet(description);
    marker.setTag(time + "");
    marker.setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE));
    mSpawnPoints.add(marker);
    if (marker.getTag() != "") {
        mSpawnPointTimes.add(marker);
    }
}
 
开发者ID:kav0rka,项目名称:VennTracker,代码行数:11,代码来源:SpawnLocation.java

示例3: checkSpawnTimes

import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
public static void checkSpawnTimes() {
    if (mSpawnPoints.size() > 0) {
        Calendar c = Calendar.getInstance();
        int currentTime = c.get(Calendar.MINUTE);
        for (Marker marker : mSpawnPointTimes) {
            if (marker.getTag() != null) {
                boolean overlap = false;
                int startTime = Integer.parseInt(marker.getTag().toString());
                int endTime = startTime + 30;
                if (endTime >= 60) {
                    overlap = true;
                    endTime -= 60;
                }

                if (!overlap && currentTime >= startTime && currentTime <= endTime) {
                    marker.setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN));
                } else if (overlap && currentTime >= 30 && currentTime >= startTime && currentTime <= (startTime + 30)) {
                    marker.setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN));
                } else if (overlap && currentTime < 30 && currentTime <= endTime) {
                    marker.setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN));
                } else {
                    marker.setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED));
                }
            }
        }
    }
}
 
开发者ID:kav0rka,项目名称:VennTracker,代码行数:28,代码来源:SpawnLocation.java

示例4: onInfoWindowClick

import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
@Override
public void onInfoWindowClick(Marker marker) {
    Log.d(TAG, "onInfoWindowClick()");
    
    String pointId = (String) marker.getTag();
    
    if(pointId != null) {
        Intent intent = new Intent(getActivity(), ShowPointActivity.class);
        Bundle dataBundle = new Bundle();
        dataBundle.putString("POINT_ID", pointId);
        intent.putExtras(dataBundle);
        startActivity(intent);
    }
}
 
开发者ID:stefanonicolai,项目名称:AstronomyTourPadova,代码行数:15,代码来源:GmapFragment.java

示例5: onMarkerClick

import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
@Override
public boolean onMarkerClick(Marker marker) {
	// TODO markers' hitboxes are not working properly, they are too big
	// If user has added a marker through place search, it's tag should be null
	if (marker.getTag() != null) {
		int rackId = (int) marker.getTag();
		launchDetailActivity(rackId);
	}
	// Return false if we want the camera to move to the marker and an info window to appear
	return true;
}
 
开发者ID:EduardoVernier,项目名称:bikedeboa-android,代码行数:12,代码来源:MapActivity.java

示例6: onInfoWindowClick

import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
@Override
public void onInfoWindowClick(Marker marker) {
    if (!(marker.getTag() instanceof Restaurant)) {
        return;
    }
    Restaurant restaurant = (Restaurant) marker.getTag();
    mHomeView.clickedRestaurant(restaurant);
}
 
开发者ID:boldijar,项目名称:today-menu-android,代码行数:9,代码来源:RestaurantsMapFragment.java

示例7: onInfoWindowClick

import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
@Override
public void onInfoWindowClick(Marker marker) {
    Trip t = (Trip) marker.getTag();
    mListener.onMarkerSelected(t);
}
 
开发者ID:gvsucis,项目名称:mobile-app-dev-book,代码行数:6,代码来源:TripMapFragment.java


注:本文中的com.google.android.gms.maps.model.Marker.getTag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。