Skip to content

Commit

Permalink
Fix issues when serializing ol icons for printing
Browse files Browse the repository at this point in the history
  • Loading branch information
marcjansen committed Dec 15, 2022
1 parent d3dd7c3 commit 5d4945d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/data/serializer/Vector.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,10 @@ Ext.define('GeoExt.data.serializer.Vector', {
} else if (imageStyle instanceof ol.style.Icon) {
var src = imageStyle.getSrc();
if (Ext.isDefined(src)) {
var img = imageStyle.getImage();
var img = imageStyle.getImage(window.devicePixelRatio || 1);
var canvas = document.createElement('canvas');
canvas.width = img.naturalWidth;
canvas.height = img.naturalHeight;
canvas.width = img.naturalWidth || img.width;
canvas.height = img.naturalHeight || img.height;
canvas.getContext('2d').drawImage(img, 0, 0);
var format = 'image/' + src.match(/\.(\w+)$/)[1];
symbolizer = {
Expand Down

0 comments on commit 5d4945d

Please sign in to comment.