Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions packages/arm-core/src/components/BaseLayerToggle.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable global-require */
import { Checkmark, Ellipsis } from '@amsterdam/asc-assets'
import {
Button,
Expand All @@ -20,12 +18,14 @@ import {
} from '../constants'
import BaseLayer from './BaseLayer'

/* eslint-disable @typescript-eslint/no-unsafe-assignment */
const AerialBackground: string = require('../../static/aerial-background.png')
const AerialBackgroundRetina: string = require('../../static/aerial-background@2.png')
const TopoBackground: string = require('../../static/topo-background.png')
const TopoBackgroundRetina: string = require('../../static/topo-background@2.png')
/* eslint-enable @typescript-eslint/no-unsafe-assignment */
// @ts-ignore
import AerialBackground from '../../static/aerial-background.png'
// @ts-ignore
import AerialBackgroundRetina from '../../static/aerial-background@2.png'
// @ts-ignore
import TopoBackground from '../../static/topo-background.png'
// @ts-ignore
import TopoBackgroundRetina from '../../static/topo-background@2.png'

export enum BaseLayerType {
Aerial = 'luchtfoto',
Expand Down Expand Up @@ -59,15 +59,15 @@ const ToggleButton = styled(Button)<ToggleButtonProps>`
align-self: self-start;
text-align: left;
background: ${({ layerType }) =>
`url(${BASE_LAYER_STYLE[layerType].background[0]})`};
`url(${BASE_LAYER_STYLE[layerType].background[0] as string})`};
text-transform: capitalize;
width: 44px;
margin-right: 2px;

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
background: ${({
layerType,
}) => `url(${BASE_LAYER_STYLE[layerType].background[1]}) no-repeat top left /
background: ${({ layerType }) => `url(${
BASE_LAYER_STYLE[layerType].background[1] as string
}) no-repeat top left /
120px 44px`};
}

Expand Down Expand Up @@ -129,7 +129,6 @@ const BaseLayerToggle: React.FC<Props> = ({
}) => {
const didMount = useRef(false)
const [toggleBaseLayerType, setToggleBaseLayerType] = useState(activeLayer)

const baseLayers = useMemo(() => {
return {
[BaseLayerType.Aerial]: aerialLayers,
Expand Down