簡體   English   中英

esri地圖顯示信息窗口,沒有點擊地圖

[英]esri map display info window without clicking on the map

我正在使用esri map javascipts API。 我想在地圖上顯示一個信息窗口。 但是,在esri給出的示例中,用戶必須單擊地圖才能顯示信息窗口。 因為在示例中,其中一個參數是screenPoint,必須通過單擊地圖獲取。 我可以點擊按鈕在特定位置顯示信息窗口嗎? 謝謝!

dojo.connect(map.graphics, "onClick", function(evt) {
      var g = evt.graphic;
      map.infoWindow.setContent(g.getContent());
      map.infoWindow.setTitle(g.getTitle());
      map.infoWindow.show(evt.screenPoint,map.getInfoWindowAnchor(evt.screenPoint));
    });

是的,map.infoWindow.show()方法的第一個參數只是一個屏幕點位置。 這是Point對象文檔的鏈接: http//help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/point.htm ,這是您為該參數傳遞的內容。 例如: new esri.geometry.Point(-118.15, 33.80, map.spatialReference);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM