From: Anthony Talarico Date: Wed, 20 Mar 2019 04:18:57 +0000 (-0400) Subject: adding county map bullet list section for top 5 attractions of each county on hover X-Git-Tag: v1.0.0^2~9 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=81fc2723a69bd4b350aee26a0b25723575c85bd2;p=WP-Plugins%2Fglm-member-db-county-map.git adding county map bullet list section for top 5 attractions of each county on hover --- diff --git a/css/glm-county-map.min.css b/css/glm-county-map.min.css index 1a1faae..ee5936c 100644 --- a/css/glm-county-map.min.css +++ b/css/glm-county-map.min.css @@ -1 +1 @@ -.isle-royale-label{font-size:16px}.isle-royale-label .isle-royale-arrow{position:absolute;top:-40px;left:0;width:100%;font-size:26px;height:100%}.area-label{color:white;border-radius:6px;padding:5px 10px !important;box-shadow:2px 4px 5px 0 rgba(0,0,0,0.5);font-weight:bold !important}.leaflet-pane.leaflet-marker-pane div:nth-child(8) .area-label{background:#5E8F72 !important}.leaflet-pane.leaflet-marker-pane div:nth-child(9) .area-label{background:#1c1c1c !important}.leaflet-pane.leaflet-marker-pane div:nth-child(10) .area-label{background:#65C6F4 !important}.leaflet-pane.leaflet-marker-pane div:nth-child(11) .area-label{background:#587386 !important}.leaflet-pane.leaflet-marker-pane div:nth-child(12) .area-label{background:#696969 !important}.leaflet-pane.leaflet-marker-pane div:nth-child(13) .area-label{background:#8F5E6D !important}.leaflet-pane.leaflet-marker-pane div:nth-child(14) .area-label{background:white !important;color:black !important;font-weight:bold}.leaflet-pane.leaflet-marker-pane div:nth-child(15) .area-label{background:#685E8F !important}.leaflet-pane.leaflet-marker-pane div:nth-child(16) .area-label{background:#F59E00 !important}.leaflet-pane.leaflet-marker-pane div:nth-child(17) .area-label{background:#F47165 !important}#glm-county-description{background:white;border-radius:7px;height:150px;width:350px} +.isle-royale-label{font-size:16px}.isle-royale-label .isle-royale-arrow{position:absolute;top:-40px;left:0;width:100%;font-size:26px;height:100%}.area-label{color:white;border-radius:6px;padding:5px 10px !important;box-shadow:2px 4px 5px 0 rgba(0,0,0,0.5);font-weight:bold !important}.leaflet-pane.leaflet-marker-pane div:nth-child(8) .area-label{background:#5E8F72 !important}.leaflet-pane.leaflet-marker-pane div:nth-child(9) .area-label{background:#1c1c1c !important}.leaflet-pane.leaflet-marker-pane div:nth-child(10) .area-label{background:#65C6F4 !important}.leaflet-pane.leaflet-marker-pane div:nth-child(11) .area-label{background:#587386 !important}.leaflet-pane.leaflet-marker-pane div:nth-child(12) .area-label{background:#696969 !important}.leaflet-pane.leaflet-marker-pane div:nth-child(13) .area-label{background:#8F5E6D !important}.leaflet-pane.leaflet-marker-pane div:nth-child(14) .area-label{background:white !important;color:black !important;font-weight:bold}.leaflet-pane.leaflet-marker-pane div:nth-child(15) .area-label{background:#685E8F !important}.leaflet-pane.leaflet-marker-pane div:nth-child(16) .area-label{background:#F59E00 !important}.leaflet-pane.leaflet-marker-pane div:nth-child(17) .area-label{background:#F47165 !important}#glm-county-description{background:white;border-radius:7px;height:150px;width:375px;position:absolute;z-index:999;left:40%;top:10px}#glm-county-description .county-description-title{padding-top:5px;font-weight:bold;font-size:16px;background:#668194;color:white;border-top-left-radius:5px;border-top-right-radius:5px;margin-bottom:5px;text-transform:uppercase}#glm-county-description .glm-county-map-top-list li{margin:0 !important;text-align:left;padding:0 5px !important} diff --git a/sass/front/_map.scss b/sass/front/_map.scss index 73435ba..9691fea 100644 --- a/sass/front/_map.scss +++ b/sass/front/_map.scss @@ -117,5 +117,27 @@ background: white; border-radius: 7px; height: 150px; - width: 350px; + width: 375px; + position: absolute; + z-index: 999; + left: 40%; + top: 10px; + .county-description-title{ + padding-top: 5px; + font-weight: bold; + font-size: 16px; + background: #668194; + color: white; + border-top-left-radius: 5px; + border-top-right-radius: 5px; + margin-bottom: 5px; + text-transform: uppercase; + } + .glm-county-map-top-list{ + li{ + margin: 0 !important; + text-align: left; + padding: 0 5px !important; + } + } } \ No newline at end of file diff --git a/views/front/map/display.html b/views/front/map/display.html index 0cbac9f..1c077ea 100644 --- a/views/front/map/display.html +++ b/views/front/map/display.html @@ -115,7 +115,9 @@ } var ltInfo = ''; - + var countyDescription = $('
', { + id: "glm-county-description" + }).appendTo( $("#area-map")) new L.Marker([47.30, -89.85], { icon: new L.DivIcon({ className: 'my-div-icon', @@ -123,12 +125,12 @@ }) }).addTo(countyMap); - new L.Marker([47.47, -87.3], { - icon: new L.DivIcon({ - className: 'my-div-icon', - html: '
' - }) - }).addTo(countyMap); + // var countyDescription = new L.Marker([47.47, -87.3], { + // icon: new L.DivIcon({ + // className: 'my-div-icon', + // html: '
' + // }) + // }).addTo(countyMap); new L.Marker([46.8, -87.3], { icon: new L.DivIcon({ @@ -165,93 +167,13 @@ }).addTo(countyMap); countyMap.on('zoomend', function() { - if(countyMap.getZoom() < 8){ - $(".glm-theme-map-label").hide() - }else{ - $(".glm-theme-map-label").show() - } - }); - // $("#island-map").hover( - // function(){ - // countyMap._layers[144].setStyle({ - // weight: 3, - // color: "#003366", - // dashArray: '', - // fillOpacity: 0.1 - // }) - // }, function(){ - // countyMap._layers[144].setStyle({ - // weight: 2, - // color: "#000000", - // dashArray: '6', - // fillOpacity: 0 - // }) - // }) - // For each UP county - var countyLayer; - // $.each(keweenaw, function(county, countyData) { - // var page = "#"; - // var location = areas.filter( function(area){ - // return area.area_name == county; - // }); - - // location = location[0]; - // if(parseInt(location.page_id)){ - // page = pages[location.page_id]['url']; - // } - // // Get the GeoJson file for this county - // $.get(countiesDirectory + county + '.GeoJson', function(countyFile) { - - // // Convert the county file to a JSON - // var countyJSON = jQuery.parseJSON(countyFile); - - // // Add the county overlay to the map using "countyStyle" above - // countyLayer = L.geoJson(countyJSON, { - // style: islandStyle - // }).addTo(islandMap); - - // countyLayer.on({ - // mouseover: function(e){ - // var layer = e.target; - - // layer.setStyle({ - // weight: 3, - // color: location.hover_color, - // dashArray: '', - // fillOpacity: 0.1 - // }); - - // if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) { - // layer.bringToFront(); - // } - // }, - // mouseout: function(e){ - // var layer = e.target; - // layer.resetStyle(e.layer); - // }, - // click: function(){ - // window.location = page; - // } - // }); - // // Get center of the county and add offsets - // var center = countyLayer.getBounds().getCenter(); - // var center = new L.LatLng(center.lat + countyData.latOffset, center.lng + countyData.lonOffset); - - // // Create Div type icom for county names - // var countyNameIcon = L.divIcon({ - // className: 'county-name', - // html: '' + county + '' - // }); - - // // use county name icon as marker using center location calculated above. - // L.marker(center, { - // icon: countyNameIcon, - // county: county, - // url: countyData.url - // }).addTo(islandMap); - - // }); - // }); + if(countyMap.getZoom() < 8){ + $(".glm-theme-map-label").hide() + }else{ + $(".glm-theme-map-label").show() + } + }); + $.each(upperMI, function(county, countyData) { var page = "#"; var location = areas.filter( function(area){ @@ -283,7 +205,6 @@ mouseover: function(e){ var layer = e.target; - console.log(layer); if(layer._leaflet_id == 144){ {literal} $("#island-map").css({ "border-style":"solid", @@ -301,6 +222,20 @@ if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) { layer.bringToFront(); } + + var countyMapTopList = $("