Geodan / mapbox-3dtiles

3D Tiles implementation using Mapbox GL JS custom layers
BSD 3-Clause "New" or "Revised" License
300 stars 62 forks source link

Error after removing layer #30

Closed tebben closed 4 years ago

tebben commented 4 years ago

All Mapbox3DTiles layers are broken after removing a Mapbox3DTiles layer from the map, this has probably something to do with: https://github.com/Geodan/mapbox-3dtiles/blob/master/Mapbox3DTiles.mjs#L691

Uncaught TypeError: this.cameraSync is null
    loadVisibleTiles Mapbox3DTiles.mjs:72
    updateCallback Mapbox3DTiles.mjs:117
    updateCamera CameraSync.mjs:120
    CameraSync CameraSync.mjs:38
    fire mapbox-gl.js:31
    _fireEvent mapbox-gl.js:35
    _fireEvents mapbox-gl.js:35
    _updateMapTransform mapbox-gl.js:35
    _applyChanges mapbox-gl.js:35
    _requestFrame mapbox-gl.js:35
    run mapbox-gl.js:35
    _render mapbox-gl.js:35
    _frame mapbox-gl.js:35
    frame mapbox-gl.js:31
    triggerRepaint mapbox-gl.js:35
    _render mapbox-gl.js:35
    _frame mapbox-gl.js:35
    frame mapbox-gl.js:31
    triggerRepaint mapbox-gl.js:35
    _update mapbox-gl.js:35
    _updateMapTransform mapbox-gl.js:35
    _applyChanges mapbox-gl.js:35
    _requestFrame mapbox-gl.js:35
    run mapbox-gl.js:35
    _render mapbox-gl.js:35
    _frame mapbox-gl.js:35
    frame mapbox-gl.js:31
anneb commented 4 years ago

Fixed: Map events are now removed on layer remove