From: Anthony Talarico Date: Wed, 16 Jan 2019 19:50:55 +0000 (-0500) Subject: adding second map for the isle royal, changing font styles for the labels X-Git-Tag: v1.0.0^2~16 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=165f488284043a7183101cd272f60b2d619ee21c;p=WP-Plugins%2Fglm-member-db-county-map.git adding second map for the isle royal, changing font styles for the labels --- diff --git a/views/front/map/display.html b/views/front/map/display.html index f0a29b7..b7e9321 100644 --- a/views/front/map/display.html +++ b/views/front/map/display.html @@ -1,5 +1,6 @@
+
@@ -13,12 +14,11 @@ // Create map with default center and size var countyMap = L.map('area-map',{ gestureHandling: true, - - }).setView([46.80, -87.0], 8); - - - - + }).setView([46.50, -86.78], 8); + var islandMap = L.map('island-map',{ + zoomControl:false, + gestureHandling: true, + }).setView([48.0, -88.78], 8); var countiesDirectory = '{$assets}/counties/'; // Tile Server URL var tileServer = 'https://maps.gaslightmedia.com/12312029-NoPlaceNames-95bfebd37e9e7d649daafa8762629084/'+ {literal}'{z}/{x}/{y}.png'{/literal}; @@ -30,7 +30,12 @@ Imagery © Gaslight Media', maxZoom: 18 }).addTo(countyMap); - + L.tileLayer(tileServer, { + attribution: 'Map data © OpenStreetMap contributors, \ + CC-BY-SA, \ + Imagery © Gaslight Media', + maxZoom: 18 + }).addTo(islandMap); /* * List of MI Upper Peninsula counties * @@ -97,7 +102,44 @@ function zoomToCounty(e) { countyMap.fitBounds(e.target.getBounds()); } + var ltInfo = ''; + + + new L.Marker([47.0, -87.3], { + icon: new L.DivIcon({ + className: 'my-div-icon', + html: 'Lake Superior' + }) + }).addTo(countyMap); + + new L.Marker([45.85, -86.30], { + icon: new L.DivIcon({ + className: 'my-div-icon', + html: 'Lake Michigan' + }) + }).addTo(countyMap); + new L.Marker([45.85, -84.45], { + icon: new L.DivIcon({ + className: 'my-div-icon', + html: 'Mackinac Island' + }) + }).addTo(countyMap); + + new L.Marker([45.55, -85.00], { + icon: new L.DivIcon({ + className: 'my-div-icon', + html: 'Lower Peninsula' + }) + }).addTo(countyMap); + + countyMap.on('zoomend', function() { + if(countyMap.getZoom() < 8){ + $(".glm-theme-map-label").hide() + }else{ + $(".glm-theme-map-label").show() + } + }); // For each UP county var countyLayer; $.each(upperMI, function(county, countyData) {