Commit fc8d097b authored by Deployer's avatar Deployer

Fix imagePath url generation in SDK

parent 397d2754
......@@ -68,8 +68,6 @@
<div id='map' class='map'> </div>
<script>
window.L.Icon.Default.imagePath = '../dist/v1.4.1/images/images';
try {
L.cedarmaps.accessToken = accessToken;
} catch (err) {
......
......@@ -60,8 +60,6 @@
<div id="response"></div>
</div>
<script>
window.L.Icon.Default.imagePath ='../dist/v1.6.0/images/';
try {
L.cedarmaps.accessToken = accessToken;
}
......
......@@ -26,4 +26,7 @@ module.exports = L.cedarmaps;
window.L.Icon.Default.imagePath =
// Detect bad-news protocols like file:// and hardcode
// to https if they're detected.
'dist/v1.0.0/images/images';
\ No newline at end of file
((document.location.protocol === 'https:' ||
document.location.protocol === 'http:') ? '' : 'https:') +
'//api.cedarmaps.com/cedarmaps.js/' + 'v' +
require('../package.json').version + '/images/';
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment