Android – deletes the location icon of the default user

I use Google Maps V2 for Android to develop applications. I try to add a custom icon to the user's location, but I can't delete the default icon, so it overwrites my custom icon, as shown in the figure:

(now this is big: P)

My code is like this:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_map);

    map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();

    map.setMyLocationEnabled(true);

    map.setOnMyLocationchangelistener(new OnMyLocationchangelistener() {

        @Override
        public void onMyLocationChange(Location location) {
            if (location == null)
                return;

            mPositionMarker = map.addMarker(new MarkerOptions()
            .flat(true)
            .icon(BitmapDescriptorFactory
                    .fromResource(R.drawable.logop1))
            .anchor(0.5f, 1f)
            .position(new LatLng(location.getLatitude(), location.getLongitude())));

        }
    });
}

So: 1) is there any way to delete the default blue dot at the user's current location?

2) When I move to the "real world", do I update the user location (I can't test it for connectivity reasons) or do I have to write / overwrite methods to update the user location?

Thank you in advance

resolvent:

You will have to stop using Google map. Setmylocationenabled and write more code, including having your own locationclient and adding a circle to ensure accuracy

You must do it yourself. - set to false GMAPs. Getuissettings(). Setmylocationbuttonenabled (false);

>Create your own location button > if you get the current location, set a marker with an icon on it > if you click the location button, move the camera and center it on the map

This will remove the blue dot

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>