Skip to content

Commit fbc083b

Browse files
committed
Add update_map basemap argument
1 parent fe39644 commit fbc083b

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

felt_python/maps.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ def update_map(
115115
title: str | None = None,
116116
description: str | None = None,
117117
public_access: str | None = None,
118+
basemap: str | None = None,
118119
api_token: str | None = None,
119120
):
120121
"""Update a map's details
@@ -126,6 +127,10 @@ def update_map(
126127
public_access: Optional new public access setting
127128
Options are "private", "view_only", "view_and_comment",
128129
or "view_comment_and_edit"
130+
basemap: The basemap to use for the map. Defaults to "default".
131+
Valid values are "default", "light", "dark", "satellite",
132+
a valid raster tile URL with {x}, {y}, and {z} parameters,
133+
or a hex color string like #ff0000.
129134
api_token: Optional API token
130135
131136
Returns:
@@ -138,6 +143,8 @@ def update_map(
138143
json_args["description"] = description
139144
if public_access is not None:
140145
json_args["public_access"] = public_access
146+
if basemap is not None:
147+
json_args["basemap"] = basemap
141148

142149
response = make_request(
143150
url=MAP_UPDATE.format(map_id=map_id),

notebooks/maps.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@
9494
" map_id=map_id,\n",
9595
" title=\"A felt-python map with an update\",\n",
9696
" description=\"This map was updated through the API\",\n",
97-
" public_access=\"view_only\"\n",
97+
" public_access=\"view_only\",\n",
98+
" basemap=\"dark\" # You can also update the basemap\n",
9899
")"
99100
]
100101
},

tests/maps_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def test_map_workflow(self):
7474
title=updated_name,
7575
description=f"This map was updated through the API test at {self.timestamp}",
7676
public_access="view_only",
77+
basemap="dark",
7778
)
7879

7980
self.assertIsNotNone(updated_map)
@@ -83,6 +84,7 @@ def test_map_workflow(self):
8384

8485
self.assertEqual(updated_details["title"], updated_name)
8586
self.assertEqual(updated_details["public_access"], "view_only")
87+
self.assertEqual(updated_details["basemap"], "dark")
8688

8789
# Step 4: Export comments
8890
# Note: There will be no comments on a newly created map

0 commit comments

Comments
 (0)