/plugins/layer_order

The plugin sorts the mapview.locale.layers[] array according to the order of layer object keys in the layer_order locale property.

Layer with keys not referenced in the layer order will be on top.

"layer_order": [
  "urban_areas",
  "admin",
  "retail_places"
]

Methods

(inner) layer_order(plugin, mapview)

The function sorts mapview.locale.layers based on the order specified in layer_order array. It accesses each layer key and checks its index in the layer_order array.

Parameters:
NameTypeDescription
pluginArray

An array listing layers to be reordered.

mapviewObject

The mapview object