Skip to content

Instantly share code, notes, and snippets.

@jmoe
Last active August 29, 2015 14:13
Show Gist options
  • Save jmoe/ef16dc9f294a69444802 to your computer and use it in GitHub Desktop.
Save jmoe/ef16dc9f294a69444802 to your computer and use it in GitHub Desktop.
Making paths easier to click with turf.js
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