Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Setting map pin image - iPhone only?

I was going to play around with the map view, see what can be set and not set to change its visuals. And found that the pin can be set using pinImage by looking at kitchen sink demo at (http://github.com/appcelerator/titanium_mobile/blob/master/demos/KitchenSink/Resources/images/map-pin.png).

But the if statement leads me to think that this only works on iPhone, is this true? Also, is there anywhere in the API docs which tell us which commands/attributes work on which devices?

if (!isAndroid) {
    atlantaParams.pincolor = Titanium.Map.ANNOTATION_PURPLE;
} else {
    atlantaParams.pinImage = "/images/map-pin.png";
}
— asked April 1st 2010 by Dan Duke
  • android
  • beginner
  • compatibility
  • device
  • iphone
  • map
  • mobile
  • pinimage
  • win32
0 Comments

5 Answers

  • Accepted Answer

    Android has 3 standard pins (red, green and purple), same on iPhone. But on the iPhone you have the possibility to add your own custom pins. You can do that with the command you subscribed

    — answered April 1st 2010 by Glenn Tillemans
    permalink
    0 Comments
  • What?? no customized pin for Android?? shoot!

    — answered November 25th 2011 by Nidhi Shah
    permalink
    0 Comments
  • Okay, thanks, so I can't do this on android, shame. Sadly the pin I get in the android preview doesn't even look like a pin, just a circle (which is why I wanted to use an image).

    — answered April 1st 2010 by Dan Duke
    permalink
    0 Comments
  • yeah i know, i dont like those dots eighter, hopefully in one of the next releases this will be adjusted.

    — answered April 1st 2010 by Glenn Tillemans
    permalink
    0 Comments
  • Just for information if somebody come to this subject.

    It is possible with this code :

    mapview.addAnnotation(Ti.Map.createAnnotation({
        animate: true,
        title: 'Annotation title',
        subtitle: 'Subtitle',
        latitude: geo.LATITUDE_BASE,
        longitude: geo.LONGITUDE_BASE,
        leftButton: '/images/delete.png',
        image: '/images/red-dot.png',
    }));
    
    — answered June 11th 2012 by Louis Nicolas
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.