|
@@ -205,91 +205,7 @@
|
|
|
|
|
|
},
|
|
|
mounted() {
|
|
|
- // document.getElementById("location1").addEventListener("click", location1);
|
|
|
- // document.getElementById("location2").addEventListener("click", location2);
|
|
|
- // // document.getElementById("clear").addEventListener("click", clearMap);
|
|
|
-
|
|
|
- // function location1() {
|
|
|
- // let alon = document.getElementById("alon").value;
|
|
|
- // let alat = document.getElementById("alat").value;
|
|
|
- // addPoint(+alon, +alat, "锚点1")
|
|
|
- // }
|
|
|
-
|
|
|
- // function location2() {
|
|
|
- // let blon = document.getElementById("blon").value;
|
|
|
- // let blat = document.getElementById("blat").value;
|
|
|
- // addPoint(+blon, +blat, "锚点2")
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
- // let pointLayerArray = [];
|
|
|
- // let map = initMap('map');
|
|
|
-
|
|
|
- // function initMap(divid) {
|
|
|
- // let gaodeMapLayer = new ol.layer.Tile({
|
|
|
- // source: new ol.source.XYZ({
|
|
|
- // url: 'http://wprd03.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=7&x={x}&y={y}&z={z}' //高德地图切片访问路径
|
|
|
- // })
|
|
|
- // });
|
|
|
-
|
|
|
- // return new ol.Map({
|
|
|
- // layers: [gaodeMapLayer],
|
|
|
- // target: divid,
|
|
|
- // view: new ol.View({
|
|
|
- // center: ol.proj.fromLonLat([113.59569403794666,
|
|
|
- // 22.36656052911783
|
|
|
- // ]), //最初定位的位置
|
|
|
- // zoom: 4 //地图层级
|
|
|
- // })
|
|
|
- // });
|
|
|
-
|
|
|
- // }
|
|
|
-
|
|
|
- // function addPoint(lon, lat, text) {
|
|
|
-
|
|
|
- // let vector = new ol.source.Vector();
|
|
|
- // let vLayer = new ol.layer.Vector({
|
|
|
- // source: vector
|
|
|
- // })
|
|
|
- // vLayer.type = "con_point";
|
|
|
- // map.addLayer(vLayer)
|
|
|
- // pointLayerArray.push(vLayer);
|
|
|
- // let labelCoords = ol.proj.transform([lon, lat], "EPSG:4326", "EPSG:3857");
|
|
|
- // let feature = new ol.Feature({
|
|
|
- // geometry: new ol.geom.Point(labelCoords)
|
|
|
- // });
|
|
|
- // vector.addFeature(feature);
|
|
|
- // vLayer.setStyle(new ol.style.Style({
|
|
|
- // image: new ol.style.Circle({ //点样式
|
|
|
- // radius: 7,
|
|
|
- // fill: new ol.style.Fill({
|
|
|
- // color: '#00c033'
|
|
|
- // })
|
|
|
- // }),
|
|
|
- // text: new ol.style.Text({
|
|
|
- // text: text,
|
|
|
- // font: '15px sans-serif',
|
|
|
- // offsetX: 5,
|
|
|
- // offsetY: -10,
|
|
|
- // fill: new ol.style.Fill({
|
|
|
- // color: "#b9391f"
|
|
|
- // }),
|
|
|
- // stroke: new ol.style.Stroke({
|
|
|
- // color: "#b9391f"
|
|
|
- // })
|
|
|
- // })
|
|
|
- // }))
|
|
|
- // map.getView().setCenter(labelCoords)
|
|
|
- // }
|
|
|
-
|
|
|
- // function clearMap() {
|
|
|
- // pointLayerArray.map(each => {
|
|
|
- // if (each.type == "con_point") {
|
|
|
- // map.removeLayer(each)
|
|
|
- // }
|
|
|
- // });
|
|
|
- // pointLayerArray = [];
|
|
|
- // }
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -319,7 +235,6 @@
|
|
|
},
|
|
|
clearMap() {
|
|
|
this.pointLayerArray.map(each => {
|
|
|
- alert(1)
|
|
|
if (each.type == "con_point") {
|
|
|
this.map.removeLayer(each)
|
|
|
}
|