diff options
author | Abyss777 <abyss@fox5.ru> | 2016-11-08 11:49:00 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-11-08 11:49:00 +0500 |
commit | 8b5bbc7a899205a40e1d246862f54ecb4b939682 (patch) | |
tree | 071387887d5900cfcdcbbfbcc7fda4f4b0f35c1d /web/load.js | |
parent | 97fd53f33b92e334e6094edb340ea551a44d136e (diff) | |
download | trackermap-web-8b5bbc7a899205a40e1d246862f54ecb4b939682.tar.gz trackermap-web-8b5bbc7a899205a40e1d246862f54ecb4b939682.tar.bz2 trackermap-web-8b5bbc7a899205a40e1d246862f54ecb4b939682.zip |
Load SVGs to html
Diffstat (limited to 'web/load.js')
-rw-r--r-- | web/load.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/web/load.js b/web/load.js index f4987acd..7f0caf9d 100644 --- a/web/load.js +++ b/web/load.js @@ -14,6 +14,15 @@ script.async = false document.head.appendChild(script); } + + function addSvgFile(file, id) { + var svg = document.createElement('object'); + svg.setAttribute('id', id); + svg.setAttribute('data', file); + svg.setAttribute('type', 'image/svg+xml'); + svg.setAttribute('style','visibility:hidden') + document.body.appendChild(svg); + } var debugMode = document.getElementById('loadScript').getAttribute('mode') === 'debug'; var touchMode = 'ontouchstart' in window || navigator.maxTouchPoints; @@ -119,6 +128,11 @@ addScriptFile('//cdnjs.cloudflare.com/ajax/libs/ol3/' + olVersion + '/ol-debug.js'); addStyleFile('app.css'); - addScriptFile('arrow.js'); + //addScriptFile('arrow.js'); + + addSvgFile('images/arrow.svg', 'arrowSvg'); + addSvgFile('images/car.svg', 'carSvg'); + addSvgFile('images/bus.svg', 'busSvg'); + addSvgFile('images/truck.svg', 'truckSvg'); })(); |