iOS Map annotations
Andy Hilton
andyh at totallybrilliant.com
Wed Dec 22 12:40:30 EST 2010
As so often happens - once you go to the trouble of writing out your issue and mailing it in - then the very next thing is : it starts to work properly !!
Hmm still not convinced by it - but it is at least seeming to do what I want now by using :
Do iAnnotationList.$line.$assign(pAnnotationRow)
Do $cinst.$objs.Map.$showannotation.$assign(pAnnotationRow)
in my evAnnotationTouched event
Andy
On Dec 22, 2010, at 12:35 PM, Andy Hilton wrote:
> Has anyone managed to conquer iOS map annotations yet ?
>
> I have a very cool little test form going where I can look up client details and click on them, do a geo location lookup (thanks Google !) and see them on a map - great !
>
> I can add annotations (pins) to my map - also great !
>
> But I am struggling with the seemingly basic principle of - once there are more than one annotations on the map - getting the user to push on an annotation and get its callout bubble to show.....
> Works just fine with only one annotation......
> But as soon as there are more than one - I don't seem to be able to control which annotation is considered 'current' to the map.....
>
> Here's a brief resume of what I am doing :
>
> I have an instance var List in which I keep a list of all annotations added to the map - and this is what I set when a new one is added :
>
> Do $cinst.$objs.Map.$addannotation.$assign(iAnnotationList)
>
> Once that bit is done - then when I click on any of my pins in my map, I get an evAnnotationTouched event coming through just fine - which shows me the pAnnotationRow of the annotation clicked on - and if I refer that row number to my iAnnotationList - it matches to the right annotation - which all seems fine - but.....
>
> How do I get the map to display the callout bubble for *that* annotation ?
>
> I have a command :
> Do $cinst.$objs.Map.$showannotation.$assign(1)
>
> But, to be truthful, I am not wholly sure I comprehend what the manual says about this command : "Assign an annotation number (a 1-based index into the added annotations) to show the callout bubble for the annotation. If the annotation is not currently visible,assigning this property has no effect"
>
> My interpretation is this : my annotation is currently visible - I can see it on the map......what is a '1-based index' ? To my knowledge it simply means a number sequence starting at 1, not 0 - is this right ? So if I have 2 annotations in my map - I *should* be able to issue the command :
>
> Do $cinst.$objs.Map.$showannotation.$assign(2)
>
> And it should show my callout bubble for annotation number 2 - right ? Except it doesn't......
>
> Anyone any words of wisdom here ?
>
> This is for iOS 4.2 which does seem to be relevant according to some Googling answers I found....
>
> Andy
>
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
More information about the omnisdev-en
mailing list