Skip to content

Commit

Permalink
Add GeoJSON to the mimerenderer example
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpio committed Mar 5, 2021
1 parent 607c7cf commit 0ad0268
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions notebooks/mimerenderers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,50 @@
"fasta_output"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# GeoJSON"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from IPython.display import GeoJSON\n",
"\n",
"\n",
"geojson_button = Button(description='Output GeoJSON')\n",
"geojson_output = Output()\n",
"\n",
" \n",
"@geojson_output.capture()\n",
"def on_click(change):\n",
" obj = GeoJSON({\n",
" \"type\": \"Feature\",\n",
" \"geometry\": {\n",
" \"type\": \"Point\",\n",
" \"coordinates\": [-118.4563712, 34.0163116]\n",
" }\n",
" })\n",
" display.display(obj)\n",
" \n",
"\n",
"geojson_button.on_click(on_click)\n",
"display.display(geojson_button)\n",
"geojson_output"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
Expand Down

0 comments on commit 0ad0268

Please sign in to comment.