Skip to content

Commit

Permalink
#485 Fix image_overlay updateVectorLayer flickering
Browse files Browse the repository at this point in the history
  • Loading branch information
tariqksoliman committed Feb 1, 2024
1 parent e72b204 commit 9039507
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 46 deletions.
26 changes: 0 additions & 26 deletions src/essence/essence.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,32 +507,6 @@ var essence = {
mmgisAPI_.fina(Map_)

stylize()

let offsetI = 0
setInterval(() => {
//return
window.mmgisAPI.updateVectorLayer(
'Waypoints',
{
type: 'Feature',
properties: {
sol: 0,
site: 0,
pos: 0,
yaw_rad: (90 * Math.PI) / 180,
},
geometry: {
type: 'Point',
coordinates: [
137.35500231 + offsetI * 0.00006,
-4.699734,
],
},
},
3
)
offsetI++
}, 5000)
}
},
}
Expand Down
23 changes: 3 additions & 20 deletions src/external/Leaflet/leaflet-imagetransform.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@
this._imgNode = L.DomUtil.create('img')
if (this.options.clip) {
if (cache?.canvas) {
this._cached = true
this._canvas = this._cloneCanvas(cache.canvas)
this._canvas.style['transform-origin'] = '0px 0px'
this._imgNode = cache.imgNode
this._imgNode.style[L.DomUtil.TRANSFORM_ORIGIN] = '0 0'
this._image.appendChild(this._canvas)
Expand All @@ -115,25 +117,6 @@
this._imgNode.style.display = 'none'
}

/*
if (cacheCanvas) {
this._canvas = this._cloneCanvas(cacheCanvas)
this._image.appendChild(this._canvas)
this._onImageLoad(false)
} else {
this._image.appendChild(this._imgNode)
this._imgNode.style[L.DomUtil.TRANSFORM_ORIGIN] = '0 0'
// Hide imgNode until image has loaded
this._imgNode.style.display = 'none'
this._canvas = L.DomUtil.create(
'canvas',
'leaflet-canvas-transform'
)
*/

this._updateOpacity()

//TODO createImage util method to remove duplication
Expand Down Expand Up @@ -176,7 +159,7 @@
) {
LImageTransformCache[this.options.id] = {
canvas: this._cloneCanvas(this._drawCanvasCache()),
imgNode: this._imgNode,
imgNode: this._imgNode.cloneNode(),
}
}
}
Expand Down

0 comments on commit 9039507

Please sign in to comment.