I’m trying to load different Google Maps depending on what link they click. Something like this:
First, a user clicks a link like…
<a class="loadMap" href="?map¢er=44.370987,-85.407715">load map 1</a>
…or…
<a class="loadMap" href="?map¢er=23.4567,-80.234523">load map 2</a>
The Google Maps API is then loaded asynchronously (if it hasn’t been loaded already). The map center is taken from the href of the link clicked, and then the map is displayed right below the link that was clicked (something in jQuery like $(this).after(showMap);)
I’ve found examples that load a single map asynchronously, but I can’t figure out how to pass different map parameters to load a different map and place it relative to the link that was clicked.
1 Answer