diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-10-02 23:11:09 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-10-02 23:11:09 +1300 |
commit | 396abfe03f85f294d911d8362b7afce5600620c6 (patch) | |
tree | c61e207a696e843f3088dfa621fea2e09a04a926 | |
parent | cabb500189f027bc64d6b62bde9cf017efa4c0d4 (diff) | |
download | trackermap-web-396abfe03f85f294d911d8362b7afce5600620c6.tar.gz trackermap-web-396abfe03f85f294d911d8362b7afce5600620c6.tar.bz2 trackermap-web-396abfe03f85f294d911d8362b7afce5600620c6.zip |
Update map icons
-rw-r--r-- | modern/public/category/car.svg | 4 | ||||
-rw-r--r-- | modern/src/MainMap.js | 13 | ||||
-rw-r--r-- | modern/src/reducers/index.js | 4 |
3 files changed, 13 insertions, 8 deletions
diff --git a/modern/public/category/car.svg b/modern/public/category/car.svg new file mode 100644 index 00000000..7dad87d2 --- /dev/null +++ b/modern/public/category/car.svg @@ -0,0 +1,4 @@ +<?xml version="1.0"?> +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff" width="24px" height="24px"> + <path d="M 10 3 C 6.16 3 4.0007812 7.3392969 3.3007812 9.0292969 C 3.2407813 9.0392969 3.1808594 9.0503125 3.1308594 9.0703125 C 3.0008594 9.1203125 8.8817842e-16 10.36 0 14 C 0 15.49 0.62039063 16.250859 1.1503906 16.630859 C 1.4534283 16.848834 1.7927087 16.933479 2.1328125 16.970703 C 2.5695992 18.706125 4.1307191 20 6 20 C 7.858438 20 9.4100868 18.720168 9.8574219 17 L 14.142578 17 C 14.589913 18.720168 16.141562 20 18 20 C 19.873415 20 21.436431 18.700223 21.869141 16.958984 C 23.171684 16.837562 24 16.373111 24 15 L 24 13 C 24 10.28 21.099922 9.0291406 18.919922 8.6191406 C 18.879922 8.5391406 18.839297 8.4508594 18.779297 8.3808594 C 16.769297 5.8608594 14.48 3 10 3 z M 11 5.0800781 C 13.58 5.4100781 15.120938 7.04 16.710938 9 L 11 9 L 11 5.0800781 z M 9 5.1894531 L 9 9 L 5.5195312 9 C 6.1595313 7.68 7.36 5.7694531 9 5.1894531 z M 6 14 C 7.103 14 8 14.897 8 16 C 8 17.103 7.103 18 6 18 C 4.897 18 4 17.103 4 16 C 4 14.897 4.897 14 6 14 z M 18 14 C 19.103 14 20 14.897 20 16 C 20 17.103 19.103 18 18 18 C 16.897 18 16 17.103 16 16 C 16 14.897 16.897 14 18 14 z" fill="#ffffff"/> +</svg> diff --git a/modern/src/MainMap.js b/modern/src/MainMap.js index fab17777..5a096c53 100644 --- a/modern/src/MainMap.js +++ b/modern/src/MainMap.js @@ -18,10 +18,11 @@ class MainMap extends Component { const position = [this.state.lat, this.state.lng] const markers = this.props.positions.map(position => - <DivIcon position={{ lat: position.latitude, lng: position.longitude }} className="" iconSize={[38, 95]}> - <svg className="user-location" viewBox="0 0 120 120" version="1.1" - xmlns="http://www.w3.org/2000/svg"> - <text x="20" y="60" style={{fontSize: '48px'}}>TEST</text> + <DivIcon key={position.id.toString()} position={{ lat: position.latitude, lng: position.longitude }} className="" iconSize={[50, 50]}> + <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 50 50"> + <circle cx="25" cy="25" r="20" stroke="#fff" stroke-width="2.5" fill="#008000" /> + <path d="m25 5v5" stroke="#fff" stroke-width="2.5" /> + <image x="13" y="13" fill="#fff" href="/category/car.svg" /> </svg> </DivIcon> ); @@ -29,8 +30,8 @@ class MainMap extends Component { return ( <Map style={{height: this.props.height, width: this.props.width}} center={position} zoom={this.state.zoom}> <TileLayer - attribution='© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="https://carto.com/attributions">CARTO</a>' - url="https://cartodb-basemaps-a.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png" /> + attribution="© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors" + url="https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png" /> {markers} </Map> ) diff --git a/modern/src/reducers/index.js b/modern/src/reducers/index.js index 962d83c2..ac592bfe 100644 --- a/modern/src/reducers/index.js +++ b/modern/src/reducers/index.js @@ -9,12 +9,12 @@ function rootReducer(state = initialState, action) { case 'UPDATE_DEVICES': return Object.assign({}, { ...state, - devices: [...state.devices, ...action.devices] + devices: [...action.devices] }); case 'UPDATE_POSITIONS': return Object.assign({}, { ...state, - positions: [...state.positions, ...action.positions] + positions: [...action.positions] }); default: return state; |