From a55758d1aa8452e843194ff109b8068616b5eaf5 Mon Sep 17 00:00:00 2001 From: Qiusheng Wu Date: Sun, 27 Oct 2024 00:26:41 -0400 Subject: [PATCH] Fix maplibre notebook typos (#132) --- book/geospatial/maplibre.ipynb | 371 +++++++++++++++------------------ book/geospatial/maplibre.md | 21 +- 2 files changed, 173 insertions(+), 219 deletions(-) diff --git a/book/geospatial/maplibre.ipynb b/book/geospatial/maplibre.ipynb index e9f6448..9cbe645 100644 --- a/book/geospatial/maplibre.ipynb +++ b/book/geospatial/maplibre.ipynb @@ -249,7 +249,7 @@ "metadata": {}, "outputs": [], "source": [ - "m = leafmap.Map(center=[11.255, 43.77], zoom=13, style=\"streets\", controls={})\n", + "m = leafmap.Map(center=[11.255, 43.77], zoom=13, style=\"positron\", controls={})\n", "m.add_control(\"fullscreen\", position=\"top-right\")\n", "m" ] @@ -271,7 +271,7 @@ "metadata": {}, "outputs": [], "source": [ - "m = leafmap.Map(center=[11.255, 43.77], zoom=13, style=\"streets\", controls={})\n", + "m = leafmap.Map(center=[11.255, 43.77], zoom=13, style=\"positron\", controls={})\n", "m.add_control(\"navigation\", position=\"top-left\")\n", "m" ] @@ -1664,35 +1664,6 @@ "cell_type": "markdown", "id": "107", "metadata": {}, - "source": [ - "### Local Vector Data\n", - "\n", - "Local vector files, such as GeoJSON, can be loaded directly into the map. The example downloads a GeoJSON file representing U.S. states and adds it to the map using `open_geojson`." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "108", - "metadata": {}, - "outputs": [], - "source": [ - "m = leafmap.Map(center=[-100, 40], zoom=3, style=\"streets\")\n", - "url = \"https://github.com/opengeos/datasets/releases/download/us/us_states.geojson\"\n", - "gdf = leafmap.geojson_to_gdf(url)\n", - "paint = {\n", - " \"fill-color\": \"#3388ff\",\n", - " \"fill-opacity\": 0.8,\n", - " \"fill-outline-color\": \"#ffffff\",\n", - "}\n", - "m.add_gdf(gdf, layer_type=\"fill\", name=\"States\", paint=paint)\n", - "m" - ] - }, - { - "cell_type": "markdown", - "id": "109", - "metadata": {}, "source": [ "### Changing Building Color\n", "\n", @@ -1702,7 +1673,7 @@ { "cell_type": "code", "execution_count": null, - "id": "110", + "id": "108", "metadata": {}, "outputs": [], "source": [ @@ -1724,7 +1695,7 @@ { "cell_type": "code", "execution_count": null, - "id": "111", + "id": "109", "metadata": {}, "outputs": [], "source": [ @@ -1733,7 +1704,7 @@ }, { "cell_type": "markdown", - "id": "112", + "id": "110", "metadata": {}, "source": [ "![](https://i.imgur.com/PayiTON.png)" @@ -1741,7 +1712,7 @@ }, { "cell_type": "markdown", - "id": "113", + "id": "111", "metadata": {}, "source": [ "### Adding a New Layer Below Labels\n", @@ -1752,7 +1723,7 @@ { "cell_type": "code", "execution_count": null, - "id": "114", + "id": "112", "metadata": {}, "outputs": [], "source": [ @@ -1776,7 +1747,7 @@ }, { "cell_type": "markdown", - "id": "115", + "id": "113", "metadata": {}, "source": [ "### Heat Map\n", @@ -1787,7 +1758,7 @@ { "cell_type": "code", "execution_count": null, - "id": "116", + "id": "114", "metadata": {}, "outputs": [], "source": [ @@ -1881,7 +1852,7 @@ }, { "cell_type": "markdown", - "id": "117", + "id": "115", "metadata": {}, "source": [ "![](https://i.imgur.com/OLCRPKj.png)" @@ -1889,7 +1860,7 @@ }, { "cell_type": "markdown", - "id": "118", + "id": "116", "metadata": {}, "source": [ "### Visualizing Population Density\n", @@ -1900,7 +1871,7 @@ { "cell_type": "code", "execution_count": null, - "id": "119", + "id": "117", "metadata": {}, "outputs": [], "source": [ @@ -1955,7 +1926,7 @@ }, { "cell_type": "markdown", - "id": "120", + "id": "118", "metadata": {}, "source": [ "## Visualizing Raster Data\n", @@ -1972,7 +1943,7 @@ { "cell_type": "code", "execution_count": null, - "id": "121", + "id": "119", "metadata": {}, "outputs": [], "source": [ @@ -1984,7 +1955,7 @@ { "cell_type": "code", "execution_count": null, - "id": "122", + "id": "120", "metadata": {}, "outputs": [], "source": [ @@ -1998,7 +1969,7 @@ { "cell_type": "code", "execution_count": null, - "id": "123", + "id": "121", "metadata": {}, "outputs": [], "source": [ @@ -2007,7 +1978,7 @@ }, { "cell_type": "markdown", - "id": "124", + "id": "122", "metadata": {}, "source": [ "A Digital Elevation Model (DEM) is also downloaded and visualized with a terrain color scheme. Leafmap’s `layer_interact` method allows interactive adjustments." @@ -2016,7 +1987,7 @@ { "cell_type": "code", "execution_count": null, - "id": "125", + "id": "123", "metadata": {}, "outputs": [], "source": [ @@ -2028,7 +1999,7 @@ { "cell_type": "code", "execution_count": null, - "id": "126", + "id": "124", "metadata": {}, "outputs": [], "source": [ @@ -2040,7 +2011,7 @@ { "cell_type": "code", "execution_count": null, - "id": "127", + "id": "125", "metadata": {}, "outputs": [], "source": [ @@ -2049,7 +2020,7 @@ }, { "cell_type": "markdown", - "id": "128", + "id": "126", "metadata": {}, "source": [ "### Cloud Optimized GeoTIFF (COG)\n", @@ -2060,7 +2031,7 @@ { "cell_type": "code", "execution_count": null, - "id": "129", + "id": "127", "metadata": {}, "outputs": [], "source": [ @@ -2080,7 +2051,7 @@ { "cell_type": "code", "execution_count": null, - "id": "130", + "id": "128", "metadata": {}, "outputs": [], "source": [ @@ -2089,7 +2060,7 @@ }, { "cell_type": "markdown", - "id": "131", + "id": "129", "metadata": {}, "source": [ "### STAC Layer\n", @@ -2100,7 +2071,7 @@ { "cell_type": "code", "execution_count": null, - "id": "132", + "id": "130", "metadata": {}, "outputs": [], "source": [ @@ -2115,7 +2086,7 @@ { "cell_type": "code", "execution_count": null, - "id": "133", + "id": "131", "metadata": {}, "outputs": [], "source": [ @@ -2124,7 +2095,7 @@ }, { "cell_type": "markdown", - "id": "134", + "id": "132", "metadata": {}, "source": [ "Leafmap also supports loading STAC items from the [Microsoft Planetary Computer](https://planetarycomputer.microsoft.com). The example demonstrates how to load a STAC item from the Planetary Computer and display it on the map." @@ -2133,7 +2104,7 @@ { "cell_type": "code", "execution_count": null, - "id": "135", + "id": "133", "metadata": {}, "outputs": [], "source": [ @@ -2144,7 +2115,7 @@ { "cell_type": "code", "execution_count": null, - "id": "136", + "id": "134", "metadata": {}, "outputs": [], "source": [ @@ -2154,7 +2125,7 @@ { "cell_type": "code", "execution_count": null, - "id": "137", + "id": "135", "metadata": {}, "outputs": [], "source": [ @@ -2170,7 +2141,7 @@ }, { "cell_type": "markdown", - "id": "138", + "id": "136", "metadata": {}, "source": [ "## Interacting with the Map\n", @@ -2186,7 +2157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "139", + "id": "137", "metadata": {}, "outputs": [], "source": [ @@ -2198,7 +2169,7 @@ }, { "cell_type": "markdown", - "id": "140", + "id": "138", "metadata": {}, "source": [ "### Disabling Scroll Zoom\n", @@ -2209,7 +2180,7 @@ { "cell_type": "code", "execution_count": null, - "id": "141", + "id": "139", "metadata": {}, "outputs": [], "source": [ @@ -2219,7 +2190,7 @@ }, { "cell_type": "markdown", - "id": "142", + "id": "140", "metadata": {}, "source": [ "### Fitting Bounds\n", @@ -2230,7 +2201,7 @@ { "cell_type": "code", "execution_count": null, - "id": "143", + "id": "141", "metadata": {}, "outputs": [], "source": [ @@ -2240,7 +2211,7 @@ }, { "cell_type": "markdown", - "id": "144", + "id": "142", "metadata": {}, "source": [ "Fit to Kenya." @@ -2249,7 +2220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "145", + "id": "143", "metadata": {}, "outputs": [], "source": [ @@ -2260,7 +2231,7 @@ { "cell_type": "code", "execution_count": null, - "id": "146", + "id": "144", "metadata": {}, "outputs": [], "source": [ @@ -2307,7 +2278,7 @@ { "cell_type": "code", "execution_count": null, - "id": "147", + "id": "145", "metadata": {}, "outputs": [], "source": [ @@ -2318,7 +2289,7 @@ { "cell_type": "code", "execution_count": null, - "id": "148", + "id": "146", "metadata": {}, "outputs": [], "source": [ @@ -2327,7 +2298,7 @@ }, { "cell_type": "markdown", - "id": "149", + "id": "147", "metadata": {}, "source": [ "### Restricting Map Panning to an Area\n", @@ -2338,7 +2309,7 @@ { "cell_type": "code", "execution_count": null, - "id": "150", + "id": "148", "metadata": {}, "outputs": [], "source": [ @@ -2351,7 +2322,7 @@ { "cell_type": "code", "execution_count": null, - "id": "151", + "id": "149", "metadata": {}, "outputs": [], "source": [ @@ -2361,7 +2332,7 @@ }, { "cell_type": "markdown", - "id": "152", + "id": "150", "metadata": {}, "source": [ "### Flying To\n", @@ -2372,7 +2343,7 @@ { "cell_type": "code", "execution_count": null, - "id": "153", + "id": "151", "metadata": {}, "outputs": [], "source": [ @@ -2383,7 +2354,7 @@ { "cell_type": "code", "execution_count": null, - "id": "154", + "id": "152", "metadata": {}, "outputs": [], "source": [ @@ -2393,7 +2364,7 @@ { "cell_type": "code", "execution_count": null, - "id": "155", + "id": "153", "metadata": {}, "outputs": [], "source": [ @@ -2404,7 +2375,7 @@ { "cell_type": "code", "execution_count": null, - "id": "156", + "id": "154", "metadata": {}, "outputs": [], "source": [ @@ -2423,7 +2394,7 @@ }, { "cell_type": "markdown", - "id": "157", + "id": "155", "metadata": {}, "source": [ "### Jumping to a Series of Locations\n", @@ -2434,7 +2405,7 @@ { "cell_type": "code", "execution_count": null, - "id": "158", + "id": "156", "metadata": {}, "outputs": [], "source": [ @@ -2444,7 +2415,7 @@ { "cell_type": "code", "execution_count": null, - "id": "159", + "id": "157", "metadata": {}, "outputs": [], "source": [ @@ -2491,7 +2462,7 @@ { "cell_type": "code", "execution_count": null, - "id": "160", + "id": "158", "metadata": {}, "outputs": [], "source": [ @@ -2503,7 +2474,7 @@ }, { "cell_type": "markdown", - "id": "161", + "id": "159", "metadata": {}, "source": [ "### Getting Coordinates of the Mouse Pointer\n", @@ -2514,7 +2485,7 @@ { "cell_type": "code", "execution_count": null, - "id": "162", + "id": "160", "metadata": {}, "outputs": [], "source": [ @@ -2524,7 +2495,7 @@ { "cell_type": "code", "execution_count": null, - "id": "163", + "id": "161", "metadata": {}, "outputs": [], "source": [ @@ -2535,7 +2506,7 @@ { "cell_type": "code", "execution_count": null, - "id": "164", + "id": "162", "metadata": {}, "outputs": [], "source": [ @@ -2545,7 +2516,7 @@ { "cell_type": "code", "execution_count": null, - "id": "165", + "id": "163", "metadata": {}, "outputs": [], "source": [ @@ -2564,7 +2535,7 @@ }, { "cell_type": "markdown", - "id": "166", + "id": "164", "metadata": {}, "source": [ "## Customizing Layer Styles\n", @@ -2579,7 +2550,7 @@ { "cell_type": "code", "execution_count": null, - "id": "167", + "id": "165", "metadata": {}, "outputs": [], "source": [ @@ -2590,7 +2561,7 @@ { "cell_type": "code", "execution_count": null, - "id": "168", + "id": "166", "metadata": {}, "outputs": [], "source": [ @@ -2599,7 +2570,7 @@ }, { "cell_type": "markdown", - "id": "169", + "id": "167", "metadata": {}, "source": [ "### Changing Case of Labels\n", @@ -2610,7 +2581,7 @@ { "cell_type": "code", "execution_count": null, - "id": "170", + "id": "168", "metadata": {}, "outputs": [], "source": [ @@ -2646,7 +2617,7 @@ }, { "cell_type": "markdown", - "id": "171", + "id": "169", "metadata": {}, "source": [ "![](https://i.imgur.com/FzGOovv.png)" @@ -2654,7 +2625,7 @@ }, { "cell_type": "markdown", - "id": "172", + "id": "170", "metadata": {}, "source": [ "### Variable Label Placement\n", @@ -2665,7 +2636,7 @@ { "cell_type": "code", "execution_count": null, - "id": "173", + "id": "171", "metadata": {}, "outputs": [], "source": [ @@ -2733,7 +2704,7 @@ { "cell_type": "code", "execution_count": null, - "id": "174", + "id": "172", "metadata": {}, "outputs": [], "source": [ @@ -2742,7 +2713,7 @@ }, { "cell_type": "markdown", - "id": "175", + "id": "173", "metadata": {}, "source": [ "## Adding Custom Components\n", @@ -2759,7 +2730,7 @@ { "cell_type": "code", "execution_count": null, - "id": "176", + "id": "174", "metadata": {}, "outputs": [], "source": [ @@ -2796,7 +2767,7 @@ }, { "cell_type": "markdown", - "id": "177", + "id": "175", "metadata": {}, "source": [ "![](https://i.imgur.com/Nq1uV9d.png)" @@ -2805,7 +2776,7 @@ { "cell_type": "code", "execution_count": null, - "id": "178", + "id": "176", "metadata": {}, "outputs": [], "source": [ @@ -2818,7 +2789,7 @@ { "cell_type": "code", "execution_count": null, - "id": "179", + "id": "177", "metadata": {}, "outputs": [], "source": [ @@ -2830,7 +2801,7 @@ }, { "cell_type": "markdown", - "id": "180", + "id": "178", "metadata": {}, "source": [ "To customize icons, you can also generate icon data with `numpy`, creating unique color gradients and using it as a map icon." @@ -2839,7 +2810,7 @@ { "cell_type": "code", "execution_count": null, - "id": "181", + "id": "179", "metadata": {}, "outputs": [], "source": [ @@ -2895,7 +2866,7 @@ }, { "cell_type": "markdown", - "id": "182", + "id": "180", "metadata": {}, "source": [ "![](https://i.imgur.com/qWWlnAm.png)" @@ -2903,7 +2874,7 @@ }, { "cell_type": "markdown", - "id": "183", + "id": "181", "metadata": {}, "source": [ "### Adding Text\n", @@ -2916,7 +2887,7 @@ { "cell_type": "code", "execution_count": null, - "id": "184", + "id": "182", "metadata": {}, "outputs": [], "source": [ @@ -2930,7 +2901,7 @@ }, { "cell_type": "markdown", - "id": "185", + "id": "183", "metadata": {}, "source": [ "![](https://i.imgur.com/UAtlh3r.png)" @@ -2938,7 +2909,7 @@ }, { "cell_type": "markdown", - "id": "186", + "id": "184", "metadata": {}, "source": [ "### Adding GIF\n", @@ -2949,7 +2920,7 @@ { "cell_type": "code", "execution_count": null, - "id": "187", + "id": "185", "metadata": {}, "outputs": [], "source": [ @@ -2965,7 +2936,7 @@ }, { "cell_type": "markdown", - "id": "188", + "id": "186", "metadata": {}, "source": [ "![](https://i.imgur.com/auytBtD.png)" @@ -2973,7 +2944,7 @@ }, { "cell_type": "markdown", - "id": "189", + "id": "187", "metadata": {}, "source": [ "### Adding HTML\n", @@ -2984,7 +2955,7 @@ { "cell_type": "code", "execution_count": null, - "id": "190", + "id": "188", "metadata": {}, "outputs": [], "source": [ @@ -3011,7 +2982,7 @@ }, { "cell_type": "markdown", - "id": "191", + "id": "189", "metadata": {}, "source": [ "![](https://i.imgur.com/TgalNOv.png)" @@ -3019,7 +2990,7 @@ }, { "cell_type": "markdown", - "id": "192", + "id": "190", "metadata": {}, "source": [ "### Adding Color bar\n", @@ -3032,7 +3003,7 @@ { "cell_type": "code", "execution_count": null, - "id": "193", + "id": "191", "metadata": {}, "outputs": [], "source": [ @@ -3055,7 +3026,7 @@ }, { "cell_type": "markdown", - "id": "194", + "id": "192", "metadata": {}, "source": [ "Make the color bar background transparent to blend seamlessly with the map." @@ -3064,7 +3035,7 @@ { "cell_type": "code", "execution_count": null, - "id": "195", + "id": "193", "metadata": {}, "outputs": [], "source": [ @@ -3090,7 +3061,7 @@ }, { "cell_type": "markdown", - "id": "196", + "id": "194", "metadata": {}, "source": [ "Make the color bar vertical for a different layout." @@ -3099,7 +3070,7 @@ { "cell_type": "code", "execution_count": null, - "id": "197", + "id": "195", "metadata": {}, "outputs": [], "source": [ @@ -3127,7 +3098,7 @@ }, { "cell_type": "markdown", - "id": "198", + "id": "196", "metadata": {}, "source": [ "### Adding Legend\n", @@ -3140,7 +3111,7 @@ { "cell_type": "code", "execution_count": null, - "id": "199", + "id": "197", "metadata": {}, "outputs": [], "source": [ @@ -3161,7 +3132,7 @@ { "cell_type": "code", "execution_count": null, - "id": "200", + "id": "198", "metadata": {}, "outputs": [], "source": [ @@ -3177,7 +3148,7 @@ { "cell_type": "code", "execution_count": null, - "id": "201", + "id": "199", "metadata": {}, "outputs": [], "source": [ @@ -3220,7 +3191,7 @@ }, { "cell_type": "markdown", - "id": "202", + "id": "200", "metadata": {}, "source": [ "![](https://i.imgur.com/dy60trf.png)" @@ -3228,7 +3199,7 @@ }, { "cell_type": "markdown", - "id": "203", + "id": "201", "metadata": {}, "source": [ "### Adding Video\n", @@ -3239,7 +3210,7 @@ { "cell_type": "code", "execution_count": null, - "id": "204", + "id": "202", "metadata": {}, "outputs": [], "source": [ @@ -3264,7 +3235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "205", + "id": "203", "metadata": {}, "outputs": [], "source": [ @@ -3286,7 +3257,7 @@ }, { "cell_type": "markdown", - "id": "206", + "id": "204", "metadata": {}, "source": [ "## PMTiles\n", @@ -3301,7 +3272,7 @@ { "cell_type": "code", "execution_count": null, - "id": "207", + "id": "205", "metadata": {}, "outputs": [], "source": [ @@ -3314,7 +3285,7 @@ { "cell_type": "code", "execution_count": null, - "id": "208", + "id": "206", "metadata": {}, "outputs": [], "source": [ @@ -3362,7 +3333,7 @@ { "cell_type": "code", "execution_count": null, - "id": "209", + "id": "207", "metadata": {}, "outputs": [], "source": [ @@ -3371,7 +3342,7 @@ }, { "cell_type": "markdown", - "id": "210", + "id": "208", "metadata": {}, "source": [ "### Source Cooperative Data\n", @@ -3382,7 +3353,7 @@ { "cell_type": "code", "execution_count": null, - "id": "211", + "id": "209", "metadata": {}, "outputs": [], "source": [ @@ -3395,7 +3366,7 @@ { "cell_type": "code", "execution_count": null, - "id": "212", + "id": "210", "metadata": {}, "outputs": [], "source": [ @@ -3437,7 +3408,7 @@ { "cell_type": "code", "execution_count": null, - "id": "213", + "id": "211", "metadata": {}, "outputs": [], "source": [ @@ -3446,7 +3417,7 @@ }, { "cell_type": "markdown", - "id": "214", + "id": "212", "metadata": {}, "source": [ "### 3D PMTiles\n", @@ -3457,7 +3428,7 @@ { "cell_type": "code", "execution_count": null, - "id": "215", + "id": "213", "metadata": {}, "outputs": [], "source": [ @@ -3470,7 +3441,7 @@ { "cell_type": "code", "execution_count": null, - "id": "216", + "id": "214", "metadata": {}, "outputs": [], "source": [ @@ -3525,7 +3496,7 @@ }, { "cell_type": "markdown", - "id": "217", + "id": "215", "metadata": {}, "source": [ "### 3D Buildings\n", @@ -3536,7 +3507,7 @@ { "cell_type": "code", "execution_count": null, - "id": "218", + "id": "216", "metadata": {}, "outputs": [], "source": [ @@ -3551,7 +3522,7 @@ }, { "cell_type": "markdown", - "id": "219", + "id": "217", "metadata": {}, "source": [ "### 2D Buildings, Transportation, and Other Themes\n", @@ -3564,7 +3535,7 @@ { "cell_type": "code", "execution_count": null, - "id": "220", + "id": "218", "metadata": {}, "outputs": [], "source": [ @@ -3577,7 +3548,7 @@ }, { "cell_type": "markdown", - "id": "221", + "id": "219", "metadata": {}, "source": [ "Transportation theme:" @@ -3586,7 +3557,7 @@ { "cell_type": "code", "execution_count": null, - "id": "222", + "id": "220", "metadata": {}, "outputs": [], "source": [ @@ -3599,7 +3570,7 @@ }, { "cell_type": "markdown", - "id": "223", + "id": "221", "metadata": {}, "source": [ "Places theme:" @@ -3608,7 +3579,7 @@ { "cell_type": "code", "execution_count": null, - "id": "224", + "id": "222", "metadata": {}, "outputs": [], "source": [ @@ -3621,7 +3592,7 @@ }, { "cell_type": "markdown", - "id": "225", + "id": "223", "metadata": {}, "source": [ "Addresses theme:" @@ -3630,7 +3601,7 @@ { "cell_type": "code", "execution_count": null, - "id": "226", + "id": "224", "metadata": {}, "outputs": [], "source": [ @@ -3643,7 +3614,7 @@ }, { "cell_type": "markdown", - "id": "227", + "id": "225", "metadata": {}, "source": [ "Base theme:" @@ -3652,7 +3623,7 @@ { "cell_type": "code", "execution_count": null, - "id": "228", + "id": "226", "metadata": {}, "outputs": [], "source": [ @@ -3665,7 +3636,7 @@ }, { "cell_type": "markdown", - "id": "229", + "id": "227", "metadata": {}, "source": [ "Divisions themem:" @@ -3674,7 +3645,7 @@ { "cell_type": "code", "execution_count": null, - "id": "230", + "id": "228", "metadata": {}, "outputs": [], "source": [ @@ -3687,7 +3658,7 @@ }, { "cell_type": "markdown", - "id": "231", + "id": "229", "metadata": {}, "source": [ "## Deck.GL Layers\n", @@ -3702,7 +3673,7 @@ { "cell_type": "code", "execution_count": null, - "id": "232", + "id": "230", "metadata": {}, "outputs": [], "source": [ @@ -3731,7 +3702,7 @@ }, { "cell_type": "markdown", - "id": "233", + "id": "231", "metadata": {}, "source": [ "### Multiple Deck.GL Layers\n", @@ -3744,7 +3715,7 @@ { "cell_type": "code", "execution_count": null, - "id": "234", + "id": "232", "metadata": {}, "outputs": [], "source": [ @@ -3755,7 +3726,7 @@ { "cell_type": "code", "execution_count": null, - "id": "235", + "id": "233", "metadata": {}, "outputs": [], "source": [ @@ -3806,7 +3777,7 @@ }, { "cell_type": "markdown", - "id": "236", + "id": "234", "metadata": {}, "source": [ "The result is a rich, interactive visualization that highlights both point data and relational data connections, useful for airport connectivity or hub-and-spoke modeling.\n", @@ -3822,7 +3793,7 @@ { "cell_type": "code", "execution_count": null, - "id": "237", + "id": "235", "metadata": {}, "outputs": [], "source": [ @@ -3838,7 +3809,7 @@ { "cell_type": "code", "execution_count": null, - "id": "238", + "id": "236", "metadata": {}, "outputs": [], "source": [ @@ -3847,7 +3818,7 @@ }, { "cell_type": "markdown", - "id": "239", + "id": "237", "metadata": {}, "source": [ "![](https://i.imgur.com/oHQDf79.png)" @@ -3855,7 +3826,7 @@ }, { "cell_type": "markdown", - "id": "240", + "id": "238", "metadata": {}, "source": [ "You can overlay Earth Engine data with other 3D elements, like buildings, to create a multi-layered, interactive map. " @@ -3864,7 +3835,7 @@ { "cell_type": "code", "execution_count": null, - "id": "241", + "id": "239", "metadata": {}, "outputs": [], "source": [ @@ -3879,7 +3850,7 @@ }, { "cell_type": "markdown", - "id": "242", + "id": "240", "metadata": {}, "source": [ "![](https://i.imgur.com/Y52jep5.png)" @@ -3887,7 +3858,7 @@ }, { "cell_type": "markdown", - "id": "243", + "id": "241", "metadata": {}, "source": [ "If you have an Earth Engine account, authenticate and initialize Earth Engine in your notebook by uncommenting the relevant code." @@ -3896,7 +3867,7 @@ { "cell_type": "code", "execution_count": null, - "id": "244", + "id": "242", "metadata": {}, "outputs": [], "source": [ @@ -3909,7 +3880,7 @@ { "cell_type": "code", "execution_count": null, - "id": "245", + "id": "243", "metadata": {}, "outputs": [], "source": [ @@ -3924,7 +3895,7 @@ }, { "cell_type": "markdown", - "id": "246", + "id": "244", "metadata": {}, "source": [ "## Animations\n", @@ -3937,7 +3908,7 @@ { "cell_type": "code", "execution_count": null, - "id": "247", + "id": "245", "metadata": {}, "outputs": [], "source": [ @@ -3948,7 +3919,7 @@ { "cell_type": "code", "execution_count": null, - "id": "248", + "id": "246", "metadata": {}, "outputs": [], "source": [ @@ -3962,7 +3933,7 @@ { "cell_type": "code", "execution_count": null, - "id": "249", + "id": "247", "metadata": {}, "outputs": [], "source": [ @@ -3989,7 +3960,7 @@ { "cell_type": "code", "execution_count": null, - "id": "250", + "id": "248", "metadata": {}, "outputs": [], "source": [ @@ -4004,7 +3975,7 @@ }, { "cell_type": "markdown", - "id": "251", + "id": "249", "metadata": {}, "source": [ "![](https://i.imgur.com/LRwfBl9.png)" @@ -4012,7 +3983,7 @@ }, { "cell_type": "markdown", - "id": "252", + "id": "250", "metadata": {}, "source": [ "### Animating the Map Camera Around a Point\n", @@ -4023,7 +3994,7 @@ { "cell_type": "code", "execution_count": null, - "id": "253", + "id": "251", "metadata": {}, "outputs": [], "source": [ @@ -4068,7 +4039,7 @@ }, { "cell_type": "markdown", - "id": "254", + "id": "252", "metadata": {}, "source": [ "![](https://i.imgur.com/odCwtjT.png)" @@ -4076,7 +4047,7 @@ }, { "cell_type": "markdown", - "id": "255", + "id": "253", "metadata": {}, "source": [ "### Animating a Point\n", @@ -4087,7 +4058,7 @@ { "cell_type": "code", "execution_count": null, - "id": "256", + "id": "254", "metadata": {}, "outputs": [], "source": [ @@ -4099,7 +4070,7 @@ { "cell_type": "code", "execution_count": null, - "id": "257", + "id": "255", "metadata": {}, "outputs": [], "source": [ @@ -4109,7 +4080,7 @@ { "cell_type": "code", "execution_count": null, - "id": "258", + "id": "256", "metadata": {}, "outputs": [], "source": [ @@ -4123,7 +4094,7 @@ { "cell_type": "code", "execution_count": null, - "id": "259", + "id": "257", "metadata": {}, "outputs": [], "source": [ @@ -4144,7 +4115,7 @@ { "cell_type": "code", "execution_count": null, - "id": "260", + "id": "258", "metadata": {}, "outputs": [], "source": [ @@ -4162,7 +4133,7 @@ { "cell_type": "code", "execution_count": null, - "id": "261", + "id": "259", "metadata": {}, "outputs": [], "source": [ @@ -4173,7 +4144,7 @@ { "cell_type": "code", "execution_count": null, - "id": "262", + "id": "260", "metadata": {}, "outputs": [], "source": [ @@ -4182,7 +4153,7 @@ }, { "cell_type": "markdown", - "id": "263", + "id": "261", "metadata": {}, "source": [ "![](https://i.imgur.com/EAxNQx4.png)" @@ -4190,7 +4161,7 @@ }, { "cell_type": "markdown", - "id": "264", + "id": "262", "metadata": {}, "source": [ "### Animating a Point Along a Route\n", @@ -4201,7 +4172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "265", + "id": "263", "metadata": {}, "outputs": [], "source": [ @@ -4246,7 +4217,7 @@ { "cell_type": "code", "execution_count": null, - "id": "266", + "id": "264", "metadata": {}, "outputs": [], "source": [ @@ -4259,7 +4230,7 @@ }, { "cell_type": "markdown", - "id": "267", + "id": "265", "metadata": {}, "source": [ "![](https://i.imgur.com/kdP1oT1.png)" @@ -4267,7 +4238,7 @@ }, { "cell_type": "markdown", - "id": "268", + "id": "266", "metadata": {}, "source": [ "### Updating a Feature in Real-Time\n", @@ -4278,7 +4249,7 @@ { "cell_type": "code", "execution_count": null, - "id": "269", + "id": "267", "metadata": {}, "outputs": [], "source": [ @@ -4288,7 +4259,7 @@ { "cell_type": "code", "execution_count": null, - "id": "270", + "id": "268", "metadata": {}, "outputs": [], "source": [ @@ -4299,7 +4270,7 @@ { "cell_type": "code", "execution_count": null, - "id": "271", + "id": "269", "metadata": {}, "outputs": [], "source": [ @@ -4312,7 +4283,7 @@ { "cell_type": "code", "execution_count": null, - "id": "272", + "id": "270", "metadata": {}, "outputs": [], "source": [ @@ -4338,7 +4309,7 @@ { "cell_type": "code", "execution_count": null, - "id": "273", + "id": "271", "metadata": {}, "outputs": [], "source": [ @@ -4351,7 +4322,7 @@ }, { "cell_type": "markdown", - "id": "274", + "id": "272", "metadata": {}, "source": [ "## To HTML\n", @@ -4362,7 +4333,7 @@ { "cell_type": "code", "execution_count": null, - "id": "275", + "id": "273", "metadata": {}, "outputs": [], "source": [ @@ -4374,7 +4345,7 @@ { "cell_type": "code", "execution_count": null, - "id": "276", + "id": "274", "metadata": {}, "outputs": [], "source": [ @@ -4395,7 +4366,7 @@ { "cell_type": "code", "execution_count": null, - "id": "277", + "id": "275", "metadata": {}, "outputs": [], "source": [ @@ -4417,7 +4388,7 @@ }, { "cell_type": "markdown", - "id": "278", + "id": "276", "metadata": {}, "source": [ "## Summary\n", diff --git a/book/geospatial/maplibre.md b/book/geospatial/maplibre.md index 7eff38f..52839e2 100644 --- a/book/geospatial/maplibre.md +++ b/book/geospatial/maplibre.md @@ -136,7 +136,7 @@ m Fullscreen control enables users to expand the map to full screen, enhancing focus and visual clarity. This is especially useful when viewing complex or large datasets. ```{code-cell} ipython3 -m = leafmap.Map(center=[11.255, 43.77], zoom=13, style="streets", controls={}) +m = leafmap.Map(center=[11.255, 43.77], zoom=13, style="positron", controls={}) m.add_control("fullscreen", position="top-right") m ``` @@ -146,7 +146,7 @@ m The Navigation control provides buttons for zooming and reorienting the map, improving the user's ability to navigate efficiently. ```{code-cell} ipython3 -m = leafmap.Map(center=[11.255, 43.77], zoom=13, style="streets", controls={}) +m = leafmap.Map(center=[11.255, 43.77], zoom=13, style="positron", controls={}) m.add_control("navigation", position="top-left") m ``` @@ -1039,23 +1039,6 @@ m m.open_geojson() ``` -### Local Vector Data - -Local vector files, such as GeoJSON, can be loaded directly into the map. The example downloads a GeoJSON file representing U.S. states and adds it to the map using `open_geojson`. - -```{code-cell} ipython3 -m = leafmap.Map(center=[-100, 40], zoom=3, style="streets") -url = "https://github.com/opengeos/datasets/releases/download/us/us_states.geojson" -gdf = leafmap.geojson_to_gdf(url) -paint = { - "fill-color": "#3388ff", - "fill-opacity": 0.8, - "fill-outline-color": "#ffffff", -} -m.add_gdf(gdf, layer_type="fill", name="States", paint=paint) -m -``` - ### Changing Building Color You can customize the color and opacity of buildings based on the map’s zoom level. This example changes building colors from orange at lower zoom levels to lighter shades as the zoom level increases. Additionally, the opacity gradually transitions to fully opaque, making buildings more visible at close-up zoom levels.