The mapviewer is used to visualize the map, routes, pois etc.
More...
Inheritance diagram for Mapviewer:Public Member Functions | |
| final ApiError | disableCoiZoom () |
| final ApiError | disableRealityView () |
| final ApiError | disableSignPost () |
| final ApiError | disableSpeedDependentZoom () |
| final ApiError | enableCoiZoom () |
| final ApiError | enableLocationTracking (final boolean enable, final int mSecToPauseAfterTouch) |
| final ApiError | enableRealityView () |
| final ApiError | enableRotation (final boolean enable) |
| final ApiError | enableSignPost () |
| final ApiError | enableSpeedDependentZoom () |
| boolean | equals (Object o) |
| final native boolean | extendedSoftVehicleAttributesAreVisible () |
| final native boolean | extendedVehicleAttributesAreVisible () |
| final native int | getActiveRefreshInterval () |
| final double | getCarIconLookAheadRatio2D () |
| final double | getCarIconLookAheadRatio3DLandscape () |
| final double | getCarIconLookAheadRatio3DPortrait () |
| final Position | getCarIconPosition () |
| final Position | getCenterPoint () |
| final String | getColorProfile () |
| final Position | getFrameCoordFromGeoCoord (final Position pos) |
| final Position | getGeoCoordFromFrameCoord (final Position frame) |
| final int | getGesturingRefreshInterval () |
| final double | getGroundResolution () |
| final Position | getMapCenterOffsetLandscape () |
| final Position | getMapCenterOffsetPortrait () |
| final native MapContent | getMapContent () |
| final MapPerspective | getPerspective () |
| final long | getRouteColor (final RouteColor mode) |
| final boolean | getRouteGuidanceMode () |
| final int | getTrackingRefreshInterval () |
| final native double | getViewingDistance () |
| final double | getViewingDistanceForRadius (final double radiusInMeters) |
| final double | getViewingDistanceForRegion (final Position pos1, final Position pos2) |
| final void | hideAllWaypoints () |
| final native boolean | isCoiZoomEnabled () |
| final boolean | isLayerVisible (final String layerName) |
| final boolean | isLocationTrackingEnabled () |
| final native boolean | isPoiCategoryVisible (PoiCategory poicategory) |
| final native boolean | isPoiSourceVisible (PoiSource poisource) |
| final native boolean | isRealityViewActive () |
| final native boolean | isRealityViewEnabled () |
| final boolean | isRotationEnabled () |
| final boolean | isSignPostActive () |
| final native boolean | isSignPostEnabled () |
| final native boolean | isSpeedDependentZoomEnabled () |
| final native boolean | isVehicleIconVisible () |
| Mapviewer () | |
| final ApiError | pauseLocationTracking () |
| final native boolean | residentialStreetsAreVisible () |
| final ApiError | resumeLocationTracking () |
| final ApiError | setCarIconLookAheadRatio (final double lookAheadRatio2D, final double lookAheadRatio3DPortrait, final double lookAheadRatio3DLandscape) |
| final ApiError | setCenterPoint (final Position pos) |
| final ApiError | setColorForAllProfiles (final long red, final long green, final long blue, final long alpha, final String colorName) |
| final ApiError | setColorForProfile (final long red, final long green, final long blue, final long alpha, final String colorName, final String profileName) |
| final ApiError | setColorProfile (final String colorProfile) |
| final ApiError | setCurrentColor (final long red, final long green, final long blue, final long alpha, final String colorName) |
| final ApiError | setIconPath (final String path) |
| final ApiError | setMapCenterOffsets (final double centerOffsetLandscapeX, final double centerOffsetLandscapeY, final double centerOffsetPortraitX, final double centerOffsetPortraitY) |
| final ApiError | setMapContent (final MapContent mapContent) |
| final ApiError | setMinZoomHeight (final double minZoomHeight) |
| final ApiError | setPerspective (final MapPerspective viewMode) |
| final ApiError | setRefreshInterval (final int mSecTracking, final int mSecGesture) |
| final ApiError | setRouteGuidanceMode (final boolean enable) |
| final boolean | setSignPostOffset (final int xOffset, final int yOffset) |
| final ApiError | setVehicleIconBaseName (final String vehicleIconBaseName, final double vehicleIconSizeInCM) |
| final ApiError | setViewingDistance (final double distanceInMeters, final boolean animatedZoom) |
| final ApiError | showDynamicLayer (final String contentName, final String shapeFile, final boolean doShow) |
| final ApiError | showExtendedSoftVehicleAttributes (final boolean doShow) |
| final ApiError | showExtendedVehicleAttributes (final boolean doShow) |
| final ApiError | showLayer (final String layerName, final boolean doShow) |
| final ApiError | showPoiCategory (final PoiCategory poicategory, final boolean doShow) |
| final ApiError | showPoiSource (final PoiSource poisource, final boolean doShow) |
| final ApiError | showRoute (final Navigation route, final boolean doShow, final long color, final long borderColor) |
| final ApiError | showRouteComparison (final RouteComparison routeComparison, final boolean doShow, final long colorOldRoute, final long borderColorOldRoute, final long colorNewRoute, final long borderColorNewRoute) |
| final ApiError | showSelection (final Selection selHandle, final boolean doShow, final String fillColor, final String borderColor, final String iconFileName) |
| final native ApiError | showVehicleIcon (boolean show) |
| final ApiError | showWaypoint (final Waypoint poi, final boolean doShow) |
| final ApiError | zoomToExtend (final Polygon plg) |
| final ApiError | zoomToFollowMeRoute (final FollowMeRoute followMeRoute) |
Static Public Member Functions | |
| final static native DayNightMode | getActiveDayNightStatus () |
| final static native DayNightMode | getDayNightMode () |
| static final ApiError | setDayNightMode (final DayNightMode mode) |
Protected Member Functions | |
| void | addMapviewerListener (MapviewerListener listener) |
| final String | getName () |
| void | removeAllMapviewerListeners () |
| void | removeMapviewerListener (MapviewerListener listener) |
The SDK utility class ApiHelper provides the method getGLSurfaceView() to obtain the Mapviewer View. This can be attached to a frame layout. See the quickstart manual for a source code example.
The viewer is organized in layers for visualizing groups of different items like POI's specific roads or GPS logs. Layers are configured and specified in mapservices.xml file.
| Mapviewer | ( | ) |
|
protected |
| final ApiError disableCoiZoom | ( | ) |
Disable COI (crossing of interest) zoom (default setting). See Mapviewer.enableCoiZoom()
| final ApiError disableRealityView | ( | ) |
This function disables the RealityView. No Reality View pictures will be shown.
| final ApiError disableSignPost | ( | ) |
With this function you can disable the display of signposts.
| final ApiError disableSpeedDependentZoom | ( | ) |
Disable automatic zooming based on driving speed (default setting)
| final ApiError enableCoiZoom | ( | ) |
Enable COI (crossing of interest) zoom. Zooms automatically at crossings that are relevant for navigation along the route.
| final ApiError enableLocationTracking | ( | final boolean | enable, |
| final int | mSecToPauseAfterTouch | ||
| ) |
Center map to the current position with every location update. If the mapcenter is changed due to a gesture, the tracking will be paused until the passed timeout is reached. If the tracking should be resumed earlier, call mta_map_resumeLocationTracking
| enable | - true to enable tracking |
| mSecToPauseAfterTouch | - how many milliseconds to wait until tracking continues |
| final ApiError enableRealityView | ( | ) |
Reality View mode shows the signage and lanes you must follow. This mode displays until you pass the highway junction. Once past the junction, the map returns to navigation mode. Note: Reality View mode is not available for every highway junction. Availability is dependent on the map data currently in use. When, during navigation, you approach a highway junction, the map changes to Reality View mode.
This function enable the RealityView - appropriate resources have to be installed
| final ApiError enableRotation | ( | final boolean | enable | ) |
| enable | if true - rotates the map according to the heading value of the compass |
| final ApiError enableSignPost | ( | ) |
Signposts (e.g. motorway signs) show the direction you have to follow at next junction. Availability is dependent on the map data currently in use. The signposts will be shown for next junction in navigation.
| final ApiError enableSpeedDependentZoom | ( | ) |
Enable zooming based on driving speed
|
inherited |
| final native boolean extendedSoftVehicleAttributesAreVisible | ( | ) |
| final native boolean extendedVehicleAttributesAreVisible | ( | ) |
|
static |
Gets the current state (not the mode) of the day / night mode setting e.g. if the day / night mode is set to DayNightMode.AUTOMATIC_DAY_NIGHT_MODE this function will still return DayNightMode.NIGHT_MODE at night and DayNightMode.DAY_MODE during daytime
| final native int getActiveRefreshInterval | ( | ) |
| final double getCarIconLookAheadRatio2D | ( | ) |
| final double getCarIconLookAheadRatio3DLandscape | ( | ) |
| final double getCarIconLookAheadRatio3DPortrait | ( | ) |
| final Position getCarIconPosition | ( | ) |
| final Position getCenterPoint | ( | ) |
Gets the coordinate of the map that the viewer currently centers.
| final String getColorProfile | ( | ) |
|
static |
| frame | to calculate geocoordinates from |
| final int getGesturingRefreshInterval | ( | ) |
| final double getGroundResolution | ( | ) |
| final Position getMapCenterOffsetLandscape | ( | ) |
Returns the relative position of the current MapCenter for landscape mode. All values are defined as a percentage value from -1 to 1. Don't mistake this for a geo position. For X: -1 is left, 0 is center, 1 is right. For Y: -1 is top, 0 is center, 1 is bottom.
| final Position getMapCenterOffsetPortrait | ( | ) |
Returns the relative position of the current MapCenter for portrait mode. All values are defined as a percentage value from -1 to 1. Don't mistake this for a geo position. For X: -1 is left, 0 is center, 1 is right. For Y: -1 is top, 0 is center, 1 is bottom.
| final native MapContent getMapContent | ( | ) |
|
protected |
| final MapPerspective getPerspective | ( | ) |
| final long getRouteColor | ( | final RouteColor | mode | ) |
Returns the color / border color by day / night of the route defined in mapServices.xml.
| mode | - See RouteColor |
| final boolean getRouteGuidanceMode | ( | ) |
| final int getTrackingRefreshInterval | ( | ) |
| final double getViewingDistanceForRadius | ( | final double | radiusInMeters | ) |
| final void hideAllWaypoints | ( | ) |
remove all previously shown waypoints that are shown by Mapviewer.showWaypoint()
| final native boolean isCoiZoomEnabled | ( | ) |
| final boolean isLayerVisible | ( | final String | layerName | ) |
| final boolean isLocationTrackingEnabled | ( | ) |
Mapviewer.enableLocationTracking()
| final native boolean isPoiCategoryVisible | ( | PoiCategory | poicategory | ) |
| final native boolean isPoiSourceVisible | ( | PoiSource | poisource | ) |
| final native boolean isRealityViewActive | ( | ) |
| final native boolean isRealityViewEnabled | ( | ) |
With this function you can check if RealityView is enabled or not.
| final boolean isRotationEnabled | ( | ) |
| final boolean isSignPostActive | ( | ) |
| final native boolean isSignPostEnabled | ( | ) |
With this function you can check if Signpost drawing is active or not.
| final native boolean isSpeedDependentZoomEnabled | ( | ) |
| final native boolean isVehicleIconVisible | ( | ) |
| final ApiError pauseLocationTracking | ( | ) |
If location tracking is enabled the tracking will be paused until the location tracking timeout is reached or mta_map_resumeLocationTracking() is called.
|
protected |
|
protected |
| final native boolean residentialStreetsAreVisible | ( | ) |
| final ApiError resumeLocationTracking | ( | ) |
If location tracking is enabled and the user touched the map or mta_map_pauseLocationTracking() was called, the tracking is paused until the location tracking timeout is reached. This methods interrupts the timeout and resumes the tracking immediately.
| final ApiError setCarIconLookAheadRatio | ( | final double | lookAheadRatio2D, |
| final double | lookAheadRatio3DPortrait, | ||
| final double | lookAheadRatio3DLandscape | ||
| ) |
| final ApiError setCenterPoint | ( | final Position | pos | ) |
Sets the viewer to center the map at the given point.
| pos | - center point of the map in geocoordinates |
| final ApiError setColorForAllProfiles | ( | final long | red, |
| final long | green, | ||
| final long | blue, | ||
| final long | alpha, | ||
| final String | colorName | ||
| ) |
Sets the color for given name for all color profiles.
The color will change immediately in the map.
| red | value 0 - 255 |
| green | value 0 - 255 |
| blue | value 0 - 255 |
| alpha | value 0 - 255 |
| colorName | - name of the defined color value to change |
| final ApiError setColorForProfile | ( | final long | red, |
| final long | green, | ||
| final long | blue, | ||
| final long | alpha, | ||
| final String | colorName, | ||
| final String | profileName | ||
| ) |
Sets the color for given color name and color profile (defined in mapservices.xml or colors.xml). If the color or the profile does not exist, MTA_ERROR_OBJ_NOT_FOUND will be returned. If the profile is currently active, the color will change immediately in the map.
| red | value 0 - 255 |
| green | value 0 - 255 |
| blue | value 0 - 255 |
| alpha | value 0 - 255 |
| colorName | - name of the defined color value to change |
| profileName | - name of the defined profileName value to change |
| final ApiError setColorProfile | ( | final String | colorProfile | ) |
Set base name of desired color profile. Must be defined in mapservices_xml as "day_xxx" and "night_xxx" xxx stand for color profile base name
| colorProfile | - color profile base name ( without day_ or night_ ) |
| final ApiError setCurrentColor | ( | final long | red, |
| final long | green, | ||
| final long | blue, | ||
| final long | alpha, | ||
| final String | colorName | ||
| ) |
Sets the color for given name for the current active profile The color will change immediately in the map. If you switch to an other profile, this color will be lost!
| red | value 0 - 255 |
| green | value 0 - 255 |
| blue | value 0 - 255 |
| alpha | value 0 - 255 |
| colorName | - name of the defined color value to change |
|
static |
Get/Sets the day/night/auto mode of the map engine. The setting is stored in the settings.ini
| mode | - See DayNightMode |
| final ApiError setIconPath | ( | final String | path | ) |
Set the folder where map related icons like poi icons are located. By default this is ResourcePath/poi_icons
| path | - the new path to set |
| final ApiError setMapCenterOffsets | ( | final double | centerOffsetLandscapeX, |
| final double | centerOffsetLandscapeY, | ||
| final double | centerOffsetPortraitX, | ||
| final double | centerOffsetPortraitY | ||
| ) |
Offsets the target lookat point on the map (not for 2D northbound). It can be changed if GUI controls overlap the car icon. All values are defined as a percentage value from -1 to 1. For X: -1 is left, 0 is center, 1 is right. For Y: -1 is top, 0 is center, 1 is bottom.
| centerOffsetLandscapeX | |
| centerOffsetLandscapeY | |
| centerOffsetPortraitX | |
| centerOffsetPortraitY |
| final ApiError setMapContent | ( | final MapContent | mapContent | ) |
| final ApiError setMinZoomHeight | ( | final double | minZoomHeight | ) |
| minZoomHeight | - the closest zoom level. Default is 100, minimum 1 and maximum 7000000.0f |
| final ApiError setPerspective | ( | final MapPerspective | viewMode | ) |
Changes the view mode (2D and 3D) of the map viewer. The setting is stored in the settings.ini
| viewMode | - See MapPerspective |
| final ApiError setRefreshInterval | ( | final int | mSecTracking, |
| final int | mSecGesture | ||
| ) |
| final ApiError setRouteGuidanceMode | ( | final boolean | enable | ) |
| enable | - true to show reality views, green arrows on next crossing ... |
| final boolean setSignPostOffset | ( | final int | xOffset, |
| final int | yOffset | ||
| ) |
| final ApiError setVehicleIconBaseName | ( | final String | vehicleIconBaseName, |
| final double | vehicleIconSizeInCM | ||
| ) |
Change the vehicle icon symbol. A set of four symbols must be defined: "vehicleIconBaseName"_3d.png : for 3D mode with good gps signal "vehicleIconBaseName"_3d_grey.png : for 3D mode with bad gps signal "vehicleIconBaseName"_2d.png : for 2D mode with bad gps signal "vehicleIconBaseName"_2d_grey.png : for 2D mode with bad gps signal
| vehicleIconBaseName | - base name of the four needed pngs. An empty string means the default carIcon (arrow). |
| vehicleIconSizeInCM | - size of the icon in cm on screen |
| final ApiError setViewingDistance | ( | final double | distanceInMeters, |
| final boolean | animatedZoom | ||
| ) |
| distanceInMeters | to set as viewing height |
| animatedZoom | - do animate zoom or jump directly to given distance - Feature is not yet available and prepared for future use |
| final ApiError showDynamicLayer | ( | final String | contentName, |
| final String | shapeFile, | ||
| final boolean | doShow | ||
| ) |
Displays or hides a shapefile on a map. The description and displaying options (Shape reader, and layer) have to be defined in the Mapservices.xml file
| doShow | - Show (=true) or hide (=false). |
| contentName | - ID of the content that shall be used to display the shapefile; Specified in the mapsiervices.xml |
| shapeFile | - shapeFile that shall be displayed with the given content |
Add a shape reader definition to the mapservices.xml in the "SHAPEREADERS" section:
Add a layer definition to the mapservices.xml in the "LAYERS" section:
Now you have finished the configuration of the mapservices for displaying some points!
If you call showDynamicLayer("MyPoints", "PathToYourShape/MyPoints", true); the mapviewer displays your points, using the symbol "gps_point.png"!
Until now, this function is not very dynamic, because you have to define the shape reader and the layer already in the mapservices, and there must already be a valid shape file at the mentioned path!
But if you have a second point shape called "OtherPointsOfMe" at another location, you can switch to the other points by calling:
showDynamicLayer("MyPoints", "OtherPath/OtherPointsOfMe", true);
This is the only thing, that is dynamic here! With this function you can change the source path and file name of an existing shape reader!
If you have a point shape (in ESRII format), the SDK expects the following files now in this folder:
| final ApiError showExtendedSoftVehicleAttributes | ( | final boolean | doShow | ) |
Show or hide soft restricted vehicle attributes on the map
| doShow | - Show (=true) or hide (=false). |
| final ApiError showExtendedVehicleAttributes | ( | final boolean | doShow | ) |
Show or hide hard restricted vehicle attributes on the map
| doShow | - Show (=true) or hide (=false). |
| final ApiError showLayer | ( | final String | layerName, |
| final boolean | doShow | ||
| ) |
| layerName | - of the layer that will be shown or hidden |
| doShow | - Show (=true) or hide (=false). |
| final ApiError showPoiCategory | ( | final PoiCategory | poicategory, |
| final boolean | doShow | ||
| ) |
Shows or hides of all pois of the given category in the mapviewer.
| poicategory | - Category to show or hide |
| doShow | - Show (=true) or hide (=false). |
| final ApiError showPoiSource | ( | final PoiSource | poisource, |
| final boolean | doShow | ||
| ) |
| poisource | - source to show or hide |
| doShow | - Show (=true) or hide (=false). |
| final ApiError showRoute | ( | final Navigation | route, |
| final boolean | doShow, | ||
| final long | color, | ||
| final long | borderColor | ||
| ) |
Display or hide a route in the map. Note that during a navigation the route is displayed automatically. The color model is the rgba model in one unsigned int. (e.g. 0xFF00FFFF). The values for each component are in range 0 - 255 (0xFF).
| route | - route that shall be shown |
| doShow | - Show (=true) or hide (=false). |
| color | - RGBA color value (e.g. 0xFF00FFFF means red : 0xFF, green : 0x00, blue : 0xFF, alpha : 0xFF) |
| borderColor | - RGBA border color value (e.g. 0xFF00FFFF means red : 0xFF, green : 0x00, blue : 0xFF, alpha : 0xFF) |
| final ApiError showRouteComparison | ( | final RouteComparison | routeComparison, |
| final boolean | doShow, | ||
| final long | colorOldRoute, | ||
| final long | borderColorOldRoute, | ||
| final long | colorNewRoute, | ||
| final long | borderColorNewRoute | ||
| ) |
Shows or hide a route comparison with the appropriate routes on the map
| routeComparison | - the comparison to show |
| doShow | - Show (=true) or hide (=false). |
| colorOldRoute | - fill color of the old route |
| borderColorOldRoute | - border color of the old route |
| colorNewRoute | - fill color of the new route |
| borderColorNewRoute | - border color of the new route |
| final ApiError showSelection | ( | final Selection | selHandle, |
| final boolean | doShow, | ||
| final String | fillColor, | ||
| final String | borderColor, | ||
| final String | iconFileName | ||
| ) |
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.
| selHandle | - Selection to show or hide. |
| doShow | - Show (=true) or hide (=false). |
| fillColor | - Fill color for highlighted polylines and polygons. |
| borderColor | - Border color for highlighted polylines and polygons. |
| iconFileName | - Png icon filename for highlighted points. |
| final native ApiError showVehicleIcon | ( | boolean | show | ) |
| show | - if true the vehicle icon is shown on the map |
| final ApiError showWaypoint | ( | final Waypoint | poi, |
| final boolean | doShow | ||
| ) |
Shows or hides a user defined POI in the mapviewer. The icons bottom - center is aligned with the coordinate when shown. The POI-category-ID of this waypoint is PoiCategoryId.ID_USER_POI. See also Waypoint.getPoiCategory() and PoiCategory.getTypeIdStr().
| poi | - The waypoint that shall be shown |
| doShow | - Show (=true) or hide (=false). |
| final ApiError zoomToExtend | ( | final Polygon | plg | ) |
Zoom the map to the given polygon area.
| plg | - polygon area that should be visible / zoomed to |
| final ApiError zoomToFollowMeRoute | ( | final FollowMeRoute | followMeRoute | ) |
This method can be used zoom a follow me route on the map providing a nmea log file. This route only show the route defined in the nmea log and not from the current position which is shown after a call to FollowMeRoute.calculate().
| followMeRoute | - follow me route to zoom to |