@evergis/sgis
Advanced tools
Comparing version 0.5.0-alpha.24 to 0.5.0-alpha.25
@@ -18,2 +18,3 @@ import { HTMLRasterElement, Offset } from "../baseTypes"; | ||
private _src; | ||
private _aborted; | ||
offset: Offset; | ||
@@ -32,2 +33,3 @@ onLoad?: () => void; | ||
set opacity(value: number); | ||
deleteNode(): void; | ||
} |
@@ -63,4 +63,4 @@ import { PolyControl } from "./controls/PolyControl"; | ||
export { Control } from "./controls/Control"; | ||
export declare const version = "0.5.0-alpha.24"; | ||
export declare const releaseDate = "27.07.2022"; | ||
export declare const version = "0.5.0-alpha.25"; | ||
export declare const releaseDate = "03.08.2022"; | ||
export declare const controls: { | ||
@@ -67,0 +67,0 @@ Circle: typeof Circle; |
@@ -66,2 +66,4 @@ import { debounce } from '../utils/utils'; | ||
_snappingHandle(event) { | ||
if (!this._activeFeature) | ||
return; | ||
const snappingResult = this._snap(event.point.position, event.browserEvent.altKey); | ||
@@ -68,0 +70,0 @@ Promise.resolve(snappingResult).then((point) => { |
@@ -86,2 +86,4 @@ import { debounce } from '../utils/utils'; | ||
let mousemoveEvent = event; | ||
this._unsnap(); | ||
this._debouncedSnappingHandle(mousemoveEvent); | ||
if (!this._activeFeature) | ||
@@ -95,17 +97,20 @@ return; | ||
this._tempLayer.redraw(); | ||
this._unsnap(); | ||
this.fire(new ChangeEvent(ringIndex, pointIndex)); | ||
this._debouncedSnappingHandle(mousemoveEvent); | ||
} | ||
_snappingHandle(event) { | ||
let ringIndex = this._activeFeature.rings.length - 1; | ||
let pointIndex = this._activeFeature.rings[ringIndex].length - 1; | ||
const snappingResult = this._snap(event.point.position, event.browserEvent.altKey, this._activeFeature.rings[ringIndex], pointIndex, this._activeFeature.isEnclosed); | ||
Promise.resolve(snappingResult).then((point) => { | ||
this._activeFeature.rings[ringIndex][pointIndex] = point || event.point.position; | ||
this._activeFeature.redraw(); | ||
if (this._tempLayer) | ||
this._tempLayer.redraw(); | ||
this.fire(new ChangeEvent(ringIndex, pointIndex)); | ||
}); | ||
if (this._activeFeature) { | ||
let ringIndex = this._activeFeature.rings.length - 1; | ||
let pointIndex = this._activeFeature.rings[ringIndex].length - 1; | ||
const snappingResult = this._snap(event.point.position, event.browserEvent.altKey, this._activeFeature.rings[ringIndex], pointIndex, this._activeFeature.isEnclosed); | ||
Promise.resolve(snappingResult).then((point) => { | ||
this._activeFeature.rings[ringIndex][pointIndex] = point || event.point.position; | ||
this._activeFeature.redraw(); | ||
if (this._tempLayer) | ||
this._tempLayer.redraw(); | ||
this.fire(new ChangeEvent(ringIndex, pointIndex)); | ||
}); | ||
} | ||
else { | ||
this._snap(event.point.position, event.browserEvent.altKey); | ||
} | ||
} | ||
@@ -112,0 +117,0 @@ _handleDblclick(event) { |
@@ -168,2 +168,4 @@ var __rest = (this && this.__rest) || function (s, e) { | ||
_snappingHandle(event) { | ||
if (!this._activeFeature) | ||
return; | ||
const snappingResult = this._snap(event.point.position, event.browserEvent.altKey, this._activeFeature.rings[this._activeRing], this._activeIndex, this._activeFeature instanceof Polygon); | ||
@@ -170,0 +172,0 @@ Promise.resolve(snappingResult).then((point) => { |
@@ -32,3 +32,3 @@ import { Layer, LayerErrorEvent, PropertyChangeEvent } from "./Layer"; | ||
} | ||
if (this._nextRender !== this._currentRender && this._nextRender.isReady) { | ||
if (this._nextRender !== this._currentRender && this._nextRender && this._nextRender.isReady) { | ||
this._currentRender = this._nextRender; | ||
@@ -63,2 +63,8 @@ } | ||
else { | ||
if (this._nextRender && !this._nextRender.isReady) { | ||
this._nextRender.deleteNode(); | ||
// create new new StaticHtmlImageRender | ||
this._nextRender = this._currentRender; | ||
this._loadNextRender(bbox, resolution); | ||
} | ||
this._toLoad = { bbox, resolution }; | ||
@@ -65,0 +71,0 @@ } |
@@ -151,3 +151,3 @@ var __rest = (this && this.__rest) || function (s, e) { | ||
if (indexDoesNotExistInCurrentBBox && itIsImageNodeNotLoaded) { | ||
tile.node.src = ""; | ||
tile.deleteNode(); | ||
delete this._tileCache[tileId]; | ||
@@ -154,0 +154,0 @@ } |
@@ -18,2 +18,3 @@ import { HTMLRasterElement, Offset } from "../baseTypes"; | ||
private _src; | ||
private _aborted; | ||
offset: Offset; | ||
@@ -32,2 +33,3 @@ onLoad?: () => void; | ||
set opacity(value: number); | ||
deleteNode(): void; | ||
} |
@@ -13,2 +13,3 @@ import { StaticRender } from "./Render"; | ||
this._src = src; | ||
this._aborted = false; | ||
this._createNode(); | ||
@@ -24,3 +25,8 @@ } | ||
this.readyPromise = loadImage(this._node, this._src); | ||
this.readyPromise.then(this.onLoad).catch(this.onError); | ||
this.readyPromise.then(this.onLoad).catch((error) => { | ||
if (this._aborted) { | ||
return; | ||
} | ||
this.onError(error); | ||
}); | ||
} | ||
@@ -51,2 +57,8 @@ get node() { | ||
} | ||
deleteNode() { | ||
this._aborted = true; | ||
if (this._node) { | ||
this._node.src = ""; | ||
} | ||
} | ||
} |
@@ -63,4 +63,4 @@ import { PolyControl } from "./controls/PolyControl"; | ||
export { Control } from "./controls/Control"; | ||
export declare const version = "0.5.0-alpha.24"; | ||
export declare const releaseDate = "27.07.2022"; | ||
export declare const version = "0.5.0-alpha.25"; | ||
export declare const releaseDate = "03.08.2022"; | ||
export declare const controls: { | ||
@@ -67,0 +67,0 @@ Circle: typeof Circle; |
@@ -65,4 +65,4 @@ import { PolyControl } from "./controls/PolyControl"; | ||
export { Control } from "./controls/Control"; | ||
export const version = "0.5.0-alpha.24"; | ||
export const releaseDate = "27.07.2022"; | ||
export const version = "0.5.0-alpha.25"; | ||
export const releaseDate = "03.08.2022"; | ||
let utilsModulesExt = {}; | ||
@@ -69,0 +69,0 @@ Object.assign(utilsModulesExt, utilsModule, { Color: Color }); |
{ | ||
"name": "@evergis/sgis", | ||
"version": "0.5.0-alpha.24", | ||
"version": "0.5.0-alpha.25", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/sGis_bundle.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
2931881
36283