Fork me on GitHub
Show:

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

aeris.maps.Map

Syntax

aeris.maps.Map

(
  • el
  • opt_attrs
  • opt_options
)

Summary

Parameters:

Methods

createStrategy_

Syntax

createStrategy_

(
  • Strategy
)
AbstractStrategy protected

Summary

Create a {aeris.maps.AbstractStrategy} instance.

Override to adjust how strategy objects are instantiated.

Parameters:

  • Strategy Function

    AbstractStrategy object ctor.

Returns:

getBaseLayer

Syntax

getBaseLayer

() Layer

Summary

Returns:

getBounds

Syntax

getBounds

() Bounds

Summary

Returns:

getCenter

Syntax

getCenter

() LatLon

Summary

Returns:

getElement

Syntax

getElement

() HTMLElement

Summary

Note that this may return unexpected results when the map was created with a view instance, instead of an {HTMLElement}.

Returns:

HTMLElement:

The map canvas element

getView

Syntax

getView

() Object

Summary

Returns:

Object:

The view object creating by the mapping library.

getZoom

Syntax

getZoom

() Number

Summary

Returns:

hasMap

Syntax

hasMap

() Boolean

Summary

Returns:

Boolean:

Returns true if the layer has a map set.

normalizeElement_

Syntax

normalizeElement_

(
  • el
)
HTMLElement private

Summary

Parameters:

Returns:

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

setBaseLayer

Syntax

setBaseLayer

(
  • baseLayer
)

Summary

Parameters:

setBounds

Syntax

setBounds

(
  • bounds
)

Summary

Parameters:

setCenter

Syntax

setCenter

(
  • center
)

Summary

Parameters:

setStrategy

Syntax

setStrategy

(
  • Strategy
)

Summary

Set the strategy to use for rendering the StrategyObject.

Parameters:

  • Strategy Function

    Constructor for an {aeris.maps.AbstractStrategy} object.

setZoom

Syntax

setZoom

(
  • zoom
)

Summary

Parameters:

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).

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

center

LatLon LatLon coordinate.

map

Map protected

An AerisMap that the object is bound to. This is set with setMap.

scrollZoom

Boolean

Whether to enable zooming using the mouse scrollwheel.

Attribute not currently supported by open layers.

zoom

number

Events

click

Syntax

click

Summary

Event Payload:

dblclick

Syntax

dblclick

Summary

Event Payload:

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: