Search

Data Formats

Concepts in MapWeave are described as plain JavaScript objects whose properties configure its state.

The formats below describe the data structures used to define concepts in MapWeave.

CompassPoint

CompassPoint "n" | "ne" | "e" | "se" | "s" | "sw" | "w" | "nw"

The direction as shown on a compass.

FitBoundsOptions

The options for fitting the map to a provided bounding box.

Defines the bounds to be shown on the map. Set the values manually or get values using the getBounds() layer methods.

padding

optional
number default: auto

The padding to apply to the map around the defined bounds in pixels. If not specified, defaults to a value equal to 1/8th of the minimum screen width or height.

time

optional
number default: 0

The time of the animation in milliseconds.

FlyToOptions

The configuration for flying the map to a specific view.

bearing

optional
number

The bearing at the end of the fly to animation. If not set, preserves the previous viewState.

pitch

optional
number

The pitch at the end of the fly to animation. If not set, preserves the previous viewState.

time

optional
number default: 1000

The duration of the fly to animation in milliseconds.

zoom

optional
number

The zoom level at the end of the fly to animation. If not set, preserves the previous viewState.

Gradient

Gradient Record<number, string>

An object used to specify a set of color stops that defines a color gradient. The key is a number between 0 and 1, specifying the position of the color stop. The value is a string defining the color for that position.

const colorGradient = {
  0: '#30C5D2',
  0.5: '#743C9E',
  1: '#290F85',
};

LngLatAlt

Defines longitude and latitude in degrees from the Greenwich meridian and the equator respectively. Altitude is defined as meters above sea level.

number

Altitude of a geographic position in meters.

number

Latitude of a geographic position in degrees [-90°, 90°].

Longitude of a geographic position in degrees [-180°, 180°].

LngLatBounds

Defines a rectangle on the map by the southwest and northeast corners.

The northeast corner of the bounding rectangle.

The southwest corner of the bounding rectangle.

LngLatObject

An object that defines longitude and latitude in degrees from the Greenwich meridian and the equator respectively.

number

Latitude of a geographic position in degrees [-90°, 90°].

Longitude of a geographic position in degrees [-180°, 180°].

PointerEventItem

PointerEventItem ObservationsItem | NetworkItem | Feature

Defines the item in the layer targeted by pointer events.

SizedViewState

An object describing the view of the map returned by MapWeave.

number

The bearing (rotation) of the map, in degrees. Set to 0 for north to be top center of the view.

number

Height of the viewport in pixels.

number

The latitude of the center of the map.

The longitude of the center of the map.

number

The pitch (tilt) of the map, in degrees. Set to 0 to view the map directly from above.

number

Width of the viewport in pixels.

number

The zoom level of the map.

TimeRange

Defines a time interval with a start and an end.

number | Date

The end of the time range as a Date in local time or a millisecond number in UTC.

number | Date

The start of the time range as a Date in local time or a millisecond number in UTC.

ViewState

An object to specify the view of the map.

bearing

optional
number

The bearing (rotation) of the map, in degrees. Set to 0 for north to be top center of the view.

latitude

optional
number

The latitude of the center of the map.

longitude

optional
number

The longitude of the center of the map.

pitch

optional
number

The pitch (tilt) of the map, in degrees. Set to 0 to view the map directly from above.

zoom

optional
number

The zoom level of the map.

Terms of use

These terms do not alter or supersede any existing agreements between you (or your employer) and us.

By accessing or using any Content you agree to be bound by these Terms of Use. Please review these terms carefully before using the website.

The contents of this website, including but not limited to any text, code samples, API references, schemas, interactive tools, and other materials (collectively, the 'Content'), are made available for informational and internal evaluation purposes only. All intellectual property rights in the Content are reserved. No licence is granted to use the Content for any commercial purpose, or to copy, distribute, modify, reverse-engineer, or incorporate any part of the Content into any product or service, without our prior written consent.

This Content is provided “as is” and “as available,” without any representations, warranties, or guarantees of any kind, whether express or implied, including but not limited to implied warranties of merchantability, fitness for a particular purpose, non-infringement, or accuracy. To the fullest extent permitted by applicable law, we expressly exclude and disclaim all implied warranties, conditions, and other terms that might otherwise be implied.

We disclaim all liability for any loss or damage, whether direct, indirect, incidental, consequential, or otherwise, arising from any reliance placed on the Content or from your use of it, to the fullest extent permitted by applicable law. By continuing to access or use the Content, you acknowledge and agree to these terms.