@maptiler/sdk 2.4.0 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/maptiler-sdk.mjs +778 -772
- package/dist/maptiler-sdk.mjs.map +1 -1
- package/dist/src/Map.d.ts +3 -2
- package/package.json +1 -1
- package/readme.md +26 -1
package/dist/src/Map.d.ts
CHANGED
|
@@ -28,11 +28,12 @@ export type MapOptions = Omit<MapOptionsML, "style" | "maplibreLogo"> & {
|
|
|
28
28
|
*/
|
|
29
29
|
style?: ReferenceMapStyle | MapStyleVariant | StyleSpecification | string;
|
|
30
30
|
/**
|
|
31
|
-
* Define the language of the map. This can be done directly with a language ISO code (eg. "en")
|
|
31
|
+
* Define the language of the map. This can be done directly with a language ISO code (eg. "en"),
|
|
32
|
+
* the ISO code prepended with the OSM flag (eg. "name:en" or even just "name"),
|
|
32
33
|
* or with a built-in shorthand (eg. Language.ENGLISH).
|
|
33
34
|
* Note that this is equivalent to setting the `config.primaryLanguage` and will overwrite it.
|
|
34
35
|
*/
|
|
35
|
-
language?: LanguageInfo;
|
|
36
|
+
language?: LanguageInfo | string;
|
|
36
37
|
/**
|
|
37
38
|
* Define the MapTiler Cloud API key to be used. This is strictly equivalent to setting
|
|
38
39
|
* `config.apiKey` and will overwrite it.
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -468,7 +468,7 @@ Whenever a label is not supported in the defined language, it falls back to `Lan
|
|
|
468
468
|
Here is a sample of some compatible languages:
|
|
469
469
|

|
|
470
470
|
|
|
471
|
-
|
|
471
|
+
## Built-in support for right-to-left languages
|
|
472
472
|
Languages that are written right-to-left such as Arabic and Hebrew are fully supported by default. No need to install any plugins!
|
|
473
473
|
|
|
474
474
|
<p align="center">
|
|
@@ -476,6 +476,31 @@ Languages that are written right-to-left such as Arabic and Hebrew are fully sup
|
|
|
476
476
|
<img src="images/screenshots/lang-hebrew.jpeg" width="48%"></img>
|
|
477
477
|
</p>
|
|
478
478
|
|
|
479
|
+
## Visitor language modes
|
|
480
|
+
The *visitor* language modes are special built-in modes made to display labels in two different languages, concatenated when available:
|
|
481
|
+
- `Language.VISITOR` concatenates labels in the language of your system and the *local* language
|
|
482
|
+
- `Language.VISITOR_ENGLISH` concatenates labels in English and the *local* language
|
|
483
|
+
|
|
484
|
+
```ts
|
|
485
|
+
const map = new Map({
|
|
486
|
+
// some options...
|
|
487
|
+
language: Language.VISITOR,
|
|
488
|
+
})
|
|
489
|
+
|
|
490
|
+
// or
|
|
491
|
+
|
|
492
|
+
const map = new Map({
|
|
493
|
+
// some options...
|
|
494
|
+
language: Language.VISITOR_ENGLISH,
|
|
495
|
+
})
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
We believe these two modes can be very handy to help the end users identify places, especially when the local labels are not using a latin charset. Here is how it looks like:
|
|
499
|
+
|
|
500
|
+

|
|
501
|
+

|
|
502
|
+
|
|
503
|
+
|
|
479
504
|
# Custom Events and Map Lifecycle
|
|
480
505
|
## Events
|
|
481
506
|
### The `ready` event
|