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 marker (“br”, “tr”, “tl” or “bl”).
anchor{Object} Object to which we’ll anchor the marker.
Constructor
ALKMaps.Marker2.Anchored
Functions
destroy
showOverridden from Marker since user might hide marker and then show() it in a new location (meaning we might want to update the relative position on the show)
moveToWe first calculate the new relativePosition, and then we calculate the new px where we will put the marker, based on the new relative position.
setSize
calculateRelativePosition
updateRelativePositionThe marker 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 marker (“br”, “tr”, “tl” or “bl”).

anchor

{Object} Object to which we’ll anchor the marker.  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 Marker since user might hide marker and then show() it in a new location (meaning we might want to update the relative position on the show)

moveTo

moveTo: function (px)

We first calculate the new relativePosition, and then we calculate the new px where we will put the marker, based on the new relative position.

If the relativePosition has changed, we must also call updateRelativePosition() to make any visual changes to the marker 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 marker’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 marker should be placed.

updateRelativePosition

updateRelativePosition: function ()

The marker has been moved to a new relative location, so we may want to make some cosmetic adjustments to it.

calculateNewPx

calculateNewPx: function (px)

Parameters

px{ALKMaps.Pixel}

Returns

{ALKMaps.Pixel} The the new px position of the marker 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 Marker since user might hide marker and then show() it in a new location (meaning we might want to update the relative position on the show)
moveTo: function (px)
We first calculate the new relativePosition, and then we calculate the new px where we will put the marker, based on the new relative position.
setSize: function (contentSize)
calculateRelativePosition: function (px)
updateRelativePosition: function ()
The marker 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