Skip to content

Latest commit

 

History

History
592 lines (479 loc) · 5.8 KB

GoogleMap.md

File metadata and controls

592 lines (479 loc) · 5.8 KB

GoogleMap

API

Examples

API

Properties

Name Default Description
cameraPosition: CameraPosition;
{
  position: {
    latitude: 0,
    longitude: 0
  },
  zoom: 0
}
Gets or sets the current position of the camera.
isAmbientEnabled: boolean;

false

Android only: Sets the value whether ambient-mode styling should be enabled.
isBuildingsEnabled: boolean;

false

Gets or sets the value whether 3D buildings layer is enabled.
isCameraAnimationEnabled: boolean;

true

Gets or sets the value whether animate the movement of the camera.
isIndoorEnabled: boolean;

false

Gets or sets the value whether indoor maps are currently enabled.
isMyLocationEnabled: boolean;

false

Gets or sets the value whether enables or disables the my-location layer.
isTrafficEnabled: boolean;

false

Gets or sets the value whether the map is drawing traffic data.
mapStyle: string;
Gets or sets the styling of the base map.
mapType: MapType;

MapType.normal

Gets or sets the type of map that's currently displayed.
maxZoomLevel: number;
21 Gets or sets the maximum zoom level for the current camera position. This takes into account what map type is currently being used, e.g., satellite or terrain may have a lower max zoom level than the base map tiles.
minZoomLevel: number;
0 Gets or sets the minimum zoom level. This is the same for every location (unlike the maximum zoom level) but may vary between devices and map sizes.
projection: Projection;
Gets a Projection object that you can use to convert between screen coordinates and latitude/longitude coordinates.
uiSettings: UiSettings;
{
  isCompassEnabled: false,
  isIndoorLevelPickerEnabled: false,
  isMapToolbarEnabled: false,
  isMyLocationButtonEnabled: false,
  isRotateGesturesEnabled: true,
  isScrollGesturesEnabled: true,
  isTiltGesturesEnabled: true,
  isZoomControlsEnabled: false,
  isZoomGesturesEnabled: true
}
Gets or set the user interface settings for the map.

Events

Name Data Description
cameraIdle
cameraMove
cameraMoveCanceled
cameraMoveStart
mapReady
mapTap
mapLoaded
mapLongTap
markerTap
markerDrag
markerDragEnd
markerDragStart
circleTap
polygonTap
polylineTap
poiTap
groundOverlayTap
myLocationButtonTap
myLocationTap
cameraIdle
cameraMove
cameraMoveCanceled
cameraMoveStart

Examples

NativeScript

<Page
    xmlns="http://schemas.nativescript.org/tns.xsd"
    xmlns:gmap="nativescript-google-maps">
    <GridLayout>
        <gmap:GoogleMap
            cameraPosition="-33.852,151.211">
            <gmap:Marker
                position="-33.852,151.211"/>
        </GoogleMap>
    </GridLayout>
</Page>

Vue

<template>
    <Page>
        <GridLayout>
            <GMap
                :cameraPosition="cameraPosition">
                <GMapMarker
                    :position="markerPosition"/>
            </GMap>
        </GridLayout>
    </Page>
</template>

<script lang="ts">
import Vue from "nativescript-vue";

export default Vue.extend({
    data() {
        return {
            cameraPosition: {
                latitude: -33.852,
                longitude: 151.211,
                zoom: 18
            },
            markerPosition: {
                latitude: -33.852,
                longitude: 151.211
            }
        }
    }
});
</script>