The Selection class can be used to print Polygons or Polylines on the Map or highlight certain layers of the 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
◆ addPolygon()
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()
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()
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
◆ 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
◆ 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.
◆ showSelection()
| ApiError showSelection |
( |
final Mapviewer |
mapviewer, |
|
|
final boolean |
doShow, |
|
|
final String |
fillColor, |
|
|
final String |
borderColor, |
|
|
final String |
iconFileName |
|
) |
| |
- Deprecated:
- Use Mapviewer.showSelection() instead. Will be removed in SDK 9.10. Show (or hide) the selection in the map. A selection is visible as long as the object is kept alive or this method is called to hide it explicitly.
- Parameters
-
| doShow | - Show (=true) or hide (=false). |
| mapviewer | - map to show selection on |
| fillColor | - Fill color for highlighted polylines and polygons. |
| borderColor | - Border color for highlighted polylines and polygons. |
| iconFileName | - Png icon filename for highlighted points. |
- Returns
- Errorcode
The documentation for this class was generated from the following file: