UNPKG

@nativescript/google-maps

Version:
455 lines (454 loc) 19.3 kB
import { Color, ImageSource } from '@nativescript/core'; import { CircleOptions, Coordinate, CoordinateBounds, GroundOverlayOptions, ICameraPosition, ICameraUpdate, ICap, ICircle, IGoogleMap, IGroundOverlay, IIndoorBuilding, IIndoorLevel, ILocation, IMarker, IPatternItem, IPoi, IPolygon, IPolyline, IProjection, ITileOverlay, ITileProvider, IUISettings, IVisibleRegion, MarkerOptions, PolygonOptions, PolylineOptions, Style, TileOverlayOptions } from '.'; import { JointType, MapType, MapViewBase } from './common'; export { hueFromColor, intoNativeMarkerOptions } from './utils'; export declare class Location implements ILocation { private _native; static fromNative(location: android.location.Location): Location; get native(): globalAndroid.location.Location; get android(): globalAndroid.location.Location; get altitudeAccuracy(): number; get accuracy(): number; get coordinate(): Coordinate; get timestamp(): Date; get altitude(): number; get speed(): number; get heading(): number; } export declare class MapView extends MapViewBase { mapView: com.google.android.gms.maps.MapView; lifeCycleHooks: any; createdBundle: any; savedBundle: any; _listener: com.google.android.gms.maps.OnMapReadyCallback; _map: com.google.android.gms.maps.GoogleMap; _destroyed: boolean; createNativeView(): globalAndroid.widget.LinearLayout; initNativeView(): void; disposeNativeView(): void; _updateCamera(map: any, owner: { lat?: any; lng?: any; zoom?: any; tilt?: any; bearing?: any; }): void; _setMapClickListener(map: any, preventDefaultMarkerTapBehavior: any): void; } export declare class IndoorLevel implements IIndoorLevel { _native: com.google.android.gms.maps.model.IndoorLevel; static fromNative(nativeIndoorLevel: com.google.android.gms.maps.model.IndoorLevel): IndoorLevel; get native(): com.google.android.gms.maps.model.IndoorLevel; get android(): com.google.android.gms.maps.model.IndoorLevel; get name(): string; get shortName(): string; } export declare class IndoorBuilding implements IIndoorBuilding { _native: com.google.android.gms.maps.model.IndoorBuilding; static fromNative(nativeIndoorBuilding: com.google.android.gms.maps.model.IndoorBuilding): IndoorBuilding; get native(): com.google.android.gms.maps.model.IndoorBuilding; get android(): com.google.android.gms.maps.model.IndoorBuilding; get defaultLevelIndex(): number; get levels(): IndoorLevel[]; get underground(): boolean; } export declare class UISettings implements IUISettings { _native: com.google.android.gms.maps.UiSettings; static fromNative(nativeUiSettings: com.google.android.gms.maps.UiSettings): UISettings; get native(): com.google.android.gms.maps.UiSettings; get android(): com.google.android.gms.maps.UiSettings; get mapToolbarEnabled(): boolean; set mapToolbarEnabled(value: boolean); get zoomControlsEnabled(): boolean; set zoomControlsEnabled(value: boolean); get zoomGesturesEnabled(): boolean; set zoomGesturesEnabled(value: boolean); get tiltGesturesEnabled(): boolean; set tiltGesturesEnabled(value: boolean); setAllGesturesEnabled(value: boolean): void; get compassEnabled(): boolean; set compassEnabled(value: boolean); get scrollGesturesEnabledDuringRotateOrZoom(): boolean; set scrollGesturesEnabledDuringRotateOrZoom(value: boolean); get rotateGesturesEnabled(): boolean; set rotateGesturesEnabled(value: boolean); get myLocationButtonEnabled(): boolean; set myLocationButtonEnabled(value: boolean); get indoorLevelPickerEnabled(): boolean; set indoorLevelPickerEnabled(value: boolean); get scrollGesturesEnabled(): boolean; set scrollGesturesEnabled(value: boolean); } export declare class GoogleMap implements IGoogleMap { _native: com.google.android.gms.maps.GoogleMap; static fromNative(nativeMap: com.google.android.gms.maps.GoogleMap): GoogleMap; get native(): com.google.android.gms.maps.GoogleMap; get android(): com.google.android.gms.maps.GoogleMap; get cameraPosition(): CameraPosition; set cameraPosition(value: CameraPosition); set mapType(type: MapType); get mapType(): MapType; get uiSettings(): UISettings; get trafficEnabled(): boolean; set trafficEnabled(value: boolean); get maxZoomLevel(): number; set maxZoomLevel(value: number); set minZoomLevel(value: number); get minZoomLevel(): number; get buildingsEnabled(): boolean; set buildingsEnabled(value: boolean); get myLocationEnabled(): boolean; set myLocationEnabled(value: boolean); get projection(): Projection; _mapStyle: Style[]; get mapStyle(): Style[]; set mapStyle(value: Style[]); moveCamera(update: CameraUpdate): void; animateCamera(update: CameraUpdate): void; clear(): void; addMarker(options: MarkerOptions): Marker; removeMarker(marker: Marker): void; addCircle(options: CircleOptions): Circle; removeCircle(circle: Circle): void; addPolygon(options: PolygonOptions): Polygon; removePolygon(polygon: Polygon): void; addPolyline(options: PolylineOptions): Polyline; removePolyline(polyline: Polyline): void; addGroundOverlay(options: GroundOverlayOptions): GroundOverlay; removeGroundOverlay(groundOverlay: GroundOverlay): void; snapshot(): Promise<ImageSource>; addTileOverlay(options: TileOverlayOptions): TileOverlay; removeTileOverlay(overlay: TileOverlay): void; } export declare class CameraUpdate implements ICameraUpdate { _native: com.google.android.gms.maps.CameraUpdate; static fromNative(nativeUpdate: com.google.android.gms.maps.CameraUpdate): CameraUpdate; static fromCoordinate(coordinate: Coordinate, zoom?: number): CameraUpdate; static fromCoordinates(coordinates: Coordinate[], padding: number): any; static fromCameraPosition(position: CameraPosition): CameraUpdate; static zoomIn(): CameraUpdate; static zoomOut(): CameraUpdate; static zoomTo(value: number): CameraUpdate; static zoomBy(amount: number, point?: { x: number; y: number; }): CameraUpdate; static scrollBy(x: number, y: number): CameraUpdate; get native(): com.google.android.gms.maps.CameraUpdate; get android(): com.google.android.gms.maps.CameraUpdate; } export declare class CameraPosition implements ICameraPosition { _native: com.google.android.gms.maps.model.CameraPosition; constructor(target: Coordinate, zoom: number, bearing?: number, tilt?: number); static fromNative(nativePosition: com.google.android.gms.maps.model.CameraPosition): CameraPosition; get native(): com.google.android.gms.maps.model.CameraPosition; get android(): com.google.android.gms.maps.model.CameraPosition; get bearing(): number; set bearing(value: number); get target(): Coordinate; set target(value: Coordinate); get tilt(): number; set tilt(value: number); get zoom(): number; set zoom(value: number); toJSON(): { target: Coordinate; tilt: number; bearing: number; zoom: number; }; } declare abstract class OverLayBase { abstract readonly native: any; get userData(): { [key: string]: any; }; set userData(data: { [key: string]: any; }); } export declare class Marker extends OverLayBase implements IMarker { _native: com.google.android.gms.maps.model.Marker; _color: Color; _icon: ImageSource; constructor(); static fromNative(nativeMarker: com.google.android.gms.maps.model.Marker): Marker; _setIcon(icon: any): void; _setColor(color: any): void; get rotation(): number; set rotation(value: number); get visible(): boolean; set visible(value: boolean); get flat(): boolean; set flat(value: boolean); get color(): Color; set color(value: string | Color); get opacity(): number; set opacity(value: number); get icon(): any; set icon(value: any); get draggable(): boolean; set draggable(value: boolean); get native(): com.google.android.gms.maps.model.Marker; get android(): com.google.android.gms.maps.model.Marker; get position(): { lat: number; lng: number; }; set position(latlng: { lat: number; lng: number; }); get title(): string; set title(value: string); get snippet(): string; set snippet(value: string); get zIndex(): number; set zIndex(value: number); hideInfoWindow(): void; showInfoWindow(): void; } export declare class Circle extends OverLayBase implements ICircle { _native: com.google.android.gms.maps.model.Circle; static fromNative(nativeCircle: com.google.android.gms.maps.model.Circle): Circle; get native(): com.google.android.gms.maps.model.Circle; get android(): com.google.android.gms.maps.model.Circle; get radius(): number; set radius(value: number); get strokeColor(): Color; set strokeColor(value: string | Color); get center(): Coordinate; set center(value: Coordinate); get fillColor(): Color; set fillColor(value: string | Color); get visible(): boolean; set visible(value: boolean); get tappable(): boolean; set tappable(value: boolean); get strokeWidth(): number; set strokeWidth(value: number); get strokePattern(): PatternItem[]; set strokePattern(value: PatternItem[]); get zIndex(): number; set zIndex(value: number); } export declare class Polygon extends OverLayBase implements IPolygon { _native: com.google.android.gms.maps.model.Polygon; static fromNative(nativePolygon: com.google.android.gms.maps.model.Polygon): Polygon; get native(): com.google.android.gms.maps.model.Polygon; get android(): com.google.android.gms.maps.model.Polygon; get points(): Coordinate[]; set points(value: Coordinate[]); addPoint(point: Coordinate): void; addPoints(points: Coordinate[]): void; get holes(): Coordinate[][]; set holes(value: Coordinate[][]); get tappable(): boolean; set tappable(value: boolean); get strokeWidth(): number; set strokeWidth(value: number); get strokeColor(): Color; set strokeColor(value: Color | string); get strokePattern(): PatternItem[]; set strokePattern(value: PatternItem[]); get zIndex(): number; set zIndex(value: number); get geodesic(): boolean; set geodesic(value: boolean); get strokeJointType(): JointType; set strokeJointType(value: JointType); get visible(): boolean; set visible(value: boolean); get fillColor(): Color; set fillColor(value: Color | string); } export declare class Polyline extends OverLayBase implements IPolyline { _native: com.google.android.gms.maps.model.Polyline; static fromNative(nativePolyline: com.google.android.gms.maps.model.Polyline): Polyline; get native(): com.google.android.gms.maps.model.Polyline; get android(): com.google.android.gms.maps.model.Polyline; get width(): number; set width(value: number); get points(): Coordinate[]; set points(value: Coordinate[]); addPoint(point: Coordinate): void; addPoints(points: Coordinate[]): void; get tappable(): boolean; set tappable(value: boolean); get geodesic(): boolean; set geodesic(value: boolean); get visible(): boolean; set visible(value: boolean); get zIndex(): number; set zIndex(value: number); get jointType(): JointType; set jointType(value: JointType); get pattern(): PatternItem[]; set pattern(value: PatternItem[]); get color(): Color; set color(value: string | Color); get startCap(): Cap; set startCap(cap: Cap); get endCap(): Cap; set endCap(cap: Cap); } export declare class GroundOverlay extends OverLayBase implements IGroundOverlay { _native: com.google.android.gms.maps.model.GroundOverlay; constructor(); static fromNative(nativeGroundOverlayOptions: com.google.android.gms.maps.model.GroundOverlay): GroundOverlay; get native(): com.google.android.gms.maps.model.GroundOverlay; get android(): com.google.android.gms.maps.model.GroundOverlay; get zIndex(): number; set zIndex(value: number); set visible(value: boolean); get visible(): boolean; get transparency(): number; set transparency(value: number); set position(value: Coordinate); get position(): Coordinate; get width(): number; get height(): number; get bounds(): CoordinateBounds; get tappable(): boolean; set tappable(value: boolean); get bearing(): number; set bearing(value: number); _image: ImageSource; get image(): ImageSource; } export declare class Poi implements IPoi { _native: com.google.android.gms.maps.model.PointOfInterest; static fromNative(nativePoi: com.google.android.gms.maps.model.PointOfInterest): Poi; get native(): com.google.android.gms.maps.model.PointOfInterest; get android(): com.google.android.gms.maps.model.PointOfInterest; get coordinate(): Coordinate; get name(): string; get placeId(): string; } export declare class TileOverlay implements Partial<ITileOverlay> { _native: com.google.android.gms.maps.model.TileOverlay; static fromNative(nativeOverlay: com.google.android.gms.maps.model.TileOverlay): TileOverlay; get native(): com.google.android.gms.maps.model.TileOverlay; get android(): com.google.android.gms.maps.model.TileOverlay; get fadeIn(): boolean; set fadeIn(value: boolean); get transparency(): number; set transparency(value: number); get visible(): boolean; set visible(value: boolean); get zIndex(): number; set zIndex(value: number); clearTileCache(): void; } export declare class Tile { _native: com.google.android.gms.maps.model.Tile; static _NONE: any; static get NONE(): any; static fromNative(nativeTile: com.google.android.gms.maps.model.Tile): Tile; static fromImageSource(source: ImageSource): Tile | null; get native(): com.google.android.gms.maps.model.Tile; get android(): com.google.android.gms.maps.model.Tile; } export declare class TileProvider implements ITileProvider { _native: com.google.android.gms.maps.model.TileProvider; _callback: (x: number, y: number, zoom: number) => Tile; constructor(callback: (x: number, y: number, zoom: number) => Tile); static fromNative(nativeTileProvider: com.google.android.gms.maps.model.TileProvider): TileProvider; get native(): com.google.android.gms.maps.model.TileProvider; get android(): com.google.android.gms.maps.model.TileProvider; } export declare class UrlTileProvider extends TileProvider { _native: com.google.android.gms.maps.model.UrlTileProvider; _callback: (x: number, y: number, zoom: number) => string; constructor(callback: (x: number, y: number, zoom: number) => string, size?: number); get native(): com.google.android.gms.maps.model.UrlTileProvider; } export declare class Projection implements IProjection { _native: com.google.android.gms.maps.Projection; static fromNative(nativeProjection: com.google.android.gms.maps.Projection): Projection; get native(): com.google.android.gms.maps.Projection; get android(): com.google.android.gms.maps.Projection; coordinateForPoint(point: { x: number; y: number; }): Coordinate; visibleRegion(): VisibleRegion; pointForCoordinate(coordinate: Coordinate): { x: number; y: number; }; containsCoordinate(coordinate: Coordinate): boolean; } export declare class VisibleRegion implements IVisibleRegion { _native: com.google.android.gms.maps.model.VisibleRegion; static fromNative(nativeVisibleRegion: com.google.android.gms.maps.model.VisibleRegion): VisibleRegion; get native(): com.google.android.gms.maps.model.VisibleRegion; get android(): com.google.android.gms.maps.model.VisibleRegion; get farLeft(): Coordinate; get farRight(): Coordinate; get nearLeft(): Coordinate; get nearRight(): Coordinate; } export declare class Cap implements ICap { _native: com.google.android.gms.maps.model.Cap; static fromNative(nativeCap: com.google.android.gms.maps.model.Cap): Cap; get native(): com.google.android.gms.maps.model.Cap; get android(): com.google.android.gms.maps.model.Cap; } export declare class ButtCap extends Cap { _native: com.google.android.gms.maps.model.ButtCap; constructor(); constructor(nativeCap: com.google.android.gms.maps.model.ButtCap); static fromNative(nativeCap: com.google.android.gms.maps.model.ButtCap): ButtCap; get native(): com.google.android.gms.maps.model.ButtCap; get android(): com.google.android.gms.maps.model.ButtCap; } export declare class RoundCap extends Cap { _native: com.google.android.gms.maps.model.RoundCap; constructor(); constructor(nativeCap: com.google.android.gms.maps.model.RoundCap); static fromNative(nativeCap: com.google.android.gms.maps.model.RoundCap): RoundCap; get native(): com.google.android.gms.maps.model.RoundCap; get android(): com.google.android.gms.maps.model.RoundCap; } export declare class SquareCap extends Cap { _native: com.google.android.gms.maps.model.SquareCap; constructor(); constructor(nativeCap: com.google.android.gms.maps.model.SquareCap); static fromNative(nativeCap: com.google.android.gms.maps.model.SquareCap): SquareCap; get native(): com.google.android.gms.maps.model.SquareCap; get android(): com.google.android.gms.maps.model.SquareCap; } export declare class CustomCap extends Cap { _native: com.google.android.gms.maps.model.CustomCap; constructor(image: ImageSource, refWidth?: number); constructor(nativeCap: com.google.android.gms.maps.model.CustomCap); static fromNative(nativeCap: com.google.android.gms.maps.model.CustomCap): CustomCap; get native(): com.google.android.gms.maps.model.CustomCap; get android(): com.google.android.gms.maps.model.CustomCap; } export declare class PatternItem implements IPatternItem { _native: com.google.android.gms.maps.model.PatternItem; static fromNative(nativePattern: com.google.android.gms.maps.model.PatternItem): PatternItem; get native(): com.google.android.gms.maps.model.PatternItem; get android(): com.google.android.gms.maps.model.PatternItem; } export declare class Dash extends PatternItem { _native: com.google.android.gms.maps.model.Dash; constructor(length: number); get native(): com.google.android.gms.maps.model.Dash; get android(): com.google.android.gms.maps.model.Dash; } export declare class Gap extends PatternItem { _native: com.google.android.gms.maps.model.Gap; constructor(length: number); get native(): com.google.android.gms.maps.model.Gap; get android(): com.google.android.gms.maps.model.Gap; } export declare class Dot extends PatternItem { _native: com.google.android.gms.maps.model.Dot; constructor(); get native(): com.google.android.gms.maps.model.Dot; get android(): com.google.android.gms.maps.model.Dot; } export { MapType, JointType };