本文整理汇总了Java中com.google.android.gms.maps.GoogleMap.setInfoWindowAdapter方法的典型用法代码示例。如果您正苦于以下问题:Java GoogleMap.setInfoWindowAdapter方法的具体用法?Java GoogleMap.setInfoWindowAdapter怎么用?Java GoogleMap.setInfoWindowAdapter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.gms.maps.GoogleMap
的用法示例。
在下文中一共展示了GoogleMap.setInfoWindowAdapter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: enableSubMap
import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
public void enableSubMap(GoogleMap subMap) {
mMaps.add(MAP_CODE_SUB, subMap);
mMapTiles.add(MAP_CODE_SUB, null);
subMap.setMapType(MAP_TYPE_HYBRID);
subMap.moveCamera(CameraUpdateFactory.newCameraPosition(mMaps.get(MAP_CODE_MAIN).getCameraPosition()));
onCameraMove();
// 在Activity和Map物件註冊ClusterManager
mClusterManagers.add(MAP_CODE_SUB, new ClusterManager<CustomMarker>(mContext, subMap));
// The Rule about Cluster Managing
mClusterManagers.get(MAP_CODE_SUB).setRenderer(
new CustomRenderer(mContext, subMap, mClusterManagers.get(MAP_CODE_SUB)));
mClusterManagers.get(MAP_CODE_SUB).setOnClusterClickListener(
(CustomRenderer) mClusterManagers.get(MAP_CODE_SUB).getRenderer());
// Click on marker to open infoWindow
subMap.setOnMarkerClickListener(mClusterManagers.get(MAP_CODE_SUB));
// Click on Cluster to zoom to Markers
subMap.setOnCameraIdleListener(this);
// Test for new info window
subMap.setInfoWindowAdapter(new CustomAdapter(mContext));
}
示例2: MapsManager
import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
MapsManager(Activity context, GoogleMap map) {
mContext = context;
// 地圖
mMaps.add(MAP_CODE_MAIN, map);
mMapTiles.add(MAP_CODE_MAIN, null);
mZoomNumber = (TextView) context.findViewById(R.id.zoom_number);
// 顯示準心座標
mCrossCoor = (TextView) context.findViewById(R.id.tvCoord);
mCrossCoor.setOnClickListener((MapsActivity) mContext);
// 加入比例尺
RelativeLayout container = (RelativeLayout) context.findViewById(R.id.layout_container);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(800, 800);
mScaleBar = new ScaleBar(mContext, getMap(MAP_CODE_MAIN));
mScaleBar.setLayoutParams(params);
container.addView(mScaleBar);
// 註冊畫面縮放的監聽
map.setOnCameraMoveListener(this);
// Set the Listener
map.setOnMapClickListener(this);
map.setOnMapLongClickListener(this);
map.setOnInfoWindowClickListener(this);
map.setOnMarkerDragListener(this);
map.setOnCameraIdleListener(this);
// 在Activity和Map物件註冊ClusterManager
mClusterManagers.add(MAP_CODE_MAIN, new ClusterManager<CustomMarker>(mContext, map));
// The Rule about Cluster Managing
mClusterManagers.get(MAP_CODE_MAIN).setRenderer(
new CustomRenderer(mContext, map, mClusterManagers.get(MAP_CODE_MAIN)));
mClusterManagers.get(MAP_CODE_MAIN).setOnClusterClickListener(
(CustomRenderer) mClusterManagers.get(MAP_CODE_MAIN).getRenderer());
// Click on marker to open infoWindow
map.setOnMarkerClickListener(mClusterManagers.get(MAP_CODE_MAIN));
// POI in Google map
map.setOnPoiClickListener(this);
// Test for new info window
map.setInfoWindowAdapter(new CustomAdapter(mContext));
}