| 11 | */ |
| 12 | export var MapExtend = function () { |
| 13 | const fun = function (layer, coordinate, resolution, callback, pixel, e) { |
| 14 | if (layer instanceof LayerGroup) { |
| 15 | layer.getLayers().forEach(function (subLayer) { |
| 16 | fun(subLayer, coordinate, resolution, callback, pixel, e) |
| 17 | }); |
| 18 | } else { |
| 19 | //当前高效率点图层满足筛选条件/并且可视时,可被选中: |
| 20 | if (layer.getSource()._forEachFeatureAtCoordinate) { |
| 21 | layer.getSource()._forEachFeatureAtCoordinate(coordinate, resolution, (feature) => { |
| 22 | callback(feature, layer) |
| 23 | }, pixel, e); |
| 24 | } |
| 25 | } |
| 26 | } |
| 27 | olMap.prototype.forEachFeatureAtPixelDefault = olMap.prototype.forEachFeatureAtPixel; |
| 28 | |
| 29 | olMap.prototype.forEachFeatureAtPixel = olMap.prototype.Tc = function (pixel, callback, opt_options, e) { |