Skip to content

Commit a1bedfe

Browse files
Fix AJAXError import (#129)
* Fix AJAXError import * changelog update
1 parent b2d083c commit a1bedfe

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# MapTiler SDK Changelog
22

3+
## 2.4.1
4+
### Bug Fixes
5+
- The class `AJAXError` is now imported as part of the `maplibregl` namespace (CommonJS limitation from Maplibre GL JS) (https://github.com/maptiler/maptiler-sdk-js/pull/129)
6+
37
## 2.4.0
48
### New Features
59
- Shows a warning message in the map container if WebGL context is lost

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@maptiler/sdk",
3-
"version": "2.4.0",
3+
"version": "2.4.1",
44
"description": "The Javascript & TypeScript map SDK tailored for MapTiler Cloud",
55
"module": "dist/maptiler-sdk.mjs",
66
"types": "dist/maptiler-sdk.d.ts",

src/Map.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import maplibregl, { AJAXError } from "maplibre-gl";
1+
import maplibregl from "maplibre-gl";
22
import { Base64 } from "js-base64";
33
import type {
44
StyleSpecification,
@@ -264,8 +264,8 @@ export class Map extends maplibregl.Map {
264264

265265
// Safeguard for distant styles at non-http 2xx status URLs
266266
this.on("error", (event) => {
267-
if (event.error instanceof AJAXError) {
268-
const err = event.error as AJAXError;
267+
if (event.error instanceof maplibregl.AJAXError) {
268+
const err = event.error as maplibregl.AJAXError;
269269
const url = err.url;
270270
const cleanUrl = new URL(url);
271271
cleanUrl.search = "";

0 commit comments

Comments
 (0)