This example app demonstrates the following features:
- Add a polygon territory; create an optimization with the customer of a territory
When you run the example app, a polygon territory will be saved.
- Create a
vrp::Territoryand set the name, type (Polygon), color and data. The data must contain the coordinates of the polygon. - Create a
ProgressListenerandvrp::Service. - Call the
addTerritory()method from thevrp::Serviceusing thevrp::TerritoryandProgressListenerand wait for the operation to be done.
- Create a
CoordinatesListand add the territory's coordinates to it. - Create a
MapServiceListener,OpenGLContextandMapView. - Create a
MarkerCollectionof type Polygon and add the list created at 1.) to it. - Create a
MarkerCollectionDisplaySettingsand set the territory's color to the polygon fill color. - Set the newly created
MarkerCollectionin the markers collections of the map view preferences, together with theMarkerCollectionDisplaySettings. - Allow the application to run until the map view is fully loaded.
