Skip to content

Commit ba8c365

Browse files
committed
fix: connected init to rendercompleted
1 parent a06690d commit ba8c365

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

docs/images/tutorial-step2.png

14.1 KB
Loading

docs/tutorial.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ Now scroll down to behavior section of the properties and toggle the following i
2323
Add an new interaction by clicking `+Add` on the right side of Event Handlers. Select the `onModify` event and for Action `Run Javascript`. Copy the javascript below into the script field. Set the bounce to 0.5s to reduce the number of modify events
2424

2525
```js
26-
localStorage.setItem('draw',geo1.getFeatures('draw'))
26+
geo1.getFeatures('draw').then((features)=>{
27+
localStorage.setItem('draw',features)})
2728
})
2829
```
2930
<br clear="right"/>

src/vendors/Geo.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ function Geo(props) {
723723
loadLayers(map)
724724

725725
//Add map init event
726-
fireEvent('map:init', map);
726+
map.once('rendercomplete', () => { fireEvent('map:init', map) })
727727
}
728728
}, [props.features, props.projection, props.startDate, props.endDate, map]);
729729

0 commit comments

Comments
 (0)