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
4 Answers
-
Accepted Answer
Change
if (evt.title == 'South Bank' && evt.source == 'rightButton')
to
if (evt.title == 'South Bank' && evt.clicksource == 'rightButton')
-
Change
if (evt.title == 'South Bank' && evt.source == 'rightButton')
to
if (evt.title == 'South Bank' && evt.clicksource == 'rightButton')
-
Change
if (evt.title == 'South Bank' && evt.source == 'rightButton')
to
if (evt.title == 'South Bank' && evt.clicksource == 'rightButton')
-
Man, I got the error page, so I tried posting it again. Sorry for tripleposting.