1 line
1.7 KiB
JavaScript
1 line
1.7 KiB
JavaScript
$(".navbar-nav li a").each(function(){if($($(this))[0].href==String(window.location)){$(this).parent().addClass("active")}else{if(window.location.pathname=="/"){$(".navbar-nav li").first().addClass("active")}else{$(".navbar-nav li").first().removeClass("active")}}});function onEachFeature(a,c){var d=[];if(a.properties){for(var b in a.properties){d.push(b+": "+a.properties[b])}}c.bindPopup(d.join("<br />"))}function loadStaticMap(){var a=L.tileLayer("http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",{maxZoom:18});var d=new L.GeoJSON.AJAX("/json/sjy_bound_2nd.geojson",{style:{color:"#de950d",weight:2,opacity:1,fillOpacity:0}});var c=L.map("map",{layers:[a,d],minZoom:6,maxZoom:17,zoomIn:1,zoomOut:1,zoomControl:false}).setView([34,96],6);var b=new L.LatLngBounds(new L.LatLng(31,103),new L.LatLng(38,89));c.fitBounds(b);$('a[data-toggle="tab"]').on("shown.bs.tab",function(f){c.invalidateSize()})}function loadStationMap(f){var a=L.tileLayer("http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",{maxZoom:18});var d=new L.GeoJSON.AJAX("/json/sjy_bound_2nd.geojson",{style:{color:"#de950d",weight:2,opacity:1,fillOpacity:0}});var e=new L.GeoJSON.AJAX("/api/gis/geojson/"+f,{pointToLayer:function(g,h){return L.circleMarker(h,{radius:4,fillColor:"#0aff3c",color:"#000",weight:1,opacity:1,fillOpacity:0.8})},onEachFeature:onEachFeature});var c=L.map("map",{layers:[a,d,e],minZoom:6,maxZoom:17,zoomIn:1,zoomOut:1,zoomControl:false}).setView([34,96],6);var b=new L.LatLngBounds(new L.LatLng(31,103),new L.LatLng(38,89));c.fitBounds(b);$('a[data-toggle="tab"]').on("shown.bs.tab",function(g){c.invalidateSize()})}; |