【发布时间】:2017-12-05 12:02:53
【问题描述】:
我在其中创建了一张地图,我在当前位置显示了一个标记,它工作正常 当位置已经打开但是当活动打开并且我打开位置时它不显示任何标记我想在位置打开时显示标记 有什么帮助吗?..
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
getCurrentLocation();
// latLngCurrentLocation is my current location which is update using getCurrentLocation() method.
if(latLngCurrentLocation != null) {
// add marker on current location
markerCurrent = mMap.addMarker(new MarkerOptions()
.position(latLngCurrentLocation)
.draggable(true)
.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN))
.title("Current Location"));
mMap.moveCamera(CameraUpdateFactory.newLatLng(latLngCurrentLocation));
mMap.animateCamera(CameraUpdateFactory.zoomTo(8));
mMap.getUiSettings().setZoomControlsEnabled(true);
mMap.setOnMarkerDragListener(this);
}
}
【问题讨论】:
标签: java android google-maps