Skip to content

Commit

Permalink
Improved folium basemaps opengeos#91
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs committed Aug 5, 2021
1 parent 351cb45 commit 94459f1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/notebooks/24_heatmap.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"metadata": {},
"outputs": [],
"source": [
"m = leafmap.Map(tiles='stamentoner', google_map=None)\n",
"m = leafmap.Map(tiles='stamentoner')\n",
"m.add_heatmap(filepath, latitude=\"latitude\", longitude='longitude', value=\"pop_max\", name=\"Heat map\", radius=20)\n",
"m"
]
Expand Down
4 changes: 2 additions & 2 deletions examples/notebooks/00_key_features.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"metadata": {},
"outputs": [],
"source": [
"import leafmap"
"import leafmap.foliumap as leafmap"
]
},
{
Expand All @@ -71,7 +71,7 @@
"metadata": {},
"outputs": [],
"source": [
"import leafmap.foliumap as leafmap"
"import leafmap"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/notebooks/24_heatmap.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"metadata": {},
"outputs": [],
"source": [
"m = leafmap.Map(tiles='stamentoner', google_map=None)\n",
"m = leafmap.Map(tiles='stamentoner')\n",
"m.add_heatmap(filepath, latitude=\"latitude\", longitude='longitude', value=\"pop_max\", name=\"Heat map\", radius=20)\n",
"m"
]
Expand Down
22 changes: 20 additions & 2 deletions leafmap/basemaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,15 @@ def xyz_to_leaflet():
name = wms_tiles[key]["name"]
url = wms_tiles[key]["url"]
layers = wms_tiles[key]["layers"]
fnt = wms_tiles[key]["format"]
fmt = wms_tiles[key]["format"]
transparent = wms_tiles[key]["transparent"]
attribution = wms_tiles[key]["attribution"]
leaflet_dict[key] = ipyleaflet.WMSLayer(
url=url,
layers=layers,
name=name,
attribution=attribution,
format=fnt,
format=fmt,
transparent=transparent,
)

Expand Down Expand Up @@ -317,6 +317,24 @@ def xyz_to_folium():
control=True,
)

for key in wms_tiles:
name = wms_tiles[key]["name"]
url = wms_tiles[key]["url"]
layers = wms_tiles[key]["layers"]
fmt = wms_tiles[key]["format"]
transparent = wms_tiles[key]["transparent"]
attribution = wms_tiles[key]["attribution"]
folium_dict[key] = folium.WmsTileLayer(
url=url,
layers=layers,
name=name,
attr=attribution,
fmt=fmt,
transparent=transparent,
overlay=True,
control=True,
)

xyz_dict = get_xyz_dict()
for item in xyz_dict:
name = xyz_dict[item].name
Expand Down

0 comments on commit 94459f1

Please sign in to comment.