0

Is there a way to dictate on which side of the point the InfoWindow shows up?

I have tried using map.infoWindow.show(location, InfoWindow.ANCHOR_UPPERRIGHT) thinking that this would make the window always show on the right side of the point, but it didn't seem to have an effect.

I'm trying to develop a way for the user to move the InfoWindow out of the way so that it doesn't block any other features that they may need to see, or in some cases block the feature that is highlighted. Even if I can't drag it out of the way, being able to move it 90 degrees would still help.

  • 1
    According to the documentation, your approach seems to be the right one. Anyway I would set the FixedAnchor using map.infoWindow.setFixedAnchor(InfoWindow.ANCHOR_UPPERRIGHT) and see if it has an effect. – Katah Mar 19 at 14:43
  • Your exact suggestion didn't work because the .setFixedAnchor function wasn't available on mine. However, using map.infoWindow.anchor = "upperright" seemed to do the trick. – Pyro Mar 21 at 18:52
0

With helpful advice from @Katah, I was able to figure out the problem.

Using map.infoWindow._anchorSetter(pos) where pos = ("top" || "right" || "bottom" || "left") allowed me to dictate the position of the InfoWindow relative to the point placed at any given time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.