Closed Chris-airseed closed 1 year ago
It works fine on my end. Please run leafmap.Report()
and report the result here.
import leafmap
m = leafmap.Map()
url = 'https://opendata.digitalglobe.com/events/california-fire-2020/pre-event/2018-02-16/pine-gulch-fire20/1030010076004E00.tif'
m.add_cog_layer(url, name="Fire (pre-event)", zoom_to_layer=True)
m
Thanks giswqs The issue in the title was unclear. I've clarified it now.
Again, it works as expected on my end. Setting zoom_to_layer=False
does not change the map center/zoom level.
import leafmap
m = leafmap.Map(google_map="HYBRID", location=[-31.562117, 147.194643], zoom=5, locate_control=False, latlon_control=True, draw_export=False, minimap_control=False)
url = 'https://opendata.digitalglobe.com/events/california-fire-2020/pre-event/2018-02-16/pine-gulch-fire20/1030010076004E00.tif'
m.add_cog_layer(url, name="Fire (pre-event)", zoom_to_layer=False)
m
Thanks again! Okay so the issue was I had import leafmap.foliumap as leafmap rather than import leafmap
Actually the location issue still persists. It should centre on the East coast of Australia
Use center
rather than location
for ipyleaflet.
import leafmap
m = leafmap.Map(center=[-31.562117, 147.194643], zoom=5)
m
The folium bug has been fixed. Run leafmap.update_package()
and restart the kernel to take effect.
Use
center
rather thanlocation
for ipyleaflet.import leafmap m = leafmap.Map(center=[-31.562117, 147.194643], zoom=5) m
Yep. Just noticed that. Thank you
Environment Information
Description
Using add_cog_layer overrides location and zoom level. add_cog_layer()
What I Did