本文整理匯總了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);
}