liuyg
2021-11-19 0855c8cef2f2f414cf9a84285421fdcdd5bc6310
src/components/map/main.vue
@@ -7,7 +7,8 @@
 * @LastEditTime: 2021-04-24 11:59:43
-->
<template>
  <div id="track_map" style="height: 100%"></div>
    <div id="track_map"
         style="height: 100%"></div>
</template>
<script>
import "ol/ol.css";
@@ -94,7 +95,6 @@
  mounted() {
    //建立地图
    this.createmap(1); //1为本地
    // this.createmap(); //空或其他是外网
    this.parentParameter();
@@ -149,6 +149,8 @@
            projection: "EPSG:4326",
          }),
        });
            } else {
        var projection = getProjection("EPSG:4326");
        var projectionExtent = projection.getExtent();
        var size = getWidth(projectionExtent) / 256;
@@ -157,7 +159,6 @@
          //计算比例尺
          resolutions[z] = size / Math.pow(2, z);
        }
      } else {
        // 正式服务器上使用
        this.ol2d = new OlMap({
          layers: [