Show More
@@ -0,0 +1,2 b'' | |||
|
1 | * IPython.display has gained a :any:`GeoJSON <IPython.display.GeoJSON>` object. | |
|
2 | :ghpull:`10288` and :ghpull:`????` |
@@ -709,6 +709,37 b' class GeoJSON(DisplayObject):' | |||
|
709 | 709 | Path to a local file to load the data from. |
|
710 | 710 | metadata: dict |
|
711 | 711 | Specify extra metadata to attach to the json display object. |
|
712 | ||
|
713 | Examples | |
|
714 | -------- | |
|
715 | ||
|
716 | The following will display an interactive map of Mars with a point of | |
|
717 | interest on frontend that do support GeoJSON display. | |
|
718 | ||
|
719 | >>> from IPython.display import GeoJSON | |
|
720 | ||
|
721 | >>> GeoJSON(data={ | |
|
722 | ... "type": "Feature", | |
|
723 | ... "geometry": { | |
|
724 | ... "type": "Point", | |
|
725 | ... "coordinates": [-81.327, 296.038] | |
|
726 | ... }, | |
|
727 | ... "properties": { | |
|
728 | ... "name": "Inca City" | |
|
729 | ... } | |
|
730 | ... }, | |
|
731 | ... url_template="http://s3-eu-west-1.amazonaws.com/whereonmars.cartodb.net/{basemap_id}/{z}/{x}/{y}.png", | |
|
732 | ... layer_options={ | |
|
733 | ... "basemap_id": "celestia_mars-shaded-16k_global", | |
|
734 | ... "attribution" : "Celestia/praesepe", | |
|
735 | ... "minZoom" : 0, | |
|
736 | ... "maxZoom" : 18, | |
|
737 | ... }) | |
|
738 | <IPython.core.display.GeoJSON object> | |
|
739 | ||
|
740 | In the terminal IPython, you will only see the text representation of | |
|
741 | the GeoJSON object. | |
|
742 | ||
|
712 | 743 | """ |
|
713 | 744 | self.url_template = url_template |
|
714 | 745 | self.layer_options = layer_options |
General Comments 0
You need to be logged in to leave comments.
Login now