Titanium Community Questions & Answer Archive

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

URL Link Map Annotation (Iphone)

Hi there,

I have created an app which was fully functional and live on the app store until the IOS4 release which made the map feature stop functioning. I originally built it in 0.8.1 but decided to rebuild in titanium 3.1.2 so i could use the IOS4 patch to get the map working again.

Everything has gone fine except I cant open a linked file that includes further details on a specific pin. Originally I wrote it all out it separate html files and linked it through an event listener. However when I run the map none of the linked files open and i have no idea what the problem maybe, Here is a copy of my code so you can have a look

var mapview = Titanium.Map.createView({
            mapType: Titanium.Map.HYBRID_TYPE,
            region: {latitude:51.506706, longitude:-0.116719, latitudeDelta:0.2, longitudeDelta:0.2},
            animate:true,
            regionFit:true,
            userLocation:true,
            annotations:[
                    {
                    latitude:51.506706, 
                    longitude:-0.116719,
                    title:"South Bank",
                    pincolor:Titanium.Map.ANNOTATION_RED,
                    animate:true,
                    rightButton:Titanium.UI.iPhone.SystemButton.DISCLOSURE,
                    }
            ]
        });

Here is my event listener


mapview.addEventListener('click',function(evt)
        {
            Ti.API.info('you clicked on '+evt.title+' with click source = '+evt.source);

            if (evt.title == 'South Bank' && evt.source == 'rightButton')
            {
                var w = Titanium.UI.createWindow({
                    url:'southbank.html'
                });
                w.open({animated:true});
            }
        });

Thanks

All The Best Sam

— asked July 5th 2010 by Sam Jacob
  • 3.1.2
  • annotation
  • event
  • iphone
  • link
  • listener
  • map
  • url
0 Comments

4 Answers

  • Accepted Answer

    Change

    if (evt.title == 'South Bank' && evt.source == 'rightButton')
    

    to

    if (evt.title == 'South Bank' && evt.clicksource == 'rightButton')
    
    — answered July 6th 2010 by Chris Magnussen
    permalink
    0 Comments
  • Change

    if (evt.title == 'South Bank' && evt.source == 'rightButton')
    

    to

    if (evt.title == 'South Bank' && evt.clicksource == 'rightButton')
    
    — answered July 6th 2010 by Chris Magnussen
    permalink
    0 Comments
  • Change

    if (evt.title == 'South Bank' && evt.source == 'rightButton')
    

    to

    if (evt.title == 'South Bank' && evt.clicksource == 'rightButton')
    
    — answered July 6th 2010 by Chris Magnussen
    permalink
    0 Comments
  • Man, I got the error page, so I tried posting it again. Sorry for tripleposting.

    — answered July 6th 2010 by Chris Magnussen
    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.