ALKMaps. | |
Properties | |
relativePosition | {String} Relative position of the popup (“br”, “tr”, “tl” or “bl”). |
keepInMap | {Boolean} If panMapIfOutOfView is false, and this property is true, constrain the popup such that it always fits in the available map space. |
anchor | {Object} Object to which we’ll anchor the popup. |
Constructor | |
ALKMaps. | |
Functions | |
destroy | |
show | Overridden from Popup since user might hide popup and then show() it in a new location (meaning we might want to update the relative position on the show) |
moveTo | Since the popup is moving to a new px, it might need also to be moved relative to where the marker is. |
setSize | |
calculateRelativePosition | |
updateRelativePosition | The popup has been moved to a new relative location, so we may want to make some cosmetic adjustments to it. |
calculateNewPx |
{Boolean} If panMapIfOutOfView is false, and this property is true, constrain the popup such that it always fits in the available map space. By default, this is set. If you are creating popups that are near map edges and not allowing panning, and especially if you have a popup which has a fixedRelativePosition, setting this to false may be a smart thing to do.
For anchored popups, default is true, since subclasses will usually want this functionality.
{Object} Object to which we’ll anchor the popup. Must expose a ‘size’ (ALKMaps.Size) and ‘offset’ (ALKMaps.Pixel).
id | {String} |
lonlat | {ALKMaps.LonLat} |
contentSize | {ALKMaps.Size} |
contentHTML | {String} |
anchor | {Object} Object which must expose a ‘size’ ALKMaps.Size and ‘offset’ ALKMaps.Pixel (generally an ALKMaps.Icon). |
closeBox | {Boolean} |
closeBoxCallback | {Function} Function to be called on closeBox click. |
moveTo: function( px )
Since the popup is moving to a new px, it might need also to be moved relative to where the marker is. We first calculate the new relativePosition, and then we calculate the new px where we will put the popup, based on the new relative position.
If the relativePosition has changed, we must also call updateRelativePosition() to make any visual changes to the popup which are associated with putting it in a new relativePosition.
px | {ALKMaps.Pixel} |
setSize:function( contentSize )
contentSize | {ALKMaps.Size} the new size for the popup’s contents div (in pixels). |
calculateRelativePosition:function( px )
px | {ALKMaps.Pixel} |
{String} The relative position (“br” “tr” “tl” “bl”) at which the popup should be placed.
updateRelativePosition: function()
The popup has been moved to a new relative location, so we may want to make some cosmetic adjustments to it.
Note that in the classic Anchored popup, there is nothing to do here, since the popup looks exactly the same in all four positions. Subclasses such as Framed, however, will want to do something special here.
calculateNewPx:function( px )
px | {ALKMaps.Pixel} |
{ALKMaps.Pixel} The the new px position of the popup on the screen relative to the passed-in px.
destroy: function()
Overridden from Popup since user might hide popup and then show() it in a new location (meaning we might want to update the relative position on the show)
show: function()
Since the popup is moving to a new px, it might need also to be moved relative to where the marker is.
moveTo: function( px )
setSize:function( contentSize )
calculateRelativePosition:function( px )
The popup has been moved to a new relative location, so we may want to make some cosmetic adjustments to it.
updateRelativePosition: function()
calculateNewPx:function( px )