Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't set opacity before layer is added to map #298

Merged
merged 1 commit into from
Mar 11, 2021

Conversation

turban
Copy link
Collaborator

@turban turban commented Mar 11, 2021

This PR avoids an app crash when the opacity is changed before the layers are added to the map. There will be a separate PR in maps-app when this PR is merged.

@turban turban requested a review from martinkrulltott March 11, 2021 13:13
@@ -415,7 +415,7 @@ class EarthEngine extends Layer {
const layerId = `${id}-polygon`
const mapgl = this.getMapGL()

if (mapgl.getLayer(layerId)) {
if (mapgl && mapgl.getLayer(layerId)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (mapgl && mapgl.getLayer(layerId)) {
if (mapgl?.getLayer(layerId)) {

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, but I don't take the risk on hard freeze day - need do be sure that it's supported by the babel setup first.

@turban turban merged commit a05e04a into master Mar 11, 2021
@turban turban deleted the fix/layer-opacity branch March 11, 2021 13:19
dhis2-bot added a commit that referenced this pull request Mar 11, 2021
## [1.8.4](v1.8.3...v1.8.4) (2021-03-11)

### Bug Fixes

* don't set opacity before layer is added to map ([#298](#298)) ([a05e04a](a05e04a))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 1.8.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants