Skip to content

Commit

Permalink
【ut】fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongjiaojiao committed Oct 18, 2024
1 parent 7351367 commit 7ec9629
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/tool/mock_maplibregl_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function functor(x) {
}

const Map = function (options) {
const evented = new mapboxgl.Evented();
const evented = new maplibregl.Evented();
this.on = evented.on;
this.once = evented.once;
this._update = ()=>{};
Expand All @@ -42,12 +42,12 @@ const Map = function (options) {

try {
this.center = this.options.center
? new mapboxgl.LngLat(this.options.center.lng, this.options.center.lat)
: new mapboxgl.LngLat(0, 0);
? new maplibregl.LngLat(this.options.center.lng, this.options.center.lat)
: new maplibregl.LngLat(0, 0);
} catch (e) {
this.center = this.options.center
? new mapboxgl.LngLat(this.options.center[0], this.options.center[1])
: new mapboxgl.LngLat(0, 0);
? new maplibregl.LngLat(this.options.center[0], this.options.center[1])
: new maplibregl.LngLat(0, 0);
}
this.resize = function () {};
this.style = {
Expand Down Expand Up @@ -189,7 +189,7 @@ const Map = function (options) {
this.getBounds = function () {
return (
this.bounds ||
mapboxgl.LngLatBounds.convert([
maplibregl.LngLatBounds.convert([
[-180, -90],
[180, 90]
])
Expand All @@ -206,9 +206,9 @@ const Map = function (options) {
};
this.setCenter = function (x) {
if (x instanceof Array) {
this.center = new mapboxgl.LngLat(x[0], x[1]);
this.center = new maplibregl.LngLat(x[0], x[1]);
} else if (x instanceof Object) {
this.center = new mapboxgl.LngLat(x.lng, x.lat);
this.center = new maplibregl.LngLat(x.lng, x.lat);
}
};

Expand Down Expand Up @@ -266,7 +266,7 @@ const Map = function (options) {
};
};
this.unproject = function (point) {
return new mapboxgl.LngLat(-73.9876, 40.7661);
return new maplibregl.LngLat(-73.9876, 40.7661);
};

this.queryRenderedFeatures = function (pointOrBox, queryParams) {
Expand Down

0 comments on commit 7ec9629

Please sign in to comment.