osmLayer

geo. osmLayer

new osmLayer(argopt)

Description:
  • Create a new instance of osmLayer. This is a geo.tileLayer with an OSM url and attribution defaults and with the tiles centered on the origin.

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

Specification for the layer.

Extends

Members

activeTiles

Description:
  • Readonly accessor to the active tile mapping. This is an object containing all currently drawn tiles (hash(tile) => tile).

Source:
Inherited From:
Properties:
Name Type Description
activeTiles object

The keys are hash(tile) and the values are tiles.

Readonly accessor to the active tile mapping. This is an object containing all currently drawn tiles (hash(tile) => tile).

cache

Description:
  • Readonly accessor to the tile cache object.

Source:
Inherited From:
Properties:
Name Type Description
cache geo.tileCache

The tile cache object.

Readonly accessor to the tile cache object.

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.

(protected) newLayerId

Description:
  • Gets a new id number for a layer.

Source:
Inherited From:

Gets a new id number for a layer.

options

Description:
  • Readonly accessor to the options object.

Source:
Inherited From:
Properties:
Name Type Description
options object

A copy of the options object.

Readonly accessor to the options object.

queue

Description:
  • Get/set the queue object.

Source:
Inherited From:
Properties:
Name Type Description
queue geo.fetchQueue

The current queue.

Get/set the queue object.

queueSize

Description:
  • Get/set the queue size.

Source:
Overrides:
Properties:
Name Type Description
size number

The queue size.

Get/set the queue size.

reference

Description:
  • Get/set the tile reference value.

Source:
Inherited From:
Properties:
Name Type Description
reference string

A reference value to distinguish tiles on this layer.

Get/set the tile reference value.

(static) defaults

Description:
  • This object contains the default options used to initialize the osmLayer.

Source:

This object contains the default options used to initialize the osmLayer.

(static) tileSources :object

Description:
  • This is a list of known tile sources. It can be added to via geo.osmLayer.tilesource[<key>] = <object>, where the object has url, attribution, subdomains, minLevel, and maxLevel defined.

Source:

This is a list of known tile sources. It can be added to via geo.osmLayer.tilesource[<key>] = <object>, where the object has url, attribution, subdomains, minLevel, and maxLevel defined.

Type:
  • object

Methods

active(argopt) → {boolean|this}

Description:
  • Get/Set whether or not the layer is active. An active layer will receive native mouse when the layer is on top. Non-active layers will never receive native mouse events.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
arg boolean <optional>

If specified, the new active value.

Returns:
Type
boolean | this

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

addFeature(feature) → {this}

Description:
  • Add a feature to the layer if it is not already present.

Source:
Inherited From:
Parameters:
Name Type Description
feature object

the feature to add.

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

attribution(argnullable) → {string|this}

Description:
  • Get or set the attribution html content that will displayed with the layer. By default, nothing will be displayed. Note, this content is not html escaped, so care should be taken when rendering user provided content.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
arg string <nullable>

An html fragment

Returns:

Chainable as a setter

Type
string | this

autoshareRenderer() → {boolean|string}

Description:
  • Get the setting of autoshareRenderer.

Source:
Inherited From:
Returns:
Type
boolean | string

canvas() → {HTMLCanvasElement}

Description:
  • Get canvas of the layer.

Source:
Inherited From:
Returns:

The canvas element associated with the layer.

Type
HTMLCanvasElement

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>

clear() → {Array.<geo.tile>}

Description:
  • Remove all active tiles from the canvas.

Source:
Inherited From:
Returns:

The array of tiles removed.

Type
Array.<geo.tile>

createFeature(featureName, arg) → {geo.feature}

Description:
  • Create a feature by name.

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

The name of the feature to create.

arg object

Properties for the new feature.

Returns:

The created feature.

Type
geo.feature

dataTime() → {geo.timestamp}

Description:
  • Return last time data got changed.

Source:
Inherited From:
Returns:

The data time.

Type
geo.timestamp

deleteFeature(feature) → {this}

Description:
  • Delete feature.

Source:
Inherited From:
Parameters:
Name Type Description
feature geo.feature

The feature to delete.

Returns:
Type
this

displayToLevel(ptopt, zoomopt) → {object}

Description:
  • Convert display pixel coordinates (where (0,0) is the upper left) to layer pixel coordinates (typically (0,0) is the center of the map and the upper-left has the most negative values). By default, this is done at the current base zoom level.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
pt object <optional>

The point to convert with x and y. If undefined, use the center of the display.

zoom number <optional>

If specified, the zoom level to use.

Returns:

The point in level coordinates with x and y.

Type
object

draw() → {this}

Description:
  • Draw. If the layer is visible, call the parent class's draw function and the renderer's render function.

Source:
Inherited From:
Returns:
Type
this

drawTile(tile)

Description:
  • Draw the given tile on the active canvas .

Source:
Inherited From:
Parameters:
Name Type Description
tile geo.tile

The tile to draw.

features(valopt) → {Array.<geo.feature>|this}

Description:
  • Get/Set drawables.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
val Array.<geo.feature> <optional>

A list of features, or unspecified to return the current feature list. If a list is provided, features are added or removed as needed.

Returns:

The current features associated with the layer or the current layer.

Type
Array.<geo.feature> | this

fromLevel(coord, level) → {object}

Description:
  • Convert a coordinate from pixel coordinates at the given zoom level to world coordinates.

Source:
Inherited From:
Parameters:
Name Type Description
coord object
Properties
Name Type Description
x number

The offset in pixels (level 0) from the left edge.

y number

The offset in pixels (level 0) from the bottom edge.

level number

The zoom level of the source coordinates.

Returns:

World coordinates with x and y.

Type
object

fromLocal(pt, zoom) → {object}

Description:
  • Compute world coordinates from the given local coordinates. The tile layer uses units of pixels relative to the world space coordinate origin.

Source:
Inherited From:
Parameters:
Name Type Description
pt object

A point in world space coordinates with x and y.

zoom number | undefined

If unspecified, use the map zoom.

Returns:

Local coordinates with x and y.

Type
object

gcs(argopt) → {string|this}

Description:
  • Get or set the layer gcs. This defaults to the map's gcs.

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

If undefined, return the current gcs. Otherwise, a new value for the gcs. If null, use the map's gcs.

Returns:

A string used by geo.transform.

Type
string | this

gcsFeatures(valopt, nullable) → {string|this}

Description:
  • Get or set the gcs for all features. For features, the default is usually the map's ingcs.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
val string <optional>
<nullable>

If undefined, return the current gcs. If null, use the map's interface gcs. Otherwise, set a new value for the gcs. When getting the current gcs, if not all features have the same gcs, undefined will be returned.

Returns:

A string used by geo.transform. If the map interface gcs is in use, that value will be returned. If the gcs is set, return the current class instance.

Type
string | this

gcsTileBounds(indexOrTile, gcsopt) → {object}

Description:
  • Returns a tile's bounds in a gcs.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
indexOrTile object | geo.tile

Either a tile or an object with {x, y, level}` specifying a tile.

gcs string | geo.transform | null <optional>

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

Returns:

The tile bounds in the specified gcs.

Type
object

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

height() → {number}

Description:
  • Return the height of the layer in pixels.

Source:
Inherited From:
Returns:

The height of the parent map in pixels.

Type
number

id(valopt) → {string|this}

Description:
  • Get/Set id of the layer.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
val string | null <optional>

If null, generate a new layer id. Otherwise, if specified, the new id of the layer.

Returns:
Type
string | this

initialized(valopt) → {boolean|this}

Description:
  • Get/Set if the layer has been initialized.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
val boolean <optional>

If specified, update the initialized value. Otherwise, return the current instance.

Returns:

Either the initialized value or this.

Type
boolean | this

isValid(index) → {boolean}

Description:
  • Returns true if the given tile index is valid:

    • min level <= level <= max level
    • 0 <= x <= 2^level - 1
    • 0 <= y <= 2^level - 1 If the layer wraps, the x and y values may be allowed to extend beyond these values.
Source:
Inherited From:
Parameters:
Name Type Description
index object

The tile index.

Properties
Name Type Description
x number
y number
level number
Returns:
Type
boolean

map() → {geo.map}

Description:
  • Get the map associated with this layer.

Source:
Inherited From:
Returns:

The map associated with the layer.

Type
geo.map

modified() → {this}

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

Source:
Inherited From:
Returns:
Type
this

moveDown(nopt) → {this}

Description:
  • Bring the layer below the given number of layers. This will rotate the current z-indices for this and the previous n layers.

Source:
Inherited From:
Parameters:
Name Type Attributes Default Description
n number <optional>
1

The number of positions to move.

Returns:
Type
this

moveToBottom() → {this}

Description:
  • Bring the layer to the bottom of the map layers.

Source:
Inherited From:
Returns:
Type
this

moveToTop() → {this}

Description:
  • Bring the layer to the top of the map layers.

Source:
Inherited From:
Returns:
Type
this

moveUp(nopt) → {this}

Description:
  • Bring the layer above the given number of layers. This will rotate the current z-indices for this and the next n layers.

Source:
Inherited From:
Parameters:
Name Type Attributes Default Description
n number <optional>
1

The number of positions to move.

Returns:
Type
this

name(valopt) → {string|this}

Description:
  • Get/Set name of the layer.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
val string <optional>

If specified, the new name of the layer.

Returns:
Type
string | this

nearestPixel(valopt, skipUpdateopt) → {boolean|number|this}

Description:
  • Get/Set nearestPixel value.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
val boolean | number <optional>

If not specified, return the current value. If true, image quads are rendered with near-neighbor sampling. If false, with interpolated sampling. If a number, interpolate at that zoom level or below and nearest neighbor at that zoom level or above.

skipUpdate boolean <optional>

If specifying val and this value is truthy, don't update the layer or mark it as modified.

Returns:
Type
boolean | number | this

node() → {HTMLDivElement}

Description:
  • Get root node of the layer.

Source:
Inherited From:
Returns:
Type
HTMLDivElement

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

opacity(opacityopt) → {number|this}

Description:
  • Get or set the current layer opacity. The opacity is in the range [0-1]. An opacity of 0 is not the same as setting visible(false), as interactions can still occur with the layer.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
opacity number <optional>

If specified, set the opacity. Otherwise, return the opacity.

Returns:

The current opacity or the current layer.

Type
number | 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

prefetch(level, bounds) → {jQuery.Deferred}

Description:
  • Prefetches tiles up to a given zoom level around a given bounding box.

Source:
Inherited From:
Parameters:
Name Type Description
level number

The zoom level.

bounds geo.geoBounds

The map bounds.

Returns:

resolves when all of the tiles are fetched.

Type
jQuery.Deferred

remove(tile) → {geo.tile}

Description:
  • Remove the given tile from the canvas and the active cache.

Source:
Inherited From:
Parameters:
Name Type Description
tile geo.tile | string

The tile (or hash) to remove.

Returns:

The tile removed from the active layer.

Type
geo.tile

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

removeFeature(feature) → {this}

Description:
  • Remove a feature without destroying it.

Source:
Inherited From:
Parameters:
Name Type Description
feature geo.feature

The feature to remove.

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

renderer() → {geo.renderer}

Description:
  • Get the renderer for the layer.

Source:
Inherited From:
Returns:

The renderer associated with the layer or null if there is no renderer.

Type
geo.renderer

rendererName() → {string}

Description:
  • Get the name of the renderer.

Source:
Inherited From:
Returns:
Type
string

reset() → {this}

Description:
  • Reset the layer to the initial state, clearing the canvas and resetting the tile cache.

Source:
Inherited From:
Returns:
Type
this

selectionAPI(valopt) → {boolean|this}

Description:
  • Get/Set selectionAPI of the layer.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
val boolean <optional>

If specified change the selectionAPI state of the layer, otherwise return the current state.

Returns:

The selectionAPI state or the current layer.

Type
boolean | this

source(sourceopt) → {string|undefined|this}

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

The name of a defined tile source or undefined get the current named tile source, if any.

Returns:

Either the name of the current tile source, if any. Returns this when setting the source.

Type
string | undefined | this

sticky() → {boolean}

Description:
  • Get whether or not the layer is sticky (navigates with the map).

Source:
Inherited From:
Returns:
Type
boolean

subdomains(subdomainsopt) → {string|Array.<string>|this}

Description:
  • Get or set the subdomains used for templating.

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

A comma-separated list, a string of single character subdomains, or a list.

Returns:
Type
string | Array.<string> | this

tileAtPoint(point, level) → {object}

Description:
  • Returns the tile indices at the given point.

Source:
Inherited From:
Parameters:
Name Type Description
point object

The coordinates in pixels relative to the map origin.

Properties
Name Type Description
x number
y number
level number

The target zoom level.

Returns:

The tile indices. This has x and y properties.

Type
object

tileCropFromBounds(tile) → {object}

Description:
  • Get the crop values for a tile based on the tilesMaxBounds function. Returns undefined if the tile should not be cropped.

Source:
Inherited From:
Parameters:
Name Type Description
tile object

The tile to compute crop values for.

Returns:

Either undefined or an object with x and y values which is the size in pixels for the tile.

Type
object

tilesAtZoom(level) → {object}

Description:
  • The number of tiles at the given zoom level. The default implementation just returns Math.pow(2, z).

Source:
Inherited From:
Parameters:
Name Type Description
level number

A zoom level.

Returns:

The number of tiles in each axis in the form {x: nx, y: ny}.

Type
object

tilesMaxBounds(level) → {object}

Description:
  • The maximum tile bounds at the given zoom level, or null if no special tile bounds.

Source:
Inherited From:
Parameters:
Name Type Description
level number

A zoom level.

Returns:

The maximum tile bounds in pixels for the specified level, or null if none specified ({x: width, y: height}).

Type
object

timestamp() → {number}

Description:
  • Get time.

Source:
Inherited From:
Returns:

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

Type
number

toLevel(coord, level) → {object}

Description:
  • Convert a coordinate from layer coordinates to pixel coordinates at the given zoom level.

Source:
Inherited From:
Parameters:
Name Type Description
coord object
Properties
Name Type Description
x number

The offset in pixels (level 0) from the left edge.

y number

The offset in pixels (level 0) from the bottom edge.

level number

The zoom level of the new coordinates.

Returns:

The pixel coordinates with x and y.

Type
object

toLocal(pt, zoomopt) → {object}

Description:
  • Compute local coordinates from the given world coordinates. The tile layer uses units of pixels relative to the world space coordinate origin.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
pt object

A point in world space coordinates with x and y.

zoom number <optional>

If unspecified, use the map zoom.

Returns:

Local coordinates with x and y.

Type
object

updateTime() → {geo.timestamp}

Description:
  • Return the modified time for the last update that did something.

Source:
Inherited From:
Returns:

The update time.

Type
geo.timestamp

url(urlopt) → {string|function|this}

Description:
  • Get or set the tile url string or function. If changed, load the new tiles.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
url string | function <optional>

The new tile url.

Returns:
Type
string | function | this

visible(valopt) → {boolean|this}

Description:
  • Get/Set visibility of the layer.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
val boolean <optional>

If unspecified, return the visibility, otherwise set it.

Returns:

Either the visibility (if getting) or the layer (if setting).

Type
boolean | this

width() → {number}

Description:
  • Return the width of the layer in pixels.

Source:
Inherited From:
Returns:

The width of the parent map in pixels.

Type
number

zIndex(zIndexopt, allowDuplicateopt) → {number|this}

Description:
  • Get or set the z-index of the layer. The z-index controls the display order of the layers in much the same way as the CSS z-index property.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
zIndex number <optional>

The new z-index, or undefined to return the current z-index.

allowDuplicate boolean <optional>

When setting the z index, if this is truthy, allow other layers to have the same z-index. Otherwise, ensure that other layers have distinct z-indices from this one.

Returns:
Type
number | this

Type Definitions

spec

Description:
  • Object specification for an OSM layer.

Source:
Properties:
Name Type Attributes Default Description
mapOpacity number <optional>

If specified, and opacity is not specified, use this as the layer opacity.

source string <optional>

If specified, use the predefined tile source (see geo.osmLayer.tileSources).

crossDomain string <optional>
'anonymous'

Image CORS attribute. This is used for the crossorigin property when loading images.

minLevel number <optional>
0

The minimum zoom level available.

maxLevel number <optional>
18

The maximum zoom level available.

tileOverlap object <optional>

Pixel overlap between tiles.

Properties
Name Type Attributes Description
x number <optional>

Horizontal overlap.

y number <optional>

Vertical overlap.

tileWidth number <optional>
256

The tile width without overlap.

tileHeight number <optional>
256

The tile height without overlap.

tilesAtZoom function <optional>
null

A function that is given a zoom level and returns {x: (num), y: (num)} with the number of tiles at that zoom level.

cacheSize number <optional>
600

The maximum number of tiles to cache. The default is 200 if keepLower is false.

queue geo.fetchQueue <optional>

A fetch queue to use. If unspecified, a new queue is created.

queueSize number <optional>
6

The queue size. Most browsers make at most 6 requests to any domain, so this should be no more than 6 times the number of subdomains used.

initialQueueSize number <optional>
0

The initial queue size. 0 to use the queue size. When querying a tile server that needs to load information before serving the first tile, having an initial queue size of 1 can reduce the load on the tile server. After the initial queue of tiles are loaded, the queueSize is used for all additional queries unless the initialQueueSize is set again or the tile cache is reset.

keepLower boolean <optional>
true

When truthy, keep lower zoom level tiles when showing high zoom level tiles. This uses more memory but results in smoother transitions.

wrapX boolean <optional>
true

Wrap in the x-direction.

wrapY boolean <optional>
false

Wrap in the y-direction.

url string | function <optional>
null

A function taking the current tile indices (x, y, level, subdomains) and returning a URL or jquery ajax config to be passed to the {geo.tile} constructor. Example:

(x, y, z, subdomains) => "http://example.com/z/y/x.png"

If this is a string, a template url with {x}, {y}, {z}, and {s} as template variables. {s} picks one of the subdomains parameter and may contain a comma-separated list of subdomains.

subdomains string | Array.<string> <optional>
"abc"

Subdomains to use in template url strings. If a string, this is converted to a list before being passed to a url function.

baseUrl string <optional>
null

If defined, use the old-style base url instead of the url parameter. This is functionally the same as using a url of baseUrl/{z}/{x}/{y}.(imageFormat || png). If the specified string does not end in a slash, one is added.

imageFormat string <optional>
'png'

This is only used if a baseUrl is specified, in which case it determines the image name extension used in the url.

animationDuration number <optional>
0

The number of milliseconds for the tile loading animation to occur. Only some renderers support this.

attribution string <optional>

An attribution to display with the layer (accepts HTML).

tileRounding function <optional>
Math.round

This function determines which tiles will be loaded when the map is at a non-integer zoom. For example, Math.floor, will use tile level 2 when the map is at zoom 2.9.

tileOffset function <optional>

This function takes a zoom level argument and returns, in units of pixels, the coordinates of the point (0, 0) at the given zoom level relative to the bottom left corner of the domain.

tilesMaxBounds function <optional>
null

This function takes a zoom level argument and returns an object with x and y in pixels which is used to crop the last row and column of tiles. Note that if tiles wrap, only complete tiles in the wrapping direction(s) are supported, and this max bounds will probably not behave properly.

topDown boolean <optional>
false

True if the gcs is top-down, false if bottom-up (the ingcs does not matter, only the gcs coordinate system). When falsy, this inverts the gcs y-coordinate when calculating local coordinates.

idleAfter string <optional>
'view'

Consider the layer as idle once a specific set of tiles is loaded. 'view' is when all tiles in view are loaded. 'all' is when tiles in view and tiles that were once requested have been loaded (this corresponds to having all network activity finished).

baseQuad object <optional>

A quad feature element to draw before below any tile layers. If specified, this uses the quad defaults, so this is a geo.quadFeature.position object with, typically, an image property added to it. The quad positions are in the map gcs coordinates.

nearestPixel boolean | number <optional>

If true, image quads are rendered with near-neighbor sampling. If false, with interpolated sampling. If a number, interpolate at that zoom level or below and nearest neighbor at that zoom level or above.

id number <optional>

The id of the layer. Defaults to a increasing sequence.

map geo.map <optional>
null

Parent map of the layer.

renderer string | geo.renderer <optional>

Renderer to associate with the layer. If not specified, either annotations or features can be used to determine the renderer. If a geo.renderer instance, the renderer is not recreated; not all renderers can be shared by multiple layers.

autoshareRenderer boolean | string <optional>
true

If truthy and the renderer supports it, auto-share renderers between layers. Currently, auto-sharing can only occur for webgl renderers and adjacent layers. If true, sharing will only occur if the layers have the same opacity and it is 1 or 0 and any tile layers are below non-tile layers. If "more", sharing will occur for any adjacent layers that have the same opacity. Shared renderers has slightly different behavior than non-shared renderers: changing z-index may result in rerendering and be slightly slower; only one DOM canvas is used for all shared renderers. Some features have slight z-stacking differences in shared versus non-shared renderers.

canvas HTMLElement <optional>

If specified, use this canvas rather than a canvas associaied with the renderer directly. Renderers may not support sharing a canvas.

annotations Array.<string> | object <optional>

A list of annotations that will be used on this layer, used to select a renderer. Instead of a list, if this is an object, the keys are the annotation names, and the values are each a list of modes that will be used with that annotation. See featuresForAnnotations more details. This is ignored if renderer is specified.

features Array.<string> <optional>

A list of features that will be used on this layer, used to select a renderer. Features are the basic feature names (e.g., 'quad'), or the feature name followed by a required capability (e.g., 'quad.image'). This is ignored if renderer or annotations is specified.

active boolean <optional>
true

Truthy if the layer has the active css class and may receive native mouse events.

opacity number <optional>
1

The layer opacity on a scale of [0-1].

name string <optional>
''

A name for the layer for user convenience. If specified, this is also the id property of the containing DOM element.

selectionAPI boolean <optional>
true

Truthy if the layer can generate selection and other interaction events.

sticky boolean <optional>
true

Truthy if the layer should navigate with the map.

visible boolean <optional>
true

Truthy if the layer is visible.

zIndex number <optional>

The z-index to assign to the layer (defaults to the index of the layer inside the map).

Object specification for an OSM layer.

Type: