PTV Navigator Remote Interface Documentation
|
Variables | |
final int | MSG_RI_ADD_MARKER = 906 |
Draws a marker onto the map
The marker has to be given as a png file and must be sent with a FileProvider:
To grant the navigator access to the image that should be set, the "ImageName" must be filled with the uri of the image file generated by a FileProvider(needed for Android >= 10). The steps to grant a permission is as following:
<provider android:name="androidx.core.content.FileProvider" android:authorities="com.ptvag.navigation.ritest.fileprovider" android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/filepaths"></meta-data> </provider>
The "Tag" field describes a string identifier for one or multiple markers. Removing markers will be done by this identifier. Multiple markers can have the same tag. The tag is used in MSG_RI_REMOVE_MARKER to identify which markers should be removed. If no tag is given, the marker will get a default tag (to remove these tags, also omit the tag in MSG_RI_REMOVE_MARKER).
The image anchor represents the point where the real world coordinate is located on the image. It is in the upper left corner of the image per default. The "ImageOffsetX/ImageOffsetY" fields are float parameters that move the image anchor relatively by the offset. Positive values will move the anchor to the right / down, negative offsets will move it to the left / up. An offset of (0.5, 0.5) will move the anchor to the center of the image. Default is (0.5, 0.5).
If a "Label" ist given, a text will be shown at the marker depending of the "LabelAlignment" and the "LabelOffset". The "LabelAlignment" parameter describes how the label is aligned to the image anchor. Valid values are "left,right,center". Default is "center". The label can be moved relatively to the image anchor by setting the LabelOffsetX/LabelOffsetY parameters. Default is LabelOffsetX: 0.0, LabelOffsetY: 25.0 The label can be sized with "LabelSize", the default size is 16.0.
Key | Value | Type | Info |
---|---|---|---|
Tag | Tag for the marker, will be used as an identifier for later removal of the marker, optional, if not set, a default tag will be set | String | |
ImageName | The file provider path of the image that should be shown as a marker (mandatory) | String | |
Latitude | The Latitude of the marker (mandatory) | Double | |
Longitude | The longitude of the marker (mandatory) | Double | |
ImageOffsetX | X image offset relative to the image anchor, default is 0.5 (optional) | Float | |
ImageOffsetY | Y image offset relative to the image anchor, default is 0.5 (optional) | Float | |
Label | A label text (optional) | String | |
LabelOffsetX | X label offset relative to the image anchor (optional) | Float | |
LabelOffsetY | Y label offset relative to the image anchor, default is 25.0 (optional) | Float | |
LabelAlignment | Alignment of the label relative to the image anchor, valid values are "left,right,center", default is "center" (optional) | String | |
LabelSize | Size of the label, default is 16.0 (optional) | Double |
RI_ERROR_NONE if everything is ok.
RI_ERROR_RI_DISABLED if the Remote Interface service is disabled and/or not licensed.
RI_ERROR_NOT_INITIALIZED if the Remote Interface service is not initialized yet.
RI_ERROR_INVALID_PARAMETER if one of the input variables are not correct.
RI_ERROR_FILE_ACCESS if the image cannot be accessed.
RI_ERROR_NO_LICENSE if the navigator has no valid license.
© PTV Logistics 2024 | Generated on Tue May 27 2025 16:37:35 for PTV Navigator Remote Interface Documentation by ![]() |