"
]
},
- "execution_count": 4,
+ "execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
@@ -189,7 +189,7 @@
},
{
"cell_type": "code",
- "execution_count": 5,
+ "execution_count": 4,
"metadata": {
"collapsed": true
},
@@ -206,7 +206,7 @@
},
{
"cell_type": "code",
- "execution_count": 6,
+ "execution_count": 5,
"metadata": {
"collapsed": false
},
@@ -235,7 +235,7 @@
" | 1.623847e+09 | \n",
" 330454.175933 | \n",
" (POLYGON ((970217.0223999023 145643.3322143555... | \n",
- " {'weight': 2, 'fillColor': '#ff0000', 'color':... | \n",
+ " {u'color': u'black', u'fillColor': u'#ff0000',... | \n",
" \n",
" \n",
" | 1 | \n",
@@ -244,7 +244,7 @@
" 1.937810e+09 | \n",
" 741227.337073 | \n",
" (POLYGON ((1021176.479003906 151374.7969970703... | \n",
- " {'weight': 2, 'fillColor': '#00ff00', 'color':... | \n",
+ " {u'color': u'black', u'fillColor': u'#00ff00',... | \n",
"
\n",
" \n",
" | 2 | \n",
@@ -253,7 +253,7 @@
" 3.045079e+09 | \n",
" 896875.396449 | \n",
" (POLYGON ((1029606.076599121 156073.8142089844... | \n",
- " {'weight': 2, 'fillColor': '#0000ff', 'color':... | \n",
+ " {u'color': u'black', u'fillColor': u'#0000ff',... | \n",
"
\n",
" \n",
" | 3 | \n",
@@ -262,7 +262,7 @@
" 6.364308e+08 | \n",
" 358400.912836 | \n",
" (POLYGON ((981219.0557861328 188655.3157958984... | \n",
- " {'weight': 2, 'fillColor': '#ffff00', 'color':... | \n",
+ " {u'color': u'black', u'fillColor': u'#ffff00',... | \n",
"
\n",
" \n",
" | 4 | \n",
@@ -271,7 +271,7 @@
" 1.186822e+09 | \n",
" 464475.145651 | \n",
" (POLYGON ((1012821.805786133 229228.2645874023... | \n",
- " {'weight': 2, 'fillColor': '#00ffff', 'color':... | \n",
+ " {u'color': u'black', u'fillColor': u'#00ffff',... | \n",
"
\n",
" \n",
"\n",
@@ -293,14 +293,14 @@
"4 (POLYGON ((1012821.805786133 229228.2645874023... \n",
"\n",
" style \n",
- "0 {'weight': 2, 'fillColor': '#ff0000', 'color':... \n",
- "1 {'weight': 2, 'fillColor': '#00ff00', 'color':... \n",
- "2 {'weight': 2, 'fillColor': '#0000ff', 'color':... \n",
- "3 {'weight': 2, 'fillColor': '#ffff00', 'color':... \n",
- "4 {'weight': 2, 'fillColor': '#00ffff', 'color':... "
+ "0 {u'color': u'black', u'fillColor': u'#ff0000',... \n",
+ "1 {u'color': u'black', u'fillColor': u'#00ff00',... \n",
+ "2 {u'color': u'black', u'fillColor': u'#0000ff',... \n",
+ "3 {u'color': u'black', u'fillColor': u'#ffff00',... \n",
+ "4 {u'color': u'black', u'fillColor': u'#00ffff',... "
]
},
- "execution_count": 6,
+ "execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
@@ -311,7 +311,7 @@
},
{
"cell_type": "code",
- "execution_count": 7,
+ "execution_count": 6,
"metadata": {
"collapsed": false
},
@@ -319,13 +319,13 @@
{
"data": {
"text/html": [
- ""
+ ""
],
"text/plain": [
- ""
+ ""
]
},
- "execution_count": 7,
+ "execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
@@ -338,6 +338,92 @@
"m"
]
},
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "We can also use the `popup_function` to set the popup for each feature in the GeoDataFrame. First, we'll create the function to return a HTML string from a GeoJson Feature:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "def make_popupcontent(feature):\n",
+ " return \"{}\".format(feature[\"properties\"][\"BoroName\"])"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "