Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map initalization language param #161

Conversation

jaspk06
Copy link
Contributor

@jaspk06 jaspk06 commented May 10, 2024

Adds the map option language to configure map language. This only works for Radar map styles as it searchs and replaces for the expression ["get", "radar:name_client_language"].

Also sends up the header X-Radar-Device-Language with every style request which grabs from navigator.language. This is so that the server can figure out how to transform the style appropriately given the browser language.

@jaspk06 jaspk06 requested a review from kochis May 10, 2024 17:35
@jaspk06 jaspk06 changed the title [MAPS-1070] Detect browser language custom style SDK Detect browser language custom style SDK May 10, 2024
@jaspk06 jaspk06 changed the base branch from master to refactor-map-ui May 10, 2024 17:36
@jaspk06 jaspk06 changed the base branch from refactor-map-ui to release-4.3 May 10, 2024 17:36
src/types.ts Outdated
@@ -460,7 +460,7 @@ export interface RadarSearchGeofencesResponse extends RadarResponse {
}

export interface RadarMapOptions extends Omit<maplibregl.MapOptions, 'transformRequest'> {
container: string | HTMLElement;
fallbackLanguage?: string;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

container was already defined in the maplibregl.MapOptions type

@jaspk06 jaspk06 changed the title Detect browser language custom style SDK Client side language override May 10, 2024
@jaspk06 jaspk06 force-pushed the jasonliu/maps-1070-programmatic-language-adjustment-detect-local-language branch from e2b7c1b to deccc3d Compare May 13, 2024 15:56
@jaspk06 jaspk06 changed the title Client side language override Map initalization locale param May 13, 2024
@jaspk06 jaspk06 changed the title Map initalization locale param Map initalization language param May 14, 2024
@jaspk06 jaspk06 requested a review from BrainAtRadar May 14, 2024 21:31
src/ui/RadarMap.ts Outdated Show resolved Hide resolved
@jaspk06 jaspk06 merged commit d0c0e3f into release-4.3 May 21, 2024
3 checks passed
kochis added a commit that referenced this pull request Jun 6, 2024
* Radar map UI kit refactor (#153)

* support custom style

* custom markers

* Maplibre control radar logo

* bump version

* refactor mapui kit by inheriting maplibre-gl

- bump tsconfig target from es2015->es2016 for compatibility with class inheritence

* pass request header override in map transformRequest

* version bump

* include custom style id in marker request

* new marker logic

* Delete .vscode directory

* add .vscode/ to .gitignore

* bump version

* bump version

* update transformRequest and add custom styles to demo page

* marker updates

* remove `getOptions` from `RadarMarker`

* better way to handle custom markers and image urls

* add custom url input to marker demo page

* compliation target changes and copy changes

* set beta version

---------

Co-authored-by: Craig Kochis <[email protected]>

* `RadarMap.fitToMarkers` class method (#156)

* Map initalization `language` param (#161)

* fix radar-default-v1 fallback regression

* bump version

* marker default width and height

* bump version

* `RadarMarker` popup improvements (#166)

* bump version

* Support click event on marker instance (#167)

* support click handlers on markers

* log map click

* force popup on click

* Update marker params (#168)

* update marker params

* handle popup.element

* bump maplibre version in peer deps (#169)

* img alt text

* bump version

* update dev version of maplibre-gl

* fix marker image width and height

* remove unused navigator

* update browserlist

* remove beta tag

* support number and string for marker width/height

* fix types

---------

Co-authored-by: Jason Liu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants