【问题标题】:Google Map V2 disable MyLocation blue iconGoogle Map V2 禁用 MyLocation 蓝色图标
【发布时间】:2014-01-30 06:57:57
【问题描述】:

当我设置LocationSource 时,谷歌地图会自动显示蓝色图标。有谁知道怎么去掉蓝色图标??

谢谢。

Something like that

这是我的编码:

 private Marker myLocation = null;

private void prepareMapSetting(GoogleMap aGoogleMap)
{
    aGoogleMap.setLocationSource(mLocationSource);
    aGoogleMap.setOnMyLocationChangeListener(mOnMyLocationChangeListener);
    aGoogleMap.setOnMapLongClickListener(mOnMapLongClickListener);
        aGoogleMap.setMyLocationEnabled(true);
}


private OnMapLongClickListener mOnMapLongClickListener = new OnMapLongClickListener()
{
    @Override
    public void onMapLongClick(LatLng point)
    {
        if(null != mOnLocationChangedListener){
            if(null == myLocation){
                myLocation = getMap().addMarker(new MarkerOptions()
                .position(point)
                .title("You")
                .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN)));
            }
            else{
                myLocation.setPosition(point);
            }

            Location location = new Location("LongPressLocationProvider");
            location.setLatitude(point.latitude);
            location.setLongitude(point.longitude);
            mOnLocationChangedListener.onLocationChanged(location);
        }


    }
};

【问题讨论】:

    标签: google-maps google-maps-markers google-maps-android-api-2


    【解决方案1】:

    我不确定是否理解您的问题(我也没有看到您的图片)。

    其实setLocationSource只是设置mylocation层的位置源(即蓝点...)

    如果你不想要蓝点,就放

      aGoogleMap.setMyLocationEnabled(false);
    

    并且不要使用 locationSource

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多