| | |
| | | initMinZoom (config) { |
| | | const minZoom = parseInt(config.minZoom) |
| | | if (minZoom) { |
| | | this.minZoomLayers[minZoom] = config |
| | | var configs = this.minZoomLayers[minZoom] |
| | | if (configs) { |
| | | configs[configs.length] = config |
| | | } else { |
| | | configs = [config] |
| | | } |
| | | this.minZoomLayers[minZoom] = configs |
| | | } |
| | | } |
| | | |
| | |
| | | * @param layerConfig |
| | | */ |
| | | initEvent (layerConfig) { |
| | | // this.map.on('zoomend ', () => this.toggleByZoom()) |
| | | this.map.on('zoomend ', () => this.toggleByZoom()) |
| | | } |
| | | |
| | | toggleByZoom () { |
| | | const zoom = this.map.getZoom() |
| | | for (var k in this.minZoomLayers) { |
| | | const config = this.minZoomLayers[k] |
| | | const configs = this.minZoomLayers[k] |
| | | for (var j in configs) { |
| | | const config = configs[j] |
| | | const checked = config.checked |
| | | console.log(zoom) |
| | | console.log(k) |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * |
| | |
| | | } |
| | | |
| | | draw (features) { |
| | | if (features && features.length > 0) { |
| | | const icon = this.config.icon |
| | | const styles = this.config.styles |
| | | Object.assign(STYLES, styles) |
| | |
| | | }).addTo(this.layer) |
| | | setZIndex(geojsonLayer) |
| | | } |
| | | } |
| | | |
| | | mouseOverListener (e, layer) { |
| | | const icon = this.config.icon |
| | |
| | | code: 'yj', |
| | | name: '窨井', |
| | | sname: '窨井', |
| | | checked: true, |
| | | checked: false, |
| | | minZoom: 16, |
| | | wfs: WFS_URL + '?TYPENAME=窨井', |
| | | icon: 'sewers/窨井.png' |