MCPcopy Create free account
hub / github.com/ImGoodBai/MapGoGoGo / zoomBy

Function zoomBy

frontend/src/maps.tsx:270–277  ·  view source on GitHub ↗
(delta: number)

Source from the content-addressed store, hash-verified

268 }, [challenge, config, selectedCenter]);
269
270 function zoomBy(delta: number) {
271 const holder = mapRef.current;
272 if (!holder) return;
273 const { map } = holder;
274 const nextZoom = Math.max(3, Math.min(20, map.getZoom() + delta));
275 map.setZoom(nextZoom);
276 setZoom(nextZoom);
277 }
278
279 useEffect(() => {
280 const holder = mapRef.current;

Callers 1

AmapViewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected