The AtlasWeb SDK includes a layers architecture which enables you to add layers and shapes to the map.
The Layer class is the base class of all layers available in the SDK.
These are the classes that inherit from the Layer class:
- LayersCollection - the layers collection class stores a collection of layers.
- LayersManager - The layer manager class handles all the layers above the map.
The layer manager is based on the LayersCollection class and it must to be attached to a map in order to view the layers and shapes it handles.
- VectorLayer - The vector layer class is the based class of the LocalVectorLayer and RemoteVectorLayer classes that can store various of shapes (Polygon, Polyline, Circle, Marker).
- LocalVectorLayer - The local vector layer class stores a client side shapes (Polygon, Polyline, Circle, Marker).
- RemoteVectorLayer - The remote vector layer class stores a server side shapes (Polygon, Polyline, Circle, Marker).
The remote vector layer gets the data from a remote server (this is done by an XML-based response).
In order to add shapes to the map, you first need to create an instance of the LayersManager class, and attach it to the map by the map’s setLayersManager method.
Instead, you can also use the deafult map’s layers manager (you can get the object by calling the map’s getLayersManager method)
When the layers manager is attached to the map, you can add any layer to this object.
There are two classes which you can use to add shapes to the map, the LocalVectorLayer and the RemoteVectorLayer classes.
The LocalVectorLayer class stores a client side shapes (Polygon, Polyline, Circle, Marker).
In order to add a LocalVectorLayer to the map, you can add it directly to the map’s LayersManager object or you can use a LayersCollection object.
If you use a LayersCollection, the object should be attached to map’s LayersManager object as well.
The RemoteVectorLayer stores a server side shapes (Polygon, Polyline, Circle, Marker).
The process of adding a RemoteVectorLayer object to the map is the same as the LocalVectorLayer.