| | |
| | | |
| | | }); |
| | | window.onload = function () { |
| | | console.log(window.onload); // 打印数组数据 |
| | | //加载坐标点 |
| | | window.Android.loadMarker(); |
| | | }; |
| | |
| | | window.addMarker = addMarker; |
| | | window.setCenterAndZoom = setCenterAndZoom; |
| | | window.updateLocation = updateLocation; |
| | | window.aginShowLocation = aginShowLocation; |
| | | } |
| | | |
| | | // 调用原生安卓方法显示取水口详情 |
| | |
| | | map.addOverLay(lineLayer); |
| | | let icon = new T.Icon({ |
| | | iconUrl: locationIMGPath, |
| | | iconSize: new T.Point(27, 27), |
| | | iconAnchor: new T.Point(13, 20) |
| | | iconSize: new T.Point(20, 20), |
| | | iconAnchor: new T.Point(10, 10) |
| | | }); |
| | | if (locationMarker) { |
| | | map.removeOverLay(locationMarker); |
| | |
| | | // }, 500); |
| | | |
| | | } |
| | | var aginPath = []; |
| | | function aginShowLocation(lng, lat) { |
| | | // 调用 Android 提供的接口,获取数据 |
| | | console.log("aginShowLocation>>lng:"+lng+">>>lat:"+lat); |
| | | var newPoint = new T.LngLat(lng, lat); |
| | | aginPath.push(newPoint); |
| | | lineLayer.setLngLats(aginPath); |
| | | map.addOverLay(lineLayer); |
| | | } |
| | | |
| | | |
| | | })(); |