diff options
Diffstat (limited to 'modern/src')
-rw-r--r-- | modern/src/index.js | 4 | ||||
-rw-r--r-- | modern/src/map/core/Map.js | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/modern/src/index.js b/modern/src/index.js index 63f2b66c..cb6710d5 100644 --- a/modern/src/index.js +++ b/modern/src/index.js @@ -9,10 +9,12 @@ import * as serviceWorker from './serviceWorker'; import store from './store'; import { LocalizationProvider } from './common/components/LocalizationProvider'; +const base = window.location.href.indexOf('modern') >= 0 ? '/modern' : null; + ReactDOM.render(( <Provider store={store}> <LocalizationProvider> - <BrowserRouter> + <BrowserRouter basename={base}> <App /> </BrowserRouter> </LocalizationProvider> diff --git a/modern/src/map/core/Map.js b/modern/src/map/core/Map.js index aee72312..cd7b8988 100644 --- a/modern/src/map/core/Map.js +++ b/modern/src/map/core/Map.js @@ -45,14 +45,14 @@ const updateReadyValue = (value) => { const initMap = async () => { if (ready) return; if (!map.hasImage('background')) { - const background = await loadImage('/images/background.svg'); + const background = await loadImage('images/background.svg'); map.addImage('background', await prepareIcon(background), { pixelRatio: window.devicePixelRatio, }); await Promise.all(deviceCategories.map(async (category) => { const results = []; ['positive', 'negative', 'neutral'].forEach((color) => { - results.push(loadImage(`/images/icon/${category}.svg`).then((icon) => { + results.push(loadImage(`images/icon/${category}.svg`).then((icon) => { map.addImage(`${category}-${color}`, prepareIcon(background, icon, palette.colors[color]), { pixelRatio: window.devicePixelRatio, }); |