本文整理汇总了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;
}
示例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);
}
}
示例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));
}
}
}
}
}
示例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);
}
}
示例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;
}
示例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);
}
示例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);
}