| | |
| | | connectCreatedToMap: function (layer) { |
| | | return this.featuresLayer.addLayer(layer) |
| | | }, |
| | | |
| | | // 🍂method startPolyline(latlng: L.LatLng, options: hash): L.Polyline |
| | | // Start drawing a Polyline. If `latlng` is given, a first point will be added. In any case, continuing on user click. |
| | | // If `options` is given, it will be passed to the Polyline class constructor. |
| | |
| | | const line = this.createPolyline([], options) |
| | | line.enableEdit(this.map).newShape(latlng) |
| | | return line |
| | | }, |
| | | // 箭头标绘 |
| | | startPolylineArrow: function (latlng, options) { |
| | | const lineArrow = this.createPolyline([], { |
| | | color: 'black', |
| | | weight: 3, |
| | | opacity: 1.0 |
| | | }) |
| | | lineArrow.enableEdit(this.map).newShape(latlng) |
| | | return lineArrow |
| | | }, |
| | | |
| | | // 🍂method startPolygon(latlng: L.LatLng, options: hash): L.Polygon |
| | |
| | | const circle = this.createCircle(latlng, options) |
| | | circle.enableEdit(this.map).startDrawing() |
| | | return circle |
| | | }, |
| | | // 文字标注 |
| | | startText: function (latlng, options) { |
| | | latlng = latlng || this.map.getCenter().clone() |
| | | const markerBuilding = this.createMarker(latlng, options).bindTooltip('问题标注内容', { |
| | | offset: [0, 0], |
| | | permanent: true, |
| | | direction: 'top', |
| | | className: 'anim-tooltip' |
| | | }) |
| | | markerBuilding.enableEdit(this.map).startDrawing() |
| | | return markerBuilding |
| | | }, |
| | | |
| | | // 图标标注 |