zhaobao 2 жил өмнө
parent
commit
49acdc47b3

+ 4 - 4
src/components/Layouts/Map.vue

@@ -34,9 +34,9 @@
             },
             initMap(){
                 const map = L.map('map', {
-                    minZoom: 0.5,
+                    minZoom: 1,
                     maxZoom: 3,
-                    center: [30, 50],
+                    center: [0, 0],
                     zoom: 1,
                     crs: L.CRS.Simple
                 });
@@ -50,10 +50,10 @@
                     }
                     return yx(y, x)
                 }
-                var bounds = [xy(-330, -255), xy(330, 255)]
+                var bounds = [xy(-264, -204), xy(264, 204)]
                 /**添加图层 */
                     L.imageOverlay(mapUrl, bounds).addTo(map);
-                    map.setMaxBounds(bounds);
+                    map.fitBounds(bounds)
                 this.map=map
             },
             getLayers(callback){

+ 0 - 1
src/components/Layouts/index.vue

@@ -76,7 +76,6 @@ export default {
             display: block;
             width: 85vw;
             height: 86.49vh;
-            margin: 0 auto;
             img{
                 width: 100%;
                 height: 100%;