blob: 026ade18a68b6105d767ec6d80ce0d01723a225c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
import React from 'react';
import styles from './TileLayerControl.module.css';
export enum TileLayerType {
map,
satellite,
}
interface Props {
tileType: TileLayerType;
onClick: () => void;
}
export default function TileLayerControl({ tileType, onClick }: Props): JSX.Element {
const bgClass = tileType === TileLayerType.map ? styles.satellite : styles.map;
return (
<div className={`${styles.tileLayerControl} leaflet-bar`}>
<button type="button" className={bgClass} onClick={onClick}></button>
</div>
);
}
|