帖子
|
嗨,乔尔,非常感谢你给我的链接,让我找到了解决方案。根据建议,我在代码的开头应用了以下内容:我只能说,哇,这是多大的性能差异!在我看来,这些功能现在在眨眼之间加载,而不是在加载整个国家的数据时痛苦地等待!再次谢谢你,瑞奇。
…查看更多
01-13-202302:56我
|
0
|
0
|
25
|
帖子
|
嗨,有可能得到一个FeatureLayer限制功能,显示在地图上,只是我正在查看的当前地图范围?我的featureLayer大约有280K个功能,覆盖了整个国家。我限制了功能显示的比例,所以你必须在加载前将其放大到一个小区域。当特征显示时,它会将所有280k特征加载到地图上,这可能需要1-2分钟。一旦所有的功能都被加载,这是好的,你可以放大地图和选择功能没有问题,但这不是我需要的。我希望它只是加载到我正在观看的区域,希望这将大大提高初始性能。这张地图将是面向客户的,将被用来通过弹出窗口记录一个问题。在当前的初始加载时间下,它将无法使用。我曾见过queryExtent,但我不确定如何实现它?由于瑞奇
…查看更多
01-04-2023上午01:43
|
0
|
2
|
81
|
帖子
|
嗨,杰弗里,谢谢你的建议。我已经看了你的建议,我已经按照我的要求做了调整。我的地图上只有一个功能层,如果与功能交互,我需要返回其定义的弹出窗口,否则只需返回一个通用的弹出窗口(这只是记录用户点击的X/Y)。这对我很有效。view.popup.autoOpenEnabled = false;视图。在("click", (event) => { if (view.scale <= 2500) { view.hitTest(event).then((response) => { let streetGraphics = response.results.filter(function (result) { return result.graphic.layer === streetLayer; }); var features2Use = []; if (streetGraphics.length > 0) { for (var i = 0; i < streetGraphics.length; i++) { features2Use.push(streetGraphics[i].graphic); } } view.popup.open({ features: features2Use }); }); } }); view.on("click", (event) => { const x = Math.round(event.mapPoint.x * 1) / 1; const y = Math.round(event.mapPoint.y * 1) / 1; view.popup.open({ content: `Click anywhere popup`, location: event.mapPoint }); }); Thanks for your help and advice, Ricky
…查看更多
12-05-202201:48我
|
0
|
0
|
81
|
帖子
|
嗨,我想我的地图显示两个不同的弹出窗口。“如果”我点击特征层,它会返回与该层相关的弹出窗口,“否则”如果我点击特征以外的任何地方,它会返回一个不同的弹出窗口。我目前有两个独立的地图,每个都有自己不同类型的弹出。1.在这张地图上,只有当你击中特征(街道线)时才会返回一个弹出框:这有一个与特征层直接相关的customContent模板。单击其他任何地方都不会返回任何内容。const customContent = new customContent ({outFields: ["*"], creator: (event) => {const location = view.popup.location;const locationContent = ' X: ${location.x.toFixed(0)}
Y: ${location.y.toFixed(0)} ';const name =' Street: ${event.graphic. net;属性(“:域名”)}< br > < b >城镇:< / b > $ {event.graphic.attributes[“TOWN_NAME”]}< br > '; const link = ` Report a traffic safety concern`; return name + link; }, }); const template = new PopupTemplate({ outFields: ["*"], content: [customContent], }); const streetLayer = new FeatureLayer({ url: "https://services6.arcgis.com/Qptn479QktK11k72/arcgis/rest/services/New_Achieve_Streets_layer/FeatureServer/0", outFields: ["*"], }); streetLayer.maxScale=350; streetLayer.minScale=2500; streetLayer.popupTemplate = template; map.add(streetLayer); 2. On this map you can click anywhere and it returns the popup (it never interacts with the feature layer). view.popup.autoOpenEnabled = false; view.on("click", (event) => { if (view.scale <= 2500) { const x = Math.round(event.mapPoint.x * 1) / 1; const y = Math.round(event.mapPoint.y * 1) / 1; view.popup.open({ content: `Report fly-posting or an illegal sign`, location: event.mapPoint }); } }); I've tried putting the two sets of code onto the same map. However the '2' code (click anywhere) just seems to override everything and if I click on the feature (street layer) it just displays the 2nd popup. I'm guessing I need a, 'If' you hit the feature display that popup, 'Else' display the click anywhere popup. How do I go about this please? My attempts have failed. Thanks Ricky …查看更多
11-30-202207:44我
|
0
|
2
|
142
|
帖子
|
谢谢你的指教,布莱克。我以前也没有这样做过,而且对JS相当陌生,从头开始编写它似乎超出了我目前的技能范围。使用你上面的链接,我会看看我是否能找到一个样本,大致是我所追求的,并适应我的意思。祝我好运吧!
…查看更多
11-30-2022上午07:27
|
0
|
0
|
28
|
帖子
|
大家好,我希望能够点击附近,但不是直接在我们的街道特征(线)层上,它会返回该层中最近的街道的街道参考编号。我们有许多面向公众的地图,用于报告不是直接在街道上而是在街道附近的问题,例如在边缘或树篱等。我们的后台系统需要离问题最近的街道,目前我们要求客户搜索最近的街道并手动输入到表单中。我已经看了所有的指导,但我不确定从哪里开始。我不认为反向地理编码的“定位器”会做的工作,我只需要与最近的功能进行交互。下面是一个地图示例,我将更新它以包含最近的街道参考编号。https://codepen.io/RFletERYC/full/RwyYvBe正如您将看到的,您可以单击地图上的任何位置,它将返回X/Y坐标,然后将其输入到我们的后台系统中。你也可以与街道图层进行交互。但当我不直接与街道互动时,我该如何捕捉到街道的细节呢?提前感谢。 Ricky
…查看更多
11-23-202208:20我
|
0
|
2
|
66
|
帖子
|
嗨,乔尔,你的假设都是正确的,而且效果很好!谢谢你的帮助。关于瑞奇
…查看更多
11-01-202202:05我
|
0
|
0
|
88
|
帖子
|
嗨,Rene,这一直工作得很好,我希望你不介意,但我现在有一个进一步的查询关于这个。我已经被要求添加另一层到地图(边界层)见这支笔https://codepen.io/RFletERYC/full/mdKbQEo。当我添加这一层时,对图形的检查不再有效,我可以再次在地图上的任何地方放置标记,而不是仅限于街道层。我注意到你进一步提到的评论进一步检查,如层id或标题。这听起来像是我现在需要的东西。请问我该如何添加其中一张支票呢?提前感谢。瑞奇
…查看更多
10-31-2022上午07:58
|
0
|
1
|
21
|
帖子
|
嗨,我希望这是一个简单的查询。在我的地图上,客户只能在我们的街道特征层上放置一个简单的标记。这可以防止客户在报告街道问题时在田地或任何其他区域掉落标记。这是通过图形上的hitTest事件来实现的(参见下面的示例)。视图。在("click", function (evt) { var graphic = new Graphic({ geometry: { type: "point", x: evt.mapPoint.x, y: evt.mapPoint.y, spatialReference: view.spatialReference, }, symbol: { type: "simple-marker", color: [255, 10, 10], outline: { color: [255, 255, 255], width: 2, }, }, }); view.hitTest(evt).then(({results}) => { if (results.length) { view.graphics.removeAll(); view.graphics.add(graphic); } }); }); This currently works brilliantly. However if I add another feature layer to the map (in this case our county boundary layer), the restrict to hitTest part of the query for the graphics marker is ignored and it lets a customer drop a marker anywhere of their choosing. Why is it doing this and what can I do to mitigate it? The hitTest is only linked to the streets layer and that part still works fine when a street in interacted with, it's just the graphics query which seems to be ignored now. I've got my roads feature layer to load as 0 and the boundary layer as 1. Thanks
…查看更多
10-31-202203:09我
|
0
|
2
|
164
|
帖子
|
非常好,谢谢John和Rene最初的建议。
…查看更多
10-03-202201:28我
|
0
|
0
|
153
|