@@ -75,6 +75,7 @@ export class GttClient {
75
75
layerArray : Layer [ ]
76
76
defaults : DOMStringMap
77
77
contents : DOMStringMap
78
+ i18n : any
78
79
toolbar : Bar
79
80
filters : FilterOption
80
81
vector : VectorLayer < VectorSource < Geometry > >
@@ -120,8 +121,8 @@ export class GttClient {
120
121
this . defaults . geocoder = JSON . stringify ( quick_hack . geocoder )
121
122
}
122
123
123
-
124
124
this . contents = options . target . dataset
125
+ this . i18n = JSON . parse ( this . defaults . i18n )
125
126
126
127
// create map at first
127
128
this . map = new Map ( {
@@ -287,8 +288,6 @@ export class GttClient {
287
288
} )
288
289
}
289
290
290
-
291
-
292
291
// For map div focus settings
293
292
if ( options . target ) {
294
293
if ( options . target . getAttribute ( 'tabindex' ) == null ) {
@@ -316,7 +315,7 @@ export class GttClient {
316
315
// Control button
317
316
const maximizeCtrl = new Button ( {
318
317
html : '<i class="material-icons" >zoom_out_map</i>' ,
319
- title : "Maximize" ,
318
+ title : this . i18n . control . maximize ,
320
319
handleClick : ( ) => {
321
320
this . zoomToExtent ( true ) ;
322
321
}
@@ -538,7 +537,7 @@ export class GttClient {
538
537
539
538
editbar . addControl ( new Button ( {
540
539
html : '<i class="material-icons">file_upload</i>' ,
541
- title : 'Upload GeoJSON' ,
540
+ title : this . i18n . control . geojson ,
542
541
handleClick : ( ) => {
543
542
dialog . dialog ( 'open' )
544
543
}
@@ -1011,7 +1010,7 @@ export class GttClient {
1011
1010
// Control button
1012
1011
const geolocationCtrl = new Toggle ( {
1013
1012
html : '<i class="material-icons">my_location</i>' ,
1014
- title : "Geolocation" ,
1013
+ title : this . i18n . control . geolocation ,
1015
1014
active : false ,
1016
1015
onToggle : ( active : boolean ) => {
1017
1016
geolocation . setTracking ( active )
@@ -1200,7 +1199,7 @@ export class GttClient {
1200
1199
// Control button
1201
1200
const geocodingCtrl = new Toggle ( {
1202
1201
html : '<i class="material-icons">manage_search</i>' ,
1203
- title : "Geocoding" ,
1202
+ title : this . i18n . control . geocoding ,
1204
1203
className : "ctl-geocoding" ,
1205
1204
onToggle : ( active : boolean ) => {
1206
1205
const text = ( document . querySelector ( "div#" + mapId + " .ctl-geocoding div input" ) as HTMLInputElement )
0 commit comments