You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I installed it in my react-leaflet version 4.2.0.
I put starting and ending points.
When I click one of dots on the map and removing finger from mouse and then click my desired place to be thestart/end poin, my application crashes.
Cannot set properties of null (setting '_source')
TypeError: Cannot set properties of null (setting '_source')
import { useEffect } from 'react';
import { useMap } from 'react-leaflet';
import L from 'leaflet';
export default function LeafletRuler() {
const map = useMap();
useEffect(() => {
if (!map) return;
const options = {
position: 'topright', // Position to show the control. Values: 'topright', 'topleft', 'bottomright', 'bottomleft'
};
The same thing happens even if React and Angular are excluded. You can replicate it on the demos as well, though it just gives an error in the console and everything else seems to carry on working.
For me it only happens in Chrome (not Safari), and happens after double clicking the end point and then moving it.
I installed it in my react-leaflet version 4.2.0.
I put starting and ending points.
When I click one of dots on the map and removing finger from mouse and then click my desired place to be thestart/end poin, my application crashes.
Cannot set properties of null (setting '_source')
TypeError: Cannot set properties of null (setting '_source')
import { useEffect } from 'react';
import { useMap } from 'react-leaflet';
import L from 'leaflet';
export default function LeafletRuler() {
const map = useMap();
useEffect(() => {
if (!map) return;
const options = {
position: 'topright', // Position to show the control. Values: 'topright', 'topleft', 'bottomright', 'bottomleft'
};
}, [map]);
return null;
}
const Map = () => {
useEffect(() => {
const script = document.createElement('script');
script.src =
'https://ppete2.github.io/Leaflet.PolylineMeasure/Leaflet.PolylineMeasure.js';
document.body.appendChild(script);
}, []);
return (
<MapContainer
style={{ height: '100%', width: '100%', zIndex: 1 }}
zoom={10}
maxZoom={22}
center={[40.2, 45.7]}
attributionControl={false}
zoomAnimation={true}
// @ts-ignore
fullscreenControl={true}
crs={CRS.EPSG4326}
>
{/* */}
);
};
export default Map;
The text was updated successfully, but these errors were encountered: