Skip to content

GeoJSON: Map not zoomed correctly on initial render #28

@flesser

Description

@flesser

When opening a Notebook with GeoJSON renderer, the map widget sometimes is not centered but shows the whole world at a zoom layer of 0:

Screenshot

Only when the window or notebook panel gets resized (triggering the onResize message handler), the map correctly zooms in on the rendered features.

Debugging with console.log()s in the code revealed that this._map.getZoom() still is 0 even after calling fitBounds() at the end of renderModel.

I guess it has something to do with the map initialization code happening inside the Promise, when maybe the DOM isn't ready yet?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions