Transparency in MapMarker icon

So trying to add custom markers on a MapView. But as you can see in the image above, it would be very nice if the markers would have transparency. They're just images loaded from the drawable resource, with disableTransparency set to false. Also, if I just draw the image on the dc with drawBitmap() it actually just works as it should. The image has the transparency as defined. Only when drawing them as a mapMarker with setIcon, they get a black background instead of a transparent one. Is there something I'm missing here?


  • Works fine for me.  I use a .png for the icons, with a transparent background:

    Here's that png: 

    start_pin.zip


  • Ok, I just used your pin in my code, and it shows exactly the same as my png's (so black background). 
    So there is something going on with my code. How does your drawables file look for that pin? Or am I missing something else? I must be missing something, as it works for you

  • Here's the xml:

    <drawables>
        <!-- <bitmap id="endPin" filename="end_pin.png" /> -->
        <bitmap id="startPin" filename="start_pin.png" />
        <bitmap id="wpFnd" filename="bigwp.png" />
        <bitmap id="wpNew" filename="bigwpn.png" />
        <bitmap id="swpFnd" filename="sbigwp.png" />
        <bitmap id="swpNew" filename="sbigwpn.png" />        
        <bitmap id="flUp" filename="bflup.png" />
        <bitmap id="flDn" filename="bfldn.png" />
    </drawables>

    And here's the basics of how I add them: (the start pin here)

    		    marker = new Ui.MapMarker(new Position.Location({:latitude => Spots.startPoint[Spots.WP_LAT], :longitude =>Spots.startPoint[Spots.WP_LON], :format => :degrees}));
        		marker.setIcon(imgs[START_PIN], 12, 24);
            	marker.setLabel("");
    	        map_markers.add(marker);

  • Awesome, thanks a lot man, as always!

    So I had this in my resources:

    <bitmap id="GPS" filename="gps.png">
      <palette disableTransparency="false">
        <color>ffffff</color>
        <color>aaaaaa</color>
        <color>555555</color>
        <color>55AAFF</color>
      </palette>
    </bitmap>

    And when I remove the palette, it works! So I'm wondering if I'm doing something wrong in the palette here. As it uses way les memory when I add the palette then without.