0.8.0 • Published 10 months ago

capacitor-custom-google-maps v0.8.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

capacitor-custom-google-maps

capacitor custom plugin google maps

  • add function for create circle on the maps (support for web, android and ios)
  • support hide my location button if the my location is true

Install

npm install capacitor-custom-google-maps
npx cap sync

API

create(...)

create(options: CreateMapArgs) => Promise<void>
ParamType
optionsCreateMapArgs

addCircle(...)

addCircle(args: CircleOptions) => Promise<void>
ParamType
argsCircleOptions

addMarker(...)

addMarker(args: AddMarkerArgs) => Promise<{ id: string; }>
ParamType
argsAddMarkerArgs

Returns: Promise<{ id: string; }>


addMarkers(...)

addMarkers(args: AddMarkersArgs) => Promise<{ ids: string[]; }>
ParamType
argsAddMarkersArgs

Returns: Promise<{ ids: string[]; }>


removeMarker(...)

removeMarker(args: RemoveMarkerArgs) => Promise<void>
ParamType
argsRemoveMarkerArgs

removeMarkers(...)

removeMarkers(args: RemoveMarkersArgs) => Promise<void>
ParamType
argsRemoveMarkersArgs

enableClustering(...)

enableClustering(args: { id: string; }) => Promise<void>
ParamType
args{ id: string; }

disableClustering(...)

disableClustering(args: { id: string; }) => Promise<void>
ParamType
args{ id: string; }

destroy(...)

destroy(args: DestroyMapArgs) => Promise<void>
ParamType
argsDestroyMapArgs

setCamera(...)

setCamera(args: CameraArgs) => Promise<void>
ParamType
argsCameraArgs

setMapType(...)

setMapType(args: MapTypeArgs) => Promise<void>
ParamType
argsMapTypeArgs

enableIndoorMaps(...)

enableIndoorMaps(args: IndoorMapArgs) => Promise<void>
ParamType
argsIndoorMapArgs

enableTrafficLayer(...)

enableTrafficLayer(args: TrafficLayerArgs) => Promise<void>
ParamType
argsTrafficLayerArgs

enableAccessibilityElements(...)

enableAccessibilityElements(args: AccElementsArgs) => Promise<void>
ParamType
argsAccElementsArgs

enableCurrentLocation(...)

enableCurrentLocation(args: CurrentLocArgs) => Promise<void>
ParamType
argsCurrentLocArgs

setMyLocationButtonEnabled(...)

setMyLocationButtonEnabled(args: CurrentLocArgs) => Promise<void>
ParamType
argsCurrentLocArgs

setPadding(...)

setPadding(args: PaddingArgs) => Promise<void>
ParamType
argsPaddingArgs

onScroll(...)

onScroll(args: OnScrollArgs) => Promise<void>
ParamType
argsOnScrollArgs

dispatchMapEvent(...)

dispatchMapEvent(args: { id: string; focus: boolean; }) => Promise<void>
ParamType
args{ id: string; focus: boolean; }

getMapBounds(...)

getMapBounds(args: { id: string; }) => Promise<LatLngBounds>
ParamType
args{ id: string; }

Returns: Promise<LatLngBounds>


checkMockLocation(...)

checkMockLocation(args: { id: string; }) => Promise<{ isMockLocation: boolean; }>
ParamType
args{ id: string; }

Returns: Promise<{ isMockLocation: boolean; }>


Interfaces

CreateMapArgs

An interface containing the options used when creating a map.

PropTypeDescriptionDefault
idstringA unique identifier for the map instance.
apiKeystringThe Google Maps SDK API Key.
configGoogleMapConfigThe initial configuration settings for the map.
elementHTMLElementThe DOM element that the Google Map View will be mounted on which determines size and positioning.
forceCreatebooleanDestroy and re-create the map instance if a map with the supplied id already existsfalse

GoogleMapConfig

For web, all the javascript Google Maps options are available as GoogleMapConfig extends google.maps.MapOptions. For iOS and Android only the config options declared on GoogleMapConfig are available.

PropTypeDescriptionDefaultSince
widthnumberOverride width for native map.
heightnumberOverride height for native map.
xnumberOverride absolute x coordinate position for native map.
ynumberOverride absolute y coordinate position for native map.
centerLatLngDefault location on the Earth towards which the camera points.
zoomnumberSets the zoom of the map.
androidLiteModebooleanEnables image-based lite mode on Android.false
devicePixelRationumberOverride pixel ratio for native map.
stylesMapTypeStyle[] | nullStyles to apply to each of the default map types. Note that for satellite, hybrid and terrain modes, these styles will only apply to labels and geometry.4.3.0

LatLng

An interface representing a pair of latitude and longitude coordinates.

PropTypeDescription
latnumberCoordinate latitude, in degrees. This value is in the range -90, 90.
lngnumberCoordinate longitude, in degrees. This value is in the range -180, 180.

CircleOptions

An interface representing the viewports latitude and longitude bounds.

PropType
radiusnumber
mapIdstring
centerLatLng
fillColorstring
strokeColorstring
strokeWidthnumber

AddMarkerArgs

PropType
idstring
markerMarker

Marker

A marker is an icon placed at a particular point on the map's surface.

PropTypeDescriptionDefaultSince
coordinateLatLngMarker position
opacitynumberSets the opacity of the marker, between 0 (completely transparent) and 1 inclusive.1
titlestringTitle, a short description of the overlay.
snippetstringSnippet text, shown beneath the title in the info window when selected.
isFlatbooleanControls whether this marker should be flat against the Earth's surface or a billboard facing the camera.false
iconUrlstringPath to a marker icon to render. It can be relative to the web app public directory, or a https url of a remote marker icon. SVGs are not supported on native platforms.4.2.0
iconSizeSizeControls the scaled size of the marker image set in iconUrl.4.2.0
iconOriginPointThe position of the image within a sprite, if any. By default, the origin is located at the top left corner of the image .4.2.0
iconAnchorPointThe position at which to anchor an image in correspondence to the location of the marker on the map. By default, the anchor is located along the center point of the bottom of the image.4.2.0
tintColor{ r: number; g: number; b: number; a: number; }Customizes the color of the default marker image. Each value must be between 0 and 255. Only for iOS and Android.4.2.0
draggablebooleanControls whether this marker can be dragged interactivelyfalse

Size

PropType
widthnumber
heightnumber

Point

PropType
xnumber
ynumber

AddMarkersArgs

PropType
idstring
markersMarker[]

RemoveMarkerArgs

PropType
idstring
markerIdstring

RemoveMarkersArgs

PropType
idstring
markerIdsstring[]

DestroyMapArgs

PropType
idstring

CameraArgs

PropType
idstring
configCameraConfig

CameraConfig

Configuration properties for a Google Map Camera

PropTypeDescriptionDefault
coordinateLatLngLocation on the Earth towards which the camera points.
zoomnumberSets the zoom of the map.
bearingnumberBearing of the camera, in degrees clockwise from true north.0
anglenumberThe angle, in degrees, of the camera from the nadir (directly facing the Earth). The only allowed values are 0 and 45.0
animatebooleanAnimate the transition to the new Camera properties.false
animationDurationnumberThis configuration option is not being used.

MapTypeArgs

PropType
idstring
mapTypeMapType

IndoorMapArgs

PropType
idstring
enabledboolean

TrafficLayerArgs

PropType
idstring
enabledboolean

AccElementsArgs

PropType
idstring
enabledboolean

CurrentLocArgs

PropType
idstring
enabledboolean

PaddingArgs

PropType
idstring
paddingMapPadding

MapPadding

Controls for setting padding on the 'visible' region of the view.

PropType
topnumber
leftnumber
rightnumber
bottomnumber

OnScrollArgs

PropType
idstring
mapBounds{ x: number; y: number; width: number; height: number; }

LatLngBounds

An interface representing the viewports latitude and longitude bounds.

PropType
southwestLatLng
centerLatLng
northeastLatLng

Enums

MapType

MembersValueDescription
Normal'Normal'Basic map.
Hybrid'Hybrid'Satellite imagery with roads and labels.
Satellite'Satellite'Satellite imagery with no labels.
Terrain'Terrain'Topographic data.
None'None'No base map tiles.
0.8.0

10 months ago

0.7.0

10 months ago

0.6.0

10 months ago

0.5.0

12 months ago

0.4.0

2 years ago

0.3.9

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.3.1

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.0

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago