Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(position) => {
console.log("initDeviceMap - geolocation answered");
this.userLocation = new MapLocation( "Ma Position",
"",
String(position.latLng.lat),
String(position.latLng.lng),
"MYPOS");
//let latLng = new LatLng(position.coords.latitude, position.coords.longitude);
let latLng = position.latLng;
let mapOptions = {
center: latLng,
zoom: 15,
mapTypeId: GoogleMapsMapTypeId.ROADMAP
}
// create CameraPosition
let camPos: CameraPosition = {
target: latLng,
zoom: 15
};
//this.map = new GoogleMap(this.mapElement, mapOptions);
this.map = GoogleMaps.create(this.mapElement, mapOptions);
this.map.on(GoogleMapsEvent.MAP_READY).subscribe(() => {
console.log('Map is ready!');
this.map.moveCamera(camPos);
resolve(true);
});
}, (error) => {
console.log("Map error initDeviceMap : " + error);