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
Gradient
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.
Properties
Altitude of a geographic position in meters.
Longitude of a geographic position in degrees [-180°, 180°].
Latitude of a geographic position in degrees [-90°, 90°].
PointerEventItem
Defines the item in the layer targeted by pointer events.
SizedViewState
An object describing the view of the map returned by MapWeave.
Properties
The bearing (rotation) of the map, in degrees. Set to 0
for north to be top center of the view.
Height of the viewport in pixels.
The latitude of the center of the map.
The longitude of the center of the map.
The pitch (tilt) of the map, in degrees. Set to 0
to view the map directly from above.
Width of the viewport in pixels.
The zoom level of the map.
TimeRange
Defines a time interval with a start and an end.
Properties
The end of the time range as a Date
in local time or a millisecond number in UTC.
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.
Properties
The bearing (rotation) of the map, in degrees. Set to 0
for north to be top center of the view.
The latitude of the center of the map.
The longitude of the center of the map.
The pitch (tilt) of the map, in degrees. Set to 0
to view the map directly from above.
The zoom level of the map.