| | |
| | | /** |
| | | * 加载业务数据图层 |
| | | */ |
| | | |
| | | import { STYLES } from '../../../conf/Constants' |
| | | import AjaxUtils from '../../../utils/AjaxUtils' |
| | | |
| | |
| | | this.params = { |
| | | version: '1.0.0', |
| | | REQUEST: 'getfeature', |
| | | OUTPUTFORMAT: 'json', |
| | | maxFeatures: 20000 |
| | | OUTPUTFORMAT: 'json' |
| | | // maxFeatures: 20000 |
| | | } |
| | | this.popupComp = window.popupComp |
| | | this.L = window.L |
| | |
| | | } |
| | | |
| | | loadData (wfsUrl) { |
| | | AjaxUtils.get4JsonDataByUrl(wfsUrl, this.params, (res) => this.draw(res.data.features)) |
| | | AjaxUtils.get4JsonDataByUrl(wfsUrl, this.params, (res) => { |
| | | this.draw(res.data.features) |
| | | }) |
| | | } |
| | | |
| | | draw (features) { |
| | | const icon = this.config.icon |
| | | this.L.geoJSON(features, { |
| | | const styles = this.config.styles |
| | | Object.assign(STYLES, styles) |
| | | const geojsonLayer = this.L.geoJSON(features, { |
| | | style: function (feature) { |
| | | return { |
| | | fill: STYLES.FILL, |
| | |
| | | fillColor: STYLES.FILL_COLOR, |
| | | color: STYLES.COLOR, |
| | | fillOpacity: STYLES.FILL_OPACITY, |
| | | opacity: STYLES.OPACITY, |
| | | dashArray: STYLES.DASH_ARRAY, |
| | | dashSpeed: STYLES.DASH_SPPED |
| | | opacity: STYLES.OPACITY |
| | | // dashArray: STYLES.DASH_ARRAY, |
| | | // dashSpeed: STYLES.DASH_SPPED |
| | | } |
| | | }, |
| | | pointToLayer: (geoJsonPoint, latlng) => { |
| | |
| | | .on('mouseover', (e) => this.mouseOverListener(e, layer)).on('mouseout', (e) => this.mouseOutListener(e, layer)) |
| | | } |
| | | }).addTo(this.layer) |
| | | window.layerFactory.setZIndex(geojsonLayer) |
| | | } |
| | | |
| | | mouseOverListener (e, layer) { |