//Utility functions for map info window function mapit(lat,lon,zoom,id) { var map; //create a new map var centerCoord = new google.maps.LatLng(lat, lon); var mapOptions = { zoom: zoom, center: centerCoord, mapTypeId: google.maps.MapTypeId.TERRAIN, disableDefaultUI: true, navigationControl: true, navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL} }; map = new google.maps.Map(document.getElementById('map-wrapper-'+id), mapOptions); //get the geojson for this map $.ajax({ url: "/projects/data/natparks/"+id+".json", dataType: "json", success: function(data, text, request) { draw_poly(data); } //complete: function(xhr, status) {console.log(status); return false; }, }); //draw the polygon function draw_poly(data) { var poly = createPolygons(data.features[0].geometry); for (i=0;i<=poly.length-1;i++) { poly[i].setMap(map); } } } // utility functions to create/remove map container function create_map(obj) { //break up the variable passed from the map link's title element var lat = parseFloat(obj.title.split(',')[0]); var lon = parseFloat(obj.title.split(',')[1]); var zoom= parseInt(obj.title.split(',')[2]); var id= obj.title.split(',')[3]; //create container divs $(obj).parents().eq(3).append('