Module: @openmobilehub/maps-core
React Native OMH Maps Core Package
Namespaces
Classes
Interfaces
Type Aliases
InfoWindowCloseEvent
Ƭ InfoWindowCloseEvent: NativeSyntheticEvent
<>
Event triggered when an info window is closed.
Defined in
packages/core/src/components/marker/OmhMarker.types.ts:143
InfoWindowLongPressEvent
Ƭ InfoWindowLongPressEvent: MarkerPositionCarryingOmhEvent
Event triggered when an info window is long pressed.
Defined in
packages/core/src/components/marker/OmhMarker.types.ts:138
InfoWindowOpenEvent
Ƭ InfoWindowOpenEvent: NativeSyntheticEvent
<>
Event triggered when an info window is opened.
Defined in
packages/core/src/components/marker/OmhMarker.types.ts:148
InfoWindowPressEvent
Ƭ InfoWindowPressEvent: OmhEvent
<{ position?
: OmhCoordinate
}>
Event triggered when an info window is pressed.
Defined in
packages/core/src/components/marker/OmhMarker.types.ts:133
MarkerDragEndEvent
Ƭ MarkerDragEndEvent: MarkerPositionCarryingOmhEvent
Event triggered when a marker drag ends.
Defined in
packages/core/src/components/marker/OmhMarker.types.ts:128
MarkerDragEvent
Ƭ MarkerDragEvent: MarkerPositionCarryingOmhEvent
Event triggered when a marker is being dragged.
Defined in
packages/core/src/components/marker/OmhMarker.types.ts:123
MarkerDragStartEvent
Ƭ MarkerDragStartEvent: MarkerPositionCarryingOmhEvent
Event triggered when a marker drag starts.
Defined in
packages/core/src/components/marker/OmhMarker.types.ts:118
MarkerPressEvent
Ƭ MarkerPressEvent: MarkerPositionCarryingOmhEvent
Event triggered when a marker is pressed.
Defined in
packages/core/src/components/marker/OmhMarker.types.ts:113
OmhAnchor
Ƭ OmhAnchor: Object
An anchor offset.
Type declaration
Name | Type | Description |
---|---|---|
u | number | The normalized (0 - 1 ) X coordinate specifier; default: 0.5 . |
v | number | The normalized (0 - 1 ) Y coordinate specifier; default: 0.5 . |
Defined in
packages/core/src/types/common.ts:34
OmhCameraMoveStartedReason
Ƭ OmhCameraMoveStartedReason: "unknown"
| "gesture"
| "apiAnimation"
| "developerAnimation"
Reason for the camera movement on the map.
Defined in
packages/core/src/components/mapView/OmhMapView.types.ts:8
OmhCap
Ƭ OmhCap: { type
: "butt"
| "round"
| "square"
} | { icon
: number
; refWidth
: number
; type
: "custom"
}
Cap types for polyline.
Defined in
packages/core/src/components/polyline/OmhPolyline.types.ts:49
OmhCapProps
Ƭ OmhCapProps: { cap?
: OmhCap
; endCap?
: never
; startCap?
: never
} | { cap?
: never
; endCap?
: OmhCap
; startCap?
: OmhCap
}
Cap variants for polyline. Depending on the provider, start cap and end cap can be set separately. If only cap is set, it will be used for both start and end.
Defined in
packages/core/src/components/polyline/OmhPolyline.types.ts:64
OmhColor
Ƭ OmhColor: number
A color value.
Defined in
packages/core/src/types/common.ts:22
OmhCoordinate
Ƭ OmhCoordinate: Object
A geographical coordinate.
Type declaration
Name | Type | Description |
---|---|---|
latitude | number | The latitude of the coordinate. |
longitude | number | The longitude of the coordinate. |
Defined in
packages/core/src/types/common.ts:12
OmhEvent
Ƭ OmhEvent<T
>: NativeSyntheticEvent
<T
>
A common abstraction of map event.
Type parameters
Name | Description |
---|---|
T | The native event type. |
Defined in
packages/core/src/types/common.ts:7
OmhIcon
Ƭ OmhIcon: { height?
: number
; uri
: string
; width?
: number
} | ImageRequireSource
An icon, which can be either a URI source or an imported/required image source.
Defined in
packages/core/src/types/common.ts:27
OmhLineJoin
Ƭ OmhLineJoin: "miter"
| "round"
| "bevel"
The type of line join.
Defined in
packages/core/src/types/common.ts:44
OmhMapProvider
Ƭ OmhMapProvider: Object
A map provider, used to initialize the map view.
Type declaration
Name | Type | Description |
---|---|---|
name | OmhMapProviderName | The name of the provider. |
path | string | Android only: path to the implementation class. |
Defined in
packages/core/src/types/common.ts:69
OmhMapProviderName
Ƭ OmhMapProviderName: string
A provider name type.
Defined in
packages/core/src/types/common.ts:64
OmhMapViewProps
Ƭ OmhMapViewProps: ViewProps
& { mapStyle?
: string
| object
; myLocationEnabled?
: boolean
; onCameraIdle?
: () => void
; onCameraMoveStarted?
: (reason
: OmhCameraMoveStartedReason
) => void
; onMapLoaded?
: (providerName
: string
) => void
; onMapReady?
: () => void
; onMyLocationClicked?
: () => void
; rotateEnabled?
: boolean
; zoomEnabled?
: boolean
}
The OMH Map View properties.
Defined in
packages/core/src/components/mapView/OmhMapView.types.ts:22
OmhMapViewRef
Ƭ OmhMapViewRef: Object
The OMH Map View reference.
Type declaration
Name | Type | Description |
---|---|---|
getCameraCoordinate | () => Promise <OmhCoordinate | null > | - |
getProviderName | () => OmhMapProviderName | - |
setCameraCoordinate | (coordinate : OmhCoordinate , zoomLevel : number ) => Promise <void > | - |
takeSnapshot | (resultFormat : OmhSnapshotFormat ) => Promise <string > | - |
Defined in
packages/core/src/components/mapView/OmhMapView.types.ts:46
OmhMarkerEvents
Ƭ OmhMarkerEvents: Partial
<{ onDrag
: (event
: MarkerDragEvent
) => void
; onDragEnd
: (event
: MarkerDragEndEvent
) => void
; onDragStart
: (event
: MarkerDragStartEvent
) => void
; onInfoWindowClose
: (event
: InfoWindowCloseEvent
) => void
; onInfoWindowLongPress
: (event
: InfoWindowLongPressEvent
) => void
; onInfoWindowOpen
: (event
: InfoWindowOpenEvent
) => void
; onInfoWindowPress
: (event
: InfoWindowPressEvent
) => void
; onPress
: (event
: MarkerPressEvent
) => void
}>
Events for the OmhMarker component.
Defined in
packages/core/src/components/marker/OmhMarker.types.ts:153
OmhMarkerProperties
Ƭ OmhMarkerProperties: Object
Properties for the OmhMarker component.
Type declaration
Name | Type | Description |
---|---|---|
alpha? | number | The alpha (transparency) of the marker. |
anchor? | OmhAnchor | The anchor point of marker image. |
backgroundColor? | OmhColor | The RGB background color of the marker represented as an integer. |
clickable? | boolean | Whether the marker is clickable. If the marker is not clickable, the info window associated with this marker will be disabled and no click events will be propagated. Default: true . |
consumeMarkerClicks? | boolean | Controls whether the default behaviour of a clicked marker (such as opening an info window on click) for a marker click event; identical to returning true from native android code in OmhOnMarkerClickListener.onMarkerClick . The reasoning behind this is that RN does not support synchronous bi-directional callbacks for passing data in new architecture. See https://openmobilehub.github.io/android-omh-maps/api-docs/packages/core/com.openmobilehub.android.maps.core.presentation.interfaces.maps/-omh-on-marker-click-listener/on-marker-click.html |
draggable? | boolean | Whether the marker is draggable. Default: false . |
icon? | OmhIcon | The image to be used as the marker icon. |
infoWindowAnchor? | OmhAnchor | The anchor point of marker info window. |
isFlat? | boolean | Whether the marker is flat (stuck to the map) or is a billboard (rotates and tilts with the camera). Default: false (billboard). |
isVisible? | boolean | Whether the marker is visible. |
markerZIndex? | number | The zIndex of the marker, which specifies the order in which the marker is drawn on the map. |
position | OmhCoordinate | The OmhCoordinate value for the marker's position on the map. Please note that this property needs to be updated when the marker is finished being dragged, otherwise upon a change in properties, it will remain stuck at the property-position. |
rotation? | number | The rotation of the marker (degrees, clockwise) with respect to the map; default: 0 . |
snippet? | string | The text snippet to be shown below marker title. |
title? | string | A text string that's displayed in an info window when the user taps the marker. |
Defined in
packages/core/src/components/marker/OmhMarker.types.ts:19
OmhMarkerProps
Ƭ OmhMarkerProps: ViewProps
& OmhMarkerProperties
& OmhMarkerEvents
The OMH Marker properties.
Defined in
packages/core/src/components/marker/OmhMarker.types.ts:14
OmhMarkerRef
Ƭ OmhMarkerRef: Object
The OMH Marker reference.
Type declaration
Name | Type | Description |
---|---|---|
hideInfoWindow | () => void | - |
showInfoWindow | () => void | - |
Defined in
packages/core/src/components/marker/OmhMarker.types.ts:192
OmhPatternItem
Ƭ OmhPatternItem: { variant
: "dot"
} | { length
: number
; variant
: "dash"
| "gap"
}
An item in a pattern.
Defined in
packages/core/src/types/common.ts:49
OmhPolygonProps
Ƭ OmhPolygonProps: ViewProps
& { clickable?
: boolean
; consumePolygonClicks?
: boolean
; fillColor?
: OmhColor
; holes?
: OmhCoordinate
[][] ; isVisible?
: boolean
; onPolygonClick?
: (eventConsumed
: boolean
) => void
; outline
: OmhCoordinate
[] ; strokeColor?
: OmhColor
; strokeJointType?
: OmhLineJoin
; strokePattern?
: OmhPatternItem
[] ; strokeWidth?
: number
; zIndex?
: number
}
The OMH Polygon properties.
Defined in
packages/core/src/components/polygon/OmhPolygon.types.ts:12
OmhPolylineProps
Ƭ OmhPolylineProps: OmhCapProps
& ViewProps
& { clickable?
: boolean
; color?
: OmhColor
; consumePolylineClicks?
: boolean
; isVisible?
: boolean
; jointType?
: OmhLineJoin
; onPolylineClick?
: (eventConsumed
: boolean
) => void
; pattern?
: OmhPatternItem
[] ; points
: OmhCoordinate
[] ; spans?
: OmhSpan
[] ; width?
: number
; zIndex?
: number
}
The Omh Polyline properties.
Defined in
packages/core/src/components/polyline/OmhPolyline.types.ts:79
OmhSnapshotFormat
Ƭ OmhSnapshotFormat: "png"
| "jpg"
| "base64"
The OMH Snapshot format.
Defined in
packages/core/src/components/mapView/OmhMapView.types.ts:17
OmhSpan
Ƭ OmhSpan: OmhSpanCommon
& OmhMonochromaticSpan
| OmhGradientSpan
The OmhSpan type, which can be either monochromatic or gradient.
Defined in
packages/core/src/components/polyline/OmhPolyline.types.ts:44
Providers
Ƭ Providers: Object
A map provider pair.
Type declaration
Name | Type | Description |
---|---|---|
gmsProvider | OmhMapProvider | Provider for devices with Google Play Services availability. |
iosProvider | OmhMapProvider | - |
nonGmsProvider | OmhMapProvider | Provider for devices without Google Play Services availability. |
Defined in
packages/core/src/types/common.ts:79
Variables
OmhMapsAppleMapsIOSProvider
• Const
OmhMapsAppleMapsIOSProvider: OmhMapProvider
Defined in
packages/core/src/modules/ios/providers.ts:8
OmhMapsGoogleMapsIOSProvider
• Const
OmhMapsGoogleMapsIOSProvider: OmhMapProvider
Defined in
packages/core/src/modules/ios/providers.ts:3
OmhMapsLocationModule
• Const
OmhMapsLocationModule: IOmhMapsLocationModule
Defined in
packages/core/src/modules/location/OmhMapsLocationModule.ts:7
OmhMapsModule
• Const
OmhMapsModule: IOmhMapsModule
Defined in
packages/core/src/modules/core/OmhMapsModule.ts:5
Functions
OmhMapView
▸ OmhMapView(props
): ReactNode
The OMH Map View component. Actual implementation is picked based on the platform capabilities (GMS or non-GMS)
and availability of installed providers (@openmobilehub/maps-plugin-*
).
Parameters
Name | Type |
---|---|
props | ViewProps & { mapStyle? : string | object ; myLocationEnabled? : boolean ; onCameraIdle? : () => void ; onCameraMoveStarted? : (reason : OmhCameraMoveStartedReason ) => void ; onMapLoaded? : (providerName : string ) => void ; onMapReady? : () => void ; onMyLocationClicked? : () => void ; rotateEnabled? : boolean ; zoomEnabled? : boolean } & RefAttributes <OmhMapViewRef > |
Returns
ReactNode
Defined in
packages/core/src/components/mapView/OmhMapView.tsx:32
OmhMarker
▸ OmhMarker(props
): ReactNode
The OMH Marker component.
Parameters
Name | Type |
---|---|
props | ViewProps & OmhMarkerProperties & Partial <{ onDrag : (event : MarkerPositionCarryingOmhEvent ) => void ; onDragEnd : (event : MarkerPositionCarryingOmhEvent ) => void ; onDragStart : (event : MarkerPositionCarryingOmhEvent ) => void ; onInfoWindowClose : (event : InfoWindowCloseEvent ) => void ; onInfoWindowLongPress : (event : MarkerPositionCarryingOmhEvent ) => void ; onInfoWindowOpen : (event : InfoWindowOpenEvent ) => void ; onInfoWindowPress : (event : InfoWindowPressEvent ) => void ; onPress : (event : MarkerPositionCarryingOmhEvent ) => void }> & RefAttributes <OmhMarkerRef > |
Returns
ReactNode
Defined in
packages/core/src/components/marker/OmhMarker.tsx:20
OmhPolygon
▸ OmhPolygon(«destructured»
): Element
Parameters
Name | Type |
---|---|
«destructured» | OmhPolygonProps |
Returns
Element
Defined in
packages/core/src/components/polygon/OmhPolygon.tsx:5
OmhPolyline
▸ OmhPolyline(«destructured»
): Element
Parameters
Name | Type |
---|---|
«destructured» | OmhPolylineProps |
Returns
Element