Open BLGEric opened 7 years ago
so this plugin, internally, just converts the shapefile to geojson and creates a geojson layer, so anything you can do to a leaflet geojson layer you can do with this
OK I get it, thanks for your help.
I got another problem:
var test = new L.Shapefile('XX/XX/XX.zip'); var maptest = test.addTo(mymap);
these code works fine but I can not get the members under "test._layers" I tried using test._layers[i], and console.log shows "undefined" Plz help, thanks.
this is 100% a leaflet issue you have so you may want to seek help there, but more generally some issues
First of all, thanks for the help.
I'm using 1.1.0 version of leaflet. I put the "console.log(test)" under the addTo function, and result as follows
Here's the result of console.log(test._layers)
As you can see, the "feature" is just right there, but I couldn't find a way to get the key or value in that object. I've tried to add some new property into "feature" through console during runtime, and it worked. But if I add the property in my javascript, the property won't be added. It's just strange....
ok this is probably just because the way this works is
in your app you're probably somewhere in steps 3-5 when you're looking you're going to want to wait for the 'data:loaded' event to fire on the layer before doing any of that stuff.
OK, thanks for the help. I'll work on it. Much appreciated.
Hello, I'm now using your plugin for shapefiles. I want to know if there's a method to add new properties (self-defined) into the shapefile object? There's a method like "feature.properties.XXX = YYY" to add new property to the feature in GeoJson. Wondering if there's something similar to it or another way to do this. Thanks.