ui/map/customStyles¶
Interfaces¶
SavedMapStyle¶
Defined in: ui/map/customStyles.ts:8
A user-saved basemap style: a friendly display name paired with the style JSON URL it resolves to. Persisted so a custom style only has to be typed once and then re-selected by name from the style dropdown.
Properties¶
name¶
Defined in: ui/map/customStyles.ts:9
url¶
Defined in: ui/map/customStyles.ts:10
Functions¶
sanitizeStyles()¶
Defined in: ui/map/customStyles.ts:21
Coerce arbitrary stored data into a clean SavedMapStyle[]. Anything that is not an array of objects with non-empty string name/url is dropped, so a corrupted or legacy entry can never crash the dropdown rendering.
Parameters¶
raw¶
unknown
Returns¶
loadSavedStyles()¶
Defined in: ui/map/customStyles.ts:36
Load the saved custom styles, tolerating malformed/missing storage.
Returns¶
persistSavedStyles()¶
Defined in: ui/map/customStyles.ts:41
Persist the list of saved custom styles.
Parameters¶
styles¶
Returns¶
void
upsertStyle()¶
Defined in: ui/map/customStyles.ts:51
Add (or update) a saved style. Both name and URL are unique keys: saving a name that already exists overwrites its URL, and saving a URL that already exists (under any name) replaces that entry — so the dropdown never grows a duplicate label or a second option with the same value. Returns a new array.
Parameters¶
styles¶
name¶
string
url¶
string
Returns¶
removeStyleByUrl()¶
Defined in: ui/map/customStyles.ts:62
Remove the saved style with the given URL. Returns a new array.
Parameters¶
styles¶
url¶
string