Skip to content

Commit 450bf30

Browse files
committed
【fix】优化代码 review by liqian
1 parent bbb7135 commit 450bf30

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/openlayers/mapping/WebMap.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
44
import ol from 'openlayers';
55
import proj4 from "proj4";
6-
window.proj4 = proj4;
7-
window.Proj4js = proj4;
86
import {
97
FetchRequest,
108
SecurityManager,
@@ -20,6 +18,8 @@ import {
2018
} from '../core/StyleUtils';
2119
import jsonsql from 'jsonsql';
2220

21+
window.proj4 = proj4;
22+
window.Proj4js = proj4;
2323
ol.supermap = ol.supermap || {};
2424
//数据转换工具
2525
const transformTools = new ol.format.GeoJSON();
@@ -156,7 +156,9 @@ export class WebMap extends ol.Observable {
156156
that.baseProjection = mapInfo.projection;
157157

158158
// 多坐标系支持
159-
if(proj4) ol.proj.setProj4(proj4);
159+
if(proj4){
160+
ol.proj.setProj4(proj4);
161+
}
160162
if(that.addProjctionFromWKT(mapInfo.projection)){
161163
mapInfo.projection = that.baseProjection = that.getEpsgInfoFromWKT(mapInfo.projection);
162164
}else{

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