The InfoWindow does not stay opened when setting the content in the click event and a KML layer is present.
上次发布: September 14, 2015ArcGIS API for JavaScript
漏洞 ID 编号
BUG-000087759
已提交
May 19, 2015
上次修改时间
June 5, 2024
适用范围
ArcGIS API for JavaScript
找到的版本
3.13
状态
Known Limit
经开发团队审核,已确定此问题与不受 Esri 控制的软件的已知限制有关。 问题的“其他信息”部分可能包含进一步说明。
附加信息
FeatureLayers automatically handle pop-up on click. Instead of defining a feature layer click set an info template on the layer.
解决办法
Change the following to use the map click event instead of feature layer click.
Change:
//associate the features with the popup on click
featureLayer.on("click", function(evt) {
map.infoWindow.setFeatures([evt.graphic]);
var html = "<strong>";
map.infoWindow.setTitle("Station ");
map.infoWindow.show(evt.mapPoint, map.getInfoWindowAnchor(evt.screenPoint));
});
To:
//associate the features with the popup on click
map.on("click", function(evt) {
map.infoWindow.setFeatures([evt.graphic]);
var html = "<strong>";
map.infoWindow.setTitle("Station ");
map.infoWindow.show(evt.mapPoint, map.getInfoWindowAnchor(evt.screenPoint));
});