Currently working with Snap.svg, my aim is to include a background image on a polygon shape.
The specific polygon in question is outlined as follows:
<svg id="test" height="600" width="600" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="" class=""></svg>
var polygon = s.polyline(200, 286, 250, 200, 350, 200, 400, 286, 350, 373, 250, 373);
I have experimented with various methods to set the background image, but none seem to be effective:
polygon.attr(
{
fill: 'url(http://csshexagon.com/img/meow.jpg)'
});
polygon.attr('xlink:href', 'url(http://csshexagon.com/img/meow.jpg)');
If anyone has any suggestions or solutions, I would greatly appreciate it. Thank you.