Skip to content

Commit 075023b

Browse files
committed
fix: onInit
1 parent b11e7cd commit 075023b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

docs/configure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ There are many places where you can find open data sources serving information G
6464

6565
GEOComp exposes events that can be used within lowcoder. Just click on the `+Add` to add one of the events below. All events can always use `geo1.event` to access the last event information.
6666

67-
- `onInit` - Is fired when the Map initialized. `Event` variable contains the `map object`
67+
- `onInit` - Is fired when the Map initialized. `Event` variable contains the `map object` **use a bounce 0.1s** when catching this event
6868
- `onLoad` - Is fired when a Layers has finished (partial )loaded data
6969
- `onModify` - Is fired when a there is a feature added/modified/deleted on the draw layer
7070
- `onTimeline` - Is fired when user moves the timeline

src/vendors/Geo.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,8 @@ function Geo(props) {
725725

726726
//Add map init event
727727
map.once('rendercomplete', () => {
728-
fireEvent('map:init', map)
728+
//Detach from event
729+
setTimeout(() => { fireEvent('map:init', map) }, 100)
729730
})
730731
}
731732
}, [props.features, props.projection, props.startDate, props.endDate, map]);

0 commit comments

Comments
 (0)