Skip to content

Instantly share code, notes, and snippets.

@objectivehtml
Created June 16, 2013 23:18
Show Gist options
  • Select an option

  • Save objectivehtml/5793811 to your computer and use it in GitHub Desktop.

Select an option

Save objectivehtml/5793811 to your computer and use it in GitHub Desktop.
<a href="#" class="reveal" data-reveal-id="map-modal" id="reveal-trigger" style="display:none">Reveal</a>
<div id="map-modal" class="reveal-modal"></div>
{exp:gmap:init id="map" style="width:400px;height:300px"}
{exp:gmap:marker id="map" address="Yellow Stone National Park" data:url="/google-maps/reveal-ajax"}
{exp:gmap:marker id="map" address="Everglades National Park" data:url="/google-maps/reveal-ajax"}
<script type="text/javascript">
// This example assumes your map id is "map".
// Loop through the global marker array
$.each(map_markers, function(i, marker) {
google.maps.event.addListener(marker, 'click', function() {
var url = this.data.url;
$.get(url, function(html) {
$('#map-modal').html(html);
$('#reveal-trigger').click();
});
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment