I have two bitmaps that differ only by color. The green one is used to plot points of interest on a map view and the blue one shows the device’s current location. I load the bitmaps from the resources directory and convert them to BitmapDrawable objects in an identical manner.
I set the green bitmap drawable to be the map view’s overlay’s default image; for the POI points I just add them to the layer so that they pick up the default (green) image.
For the current position item I explicitly set the blue bitmap drawable when adding the point to the same overlay layer.
The only difference between normal POIs and the current location is that the current location has the specific (blue) bitmap drawable, whereas the normal POIs pick up the overlay layer’s default (green) bitmap drawable. The bitmaps came from photoshop (saved for web) and only differ in their colors.
But when I display the map the current location point’s icon image is half the size of the default image. This is true at any zoom level. I have worked around this by resizing the current position (blue) bitmap to be twice the size of the green bitmap and now you can’t tell the difference. So it is definitely some type of scaling going on in the drawing of the images.
I cannot see any interface on the set of Google maps classes that woud indicate setting a scale factor.
While my work-around of doubling the specific (blue) icon works, I’d sorely like to understand what I am not doing correctly. What am I forgetting to do?
First I would say use a separate overlay for your location pin, Adding them to the same ItemizedOverlay is not recommended.
Make Sure you are boundToBottom() for anything you are setting custom. From memory the overlays don’t resize the drawables, so this sounds like when you are setting the separate custom blue pin your not setting the drawable properly. boundBottom or boundBottomCenter need to be set otherwise it will confuse the overlay.
Also just check that your drawables are inside a dpi drawable folder. (most commonly drawable-hdpi).