telluric icon indicating copy to clipboard operation
telluric copied to clipboard

Reduce default zoom for points

Open astrojuanlu opened this issue 6 years ago • 2 comments

When one displays a point in telluric, the zoom level is maximum and the tiles are not shown. We should choose a sensible zoom value.

astrojuanlu avatar Jun 07 '18 06:06 astrojuanlu

As simple as:

diff --git telluric/plotting.py telluric/plotting.py
index f48cc10..c90f35b 100644
--- telluric/plotting.py
+++ telluric/plotting.py
@@ -135,7 +135,7 @@ def plot(feature, mp=None, style_function=None, **map_kwargs):
     else:
         if mp is None:
             center = feature.envelope.centroid.reproject(WGS84_CRS)
-            zoom = zoom_level_from_geometry(feature.envelope)
+            zoom = min(zoom_level_from_geometry(feature.envelope), 15)
 
             mp = Map(center=(center.y, center.x), zoom=zoom, **map_kwargs)
 

astrojuanlu avatar Oct 02 '18 19:10 astrojuanlu

...15 is an arbitrary value that, for the case of our default basemap (stamen terrain), does not always contain data in all regions.

astrojuanlu avatar Oct 02 '18 19:10 astrojuanlu