@@ -2,6 +2,7 @@ import { ElementRef, Injectable } from '@angular/core';
2
2
import {
3
3
CameraPosition ,
4
4
GoogleMap ,
5
+ GoogleMapOptions ,
5
6
GoogleMaps ,
6
7
GoogleMapsAnimation ,
7
8
GoogleMapsEvent ,
@@ -23,17 +24,16 @@ export class NativeGoogleMapsProvider {
23
24
24
25
// Note: Call this method on ngAfterViewInit
25
26
create ( element : ElementRef ) {
26
-
27
- const cameraPosition : CameraPosition = {
28
- zoom : 18 ,
29
- tilt : 10
30
- } ;
31
-
32
- const options = {
27
+ const mapOptions : GoogleMapOptions = {
28
+ camera : {
29
+ target : {
30
+ lat : 43.0741904 ,
31
+ lng : - 89.3809802
32
+ } ,
33
+ zoom : 18 ,
34
+ tilt : 10
35
+ } ,
33
36
mapType : GoogleMapsMapTypeId . NORMAL ,
34
- styles : [ ] ,
35
- camera : cameraPosition ,
36
- backgroundColor : 'white' ,
37
37
controls : {
38
38
compass : true ,
39
39
myLocationButton : true ,
@@ -46,10 +46,10 @@ export class NativeGoogleMapsProvider {
46
46
rotate : true ,
47
47
zoom : true
48
48
} ,
49
- preferences : null ,
49
+ preferences : null
50
50
} ;
51
51
52
- this . map = this . googleMaps . create ( element . nativeElement , options ) ;
52
+ this . map = this . googleMaps . create ( element . nativeElement , mapOptions ) ;
53
53
return this . map . one ( GoogleMapsEvent . MAP_READY ) ;
54
54
}
55
55
@@ -73,12 +73,12 @@ export class NativeGoogleMapsProvider {
73
73
}
74
74
75
75
centerToPosition ( latLng : any , zoom ?: number , tilt ?: number ) {
76
- const cameraPosition : CameraPosition = {
76
+ const cameraPosition = {
77
77
target : latLng ,
78
78
zoom : zoom || 18 ,
79
79
tilt : tilt || 10
80
80
} ;
81
- return this . map . moveCamera ( cameraPosition ) ;
81
+ return this . map . animateCamera ( cameraPosition ) ;
82
82
}
83
83
84
84
addMarker ( position , title : string , infoClickCallback , animated = true ) {
0 commit comments