@evergis/sgis
Advanced tools
Comparing version 0.5.0-alpha.15 to 0.5.0-alpha.16
@@ -42,2 +42,3 @@ import { IPoint } from "./Point"; | ||
export declare const projectRings: (rings: [number, number][][], fromCrs: Crs, toCrs: Crs) => any[]; | ||
export declare const projectPoint: (coordinates: [number, number], fromCrs: Crs, toCrs: Crs) => [number, number]; | ||
export declare const projectPoints: (ring: [number, number][], fromCrs: Crs, toCrs: Crs) => any[]; | ||
@@ -44,0 +45,0 @@ /** |
@@ -48,2 +48,3 @@ import { Container } from "./Container"; | ||
private _rerender(); | ||
private _drawVectorSync(renders, images, bbox); | ||
private _draw(renders); | ||
@@ -50,0 +51,0 @@ private _drawRender(render); |
@@ -42,2 +42,3 @@ import { IPoint } from "./Point"; | ||
export declare const projectRings: (rings: [number, number][][], fromCrs: Crs, toCrs: Crs) => any[]; | ||
export declare const projectPoint: (coordinates: [number, number], fromCrs: Crs, toCrs: Crs) => [number, number]; | ||
export declare const projectPoints: (ring: [number, number][], fromCrs: Crs, toCrs: Crs) => any[]; | ||
@@ -44,0 +45,0 @@ /** |
@@ -91,2 +91,6 @@ import { Point } from "./Point"; | ||
}; | ||
export const projectPoint = (coordinates, fromCrs, toCrs) => { | ||
const projection = fromCrs.projectionTo(toCrs); | ||
return projection(coordinates); | ||
}; | ||
export const projectPoints = function (ring, fromCrs, toCrs) { | ||
@@ -93,0 +97,0 @@ let projection = fromCrs.projectionTo(toCrs); |
@@ -48,2 +48,3 @@ import { Container } from "./Container"; | ||
private _rerender(); | ||
private _drawVectorSync(renders, images, bbox); | ||
private _draw(renders); | ||
@@ -50,0 +51,0 @@ private _drawRender(render); |
@@ -136,8 +136,23 @@ import { Canvas } from "./Canvas"; | ||
this._removeOutdatedRenders(renders); | ||
this._draw(renders); | ||
if (!this._canvas.isEmpty) { | ||
this._addCanvasToDom(bbox); | ||
const vectorImages = renders.filter(r => r instanceof StaticVectorImageRender); | ||
if (vectorImages.length > 0 && renders.length !== vectorImages.length) { | ||
this._drawVectorSync(renders, vectorImages, bbox); | ||
} | ||
this._renders = renders; | ||
else { | ||
this._draw(renders); | ||
if (!this._canvas.isEmpty) { | ||
this._addCanvasToDom(bbox); | ||
} | ||
this._renders = renders; | ||
} | ||
} | ||
_drawVectorSync(renders, images, bbox) { | ||
Promise.all(images.map(({ readyPromise }) => readyPromise)).then(() => { | ||
this._draw(renders); | ||
if (!this._canvas.isEmpty) { | ||
this._addCanvasToDom(bbox); | ||
} | ||
this._renders = renders; | ||
}); | ||
} | ||
_draw(renders) { | ||
@@ -144,0 +159,0 @@ for (let render of renders) { |
{ | ||
"name": "@evergis/sgis", | ||
"version": "0.5.0-alpha.15", | ||
"version": "0.5.0-alpha.16", | ||
"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
2758944
35124