如何解决科尔多瓦 navigator.geolocation.getCurrentPosition 在 here.map
我有一个使用这里地图的androidcordova应用程序,我添加了cordova-plugin-geolocation插件我需要获取当前位置而不是输入坐标:coords = {lat: coord,lng: coord}。如何使用 navigator.geolocation.getCurrentPosition(onSuccess,onError); 在地图上?
// Define a variable holding SVG:
var Markup = '<svg width="24" height="24" ' +
'xmlns="http://www.w3.org/2000/svg">' +
'<rect stroke="white" fill="#1b468d" x="1" y="1" width="22"
' +
'height="22" /><text x="12" y="18" font-size="12pt" ' +
'font-family="Arial" font-weight="bold" text-
anchor="middle" ' +
'fill="white">C</text></svg>';
// Create an icon
var icon = new H.map.Icon(Markup),coords = {lat: coord,lng: coord},marker = new H.map.Marker(coords,{icon: icon});
// Add the marker to the map and center the map at the location
of the marker:
map.addObject(marker);
map.setCenter(coords);
非常感谢您的帮助。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。