| | |
| | | } |
| | | |
| | | init (layer) { |
| | | this.layer = layer |
| | | const wfsUrl = this.config.wfs |
| | | if (wfsUrl) { |
| | | AjaxUtils.get4JsonDataByUrl(wfsUrl, this.params, (res) => this.draw(layer, res.data.features)) |
| | | this.loadData(wfsUrl) |
| | | } |
| | | } |
| | | |
| | | draw (layer, features) { |
| | | loadData (wfsUrl) { |
| | | AjaxUtils.get4JsonDataByUrl(wfsUrl, this.params, (res) => this.draw(res.data.features)) |
| | | } |
| | | |
| | | draw (features) { |
| | | const icon = this.config.icon |
| | | const geojson = this.L.geoJSON(features, { |
| | | this.L.geoJSON(features, { |
| | | style: function (feature) { |
| | | return { |
| | | fill: styles.defaultLineStyle.fill, |
| | |
| | | .bindTooltip((layer) => this.tooltipListener(layer), { direction: 'bottom', offset: [0, 15], sticky: true }) |
| | | .on('mouseover', (e) => this.mouseOverListener(e, layer)).on('mouseout', (e) => this.mouseOutListener(e, layer)) |
| | | } |
| | | }).addTo(layer) |
| | | return geojson |
| | | }).addTo(this.layer) |
| | | } |
| | | |
| | | mouseOverListener (e, layer) { |