【发布时间】:2018-01-22 10:31:19
【问题描述】:
我使用自定义圆圈来绘制地理围栏,但有时谷歌会显示其默认的浅蓝色地理围栏圆圈。
它会产生问题,比如它在我的地图中显示 2 个半径。
那么如何在我的应用程序中删除默认地理围栏。
【问题讨论】:
标签: android google-maps geolocation google-maps-android-api-2 geofencing
我使用自定义圆圈来绘制地理围栏,但有时谷歌会显示其默认的浅蓝色地理围栏圆圈。
它会产生问题,比如它在我的地图中显示 2 个半径。
那么如何在我的应用程序中删除默认地理围栏。
【问题讨论】:
标签: android google-maps geolocation google-maps-android-api-2 geofencing
使用map.setMyLocationEnabled(false); 并创建您自己的标记来显示当前位置
googleMap.OnMyLocationChangeListener locationListener = new GoogleMap.OnMyLocationChangeListener() {
@Override
public void onMyLocationChange(Location location) {
drawMarker(location);
private void drawMarker(Location location) {
LatLng currentPosition = new LatLng(location.getLatitude(),
location.getLongitude());
map.addMarker(new MarkerOptions()
.position(currentPosition)
.icon(BitmapDescriptorFactory
.defaultMarker(BitmapDescriptorFactory.HUE_AZURE))
.title("my position"));
}
};
map.setOnMyLocationChangeListener(locationListener);
【讨论】: