Skip to content

Commit

Permalink
updated canvasTiles example
Browse files Browse the repository at this point in the history
  • Loading branch information
Zemledelec committed Oct 18, 2021
1 parent 154be17 commit a8a5c6d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions canvasTiles/canvasTiles.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,18 @@
'attribution': 'Data @ OpenStreetMap contributors, ODbL'
});

let cnv = document.createElement("canvas");
let ctx = cnv.getContext("2d");
cnv.width = 256;
cnv.height = 256;

const tg = new og.layer.CanvasTiles("Tile grid", {
visibility: true,
isBaseLayer: false,
drawTile: function (material, applyCanvas) {
drawTile: function (material, applyCanvas) {

//
// This is important to create canvas here!
//
let cnv = document.createElement("canvas");
let ctx = cnv.getContext("2d");
cnv.width = 256;
cnv.height = 256;

//Clear canvas
ctx.clearRect(0, 0, cnv.width, cnv.height);
Expand Down

0 comments on commit a8a5c6d

Please sign in to comment.