HTMLElement used to create the map display
options to configure for the map
Adds an event listener to the map. supported events: 'mapviewchangestart', 'mapviewchange', 'mapviewchangeend', 'resize', 'tap', 'dbltap', 'pointerup', 'pointerenter', 'pointerleave', 'pointerdown', 'pointermove', 'pressmove'
A string representing the event type to listen for.
the listener function that will be called when an event of the specific type occurs
Adds a layer to the map.
If an index
is provided, the layer will be inserted at the specified position within the layer hierarchy,
which allows placing the layer between existing layers. If the index
is not specified, the layer will be
added on top of all existing layers (i.e., as the last layer in the hierarchy).
The index
is zero-based, meaning an index of 0
will insert the layer at the bottom, and an index equal
to the current number of layers will place it on top. If the specified index
exceeds the current number
of layers, the layer will be added on top.
The layer to be added to the map. This can be a TileLayer
or a CustomLayer
.
(Optional) The zero-based index in the layer hierarchy where the layer should be inserted. If omitted, the layer will be added as the topmost layer.
Add an observer to the map. Supported observers are: "zoomlevel", "center", "rotation" and "pitch".
the name of the value to observe
the observer that will be executed on value changes.
boolean that's indicating if observer was added.
Destroy the the map.
Set the map center using a bow animation combining pan and zoom operations.
the geographical coordinate to center the map.
options to configure the bow animation
the duration of the bow animation in milliseconds
Set the map center and zoomlevel using a bow animation combining pan and zoom operations.
the geographical coordinate to center the map.
the zoomlevel the map should be zoomed to.
options to configure the bow animation
the duration of the bow animation in milliseconds
Convert a geographical coordinate to a pixel coordinate relative to the current viewport of the map.
the longitude in degrees
the latitude in degrees
the altitude in meters
the pixel coordinate relative to the current viewport.
Convert a geographical coordinate to a pixel coordinate relative to the current viewport of the map.
the geographical coordinate
the pixel coordinate relative to the current viewport.
Get current active map behavior options.
indicates if map dragging is enabled or disabled.
indicates if map pitching is enabled or disabled.
indicates if map rotation is enabled or disabled.
indicates if map zooming is enabled or disabled.
Get the camera of the current viewport.
The camera's center position in geographical coordinates (world-space).
Get the current geographical center of the map.
the map's geographical center point.
Get the HTMLElement used by the map.
Get most top rendered feature within the given area of map
Point or Rect in pixel to define search area. If a Point is used, width and height must be passed in options parameter.
Describing the options param
The result providing found feature and layer. undefined is returned if nothing is found.
Get rendered features within the given area of map
Point or Rect in pixel to define search area. If a Point is used, width and height must be passed in options parameter.
Describing the options param
zIndex ordered results array
Get the current height in pixels of map.
Gets the current view bounds of the view port.
Get the current width in pixels of map.
Get the current zoom level
the current zoom level of the map
get the current applied lock status of the map.
the current applied lock options.
set lock the viewport of the map. by indicating if panning, minLevel and maxLevel should be locked.
the lock options.
the maximum allowed zoom level that can be zoomed to.
the minimum allowed zoom level that can be zoomed to.
true to enable panning, false to disable panning.
the current applied lock options.
Shift the geographical center of the map in pixels.
distance in pixels to pan the map on x axis
distance in pixels to pan the map on y axis
Set or get map pitch (tilt) in degrees
pitch in degrees
Converts from screen pixel to geo coordinate
the x position on screen in pixel
the y position on screen in pixel
the geographical coordinate
Converts from screen pixel to geo coordinate
the pixel coordinate on screen
the geographical coordinate
Remove a layer from the map.
the layer to remove
Removes an observer from the map.
the name of the value to observe
the observer that should be removed.
boolean that's indicating if observer was removed.
Resize the map view. If no width/height is passed the map will resize automatically to the maximum possible size defined by the HTMLElement.
new width in pixels
new height in pixels
Set or get map rotation along z-axis
set absolute map rotation in degrees
current applied rotation in degrees
Set the background color of the map
the background color to set
Set the map behavior on user interaction.
Behavior options
true to enable map dragging, false to disable.
true to enable map pitching, false to disable.
true to enable map rotation, false to disable.
true to enable map zooming, false to disable.
Enable/Disable a specific map behavior on user interaction. Possible behavior are: "zoom", "drag", "pitch" and "rotate
the behavior that should be disabled or enabled.
true to enable, false to disable
Set view bounds for the map to display.
GeoRect, GeoJson Feature or an GeoJson bbox [minLon, minLat, maxLon, maxLat] defining the view bounds.
animate using a bow animation @see Map.flyTo. true to enable, false to disable.
Set view bounds for the map to display.
GeoRect, GeoJson Feature or an GeoJson bbox [minLon, minLat, maxLon, maxLat] defining the view bounds.
options to configure the bow animation @see Map.flyTo.
the duration of the bow animation in milliseconds
Set zoomlevel with an optional anchor point.
new zoomlevel
x coordinate of fixed anchor point on screen in pixels
y coordinate of fixed anchor point on screen in pixels
zoom transition animation time in milliseconds [default: 0]
Take a snapshot of the current map's viewport.
Callback function that will be called when the requested snapshot has been captured.
x coordinate of the left edge of the capturing rectangle in pixel
y coordinate of the top edge of the capturing rectangle in pixel
width of the capturing rectangle in pixel
height of the capturing rectangle in pixel
Generated using TypeDoc
XYZ Map is a highly customizable WebGL based vector map display that's optimized for map editing, larger raw datasets and frequently changing data.