Centering the 'map' component on the user's GPS position #1062
Replies: 3 comments 3 replies
|
Hi ! select 'shell' as component, 'geo.js' as javascript;
select
'map' as component;
select
'You are here' as title,
$lat as latitude,
$lng as longitude;geo.js navigator.geolocation.getCurrentPosition((position) => {
const s = new URLSearchParams(window.location.search);
if (s.has("lat")) return;
s.set("lat", position.coords.latitude);
s.set("lng", position.coords.longitude);
window.location.search = s;
}); |
|
Hello, and thank you so much for your help! However, I get the impression that it only works on the PC where SQLpage is running. Is that possible? If you have any ideas, I’d love to hear them. And thank you again for your invaluable help! |
|
Ok, I understand better now, thank you. |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
Is it possible to center the 'map' component on the user's GPS position, specifically on their Android device ? Ideally, I'd love to add a marker that says "You are here!!!"—if you know what i mean.
I’ve tried using JavaScript to retrieve the latitude and longitude values from the browser, but without success. I’m not sure if there’s a solution for this.
Thanks for your help!
All reactions