From 165b5d4da073358e68f1731655d016c2cbb26dbe Mon Sep 17 00:00:00 2001 From: luxagraf Date: Tue, 27 May 2014 10:13:56 -0400 Subject: removed goodle maps, changed html to use data-* attributes --- site/media/js/photos.min.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'site/media/js/photos.min.js') diff --git a/site/media/js/photos.min.js b/site/media/js/photos.min.js index b99b0e2..92afa82 100644 --- a/site/media/js/photos.min.js +++ b/site/media/js/photos.min.js @@ -1,15 +1,9 @@ -function mapit(latlontitle){lat=parseFloat(latlontitle.split(',')[0]);lon=parseFloat(latlontitle.split(',')[1]);elid=latlontitle.split(',')[2];centerCoord=new google.maps.LatLng(lat,lon);var mapitinit;if(mapitinit==true){mapPanTo();}else{mapInit();} -function mapInit(){var mapOptions={zoom:8,center:centerCoord,disableDefaultUI:true,navigationControl:true,mapTypeId:google.maps.MapTypeId.TERRAIN,navigationControlOptions:{style:google.maps.NavigationControlStyle.SMALL}};map=new google.maps.Map(document.getElementById("mw-"+elid),mapOptions);var marker=new google.maps.Marker({position:centerCoord,map:map});mapitinit=true;} -function mapPanTo(){var marker=new google.maps.Marker({position:centerCoord,map:map});map.panTo(centerCoord);}} -function create_map(obj){imgid=obj.title.split(',')[2];$('
').insertBefore($(obj).parent().parent());$('#mc-'+imgid).append('
');$('#mc-'+imgid).css({bottom:function(index,value){return parseFloat($(obj).parent().parent().height())+20;}});mapit(obj.title);} + +function mapit(obj){lat=parseFloat(obj.attr('data-latitude'));lon=parseFloat(obj.attr('data-longitude'));elid=obj.attr('data-imgid');map=L.map(document.getElementById("mw-"+elid));centerCoord=new L.LatLng(lat,lon);zoom=8;L.tileLayer.provider('Esri.WorldTopoMap',{maxZoom:18,attribution:'Map data © OpenStreetMap contributors, CC-BY-SA, Tiles © Esri and the GIS User Community'}).addTo(map);map.setView(centerCoord,zoom);L.marker([lat,lon]).addTo(map);} +function create_map(obj){var imgid=obj.attr('data-imgid'); $('
').insertBefore($(obj).parent().parent());$('#mc-'+imgid).append('
'); $('#mc-'+imgid).css({bottom:function(index,value){return parseFloat($(obj).parent().parent().height())+20;}});mapit(obj);} function remove_map(imgid){$('#mc-'+imgid).remove();} -$(document).ready(function(){$('.map-link').click(function(){imgid=this.title.split(',')[2];if($('#mc-'+imgid).is(":visible")){remove_map(imgid);}else{create_map(this);} -return false;});var $ele=$('#slides').children() -var $curr=0 -$(document).bind('keydown',function(e){var code=e.which;switch(code){case 39:if($curr<=$ele.size()){$.scrollTo($ele[$curr],800);$curr++} -break;case 37:if($curr>0){$curr-- -var $now=$curr -$now-- -$.scrollTo($ele[$now],800);} +$(document).ready(function(){ $('.map-link').click(function(){imgid=$(this).attr('data-imgid');if($('#mc-'+imgid).is(":visible")){remove_map(imgid);}else{create_map($(this));} +return false;});var $ele=$('#slides').children();var $curr=0;$(document).bind('keydown',function(e){var code=e.which;switch(code){case 39:if($curr<=$ele.size()){$.scrollTo($ele[$curr],800);$curr++;} +break;case 37:if($curr>0){$curr--;var $now=$curr;$now--;$.scrollTo($ele[$now],800);} break;} return;});}); \ No newline at end of file -- cgit v1.2.3-70-g09d2