使用JS API的几何查询功能,不显示点图标?

0 投票
function processCompleted(queryEventArgs) {
    drawPolygon1.deactivate();
    var i, j, result = queryEventArgs.result;
    if (result && result.recordsets) {
        for (i=0, recordsets=result.recordsets, len=recordsets.length; i<len; i++) {
            if (recordsets[i].features) {
                for (j=0; j<recordsets[i].features.length; j++) {
                    var feature = recordsets[i].features[j];
                    var point = feature.geometry;
                    if(point.CLASS_NAME == SuperMap.Geometry.Point.prototype.CLASS_NAME){
                        var size = new SuperMap.Size(44, 33),
                            offset = new SuperMap.Pixel(-(size.w/2), -size.h),
                            icon = new SuperMap.Icon("theme/images/marker.png", size, offset);
                        bikemarkerLayer.addMarker(new SuperMap.Marker(new SuperMap.LonLat(point.x, point.y), icon));
                    }else{
                        feature.style = style;
                        vectorLayer1.addFeatures(feature);
                    }
                }
            }
        }
    }
}

问题:

7月 15, 2017 分类:  502次浏览 | 用户: 咻咻咻 初出茅庐 (24 分)

1个回答

0 投票
 
已采纳
您好,检查一下你的icon的路径是否正确,icon的路径是写相对于当前html所在的路径
7月 17, 2017 用户: 郑雅琳 名扬四海 (1,600 分)
采纳于 7月 29, 2017 用户:咻咻咻
问题已解决,谢谢您~
...