Skip to content

Commit

Permalink
locale -> lanuage
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspk06 committed May 13, 2024
1 parent ab20374 commit e796b50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ export interface RadarSearchGeofencesResponse extends RadarResponse {
}

export interface RadarMapOptions extends Omit<maplibregl.MapOptions, 'transformRequest'> {
locale?: string;
language?: string;
}

export interface RadarMarkerImage {
Expand Down
5 changes: 3 additions & 2 deletions src/ui/RadarMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const defaultMaplibreOptions: Partial<maplibregl.MapOptions> = {

const createStyleURL = (options: RadarOptions, mapOptions: RadarMapOptions) => {
let url = `${options.host}/maps/styles/${mapOptions.style}?publishableKey=${options.publishableKey}`
if (mapOptions.locale) {
url += `&locale=${mapOptions.locale}`
if (mapOptions.language) {
url += `&language=${mapOptions.language}`
}
return url
};
Expand Down Expand Up @@ -85,6 +85,7 @@ class RadarMap extends maplibregl.Map {
'Authorization': config.publishableKey,
'X-Radar-Device-Type': 'Web',
'X-Radar-SDK-Version': SDK_VERSION,
'X-Radar-Device-Language': navigator.language,
};
if (typeof config.getRequestHeaders === 'function') {
headers = Object.assign(headers, config.getRequestHeaders());
Expand Down

0 comments on commit e796b50

Please sign in to comment.