summaryrefslogtreecommitdiff
path: root/media/js
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2011-05-11 08:09:55 -0500
committerluxagraf <sng@luxagraf.net>2011-05-11 08:09:55 -0500
commit3d6ed9441782bb4cb0f3b496cc5595029338f815 (patch)
tree38835698d28b124c20deb0ef5c767e33756cd368 /media/js
parentbb80187bb3dc8807cad92e93c9bb9355de794438 (diff)
minified natparks script
Diffstat (limited to 'media/js')
-rw-r--r--media/js/natparks.js2
-rw-r--r--media/js/natparks.min.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/media/js/natparks.js b/media/js/natparks.js
index 5585f56..ae69ecd 100644
--- a/media/js/natparks.js
+++ b/media/js/natparks.js
@@ -14,7 +14,7 @@ function mapit(lat,lon,zoom,id) {
map = new google.maps.Map(document.getElementById('map-wrapper-'+id), mapOptions);
//get the geojson for this map
$.ajax({
- url: "/projects/data/"+id+"/",
+ url: "/projects/data/"+id+".json",
dataType: "json",
success: function(data, text, request) { draw_poly(data); }
//complete: function(xhr, status) {console.log(status); return false; },
diff --git a/media/js/natparks.min.js b/media/js/natparks.min.js
index e0b4acc..67e23b6 100644
--- a/media/js/natparks.min.js
+++ b/media/js/natparks.min.js
@@ -1,4 +1,4 @@
-function mapit(lat,lon,zoom,id){var 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);$.ajax({url:"/projects/data/"+id+"/",dataType:"json",success:function(data,text,request){draw_poly(data);}});function draw_poly(data){var poly=createPolygons(data.features[0].geometry);for(i=0;i<=poly.length-1;i++){poly[i].setMap(map);}}}
+function mapit(lat,lon,zoom,id){var 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);$.ajax({url:"/projects/data/"+id+".json",dataType:"json",success:function(data,text,request){draw_poly(data);}});function draw_poly(data){var poly=createPolygons(data.features[0].geometry);for(i=0;i<=poly.length-1;i++){poly[i].setMap(map);}}}
function create_map(obj){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];$(obj).parents().eq(3).append('<div class="map-container" id="map-container-'+id+'">');$('#map-container-'+id).append('<div class="map-wrapper" id="map-wrapper-'+id+'">');mapit(lat,lon,zoom,id);}
function remove_map(id){$(id).remove();}
function createPolygons(areajson,bounds){var coords=areajson.coordinates;var polygons=_(coords).reduce([],function(memo_n,n){var polygonpaths=_(n).reduce(new google.maps.MVCArray(),function(memo_o,o){var polygoncords=_(o).reduce(new google.maps.MVCArray(),function(memo_p,p){var mylatlng=new google.maps.LatLng(p[1],p[0]);if(bounds){bounds.extend(mylatlng);}