-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathPlatforms.tsx
40 lines (33 loc) · 946 Bytes
/
Platforms.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import React from 'react';
import { Source, LayerProps } from 'react-map-gl/maplibre';
import OrderedLayer from 'common/Map/Layers/OrderedLayer';
import { OSM_URL } from 'common/Map/const';
import { Theme } from 'types';
interface PlatformsProps {
colors: Theme;
layerOrder?: number;
}
function Platforms(props: PlatformsProps) {
const { colors, layerOrder } = props;
const platformsParams: LayerProps = {
id: 'osm/platforms',
type: 'fill',
source: 'openmaptiles',
'source-layer': 'transportation',
filter: [
'all',
['==', '$type', 'Polygon'],
['==', 'class', 'path'],
['==', 'subclass', 'platform'],
],
paint: {
'fill-color': colors.platform.fill,
},
};
return (
<Source id="platforms" type="vector" url={OSM_URL} source-layer="transportation">
<OrderedLayer {...platformsParams} layerOrder={layerOrder} />
</Source>
);
}
export default Platforms;