定位图标修改、提示信息优化、右键绘画提示信息失效问题
1 files modified
1 files added
| | |
| | | projection: 'EPSG:4326', |
| | | // 设置缩放倍数 |
| | | zoom: 13, |
| | | minZoom: 6, |
| | | maxZoom: 20 |
| | | minZoom: 8, |
| | | maxZoom: 19 |
| | | }) |
| | | }) |
| | | _this.lineVector = new VectorLayer({ |
| | |
| | | //点样式 |
| | | let style = new Style({ |
| | | image: new Icon({ |
| | | src: "/img/favicon.png", |
| | | src: "/img/dwicon.jpeg", |
| | | anchor: [0.48, 0.52], |
| | | scale:0.5 |
| | | // imgSize: [250,320], |
| | | scale: 0.2 |
| | | }), |
| | | }); |
| | | feature_Point.setStyle(style); |
| | | this.pointVector.getSource().addFeature(feature_Point); |
| | | var center = [Number(pointLonLat.lon), Number(pointLonLat.lat)]; |
| | | var view = this.map.getView(); |
| | | let center = [Number(pointLonLat.lon), Number(pointLonLat.lat)]; |
| | | let view = this.map.getView(); |
| | | view.setZoom(16); |
| | | view.animate({ |
| | | center: center, |
| | |
| | | if(!_this.showTip){ |
| | | _this.showTip = true |
| | | } |
| | | _this.tipTitle = "单击左键开始绘画"; |
| | | _this.tipTitle = "单击左键或者右键开始绘画" |
| | | //提示器 |
| | | $("#map").off("mousemove").mousemove(function (e) { |
| | | _this.setTipPosition(e.offsetX, e.offsetY, 5, 5); |
| | | }); |
| | | }) |
| | | $("#map").off("mousedown").mousedown(function () { |
| | | _this.tipTitle = "可继续,或选择最终位置双击结束绘画" |
| | | }) |
| | | |
| | | _this.draw = new Draw({ |
| | | source: _this.lineVector.getSource(), |
| | |
| | | _this.map.on('click', function (e) { |
| | | // 将点坐标保存集合 |
| | | _this.coordinates.push(e.coordinate) |
| | | _this.tipTitle = "可继续,或单击鼠标结束"; |
| | | }) |
| | | // 结束事件 |
| | | _this.draw.on('drawend', function () { |
| | |
| | | |
| | | this.map.addLayer(clusters) |
| | | }, |
| | | // 重置图层 |
| | | clearDraw(){ |
| | | let _this = this |
| | | _this.coordinates = [] |