Hi,
I would like the maps module to show the nearest location on pageload. Can anyone point me in the right direction?
Regards / Aki
Hi,
I would like the maps module to show the nearest location on pageload. Can anyone point me in the right direction?
Regards / Aki
A couple of solutions can be found here: https://www.google.dk/?gws_rd=ssl#q=google+map+nearest+location
BR Nicolai
I was thinking more in the context of the Maps module. I thought that perhaps I could use the exisiting "Find nearest" functionality in that module.
Hi Aki
You need to get the nearest location from the browser and inject it on load in the Maps.js init function. That will be something that the browser and MAPS apis support.
I cannot get any closer without actually coding for you... Maybe someone did this already and have some code to share?
BR Nicolai
I added
google.maps.event.addDomListener(window, 'load', searchNearest);
after the
google.maps.event.addDomListener(window, 'load', init);
in maps.js.
Looks like it does the trick.
Not the best solution though...
Neat, seems like a good solution...
You must be logged in to post in the forum