Closed denny123 closed 11 years ago
The last function call .setDate()
does not return a valid layer.
For now, break it into two statements:
var build = new L.BuildingsLayer().addTo(map);
build.geoJSON(bdata).setDate(new Date(2013, 03, 01, 11, 30));
now after remove build(unset in control) show error: "NOT_FOUND_ERR: DOM Exception 8"...
I don't get that exception in the reduced test environment. But buildings don't get re-added on remove -> add
I created this jsfiddle as playground. Could you try to reproduce the issue there? http://jsfiddle.net/osmbuildings/sbW36/1/
In jsfiddle your example not working too how me: after remove - not add, and my error can see on javascript console.
Strange. What browser are you using? Probably create a screenshot.
Chrome.
Whatever I do, I can't reproduce it. Please send me the versions of: Leaflet, OSM Buildings, Chrome you are using. Ideally I like to see the page on your server.
This error display sometimes with not only this problem, may be leaflet script....i trying more....
ok, now not have this error, but why after remove not add in console?
You mean, now you DON'T have it anymore? Would make some sense as there was some async image handling done wrong - maybe causing the bug. That should be fixed by now.
Am 07.03.2013 um 07:33 schrieb denny123 notifications@github.com:
ok, now not have this error, but why after remove not add in console?
— Reply to this email directly or view it on GitHub.
now no error: "NOT_FOUND_ERR: DOM Exception 8", but now if after remove 3D build(from consolelayers without error) i can't add...? 3D build layer not add in map. And if: var build = new L.BuildingsLayer(); build.geoJSON(bdata).setDate(new Date(2013, 03, 01, 11, 30)); then error: "Cannot call method 'geoJSON' of null"
I just learned myself you need to do the .addTo(map) before any setStyle or setDate calls.
ok, i hope this layer was working in controllayer.
Any news?
With version 0.1.8a there is a whole new version of OSM Buildings. Some possible error causes are fixed. But it's still working fine for me anyway. I was assuming that you do further checks on other code. Question is, whether the latest version is working better for you or not.
I have version 0.1.8a(i think in CHANGELOG.md) and after delete 3Dlayer in controlpanel i cant add more.
var build = new L.BuildingsLayer().addTo(map); build.geoJSON(bdata).setDate(new Date(2013, 03, 01, 11, 30));
//baseMaps = {"OpenStreetMap": mapnik}; overlayMaps = {"WMS статистика": wms, "Векторная статистика": geojson, "Прозрачный слой": defjson, "Магазины": markers_shop, "Поликлиники": markers_doctors, "3D здания": build}; control = L.control.layers({}, overlayMaps); map.addControl(control);
I'm not able to reproduce the issue that way. Please either set up a separate JSFiddle or point me to an URL with your project.
After seeing the code: I can't test this as I don't have most of the referred files. The sheer amount of plugins and inclusions indicates the issue can be everywhere. I can't debug it for you - at least not this way. Please copy your code, remove everything except LeafletJS and OSM Buildings and retry. Ideally, set that up in JSFiddle so I can take over and help at some point.
Hi Denny, just in case you are still using the code: I've fixed a bug which very likely caused that issue. Would be grat if you'd like to retry with latest version from master. Just be aware, there is no need for a hosted database on your side anymore. I'm still updating the docs.
I tried load() and all working and this very comfortable(i need buildings from OSM). Thank you.
var baseMaps; var overlayMaps; var control;
var wms = new L.TileLayer.WMS( "/geoserver/wms", { layers: "planet_osm_polygon", format: "image/png", transparent: true } );
var build = new L.BuildingsLayer().addTo(map).geoJSON(bdata).setDate(new Date(2013, 03, 01, 11, 30));
baseMaps = {"OpenStreetMap": mapnik}; overlayMaps = {"Население по районам": wms/, "3D здания": build/}; control = L.control.layers(baseMaps, overlayMaps); map.addControl(control);
ERROR: Cannot read property '_leaflet_id' of undefined?