-
-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate all the non react components code to typescript (#847)
This completes the migration to typescript of all the non react components code. The only changes introduced besides types are the type checks using `"something" in object` which narrows down types in typescript.
- Loading branch information
Showing
15 changed files
with
149 additions
and
96 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import MapLibreGl from "maplibre-gl" | ||
|
||
MapLibreGl.setRTLTextPlugin('https://unpkg.com/@mapbox/[email protected]/mapbox-gl-rtl-text.min.js'); | ||
MapLibreGl.setRTLTextPlugin('https://unpkg.com/@mapbox/[email protected]/mapbox-gl-rtl-text.min.js', () => {}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import type {StyleSpecification, SourceSpecification} from "@maplibre/maplibre-gl-style-spec"; | ||
|
||
export function deleteSource(mapStyle: StyleSpecification, sourceId: string) { | ||
const remainingSources = { ...mapStyle.sources} | ||
delete remainingSources[sourceId] | ||
return { | ||
...mapStyle, | ||
sources: remainingSources | ||
} | ||
} | ||
|
||
|
||
export function addSource(mapStyle: StyleSpecification, sourceId: string, source: SourceSpecification) { | ||
return changeSource(mapStyle, sourceId, source) | ||
} | ||
|
||
export function changeSource(mapStyle: StyleSpecification, sourceId: string, source: SourceSpecification) { | ||
const changedSources = { | ||
...mapStyle.sources, | ||
[sourceId]: source | ||
} | ||
return { | ||
...mapStyle, | ||
sources: changedSources | ||
} | ||
} | ||
|
Oops, something went wrong.