From f4e5708a1afac78603c8b98c836c060aef37cb1d 2017-02-23 02:29:01 From: Matthias Bussonnier Date: 2017-02-23 02:29:01 Subject: [PATCH] Add docs and what's new. --- diff --git a/IPython/core/display.py b/IPython/core/display.py index 90cf8c6..4d43552 100644 --- a/IPython/core/display.py +++ b/IPython/core/display.py @@ -709,6 +709,37 @@ class GeoJSON(DisplayObject): Path to a local file to load the data from. metadata: dict Specify extra metadata to attach to the json display object. + + Examples + -------- + + The following will display an interactive map of Mars with a point of + interest on frontend that do support GeoJSON display. + + >>> from IPython.display import GeoJSON + + >>> GeoJSON(data={ + ... "type": "Feature", + ... "geometry": { + ... "type": "Point", + ... "coordinates": [-81.327, 296.038] + ... }, + ... "properties": { + ... "name": "Inca City" + ... } + ... }, + ... url_template="http://s3-eu-west-1.amazonaws.com/whereonmars.cartodb.net/{basemap_id}/{z}/{x}/{y}.png", + ... layer_options={ + ... "basemap_id": "celestia_mars-shaded-16k_global", + ... "attribution" : "Celestia/praesepe", + ... "minZoom" : 0, + ... "maxZoom" : 18, + ... }) + + + In the terminal IPython, you will only see the text representation of + the GeoJSON object. + """ self.url_template = url_template self.layer_options = layer_options diff --git a/docs/source/whatsnew/pr/display-geojson.rst b/docs/source/whatsnew/pr/display-geojson.rst new file mode 100644 index 0000000..5172f2b --- /dev/null +++ b/docs/source/whatsnew/pr/display-geojson.rst @@ -0,0 +1,2 @@ +* IPython.display has gained a :any:`GeoJSON ` object. + :ghpull:`10288` and :ghpull:`????`