gridviz 2.0.50 → 2.0.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gridviz",
3
- "version": "2.0.50",
3
+ "version": "2.0.51",
4
4
  "description": "Visualization tool for gridded statistics",
5
5
  "keywords": [
6
6
  "statistics",
package/src/App.js CHANGED
@@ -111,7 +111,7 @@ export class App {
111
111
  if (strong) dsc.updateViewCache(this.cg.extGeo)
112
112
 
113
113
  //set layer alpha and blend mode
114
- this.cg.ctx.globalAlpha = layer.alpha? layer.alpha(zf) : 1.0
114
+ this.cg.ctx.globalAlpha = layer.alpha ? layer.alpha(zf) : 1.0
115
115
  this.cg.ctx.globalCompositeOperation = layer.blendOperation(zf)
116
116
 
117
117
  //draw cells, style by style
@@ -124,14 +124,14 @@ export class App {
124
124
 
125
125
  //set style alpha and blend mode
126
126
  //TODO: multiply by layer alpha ?
127
- this.cg.ctx.globalAlpha = s.alpha? s.alpha(zf) : 1.0
127
+ this.cg.ctx.globalAlpha = s.alpha ? s.alpha(zf) : 1.0
128
128
  this.cg.ctx.globalCompositeOperation = s.blendOperation(zf)
129
-
129
+
130
130
  s.draw(dsc.getViewCache(), dsc.getResolution(), this.cg)
131
131
  }
132
132
 
133
133
  //add legend element
134
- if (this.legend && strong)
134
+ if (this.legend && strong) {
135
135
  for (const s of layer.styles) {
136
136
  if (zf > s.maxZoom) continue
137
137
  if (zf < s.minZoom) continue
@@ -157,6 +157,11 @@ export class App {
157
157
  }
158
158
  }
159
159
  }
160
+ }
161
+
162
+ //restore default alpha and blend operation
163
+ this.cg.ctx.globalAlpha = 1.0
164
+ this.cg.ctx.globalCompositeOperation = "normal"
160
165
  }
161
166
 
162
167
  //draw boundary layer