GeoLocation and Map Integration in Ionic Vue App with capacitor

i am looking for a solution where i can implement maps and show current user location on it in Ionic Vue app.

i did implemented the same in angular but the gps don’t always work properly.

code i use is as below for the angular version.

async getCurrentPosition() {
    const { Geolocation } = Plugins;

    try {
      const coordinates = await Geolocation.getCurrentPosition();
      this.zone.run(() => {
        this.singleCoords = coordinates.coords;
        console.log("Single Coords :", this.singleCoords);
      });
    } catch (e) {
      alert("WebView geo error");
      console.error(e);
    }
  }
1 Like

I applied Capacitor geo location but its not able to enable gps of device its working fine in web browser side but not in device.if i manually enable gps then its also not able to gem my location and giving error.location not availbale.