11-20-2018, 11:57 PM
The link should take you to a page with a map (leaflet), and ping the current location, or just ping the current location when already on that page.
So roughly
if (already on landing page)
{
locate();
}
else
{
window.location='<?=$abs_us_root.$us_url_root?>app.php';
// will run locate() in e.g. onload
}
Where locate is to center map on current location and draw a temporary circle,
function locate()
{
map.locate({setView: true, maxZoom: 16});
// triggers more stuff in onLocationFound if location sharing is enabled
}
----
as for workarounds, is it possible to have two identical looking links, one that's visible on the app page and just calls the locate() function, the other visible on all other pages and linking to the app page normally?
Maybe just allow to give the menu items an id='...', so I can show/hide them dynamically
So roughly
if (already on landing page)
{
locate();
}
else
{
window.location='<?=$abs_us_root.$us_url_root?>app.php';
// will run locate() in e.g. onload
}
Where locate is to center map on current location and draw a temporary circle,
function locate()
{
map.locate({setView: true, maxZoom: 16});
// triggers more stuff in onLocationFound if location sharing is enabled
}
----
as for workarounds, is it possible to have two identical looking links, one that's visible on the app page and just calls the locate() function, the other visible on all other pages and linking to the app page normally?
Maybe just allow to give the menu items an id='...', so I can show/hide them dynamically