ALKMaps. | |
Properties | |
fixedRelativePosition | {Boolean} If true, marker postion will be fixed. |
relativePosition | {String} Relative position of the popup (“br”, “tr”, “tl” or “bl”). |
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 | |
ALKMaps. | Create an anchored marker that is placed on top right side of a location. |
ALKMaps. | Create an anchored marker that is placed on top left side of a location. |
ALKMaps. | Create an anchored marker that is placed on bottom right side of a location. |
ALKMaps. | Create an anchored marker that is placed on bottom left side of a location. |
{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 | {Object} If supplied, it should expose a ‘size’ ALKMaps.Size , ‘displayClass’ {String}, and ‘callback’ {Function}. |
attributes | {Object} Properties for a popup can be added in this. If an attribute is used for clustering, attach it here. |
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 )
Create an anchored marker that is placed on top right side of a location.
ALKMaps.Marker2.Anchored.topright = function( id, lonlat, contentSize, contentHTML, anchor, closeBox, attributes )
Create an anchored marker that is placed on top left side of a location.
ALKMaps.Marker2.Anchored.topleft = function( id, lonlat, contentSize, contentHTML, anchor, closeBox, attributes )
Create an anchored marker that is placed on bottom right side of a location.
ALKMaps.Marker2.Anchored.bottomright = function( id, lonlat, contentSize, contentHTML, anchor, closeBox, attributes )
Create an anchored marker that is placed on bottom left side of a location.
ALKMaps.Marker2.Anchored.bottomleft = function( id, lonlat, contentSize, contentHTML, anchor, closeBox, attributes )