Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i add a button to google maps marker info window on ios?

I have added Google maps sdk for ios to my Iphone app, and i have some custom markers if clicked info window pops up with title, how can i add a button to this info window so if pressed will go to new page? Now i have tryed to use this post to solve this issue Adding Click Event on InfoWindow/Marker in Google Maps SDK for native iOS/objective C it doesnt give me error but it won't work.

this is what i want my result to be:http://www.flickr.com/photos/74719051@N05/6728157477/

like image 372
user1810991 Avatar asked Mar 21 '13 00:03

user1810991


1 Answers

The answer for the question you linked shows code for using MapKit, so it wouldn't work with the Google Maps SDK for iOS.

See this question for how to return a custom view with the Google Maps SDK for iOS:

Custom annotation view in Google Maps SDK

However note that according to this question, it looks like what is displayed might be a visual copy of the view not the actual view, which might limit the interaction you can do with the view:

Add buttons to view returned by markerInfoWindow delegate method

Simply detecting a tap on the info window and going to a different page should be possible using didTapWindowOfMarker though.

Note that there's a feature request in Google's issue tracker to add direct support for this:

https://code.google.com/p/gmaps-api-issues/issues/detail?id=4961

like image 63
Saxon Druce Avatar answered Nov 10 '22 20:11

Saxon Druce