Skip to content

Commit

Permalink
fix: basic linting
Browse files Browse the repository at this point in the history
  • Loading branch information
mayfinn committed Sep 26, 2023
1 parent 569ac3a commit 691bd43
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 42 deletions.
51 changes: 21 additions & 30 deletions app/html/index.js
Original file line number Diff line number Diff line change
@@ -1,46 +1,39 @@
const urlParams = new URLSearchParams(window.location.search);
const hereApiKey = urlParams.get('hereApiKey');
const hereApiKey = urlParams.get("hereApiKey");

const currentLocation = {
lat: urlParams.get('currentLocation').split(',').map(Number)[0],
lng: urlParams.get('currentLocation').split(',').map(Number)[1]
lat: urlParams.get("currentLocation").split(",").map(Number)[0],
lng: urlParams.get("currentLocation").split(",").map(Number)[1],
};

const startLocation = decodeURIComponent(urlParams.get('startLocation'));
const endLocation = decodeURIComponent(urlParams.get('endLocation'));
const startLocation = decodeURIComponent(urlParams.get("startLocation"));
const endLocation = decodeURIComponent(urlParams.get("endLocation"));

console.log(startLocation);
console.log(endLocation);

// Initialize the platform object:
var platform = new H.service.Platform({
apikey: hereApiKey
apikey: hereApiKey,
});

// Retrieve the target element for the map:
var targetElement = document.getElementById('mapContainer');

var targetElement = document.getElementById("mapContainer");

// Obtain the default map types from the platform object
var mapLayers = platform.createDefaultLayers();

// Instantiate (and display) a map object:
var map = new H.Map(
document.getElementById('mapContainer'),
mapLayers.vector.normal.map,
{
zoom: 15,
center: currentLocation
}
);
var map = new H.Map(targetElement, mapLayers.vector.normal.map, {
zoom: 15,
center: currentLocation,
});

// Enable the event system on the map instance:
var mapEvents = new H.mapevents.MapEvents(map);



// Add event listener:
map.addEventListener('tap', function (evt) {
map.addEventListener("tap", function (evt) {
// Log 'tap' and 'mouse' events:
console.log(evt.type, evt.currentPointer.type);
});
Expand All @@ -52,17 +45,16 @@ var behavior = new H.mapevents.Behavior(mapEvents);
const ui = H.ui.UI.createDefault(map, mapLayers);

Check failure on line 45 in app/html/index.js

View workflow job for this annotation

GitHub Actions / lint

'ui' is assigned a value but never used

Check failure on line 45 in app/html/index.js

View workflow job for this annotation

GitHub Actions / lint

'ui' is assigned a value but never used

var routingParameters = {
'routingMode': 'fast', //TODO: sync with mobile app
'transportMode': 'pedestrian',
routingMode: "fast", //TODO: sync with mobile app
transportMode: "pedestrian",
// The start point of the route:
'origin': startLocation,
origin: startLocation,
// The end point of the route:
'destination': endLocation,
destination: endLocation,
// Include the route shape in the response
'return': 'polyline'
return: "polyline",
};


// Define a callback function to process the routing response:
var onResult = function (result) {
// ensure that at least one route was found
Expand All @@ -75,7 +67,7 @@ var onResult = function (result) {

// Create a polyline to display the route:
let routeLine = new H.map.Polyline(linestring, {
style: { strokeColor: 'blue', lineWidth: 3 }
style: { strokeColor: "blue", lineWidth: 3 },
});

// Create a marker for the start point:
Expand All @@ -99,7 +91,6 @@ var router = platform.getRoutingService(null, 8);
// Call calculateRoute() with the routing parameters,
// the callback and an error callback function (called if a
// communication error occurs):
router.calculateRoute(routingParameters, onResult,
function (error) {
alert(error.message);
});
router.calculateRoute(routingParameters, onResult, function (error) {
alert(error.message);
});
6 changes: 2 additions & 4 deletions app/shared/components/Map.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@
const keys = Object.keys(params) as (keyof typeof params)[];
mapSearchParams = keys
.map((key) => key + "=" + params[key])
.join("&");
mapSearchParams = keys.map((key) => key + "=" + params[key]).join("&");
console.log(mapSearchParams);
}
</script>

<!-- <label text="{mapSearchParams.toString()}" /> -->

<webView src={"~/html/map.html?" + mapSearchParams} row={$$props['row']} />
<webView src={"~/html/map.html?" + mapSearchParams} row={$$props["row"]} />
20 changes: 12 additions & 8 deletions app/views/liveView/Main.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -444,14 +444,18 @@
on:tap={simulateNextStep}
/>
<Map row={2} bind:currentLocation={currentLocation} startLocation={{
lat: currentSection.departure.place.location.lat,
lng: currentSection.departure.place.location.lng,
}} endLocation={{
lat: currentSection.arrival.place.location.lat,
lng: currentSection.arrival.place.location.lng,
}} />
<Map
row={2}
bind:currentLocation
startLocation={{
lat: currentSection.departure.place.location.lat,
lng: currentSection.departure.place.location.lng,
}}
endLocation={{
lat: currentSection.arrival.place.location.lat,
lng: currentSection.arrival.place.location.lng,
}}
/>
{/if}
<gridLayout row="3" columns="*, auto, *">
Expand Down

0 comments on commit 691bd43

Please sign in to comment.