Bladeren bron

网络监听

CzRger 2 dagen geleden
bovenliggende
commit
009c0c1fe8
1 gewijzigde bestanden met toevoegingen van 10 en 10 verwijderingen
  1. 10 10
      src/components/easyMap/initMapInfo.ts

+ 10 - 10
src/components/easyMap/initMapInfo.ts

@@ -3,6 +3,8 @@ import * as source from 'ol/source'
 // @ts-ignore
 import LutuImg from './images/bg-land.png'
 
+const isInternet = window.location.origin.includes('74.10') ? false : true
+
 const baseMapView = {
   center: [109.6915958479584, 19.111636735969318],
   projection: "EPSG:4326",
@@ -10,21 +12,19 @@ const baseMapView = {
   // extent: [120.8953306326286,31.3667480047968,121.37735577911297,31.692561298253832]
 }
 const initInternet = (obj) => {
-  const _layer = new layer.Tile({
+
+  const _layer = isInternet ? new layer.Tile({
     source: new source.XYZ({
       url: 'http://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=7&x={x}&y={y}&z={z}'
     }),
     visible: obj.visible,
+  }) : new layer.Tile({
+    source: new source.XYZ({
+      projection: "EPSG:4326",
+      url: `/EzServer6-api/EzServer6/Maps/${obj.key}/EzMap?Service=getImage&Type=RGB&ZoomOffset=0&Col={x}&Row={y}&Zoom={z}&V=0.3`,
+    }),
+    visible: obj.visible,
   })
-
-  // const _layer = new layer.Tile({
-  //   source: new source.XYZ({
-  //     projection: "EPSG:4326",
-  //     url: `/EzServer6-api/EzServer6/Maps/${obj.key}/EzMap?Service=getImage&Type=RGB&ZoomOffset=0&Col={x}&Row={y}&Zoom={z}&V=0.3`,
-  //   }),
-  //   visible: obj.visible,
-  // })
-
   _layer.set('_maxZoom', obj.maxZoom)
   _layer.set('_minZoom', obj.minZoom)
   _layer.set('_easyMapOl_layerName', obj.name)