Browse Source

bug fixed

xicheng79 3 years ago
parent
commit
6875ed93e6
2 changed files with 15 additions and 6 deletions
  1. 14 5
      src/components/map.vue
  2. 1 1
      src/components/slogan.vue

+ 14 - 5
src/components/map.vue

@@ -99,7 +99,7 @@ import more from '../assets/icon/more.svg'
 import DrawShape from '../../static/js/startDrawShape'
 
 // card
-import phoneCard from './card.vue'
+import phoneCard from './Card.vue'
 
 // slogan
 import slogan from './slogan.vue'
@@ -124,7 +124,7 @@ export default {
           image: new Icon({
             crossOrigin: 'anonymous',
             src: info,
-            scale: 0.3
+            scale: 0.225
           })
         }),
         LineString: new Style({
@@ -140,7 +140,7 @@ export default {
           image: new Icon({
             crossOrigin: 'anonymous',
             src: report,
-            scale: 0.3
+            scale: 0.25
           })
         }),
         LineString: new Style({
@@ -156,7 +156,7 @@ export default {
           image: new Icon({
             crossOrigin: 'anonymous',
             src: culture,
-            scale: 0.3
+            scale: 0.225
           })
         }),
         LineString: new Style({
@@ -521,7 +521,13 @@ export default {
     locateAtFeature: function (feature, type, zoom = 17) {
       let view = map.getView()
       view.setZoom(zoom)
-      view.setCenter(Extent.getCenter(feature.getGeometry().getExtent()))
+      if (this.$store.state.isMobile && type !== 'relate') {
+        let coord = Extent.getCenter(feature.getGeometry().getExtent())
+        coord[1] = coord[1] * 1.00008
+        view.setCenter(coord)
+      } else {
+        view.setCenter(Extent.getCenter(feature.getGeometry().getExtent()))
+      }
       if (type === 'relate') {
         view.setZoom(zoom * 0.975)
       }
@@ -967,6 +973,7 @@ export default {
       })
     }
   },
+
   mounted () {
     this.initMap()
     this.initOverLay()
@@ -979,6 +986,7 @@ export default {
     this.mapClick()
     this.sloganListener()
   },
+
   watch: {
     drawType: function () {
       DrawShape.closeDrawShape()
@@ -991,6 +999,7 @@ export default {
       }
     }
   },
+
   filters: {
     // 超过100位显示省略号
     ellipsis: function (value) {

+ 1 - 1
src/components/slogan.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <div class="slogan-div"><p class="slogan" style="white-space: pre-wrap;">{{ slogan }}</p></div>
+    <div class="slogan-div"><p class="slogan" >{{ slogan }}</p></div>
   </div>
 </template>