kekscom / osmbuildings

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

how can i make Buildings in 3d show up at smaller zoom levels #48

Closed epicanriome closed 10 years ago

epicanriome commented 10 years ago

Hi,

First i wanna say thanks for you awesome work. I use OSMBuildings as a plugin with Leaflet map. I use loadData method with my own database. It works well except that i want the buildings show up at smaller zoom levels. My buildings appear on the last two zoom levels but i want to see them before. I tried to change the MAX_HEIGHT on flatBuildings and it almost gave me what i need but only some of the buildings appear in 3d. I wanna know how to do this. Is there a way?

kekscom commented 10 years ago

Hi, I'm glad you like the library. Thank you. As you are already hacking a bit, check constants.js, there is a MIN_ZOOM setting. You probably need to combine this with your MAX_HEIGHT changes.

epicanriome commented 10 years ago

Hey. I tried what you said but it didn't work. My buildings all disappear at zoom level 15. At level 20 all my buildings show up, at level 19 too. But for level 18 and smaller it seems like less and less buildings are built until level 15 where no buildings appear. I don't need to see them under level 15 but i want to see them all at superior levels. I can't find where you decide if you have to add a building depending on its height and the current zoom level.

kekscom commented 10 years ago

Yes, that is where you need to tweak MIN_ZOOM and FlatBuildings.MAX_HEIGHT. MIN_ZOOM is generally the min zoom level from which buildings are drawn - reduce it. Then MAX_HEIGHT determines from which height on buildings are eleveted objects or just flat polygons (if below that threshold). The value is fixed but building height in screen pixels gets reduced by zooming out. Means: the further your are virtually away, the less detail is visible (better performance too). I can just assume, most of your builings have rather low heights. You should probably tweak this too. For further help I would need to see some running sample of your project.

[edit] corrected some awful typos

kekscom commented 10 years ago

From level 15+ this should be working fine now.