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 22 * This program are made available under the terms of the Apache License, Version 2.0
33 * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
44import "../core/Base" ;
5+ import mapboxgl from 'mapbox-gl' ;
56import { Bounds } from "@supermap/iclient-common/commontypes/Bounds" ;
67import { Point as GeometryPoint } from "@supermap/iclient-common/commontypes/geometry/Point" ;
78import { Polygon } from "@supermap/iclient-common/commontypes/geometry/Polygon" ;
@@ -54,7 +55,10 @@ export const Util = {
5455 //左下右上
5556 return new Bounds ( bounds [ 0 ] , bounds [ 1 ] , bounds [ 2 ] , bounds [ 3 ] ) ;
5657 }
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 ;
5862 } ,
5963
6064 toSuperMapPoint ( lnglat ) {
Original file line number Diff line number Diff line change 22 * This program are made available under the terms of the Apache License, Version 2.0
33 * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
44// import "../core/Base";
5+ import maplibregl from 'maplibre-gl' ;
56import { Bounds } from "@supermap/iclient-common/commontypes/Bounds" ;
67import { Point as GeometryPoint } from "@supermap/iclient-common/commontypes/geometry/Point" ;
78import { Polygon } from "@supermap/iclient-common/commontypes/geometry/Polygon" ;
@@ -54,7 +55,10 @@ export const Util = {
5455 //左下右上
5556 return new Bounds ( bounds [ 0 ] , bounds [ 1 ] , bounds [ 2 ] , bounds [ 3 ] ) ;
5657 }
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 ;
5862 } ,
5963
6064 toSuperMapPoint ( lnglat ) {
You can’t perform that action at this time.
0 commit comments