Skip to content

Commit

Permalink
Merge pull request #4688 from HSLdevcom/DT-5622
Browse files Browse the repository at this point in the history
fix: fix park and ride icons DT-5622
  • Loading branch information
vesameskanen authored Nov 30, 2022
2 parents a5c07d8 + 9d37d61 commit e828ba6
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions app/component/map/tile-layer/ParkAndRide.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import pick from 'lodash/pick';
import Protobuf from 'pbf';

import { drawParkAndRideIcon } from '../../../util/mapIconUtils';
import { Contour } from '../../../util/geo-utils';
import { isBrowser } from '../../../util/browser';
import { fetchWithSubscription } from '../../../util/fetchUtils';

Expand Down Expand Up @@ -68,14 +67,14 @@ export default class ParkAndRide {
}
} else if (
this.tile.coords.z >= showFacilities &&
vt.layers.facilities != null
vt.layers['facility-points'] != null
) {
for (
let i = 0, ref = vt.layers.facilities.length - 1;
let i = 0, ref = vt.layers['facility-points'].length - 1;
i <= ref;
i++
) {
const feature = vt.layers.facilities.feature(i);
const feature = vt.layers['facility-points'].feature(i);
fetchQuery(this.relayEnvironment, carParkQuery, {
id: feature.id.toString(),
}).then(data => {
Expand All @@ -87,9 +86,7 @@ export default class ParkAndRide {
this.tile.hilightedStops.includes(
feature.properties?.facility?.carParkId,
);
feature.geom = new Contour(
feature.loadGeometry()[0],
).centroid();
[[feature.geom]] = feature.loadGeometry();
this.features.push(feature);
drawParkAndRideIcon(
this.tile,
Expand Down

0 comments on commit e828ba6

Please sign in to comment.