Skip to content

Commit

Permalink
add example Notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
fitoprincipe committed Apr 25, 2019
1 parent 3b0e4da commit ac6480d
Showing 1 changed file with 115 additions and 0 deletions.
115 changes: 115 additions & 0 deletions examples/MapCursorStyle.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from ipyleaflet import Map"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "c0115c412e7e4257b1a207c6413c5dfd",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(basemap={'url': 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', 'max_zoom': 19, 'attribution': 'Map …"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"m = Map()\n",
"m.zoom = 3\n",
"m"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Change cursor's type\n",
"### Available types are listed here: https://www.w3schools.com/cssref/pr_class_cursor.asp"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"# Crosshair\n",
"m.style = {'cursor': 'crosshair'}"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"# Pointer\n",
"m.style = {'cursor': 'default'}"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"# Waiting\n",
"m.style = {'cursor': 'wait'}"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"# Get back to default behavior\n",
"m.style = {'cursor': ''}"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

0 comments on commit ac6480d

Please sign in to comment.