-
Notifications
You must be signed in to change notification settings - Fork 19
browser view
Map view is a way to display only a subset of all resources available in a single map config. The map config may contain some predefined named views, which may be activated just by the name. Or the application may configure its own view.
Methods Map::getResourceSurfaces
, Map::getResourceBoundLayers
and Map::getResourceFreeLayers
all return a vector of names of surfaces, bound layers and free layers respectively.
These names returned are all available resources of the respective type in the map config, which may be a lot more than what you want to see at the moment.
Method Map::getViewNames
returns a vector of view names that are predefined in the map config.
Method Map::getViewCurrent
returns the name of the active view.
Method Map::setViewCurrent
activates the view specified by the name.
Methods Map::getViewData
and Map::setViewData
are used to query or change properties of the view specified by its name.
Changing view, which is active, propagates the changes to the actual map as well.
The properties are all in structure MapView
.
It contains two maps: MapView::surfaces
and Map::MapView::freeLayers
.
Keys in these maps is the name of the surface or free layer and values are its properties.
Currently, the only property for a surface is vector of bound layers.
Properties for free layer are url for style config and vector of bound layers too.
The order of bound layers matters, unlike the order of surfaces, whose order is given by the map config, and cannot be changed in the view.
Additionally, alpha (opacity) can be set individually for each bound layer.
Methods Map::setViewData
and Map::setViewJson
can be used to add a new view, just pass in some unused name.
Method Map::removeView
removes the view from the list of named views.
Finally, methods Map::getViewJson
and Map::setViewJson
may be used to retrieve or set view data in the json format.