Skip to content

Commit

Permalink
Merge pull request gee-community#1759 from gee-community/nschmitz-bas…
Browse files Browse the repository at this point in the history
…emap-hotfix

Hotfix for broken basemap selector
  • Loading branch information
naschmitz authored Oct 5, 2023
2 parents 0ddedf1 + 3ea4192 commit 4ccbe58
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 0 additions & 3 deletions geemap/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,6 @@ def __init__(self, **kwargs):
kwargs = self._apply_kwarg_defaults(kwargs)
super().__init__(**kwargs)

if len(self.layers) > 0 and self.layers[0].name == "OpenStreetMap.Mapnik":
self.layers[0].name = "OpenStreetMap"

for position, widgets in self._control_config().items():
for widget in widgets:
self.add(widget, position=position)
Expand Down
8 changes: 8 additions & 0 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ def test_add_draw_control(self):
self.assertEqual(len(self.core_map.controls), 1)
self.assertIsInstance(self.core_map.get_draw_control(), core.MapDrawControl)

def test_add_basemap_selector(self):
"""Tests adding the basemap selector widget."""
self._clear_default_widgets()

self.core_map.add("basemap_selector")

self.assertEqual(len(self.core_map.controls), 1)


@patch.object(ee, "FeatureCollection", fake_ee.FeatureCollection)
@patch.object(ee, "Feature", fake_ee.Feature)
Expand Down

0 comments on commit 4ccbe58

Please sign in to comment.