From ad206f38981fd9c860dde06262f86e5611358970 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Tue, 22 Oct 2019 11:06:22 -0400 Subject: [PATCH] adding montsserat font and labels for each location --- glm-leaflet-theme.php | 2 +- glm-map.js | 128 ++++++++++++++++++++++++++++++++---------- 2 files changed, 99 insertions(+), 31 deletions(-) diff --git a/glm-leaflet-theme.php b/glm-leaflet-theme.php index 851fb4b..f3bc86e 100644 --- a/glm-leaflet-theme.php +++ b/glm-leaflet-theme.php @@ -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); diff --git a/glm-map.js b/glm-map.js index 564e116..959b91c 100644 --- a/glm-map.js +++ b/glm-map.js @@ -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 = '
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.
'; - "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 = '
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
'; + + var boyne = new L.marker([45.2125, -85.0173]).bindPopup(boyneInfo); //opacity may be set to zero + boyne.addTo(leafletMap); + + var boyne = '
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."
'; + new L.Marker([45.21, -85.015], { icon: new L.DivIcon({ - className: 'my-div-icon', - html: 'Little Traverse Bay' + className: 'glm-map-city', + html: 'Boyne City' }) - }).addTo(leafletMap).bindPopup(ltbInfo); + }).addTo(leafletMap).bindPopup(boyne); + + ////////////////////// + + var chxInfo = '
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
'; - // Lake Michigan - var lmInfo = '
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."
'; - 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 = '
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."
'; + new L.Marker([45.2984, -85.2558], { icon: new L.DivIcon({ - className: 'my-div-icon', - html: 'Lake Michigan' + className: 'glm-map-city', + html: 'Charlevoix' }) - }).addTo(leafletMap).bindPopup(lmInfo); + }).addTo(leafletMap).bindPopup(chx); + + ////////////////////// + var cheboyganInfo = '
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
'; + + var cheboygan = new L.marker([45.5961, -84.4848]).bindPopup(cheboyganInfo); //opacity may be set to zero + cheboygan.addTo(leafletMap); - var ltInfo = '
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."
'; - // Little Traverse Township - new L.Marker([45.437909, -84.966940], { + var cheboygan = '
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."
'; + new L.Marker([45.5972, -84.4848], { icon: new L.DivIcon({ - className: 'my-div-icon', - html: 'Little Traverse Township' + className: 'glm-map-city', + html: 'Cheboygan' }) - }).addTo(leafletMap).bindPopup(ltInfo); + }).addTo(leafletMap).bindPopup(cheboygan); - // Harbor Springs - var info = '
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
'; - var marker = new L.marker([45.431962, -84.990662]).bindPopup(info); //opacity may be set to zero - marker.addTo(leafletMap); + ////////////////////// + var harborInfo = '
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
'; + 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 = '
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."
'; - new L.Marker([45.442881, -85.029999], { + var harbor = '
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."
'; + new L.Marker([45.4274, -84.9106], { + icon: new L.DivIcon({ + className: 'glm-map-city', + html: 'Harbor Springs' + }) + }).addTo(leafletMap).bindPopup(harbor); + + //////////////// + + var indianriverInfo = '
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
'; + + var indianriver = new L.marker([45.4083, -84.6154]).bindPopup(indianriverInfo); //opacity may be set to zero + indianriver.addTo(leafletMap); + + var irLabel = '
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."
'; + new L.Marker([45.4083, -84.6154], { + icon: new L.DivIcon({ + className: 'glm-map-city', + html: 'Indian River' + }) + }).addTo(leafletMap).bindPopup(irLabel); + + /////////// + + var petoskeyInfo = '
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
'; + + var petoskey = new L.marker([45.358, -85.0271]).bindPopup(petoskeyInfo); //opacity may be set to zero + petoskey.addTo(leafletMap); + + var petoskey = '
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."
'; + new L.Marker([45.358, -85.0271], { icon: new L.DivIcon({ - className: 'my-div-icon', - html: 'West Traverse Township' + className: 'glm-map-city', + html: 'Petoskey' }) - }).addTo(leafletMap).bindPopup(ltInfo); + }).addTo(leafletMap).bindPopup(petoskey); + ////////////////////// + var petoskeyEastInfo = '
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
'; + + var petoskeyEast = new L.marker([45.3746, -84.9276]).bindPopup(petoskeyEastInfo); //opacity may be set to zero + petoskeyEast.addTo(leafletMap); + + var petoskeyEast = '
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."
'; + new L.Marker([45.3746, -84.9276], { + icon: new L.DivIcon({ + className: 'glm-map-city', + html: 'Petoskey East' + }) + }).addTo(leafletMap).bindPopup(petoskeyEast); + + // West Traverse Township + // var ltInfo = '
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."
'; + // new L.Marker([45.405, -84.6135], { + // icon: new L.DivIcon({ + // className: 'glm-map-city', + // html: 'Indian River' + // }) + // }).addTo(leafletMap).bindPopup(ltInfo); } initMap(); }); \ No newline at end of file -- 2.17.1