The Selection class can be used to print Polygons or Polylines on the Map or highlight certain layers of the map.
Use Mapviewer.showSelection() to display on a map.
A Selection can have an arbitrary number of selected layers, polygons or polylines.
More...
Additionally it allows the selection of additional data annotations in the Map for very specific map datasets
◆ Selection()
Create an empty selection. The empty selection can be filled with polylines or polygons to display them in the map
◆ addPoint()
| ApiError addPoint |
( |
final Polygon |
point | ) |
|
Add a point to this selection.
- Parameters
-
| point | - the point object (a polygon with a single point) that is added |
◆ addPolygon()
| ApiError addPolygon |
( |
final Polygon |
polygon, |
|
|
final String |
fillColor |
|
) |
| |
Add a polygon to this selection. If the polygon has the optional user attribute "zIndex", the polygon will be shown in the corresponding z-Order between already existing layers. See the "LAYERS" section in the mapservices.xml for the z-Indexes of the already existing layers.
- Parameters
-
| polygon | - the polygon object that is added |
| fillColor | - the color that is used to fill the polygon if the selection is shown on the map |
◆ addPolyline()
| ApiError addPolyline |
( |
final Polygon |
polygon, |
|
|
final String |
lineColor |
|
) |
| |
Add a polyline to this selection. Therefore the geometry of the polygon object is treated as a polyline! If the polyline has the optional user attribute "zIndex", the polyline will be shown in the corresponding z-Order between already existing layers. See the "LAYERS" section in the mapservices.xml for the z-Indexes of the already existing layers.
- Parameters
-
| polygon | - the polygon object that is added as polyline |
| lineColor | - the color that is used to draw the polyline if the selection is shown on the map |
◆ addRouteLine()
| Polygon addRouteLine |
( |
final double |
fromDistToDestinationInMeters, |
|
|
final double |
lengthInMeters, |
|
|
final String |
lineColor |
|
) |
| |
Add a part of a route to this selection.
- Parameters
-
| fromDistToDestinationInMeters | - start point relative to the distance to the destination of the route. Maybe the user attribute 'DIST_TO_DESTINATION' of a waypoint of a poi search along the route. If fromDistToDestinationInMeters == -1.0, then the route part will be generated from the current position. |
| lengthInMeters | - """ |
| lineColor | - the color that is used to draw the polyline if the selection is shown on the map |
- Returns
- The new added Polyline. DO NOT ADD THIS LINE AGAIN WITH mta_sel_addRouteLine.
◆ clear()
Deletes all objects from this selection.
◆ deleteObject()
| ApiError deleteObject |
( |
final Polygon |
poly | ) |
|
Deletes a polygon or polyline from this selection.
- Parameters
-
| poly | - the poly... object that has to be deleted |
◆ equals()
| boolean equals |
( |
Object |
o | ) |
|
|
inherited |
◆ getObjects()
Get a polygon iterator for all objects, contained in this selection.
- Returns
- iterator over polygons that match the selection
◆ getPersistedBlockages()
This method returns the selection of all persisted blockages! It is used during route calculation. The routing algorithm tries to calculate a route, that avoids all blockages contained in this selection. If you want to see these blockages in the map, you can use Mapviewer.showSelection().
- Returns
- Selection object, containing all persisted blockages.
◆ getSelectetObjects()
| Iterable< Polygon > getSelectetObjects |
( |
final String |
attributeColumnNames | ) |
|
Get a polygon iterator for all selected objects.
- Parameters
-
| attributeColumnNames | - A list of attribute names, delimited by '|'. The names must be available as columns in the real shape files. You can leave this parameter empty, if you only want the geometry. |
- Returns
- iterator over polygons that match the selection
◆ getTemporaryBlockages()
This method returns the selection of all temporary blockages! It is used during route calculation. The routing algorithm tries to calculate a route, that avoids all blockages contained in this selection. If you want to see these blockages in the map, you can use Mapviewer.showSelection().
- Returns
- Selection object, containing all temporary blockages.
◆ selectFromMap()
Select objects in the map for a certain area by its layer names. The layers are defined in the mapservices.xml class
- Parameters
-
| mapviewer | - map to select from |
| pos | - point in screen coordinate |
| radiusPixel | - Search radius in pixels |
| layers | - List of layer names, delimited by '|'. You may use asterisks '*' here! |
- Returns
- Selection object, containing all selected map objects. Keep this object alive as long as you want to see the selection in the map.
◆ selectFromShapeFile()
| static Selection selectFromShapeFile |
( |
final String |
shapeFilePath, |
|
|
final Position |
pos, |
|
|
final double |
radiusMeters, |
|
|
final String |
selectString |
|
) |
| |
|
static |
This method allows to select elements encoded in the mapdata. It is designed to select map areas for special annotated map datasets that are delivered by request
- Parameters
-
| shapeFilePath | - the path to the shape file |
| pos | - point in geocoordinates |
| radiusMeters | - Search radius in meters |
| selectString | - Example: NAME = "Bonn" OR DISTRICT LIKE "%Godesberg%" |
- Returns
- Selection object, containing all selected map objects. Keep this object alive as long as you want to see the selection in the map.
The documentation for this class was generated from the following file: