Hi,
trying to use fit_bounds, I have no results: the map stays in its starting center and zoom level.
How to use properly fit_bounds? I'm using it in a Python Jupyter Notebook.
Thank you
import os
import json
import Fiona
from ipyleaflet import Map, GeoJSON
with open('map.geojson', 'r') as f:
data = json.load(f)
fi = fiona.open("map.geojson")
m = Map(center=(38,13), zoom=7)
sw = [fi.bounds[1], fi.bounds[0]]
ne = [fi.bounds[3], fi.bounds[2]]
geo_json = GeoJSON(
data=data
)
m.add_layer(geo_json)
m.fit_bounds([sw, ne])
m
Hi, trying to use
fit_bounds
, I have no results: the map stays in its starting center and zoom level.How to use properly
fit_bounds
? I'm using it in a Python Jupyter Notebook.Thank you