本文整理汇总了Java中com.google.android.gms.maps.GoogleMap.setOnMapClickListener方法的典型用法代码示例。如果您正苦于以下问题:Java GoogleMap.setOnMapClickListener方法的具体用法?Java GoogleMap.setOnMapClickListener怎么用?Java GoogleMap.setOnMapClickListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.gms.maps.GoogleMap
的用法示例。
在下文中一共展示了GoogleMap.setOnMapClickListener方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onMapReady
import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
@Override
public void onMapReady(GoogleMap googleMap) {
MapsInitializer.initialize(getActivity());
final ViewOption viewOption = getViewOption();
calculateAreaAndLength(viewOption);
MapUtils.showElements(viewOption, googleMap, getActivity());
googleMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {
@Override
public void onMapClick(LatLng latLng) {
Bundle args = new Bundle();
args.putParcelable("optionView", viewOption);
Intent intent = new Intent(getActivity(), MapsActivity.class);
intent.putExtra("args", args);
startActivity(intent);
}
});
}
示例2: onMapReady
import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
@Override
public void onMapReady(GoogleMap map) {
mLocationClient = getLocationClient();
mLocationClient.addListener(this);
updateMapPosition();
if (mNew) {
mMapView.setShowInfoWindow(true);
mMapView.setShowAccuracy(true);
}
map.setOnMapClickListener(new OnMapClickListener() {
@Override
public void onMapClick(LatLng loaction) {
viewMap();
}
});
map.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {
@Override
public boolean onMarkerClick(Marker marker) {
viewMap();
return true;
}
});
}
示例3: onMapReady
import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
@Override
public void onMapReady(final GoogleMap googleMap) {
userDataFirebaseCreateFlag.setupMap(googleMap);
googleMap.setOnMapClickListener(this);
flagCreateViewHolder.CURRENT_USER_LOCATION_IMAGE_VIEW
.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
userDataFirebaseCreateFlag.setupMap(googleMap);
}
});
}
示例4: onMapReady
import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
/**
* Appena la mappa è disponibile, oltre a settare le funzioni di base riportate nella classe
* padre, vengono attivate le funzioni specifiche della mappa e avviata una prima ricerca dei
* parcheggi nella zona di Urbino (di dafault).
*/
@Override
public void onMapReady(GoogleMap googleMap) {
super.onMapReady(googleMap);
googleMap.setOnMarkerClickListener(this);
googleMap.setOnMapClickListener(this);
// vengono cercati i parcheggi presso urbino all'avvio
AsyncDownloadParcheggi adp
= new AsyncDownloadParcheggi(mMainActivity, MappaGoogle.COORD_INIZIALI);
adp.execute();
}
示例5: onMapReady
import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
@Override
public void onMapReady(GoogleMap map) {
// New entry, track and save gps location.
if (mEvent != null && mEvent.mLocalId <= 0
&& (mEvent.mLocationSource == null || mEvent.mLocationSource.equals(GameHarvest.LOCATION_SOURCE_GPS))) {
mMapView.setShowInfoWindow(true);
mMapView.setShowAccuracy(true);
if (getActivity() != null) {
mLocationClient = ((BaseActivity) getActivity()).getLocationClient();
mLocationClient.addListener(this);
}
}
map.setOnMapClickListener(new GoogleMap.OnMapClickListener() {
@Override
public void onMapClick(LatLng arg0) {
viewMap();
}
});
map.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {
@Override
public boolean onMarkerClick(Marker marker) {
viewMap();
return true;
}
});
}
示例6: 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));
}
示例7: onMapReady
import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
@Override
public void onMapReady(GoogleMap googleMap) {
super.onMapReady(googleMap);
googleMap.setOnMapClickListener(this);
googleMap.setOnMarkerClickListener(this);
}
示例8: onMapReady
import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
@Override
public void onMapReady(GoogleMap googleMap) {
map = googleMap;
googleMap.setOnMapClickListener(this);
}
示例9: initMap
import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
@Override
protected void initMap(GoogleMap map) {
super.initMap(map);
map.setOnMarkerClickListener(this);
map.setOnMapClickListener(this);
}