mirror of
https://github.com/HSLdevcom/digitransit-ui
synced 2026-02-22 08:05:45 +01:00
50 lines
1.3 KiB
JavaScript
50 lines
1.3 KiB
JavaScript
import React from 'react';
|
|
import { configShape } from '../../../util/shapes';
|
|
import TileLayerContainer from './TileLayerContainer';
|
|
import VehicleRentalStations from './VehicleRentalStations';
|
|
import Stops from './Stops';
|
|
import ParkAndRideForCars from './ParkAndRideForCars';
|
|
import ParkAndRideForBikes from './ParkAndRideForBikes';
|
|
import { mapLayerShape } from '../../../store/MapLayerStore';
|
|
import RentalVehicles from './RentalVehicles';
|
|
|
|
export default function VectorTileLayerContainer(
|
|
{ mapLayers, ...rest },
|
|
{ config },
|
|
) {
|
|
const layers = [];
|
|
|
|
layers.push(Stops);
|
|
|
|
if (mapLayers.citybike) {
|
|
layers.push(VehicleRentalStations);
|
|
}
|
|
if (mapLayers.parkAndRide) {
|
|
layers.push(ParkAndRideForCars);
|
|
}
|
|
if (mapLayers.parkAndRideForBikes) {
|
|
layers.push(ParkAndRideForBikes);
|
|
}
|
|
if (mapLayers.scooter) {
|
|
layers.push(RentalVehicles);
|
|
}
|
|
return (
|
|
<TileLayerContainer
|
|
key="tileLayer"
|
|
pane="markerPane"
|
|
layers={layers}
|
|
mapLayers={mapLayers}
|
|
tileSize={config.map.tileSize || 256}
|
|
zoomOffset={config.map.zoomOffset || 0}
|
|
{...rest}
|
|
/>
|
|
);
|
|
}
|
|
|
|
VectorTileLayerContainer.propTypes = {
|
|
mapLayers: mapLayerShape.isRequired,
|
|
};
|
|
|
|
VectorTileLayerContainer.contextTypes = {
|
|
config: configShape.isRequired,
|
|
};
|