GitHub:八至
作者:狐狸家的鱼
本文链接:实现QML中显示html中地图的坐标
如何QML与HTML通信已经在这篇文章 QML与HTML通信之画图 详细讲述了
var coord; map.on(‘singleclick‘,(evt)=>{ coord = ol.coordinate.toStringXY(ol.proj.transform(evt.coordinate,‘EPSG:3857‘,‘EPSG:4326‘),2); content.changeText(coord); });
function changeText(newText) {//鼠标点击经纬度显示 鼠标点击时会调用该函数 并更新文本coordinateTex console.log(newText); giwSC.coordinateTex = newText;// }
MyText{ id:coordinateTex; fontSize: l; text: "104.08,30.66"; }
OpenLayers学习笔记(四)— QML显示html中openlayers地图的坐标
原文:https://www.cnblogs.com/suRimn/p/10113654.html