File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 2
2
* This program are made available under the terms of the Apache License, Version 2.0
3
3
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
4
4
import "../core/Base" ;
5
+ import mapboxgl from 'mapbox-gl' ;
5
6
import { Bounds } from "@supermap/iclient-common/commontypes/Bounds" ;
6
7
import { Point as GeometryPoint } from "@supermap/iclient-common/commontypes/geometry/Point" ;
7
8
import { Polygon } from "@supermap/iclient-common/commontypes/geometry/Polygon" ;
@@ -54,7 +55,10 @@ export const Util = {
54
55
//左下右上
55
56
return new Bounds ( bounds [ 0 ] , bounds [ 1 ] , bounds [ 2 ] , bounds [ 3 ] ) ;
56
57
}
57
- return new Bounds ( bounds . getWest ( ) , bounds . getSouth ( ) , bounds . getEast ( ) , bounds . getNorth ( ) ) ;
58
+ if ( bounds instanceof mapboxgl . LngLatBounds ) {
59
+ return new Bounds ( bounds . getWest ( ) , bounds . getSouth ( ) , bounds . getEast ( ) , bounds . getNorth ( ) ) ;
60
+ }
61
+ return bounds ;
58
62
} ,
59
63
60
64
toSuperMapPoint ( lnglat ) {
Original file line number Diff line number Diff line change 2
2
* This program are made available under the terms of the Apache License, Version 2.0
3
3
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
4
4
// import "../core/Base";
5
+ import maplibregl from 'maplibre-gl' ;
5
6
import { Bounds } from "@supermap/iclient-common/commontypes/Bounds" ;
6
7
import { Point as GeometryPoint } from "@supermap/iclient-common/commontypes/geometry/Point" ;
7
8
import { Polygon } from "@supermap/iclient-common/commontypes/geometry/Polygon" ;
@@ -54,7 +55,10 @@ export const Util = {
54
55
//左下右上
55
56
return new Bounds ( bounds [ 0 ] , bounds [ 1 ] , bounds [ 2 ] , bounds [ 3 ] ) ;
56
57
}
57
- return new Bounds ( bounds . getWest ( ) , bounds . getSouth ( ) , bounds . getEast ( ) , bounds . getNorth ( ) ) ;
58
+ if ( bounds instanceof maplibregl . LngLatBounds ) {
59
+ return new Bounds ( bounds . getWest ( ) , bounds . getSouth ( ) , bounds . getEast ( ) , bounds . getNorth ( ) ) ;
60
+ }
61
+ return bounds ;
58
62
} ,
59
63
60
64
toSuperMapPoint ( lnglat ) {
You can’t perform that action at this time.
0 commit comments