Documentation for maplib/Layer.kt

class Layer

Layer class

fun constructor(handle: Long)

Main constructor

var name : String

Layer name read/write property

var visible : Boolean

Layer visible read/write property

var maxZoom : Float

Layer maximum zoom to show. At higher zoom levels layer is not visible

var minZoom : Float

Layer minimum zoom to show. At lower zoom levels layer is not visible

val dataSource : Object

Layer data source readonly property

var style : JsonObject

Layer style in Json format read/write property

var styleName : String

Layer style name (type) read/write property. The supported styles are: - simplePoint - primitivePoint - simpleLine - simpleFill - simpleFillBordered - marker The style connected with geometry type of vector layer. If you set style of incompatible type the layer will not see on map.

fun identify(envelope: Envelope, limit: Int = 0) : Array<Feature>

Find features in vector layer that intersect envelope

Parameters
  • envelope – Envelope to test on intersection

  • limit – The return feature limit

Returns

The array of features from datasource in layer

fun select(features: List<Feature> = listOf())

Highlight feature in layer. Change the feature style to selection style. The selection style mast be set in map.

Parameters
  • features – Features array. If array is empty the current highlighted features will get layer style and drawn not hightailed.