leaflet-polygon-fillPattern icon indicating copy to clipboard operation
leaflet-polygon-fillPattern copied to clipboard

Impossible to customize url dress

Open Kernonen opened this issue 5 years ago • 1 comments

Hello thanks to your plugin !

When I give fill a constant value like fill:'url(image.gif)' it works

But when I try to make it with a variable, it doesn't work (can't find the texture) var imageName = image; fill:'url('+imageName+'.gif)'

I can't get the syntax right

Kernonen avatar Jan 14 '20 19:01 Kernonen

Did you try using quotes around image name?

var imageName = 'image';
var styleDefinition = {
  fill: 'url(' + imageName + '.gif)'
};

Works in Chrome console

image

Deele avatar May 19 '20 09:05 Deele