Plugin Escape Hatch
This plugin provides an escape hatch to access the native osmdroid API. This allows developers to use the underlying provider’s API directly, should they need to access a feature of the provider that is not supported by the OMH plugin.
You can obtain the native MapView map instance by casting the OmhMap instance to OmhMapImpl:
import com.openmobilehub.android.maps.plugin.openstreetmap.presentation.maps.OmhMapImpl as OSMOmhMapImpl
...
(omhMap as OSMOmhMapImpl).mapView
For this provider, the following limitations as to the provider’s API apply:
- calling
MapView.setOnTouchListenerwill break touch system for OMH - calling
Marker.remove()will remove the marker from the map, yet theOmhMarkerwon’t be conscious of this change, which will likely lead to an exception - calling
Marker.setOnMarkerClickListenerorMarker.setOnMarkerDragListenerwill break OMH marker interactions system - calling
Polyline.setOnClickListenerwill break OMH polyline interactions system - calling
Polyline.remove()will remove the polyline from the map, yet theOmhPolylinewon’t be conscious of this change, which will likely lead to an exception - calling
Polygon.setOnClickListenerwill break OMH polyline interactions system - calling
Polygon.remove()will remove the polyline from the map, yet theOmhPolygonwon’t be conscious of this change, which will likely lead to an exception - calling
InfoWindow.view.setOnTouchListener,InfoWindow.view.setOnClickListener,InfoWindow.view.setOnLongClickListenerwill break OMH Info Window interactions system