Select to view content in your preferred language

Moving a Popup Anchor

1530
5
10-16-2012 03:24 PM
nathanmanning
Emerging Contributor
I am using a popup for my map's info window. What I want to know is if there is any way to change the anchor location like you could for a generic InfoWindow? If I try to use setFixedAnchor() I get a "undefined method" error since Popup doesn't support this function.

Any ideas?

Thanks,
N
0 Kudos
5 Replies
derekswingley1
Deactivated User
setFixedAnchor is indeed defined on InfoWindow. The popup does not have this method.

What are you trying to change about the default popup positioning? As is, the popup always positions itself within the map.
0 Kudos
nathanmanning
Emerging Contributor
setFixedAnchor is indeed defined on InfoWindow. The popup does not have this method.

What are you trying to change about the default popup positioning? As is, the popup always positions itself within the map.


I am using a popup to display driving directions between points, and would like to control the both location of the popup as well as which side the anchor is on in order to avoid covering up the route graphics. The reason I am setting my map's infoWindow to a popup is because I use it elsewhere to display information about various (and possibly overlapping) points and the built in user interface for clicking through multiple points is very handy.

Is there any way to assign where the anchor is located, as ANCHOR_LOWERLEFT can with InfoWindow?
0 Kudos
derekswingley1
Deactivated User

Is there any way to assign where the anchor is located, as ANCHOR_LOWERLEFT can with InfoWindow?


No, there isn't a way to do this. The popup will do its best position itself within the map (and this works, as long as the popup isn't bigger than the map container). If you always used ANCHOR_LOWERLEFT, there's a good chance you could be opening the popup but it wouldn't be 100% visible, which would then require to pan to see all of it.

If I'm missing something, can you post some screen shots that show what's happening now and perhaps mock-up what you'd like to be happening?
0 Kudos
nathanmanning
Emerging Contributor
The map is positioning the Popup automatically just as you described. I don't need to scroll to see it. The problem is that without explicit control over the location of the Popup, the map sometimes covers the resources (in this case driving directions) that it represents. You can see this in the screen shot below. Covering the path in this way is no good for me.

[ATTACH=CONFIG]18695[/ATTACH]


No, there isn't a way to do this. The popup will do its best position itself within the map (and this works, as long as the popup isn't bigger than the map container). If you always used ANCHOR_LOWERLEFT, there's a good chance you could be opening the popup but it wouldn't be 100% visible, which would then require to pan to see all of it.

If I'm missing something, can you post some screen shots that show what's happening now and perhaps mock-up what you'd like to be happening?
0 Kudos
MichaelStranovsky
Regular Contributor
Can you provide a link to your site where you use the pop driving directions?
0 Kudos