From 72d9047da8713cd446081d1553cd0056f1ccdea8 Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Wed, 25 May 2016 17:07:53 -0400 Subject: [PATCH] fixes! --- src/plugins/googlemaps.ts | 62 +++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/src/plugins/googlemaps.ts b/src/plugins/googlemaps.ts index c85205eb..88fdbdec 100644 --- a/src/plugins/googlemaps.ts +++ b/src/plugins/googlemaps.ts @@ -11,7 +11,6 @@ import {Cordova, Plugin} from './plugin'; import {Observable} from 'rxjs/Rx'; import {CordovaInstance} from './plugin'; -import {InstanceProperty} from "../../dist/plugins/plugin"; /** * Created by Ibrahim on 3/29/2016. */ @@ -236,20 +235,15 @@ export class GoogleMaps { }) setAllGesturesEnabled (enabled: boolean): void { } - addMarker (options: any): GoogleMapsMarker { - if (!options) { - console.warn('Google Maps Plugin: No options provided.'); - return; - } - - let objectInstance = this._objectInstance.addMarker(options); + addMarker (options: GoogleMapsMarkerOptions): GoogleMapsMarker { + let objectInstance: any = this._objectInstance.addMarker(options); return new GoogleMapsMarker(objectInstance); } - @CordovaInstance({ - sync: true - }) - addCircle (options: any): void { } + addCircle (options: GoogleMapsCircleOptions): GoogleMapsCircle { + let objectInstance: any = this._objectInstance.addCircle(options); + return new GoogleMapsCircle(objectInstance); + } @CordovaInstance({ sync: true @@ -360,19 +354,21 @@ export interface VisibleRegion { southwest: any; } +export interface GoogleMapsMarkerOptions { + icon: any; + title: string; + snippet: string; + position: GoogleMapsLatLng; + infoWindowAnchor: number[]; + draggable: boolean; + flat: boolean; + rotation: number; + visible: boolean; + styles: any; + animation: string; + zIndex: number; +} export class GoogleMapsMarker { - @InstanceProperty icon: any; - @InstanceProperty title: string; - @InstanceProperty snippet: string; - @InstanceProperty position: GoogleMapsLatLng; - @InstanceProperty infoWindowAnchor: number[]; - @InstanceProperty draggable: boolean; - @InstanceProperty flat: boolean; - @InstanceProperty rotation: number; - @InstanceProperty visible: boolean; - @InstanceProperty styles: any; - @InstanceProperty animation: string; - @InstanceProperty zIndex: number; constructor (private _objectInstance: any) { } @@ -512,15 +508,17 @@ export interface GoogleMapsMarkerIcon { } } +export interface GoogleMapsCircleOptions { + center: GoogleMapsLatLng; + visible: boolean; + radius: number; + strokeColor: string; + strokeWidth: number; + fillColor: string; + visible: boolean; + zIndex: number; +} export class GoogleMapsCircle { - @InstanceProperty center: GoogleMapsLatLng; - @InstanceProperty visible: boolean; - @InstanceProperty radius: number; - @InstanceProperty strokeColor: string; - @InstanceProperty strokeWidth: number; - @InstanceProperty fillColor: string; - @InstanceProperty visible: boolean; - @InstanceProperty zIndex: number; constructor(private _objectInstnace: any) { }