首页 / 浏览问题 / WebGIS / 问题详情
有高亮线的地图移动缩放遇到的问题
55EXP 2025年08月04日

选中一条路线后,在地图上画出来,然后缩放地图,或者是移动地图,会出现错误,导致位置绘制的线形和地图原本的线形不一致。

错误信息:

iclient-classic-es6.js:6188 Uncaught TypeError: Geometry.Point is not a constructor
    at Object.lineIntersection (iclient-classic-es6.js:6188:26)
    at SuperMap.Util.clipLineRect (eval at <anonymous> (SuperMap-8.1.1-17729.js:1:1), <anonymous>:1:30970)
    at SuperMap.Util.clipLineStringRect (eval at <anonymous> (SuperMap-8.1.1-17729.js:1:1), <anonymous>:1:31519)
    at SuperMap.Util.clipGeometryRect (eval at <anonymous> (SuperMap-8.1.1-17729.js:1:1), <anonymous>:1:36064)
    at initialize.drawFeature (eval at <anonymous> (SuperMap-8.1.1-17729.js:3:1), <anonymous>:1:468570)
    at initialize.drawFeatures (eval at <anonymous> (SuperMap-8.1.1-17729.js:3:1), <anonymous>:1:465387)
    at initialize.moveTo (eval at <anonymous> (SuperMap-8.1.1-17729.js:3:1), <anonymous>:1:464776)
    at initialize.moveTo (eval at <anonymous> (SuperMap-8.1.1-17729.js:3:1), <anonymous>:1:53690)
    at initialize.setCenter (eval at <anonymous> (SuperMap-8.1.1-17729.js:3:1), <anonymous>:1:49172)
    at initialize.wheelChange (eval at <anonymous> (SuperMap-8.1.1-17729.js:3:1), <anonymous>:1:249864)
lineIntersection    @    iclient-classic-es6.js:6188
SuperMap.Util.clipLineRect    @    VM780:1
SuperMap.Util.clipLineStringRect    @    VM780:1
SuperMap.Util.clipGeometryRect    @    VM780:1
drawFeature    @    VM781:1
drawFeatures    @    VM781:1
moveTo    @    VM781:1
moveTo    @    VM781:1
setCenter    @    VM781:1
wheelChange    @    VM781:1
wheelDown    @    VM781:1
callback    @    VM781:1
wheelZoom    @    VM781:1
onWheelEvent    @    VM781:1
eval    @    VM781:1


主要代码:

vectorLayer = new SuperMap.Layer.Vector("VectorLayer")

从服务器查询后,将线形放入图层

 feature = result.recordsets[i].features[j];
  feature.style = controlStyle;
  workLayer.addFeatures(feature);





前端版本:supermap-iclient-javascript-classic-2025.zip
iserver版本: iServer 11i(2024) (11.3.0-win64)

1个回答

您好,我本地测试用的是示例服务(https://iclient.supermap.io/examples/classic/editor.html#query_queryBySQL)换成线数据集没有报错。

您将feature中的坐标点获取到,重新用绘制几何线的方式添加到地图看看会不会报错

var points2 = [
                new SuperMap.Geometry.Point(0, 29.4),
                new SuperMap.Geometry.Point(-50, 39.4),
                new SuperMap.Geometry.Point(-30, 19.4),
                new SuperMap.Geometry.Point(100, 49.4)
            ];
            var line1 = new SuperMap.Geometry.LineString(points2);
            var linecVector = new SuperMap.Feature.Vector(line1);
            linecVector.style = {
                strokeColor: "#7B68EE",
                strokeWidth: 2
            };

1,331EXP 2025年08月05日
...