Properties:

LibreMap

Returns the maplibre map object. After you access the maplibre map object, all the methods and properties of the maplibre-gl library can be applied to it.

Returns:

maplibre map: Returns maplibre map object.

Example:

const maplibretMap = map._internalMap;

_draw

Returns the draw object. Using this object, you can access to the complete information of the drawings. All new drawing capabilities, access to attributes of drawn features such as area of polygons or length of lines are available in this object.

Returns:

Object: Returns draw object.

Example:

const draw = map._draw;

Methods:

getFeatureLayers()

Returns an array of created feature layers.

Returns:

Array: Returns an array of feature layers.

Example:

const featureLayers = await map.getFeatureLayers();

getRasterLayers()

Returns an array of created raster layers.

Returns:

Array: Returns an array of raster layers and mosaic layers.

Example:

const featureLayers = await map.getFeatureLayers();

addScaleControl()

Adds scale control to the map.

Returns:

String: Returns a message that shows adding scale control was successful or not. Null message means adding was successful.

Example:

const result = await map.addScaleControl();

removeScaleControl()

Removes scale control from the map.

Returns:

String: Returns a message that shows removing scale control was successful or not. Null message means removing was successful.

Example:

const result = await map.removeScaleControl();

addBaseMaps()

Adds base maps to the map.

Returns:

String: Returns a message that shows adding base maps was successful or not. Null message means adding was successful.

Example:

const result = await map.addBaseMaps();

removeBaseMaps()

Removes base maps from the map.

Returns:

String: Returns a message that shows removing base maps was successful or not. Null message means removing was successful.

Example:

const result = await map.removeBaseMaps();

addSearchBar()

Adds search bar to the map.

Returns:

String: Returns a message that shows adding search bar was successful or not. Null message means adding was successful.

Example:

const result = await map.addSearchBar();

removeSearchBar()

Removes search bar from the map.

Returns:

String: Returns a message that shows removing search bar was successful or not. Null message means removing was successful.

Example:

const result = await map.removeSearchBar();

addCoordinatesViewer()

Adds a panel to the map to show coordinates in UTM or geographic coordinate system.

Returns:

String: Returns a message that shows adding coordinates viewer was successful or not. Null message means adding was successful.

Example:

const result = await map.addCoordinatesViewer();

removeCoordinatesViewer()

Removes coordinates viewer from the map.

Returns:

String: Returns a message that shows removing coordinates viewer was successful or not. Null message means removing was successful.

Example:

const result = await map.removeCoordinatesViewer();

addLegend()

Adds legend to the map.

Returns:

String: Returns a message that shows adding legend was successful or not. Null message means adding was successful.

Example:

const result = await map.addLegend();

removeLegend()

Removes legend from the map.

Returns:

String: Returns a message that shows removing legend was successful or not. Null message means removing was successful.

Example:

const result = await map.removeLegend();

addOverview()

Adds overview map to the map.

Returns:

String: Returns a message that shows adding overview map was successful or not. Null message means adding was successful.

Example:

const result = await map.addOverview();

removeOverview()

Removes overview map from the map.

Returns:

String: Returns a message that shows removing overview map was successful or not. Null message means removing was successful.

Example:

const result = await map.removeOverview();

addMeasurementTools()

Adds measurement tools to the map.

Returns:

String: Returns a message that shows adding measurement tools was successful or not. Null message means adding was successful.

Example:

const result = await map.addMeasurementTools();

removeMeasurementTools()

Removes measurement tools from the map.

Returns:

String: Returns a message that shows removing measurement tools was successful or not. Null message means removing was successful.

Example:

const result = await map.removeMeasurementTools();

openCoordinatePanel()

Opens a panel to go to xy location.

Returns:

String: Returns a message that shows opening the panel was successful or not. Null message means opening was successful.

Example:

const result = await map.openCoordinatePanel();

zoomToDefaultExtent()

If a map is opened, zooms to map extent saved in geobox studio, if a layer is opened, zooms to layer extent.

Returns:

String: Returns a message that shows zooming was successful or not. Null message means zooming was successful.

Example:

const result = await map.zoomToDefaultExtent();

Leave a comment

Your email address will not be published. Required fields are marked *