Skip to content

Commit

Permalink
Update 3D choropleth map example (#839)
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs authored Jul 20, 2024
1 parent 1328ba1 commit d3bdf02
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions docs/maplibre/3d_choropleth.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,46 @@
"m"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"m = leafmap.Map(center=[-100, 40], zoom=3, pitch=60, style=\"basic\")\n",
"source = {\n",
" \"type\": \"geojson\",\n",
" \"data\": \"https://open.gishub.org/data/us/us_counties.geojson\",\n",
"}\n",
"m.add_source(\"counties\", source)\n",
"layer = {\n",
" \"id\": \"us-counties\",\n",
" \"source\": \"counties\",\n",
" \"type\": \"fill-extrusion\",\n",
" \"paint\": {\n",
" \"fill-extrusion-color\": [\n",
" \"interpolate\",\n",
" [\"linear\"],\n",
" [\"get\", \"CENSUSAREA\"],\n",
" 400,\n",
" \"#fff5eb\",\n",
" 600,\n",
" \"#fee6ce\",\n",
" 800,\n",
" \"#fdd0a2\",\n",
" 1000,\n",
" \"#fdae6b\",\n",
" ],\n",
" \"fill-extrusion-opacity\": 1,\n",
" \"fill-extrusion-height\": [\"*\", [\"get\", \"CENSUSAREA\"], 50],\n",
" },\n",
"}\n",
"first_symbol_layer_id = m.find_first_symbol_layer()[\"id\"]\n",
"m.add_layer(layer, first_symbol_layer_id)\n",
"m.add_layer_control()\n",
"m"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down

0 comments on commit d3bdf02

Please sign in to comment.