-4

How do I add pictures to a location where I have a marker in Google Maps IOS SDK?

  • This question does not show any research effort. It is important to **do your homework**. Tell us what you found and ***why*** it didn't meet your needs. This demonstrates that you've taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer. [FAQ](http://stackoverflow.com/questions/how-to-ask). – John Conde Apr 12 '13 at 13:36
  • I have done my research. I have construct an entire IOS App using Google Maps IOS SDK. I know we can place markers on the maps, and drop overlays. However, I don't see any info in the headers about adding a picture to a location based on user place marker. – user2274599 Apr 12 '13 at 13:39
  • Do you mean a ground overlay (ie the picture is displayed as an overlay on the map), or do you mean use a picture for the marker, or do you mean that when the marker is tapped, a picture is displayed? – Saxon Druce Apr 12 '13 at 13:43
  • From what I understand, GSMarkerOptions class allows you to set the title. I wanted to set if there was a way to set a picture, just as you would set the title in GSMarkerOptions class. – user2274599 Apr 12 '13 at 13:46

1 Answers1

1

Just set the icon property of GMSMarkerOptions to a UIImage.

There is an example of this here:

https://developers.google.com/maps/documentation/ios/marker#customize_a_marker

UPDATE:

You can use a UIImagePickerController to take a picture. You would need to resize the returned UIImage, to make it small enough for a marker.

You can use the myLocation property on the GMSMapView to get the current location to add the marker to. You would need to set myLocationEnabled to YES on the GMSMapView when you first create the map view, in order for myLocation to track your current location.

Saxon Druce
  • 17,406
  • 5
  • 50
  • 71
  • What if I want the user in the map application to add a picture during runtime of application? How would I do that? I want to take a picture as a user, and then add it to Google Maps IOS SDK based on location. – user2274599 Apr 12 '13 at 13:58