Map
Summary
An Aeris Map is the base object on which all other map objects live. Any MapObjectInterface object can be added to a map using the setMap
method:
var map = new aeris.maps.Map('map-canvas-id');
mapObject.setMap(map); // adds the object to the map
mapobject.setMap(null); // removes the object from the map
Marker and AerisRadar are examples of MapObjectInterface objects which can be set to a map.
Constructor
Item Index
Methods
Properties
Events
Methods
createStrategy_
Syntax
Summary
Create a {aeris.maps.AbstractStrategy} instance.
Override to adjust how strategy objects are instantiated.
Parameters:
-
Strategy
FunctionAbstractStrategy object ctor.
Returns:
destroy
Syntax
destroy
()
Summary
getElement
Syntax
Summary
Note that this may return unexpected results when the map was created with a view instance, instead of an {HTMLElement}.
Returns:
The map canvas element
getMap
Syntax
getMap
()
Summary
removeStrategy
Syntax
removeStrategy
()
Summary
Remove and clean up the StrategyObject's strategy.
resetStrategy
Syntax
resetStrategy
()
Summary
Reset the rendering strategy used by the object. Useful for re-enabled a strategy which has previously been removed with StrategyObject#removeStrategy
setMap
Syntax
setMap
()
Summary
setStrategy
Syntax
setStrategy
-
Strategy
Summary
Set the strategy to use for rendering the StrategyObject.
Parameters:
-
Strategy
FunctionConstructor for an {aeris.maps.AbstractStrategy} object.
updateSize
Syntax
updateSize
()
Summary
To be used when the map canvas element has changed dimensions.
This will tell the underlying mapping strategy to refresh appropriately (eg. load new tile images to account for a larger map).
validate
Syntax
validate
()
Summary
validateElementExists_
Syntax
validateElementExists_
()
private
Summary
Properties
mapEl_
Syntax
mapEl_
HTMLElement Map element be also be a reference to a pre-existing map view
private
Summary
strategy_
Syntax
strategy_
aeris.maps.Strategy Strategy constructor.
Summary
Default {aeris.Strategy} implementation
StrategyType_
Syntax
StrategyType_
function():aeris.maps.AbstractStrategy
private
Summary
Attributes
baseLayer
Layer
The base map layer. Note that different mapping libraries have different default base layers.
bounds
Bounds LatLons of SW and NE corners.
LatLon bounds of the map viewport.
Default: A rough box around the US
scrollZoom
Boolean
Whether to enable zooming using the mouse scrollwheel.
Attribute not currently supported by open layers.
Events
load
Syntax
load
Summary
When base map tiles are loaded.
strategy:set
Syntax
strategy:set
Summary
When a strategy is set on the object.
Event Payload:
-
strategy
aeris.maps.AbstractStrategy