aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-21 14:28:52 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-21 14:28:52 -0700
commitada1d9242961e009711e7354adbe416b87882b24 (patch)
tree964e0001825fa2dcc5c65cada18bafd2a7af7e79
parentfcaa089ea298c9067a2b09a168cb4d90c88e8b54 (diff)
downloadtrackermap-web-ada1d9242961e009711e7354adbe416b87882b24.tar.gz
trackermap-web-ada1d9242961e009711e7354adbe416b87882b24.tar.bz2
trackermap-web-ada1d9242961e009711e7354adbe416b87882b24.zip
Fix modern app issues
-rw-r--r--modern/src/index.js4
-rw-r--r--modern/src/map/core/Map.js4
-rwxr-xr-xtools/package.sh2
3 files changed, 6 insertions, 4 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,
});
diff --git a/tools/package.sh b/tools/package.sh
index 858d2405..55a01df3 100755
--- a/tools/package.sh
+++ b/tools/package.sh
@@ -11,6 +11,6 @@ npm run build
cd modern
rm -r ../web/modern
-npm install
+npm install --force
npm run build_release
mv build ../web/modern