kekscom / osmbuildings

OSM Buildings Classic 2.5D
http://osmbuildings.org
BSD 2-Clause "Simplified" License
505 stars 140 forks source link

Add support for displaying buildings layer and GeoJSON object(s) on multiple layers #107

Closed ryanimpey closed 3 years ago

ryanimpey commented 7 years ago

Adding a geojson object to the map whilst a building layer is already assigned will overwrite all buildings/geojson data currently on the map. With leaflet layers it would be nice to be able to show json on a seperate layer whilst keeping the main building layer visible as a base layer.

Thanks!

kekscom commented 6 years ago

Would be a good improvement!

ryanimpey commented 6 years ago

@kekscom Would this be a feature you'd be able to add? If not could you point me in a direction as to where I would start to add this enhancement. Thanks!

kekscom commented 6 years ago

You are very welcome to help!

These are the code parts, that decide between data tiles and a GeoJSON. https://github.com/kekscom/osmbuildings/blob/master/src/Data.js#L125 https://github.com/kekscom/osmbuildings/blob/master/src/Data.js#L144

Everywhere in that file you should remove separation between data sources and handle both.

ryanimpey commented 6 years ago

@kekscom Just to add to this, if I wanted to look into adding multiple, seperate GeoJson layers that could be toggled using the Leaflet Layer Groups and Layers Control (much like in this example http://leafletjs.com/examples/layers-control/) How would I go about doing that/what files would need modifying?

Thank you!

kekscom commented 6 years ago

Hi, OSM Buildings is absolutely not designed to run multiple instances. I also think it's a bad idea performance wise. My approach would be hacking the Leaflet layer switcher in order to make up and handle artificial layers.

Am 02.09.2017 um 19:10 schrieb Ryan notifications@github.com:

@kekscom If I wanted to look into adding multiple, seperate GeoJson layers that could be toggled using the Leaflet Layer Groups and Layers Control (much like in this example http://leafletjs.com/examples/layers-control/) How would I go about doing that/what files would need modifying?

Thank you!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.