ALKMaps. | |
Properties | |
imageSrc | {String} location of the image to be used as the popup frame |
imageSize | {ALKMaps.Size} Size (measured in pixels) of the image located by the ‘imageSrc’ property. |
isAlphaImage | {Boolean} The image has some alpha and thus needs to use the alpha image hack. |
positionBlocks | {Object} Hash of different position blocks (Object/Hashs). |
blocks | {Array[Object]} Array of objects, each of which is one “block” of the popup. |
fixedRelativePosition | {Boolean} We want the framed popup to work dynamically placed relative to its anchor but also in just one fixed position. |
Constructor | |
ALKMaps. | |
Functions | |
destroy | |
setBackgroundColor | |
setBorder | |
setOpacity | Sets the opacity of the popup. |
setSize | Overridden here, because we need to update the blocks whenever the size of the popup has changed. |
updateRelativePosition | When the relative position changes, we need to set the new padding BBOX on the popup, reposition the close div, and update the blocks. |
calculateNewPx | Besides the standard offset as determined by the Anchored class, our Framed popups have a special ‘offset’ property for each of their positions, which is used to offset the popup relative to its anchor. |
createBlocks | |
updateBlocks | Internal method, called on initialize and when the popup’s relative position has changed. |
{ALKMaps.Size} Size (measured in pixels) of the image located by the ‘imageSrc’ property.
{Object} Hash of different position blocks (Object/Hashs). Each block will be keyed by a two-character ‘relativePosition’ code string (ie “tl”, “tr”, “bl”, “br”). Block properties are ‘offset’, ‘padding’ (self-explanatory), and finally the ‘blocks’ parameter, which is an array of the block objects.
Each block object must have ‘size’, ‘anchor’, and ‘position’ properties.
Note that positionBlocks should never be modified at runtime.
{Boolean} We want the framed popup to work dynamically placed relative to its anchor but also in just one fixed position. A well designed framed popup will have the pixels and logic to display itself in any of the four relative positions, but (understandably), this will not be the case for all of them. By setting this property to ‘true’, framed popup will not recalculate for the best placement each time it’s open, but will always open the same way. Note that if this is set to true, it is generally advisable to also set the ‘panIntoView’ property to true so that the popup can be scrolled into view (since it will often be offscreen on open) Default is false.
id | {String} |
lonlat | {ALKMaps.LonLat} |
contentSize | {ALKMaps.Size} |
contentHTML | {String} |
anchor | {Object} Object to which we’ll anchor the popup. Must expose a ‘size’ (ALKMaps.Size) and ‘offset’ (ALKMaps.Pixel) (Note that this is generally an ALKMaps.Icon). |
closeBox | {Boolean} |
closeBoxCallback | {Function} Function to be called on closeBox click. |
setSize:function( contentSize )
Overridden here, because we need to update the blocks whenever the size of the popup has changed.
contentSize | {ALKMaps.Size} the new size for the popup’s contents div (in pixels). |
calculateNewPx:function( px )
Besides the standard offset as determined by the Anchored class, our Framed popups have a special ‘offset’ property for each of their positions, which is used to offset the popup relative to its anchor.
px | {ALKMaps.Pixel} |
{ALKMaps.Pixel} The the new px position of the popup on the screen relative to the passed-in px.
destroy: function()
setBackgroundColor:function( color )
setBorder:function()
Sets the opacity of the popup.
setOpacity:function( opacity )
Overridden here, because we need to update the blocks whenever the size of the popup has changed.
setSize:function( contentSize )
When the relative position changes, we need to set the new padding BBOX on the popup, reposition the close div, and update the blocks.
updateRelativePosition: function()
Besides the standard offset as determined by the Anchored class, our Framed popups have a special ‘offset’ property for each of their positions, which is used to offset the popup relative to its anchor.
calculateNewPx:function( px )
createBlocks: function()
Internal method, called on initialize and when the popup’s relative position has changed.
updateBlocks: function()