首页 / 浏览问题 / 云GIS / 问题详情
ol加载地图出现问题
34EXP 2020年04月29日

矢量瓦片加载

new ol.supermap.MapService(url).getMapInfo(function(serviceResult) {

      var stylesOptions = {

        url: url,

        view: newMap.getView()

      };

      var vectorTileStyles = new ol.supermap.VectorTileStyles(stylesOptions);

      console.log(vectorTileStyles.getFeatureStyle);

      var vectorTileOptions = ol.source.VectorTileSuperMapRest.optionsFromMapJSON(

        url,

        serviceResult.result

      );

      var vectorLayer = new ol.layer.VectorTile({

        source: new ol.source.VectorTileSuperMapRest(vectorTileOptions),

        style: vectorTileStyles.getFeatureStyle,

        id: layerId,

        className: className,

        zIndex:zIndex

      });

      map.addLayer(vectorLayer);

    });

1个回答

您好,瓦片加载不完全,您那边该图层的坐标系和地图或者底图的坐标系单位一致吗?然后您那边可以打印下vectorTileOptions这个参数,看下里面tilegrid的参数,然后您可去iserver以openlayer的方式去预览,然后map.values_.layergroup.values_.layers.array_[+""+0+""].state_.layer.values_.source贴上这样的语句到控制台去对比下对接参数,可能是您那边原点参数有问题。
3,352EXP 2020年04月29日
你好,我对照了一下,原点的参数是一样的
...