adding montsserat font and labels for each location
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 22 Oct 2019 15:06:22 +0000 (11:06 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 22 Oct 2019 15:06:22 +0000 (11:06 -0400)
glm-leaflet-theme.php
glm-map.js

index 851fb4b..f3bc86e 100644 (file)
@@ -31,7 +31,7 @@ function glm_enqueue_leaflet(){
     if(has_shortcode($post->post_content,'glm-leaflet-theme')){
         wp_enqueue_style('glm-leaflet-style', "https://unpkg.com/leaflet@1.3.3/dist/leaflet.css");
         wp_enqueue_script('glm-leaflet', "https://unpkg.com/leaflet@1.3.3/dist/leaflet.js");
-
+        wp_enqueue_style('glm-leaflet-font', "https://fonts.googleapis.com/css?family=Montserrat&display=swap");
         wp_enqueue_style('glm-leaflet-gesture-style', "//unpkg.com/leaflet-gesture-handling/dist/leaflet-gesture-handling.min.css");
         wp_enqueue_script('glm-leaflet-gesture', "//unpkg.com/leaflet-gesture-handling");
         wp_enqueue_style('glm-leaflet-map-style', plugin_dir_url(__FILE__).'glm-map-style.css', '1.0.0',true);
index 564e116..959b91c 100644 (file)
@@ -7,13 +7,13 @@ jQuery(function($){
         // Styles a map in night mode.
 
         leafletMap = L.map('glm-leaflet-container', {
-            center: [45.431962, -84.990662],
+            center: [45.3749, -84.9592],
             zoom: 12,
             // scrollWheelZoom: false,java
             gestureHandling: true
         });
         leafletMap.on('zoomend', function() {
-            if(leafletMap.getZoom() < 12){
+            if(leafletMap.getZoom() < 9){
                 $(".glm-theme-map-label").hide()
             }else{
                 $(".glm-theme-map-label").show()
@@ -33,47 +33,115 @@ jQuery(function($){
             id: 'nothot'
         }).addTo(leafletMap);
 
-        var ltbInfo = '<div class="marker-title">Little Traverse Bay is a small bay, 170 feet (55 m) deep, off Lake Michigan in the northern area of the Lower Peninsula of Michigan. The cities of Harbor Springs and Petoskey are located on this bay.</div>';
-        "Little Traverse Bay is a small bay, 170 feet (55 m) deep, off Lake Michigan in the northern area of the Lower Peninsula of Michigan. The cities of Harbor Springs and Petoskey are located on this bay."
-        new L.Marker([45.406518, -84.948100], {
+        var style = "color: #343539;line-height: 1;display: block; width: 125px; font-weight: bold; font-family: 'Montserrat';font-size: 16px;";
+        //////////////////////
+        var boyneInfo = '<div class="marker-title">Harbor Springs is a city and resort community in Emmet County in the U.S. state of Michigan. The population was 1,194 at the 2010 census. Harbor Springs is in a sheltered bay on the north shore of the Little Traverse Bay on Lake Michigan</div>';
+
+        var boyne = new L.marker([45.2125, -85.0173]).bindPopup(boyneInfo); //opacity may be set to zero
+        boyne.addTo(leafletMap);
+
+        var boyne = '<div class="marker-title">West Traverse Township is a civil township of Emmet County in the U.S. state of Michigan. The population was 1,448 at the 2000 census." </div>';
+        new L.Marker([45.21, -85.015], {
             icon: new L.DivIcon({
-                className: 'my-div-icon',
-                html: '<span class="glm-theme-map-label">Little Traverse Bay</span>'
+                className: 'glm-map-city',
+                html: '<span style="' + style + '" class="glm-theme-map-label">Boyne City</span>'
             })
-        }).addTo(leafletMap).bindPopup(ltbInfo);
+        }).addTo(leafletMap).bindPopup(boyne);
+
+        //////////////////////
+
+        var chxInfo = '<div class="marker-title">Harbor Springs is a city and resort community in Emmet County in the U.S. state of Michigan. The population was 1,194 at the 2010 census. Harbor Springs is in a sheltered bay on the north shore of the Little Traverse Bay on Lake Michigan</div>';
 
-        // Lake Michigan
-        var lmInfo = '<div class="marker-title">Lake Michigan is one of the five Great Lakes of North America and the only one located entirely within the United States. The other four Great Lakes are shared by the U.S. and Canada. It is the second-largest of the Great Lakes by volume and the third-largest by surface area." </div>';
-        new L.Marker([45.416413, -85.144117], {
+        var chx = new L.marker([45.2984, -85.2558]).bindPopup(chxInfo); //opacity may be set to zero
+        chx.addTo(leafletMap);
+
+        var chx = '<div class="marker-title">West Traverse Township is a civil township of Emmet County in the U.S. state of Michigan. The population was 1,448 at the 2000 census." </div>';
+        new L.Marker([45.2984, -85.2558], {
             icon: new L.DivIcon({
-                className: 'my-div-icon',
-                html: '<span class="glm-theme-map-label">Lake Michigan</span>'
+                className: 'glm-map-city',
+                html: '<span style="' + style + '" class="glm-theme-map-label">Charlevoix</span>'
             })
-        }).addTo(leafletMap).bindPopup(lmInfo);
+        }).addTo(leafletMap).bindPopup(chx);
+
+        //////////////////////
+        var cheboyganInfo = '<div class="marker-title">Harbor Springs is a city and resort community in Emmet County in the U.S. state of Michigan. The population was 1,194 at the 2010 census. Harbor Springs is in a sheltered bay on the north shore of the Little Traverse Bay on Lake Michigan</div>';
+
+        var cheboygan = new L.marker([45.5961, -84.4848]).bindPopup(cheboyganInfo); //opacity may be set to zero
+        cheboygan.addTo(leafletMap);
 
-        var ltInfo = '<div class="marker-title">Little Traverse Township is a civil township of Emmet County in the U.S. state of Michigan. The population was 2,426 at the 2000 census." </div>';
-        // Little Traverse Township
-        new L.Marker([45.437909, -84.966940], {
+        var cheboygan = '<div class="marker-title">West Traverse Township is a civil township of Emmet County in the U.S. state of Michigan. The population was 1,448 at the 2000 census." </div>';
+        new L.Marker([45.5972, -84.4848], {
             icon: new L.DivIcon({
-                className: 'my-div-icon',
-                html: '<span style="color: #343539;line-height: 1;" class="glm-theme-map-label">Little Traverse Township</span>'
+                className: 'glm-map-city',
+                html: '<span style="' + style + '" class="glm-theme-map-label">Cheboygan</span>'
             })
-        }).addTo(leafletMap).bindPopup(ltInfo);
+        }).addTo(leafletMap).bindPopup(cheboygan);
 
-        // Harbor Springs
-        var info = '<div class="marker-title">Harbor Springs is a city and resort community in Emmet County in the U.S. state of Michigan. The population was 1,194 at the 2010 census. Harbor Springs is in a sheltered bay on the north shore of the Little Traverse Bay on Lake Michigan</div>';
-        var marker = new L.marker([45.431962, -84.990662]).bindPopup(info); //opacity may be set to zero
-        marker.addTo(leafletMap);
+        //////////////////////
+        var harborInfo = '<div class="marker-title">Harbor Springs is a city and resort community in Emmet County in the U.S. state of Michigan. The population was 1,194 at the 2010 census. Harbor Springs is in a sheltered bay on the north shore of the Little Traverse Bay on Lake Michigan</div>';
 
+        var harbor = new L.marker([45.4274, -84.9106]).bindPopup(harborInfo); //opacity may be set to zero
+        harbor.addTo(leafletMap);
 
-        // West Traverse Township
-        var ltInfo = '<div class="marker-title">West Traverse Township is a civil township of Emmet County in the U.S. state of Michigan. The population was 1,448 at the 2000 census." </div>';
-        new L.Marker([45.442881, -85.029999], {
+        var harbor = '<div class="marker-title">West Traverse Township is a civil township of Emmet County in the U.S. state of Michigan. The population was 1,448 at the 2000 census." </div>';
+        new L.Marker([45.4274, -84.9106], {
+            icon: new L.DivIcon({
+                className: 'glm-map-city',
+                html: '<span style="' + style + '" class="glm-theme-map-label">Harbor Springs</span>'
+            })
+        }).addTo(leafletMap).bindPopup(harbor);
+
+        ////////////////
+
+        var indianriverInfo = '<div class="marker-title">Harbor Springs is a city and resort community in Emmet County in the U.S. state of Michigan. The population was 1,194 at the 2010 census. Harbor Springs is in a sheltered bay on the north shore of the Little Traverse Bay on Lake Michigan</div>';
+
+        var indianriver = new L.marker([45.4083, -84.6154]).bindPopup(indianriverInfo); //opacity may be set to zero
+        indianriver.addTo(leafletMap);
+
+        var irLabel = '<div class="marker-title">West Traverse Township is a civil township of Emmet County in the U.S. state of Michigan. The population was 1,448 at the 2000 census." </div>';
+        new L.Marker([45.4083, -84.6154], {
+            icon: new L.DivIcon({
+                className: 'glm-map-city',
+                html: '<span style="' + style + '" class="glm-theme-map-label">Indian River</span>'
+            })
+        }).addTo(leafletMap).bindPopup(irLabel);
+
+        ///////////
+
+        var petoskeyInfo = '<div class="marker-title">Harbor Springs is a city and resort community in Emmet County in the U.S. state of Michigan. The population was 1,194 at the 2010 census. Harbor Springs is in a sheltered bay on the north shore of the Little Traverse Bay on Lake Michigan</div>';
+
+        var petoskey = new L.marker([45.358, -85.0271]).bindPopup(petoskeyInfo); //opacity may be set to zero
+        petoskey.addTo(leafletMap);
+
+        var petoskey = '<div class="marker-title">West Traverse Township is a civil township of Emmet County in the U.S. state of Michigan. The population was 1,448 at the 2000 census." </div>';
+        new L.Marker([45.358, -85.0271], {
             icon: new L.DivIcon({
-                className: 'my-div-icon',
-                html: '<span style="color: #343539;line-height: 1;" class="glm-theme-map-label">West Traverse Township</span>'
+                className: 'glm-map-city',
+                html: '<span style="' + style + '" class="glm-theme-map-label">Petoskey</span>'
             })
-        }).addTo(leafletMap).bindPopup(ltInfo);
+        }).addTo(leafletMap).bindPopup(petoskey);
+        //////////////////////
+        var petoskeyEastInfo = '<div class="marker-title">Harbor Springs is a city and resort community in Emmet County in the U.S. state of Michigan. The population was 1,194 at the 2010 census. Harbor Springs is in a sheltered bay on the north shore of the Little Traverse Bay on Lake Michigan</div>';
+
+        var petoskeyEast = new L.marker([45.3746, -84.9276]).bindPopup(petoskeyEastInfo); //opacity may be set to zero
+        petoskeyEast.addTo(leafletMap);
+
+        var petoskeyEast = '<div class="marker-title">West Traverse Township is a civil township of Emmet County in the U.S. state of Michigan. The population was 1,448 at the 2000 census." </div>';
+        new L.Marker([45.3746, -84.9276], {
+            icon: new L.DivIcon({
+                className: 'glm-map-city',
+                html: '<span style="' + style + '" class="glm-theme-map-label">Petoskey East</span>'
+            })
+        }).addTo(leafletMap).bindPopup(petoskeyEast);
+
+        // West Traverse Township
+        // var ltInfo = '<div class="marker-title">West Traverse Township is a civil township of Emmet County in the U.S. state of Michigan. The population was 1,448 at the 2000 census." </div>';
+        // new L.Marker([45.405, -84.6135], {
+        //     icon: new L.DivIcon({
+        //         className: 'glm-map-city',
+        //         html: '<span style="color: #343539;line-height: 1;display: block; width: 100px; font-weight: bold;" class="glm-theme-map-label">Indian River</span>'
+        //     })
+        // }).addTo(leafletMap).bindPopup(ltInfo);
     }
     initMap();
 });
\ No newline at end of file