mugundhan-googlemap v1.1.2
mugundhan-googlemap
Capacitor Google Map for Android and Ios
Install
npm install mugundhan-googlemap
npx cap syncAPI
echo(...)create(...)initialize(...)addMarker(...)setCamera(...)setMapType(...)setIndoorEnabled(...)setTrafficEnabled(...)accessibilityElementsHidden(...)padding(...)clear()close()hide()show()settings(...)reverseGeocodeCoordinate(...)enableCurrentLocation(...)myLocation(...)viewBounds()setMapStyle(...)addPolyline(...)addCircle(...)addPolygon(...)setOnMarkerClickListener()setOnMapClickListener()setOnPoiClickListener()requestLocationPermission()setOnMyLocationClickListener()setOnMyLocationButtonClickListener()addListener('didTap', ...)addListener('dragEnded', ...)addListener('didTapAt', ...)addListener('didTapPOIWithPlaceID', ...)addListener('didChange', ...)addListener('onMapReady', ...)addListener(string, ...)removeAllListeners()- Interfaces
echo(...)
echo(options: { value: string; }) => any| Param | Type |
|---|---|
options | { value: string; } |
Returns: any
create(...)
create(options: { width: number; height: number; x: number; y: number; latitude?: number; longitude?: number; zoom?: number; liteMode?: boolean; }) => any| Param | Type |
|---|---|
options | { width: number; height: number; x: number; y: number; latitude?: number; longitude?: number; zoom?: number; liteMode?: boolean; } |
Returns: any
initialize(...)
initialize(options: { key: string; }) => any| Param | Type |
|---|---|
options | { key: string; } |
Returns: any
addMarker(...)
addMarker(options: { latitude: number; longitude: number; opacity?: number; title?: string; snippet?: string; isFlat?: boolean; url?: string; rotation?: number; key?: string; }) => anyAdds a marker on the map
| Param | Type |
|---|---|
options | { latitude: number; longitude: number; opacity?: number; title?: string; snippet?: string; isFlat?: boolean; url?: string; rotation?: number; key?: string; } |
Returns: any
setCamera(...)
setCamera(options: { viewingAngle?: number; bearing?: number; zoom?: number; latitude?: number; longitude?: number; animate?: boolean; animationDuration?: number; coordinates?: LatLng[]; }) => anyRepositions the camera
| Param | Type |
|---|---|
options | { viewingAngle?: number; bearing?: number; zoom?: number; latitude?: number; longitude?: number; animate?: boolean; animationDuration?: number; coordinates?: {}; } |
Returns: any
setMapType(...)
setMapType(options: { type: string; }) => anySets the map type
| Param | Type |
|---|---|
options | { type: string; } |
Returns: any
setIndoorEnabled(...)
setIndoorEnabled(options: { enabled: boolean; }) => anyAllows indoor maps to be enabled or disabled
| Param | Type |
|---|---|
options | { enabled: boolean; } |
Returns: any
setTrafficEnabled(...)
setTrafficEnabled(options: { enabled: boolean; }) => anyAllows traffic information to be enabled or disabled
| Param | Type |
|---|---|
options | { enabled: boolean; } |
Returns: any
accessibilityElementsHidden(...)
accessibilityElementsHidden(options: { hidden: boolean; }) => anyiOS Only To hide accessiblity elements
| Param | Type |
|---|---|
options | { hidden: boolean; } |
Returns: any
padding(...)
padding(options: { top: number; left: number; right: number; bottom: number; }) => anyAdds padding around the map
| Param | Type |
|---|---|
options | { top: number; left: number; right: number; bottom: number; } |
Returns: any
clear()
clear() => anyClear any views like Marker, Shapes from the map
Returns: any
close()
close() => anyDestroy the mapView, use in ionViewDidLeave and similar
Returns: any
hide()
hide() => anyHide the mapView, use when preventing any overlapping on other views
Returns: any
show()
show() => anyShow the hidden mapView
Returns: any
settings(...)
settings(options: { allowScrollGesturesDuringRotateOrZoom?: boolean; compassButton?: boolean; consumesGesturesInView?: boolean; indoorPicker?: boolean; myLocationButton?: boolean; rotateGestures?: boolean; scrollGestures?: boolean; tiltGestures?: boolean; zoomGestures?: boolean; }) => anyMap UI Settings
| Param | Type |
|---|---|
options | { allowScrollGesturesDuringRotateOrZoom?: boolean; compassButton?: boolean; consumesGesturesInView?: boolean; indoorPicker?: boolean; myLocationButton?: boolean; rotateGestures?: boolean; scrollGestures?: boolean; tiltGestures?: boolean; zoomGestures?: boolean; } |
Returns: any
reverseGeocodeCoordinate(...)
reverseGeocodeCoordinate(options: { latitude: number; longitude: number; }) => anyGet Google Map address for a set of lat lng
| Param | Type |
|---|---|
options | { latitude: number; longitude: number; } |
Returns: any
enableCurrentLocation(...)
enableCurrentLocation(options: { enabled: boolean; }) => anyEnable user's current location
| Param | Type |
|---|---|
options | { enabled: boolean; } |
Returns: any
myLocation(...)
myLocation(options: any) => anyGet user location
| Param | Type |
|---|---|
options | any |
Returns: any
viewBounds()
viewBounds() => anyGet view bounds in latlng. This polygon can be a trapezoid instead of a rectangle, because a camera can have tilt. If the camera is directly over the center of the camera, the shape is rectangular, but if the camera is tilted, the shape will appear to be a trapezoid whose smallest side is closest to the point of view.
Returns: any
setMapStyle(...)
setMapStyle(options: { jsonString: string; }) => anyAdd styles to map with a style JSON string format specific by Google
| Param | Type |
|---|---|
options | { jsonString: string; } |
Returns: any
addPolyline(...)
addPolyline(options: PolylineOptions) => anyShapes
| Param | Type |
|---|---|
options | PolylineOptions |
Returns: any
addCircle(...)
addCircle(options: CircleOptions) => any| Param | Type |
|---|---|
options | CircleOptions |
Returns: any
addPolygon(...)
addPolygon(options: PolygonOptions) => any| Param | Type |
|---|---|
options | PolygonOptions |
Returns: any
setOnMarkerClickListener()
setOnMarkerClickListener() => anyMap click listeners
Returns: any
setOnMapClickListener()
setOnMapClickListener() => anyReturns: any
setOnPoiClickListener()
setOnPoiClickListener() => anyReturns: any
requestLocationPermission()
requestLocationPermission() => anyReturns: any
setOnMyLocationClickListener()
setOnMyLocationClickListener() => anyReturns: any
setOnMyLocationButtonClickListener()
setOnMyLocationButtonClickListener() => anyReturns: any
addListener('didTap', ...)
addListener(eventName: 'didTap', listenerFunc: (results: any) => void) => PluginListenerHandle| Param | Type |
|---|---|
eventName | 'didTap' |
listenerFunc | (results: any) => void |
Returns: PluginListenerHandle
addListener('dragEnded', ...)
addListener(eventName: 'dragEnded', listenerFunc: (results: any) => void) => PluginListenerHandle| Param | Type |
|---|---|
eventName | 'dragEnded' |
listenerFunc | (results: any) => void |
Returns: PluginListenerHandle
addListener('didTapAt', ...)
addListener(eventName: 'didTapAt', listenerFunc: (results: any) => void) => PluginListenerHandle| Param | Type |
|---|---|
eventName | 'didTapAt' |
listenerFunc | (results: any) => void |
Returns: PluginListenerHandle
addListener('didTapPOIWithPlaceID', ...)
addListener(eventName: 'didTapPOIWithPlaceID', listenerFunc: (results: any) => void) => PluginListenerHandle| Param | Type |
|---|---|
eventName | 'didTapPOIWithPlaceID' |
listenerFunc | (results: any) => void |
Returns: PluginListenerHandle
addListener('didChange', ...)
addListener(eventName: 'didChange', listenerFunc: (results: any) => void) => PluginListenerHandle| Param | Type |
|---|---|
eventName | 'didChange' |
listenerFunc | (results: any) => void |
Returns: PluginListenerHandle
addListener('onMapReady', ...)
addListener(eventName: 'onMapReady', listenerFunc: (results: any) => void) => PluginListenerHandle| Param | Type |
|---|---|
eventName | 'onMapReady' |
listenerFunc | (results: any) => void |
Returns: PluginListenerHandle
addListener(string, ...)
addListener(eventName: string, listenerFunc: (...args: any[]) => any) => any| Param | Type |
|---|---|
eventName | string |
listenerFunc | (...args: {}) => any |
Returns: any
removeAllListeners()
removeAllListeners() => anyReturns: any
Interfaces
LatLng
| Prop | Type |
|---|---|
latitude | number |
longitude | number |
PolylineOptions
| Prop | Type |
|---|---|
id | ViewID |
points | {} |
tag | any |
color | string |
width | number |
zIndex | number |
visibility | boolean |
ViewID
| Prop | Type |
|---|---|
androidID | number |
iOSID | number |
CircleOptions
| Prop | Type |
|---|---|
id | ViewID |
center | LatLng |
radius | number |
strokeColor | string |
fillColor | string |
strokeWidth | number |
zIndex | number |
visibility | boolean |
PolygonOptions
| Prop | Type |
|---|---|
id | ViewID |
points | {} |
tag | any |
strokeColor | string |
fillColor | string |
strokeWidth | number |
zIndex | number |
visibility | boolean |
PluginListenerHandle
| Prop | Type |
|---|---|
remove | () => any |