eegeo.js

L.eeGeo.map(element, apiKey, options)

Extends: L.Map

// Create a map inside the "map" element, centered over San Francisco
var map = L.eeGeo.map("map", "your_api_key_here", {
    center: [37.7858, -122.401],
    zoom: 16
});
Argument Type Description
element HTMLElement | string The DOM element, or id of the DOM element, to create a map inside
apiKey string A valid eeGeo API key which is required to initialize the map
options object These are the same options you would pass to L.map with some extensions described below

Options

Options Type Default Description
canvasId string “canvas” The id to give to the generated canvas HTML element that the map is rendered on
width number * The initial width of the canvas. Defaults to the width of the element passed to the constructor
height number * The initial height of the canvas. Defaults to the height of the element passed to the constructor
indoorsEnabled boolean false Whether or not IndoorMap objects and their IndoorMapEntrance objects can be loaded by the map
displayEntranceMarkers boolean true Whether or not to automatically represent IndoorMapEntrance objects as interactive markers on the map

Methods

map.getAltitudeAtLatLng(latLng)

Returns the altitude of the terrain in meters above sea level at a given LatLng.

Argument Type Description
latLng L.LatLng The LatLng where the altitude will be returned from

map.getCameraHeightAboveTerrain()

Returns the height of the camera above the terrain in meters.

map.getCameraPitchDegrees()

Returns the pitch of the camera in degrees, where 0 is the horizontal and 90 is the downward vertical.

map.precache(center, radius, callback)

Begin an operation to precache a spherical area of the map. This allows that area to load faster in future.

This function returns an object with a cancel() method to allow you to cancel the precache operation.

Argument Type Description
center L.LatLng The center of the area to precache
radius number The radius of the area to precache
callback function The function to call when the precache operation completes. The function will be passed a boolean indicating whether the precache completed successfully.

Events

In addition to the standard Leaflet events, L.eeGeo.map supports the following events.

The following events are supported.

Event Data Description
update Event Fired every frame.
zoom Event Fired repeatedly while the user zooms the map.
pan Event Fired repeatedly while the map is panning (e.g. while the user is dragging the map or while the map is still moving after the user stops dragging the map).
panstart Event Fired when the user starts dragging the map.
panend Event Fired when the map stops moving after the user stops dragging the map.
rotate Event Fired repeatedly while the user rotates the map.
rotatestart Event Fired when the user starts rotating the map.
rotateend Event Fired when the user stops rotating the map.
tilt Event Fired repeatedly while the user tilts the map.
tiltstart Event Fired when the user starts tilting the map.
tiltend Event Fired when the user stops tilting the map.
transitionstart Event Fired when the user calls SetView().
transitionend Event Fired when the camera stops transitioning after SetView() has been called.

Properties

map.indoors

See L.eeGeo.map.indoors

map.themes

See L.eeGeo.map.themes

v0.1.780