-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for map controls localization (requires mapbox-gl >…
…= 1.6.0)
- Loading branch information
1 parent
08124a6
commit c669619
Showing
3 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
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
36 changes: 36 additions & 0 deletions
36
projects/showcase/src/app/demo/examples/custom-locale.component.ts
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,36 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'showcase-demo', | ||
template: ` | ||
<mgl-map | ||
[style]="'mapbox://styles/mapbox/light-v9'" | ||
[center]="[36.235656, 50.003870]" | ||
[zoom]="[11.15]" | ||
[locale]="locale" | ||
> | ||
<mgl-control mglFullscreen position="top-left"></mgl-control> | ||
<mgl-control mglGeolocate position="top-left"></mgl-control> | ||
<mgl-control mglNavigation position="top-left"></mgl-control> | ||
<mgl-control mglScale></mgl-control> | ||
</mgl-map> | ||
`, | ||
styleUrls: ['./examples.css'] | ||
}) | ||
export class CustomLocaleComponent { | ||
readonly locale = { | ||
'FullscreenControl.Enter': 'Перейти в повоекранний режим', | ||
'FullscreenControl.Exit': 'Вийти з повноекранного режиму', | ||
'GeolocateControl.FindMyLocation': 'Знайти моє місцеположення', | ||
'GeolocateControl.LocationNotAvailable': 'Місцеположення недоступне', | ||
'LogoControl.Title': 'Лого Mapbox', | ||
'NavigationControl.ResetBearing': 'Cкинути компас', | ||
'NavigationControl.ZoomIn': 'Наблизити', | ||
'NavigationControl.ZoomOut': 'Віддалити', | ||
'ScaleControl.Feet': 'ф', | ||
'ScaleControl.Meters': 'м', | ||
'ScaleControl.Kilometers': 'км', | ||
'ScaleControl.Miles': 'ми', | ||
'ScaleControl.NauticalMiles': 'нм' | ||
}; | ||
} |