mirror of
https://github.com/sstent/aicyclingcoach-go.git
synced 2026-01-27 09:32:08 +00:00
sync
This commit is contained in:
18
node_modules/@react-leaflet/core/lib/attribution.js
generated
vendored
Normal file
18
node_modules/@react-leaflet/core/lib/attribution.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import { useEffect, useRef } from 'react';
|
||||
export function useAttribution(map, attribution) {
|
||||
const attributionRef = useRef(attribution);
|
||||
useEffect(function updateAttribution() {
|
||||
if (attribution !== attributionRef.current && map.attributionControl != null) {
|
||||
if (attributionRef.current != null) {
|
||||
map.attributionControl.removeAttribution(attributionRef.current);
|
||||
}
|
||||
if (attribution != null) {
|
||||
map.attributionControl.addAttribution(attribution);
|
||||
}
|
||||
}
|
||||
attributionRef.current = attribution;
|
||||
}, [
|
||||
map,
|
||||
attribution
|
||||
]);
|
||||
}
|
||||
Reference in New Issue
Block a user