gohrms commented on issue #255:
URL:
https://github.com/apache/cordova-plugin-geolocation/issues/255#issuecomment-1329338997
> I am using IONIC and change "cordova-plugin-geolocation" to
@capacitor/geolocation it working
>
> ```
> //import { Geolocation } from '@ionic-native/geolocation/ngx';
> //import { LocationAccuracy } from '@ionic-native/location-accuracy/ngx';
> import { Geolocation,PositionOptions } from '@capacitor/geolocation';
> ...
> public options: PositionOptions = {
> timeout: 5000,
> enableHighAccuracy: true,
> maximumAge: 3000
> };
> ...
>
> /*async getCurrentCoordinates() {
> this.geolocation.getCurrentPosition(this.options).then((resp) => {
> this.latitude = resp.coords.latitude;
> this.longitude = resp.coords.longitude;
> console.log('accuracy:',resp.coords.accuracy);
> }).catch((error) => {
> console.log('Error getting location', error);
> });
> }
> */
> async getCurrentCoordinates() {
> const position = await Geolocation.getCurrentPosition(this.options);
> console.log('accuracy:',position.coords.accuracy);
> this.latitude = position.coords.latitude;
> this.longitude = position.coords.longitude;
> }
> ```
You mean to say, to convert the ionic cordova project to ionic capacitor
project ? I tried to add capacitor in my cordova project and it gives me error
"SyntaxError: Unexpected token '('" in adb logcat.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]