Skip to content

Commit

Permalink
Merge pull request #3159 from HSLdevcom/DT-3463
Browse files Browse the repository at this point in the history
DT-3463
  • Loading branch information
vesameskanen authored Mar 20, 2020
2 parents 4ae439b + a221c3c commit 7c1eabc
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 33 deletions.
22 changes: 7 additions & 15 deletions app/component/map/tile-layer/CityBikes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import pick from 'lodash/pick';

import { isBrowser } from '../../../util/browser';
import {
drawAvailabilityBadge,
drawAvailabilityValue,
drawIcon,
drawRoundIcon,
drawCitybikeNotInUseIcon,
getMapIconScale,
} from '../../../util/mapIconUtils';

Expand Down Expand Up @@ -113,25 +113,17 @@ class CityBikes {
),
);

if (result.state === BIKESTATION_CLOSED) {
// Draw just plain grey base icon
return drawIcon(
`${iconName}_off`,
this.tile,
geom,
this.citybikeImageSize,
);
}

if (result.state === BIKESTATION_OFF) {
if (
result.state === BIKESTATION_CLOSED ||
result.state === BIKESTATION_OFF
) {
return drawIcon(
`${iconName}_off`,
iconName,
this.tile,
geom,
this.citybikeImageSize,
).then(() =>
drawAvailabilityBadge(
'no',
drawCitybikeNotInUseIcon(
this.tile,
geom,
this.citybikeImageSize,
Expand Down
16 changes: 12 additions & 4 deletions app/util/mapIconUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,20 @@ export function drawParkAndRideIcon(tile, geom, width, height) {
);
}

export function drawCitybikeNotInUseIcon(tile, geom, imageSize) {
export function drawCitybikeNotInUseIcon(
tile,
geom,
imageSize,
badgeSize,
scaleratio,
) {
return getImageFromSpriteCache(
'icon-icon_not-in-use',
imageSize,
imageSize,
).then(image => drawIconImage(image, tile, geom, imageSize, imageSize));
badgeSize,
badgeSize,
).then(image =>
drawIconImageBadge(image, tile, geom, imageSize, badgeSize, scaleratio),
);
}

export function drawAvailabilityBadge(
Expand Down
9 changes: 4 additions & 5 deletions static/assets/svg-sprite.default.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 12 additions & 9 deletions static/assets/svg-sprite.hsl.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7c1eabc

Please sign in to comment.