/
githubmirror
/
Leaflet
Обзор
Документация
Войти
/
githubmirror
/
Leaflet
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
spec/suites/SpecHelper.js
29 строк
800 B
Volodymyr Agafonkin
Vitest follow-up cleanups (#10210)
11 май 2026, 18:44
Не верифицирован
11 май 2026, 18:44
0cbec26
Код
Авторство
О чём код?
import {DomEvent} from 'leaflet'; const runAsTouchBrowser = import.meta.env.VITE_TOUCH === '1'; export const pointerType = runAsTouchBrowser ? 'touch' : 'mouse'; export const pointerEventType = ['pointer', {pointerType}]; export function createContainer(width, height) { width = width ? width : '400px'; height = height ? height : '400px'; const container = document.createElement('div'); container.style.position = 'absolute'; container.style.top = '0px'; container.style.left = '0px'; container.style.height = height; container.style.width = width; document.body.appendChild(container); return container; } export function removeMapContainer(map, container) { map?.remove(); if (container) { document.body.removeChild(container); } DomEvent.PointerEvents.cleanupPointers(); }