kekscom / osmbuildings

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

Allow initialization without adding to a map / support for layers control #70

Closed amenk closed 9 years ago

amenk commented 9 years ago

Use case: Initialize 3D buildings but show them only after selection in the layer control.

Currently a map object must be supplied on initialization - so we can not add it to the layer control without directly showing the buildings.

Current workaround: Remove layer immediately after initialization.

kekscom commented 9 years ago

changed by a3b57a7427d476e5848d6a9378c1b5618bcd9317

You can now do:

var osmb = new OSMBuildings();
L.control.layers({}, { Buildings:osmb }).addTo(map);
osmb.addTo(map).load()
amenk commented 9 years ago

Cool thanks