/
VVRONGG
/
backside
Обзор
Документация
Войти
/
VVRONGG
/
backside
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
1
CI/CD
Аналитика
Безопасность
master
admin/src/leaflet-setup.ts
20 строк
948 B
VVrongg
add kubec deploy
24 май 2026, 20:16
24 май 2026, 20:16
db9ffee
Код
Авторство
О чём код?
// Shared Leaflet bootstrap: pull in the stylesheet and wire up the default // marker icons (bundlers can't resolve Leaflet's built-in icon paths, so the // markers come out blank without this). Import this module once per map. import L from 'leaflet'; import 'leaflet/dist/leaflet.css'; import markerIcon2x from 'leaflet/dist/images/marker-icon-2x.png'; import markerIcon from 'leaflet/dist/images/marker-icon.png'; import markerShadow from 'leaflet/dist/images/marker-shadow.png'; // Icon.Default overrides _getIconUrl to prepend an auto-detected image path to // whatever URL we set, which mangles the bundler-hashed paths into 404s (blank // markers). Drop the override so it uses our URLs verbatim, then point it at the // bundled assets. delete (L.Icon.Default.prototype as unknown as { _getIconUrl?: unknown })._getIconUrl; L.Icon.Default.mergeOptions({ iconRetinaUrl: markerIcon2x, iconUrl: markerIcon, shadowUrl: markerShadow, });