CzRger преди 1 седмица
родител
ревизия
fb0ef68fb4
променени са 3 файла, в които са добавени 25 реда и са изтрити 25 реда
  1. 22 22
      src/stores/ship-map/ship-map.ts
  2. 1 1
      src/views/web/index.vue
  3. 2 2
      vite.config.ts

+ 22 - 22
src/stores/ship-map/ship-map.ts

@@ -57,27 +57,27 @@ export const useShipMapStore = defineStore('shipMap', () => {
     state.map = map
     state.mapFunc = mapFunc
     state.zoom = state.map.getView().getZoom()
-    // state.map.on('movestart', e => {
-    //   map.un('pointermove', mapPointerMove)
-    //   map.un('singleclick', mapSingleClick)
-    // })
-    // state.map.on('moveend', e => {
-    //   state.trackHover = new Date().getTime()
-    //   state.zoom = e.map.getView().getZoom()
-    //   switchZoom()
-    //   map.on('singleclick', mapSingleClick)
-    //   map.on('pointermove', mapPointerMove)
-    // })
-    // state.ws.overlayTrack = new ol.Overlay({
-    //   element: trackPointDom,
-    //   autoPan: false,
-    //   offset: [0, -22],
-    //   positioning: 'bottom-center',
-    //   stopEvent: true,
-    // })
-    // state.map.addOverlay(state.ws.overlayTrack)
+    state.map.on('movestart', e => {
+      map.un('pointermove', mapPointerMove)
+      map.un('singleclick', mapSingleClick)
+    })
+    state.map.on('moveend', e => {
+      state.trackHover = new Date().getTime()
+      state.zoom = e.map.getView().getZoom()
+      switchZoom()
+      map.on('singleclick', mapSingleClick)
+      map.on('pointermove', mapPointerMove)
+    })
+    state.ws.overlayTrack = new ol.Overlay({
+      element: trackPointDom,
+      autoPan: false,
+      offset: [0, -22],
+      positioning: 'bottom-center',
+      stopEvent: true,
+    })
+    state.map.addOverlay(state.ws.overlayTrack)
     // 预警助手
-    initWarningWS()
+    // initWarningWS()
   }
   const mapPointerMove = (ev) => {
     let pixel = ev.pixel
@@ -275,11 +275,11 @@ export const useShipMapStore = defineStore('shipMap', () => {
         })
       }
       const _tileWMS = new source.TileWMS({
-        url: `/geoserver-api/geoserver/redis/wms`,
+        url: `/geoserver-api/geoserver/kafka/wms`,
         params: {
           'FORMAT': 'image/png8',
           'VERSION': '1.1.1',
-          LAYERS: 'redis:geo_fusion_ship',
+          LAYERS: 'kafka:fusion',
           "exceptions": 'application/vnd.ogc.se_inimage',
           // CQL_FILTER: CQL,
           refresh: new Date().getTime()

+ 1 - 1
src/views/web/index.vue

@@ -111,7 +111,7 @@ const titleCpt = computed(() => {
 const mapLoad = (map, mapFunc) => {
   state.map = map
   state.mapFunc = mapFunc
-  // ShipMapStore.initMap(state.map, state.mapFunc, {trackPointDom: ref_trackPoint.value.$el})
+  ShipMapStore.initMap(state.map, state.mapFunc, {trackPointDom: ref_trackPoint.value.$el})
 }
 const mapParamsListener = (p) => {
   ref_web.value?.style.setProperty('--easy-map-height',  p.resizeMapHeight + 'px')

+ 2 - 2
vite.config.ts

@@ -53,7 +53,7 @@ export default defineConfig({
     strictPort: false,
     proxy: {
       '/sww-api': {
-        target: 'http://8.130.108.178:8080/',
+        target: 'http://192.168.242.21:8080/',
         changeOrigin: true,
         rewrite: (path) => {
           return path.replace(/^\/sww-api/, '')
@@ -77,7 +77,7 @@ export default defineConfig({
         }
       },
       '/geoserver-api': {
-        target: 'http://74.10.28.39:8080/',	// 地图服务代理
+        target: 'http://192.168.242.21:9090/',	// 地图服务代理
         changeOrigin: true,
         rewrite: path => {
           return path.replace(/^\/geoserver-api/, '')