kekscom/osmbuildings — pull request #45 by bennlich (2013-08-01 07:20:48+00:00)
Title: Two bug fixes: check for non-null attributionControl and listen for onViewReset event

1) Leaflet lets users disable attributionControl in Map options. I added a check for attributionControl before OSM tries to add its attribution.

2) After calling map.setView() and loading new building data, the building layer would be incorrectly offset until after scrolling the map. I added an onViewReset listener that realigns the building layer (just like onMoveEnd).

Note: the onViewReset event is also triggered after a zoom, so it might be worthwhile to set a flag in onZoom that prevents the onViewReset event handler from firing, but I didn't notice a significant performance hit.