Last active
August 29, 2015 14:13
-
-
Save jmoe/ef16dc9f294a69444802 to your computer and use it in GitHub Desktop.
Making paths easier to click with turf.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pathLayer = L.geoJson(geojsonData, { | |
onEachFeature: function(feature, layer) { | |
var buffered = turf.buffer(feature,0.01,'kilometers'); | |
var hoverZone = L.geoJson(buffered).addTo(someMap); | |
hoverZone.on('mouseover', function() { | |
// do something | |
}); | |
hoverZone.on('mouseout', function() { | |
// do something else | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment