帖子
|
关于这段代码:this.view。goTo({目标:this.view.graphics}).catch(this.catchAbortError);this.view.graphics是一个集合,但是goTo的文档没有指定支持集合。我建议传递文档中指定的值,比如图形数组:this.view.goTo(this.view.graphics.toArray()).catch(this.catchAbortError);
...查看更多
|
0
|
1
|
5
|
帖子
|
您的实现将生成许多uniquevaluerenderer,每个都有一个符号。然而,似乎你真正要做的是创建一个带有所有符号的UniqueValueRenderer。如果是这种情况,那么下面的代码可以解决问题:$。ajax({type: "GET", dataType: "json", url: "/LocationType/LoadLocationType", success: function(data) {var renderer = new uniquevaluerender ({field:"id});For (var I = 0;I < data.length;++i){渲染器。addUniqueValueInfo({值:data[i].)Id, label: data[i]。locationTypeName,符号:{类型:"图片标记",url: "https://localhost/image/" +数据[i]。locationTypeImageName,宽度:"20px",高度:"20px", outline: {color:[255,255,255],宽度:1}}}}); } //now do something with the renderer (e.g. add to a layer, etc). }, error: function () { alert('Something when wrong'); } })
...查看更多
|
0
|
0
|
1
|
帖子
|
我看到在你的循环中的第一行是:var坐标= objCoordinates[0];这肯定会抛出你的结果,我认为你更愿意:var coordinates = objCoordinates[I];
...查看更多
|
0
|
3.
|
15
|
帖子
|
文档指出,层必须有唯一的id,因此违背这一点会产生不可预测的结果。我建议调整你的应用程序,使层有唯一的id。
...查看更多
|
0
|
0
|
0
|
帖子
|
你的代码假设地图中的所有层都是featurelayer,但这是不可能的。因此,在尝试对其执行查询之前,您应该检查层类型。一个简单的检查是这样的:map.allLayers。forEach(layer =>{//查询所有层数据if (typeof layer. 0)queryFeatures == "function") {layer.queryFeatures(query).then((results) =>{//处理查询结果console.log(results)}).catch(errorCallback);}});
...查看更多
|
1
|
0
|
66
|
帖子
|
如果要这样做,你就必须点击点特征的坐标,但这实际上是不可能的。因此,对于点查询,应该使用MapView。取而代之的是hitTest -只要你点击点的符号,它就应该工作。也许可以尝试这样做:函数queryFeaturelayer(几何){if(几何。type == "point") {gisView.hitTest(gisView.toScreen(geometry), {include:parcelLayer}).then(function(hitTestResult) {var graphics = [];hitTestResult.results.forEach(函数(结果){graphics.push(结果.graphic);});console.log("Feature count: " + graphics.length);结果({特点:图形});}); } else { const parcelQuery = { spatialRelationship: "intersects", geometry: geometry, outFields: ['*'], returnGeometry: true }; parcelLayer.queryFeatures(parcelQuery).then((results) => { console.log("Feature count: " + results.features.length); displayResults(results); }).catch((error) => { console.log(error); }); } }
...查看更多
|
0
|
1
|
52
|
帖子
|
为了让applyEdits操作成功地处理删除,必须设置objectIdField。虽然我认为你可以手动设置它,这通常不会发生,直到层加载。因此,我建议做如下修改:const featureLayer = new esriJS.FeatureLayer(featureLayerUrl);featureLayer。在("load", function() { featureLayer.applyEdits(null, null, [toDelete], (adds, updates, deletes) => { resolve(deletes); }, err => { console.log(err); debugger reject(err); }); }); Waiting for the layer to load before calling applyEdits may also solve the problem you were having in the other thread.
...查看更多
|
1
|
0
|
31
|
帖子
|
文档供查看。开放indicates that when the "features" property is set, it will use their popupTemplates to render the content of the popup. Therefore, I believe this is why your title and content are ignored. I think the solution would go something like this: featureLayer.queryFeatures(query).then(function(results) { results.features.forEach(function(graphic) { graphic.popupTemplate = {title:"Test",content:"{type_lieu}"}; }); view.popup.open({ features: results.features, location: evt.result.feature.geometry.centroid }); });
...查看更多
|
0
|
1
|
44
|
帖子
|
假设你有一个按你想要的顺序排序的层id数组,并且在索引0的最低层,在我看来,你可以添加一个这样的函数,并在需要时调用它(例如,在添加了一个层等):sortedLayerIDs.forEach(function(layerID) {var layer = map.findLayerById(layerID);If(图层)映射。重新排序(层,mapLayerIndex + +);});}(这也假设您使用的是版本4。x的API;参见Map.reorder。)
...查看更多
|
0
|
0
|
35
|
帖子
|
在黑客方面,我认为esriRequest。setRequestPreCallback可能是你最好的选择。它允许您在发送请求之前拦截和修改请求。我认为你可以在那里添加剪切参数和值。
...查看更多
|
1
|
1
|
32
|
标题 | 荣誉 | 发布 |
---|---|---|
1 | 2周前 | |
1 | 2周前 | |
1 | 3周前 | |
1 | 一个月前 | |
2 | 11-23-2022上午11:19 |