Hows the right way to do this cordova geolocation



  • <template>

    </template>

    <script>

    document.addEventListener(‘deviceready’, () => {
    navigator.geolocation.getCurrentPosition(this.onMapSuccess(), this.onMapError(), { maximumAge: 3000, timeout: 5000, enableHighAccuracy: true })
    }, false)

    export default {
    methods: {
    onMapSuccess (position) {
    this.Latitude = position.coords.latitude
    this.Longitude = position.coords.longitude
    }
    }
    }
    </script>