Skip to content

Commit

Permalink
fix GroupGLLayer child Layer not fire identifyempty event (#2058)
Browse files Browse the repository at this point in the history
* fix GroupGLLayer child Layer not fire identifyempty event

* fix typo

* update
  • Loading branch information
deyihu authored Aug 21, 2023
1 parent 10d8f76 commit 2093395
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/map/Map.Topo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { INTERNAL_LAYER_PREFIX } from '../core/Constants';
import { isNil, isString, isArrayHasData, pushIn } from '../core/util';
import { isNil, isString, isArrayHasData, pushIn, isFunction } from '../core/util';
import Coordinate from '../geo/Coordinate';
import Point from '../geo/Point';
import Map from './Map';
Expand Down Expand Up @@ -123,6 +123,15 @@ Map.include(/** @lends Map.prototype */ {
//fire layer identify empty event
if ((!result || !result.length)) {
layer.fire('identifyempty', opts);
//such as GroupGLLayer
if (layer.getLayers && isFunction(layer.getLayers)) {
const layers = (layer.getLayers() || []).filter(childLayer => {
return childLayer;
});
layers.forEach(childLayer => {
childLayer.fire('identifyempty', opts);
});
}
}
return result;
});
Expand Down

0 comments on commit 2093395

Please sign in to comment.