Skip to content

Commit 7ec9629

Browse files
committed
【ut】fix ut
1 parent 7351367 commit 7ec9629

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

test/tool/mock_maplibregl_map.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function functor(x) {
2020
}
2121

2222
const Map = function (options) {
23-
const evented = new mapboxgl.Evented();
23+
const evented = new maplibregl.Evented();
2424
this.on = evented.on;
2525
this.once = evented.once;
2626
this._update = ()=>{};
@@ -42,12 +42,12 @@ const Map = function (options) {
4242

4343
try {
4444
this.center = this.options.center
45-
? new mapboxgl.LngLat(this.options.center.lng, this.options.center.lat)
46-
: new mapboxgl.LngLat(0, 0);
45+
? new maplibregl.LngLat(this.options.center.lng, this.options.center.lat)
46+
: new maplibregl.LngLat(0, 0);
4747
} catch (e) {
4848
this.center = this.options.center
49-
? new mapboxgl.LngLat(this.options.center[0], this.options.center[1])
50-
: new mapboxgl.LngLat(0, 0);
49+
? new maplibregl.LngLat(this.options.center[0], this.options.center[1])
50+
: new maplibregl.LngLat(0, 0);
5151
}
5252
this.resize = function () {};
5353
this.style = {
@@ -189,7 +189,7 @@ const Map = function (options) {
189189
this.getBounds = function () {
190190
return (
191191
this.bounds ||
192-
mapboxgl.LngLatBounds.convert([
192+
maplibregl.LngLatBounds.convert([
193193
[-180, -90],
194194
[180, 90]
195195
])
@@ -206,9 +206,9 @@ const Map = function (options) {
206206
};
207207
this.setCenter = function (x) {
208208
if (x instanceof Array) {
209-
this.center = new mapboxgl.LngLat(x[0], x[1]);
209+
this.center = new maplibregl.LngLat(x[0], x[1]);
210210
} else if (x instanceof Object) {
211-
this.center = new mapboxgl.LngLat(x.lng, x.lat);
211+
this.center = new maplibregl.LngLat(x.lng, x.lat);
212212
}
213213
};
214214

@@ -266,7 +266,7 @@ const Map = function (options) {
266266
};
267267
};
268268
this.unproject = function (point) {
269-
return new mapboxgl.LngLat(-73.9876, 40.7661);
269+
return new maplibregl.LngLat(-73.9876, 40.7661);
270270
};
271271

272272
this.queryRenderedFeatures = function (pointOrBox, queryParams) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy