forked from PimpAPP/pimpapp-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteste.ts
53 lines (45 loc) · 1.11 KB
/
teste.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import {
GoogleMaps,
GoogleMap,
GoogleMapsEvent,
LatLng,
CameraPosition,
MarkerOptions,
Marker
} from '@ionic-native/google-maps';
export class MapPage {
constructor(private googleMaps: GoogleMaps) {}
// Load map only after view is initialized
ngAfterViewInit() {
this.loadMap();
}
loadMap() {
let element: HTMLElement = document.getElementById('map');
let map: GoogleMap = this.googleMaps.create(element);
map.one(GoogleMapsEvent.MAP_READY).then(() => console.log('Map is ready!'));
let catador: LatLng = new LatLng(-23.616786, -46.669331);
let coleta: LatLng = new LatLng(-23.618742, -46.667335);
let position: CameraPosition = {
target: catador,
zoom: 18,
tilt: 30
};
map.moveCamera(position);
let markerColeta: MarkerOptions = {
position: catador,
title: 'Coleta'
};
let markerCatador: MarkerOptions = {
position: catador,
title: 'Catador'
};
const mkCatador = map.addMarker(markerCatador)
.then((marker: Marker) => {
marker.showInfoWindow();
});
const mkColeta = map.addMarker(markerColeta)
.then((marker: Marker) => {
marker.showInfoWindow();
});
}
}