Distortions in holoviews map display, but only with panel serve

I have a simple panel app with a geographic plot generated using hvplot on two SpatialPandas Geodataframes and a holoviews basemap tile. When I run this app within a Jupyter notebook, everything is fine. But when I run it via panel serve --show paneapp.ipynb, the data along the x-axis is incorrectly stretched. That distortion doesn’t go away if I zoom in out. But, if I click the zoom_out tool and then the undo tool, the distortion disappears and the map looks as it should, and it stays that way through clicking zoom in/out and undo actions. But when I click the reset tool, the distortion reappears.

I’m out of ideas to test. I’ve reduced the panel app to the simplest form that reproduces the problem. Here’s the code, including the import statements. I’ve omitted the parts of the code that read and setup the geodataframes, for simplicity.

import geopandas as gpd
import spatialpandas as sp
from holoviews.element import tiles
import hvplot.pandas
import panel as pn

# a line SpatialPandas geodataframe, with crs set to EPSG:3857
deployments = gps_deployments_gdf.hvplot(
    tools=['zoom_out', 'undo']

# a point SpatialPandas geodataframe, with crs set to EPSG:3857
deployments_startpt = gps_deployments_start_gdf.hvplot(

    (tiles.EsriTerrain() * deployments * deployments_startpt)
    .options(width=850, height=600, xaxis=None, yaxis=None),

I’ve tried it with panel 0.14.4 and 1.0.2. Both environments have holoviews 1.16.0 and hvplot 0.8.3.


1 Like