MapTrip SDK Android Manual 9.10.8
 
Loading...
Searching...
No Matches
Waypoint Class Reference

Waypoint is a central class that specifies a position on the map. This can be done by address information (e.g. country, city, street name, housenumber...), a geocoordinate or both.
More...

+ Inheritance diagram for Waypoint:

Public Member Functions

boolean equals (Object o)
 
native String getAliasName ()
 
native Attribute getAttribute (String AttributeName, boolean bInsertIfNotExists)
 
Iterable< AttributegetAttributes ()
 
native String getCity ()
 
native String getCountry ()
 
native double getDirectionAngle ()
 
native double getDistance ()
 
native String getDistrict ()
 
native double getElevation ()
 
native String getFavoriteTag ()
 
native String getHouseNo ()
 
native String getId ()
 
native RoutingMode getInitialRoutingMode ()
 
native int getIterationIndex ()
 
native String getName ()
 
native boolean getOption (WptOption option)
 
native PoiCategory getPoiCategory ()
 
native String getPoiIcon ()
 
native String getPoiName ()
 
native double getPointDist (Waypoint hWaypoint2)
 
native double getPolyDist (Polygon hPolygon)
 
native Position getPosition ()
 
native ReroutingMode getReRoutingMode ()
 
native RouteGuidanceToRouteMode getRouteGuidanceToRouteMode ()
 
native String getState ()
 
native String getStreet ()
 
native String getUserAttribute (String attribute)
 
native double getViaPointRadius ()
 
native Position getWgs84Position ()
 
native String getZIP ()
 
native ApiError setAliasName (String name)
 
native ApiError setBitmap (Bitmap bitmap)
 
native ApiError setCity (String city)
 
native ApiError setCountry (String country)
 
native ApiError setDirectionAngle (double angleDegree)
 
native ApiError setDistrict (String district)
 
native ApiError setElevation (double elevationAboveMSL)
 
native ApiError setFavoriteTag (String favoriteTag)
 
native ApiError setHouseNo (String houseNo)
 
native ApiError setId (String id)
 
native ApiError setInitialRoutingMode (RoutingMode value)
 
native ApiError setName (String name)
 
native boolean setOption (WptOption option, boolean onOff)
 
native ApiError setPoiIcon (String poiIcon)
 
native ApiError setPosition (Position pos)
 
native ApiError setReRoutingMode (ReroutingMode value)
 
native ApiError setRouteGuidanceToRouteMode (RouteGuidanceToRouteMode value)
 
native ApiError setState (String state)
 
native ApiError setStreet (String street)
 
native ApiError setUserAttribute (String attribute, String value)
 
native ApiError setViaPointRadius (double radiusMeter)
 
native ApiError setWgs84Position (Position wgsPosition)
 
native ApiError setZIP (String zip)
 
 Waypoint ()
 
 Waypoint (String country, String city, String district, String zip, String street, String houseNo)
 
 Waypoint (Waypoint wp)
 

Static Public Member Functions

static native Waypoint createCurrentGPSPosWaypoint ()
 
static Iterable< WaypointgetWaypointsFromFile (final String filename)
 

Detailed Description

Most functionality of the SDK requires geocoordinates in a Waypoint ( e.g. the navigation Itinerary ). To retrieve missing address information or coordinates the Geocoder can be used.

Use Mapviewer.showWaypoint() to display or hide a waypoint on a map.

The SDK provides 2 different types of waypoints

  • A standard waypoint that contains a geocoordinate and / or address information
  • A GPS waypoint ( Waypoint.createCurrentGPSPosWaypoint() ) which contains the current GPS pose and is updated with every new GPS signal

Constructor & Destructor Documentation

◆ Waypoint() [1/3]

Waypoint ( )

Create a waypoint without any data.

Returns
An empty waypoint

◆ Waypoint() [2/3]

Waypoint ( String  country,
String  city,
String  district,
String  zip,
String  street,
String  houseNo 
)

Create a waypoint, initialized with an address (Does not contain geocoordinates).

Parameters
countryof the address
cityof the address
districtof the city
zippostal code of the city / district
streetof the address
houseNoof the address
Returns
new waypoint with the given address

◆ Waypoint() [3/3]

Waypoint ( Waypoint  wp)

Creates a copy of the waypoint waypoint

Parameters
wp- waypoint to copy

Member Function Documentation

◆ createCurrentGPSPosWaypoint()

static native Waypoint createCurrentGPSPosWaypoint ( )
static

Create a waypoint that represents the current GPS position (Does not contain address information). If no valid GPS signal has been received it returns a waypoint with position 0 / 0. The position of the waypoint is updated automatically with every new received gps signal

Returns
A waypoint of current gps position

◆ equals()

boolean equals ( Object  o)
inherited

◆ getAliasName()

native String getAliasName ( )

Returns
alternative name for the waypoint.

◆ getAttribute()

native Attribute getAttribute ( String  AttributeName,
boolean  bInsertIfNotExists 
)

Parameters
AttributeNameto identify value with
bInsertIfNotExists: If true and the attribute is not already available, it will be added to this waypoint
Returns
an Attribute object.

◆ getAttributes()

Iterable< Attribute > getAttributes ( )

Returns
an iterator of Attribute (s).

◆ getCity()

native String getCity ( )

Returns
the city of the waypoint.

◆ getCountry()

native String getCountry ( )

Returns
the country of the waypoint.

◆ getDirectionAngle()

native double getDirectionAngle ( )

Returns the direction angle. If no angle is set, 1.7E+308 will be returned. See Waypoint.setDirectionAngle() for a detailed description.

Returns
angle in degree

◆ getDistance()

native double getDistance ( )

Returns
the distance of the waypoint to the search start position of poi search.

◆ getDistrict()

native String getDistrict ( )

Returns
the district (Stadtteil, burough, arrondissement) in a city of the waypoint.

◆ getElevation()

native double getElevation ( )

Returns
the elevation of the waypoint in meters above MSL.

◆ getFavoriteTag()

native String getFavoriteTag ( )

Returns
additional classification of favorite waypoint. E.g. "home" or "office". Purely user defined.

◆ getHouseNo()

native String getHouseNo ( )

Returns
the house number of the waypoint.

◆ getId()

native String getId ( )

Returns
Get the external id of the waypoint.

◆ getInitialRoutingMode()

native RoutingMode getInitialRoutingMode ( )

Returns
current routing mode ( fastest, shortest ... )

◆ getIterationIndex()

native int getIterationIndex ( )

Returns
Index in iterator of last geocoding or "List" process

◆ getName()

native String getName ( )

Returns
waypoints name

◆ getOption()

native boolean getOption ( WptOption  option)

Get / Set one of the options of a waypoint. Some flags may be read-only.

Parameters
optiondefined in WptOption to get current value
Returns
true if the passed option is set

◆ getPoiCategory()

native PoiCategory getPoiCategory ( )

Returns
the poi Category - If the given waypoint is not a poi the return value is NULL.

◆ getPoiIcon()

native String getPoiIcon ( )

Returns
the poi icon file name of the waypoint

◆ getPoiName()

native String getPoiName ( )

Returns
the poi name of the waypoint.

◆ getPointDist()

native double getPointDist ( Waypoint  hWaypoint2)

Returns
the distance of the waypoint to the other waypoint in meters.

◆ getPolyDist()

native double getPolyDist ( Polygon  hPolygon)

Returns
the distance of the waypoint to the polygon in meters.

◆ getPosition()

native Position getPosition ( )

Returns
Get the position of the waypoint in internal coordinates. If data is in another projection (e.g. WGS) use the class Projection for a transformation

◆ getReRoutingMode()

native ReroutingMode getReRoutingMode ( )

Returns
current rerouting mode ( auto, manual, none )

◆ getRouteGuidanceToRouteMode()

native RouteGuidanceToRouteMode getRouteGuidanceToRouteMode ( )

Returns
current route guidance to route mode ( lead to starting point or closest point )

◆ getState()

native String getState ( )

Returns
Get the state code of the waypoint. This function works only for addresses in USA and Canada.

◆ getStreet()

native String getStreet ( )

Returns
the street of the waypoint.

◆ getUserAttribute()

native String getUserAttribute ( String  attribute)

Get the value of a user attribute of the waypoint. Is purely user defined and get/set by key-value pairs. Since SDK version 9.6 the attribute name is handled case insensitive!

Parameters
attribute- the attribute or "key" to retrieve the value from
Returns
- value for the passed key

◆ getViaPointRadius()

native double getViaPointRadius ( )

A via point is a waypoint that has a defined radius > 0. Such a waypoint is treated differently by route calculations.

In case a viapoint is in the navigation itinerary, a route calculation will not lead through the exact coordinate of the waypoint but the route will cross its radius.
If, during a navigation, the calculated route is left but continued towards a destination after the via point, the rerouting will ignore the via point at a certain distance. In that case the waypoint option WptOption.IS_IGNORED is set. If the routing shall be forced to navigate to a via point even if the navigation is close to a itinerary waypoint after the via point, it requires the option WptOption.DONT_IGNORE to be set.

Returns
radius in meters

◆ getWaypointsFromFile()

static Iterable< Waypoint > getWaypointsFromFile ( final String  filename)
static

Parameters
filenameto waypoint file stored in xml (.nmea file or .csv file with first row e.g. like "long;lat[;angle;speed]")
Returns
an iterator over the waypoints of the given file.

◆ getWgs84Position()

native Position getWgs84Position ( )

Returns
Get the position of the waypoint in WGS84 internal coordinates.

◆ getZIP()

native String getZIP ( )

Returns
Get the ZIP code of the waypoint.

◆ setAliasName()

native ApiError setAliasName ( String  name)

Parameters
name- alternative name to set to the waypoint
Returns
Errorcode

◆ setBitmap()

native ApiError setBitmap ( Bitmap  bitmap)

Returns
Errorcode

◆ setCity()

native ApiError setCity ( String  city)

Parameters
city- the city of the waypoint
Returns
Errorcode

◆ setCountry()

native ApiError setCountry ( String  country)

Parameters
countryset the waypoint country
Returns
Errorcode

◆ setDirectionAngle()

native ApiError setDirectionAngle ( double  angleDegree)

Forces the routing to reach (or start) the route in this direction. The angle must be in the range 0.0 <= angle < 360.0. If the angle is greater or equal 360.0 or negative, the direction angle will be unset and not used for the route calculation. If this angle is set, the routing algorithm searches the destination street segment not only by its distance to this waypoint, but by the difference angle (of this angle and the street segment angle) too. The street with the minimal sum of distance in meters + a third of the difference angle will be taken.

Parameters
angleDegreeangle to set
Returns
Errorcode

◆ setDistrict()

native ApiError setDistrict ( String  district)

Parameters
district- the district to set
Returns
Errorcode

◆ setElevation()

native ApiError setElevation ( double  elevationAboveMSL)

Parameters
elevationAboveMSLthe waypoints elevation in msl
Returns
Errorcode

◆ setFavoriteTag()

native ApiError setFavoriteTag ( String  favoriteTag)

Parameters
favoriteTag- tag for favorite
Returns
Errorcode

◆ setHouseNo()

native ApiError setHouseNo ( String  houseNo)

Parameters
houseNo- the house Number to set
Returns
Errorcode

◆ setId()

native ApiError setId ( String  id)

Set external id of the waypoint.

Parameters
idto set
Returns
Errorcode

◆ setInitialRoutingMode()

native ApiError setInitialRoutingMode ( RoutingMode  value)

Parameters
value- Routing mode to set (shortest fastest .... )
Returns
Errorcode

◆ setName()

native ApiError setName ( String  name)

Parameters
name- name to set the waypoint
Returns
Errorcode

◆ setOption()

native boolean setOption ( WptOption  option,
boolean  onOff 
)

set a waypoint option

Parameters
option- option to set
onOff- set true to set the given option
Returns
the previous value of the passed option before setting

◆ setPoiIcon()

native ApiError setPoiIcon ( String  poiIcon)

Set the poi icon name. May also contain a full http request.

The SDK scales the poi icon according to the android scaling factors e.g.

  • mdpi = 1,
  • hdpi = 1.5,
  • xhdpi = 2
  • xxhdpi = 3
  • xxxhdpi = 4 To provide higher res images and avoid blurry images due to upscaling, a general scale factor can be applied. The mapservices XML contains a TAG iconScale for the scale factor:

<smartphones> <android> <iconScale>1.0</iconScale> </android> </smartphones> <tablets> .... </tablets>

e.g. If your images are optimized for xxhdpi devices, you can set the scale factor in the xml to 1/3. The overall scale factor applied to different devices would be:

  • mdpi = 1 * 1/3 = 0.33,
  • hdpi = 1.5 * 1/3 = 0.5,
  • xhdpi = 2 * 1/3 = 0.66,
  • xxhdpi = 3 * 1/3 = 1,
  • xxxhdpi = 4 * 1/3 = 1,33

The icons bottom - center is aligned with the coordinate when shown

Parameters
poiIcon- poiIcon png to set
Returns
Errorcode

◆ setPosition()

native ApiError setPosition ( Position  pos)

Set Waypoint position in internal coordinates

Attention
If data is in another projection (e.g. WGS) use the class Projection for a transformation
Parameters
posposition to set
Returns
Errorcode

◆ setReRoutingMode()

native ApiError setReRoutingMode ( ReroutingMode  value)

Parameters
valuethat defines how a rerouting should be handled ( automatic, manual or none )
Returns
Errorcode

◆ setRouteGuidanceToRouteMode()

native ApiError setRouteGuidanceToRouteMode ( RouteGuidanceToRouteMode  value)

Defines for a reference route or follow me route how the route shall be approached. f.e. guide to closest segment or to start

Parameters
value- the mode to set
Returns
Errorcode

◆ setState()

native ApiError setState ( String  state)

Parameters
state- set the state of the waypoint
Returns
Errorcode

◆ setStreet()

native ApiError setStreet ( String  street)

Parameters
street- street of the waypoint
Returns
Errorcode

◆ setUserAttribute()

native ApiError setUserAttribute ( String  attribute,
String  value 
)

Set a user attribute and its value to the waypoint as key value pair. Can be use to store additional information to the waypoint. Since SDK version 9.6 the attribute name is handled case insensitive! Predefined attributes:

  • Key: iconAlignment - defines the poi icon alignment of the waypoint
  • Values: TopLeft, TopCenter, TopRight, CenterLeft, Center, CenterRight, BottomLeft, BottomCenter, BottomRight
Parameters
attributeto identify value with
valueto set
Returns
Errorcode

◆ setViaPointRadius()

native ApiError setViaPointRadius ( double  radiusMeter)

Parameters
radiusMeterradius to set
Returns
Errorcode

◆ setWgs84Position()

native ApiError setWgs84Position ( Position  wgsPosition)

Set Waypoint position in WGS84 coordinates

Returns
Errorcode

◆ setZIP()

native ApiError setZIP ( String  zip)

Parameters
zipcode to set
Returns
Errorcode

The documentation for this class was generated from the following file: