Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion common/DrawHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,11 @@ caDrawHelper.prototype.drawPolygon = function(ctx, paths){
caDrawHelper.prototype.draw = function(ctx, image_data){
for (let i = 0; i < image_data.length; i++) {
const polygon = image_data[i];
if (polygon.properties == undefined || polygon.properties == null){
polygon.properties = {}
}
const style = polygon.properties.style;

// if there is path using path to draw
// if(polygon.geometry.path){
// ctx.fillStyle = hexToRgbA(style.color,0.5);
Expand Down Expand Up @@ -287,6 +290,9 @@ caDrawHelper.prototype.doesDraw = function(bbox, ctx){

caDrawHelper.prototype.drawGrids = function(ctx, image_data){
image_data.forEach(polygon =>{
if (polygon.properties == undefined || polygon.properties == null){
polygon.properties = {}
}
const style = polygon.properties.style;
const size = polygon.properties.size;
//this.setStyle(ctx, style);
Expand All @@ -297,6 +303,9 @@ caDrawHelper.prototype.drawGrids = function(ctx, image_data){
})
}
caDrawHelper.prototype.drawGrid = function(ctx, polygon){
if (polygon.properties == undefined || polygon.properties == null){
polygon.properties = {}
}
const style = polygon.properties.style;
const size = polygon.properties.size;
//this.setStyle(ctx, style);
Expand Down Expand Up @@ -330,6 +339,14 @@ caDrawHelper.prototype.drawGrid = function(ctx, polygon){
* how the end points of every line are drawn. There are three possible values: 'butt', 'round' and 'square'
*/
caDrawHelper.prototype.setStyle = function(ctx,style){
if (style == undefined || style == null){
style = {
"color":"#fccde5",
"lineJoin":"round",
"lineCap":"round",
"isFill":true
};
}
ctx.strokeStyle = style.color;
ctx.lineJoin = style.lineJoin;
ctx.lineCap = style.lineCap;
Expand Down
Loading