nextzen / nextzen.js

Javascript SDK for Mapzen products
ISC License
85 stars 43 forks source link

Exception(s) when calling fitBounds() #423

Closed brendanyounger closed 7 years ago

brendanyounger commented 7 years ago

I keep getting exceptions like the following when calling map.fitBounds() using the latest https://mapzen.com/js/mapzen.js.

I am adding a LayerGroup to the map a few milliseconds after it is mounted and then calling map.fitBounds() a few milliseconds after that.

   view.js:95 Uncaught TypeError: Cannot read property 'update' of undefined
    at View.update (view.js:95)
    at Scene.update (scene.js:449)
    at Scene.immediateRedraw (scene.js:402)
    at NewClass.hooks.move (leaflet_layer.js:107)
    at NewClass.fire (mapzen.js:7481)
    at NewClass._move (mapzen.js:10283)
    at NewClass._resetView (mapzen.js:10236)
    at NewClass.setView (mapzen.js:9338)
    at NewClass.fitBounds (mapzen.js:9420)
    at Map.js:194

and

   at NewClass._project (mapzen.js:16234)
    at NewClass._reset (mapzen.js:15263)
    at NewClass.onAdd (mapzen.js:15212)
    at NewClass._layerAdd (mapzen.js:10853)
    at NewClass.whenReady (mapzen.js:10495)
    at NewClass.addLayer (mapzen.js:10911)
    at NewClass.onAdd (mapzen.js:14809)
    at NewClass._layerAdd (mapzen.js:10853)
    at NewClass.fire (mapzen.js:7481)
    at NewClass._resetView (mapzen.js:10248)
    at NewClass.setView (mapzen.js:9338)
    at NewClass.fitBounds (mapzen.js:9420)
    at Map.js:194
hanbyul-here commented 7 years ago

Hi @brendanyounger ! Thanks for the issue. This seems to be related to this Tangram issue: https://github.com/tangrams/tangram/issues/584 . Tangram team is trying to release the fix soon, I will update you here when the fix is released.

hanbyul-here commented 7 years ago

We are expecting this bug to be fixed with the latest release (v0.8.2) which embeds Tangram v0.13.2