};
}
- // Hover event handler
- function highlightCounty(e) {
- var layer = e.target;
- layer.setStyle({
- weight: 3,
- color: 'blue',
- dashArray: '',
- fillOpacity: 0.1
- });
-
- if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {
- layer.bringToFront();
- }
-
- }
-
// Mouse out event handler
function resetSelectedCounty(e) {
var layer = e.target;
}).addTo(countyMap);
// Add actions to county layer
+ // countyLayer.on({
+ // mouseover: highlightCounty,
+ // mouseout: resetSelectedCounty,
+ // click: zoomToCounty
+ // });
countyLayer.on({
- mouseover: highlightCounty,
+ 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: resetSelectedCounty,
click: zoomToCounty
});
-
// 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);