MCPcopy Create free account
hub / github.com/cartesiancs/map3d / adjustLng

Function adjustLng

src/components/map/SelectMap.tsx:39–42  ·  view source on GitHub ↗
(latlng: LatLng)

Source from the content-addressed store, hash-verified

37 const lastLatlngRef = useRef<LatLng | null>(null);
38
39 const adjustLng = (latlng: LatLng): LatLng => {
40 const adjustedLng = ((((latlng.lng + 180) % 360) + 360) % 360) - 180;
41 return new L.LatLng(latlng.lat, adjustedLng);
42 };
43
44 const map = useMapEvents({
45 mousedown(e) {

Callers 4

mousemoveFunction · 0.85
mouseupFunction · 0.85
handleTouchMoveFunction · 0.85
handleTouchEndFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected