Android Google Maps API v2 - how to change marker icon

后端 未结 8 1159
青春惊慌失措
青春惊慌失措 2021-01-31 16:34

I am trying to change marker icon. I get the image from one server directory.

When I put break point every time the \"bit\" result is null. And when I run t

8条回答
  •  悲&欢浪女
    2021-01-31 17:04

    For Xamarin C# users:

    tappedMarker.Remove();
    MarkerOptions markerOptions = new MarkerOptions();
    markerOptions.SetTitle(tappedMarker.Title);
    markerOptions.SetPosition(tappedMarker.Position);
    
    markerOptions.SetIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueGreen));
    tappedMarker = googleMap.AddMarker(markerOptions);
    

提交回复
热议问题