Skip to content

Commit

Permalink
[BUILD]
Browse files Browse the repository at this point in the history
  • Loading branch information
Viglino committed Jun 26, 2024
1 parent e910631 commit c418f9c
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 38 deletions.
96 changes: 59 additions & 37 deletions dist/ol-ext.js
Original file line number Diff line number Diff line change
Expand Up @@ -34148,21 +34148,13 @@ ol.layer.Vector3D = class ollayerVector3D extends ol.layer.Image {
this.height_ = this.toHeight_
}
}
var ratio = e.frameState.pixelRatio
var ratio = this._ratio = e.frameState.pixelRatio
var ctx = e.context
var m = this.matrix_ = e.frameState.coordinateToPixelTransform
// Old version (matrix)
if (!m) {
m = e.frameState.coordinateToPixelMatrix,
m[2] = m[4]
m[3] = m[5]
m[4] = m[12]
m[5] = m[13]
}
this.center_ = [
ctx.canvas.width * this.get('center')[0] / ratio,
ctx.canvas.height * this.get('center')[1] / ratio
]
this.matrix_ = e.frameState.coordinateToPixelTransform
this.inversePixelTransform_ = e.inversePixelTransform;
if (e.frameState.size) {
this.center_ = [e.frameState.size[0] / 2, e.frameState.size[1]]
}
var f = this._source.getFeaturesInExtent(e.frameState.extent)
ctx.save()
ctx.scale(ratio, ratio)
Expand Down Expand Up @@ -34243,12 +34235,30 @@ ol.layer.Vector3D = class ollayerVector3D extends ol.layer.Image {
pt[0] * this.matrix_[0] + pt[1] * this.matrix_[1] + this.matrix_[4],
pt[0] * this.matrix_[2] + pt[1] * this.matrix_[3] + this.matrix_[5]
]
var p1 = [
p0[0] + h / this.res_ * (p0[0] - this.center_[0]),
p0[1] + h / this.res_ * (p0[1] - this.center_[1])
]
var version = parseFloat(ol.util.VERSION);
// [email protected]+
if (version > 9.0) {
p0 = [
p0[0] * this.inversePixelTransform_[0] - p0[1] * this.inversePixelTransform_[1] + this.inversePixelTransform_[4],
- p0[0] * this.inversePixelTransform_[2] + p0[1] * this.inversePixelTransform_[3] + this.inversePixelTransform_[5]
]
p1 = [
p1[0] * this.inversePixelTransform_[0] - p1[1] * this.inversePixelTransform_[1] + this.inversePixelTransform_[4],
- p1[0] * this.inversePixelTransform_[2] + p1[1] * this.inversePixelTransform_[3] + this.inversePixelTransform_[5]
]
return {
p0: [p0[0]/this._ratio, p0[1]/this._ratio],
p1: [p1[0]/this._ratio, p1[1]/this._ratio]
}
}
// Old versions
return {
p0: p0,
p1: [
p0[0] + h / this.res_ * (p0[0] - this.center_[0]),
p0[1] + h / this.res_ * (p0[1] - this.center_[1])
]
p1: p1
}
}
/** Get a vector 3D for a feature
Expand Down Expand Up @@ -35472,18 +35482,12 @@ ol.render3D = class olrender3D extends ol.Object {
this.height_ = this.toHeight_
}
}
var ratio = e.frameState.pixelRatio
var ratio = this._ratio = e.frameState.pixelRatio
var ctx = e.context
var m = this.matrix_ = e.frameState.coordinateToPixelTransform
// Old version (matrix)
if (!m) {
m = e.frameState.coordinateToPixelMatrix,
m[2] = m[4]
m[3] = m[5]
m[4] = m[12]
m[5] = m[13]
}
this.center_ = [ctx.canvas.width / 2 / ratio, ctx.canvas.height / ratio]
this.matrix_ = e.frameState.coordinateToPixelTransform
this.inversePixelTransform_ = e.inversePixelTransform;
// this.center_ = [ctx.canvas.width / 2 / ratio, ctx.canvas.height / ratio]
this.center_ = [e.frameState.size[0] / 2, e.frameState.size[1]]
var f = this.layer_.getSource().getFeaturesInExtent(e.frameState.extent)
ctx.save()
ctx.scale(ratio, ratio)
Expand All @@ -35494,13 +35498,13 @@ ol.render3D = class olrender3D extends ol.Object {
var builds = []
for (var i = 0; i < f.length; i++) {
var h = this.getFeatureHeight(f[i])
if (h)
builds.push(this.getFeature3D_(f[i], h))
if (h) builds.push(this.getFeature3D_(f[i], h))
}
if (this.get('ghost'))
if (this.get('ghost')) {
this.drawGhost3D_(ctx, builds)
else
} else {
this.drawFeature3D_(ctx, builds)
}
ctx.restore()
}
/** Set layer to render 3D
Expand Down Expand Up @@ -35576,12 +35580,30 @@ ol.render3D = class olrender3D extends ol.Object {
pt[0] * this.matrix_[0] + pt[1] * this.matrix_[1] + this.matrix_[4],
pt[0] * this.matrix_[2] + pt[1] * this.matrix_[3] + this.matrix_[5]
]
var p1 = [
p0[0] + h / this.res_ * (p0[0] - this.center_[0]),
p0[1] + h / this.res_ * (p0[1] - this.center_[1])
]
var version = parseFloat(ol.util.VERSION);
// [email protected]+
if (version > 9.0) {
p0 = [
p0[0] * this.inversePixelTransform_[0] - p0[1] * this.inversePixelTransform_[1] + this.inversePixelTransform_[4],
- p0[0] * this.inversePixelTransform_[2] + p0[1] * this.inversePixelTransform_[3] + this.inversePixelTransform_[5]
]
p1 = [
p1[0] * this.inversePixelTransform_[0] - p1[1] * this.inversePixelTransform_[1] + this.inversePixelTransform_[4],
- p1[0] * this.inversePixelTransform_[2] + p1[1] * this.inversePixelTransform_[3] + this.inversePixelTransform_[5]
]
return {
p0: [p0[0]/this._ratio, p0[1]/this._ratio],
p1: [p1[0]/this._ratio, p1[1]/this._ratio]
}
}
// Old versions
return {
p0: p0,
p1: [
p0[0] + h / this.res_ * (p0[0] - this.center_[0]),
p0[1] + h / this.res_ * (p0[1] - this.center_[1])
]
p1: p1
}
}
/** Get drawing
Expand Down
2 changes: 1 addition & 1 deletion dist/ol-ext.min.js

Large diffs are not rendered by default.

0 comments on commit c418f9c

Please sign in to comment.