You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm making a web app with Capacitor and https didn't work in iOS so can't use navigator.geolocation.getCurrentPosition() but Capacitor exposes that in his modules, so I can get the coordinates, but not with the function leaflet uses
Describe the solution you'd like
A new option in locate config to overwrite the function to read the coordinates in
Describe alternatives you've considered
I try to use https in iOS Capacitor but in the issues the devs say that didn't work anyways
Additional context
I think that the code would be something like this:
this.map.locate({getCoordinates: async(onResponse,onError,options)=>{returnawaitGeolocation.getCurrentPosition();// Return the same as navigator.geolocation.getCurrentPosition()}})if(options.getCoordinates){if(options.watch){this._locationWatchId=options.getCoordinates(options);}else{try{varpos=awaitoptions.getCoordinates(options);onResponse(pos);}catch(error){onError(error);}}}else{if(options.watch){this._locationWatchId=navigator.geolocation.watchPosition(onResponse,onError,options);}else{navigator.geolocation.getCurrentPosition(onResponse,onError,options);}}
The text was updated successfully, but these errors were encountered:
Nisgrak
changed the title
Allow to pass the coordinates in .locate()
Allow to pass the function to get coordinates in .locate()
Sep 30, 2020
Is your feature request related to a problem? Please describe.
I'm making a web app with Capacitor and https didn't work in iOS so can't use
navigator.geolocation.getCurrentPosition()
but Capacitor exposes that in his modules, so I can get the coordinates, but not with the function leaflet usesDescribe the solution you'd like
A new option in locate config to overwrite the function to read the coordinates in
Leaflet/src/map/Map.js
Lines 660 to 665 in bdd7ebf
Describe alternatives you've considered
I try to use https in iOS Capacitor but in the issues the devs say that didn't work anyways
Additional context
I think that the code would be something like this:
The text was updated successfully, but these errors were encountered: