@maptiler/sdk 1.0.10 → 1.0.12
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/CHANGELOG.md +8 -0
- package/demos/maptiler-sdk.umd.js +20 -1
- package/demos/mountain.html +67 -0
- package/dist/maptiler-sdk.d.ts +30 -2
- package/dist/maptiler-sdk.min.mjs +1 -1
- package/dist/maptiler-sdk.mjs +20 -2
- package/dist/maptiler-sdk.mjs.map +1 -1
- package/dist/maptiler-sdk.umd.js +20 -1
- package/dist/maptiler-sdk.umd.js.map +1 -1
- package/dist/maptiler-sdk.umd.min.js +4 -4
- package/package.json +1 -1
- package/readme.md +3 -2
- package/src/Map.ts +24 -2
- package/src/index.ts +2 -0
- package/src/language.ts +7 -0
package/dist/maptiler-sdk.umd.js
CHANGED
|
@@ -883,6 +883,12 @@
|
|
|
883
883
|
* AUTO mode uses the language of the browser
|
|
884
884
|
*/
|
|
885
885
|
AUTO: "auto",
|
|
886
|
+
/**
|
|
887
|
+
* STYLE is a custom flag to keep the language of the map as defined into the style.
|
|
888
|
+
* If STYLE is set in the constructor, then further modification of the language
|
|
889
|
+
* with `.setLanguage()` is not possible.
|
|
890
|
+
*/
|
|
891
|
+
STYLE_LOCK: "style_lock",
|
|
886
892
|
/**
|
|
887
893
|
* Default fallback languages that uses latin charaters
|
|
888
894
|
*/
|
|
@@ -3085,6 +3091,12 @@
|
|
|
3085
3091
|
* @param language
|
|
3086
3092
|
*/
|
|
3087
3093
|
setPrimaryLanguage(language = defaults.primaryLanguage) {
|
|
3094
|
+
if (this.primaryLanguage === Language.STYLE_LOCK) {
|
|
3095
|
+
console.warn(
|
|
3096
|
+
"The language cannot be changed because this map has been instantiated with the STYLE_LOCK language flag."
|
|
3097
|
+
);
|
|
3098
|
+
return;
|
|
3099
|
+
}
|
|
3088
3100
|
if (!isLanguageSupported(language)) {
|
|
3089
3101
|
return;
|
|
3090
3102
|
}
|
|
@@ -3103,7 +3115,7 @@
|
|
|
3103
3115
|
"case",
|
|
3104
3116
|
["has", langStr],
|
|
3105
3117
|
["get", langStr],
|
|
3106
|
-
["get", "name
|
|
3118
|
+
["get", "name"]
|
|
3107
3119
|
];
|
|
3108
3120
|
for (let i = 0; i < layers.length; i += 1) {
|
|
3109
3121
|
const layer = layers[i];
|
|
@@ -3164,6 +3176,12 @@
|
|
|
3164
3176
|
* @param language
|
|
3165
3177
|
*/
|
|
3166
3178
|
setSecondaryLanguage(language = defaults.secondaryLanguage) {
|
|
3179
|
+
if (this.primaryLanguage === Language.STYLE_LOCK) {
|
|
3180
|
+
console.warn(
|
|
3181
|
+
"The language cannot be changed because this map has been instantiated with the STYLE_LOCK language flag."
|
|
3182
|
+
);
|
|
3183
|
+
return;
|
|
3184
|
+
}
|
|
3167
3185
|
if (!isLanguageSupported(language)) {
|
|
3168
3186
|
return;
|
|
3169
3187
|
}
|
|
@@ -3877,6 +3895,7 @@
|
|
|
3877
3895
|
exports.MapStyleVariant = MapStyleVariant;
|
|
3878
3896
|
exports.MaptilerGeolocateControl = MaptilerGeolocateControl;
|
|
3879
3897
|
exports.MaptilerLogoControl = MaptilerLogoControl;
|
|
3898
|
+
exports.MaptilerNavigationControl = MaptilerNavigationControl;
|
|
3880
3899
|
exports.MaptilerTerrainControl = MaptilerTerrainControl;
|
|
3881
3900
|
exports.Marker = Marker;
|
|
3882
3901
|
exports.MarkerMLGL = MarkerMLGL;
|