Using links to change the map

Good Eatin' Goal: Add links to each restaurant location and have the map automatically zoom in to the location.

Additional modules needed: GmapEZ (http://drupal.org/project/gmapez).

Basic steps

If you want to allow customers to be able to jump easily from location to location, you can add links within the text surrounding the map, which will cause GmapEZ to automatically re-center the map to the location that you linked it to.

1. You will first need to add IDs to each anchor (<a>) tag.

2. For example, we will modify our links as follows.

<a id="original" href="http://maps.google.com/maps?q=111+Main+ Street,+Parker,+CO&ie=UTF8&ll=3 9.521985/-104.784765&spn=0.030853/ 0.07724 8&z=14&iwloc=cent"> </a>

3. We can now link to the location from the text by creating another anchor tag as follows:

<a href="#original" class="ZOOM">Original Location</a>

4. The #original indicates that the browser should link to the anchor tag on the same that has an ID of original.

0 0

Post a comment