首页 / 浏览问题 / WebGIS / 问题详情
leaflet加载iserver发布的地图显示不完整
8EXP 2023年11月03日

问题描述:leaflet加载iserver发布的地图显示不完整

代码如下

<template>
  <div class="supMap-box">
    <div id="map" :style="{ height: mapHeight + 'px' }">
    </div>
  </div>
</template>

<script>
import L from 'leaflet';
import {TiledMapLayer} from '@supermap/iclient-leaflet';

export default {
  name: "Index",
  data() {
    return {
      mapHeight: 900,
      map: null,
    };
  },
  created() {   
  },
  mounted() {
    this.initMap()
  },
  methods: {

    initMap() {
      var supermapurl = 'http://localhost:8090/iserver/services/map-HanJiangLiuYuDiTu-2/rest/maps/%E6%B1%89%E6%B1%9F%E6%B5%81%E5%9F%9F'
      this.map = L.map('map', {
        crs: L.CRS.EPSG4326,
        center: [32, 111],
        maxZoom: 18,
        zoom: 6
      });
      new TiledMapLayer(supermapurl).addTo(this.map);
    }
  }
}
</script>

<style scoped>
#map {
  width: 1900px;
  height: 1400px;
}
</style>

1个回答

您好,您这个服务在iserver预览能看到吗? 能显示完全吗?
640EXP 2023年11月06日
在iserver中预览可以显示完全
您方便把数据发我吗,这边帮您测试一下,可以加我qq1305379193
调用方法错误,改成ImageMapLayer
...