From d68290932dcb0fb05c04bce06d1cd3e856ce59b2 Mon Sep 17 00:00:00 2001 From: Neil Rotstan Date: Wed, 12 Jun 2019 13:55:57 -0700 Subject: [PATCH] Set `viewBox` attribute on svg Fixes #2 --- L.VectorIcon.js | 1 + 1 file changed, 1 insertion(+) diff --git a/L.VectorIcon.js b/L.VectorIcon.js index 2a27514..38ea6f7 100644 --- a/L.VectorIcon.js +++ b/L.VectorIcon.js @@ -35,6 +35,7 @@ L.VectorIcon = L.Icon.extend({ svg.setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink"); svg.setAttribute('height', options.svgHeight + ''); svg.setAttribute('width', options.svgWidth + ''); + svg.setAttribute('viewBox', options.viewBox + ''); svg.style.marginTop = (options.svgHeight/2 - 6) * -1 + 'px'; svg.style.marginLeft = (options.svgWidth/2 - 6) * -1 + 'px';