Skip to content

Commit 3bf29d8

Browse files
authored
Merge pull request #140 from chargetrip/fix/stations-around
Fix/stations around
2 parents a0aa68b + a0689f7 commit 3bf29d8

4 files changed

Lines changed: 11 additions & 18 deletions

File tree

examples/2.stations/1.station-list/client.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ const client = createClient({
2626
/**
2727
* In this example we fetch the closest stations within a radius of 3000 meters
2828
*/
29-
export const getStations = ({ distance = 3000, power = [], amenities = [] }) => {
29+
export const getStations = ({ distance = 7000, power = [], amenities = [] }) => {
3030
return client
3131
.query(getStationsAroundQuery, {
3232
query: {
33-
location: { type: 'Point', coordinates: [10.197422, 56.171395] },
33+
location: { type: 'Point', coordinates: [9.941440543222434, 54.974349949816336] },
3434
distance,
3535
power,
3636
amenities,

examples/2.stations/1.station-list/interface.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { showCenter, showStations } from './map';
88
*/
99
const powers = {
1010
slow: [3, 3.5, 3.6, 3.7, 4, 6, 7, 7.4, 8, 10, 11, 13, 14, 16, 18, 20, 22, 36, 40],
11-
fast: [43, 45, 50, 60, 80],
11+
fast: [43, 45, 50, 60, 75, 80],
1212
turbo: [100, 120, 125, 129, 135, 150, 175, 200, 250, 350, 400],
1313
};
1414

examples/2.stations/1.station-list/map.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ const map = new mapboxgl.Map({
88
container: 'map',
99
style: 'mapbox://styles/chargetrip/ckgcbf3kz0h8819qki8uwhe0k',
1010
zoom: 11.4,
11-
center: [10.197422, 56.171395],
12-
cooperativeGestures: true,
11+
center: [9.941440543222434, 54.974349949816336], // 10.197422, 56.171395
1312
});
1413

1514
map.on('load', function() {
@@ -56,6 +55,8 @@ const selectPinlet = station => `${station.status}-${station.speed}`;
5655
*/
5756

5857
export const showStations = stations => {
58+
console.log(stations);
59+
5960
if (!stations) return;
6061

6162
document.getElementById('stationAmount').innerHTML =

public/stations/index.html

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,30 @@ <h1 id="stationAmount">- stations</h1>
2626
<div class="range-slider">
2727
<div class="labels">
2828
<label>Distance from location</label>
29-
<label id="distance" for="range"></label>
29+
<label id="distance" for="range">7 km</label>
3030
</div>
31-
<input type="range" min="1000" max="10000" value="3000" step="1000" id="range" />
31+
<input type="range" min="1000" max="10000" value="7000" step="1000" id="range" />
3232
</div>
3333
</section>
3434
<section>
3535
<h3>Charging power</h3>
3636
<ul class="checklist power">
3737
<li>
38-
<input type="checkbox" class="filter-input" id="turbo" value="turbo" />
38+
<input type="checkbox" class="filter-input" id="turbo" value="turbo" checked />
3939
<label for="turbo">
4040
<span class="title">Turbo - 100 to 350 kW</span>
4141
<span class="subtitle">Aprox. 30 min charge</span>
4242
</label>
4343
</li>
4444
<li>
45-
<input type="checkbox" class="filter-input" id="fast" value="fast" />
45+
<input type="checkbox" class="filter-input" id="fast" value="fast" checked />
4646
<label for="fast">
4747
<span class="title">Fast - 43 to 100 kW</span>
4848
<span class="subtitle">Aprox. 60 min charge</span>
4949
</label>
5050
</li>
5151
<li>
52-
<input type="checkbox" class="filter-input" id="slow" value="slow" />
52+
<input type="checkbox" class="filter-input" id="slow" value="slow" checked />
5353
<label for="slow">
5454
<span class="title">Slow - 1 to 43 kW</span>
5555
<span class="subtitle">Aprox. 7 hour charge</span>
@@ -60,14 +60,6 @@ <h3>Charging power</h3>
6060
<section>
6161
<h3>Amenities</h3>
6262
<ul class="checklist amenities">
63-
<li>
64-
<input type="checkbox" class="filter-input" id="supermarket" value="supermarket" />
65-
<label for="supermarket">Supermarket</label>
66-
</li>
67-
<li>
68-
<input type="checkbox" class="filter-input" id="bathroom" value="bathroom" />
69-
<label for="bathroom">Bathroom</label>
70-
</li>
7163
<li>
7264
<input type="checkbox" class="filter-input" id="restaurant" value="restaurant" />
7365
<label for="restaurant">Restaurant</label>

0 commit comments

Comments
 (0)