當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。