Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxianhuii committed Nov 2, 2023
1 parent 556f975 commit 822e33b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/mapboxgl/core/Util.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
import "../core/Base";
import mapboxgl from 'mapbox-gl';
import { Bounds } from "@supermap/iclient-common/commontypes/Bounds";
import { Point as GeometryPoint } from "@supermap/iclient-common/commontypes/geometry/Point";
import { Polygon } from "@supermap/iclient-common/commontypes/geometry/Polygon";
Expand Down Expand Up @@ -54,7 +55,10 @@ export const Util = {
//左下右上
return new Bounds(bounds[0], bounds[1], bounds[2], bounds[3]);
}
return new Bounds(bounds.getWest(), bounds.getSouth(), bounds.getEast(), bounds.getNorth());
if (bounds instanceof mapboxgl.LngLatBounds) {
return new Bounds(bounds.getWest(), bounds.getSouth(), bounds.getEast(), bounds.getNorth());
}
return bounds;
},

toSuperMapPoint(lnglat) {
Expand Down
6 changes: 5 additions & 1 deletion src/maplibregl/core/Util.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
// import "../core/Base";
import maplibregl from 'maplibre-gl';
import { Bounds } from "@supermap/iclient-common/commontypes/Bounds";
import { Point as GeometryPoint } from "@supermap/iclient-common/commontypes/geometry/Point";
import { Polygon } from "@supermap/iclient-common/commontypes/geometry/Polygon";
Expand Down Expand Up @@ -54,7 +55,10 @@ export const Util = {
//左下右上
return new Bounds(bounds[0], bounds[1], bounds[2], bounds[3]);
}
return new Bounds(bounds.getWest(), bounds.getSouth(), bounds.getEast(), bounds.getNorth());
if (bounds instanceof maplibregl.LngLatBounds) {
return new Bounds(bounds.getWest(), bounds.getSouth(), bounds.getEast(), bounds.getNorth());
}
return bounds;
},

toSuperMapPoint(lnglat) {
Expand Down

0 comments on commit 822e33b

Please sign in to comment.