Nextome MapView class
The controller is the interface that the developer see to manage the Nextome Map View. With the controller tha developer can add, modify and remove layers and markers. Can also manage the visibility of the tiles, can navigate programatically on the map and can hande the incoming events like taps.
Declaration
Note
The whole declaration process is described into Initialize section of NextomeMapView documentation.
Initialize
Important! the APPLY method
A very important thing to know about the controller is that to apply a change to the internal state of the map, is mandatory to call the apply()
method. For example if you need to add a marker, or turn-off a layer you must call apply()
method to see this changes. Also you can do collect actions like add, modifying, removing, turn-off/on and so on, but at the end you must to call apply()
method to see all this change applied. If you don't call the apply()
method after your changes, internally the changes are applied but nothing appen to on the screen.
Set resources
Set the resources to initialize the map. In the specific:
- A list of tiles
- The zoom level intendeed as the folder depth of provided zip
- The width and the height of the map related to the size in pixel of the map
- A flag useMockView that allow to use the map without pass any tile, just for test
- A flag isLatLng that specify if the coordinate system used will be pixel or latitude-longitude
Manage Tiles
Show-hide Tiles
Manage Layers
Add Layer
To add a new laye:
Show-hide Layer
Clear Layer
Remove all marker from a specific layer
To remove all marker from all layers
Manage Markers (Marker, Path, Shape)
Add Marker
To add a marker to a layer
Update Marker
Get Marker
To get a marker, call:
Map behaviour control
Go to point
Move on a specific point. Note that the point must match the coordinates system choose during initialization. You can pass pixel coordinates or lat-long coordinates.
Set Zoom
Set the zoom
Enable/Disable the map orientation using device compass
Manage Events
Map Ready
Called when all tiles are loaded and showed
Map Tap Events
When an empty point on the map is tapped or is pressed for a long time
Marker Events
Called when a marker (just NMMarker object, not NMPath and NMShape) is tapped