2

I would like to add an infoWindow when the user taps their current location (blue dot) in the Google Maps API V1.3 for iOS.

I can get infoWindows on other markers but not to display above the users location. Any help would be appreciated. Thanks!

Normal marker infoWindow

google current location

2 Answers 2

2

As an alternative option, could you add a marker with a transparent icon at the user's current location?

You could use KVO to move the marker whenever the map view's myLocation value changes.

You can see some sample code for how to add an observer here (but instead of moving the camera, you could move your invisible marker):

about positioning myself,some problems

0
1

when you go with the the 'default' user location, you can't. Because it isn't a real marker, the callbacks aren't fired.

What I did in our case is that I set showsMyLocation=NO but I rolled my own location. I added another marker and used a CLLocationManager to position it according to THAT position..

So in pseudocode

- viewDidLoad
    map.showsUserLocation=NO;
    locationManager = [CLLocationManager new];
    locationManager.delegate = self;
}

- locationManager:didUpdateUserLocation:newLoc {
    if(!annotation) {
        annotation = [GMSMarker new];
        annotation.map = map;
    }
    annotation.position = newLoc;
}

=> own annotation that you can treat like any other marker!

1
  • thanks! that did the trick. I still wanted the blue dot so i dug around in the bundle and found it and set it as that markers icon. It doesn't give me the accuracy blue circle but its close enough for what I need. Thanks again!
    – kev
    Commented Jun 4, 2013 at 23:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.