geoJson.addData() event
See original GitHub issueI suggest to add an event for when data is added to a geoJson layer so plugins can hook into it if they want to work with that data.
Me from the viewpoint of the plugin currently can’t tell if any data is added via addData
to the geoJson layer. Is that correct? Is there any workaround to this?
It came up with this issue in my drawing/editing plugin.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
in-place Update Leaflet GeoJSON feature - Stack Overflow
I the case of a CREATE I just do a GeoJSon.AddData() to the appropriate layer. But for the UPDATE and DELETE I want...
Read more >Using GeoJSON with Leaflet
GeoJSON is a very popular data format among many GIS technologies and services ... var myLayer = L.geoJSON().addTo(map); myLayer.addData(geojsonFeature); ...
Read more >Leaflet add data to GeoJSON without showing on map
I am adding using GeoJSON data pulled from a service. I want to load the GeoJSON layer but I don't want to display...
Read more >L.GeoJson
Useful for attaching events and popups to features. filter( <GeoJSON> featureData ... addData( <GeoJSON> data ), this, Adds a GeoJSON object to the...
Read more >Walkthrough: Adding interactive GeoJSON layers in Leaflet
Note that a call to L.DomEvent.stopPropogation() is needed so that if someone clicks a feature, only the feature click event handler code runs,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
GeoJSON
is internally aFeatureGroup
, a layer that contains other layers. Thelayeradd
andlayerremove
events are fired for theGeoJSON
layer when its content layers are modified.The
addData
function goes through each of the JSON objects in your array and callsaddLayer
on them, which fireslayeradd
for each one and provides you access to the new layer (via thelayer
property):FYI: it worked perfectly