map

geo. map

new map(arg) → {geo.map}

Description:
  • Creates a new map object.

Source:
Parameters:
Name Type Description
arg geo.map.spec

Map specification

Returns:
Type
geo.map

Extends

Members

idle

Description:
  • Getter for the idle state. Read only.

Source:
Inherited From:
Properties:
Name Type Description
idle boolean

true if the object is idle (onIdle would call a handler immediately).

Getter for the idle state. Read only.

Methods

addChild(child) → {this}

Description:
  • Add a child (or an array of children) to the object.

Source:
Inherited From:
Parameters:
Name Type Description
child geo.object | Array.<geo.object>

A child object or array of child objects.

Returns:
Type
this

addPromise(promise) → {this}

Description:
  • Add the promise here and also propagate up the scene tree.

Source:
Inherited From:
Parameters:
Name Type Description
promise Promise

A promise object.

Returns:
Type
this

allowRotation(allowRotationopt) → {boolean|function|this}

Description:
  • Get/set the allowRotation setting. If changed, adjust the map as needed.

Source:
Parameters:
Name Type Attributes Description
allowRotation boolean | function <optional>

The new allowRotation value. false prevents rotation, true allows any rotation. If a function, the function is called with a rotation (angle in radians) and returns a valid rotation (this can be used to constrain the rotation to a range or to specific values).

Returns:
Type
boolean | function | this

animationQueue(queueopt) → {array|this}

Description:
  • Get/set the animation queue. Two maps can share a single animation queue to ensure synchronized animations. When setting, the animation queue will merge values from the existing queue into the new queue.

Source:
Parameters:
Name Type Attributes Description
queue array <optional>

The animation queue to use.

Returns:

The current animation queue or the current map.

Type
array | this

autoResize(autoResizeopt) → {boolean|this}

Description:
  • Get/set the autoResize flag.

Source:
Parameters:
Name Type Attributes Description
autoResize boolean <optional>

Truthy to automatically resize the map when the size of the browser window changes.

Returns:

The current state of autoResize or the current map.

Type
boolean | this

autoshareRenderer(argopt) → {boolean|string|this}

Description:
  • Get or set the setting of autoshareRenderer.

Source:
Parameters:
Name Type Attributes Description
arg boolean | string | null <optional>

If specified, the new value for autoshareRender that gets passed to created layers. null will clear the value.

Returns:
Type
boolean | string | this

bounds(bdsopt, gcsopt) → {geo.geoBounds}

Description:
  • Get/set the locations of the current map edges. When set, the left-top and right-bottom corners are transformed to the map's gcs and then used to set the bounds.

Source:
Parameters:
Name Type Attributes Description
bds geo.geoBounds <optional>

The requested map bounds.

gcs string | geo.transform | null <optional>

undefined to use the interface gcs, null to use the map gcs, or any other transform. If setting the bounds, they are converted from this gcs to the map projection. The returned bounds are converted from the map projection to this gcs.

Returns:

The actual new map bounds.

Type
geo.geoBounds

boundsFromZoomAndCenter(zoom, center, rotation, gcsopt, ignoreDiscreteZoomopt, ignoreClampBoundsopt) → {geo.geoBounds}

Description:
  • Get the bounds that will be displayed with the given zoom and center.

    Note: the bounds may not have the requested zoom and center due to map restrictions.

Source:
Parameters:
Name Type Attributes Description
zoom number

The requested zoom level.

center geo.geoPosition

The requested center.

rotation number

The requested rotation in clockwise radians.

gcs string | geo.transform | null <optional>

undefined to use the interface gcs, null to use the map gcs, or any other transform.

ignoreDiscreteZoom boolean <optional>

If true, ignore the discreteZoom option when determining the new view.

ignoreClampBounds boolean <optional>

If true and clampBoundsX or clampBoundsY is set, allow the bounds to be less clamped. The map's maxBounds can be shifted so that they lie no further than the center of the bounds (rather than being forced to be at the edge).

Returns:
Type
geo.geoBounds

camera() → {geo.camera}

Description:
  • Get the camera.

Source:
Returns:
Type
geo.camera

center(coordinates, gcsopt, ignoreDiscreteZoomopt, ignoreClampBoundsopt) → {geo.geoPosition|this}

Description:
  • Get or set the center of the map in the given geographic coordinates.

Source:
Parameters:
Name Type Attributes Description
coordinates geo.geoPosition

If specified, the new center of the map.

gcs string | geo.transform | null <optional>

undefined to use the interface gcs, null to use the map gcs, or any other transform. If setting the center, it is converted from this gcs to the map projection. The returned center is converted from the map projection to this gcs.

ignoreDiscreteZoom boolean <optional>

If true, ignore the discreteZoom option when determining the new view.

ignoreClampBounds boolean | 'limited' <optional>

If true ignore the clampBoundsX and clampBoundsY options when determining the new view. When 'limited', the clampBoundsX and clampBoundsY options are selectively enforced so that the map will not end up more out of bounds than its current state.

Fires:
Returns:
Type
geo.geoPosition | this

children() → {Array.<geo.object>}

Description:
  • Get an array of the child objects.

Source:
Inherited From:
Returns:

A copy of the array of child objects.

Type
Array.<geo.object>

clampBoundsX(clampopt) → {boolean|this}

Description:
  • Get/set the clampBoundsX setting. If changed, adjust the bounds of the map as needed.

Source:
Parameters:
Name Type Attributes Description
clamp boolean <optional>

The new clamp value.

Returns:
Type
boolean | this

clampBoundsY(clampopt) → {boolean|this}

Description:
  • Get/set the clampBoundsY setting. If changed, adjust the bounds of the map as needed.

Source:
Parameters:
Name Type Attributes Description
clamp boolean <optional>

The new clamp value.

Returns:
Type
boolean | this

clampZoom(clampopt) → {boolean|this}

Description:
  • Get/set the clampZoom setting. If changed, adjust the bounds of the map as needed.

Source:
Parameters:
Name Type Attributes Description
clamp boolean <optional>

The new clamp value.

Returns:
Type
boolean | this

createLayer(layerName, arg) → {geo.layer}

Description:
  • Add a layer to the map.

Source:
Parameters:
Name Type Description
layerName string

The type of layer to add to the map.

arg object

Parameters for the new layer.

Fires:
Returns:
Type
geo.layer

deleteLayer(layernullable) → {geo.layer}

Description:
  • Remove a layer from the map.

Source:
Parameters:
Name Type Attributes Description
layer geo.layer <nullable>

Layer to remove from the map.

Fires:
Returns:
Type
geo.layer

discreteZoom(discreteZoomopt) → {boolean|this}

Description:
  • Get/set the discrete zoom flag. If true, the map will snap to integer zoom levels.

Source:
Parameters:
Name Type Attributes Description
discreteZoom boolean <optional>

If specified, the new discrete zoom flag.

Returns:

The current discrete zoom flag or the map object.

Type
boolean | this

displayToGcs(c, gcsopt) → {geo.geoPosition|Array.<geo.geoPosition>}

Description:
  • Convert from display to gcs coordinates. This is identical to calling displayToWorld and then worldToGcs.

Source:
Parameters:
Name Type Attributes Description
c geo.screenPosition | Array.<geo.screenPosition>

The input display coordinate to convert.

gcs string | geo.transform | null <optional>

Output gcs. undefined to use the interface gcs, null to use the map gcs, or any other transform.

Returns:

GCS space coordinates.

Type
geo.geoPosition | Array.<geo.geoPosition>

displayToWorld(c) → {geo.worldPosition|Array.<geo.worldPosition>}

Description:
  • Convert from display coordinates to world coordinates using the attached camera.

Source:
Parameters:
Name Type Description
c geo.screenPosition | Array.<geo.screenPosition>

The input coordinate to convert.

Returns:

World space coordinates.

Type
geo.worldPosition | Array.<geo.worldPosition>

draw() → {this}

Description:
  • Redraw the map and all its layers.

Source:
Overrides:
Fires:
Returns:

The map object.

Type
this

exit()

Description:
  • Exit this map. This removes all layers, destroys current interactor, and empties the associated DOM node.

Source:

fileReader(readerOrNameopt, optsopt) → {geo.fileReader|this}

Description:
  • Get, set, or create and set a file reader to a layer in the map to be used as a drop target.

Source:
Parameters:
Name Type Attributes Description
readerOrName string | object <optional>

undefined to get the current reader, an instance of a file reader to set the reader, or a name to create a file reader.

opts object <optional>

options Parameters for creating a file reader when the reader is specified by name. If this includes layer, use that layer, otherwise create a layer using these options.

Returns:
Type
geo.fileReader | this

gcs(argopt) → {string|this}

Description:
  • Get or set the map gcs. This is the coordinate system used in drawing the map.

Source:
Parameters:
Name Type Attributes Description
arg string <optional>

If undefined, return the current gcs. Otherwise, a new value for the gcs.

Returns:

A string used by geo.transform.

Type
string | this

gcsToDisplay(c, gcsopt) → {geo.screenPosition|Array.<geo.screenPosition>}

Description:
  • Convert from gcs coordinates to display coordinates. This is identical to calling gcsToWorld and then worldToDisplay.

Source:
Parameters:
Name Type Attributes Description
c geo.geoPosition | Array.<geo.geoPosition>

The input coordinate to convert.

gcs string | geo.transform | null <optional>

Input gcs. undefined to use the interface gcs, null to use the map gcs, or any other transform.

Returns:

Display space coordinates.

Type
geo.screenPosition | Array.<geo.screenPosition>

gcsToWorld(c, gcsopt) → {geo.worldPosition|Array.<geo.worldPosition>}

Description:
  • Convert from gcs coordinates to map world coordinates.

Source:
Parameters:
Name Type Attributes Description
c geo.geoPosition | Array.<geo.geoPosition>

The input coordinate to convert.

gcs string | geo.transform | null <optional>

Input gcs. undefined to use the interface gcs, null to use the map gcs, or any other transform.

Returns:

World space coordinates.

Type
geo.worldPosition | Array.<geo.worldPosition>

geoIsOn(event, handleropt) → {boolean}

Description:
  • Report if an event handler is bound to this object.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
event string | Array.<string>

An event or list of events to check.

handler function <optional>

A function that might be bound. If undefined, this will report true if there is any handler for the specified event.

Returns:

true if any of the specified events are bound to the specified handler.

Type
boolean

geoOff(eventopt, argopt, nullable) → {this}

Description:
  • Remove handlers from one event or an array of events. If no event is provided all handlers will be removed.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
event string | Array.<string> <optional>

An event or a list of events from geo.event or defined by the user, or undefined to remove all events (in which case arg is ignored).

arg function | Array.<function()> <optional>
<nullable>

A function or array of functions to remove from the events or a falsy value to remove all handlers from the events.

Returns:
Type
this

geoOn(event, handler) → {this}

Description:
  • Bind an event handler to this object.

Source:
Inherited From:
Parameters:
Name Type Description
event string

An event from geo.event or a user-defined value.

handler function

A function that is called when event is triggered. The function is passed a geo.event object.

Returns:
Type
this

geoOnce(event, handler) → {function}

Description:
  • Bind an event handler to this object that will fire once and then deregister itself.

Source:
Inherited From:
Parameters:
Name Type Description
event string

An event from geo.event or a user-defined value.

handler function

A function that is called when event is triggered. The function is passed a geo.event object.

Returns:

The actual bound handler. This is a wrapper around the handler that was passed to the function.

Type
function

geoTrigger(event, args, childrenOnlyopt) → {this}

Description:
  • Trigger an event (or events) on this object and call all handlers.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
event string

The event to trigger.

args object

Arbitrary argument to pass to the handler.

childrenOnly boolean <optional>

If truthy, only propagate down the tree.

Returns:
Type
this

ingcs(argopt) → {string|this}

Description:
  • Get or set the map interface gcs. This is the coordinate system used when getting or setting map bounds, center, and other values.

Source:
Parameters:
Name Type Attributes Description
arg string <optional>

If undefined, returtn the current interface gcs. Otherwise, a new value for the interface gcs.

Returns:

A string used by geo.transform.

Type
string | this

interactor(argopt) → {geo.mapInteractor|this}

Description:
  • Get or set the map interactor.

Source:
Parameters:
Name Type Attributes Description
arg geo.mapInteractor <optional>

If specified, the map interactor to set.

Returns:

The current map interactor or the map object.

Type
geo.mapInteractor | this

layers()

Description:
Source:

listSceneObjects(objectsopt) → {Array.<geo.sceneObject>}

Description:
  • Get a sorted list of geo.sceneObject including all children. The list always includes specified objects. Children immediately follow their parents. Siblings may be separated by children of preceding siblings.

Source:
Parameters:
Name Type Attributes Description
objects Array.<geo.sceneObject> <optional>

A list of objects for which the a combined list of dependents is generated. If not specified, the sorted list of layers is used.

Returns:

A list of object and dependents.

Type
Array.<geo.sceneObject>

maxBounds(boundsopt, gcsopt) → {geo.geoBounds|this}

Description:
  • Get/set the maximum view area of the map. If the map wraps, this is the unwrapped area.

Source:
Parameters:
Name Type Attributes Description
bounds geo.geoBounds <optional>

The map bounds.

gcs string | geo.transform | null <optional>

undefined to use the interface gcs, null to use the map gcs, or any other transform. If setting the bounds, they are converted from this gcs to the map projection. The returned bounds are converted from the map projection to this gcs.

Returns:

The map maximum bounds or the map object.

Type
geo.geoBounds | this

modified() → {this}

Description:
  • Update the timestamp to the next global timestamp value.

Source:
Inherited From:
Returns:
Type
this

node() → {object}

Description:
  • Get root DOM node of the map.

Source:
Returns:
Type
object

onIdle(handler) → {this}

Description:
  • Bind a handler that will be called one time when all internal promises are resolved. If there are no outstanding promises, this is invoked synchronously.

Source:
Inherited From:
Parameters:
Name Type Description
handler function

A function taking no arguments.

Returns:
Type
this

origin() → {geo.geoPosition}

Description:
  • Get the map's world coordinate origin in gcs coordinates.

Source:
Returns:
Type
geo.geoPosition

pan(delta, ignoreDiscreteZoomopt, ignoreClampBoundsopt) → {this}

Description:
  • Pan the map by a number of display pixels.

Source:
Parameters:
Name Type Attributes Description
delta object

Amount to pan in display pixels.

Properties
Name Type Description
x number

Horizontal distance on the display.

y number

Vertical distance on the display.

ignoreDiscreteZoom boolean <optional>

If true, ignore the discreteZoom option when determining the new view.

ignoreClampBounds boolean | 'limited' <optional>

If true ignore the clampBoundsX and clampBoundsY options when determining the new view. When 'limited', the clampBoundsX and clampBoundsY options are selectively enforced so that the map will not end up more out of bounds than its current state.

Fires:
Returns:
Type
this

parent(argopt) → {this|geo.sceneObject}

Description:
  • Get/set parent of the object.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
arg geo.sceneObject <optional>

The new parent or undefined to get the current parent.

Returns:
Type
this | geo.sceneObject

removeChild(child) → {this}

Description:
  • Remove a child (or array of children) from the object.

Source:
Inherited From:
Parameters:
Name Type Description
child geo.object | Array.<geo.object>

A child object or array of child objects.

Returns:
Type
this

removePromise(promise) → {this}

Description:
  • Remove the promise here and also propagate up the scene tree.

Source:
Inherited From:
Parameters:
Name Type Description
promise Promise

A promise object.

Returns:
Type
this

rotatedSize() → {geo.screenSize}

Description:
  • Get the rotated size of the map. This is the width and height of the non-rotated area necessary to enclose the rotated area in pixels.

Source:
Returns:

The size that fits the rotated map.

Type
geo.screenSize

rotation(rotationopt, originopt, ignoreRotationFuncopt) → {number|this}

Description:
  • Get/set the map rotation. The rotation is performed around the current view center. Rotation mostly ignores clampBoundsX, as the behavior feels peculiar otherwise.

Source:
Parameters:
Name Type Attributes Description
rotation number <optional>

Absolute angle in radians (positive is clockwise).

origin object <optional>

If specified, rotate about this origin.

Properties
Name Type Description
geo geo.geoPosition

The gcs coordinates of the rotation center.

map geo.screenPosition

The display coordinates of the rotation center.

ignoreRotationFunc boolean <optional>

If true, don't constrain the rotation.

Fires:
Returns:
Type
number | this

scheduleAnimationFrame(callback, actionopt) → {number}

Description:
  • Instead of each function using window.requestAnimationFrame, schedule all such frames through this function. This allows the callbacks to be reordered or removed as needed and reduces overhead in Chrome a small amount. Also, if the animation queue is shared between map instances, the callbacks will be called in a single time slice, providing better synchronization.

Source:
Parameters:
Name Type Attributes Default Description
callback function

Function to call during the animation frame. It is called with an animation epoch, exactly as requestAnimationFrame.

action boolean | 'remove' <optional>
false

Falsy to only add the callback if it is not already scheduled. 'remove' to remove the callback (use this instead of cancelAnimationFrame). Any other truthy value moves the callback to the end of the list.

Returns:

An integer as returned by window.requestAnimationFrame.

Type
number

screenshot(layersopt, typeopt, encoderOptionsopt, optsopt) → {jQueryDeferred}

Description:
  • Get a screen-shot of all or some of the canvas layers of map. Note that webGL layers are rerendered, even if window.overrideContextAttributes.preserveDrawingBuffer = true; is set before creating the map object. Chrome, at least, may not keep the drawing buffers if the tab loses focus (and returning focus won't necessarily rerender).

Source:
Parameters:
Name Type Attributes Default Description
layers geo.layer | Array.<geo.layer> | false | object <optional>

Either a layer, a list of layers, falsy to get all layers, or an object that contains optional values of layers, type, encoderOptions, and additional values listed in the opts parameter (this last form allows a single argument for the function).

type string <optional>
'image/png'

See canvas.toDataURL. Use 'canvas' to return the canvas element (this can be used to get the results as a blob, which can be faster for some operations but is not supported as widely).

encoderOptions number <optional>

See canvas.toDataURL.

opts object <optional>

Additional screenshot options.

Properties
Name Type Attributes Default Description
background false | string | CanvasRenderingContext2D.fillStyle <optional>
'white'

If false or null, don't prefill the background. Otherwise, a css color or CanvasRenderingContext2D.fillStyle to fill the initial canvas. This could match the background of the browser page, for instance.

wait boolean | 'idle' <optional>
false

If 'idle', wait for the map to be idle and one additional animation frame to occur. If truthy, wait for an animation frame to occur. Otherwise, take the screenshot as soon as possible.

attribution boolean | null <optional>
null

If null or unspecified, include the attribution only if all layers are used. If false, never include the attribution. If true, always include it.

html Array.<HTMLElement> | Array.<string> <optional>

A list of additional HTML elements, selectors, or jQuery elements to render on top of the map. These are rendered in order, with the last one topmost.

Fires:
Returns:

A jQuery Deferred object. The done function receives either a data URL or an HTMLCanvasElement with the result.

Type
jQueryDeferred

size(argopt) → {geo.screenSize|this}

Description:
  • Get or set the size of the map.

Source:
Parameters:
Name Type Attributes Description
arg geo.screenSize <optional>

Size in pixels.

Fires:
Returns:

The size in pixels or the map object.

Type
geo.screenSize | this

sortedLayers() → {Array.<geo.layer>}

Description:
  • Get the layers contained in the map sorted by zIndex. If two layers have the same zIndex, they are returned in creation order.

Source:
Returns:
Type
Array.<geo.layer>

timestamp() → {number}

Description:
  • Get time.

Source:
Inherited From:
Returns:

The timestamp. This is 0 if the timestamp has never been modified.

Type
number

transition(optsopt, gcsopt, animTimeopt) → {geo.map}

Description:
  • Get the current transition or start an animated zoom/pan/rotate. If a second transition is requested while a transition is already in progress, a new transition is created that is functionally from wherever the map has moved to (possibly partway through the first transition) going to the end point of the new transition.

Source:
Parameters:
Name Type Attributes Description
opts object <optional>

Options for a transition, or undefined to get the current transition.

Properties
Name Type Attributes Default Description
center geo.geoPosition <optional>

A new map center.

zoom number <optional>

A new map zoom level.

zoomOrigin geo.geoPosition <optional>

An origin to use when zooming to a new zoom level.

rotation number <optional>

A new map rotation.

duration number <optional>
1000

Transition duration in milliseconds.

ease function <optional>

Easing function for the transition. This is in the style of a d3 easing function.

interp function <optional>

Function to use when interpolating between values. This gets passed two arrays, the start and end values for [x, y, z or zoom, rotation], and returns a function that, when passed a time value returns an array of the interpolated [x, y, z or zoom, rotation] values.

zCoord boolean <optional>

If true, convert zoom values to z values for interpolation.

done function <optional>

If specified, call this function when a transition completes. The function is called with an object that contains cancel: a boolean if the transition was canceled, source: a value based on what canceled a transition, transition: the current transition that just completed, next: a boolean if another transition follows immediately.

endClamp boolean <optional>
true

If false, the last center change will not clamp to the bounds and zoom values.

gcs string | geo.transform | null <optional>

Input gcs. undefined to use the interface gcs, null to use the map gcs, or any other transform. Applies only to opts.center and to converting zoom values to height, if specified.

animTime number <optional>

The animation frame time (from a window.requestAnimationFrame callback). Used if a new transition is requested because the current transition has completed to keep things synchronized.

Fires:
Returns:
Type
geo.map

transitionCancel(sourceopt) → {boolean}

Description:
  • Cancel any existing transition. The transition will send a cancel event at the next animation frame, but no further activity occurs.

Source:
Parameters:
Name Type Attributes Description
source string <optional>

Optional cause of the cancel. This can be any value, but something like (method name).(action) is recommended to allow other functions to determine the source and cause of the transition being canceled.

Fires:
Returns:

true if a transition was in progress.

Type
boolean

unitsPerPixel(zoomopt, unitopt, nullable) → {number|this}

Description:
  • Get/set the number of world space units per display pixel at the given zoom level.

Source:
Parameters:
Name Type Attributes Default Description
zoom number <optional>
0

The target zoom level.

unit number <optional>
<nullable>

If present, set the unitsPerPixel at the specified zoom level. Otherwise return the current value.

Returns:
Type
number | this

updateAttribution() → {this}

Description:
  • Update the attribution notice displayed on the bottom right corner of the map. The content of this notice is managed by individual layers. This method queries all of the visible layers and joins the individual attribution notices into a single element. By default, this method is called on each of the following events:

    In addition, layers should call this method when their own attribution notices have changed. Users, in general, should not need to call this.

Source:
Returns:

Chainable.

Type
this

worldToDisplay(c) → {geo.screenPosition|Array.<geo.screenPosition>}

Description:
  • Convert from world coordinates to display coordinates using the attached camera.

Source:
Parameters:
Name Type Description
c geo.worldPosition | Array.<geo.worldPosition>

The input coordinate to convert.

Returns:

Display space coordinates.

Type
geo.screenPosition | Array.<geo.screenPosition>

worldToGcs(c, gcsopt) → {geo.geoPosition|Array.<geo.geoPosition>}

Description:
  • Convert from map world coordinates to gcs coordinates.

Source:
Parameters:
Name Type Attributes Description
c geo.worldPosition | Array.<geo.worldPosition>

The input coordinate to convert.

gcs string | geo.transform | null <optional>

output gcs. undefined to use the interface gcs, null to use the map gcs, or any other transform.

Returns:

GCS space coordinates.

Type
geo.geoPosition | Array.<geo.geoPosition>

zoom(valopt, originopt, ignoreDiscreteZoomopt, ignoreClampBoundsopt) → {number|this}

Description:
  • Get/Set zoom level of the map.

Source:
Parameters:
Name Type Attributes Description
val number <optional>

If undefined, return the current zoom level. Otherwise, the new zoom level to set.

origin object <optional>

If present, specifies the center of the zoom; otherwise the map's display center is used.

Properties
Name Type Description
geo geo.geoPosition

The gcs coordinates of the zoom center.

map geo.screenPosition

The display coordinates of the zoom center.

ignoreDiscreteZoom boolean <optional>

If true, ignore the discreteZoom option when determining the new view.

ignoreClampBounds boolean <optional>

If true, ignore the clampBounds option when determining the new view.

Fires:
Returns:
Type
number | this

zoomAndCenterFromBounds(bounds, rotation, gcsopt) → {geo.zoomAndCenter}

Description:
  • Get the center zoom level necessary to display the given bounds.

Source:
Parameters:
Name Type Attributes Description
bounds geo.geoBounds

The requested map bounds. right must be greater than left and bottom must be greater than top in the map's gcs (after conversion from the provided gcs).

rotation number

Rotation in clockwise radians.

gcs string | geo.transform | null <optional>

undefined to use the interface gcs, null to use the map gcs, or any other transform.

Returns:
Type
geo.zoomAndCenter

zoomRange(argopt, noRefreshopt) → {object|this}

Description:
  • Get or set the min/max zoom range.

Source:
Parameters:
Name Type Attributes Description
arg object <optional>

The zoom range.

Properties
Name Type Attributes Description
min number <optional>

The minimum zoom level.

max number <optional>

The maximum zoom level.

noRefresh boolean <optional>

If true, don't update the map if the zoom level has changed.

Returns:

The current zoom range or the map object. The min value is the minimum value that the map can go to based on the current dimensions and settings, the origMin value is the value that was specified via this function or when the map was created.

Type
object | this

(static) create(spec) → {geo.map|null}

Description:
  • Create a map from an object. Any errors in the creation of the map will result in returning null.

Source:
Parameters:
Name Type Description
spec geo.map.createSpec

The map creation specification.

Returns:
Type
geo.map | null

(inner) handleBrowserHidden()

Description:
  • Trigger an event when the browser is hidden or unhidden.

    See geo.map.trackBrowserHidden.

Source:

(inner) layerZIndexSort(a, b) → {number}

Description:
  • Comapare two layers by zIndex. If the zIndex is the same, the order in the parent element is used. If the two layers don't have the same parent (for instance, one layer isn't attached to the map), layers in the map are sorted below detached layers.

Source:
Parameters:
Name Type Description
a geo.layer

First layer to compare.

b geo.layer

Second layer to compare.

Returns:

Positive if a is above b.

Type
number

(inner) trackBrowserHidden(enableopt)

Description:
  • Track when the browser tab is hidden or unhidden.

    Based on https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API as accessed on 2019-10-24.

Source:
Parameters:
Name Type Attributes Description
enable boolean <optional>

If false, remove the event listener.

Type Definitions

createSpec

Description:
  • Specification used with map.create.

Source:
Properties:
Name Type Attributes Default Description
data Array.<object> <optional>
[]

The default data array to apply to each feature if none exists.

layers Array.<geo.layer.spec> <optional>
[]

Layers to create.

node string

DOM selector for the map container.

gcs string | geo.transform <optional>
'EPSG:3857'

The main coordinate system of the map (this is often web Mercator).

ingcs string | geo.transform <optional>
'EPSG:4326'

The default coordinate system of interface calls (this is often latitude and longitude).

unitsPerPixel number <optional>
156543

GCS to pixel unit scaling at zoom 0 (i.e., meters per pixel or degrees per pixel). The actual default is maxBounds.right - maxBounds.left converted to gcs and then divided by 256.

maxBounds object <optional>

The maximum visible map bounds.

Properties
Name Type Attributes Default Description
left number <optional>
-180

The left bound.

right number <optional>
180

The right bound.

bottom number <optional>
-85.06

The bottom bound. The default is actually the left value transformed to the map's gcs coordinate system.

top number <optional>
85.06

The top bound. The default is actually the right value transformed to the map's gcs coordinate system.

gcs number <optional>
ingcs

The coordinate system for the bounds.

zoom number <optional>
4

Initial zoom.

center object <optional>

Initial map center.

Properties
Name Type Default Description
x number 0
y number 0
rotation number <optional>
0

Initial clockwise rotation in radians.

width number <optional>

The map width (default node width).

height number <optional>

The map height (default node height).

min number <optional>
0

Minimum zoom level (though fitting to the viewport may make it so this is smaller than the smallest possible value).

max number <optional>
16

Maximum zoom level.

discreteZoom boolean <optional>
false

If true, only allow integer zoom levels. false for any zoom level.

allowRotation boolean | function <optional>
true

false prevents rotation, true allows any rotation. If a function, the function is called with a rotation (angle in radians) and returns a valid rotation. This can be used to constrain the rotation to a range or specific values.

camera geo.camera <optional>

The camera to control the view.

interactor geo.mapInteractor <optional>

The UI event handler. If undefined, a default interactor is created and used. If null, no interactor is attached to the map.

animationQueue array <optional>

An array used to synchronize animations. If specified, this should be an empty array or the same array as passed to other map instances.

autoResize boolean <optional>
true

Adjust map size on window resize.

clampBoundsX boolean <optional>
false

Prevent panning outside of the maximum bounds in the horizontal direction.

clampBoundsY boolean <optional>
true

Prevent panning outside of the maximum bounds in the vertical direction.

clampZoom boolean <optional>
true

Prevent zooming out so that the map area is smaller than the window.

autoshareRenderer boolean | string <optional>

If specified, pass this value to layers when they are created. See geo.layer.spec#autoshareRenderer for valid values.

Specification used with map.create.

Type:

spec

Description:
  • Map specification.

Source:
Properties:
Name Type Attributes Default Description
node string

DOM selector for the map container.

gcs string | geo.transform <optional>
'EPSG:3857'

The main coordinate system of the map (this is often web Mercator).

ingcs string | geo.transform <optional>
'EPSG:4326'

The default coordinate system of interface calls (this is often latitude and longitude).

unitsPerPixel number <optional>
156543

GCS to pixel unit scaling at zoom 0 (i.e., meters per pixel or degrees per pixel). The actual default is maxBounds.right - maxBounds.left converted to gcs and then divided by 256.

maxBounds object <optional>

The maximum visible map bounds.

Properties
Name Type Attributes Default Description
left number <optional>
-180

The left bound.

right number <optional>
180

The right bound.

bottom number <optional>
-85.06

The bottom bound. The default is actually the left value transformed to the map's gcs coordinate system.

top number <optional>
85.06

The top bound. The default is actually the right value transformed to the map's gcs coordinate system.

gcs number <optional>
ingcs

The coordinate system for the bounds.

zoom number <optional>
4

Initial zoom.

center object <optional>

Initial map center.

Properties
Name Type Default Description
x number 0
y number 0
rotation number <optional>
0

Initial clockwise rotation in radians.

width number <optional>

The map width (default node width).

height number <optional>

The map height (default node height).

min number <optional>
0

Minimum zoom level (though fitting to the viewport may make it so this is smaller than the smallest possible value).

max number <optional>
16

Maximum zoom level.

discreteZoom boolean <optional>
false

If true, only allow integer zoom levels. false for any zoom level.

allowRotation boolean | function <optional>
true

false prevents rotation, true allows any rotation. If a function, the function is called with a rotation (angle in radians) and returns a valid rotation. This can be used to constrain the rotation to a range or specific values.

camera geo.camera <optional>

The camera to control the view.

interactor geo.mapInteractor <optional>

The UI event handler. If undefined, a default interactor is created and used. If null, no interactor is attached to the map.

animationQueue array <optional>

An array used to synchronize animations. If specified, this should be an empty array or the same array as passed to other map instances.

autoResize boolean <optional>
true

Adjust map size on window resize.

clampBoundsX boolean <optional>
false

Prevent panning outside of the maximum bounds in the horizontal direction.

clampBoundsY boolean <optional>
true

Prevent panning outside of the maximum bounds in the vertical direction.

clampZoom boolean <optional>
true

Prevent zooming out so that the map area is smaller than the window.

autoshareRenderer boolean | string <optional>

If specified, pass this value to layers when they are created. See geo.layer.spec#autoshareRenderer for valid values.

Map specification.

Type:
  • object