-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TextPath and GeoJson layer #24
Comments
Hi, Yes absolutely, simply do: var myGeojsonLayer = L.geoJson(...);
myGeojsonLayer.setText(...) |
Works great 👍 Thanks for fast response! :) |
Hi, I've been trying to get this to work but dont seem to be making any head way. I'm trying to use this method to simulate road names but just cant get it to work. I'm loading my geoJSON data but cant seem to get my text to display. I don't suppose you could show an example of how this works with geoJSON feature data? Thanks. |
Something like that should do it (untested): L.geoJson(data, {
onEachFeature: function (feature, layer) {
layer.setText(feature.properties.streetname);
}
}).addTo(map); Please reproduce a small test case in jsfiddle or similar to make assistance easier... |
@Sc00t You can check the demo which now has an example similar to your case: http://makinacorpus.github.io/Leaflet.TextPath/ |
Thank you both, much appreciated. The demo shows exactly what I was I do have a further question if I may, I'm using a custom map and plan Thanks. On 2015-04-07 20:42, Frederic Bonifas wrote:
|
Hi,
I need to add to my geojson layer text/label for each feature.
Is it possible to do this with Leaflet.TextPath? If not, can it be added to this plugin?
:)
The text was updated successfully, but these errors were encountered: