syagbasan / android-maps-extensions

Automatically exported from code.google.com/p/android-maps-extensions
0 stars 1 forks source link

Custom Map Markers #11

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

I am just checking out this library looks exactly what I need, thanks for the 
effort. 
I am just playing around with it and I would like to create custom map markers 
for individual pins (I have worked out custom cluster icons.)

As this is an extension of Google Maps v2 I would assume that the normal method 
would work for creating custom markers however it is still using the standard 
icons.... am I missing something or is this functionality not handled by the 
library?

My code :

    Marker m =  map.addMarker(new MarkerOptions()
            .position(data.position)
            .icon(BitmapDescriptorFactory.fromResource(R.drawable.map_pin)));
    m.setData(data);

All the best

Original issue reported on code.google.com by connecti...@gmail.com on 19 Apr 2013 at 1:22

GoogleCodeExporter commented 8 years ago
I have just tried this code at the end of onCreate in demo project:

Marker m = map.addMarker(new MarkerOptions().position(new LatLng(0, 
0)).icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_launcher)));

After zooming in you can see a green robot marker, so everything worked as 
expected and your code should work as well.

I'm going to invalidate this issue, but we can discuss this more if you want.

Original comment by maciek.g...@gmail.com on 19 Apr 2013 at 5:39

GoogleCodeExporter commented 8 years ago
aha, my bad I was changing the marker icon within the mutable data array
loop it seems that this is not able to change the marker icon.

Original comment by connecti...@gmail.com on 22 Apr 2013 at 8:11