You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
794 B
26 lines
794 B
6 months ago
|
/* eslint-disable implicit-arrow-linebreak */
|
||
|
/* eslint-disable no-unused-vars */
|
||
|
import React, { useEffect, useMemo, useRef, useState } from 'react'
|
||
|
|
||
|
import L from 'leaflet'
|
||
|
import './L.TileLayer.GeneralWMS'
|
||
|
|
||
|
import { createTileLayerComponent, createElementObject, updateGridLayer } from '@react-leaflet/core'
|
||
|
|
||
|
const GeneralWMS = createTileLayerComponent(
|
||
|
function createBetterWMSLayer({ options, url, layers, ...props }, context) {
|
||
|
const layer = new L.tileLayer.generalWms(url, { layers, ...props }, context)
|
||
|
|
||
|
return createElementObject(layer, context)
|
||
|
},
|
||
|
(layer, props, prevProps) => {
|
||
|
updateGridLayer(layer, props, prevProps)
|
||
|
|
||
|
if (props.params !== null && props.params !== prevProps.params) {
|
||
|
layer.setParams(props.params)
|
||
|
}
|
||
|
}
|
||
|
)
|
||
|
|
||
|
export default GeneralWMS
|