How to use the @ionic-native/google-maps.LocationService.getMyLocation function in @ionic-native/google-maps

To help you get started, we’ve selected a few @ionic-native/google-maps examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github UCL-INGI / StudUCLouvain / src / providers / map-services / map-service.ts View on Github external
return new Promise((resolve, reject) => {
      LocationService.getMyLocation().then(
        (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