Skip to content

geojsonio.embed redirects me to geojson.io instead of embedding an Iframe in the notebook. #6

@wroscoe

Description

@wroscoe

I'm trying to embed a map in my Jupyter notebook. When I try to run the geojsonio.embed(geojson) function, the browser window is redirected to the geojson.io site. However when I embed any other site in an Iframe, it works fine.

This try's to redirect me.

import geojsonio, json

geojson = { "type": "FeatureCollection",
            "features": [
              { "type": "Feature",
                 "geometry": {
                   "type": "Polygon",
                   "coordinates": [
                     [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0],
                       [100.0, 1.0], [100.0, 0.0] ]
                     ]
                 },
                 "properties": {
                   "prop0": "value0",
                   }
                 }
               ]
             }

#redirects me to a geojsonio site
url = geojsonio.embed(json.dumps(geojson))

Using another URL the iframe functionality works as expected.

from IPython.display import IFrame 
url0 = 'http://donkeycar.com'
IFrame(url, width='100%', height=500)  

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions