kekscom / osmbuildings

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

Add LeafletJS 1.0 support #103

Open josefpaij opened 7 years ago

josefpaij commented 7 years ago

I am using Leaflet 1.0 in a project and would like to use OSMBuildings. However, there is an issue where the buildings get completely redrawn on the moveend event and they briefly disappear. Here is an example forked from the "Integrate with LeafletJS" example in the docs, using leaflet@1.0.1 instead of leaflet@0.7.3: http://codepen.io/anon/pen/XNbwYK

Are there plans to add support for LeafletJS 1.0? Any idea how to get around the redraw disappearance?

kekscom commented 7 years ago

I'd love to spent more time on 2.5D version but have very little time to do so. The flicker did appear on earlier versions as well as it does in OpenLayers. Basically on moveend many things are rebuilt. A slightly changed event emission might cause this.

tuckwat commented 7 years ago

Looks like the flickering is caused by the map drag inertia. Unfortunately you can't disable it directly but setting the inertiaDeceleration to a high enough value will effectively disable it and prevent flickering. I wasn't able to get it flicker-free with inertia.