aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-03-19 23:19:34 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-03-19 23:19:34 -0700
commitefe2c2cc2d59be87048ed12a29736a5d9eaf597f (patch)
tree0c579b38e54a6e446a5618c4da88d6320b19c7fb
parent889bc0667e21d1154ac2749842696aac0812ef8c (diff)
downloadetbsa-traccar-web-efe2c2cc2d59be87048ed12a29736a5d9eaf597f.tar.gz
etbsa-traccar-web-efe2c2cc2d59be87048ed12a29736a5d9eaf597f.tar.bz2
etbsa-traccar-web-efe2c2cc2d59be87048ed12a29736a5d9eaf597f.zip
Use raster map in production
-rw-r--r--modern/src/MainMap.js16
-rw-r--r--modern/src/MainToolbar.js4
2 files changed, 15 insertions, 5 deletions
diff --git a/modern/src/MainMap.js b/modern/src/MainMap.js
index 8b363c9..ff51b56 100644
--- a/modern/src/MainMap.js
+++ b/modern/src/MainMap.js
@@ -4,6 +4,8 @@ import { connect } from 'react-redux';
import { Map, View } from 'ol';
import { fromLonLat } from 'ol/proj';
import olms from 'ol-mapbox-style';
+import TileLayer from 'ol/layer/Tile';
+import OSM from 'ol/source/OSM';
const mapStateToProps = state => ({
positions: state.positions
@@ -15,11 +17,19 @@ class MainMap extends Component {
target: this.el,
view: new View({
constrainResolution: true,
- center: fromLonLat([14.5, 46.05]),
- zoom: 3
+ center: fromLonLat([25.65, 60.98]),
+ zoom: 9
})
});
- olms(this.map, 'https://cdn.traccar.com/map/basic.json');
+ if (location.hostname === 'localhost') {
+ olms(this.map, 'https://cdn.traccar.com/map/basic.json');
+ } else {
+ this.map.addLayer(
+ new TileLayer({
+ source: new OSM()
+ })
+ );
+ }
}
render() {
diff --git a/modern/src/MainToolbar.js b/modern/src/MainToolbar.js
index c5af9d8..6e2e4d6 100644
--- a/modern/src/MainToolbar.js
+++ b/modern/src/MainToolbar.js
@@ -97,7 +97,7 @@ class MainToobar extends Component {
</ListItemIcon>
<ListItemText primary="Dashboard" />
</ListItem>
- <ListItem button>
+ <ListItem button disabled>
<ListItemIcon>
<BarChartIcon />
</ListItemIcon>
@@ -106,7 +106,7 @@ class MainToobar extends Component {
</List>
<Divider />
<List>
- <ListItem button>
+ <ListItem button disabled>
<ListItemIcon>
<SettingsIcon />
</ListItemIcon>