JMap.Layer.attributeExists
Returns true if the layer has the given attribute.
The JMap layer id
The JMap attribute name
JMap.Layer.deleteLayer
Deletes the layer in the data store and in the map.
The layer is not deleted server side, but only in the browser.
Use this function if you want to dynamically remove a layer.
The JMap layer id
JMap.Layer.ensureLayerIsVisible
Make sure a layer is visible on the Map. All parent layers will also be made visible
The JMap layer id
JMap.Layer.ensureLayersAreVisible
Make sure that all specified layers are visible on the Map. All parent layers of all Layers will also be made visible
An array of JMap layer ids
JMap.Layer.exists
Returns true if a layer having the id exists.
The JMap layer id
JMap.Layer.getById
Returns the JMap layer having the id.
The JMap layer id
JMap.Layer.getDescription
Returns the descrition of the layer.
The JMap layer id
JMap.Layer.getEPSG4326Extent
Returns the extent of the layer in ESPG:4326 coordinates
With a JMap Cloud server, a call is made to the server.
With a JMap 7 server, no call to server is made, returns the cached extent.
JMap.Layer.getLayerAttribute
Returns the attribute descriptor for a given layer and attribute
The JMap layer id
The JMap attribute name
JMap.Layer.getLayerAttributes
Returns all attribute descriptors for a particuler layer
The JMap layer id
JMap.Layer.getLayerIds
Returns an array with JMap layer ids.
The array order is the same as the one in the tree.
If no project is loaded, returns en empty array.
This function is equivalent to :
JMap.Layer.getLayers().map(layer => layer.id)
JMap.Layer.getLayerTree
Returns project's layer tree.
The layer tree is an array of tree element.
A tree element is a layer group or a layer.
A layer group contains layer and/or other layer group, and has a negative id.
A layer has a positive id.
If no project is loaded, returns an empty array.
JMap.Layer.getLayerTreeElementsById
Returns a map (= a javascript object) where :
A tree element is a layer group or a layer.
A layer group contains layer(s) and/or other layer group(s), and has a negative id.
A layer has a positive id.
If no project is loaded, returns en empty object.
JMap.Layer.getLayers
Returns an array with JMap layers.
The array order is the same as the one in the tree.
If no project is loaded, returns en empty array.
JMap.Layer.getMetadataSchema
Returns the metadata schema associated with the current project's layers.
The layer metadata schema is an array of JLayerMetadataSchemaItem.
If no project is loaded, returns an empty array.
JMap.Layer.getName
Returns the name of the layer.
The JMap layer id
JMap.Layer.getVectorLayerIds
Returns an array with vector JMap layer ids.
Vector Layers are layers that can be selected on the map and served via Vector Tiles or geoJSON, as opposed to raster layers for instance.
The array order is not garanteed to be the same as the one in the tree.
If no project is loaded, returns en empty array.
This function is equivalent to :
JMap.Layer.getVectorLayers().map(layer => layer.id)
JMap.Layer.getVectorLayers
Returns an array with vector JMap layers.
Vector Layers are layers that can be selected on the map and served via Vector Tiles or geoJSON, as opposed to raster layers for instance.
The array order is not garanteed to be the same as the one in the tree.
If no project is loaded, returns en empty array.
JMap.Layer.hasInformationReport
Returns true if the given layer has an information report set in JMap Admin.
the JMap layer id
JMap.Layer.isAllLayerParentsVisible
Returns true if all parents of the element have the visibility property equals to true.
If element has no parent it returns true.
The JMap layer id
JMap.Layer.isSelectableById
Returns the tree element selectable property.
The selectable property is initialy defined on the project, and can be changed by the user through the JMap NG Core library.
If this property is false, the layer's features can't be selected on the map by user interaction, or by API calls.
If this property is true, the layer's features can be selected.
The JMap layer id
JMap.Layer.isVectorLayerById
returns true if specified layer is a vector layer
the JMap layer Id
JMap.Layer.isVisible
Returns the tree element visibility property.
The visibility property is initialy defined on the project, and can be changed by the user through the JMap NG Core library.
If this property is false, the layer cannot be displayed on the map.
If it's true, the layer can be rendered on the map. The layer is rendered depending on the current map scale of the map, and the min / max scale defined for this layer.
The JMap layer id
If true will check if all parent elements have the property visible equals to true
JMap.Layer.setLayerGroupExpansion
Set the layer group expansion state.
The JMap layer group id
if true will expand, if false will collapse the layer group
JMap.Layer.setLayerGroupsExpansion
Set the group expansion state of multiple layer groups.
An array of JLayerSetLayerGroupsExpansionParams
JMap.Layer.setLayersSelectability
Set the selectability property of multiple layers.
For each layer:
If it's a JMap layer, it applies the selectability to it.
The selectability property is initialy defined on the project, and can be changed by the user through the JMap NG Core library.
If this property is true, the layer's features can be selected on the map.
an array of JLayerSetLayersSelectabilityParams
JMap.Layer.setLayersVisibility
Set the visibility property of multiple layers.
For each layer:
If it's a JMap layer, it apply the visibility to it.
The visibility property is initialy defined on the project, and can be changed by the user through the JMap NG Core library.
If this property is false, the layer cannot be displayed on the map.
If it's true, the layer can be rendered on the map. The layer is rendered depending on the current map scale of the map, and the min / max scale defined for this layer.
an array of JLayerSetLayersVisibilityParams
JMap.Layer.setSelectabilityById
Set the selectability property of the layer.
If it's true, the layer's features can be selected on the map.
The JMap layer id
The new selectability property value for the layer
If false or unspecified will make sure that the layer is visible
JMap.Layer.setVisible
Set the visibility property of the layer.
If it's a JMap layer, it apply the visibility to it.
The visibility property is initialy defined on the project, and can be changed by the user through the JMap NG Core library.
If this property is false, the layer cannot be displayed on the map.
If it's true, the layer can be rendered on the map. The layer is rendered depending on the current map scale of the map, and the min / max scale defined for this layer.
The JMap layer id
The new visibility property value for the layer
JMap.Layer
Layer related methods.