# Plotting Maps offline, bypass the CDN

**URL:** <https://community.plotly.com/t/plotting-maps-offline-bypass-the-cdn/79753>\
**Category:** 📊 Plotly Python\
**Created:** [October 31, 2023, 2:19pm UTC](https://community.plotly.com/t/plotting-maps-offline-bypass-the-cdn/79753 "2023-10-31T14:19:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![guestvegetation](https://avatars.discourse-cdn.com/v4/letter/g/a87d85/32.png) [@guestvegetation](https://community.plotly.com/u/guestvegetation)\
**Post date:** [October 31, 2023, 2:19pm UTC](https://community.plotly.com/t/plotting-maps-offline-bypass-the-cdn/79753/1 "2023-10-31T14:19:13Z")

</div>

Hi All,

I’m running Plotly exclusively out of a Jupyter Lab environment that is air-gapped from the internet.  
My main use case is to produce charts that I export as SVG to be later added in static presentations.

Everything was fine until I tried doing **maps**.

I have this simple code to display in blue some European countries:

```auto
import plotly.express as px
import pandas as pd
import plotly.graph_objects as go

# Create a GeoDataFrame or DataFrame with European countries and their color
data = {
    "Country": ["France", "Germany", "Italy", "Spain", "United Kingdom", "Greece", "Portugal"],
    "Color": ["blue"] * 7
}
df = pd.DataFrame(data)

# Create a choropleth map using Plotly Express
fig = px.choropleth(
    df,
    locations="Country",
    color="Color",
    locationmode="country names",
    title="European Countries with Outlines",
    projection="natural earth",
)

# Customize the map layout
fig.update_geos(
    showcoastlines=True,
    coastlinecolor="black", # Color of country outlines
)
fig.show()

```

Which gives me a blank space in my notebook with an error message at the bottom:  
`Javascript Error: unexpected error while fetching topojson file at https://cdn.plot.ly/world_110m.json`

I have tried this solution : [Offline Scattergeo plots not working - #3 by carlmarl](https://community.plotly.com/t/offline-scattergeo-plots-not-working/43790/3)

That consist of running a Flask app that acts as a simple webserver and deliver the required .json through a local URL.

But, when I run the code above with a config tweak :

```auto
# ... rest of the code...
# Show the map
fig.show(config={'topojsonURL':'http://127.0.0.1:5000/plotlygeojsonfile/plotly/topojson/'})

```

I get the same blank map with a new error message: `Javascript Error: unexpected error while fetching topojson file at http://127.0.0.1:5000/plotlygeojsonfile/plotly/topojson/world_110m.json`

Which is interresting because it seems the new URL is accepted. But I see nothing in the logs of my Flask app. The URL was never reached.

Not, I’ve tested the server with a simple script:

```auto
import requests

file_url = "http://127.0.0.1:5000/plotlygeojsonfile/plotly/topojson/world_110m.json" # Replace with the correct URL

response = requests.head(file_url)

if response.status_code == 200:
    print("File is available.")
else:
    print("File is not available.")

```

And it returns “File is available” and the app logs shows it has been reached.

I’ve been searching for a solution for a couple of days but nothing. There seem to be things possible with Dash but I don’t know Dash at all. Like in this topic [Loading geo assets offline [Solved] - #3 by zoohair](https://community.plotly.com/t/loading-geo-assets-offline-solved/11869/3)
