| | |
| | | var that = this |
| | | var icon = layer.icon |
| | | const featureGroup = that.L.featureGroup().addTo(that.map) |
| | | that.L.geoJSON(res.features, { |
| | | const geojson = that.L.geoJSON(res.features, { |
| | | style: function (feature) { |
| | | return { |
| | | fill: true, |
| | |
| | | minWidth: 300, |
| | | closeButton: false, |
| | | autoClose: false |
| | | }).addTo(featureGroup).bringToBack() |
| | | }).addTo(featureGroup) |
| | | if (Object.prototype.hasOwnProperty.call(res, 'features') && res.features.length > 0 && (res.features[0].geometry.type === 'LineString' || res.features[0].geometry.type === 'MultiLineString')) { |
| | | geojson.bringToBack() |
| | | } else { |
| | | geojson.bringToFront() |
| | | } |
| | | return featureGroup |
| | | } |
| | | |
| | |
| | | }, |
| | | handleLocation (val) { |
| | | console.log(val) |
| | | const bound = this.L.geoJSON([val], {}).getBounds() |
| | | console.log(bound) |
| | | this.$store.state.map.flyToBounds(bound) |
| | | } |
| | | } |
| | | } |