ALKMaps.Marker2.Anchored

Inherits from

Summary
ALKMaps.Marker2.Anchored
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.Marker2.Anchored
Functions
destroy
showOverridden 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)
moveToSince the popup is moving to a new px, it might need also to be moved relative to where the marker is.
setSize
calculateRelativePosition
updateRelativePositionThe popup has been moved to a new relative location, so we may want to make some cosmetic adjustments to it.
calculateNewPx
ALKMaps.Marker2.Anchored.toprightCreate an anchored marker that is placed on top right side of a location.
ALKMaps.Marker2.Anchored.topleftCreate an anchored marker that is placed on top left side of a location.
ALKMaps.Marker2.Anchored.bottomrightCreate an anchored marker that is placed on bottom right side of a location.
ALKMaps.Marker2.Anchored.bottomleftCreate an anchored marker that is placed on bottom left side of a location.

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.  Must expose a ‘size’ (ALKMaps.Size) and ‘offset’ (ALKMaps.Pixel).

Constructor

ALKMaps.Marker2.Anchored

Parameters

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.

Functions

destroy

destroy: function()

show

show: 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)

moveTo

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.

Parameters

px{ALKMaps.Pixel}

setSize

setSize:function(contentSize)

Parameters

contentSize{ALKMaps.Size} the new size for the popup’s contents div (in pixels).

calculateRelativePosition

calculateRelativePosition:function(px)

Parameters

px{ALKMaps.Pixel}

Returns

{String} The relative position (“br” “tr” “tl” “bl”) at which the popup should be placed.

updateRelativePosition

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

calculateNewPx:function(px)

Parameters

px{ALKMaps.Pixel}

Returns

{ALKMaps.Pixel} The the new px position of the popup on the screen relative to the passed-in px.

ALKMaps.Marker2.Anchored.topright

ALKMaps.Marker2.Anchored.topright = function(id,
lonlat,
contentSize,
contentHTML,
anchor,
closeBox,
attributes)

Create an anchored marker that is placed on top right side of a location.

Returns

{ALKMaps.Marker2.Anchored}

ALKMaps.Marker2.Anchored.topleft

ALKMaps.Marker2.Anchored.topleft = function(id,
lonlat,
contentSize,
contentHTML,
anchor,
closeBox,
attributes)

Create an anchored marker that is placed on top left side of a location.

Returns

{ALKMaps.Marker2.Anchored}

ALKMaps.Marker2.Anchored.bottomright

ALKMaps.Marker2.Anchored.bottomright = function(id,
lonlat,
contentSize,
contentHTML,
anchor,
closeBox,
attributes)

Create an anchored marker that is placed on bottom right side of a location.

Returns

{ALKMaps.Marker2.Anchored}

ALKMaps.Marker2.Anchored.bottomleft

ALKMaps.Marker2.Anchored.bottomleft = function(id,
lonlat,
contentSize,
contentHTML,
anchor,
closeBox,
attributes)

Create an anchored marker that is placed on bottom left side of a location.

Returns

{ALKMaps.Marker2.Anchored}

destroy: function()
show: 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)
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.
setSize:function(contentSize)
calculateRelativePosition:function(px)
updateRelativePosition: function()
The popup has been moved to a new relative location, so we may want to make some cosmetic adjustments to it.
calculateNewPx:function(px)
ALKMaps.Marker2.Anchored.topright = function(id,
lonlat,
contentSize,
contentHTML,
anchor,
closeBox,
attributes)
Create an anchored marker that is placed on top right side of a location.
ALKMaps.Marker2.Anchored.topleft = 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.bottomright = 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.bottomleft = function(id,
lonlat,
contentSize,
contentHTML,
anchor,
closeBox,
attributes)
Create an anchored marker that is placed on bottom left side of a location.
Instances of ALKMaps.Marker2 are a combination of a div and other elements.
Instances of this class represent a width/height pair
This class represents a screen coordinate, in x and y coordinates
This class represents a longitude and latitude pair
The icon represents a graphical icon on the screen.
Close