OmhMap

interface OmhMap

Abstraction to provide access to the OmhMap. This is the main class of OMH Maps SDK for Android and is the entry point for all methods related to the map. You cannot instantiate a GoogleMap object directly, rather, you must obtain one from the getMapAsync() method on a OmhMapView that you have added to your application.

Properties

Link copied to clipboard
abstract val mapView: Any

The provider view that displays the map. This is a read-only property.

Link copied to clipboard
abstract val providerName: String

The name of the map provider. This is a read-only property.

Functions

Link copied to clipboard
abstract fun addMarker(options: OmhMarkerOptions): OmhMarker?

Adds a marker to this map. The marker's icon is rendered on the map at the position.

Link copied to clipboard
abstract fun addPolygon(options: OmhPolygonOptions): OmhPolygon?

Adds a polygon to this map. The polygon is rendered on the map based on the provided options.

Link copied to clipboard
abstract fun addPolyline(options: OmhPolylineOptions): OmhPolyline?

Adds a polyline to this map. The polyline is rendered on the map based on the provided options.

Link copied to clipboard

Gets the camera's position.

Link copied to clipboard

Gets the status of the my-location layer.

Link copied to clipboard
abstract fun moveCamera(coordinate: OmhCoordinate, zoomLevel: Float)

Moves the camera's position to a specific position.

Link copied to clipboard

Customizes the design of the info window contents. Only applicable if setCustomInfoWindowViewFactory is not set or has been set to null.

Link copied to clipboard

Customizes the design of the info window. The passed-in factory is called with instances of OmhMarker and should return a android.view.View to be used as the info window. If the factory is set to null, the default info window appearance will be used.

Link copied to clipboard
abstract fun setMapStyle(json: Int?)

Sets the style of the map based on a JSON resource. The JSON file should define the styles for the map elements.

abstract fun setMapStyle(jsonString: String?)

Sets the style of the map based on a provided string. The string should define the styles for the map elements.

Link copied to clipboard
abstract fun setMyLocationButtonClickListener(omhOnMyLocationButtonClickListener: OmhOnMyLocationButtonClickListener)

Sets a callback that's invoked when the my location button is clicked.

Link copied to clipboard
@RequiresPermission(anyOf = ["android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION"])
abstract fun setMyLocationEnabled(enable: Boolean)

Enables or disables the my location layer.

Link copied to clipboard

Sets the callback that is invoked when the camera movement has ended.

Link copied to clipboard

Sets the callback that's invoked when the camera starts moving or the reason for camera motion has changed.

Link copied to clipboard

The callback to be executed when the info window is clicked.

Link copied to clipboard

The callback to be executed when the info window is long-clicked.

Link copied to clipboard

The callbacks to be executed when the info window changes its open state.

Link copied to clipboard

Sets a callback that's invoked when this map has finished rendering. The callback will only be invoked once. If this method is called when the map is fully rendered, the callback will be invoked immediately. This event will not fire if the map never loads due to connectivity issues, or if the map is continuously changing and never completes loading due to the user constantly interacting with the map.

Link copied to clipboard

The callback to be executed when the marker is clicked.

Link copied to clipboard

The callbacks to be executed on proper marker drag events.

Link copied to clipboard

Sets a callback that's invoked when a polygon on the map is clicked.

Link copied to clipboard

Sets a callback that's invoked when a polyline on the map is clicked.

Link copied to clipboard
abstract fun setRotateGesturesEnabled(enableRotateGestures: Boolean)

Enables or disables the rotate gestures in the map.

Link copied to clipboard
abstract fun setZoomGesturesEnabled(enableZoomGestures: Boolean)

Enables or disables the zoom gestures in the map.

Link copied to clipboard
abstract fun snapshot(omhSnapshotReadyCallback: OmhSnapshotReadyCallback)

Takes a snapshot of the map.