You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rd 1112 projection change to mercator breaks style loading (#222)
* RD-112 Add validation to space and halo
* RD-1112 Version bump for RC release
* RD-1112 Add check to ensure spacebox is only created when style is loaded
* RD-1112 Fix map breaking when empty object is passed to space / halo
* RD-1112 Version bump for RC release.
* RD-1112 Version bump and update changelog
* RD-1112 Better wording for changelog
* RD-1112 Fix typo
* RD-1112 Remove un-need state variable
* RD-1112 Better wording of explanatory comments
* RD-1112 Fix Spelling in changelog
---------
Co-authored-by: Les Moffat <[email protected]>
// because maplibre removes ALL layers when setting a new style, we need to add the space layer back
257
265
// even if it hasn't changed
@@ -296,7 +304,7 @@ export class Map extends maplibregl.Map {
296
304
[0,"transparent"],
297
305
[1,"transparent"],
298
306
],
299
-
scale: 0,
307
+
scale: 1,
300
308
});
301
309
return;
302
310
}
@@ -1007,18 +1015,16 @@ export class Map extends maplibregl.Map {
1007
1015
if(styleInfo.isFallback){
1008
1016
if(this.getStyle()){
1009
1017
console.warn(
1010
-
"Invalid style. A style must be a valid URL to a style.json, a JSON string representing a valid StyleSpecification or a valid StyleSpecification object. Keeping the curent style instead.",
1018
+
"[Map.setStyle]: Invalid style. A style must be a valid URL to a style.json, a JSON string representing a valid StyleSpecification or a valid StyleSpecification object. Keeping the curent style instead.",
1011
1019
);
1012
1020
returnthis;
1013
1021
}
1014
1022
1015
1023
console.warn(
1016
-
"Invalid style. A style must be a valid URL to a style.json, a JSON string representing a valid StyleSpecification or a valid StyleSpecification object. Fallback to default MapTiler style.",
1024
+
"[Map.setStyle]: Invalid style. A style must be a valid URL to a style.json, a JSON string representing a valid StyleSpecification or a valid StyleSpecification object. Fallback to default MapTiler style.",
1017
1025
);
1018
1026
}
1019
1027
1020
-
this.styleInProcess=true;
1021
-
1022
1028
// because the style must be finished loading and parsed before we can add custom layers
1023
1029
// we need to check if the terrain has changed, because if it has, we also need to wait
1024
1030
// for the terrain to load...
@@ -1027,6 +1033,7 @@ export class Map extends maplibregl.Map {
1027
1033
1028
1034
try{
1029
1035
super.setStyle(styleInfo.style,options);
1036
+
this.styleInProcess=true;
1030
1037
}catch(e){
1031
1038
this.styleInProcess=false;
1032
1039
console.error("[Map.setStyle]: Error while setting style:",e);
@@ -1038,13 +1045,21 @@ export class Map extends maplibregl.Map {
0 commit comments