Hello, i have the next code in Ionic 3 :
this.mapElement = document.getElementById(‘map’);
let mapOptions: GoogleMapOptions = {
camera: {
target: {
lat: 43.0741904,
lng: -89.3809802
},
zoom: 18,
tilt: 30
}
};
this.map = this.googleMaps.create(this.mapElement, mapOptions);
this.map.one(GoogleMapsEvent.MAP_READY)
.then(() => {
console.log(‘Map is ready!’);
this.map.addEventListener(GoogleMapsEvent.CAMERA_MOVE).subscribe((camera)=>{
this.marker.setPosition({lat:(camera.target.lat+0.0002) ,lng:camera.target.lng});
this.lat = camera.target.lat;
this.lng = camera.target.lng;
this.transparency = true;
});
this.map.addEventListener(GoogleMapsEvent.CAMERA_MOVE_END).subscribe((camera)=>{
this.marker.setPosition({lat:(camera.target.lat) ,lng:camera.target.lng});
this.lat = camera.target.lat;
this.lng = camera.target.lng;
this.transparency = false;
});
(I declared all variables before the constructor)
In the view i must show the latitude, longitude and i want a button with transparency. But in the view not refresh the lat, lng and transparency values on camera move.
Code in the view:
{{lat}} - {{lang}}
I’m from Argentina, sorry for my bad english. Thanks.