arcgis中一般用InfoTemplate做信息展示,可是这个信息框是固定的。怎么做一个可任意拖动的对话框?
1条回答 默认 最新
- 战在春秋 2017-11-10 09:09关注
可以参考以下代码:
require([ "esri/arcgis/utils", "dojo/dnd/Moveable" ], function (arcgisUtils, Movable) { "use strict"; var mapId = "bc6e18b0c332407e800c234de472939f"; // Replace with your own map ID from ArcGIS.com. /** * Makes the popup draggable. * @returns {dojo/dnd/Movable} */ function makePopupDraggable(){ var popupDiv = document.querySelector(".esriPopup"); var dnd; if (popupDiv) { dnd = new Movable(popupDiv); } // TODO: Figure out how to make the little arrow point the right way after dragging. return dnd; } arcgisUtils.createMap(mapId, "map", { usePopupManager: true, mapOptions: { center: [-120.80566406246835, 47.41322033015946], zoom: 7, minZoom: 7 } }).then(makePopupDraggable); });
这种方法需要借助 dojo.dnd.Moveable
其网址为:http://dojotoolkit.org/reference-guide/1.7/dojo/dnd/Moveable.html#dojo-dnd-moveable
如果对您有帮助,请采纳答案好吗,谢谢!
解决 无用评论 打赏 举报
悬赏问题
- ¥15 Vue3 大型图片数据拖动排序
- ¥15 划分vlan后不通了
- ¥15 GDI处理通道视频时总是带有白色锯齿
- ¥20 用雷电模拟器安装百达屋apk一直闪退
- ¥15 算能科技20240506咨询(拒绝大模型回答)
- ¥15 自适应 AR 模型 参数估计Matlab程序
- ¥100 角动量包络面如何用MATLAB绘制
- ¥15 merge函数占用内存过大
- ¥15 使用EMD去噪处理RML2016数据集时候的原理
- ¥15 神经网络预测均方误差很小 但是图像上看着差别太大