|
@@ -8,21 +8,16 @@ import ReactMapboxGl, {
|
|
|
Marker
|
|
|
} from 'react-mapbox-gl';
|
|
|
import mapboxToken from './config/mapboxToken.js';
|
|
|
+import {longitude, latitude, testPath, mapWidth, mapHeight, markerIcon} from "./config/variables";
|
|
|
|
|
|
-const LONGITUDE = 14.320570
|
|
|
-const LATITUDE = 48.336950
|
|
|
const Map = ReactMapboxGl({ accessToken: mapboxToken });
|
|
|
-const ICON = `M20.2,15.7L20.2,15.7c1.1-1.6,1.8-3.6,1.8-5.7c0-5.6-4.5-10-10-10S2,4.5,2,10c0,2,0.6,3.9,1.6,5.4c0,0.1,0.1,0.2,0.2,0.3
|
|
|
- c0,0,0.1,0.1,0.1,0.2c0.2,0.3,0.4,0.6,0.7,0.9c2.6,3.1,7.4,7.6,7.4,7.6s4.8-4.5,7.4-7.5c0.2-0.3,0.5-0.6,0.7-0.9
|
|
|
- C20.1,15.8,20.2,15.8,20.2,15.7z`;
|
|
|
-
|
|
|
|
|
|
export default class Mapbox extends React.Component{
|
|
|
state = {
|
|
|
- latitude: LATITUDE,
|
|
|
- longitude: LONGITUDE,
|
|
|
+ latitude: latitude,
|
|
|
+ longitude: longitude,
|
|
|
zoom: [15],
|
|
|
- path: [[48.295742, 14.286967], [48.328529, 14.322428]],
|
|
|
+ path: testPath,
|
|
|
distance: 0
|
|
|
}
|
|
|
|
|
@@ -32,8 +27,8 @@ export default class Mapbox extends React.Component{
|
|
|
<Map
|
|
|
style="mapbox://styles/mapbox/streets-v9"
|
|
|
containerStyle={{
|
|
|
- height: '400',
|
|
|
- width: '600'
|
|
|
+ height: mapHeight,
|
|
|
+ width: mapWidth
|
|
|
}}
|
|
|
center={position}
|
|
|
zoom={this.state.zoom}
|
|
@@ -47,7 +42,7 @@ export default class Mapbox extends React.Component{
|
|
|
anchor="bottom"
|
|
|
>
|
|
|
<svg height={20} viewBox="0 0 24 24" style={{fill: "#343a40", stroke: "none"}}>
|
|
|
- <path d={ICON} />
|
|
|
+ <path d={markerIcon} />
|
|
|
</svg>
|
|
|
</Marker>
|
|
|
|