Get OpenStreetMap Leaflet object

Get the Leaflet object of OpenStreetMap's website

2025-04-20 기준 버전입니다. 최신 버전을 확인하세요.

이 스크립트는 직접 설치하는 용도가 아닙니다. 다른 스크립트에서 메타 지시문 // @require https://update.greasyforks.org/scripts/533461/1574689/Get%20OpenStreetMap%20Leaflet%20object.js을(를) 사용하여 포함하는 라이브러리입니다.

// ==UserScript==
// @name        Get OpenStreetMap Leaflet object
// @match       *://www.openstreetmap.org/*
// @version     1.0
// @author      CyrilSLi
// @description Get the Leaflet object of OpenStreetMap's website
// @license     MIT
// ==/UserScript==

unsafeWindow.userscriptMap = null;
if (typeof L !== "undefined" && typeof L.Map !== "undefined") {
    L.Map.addInitHook(function () {
        if (this._container && this._container.id === "map") {
            unsafeWindow.userscriptMap = this;
        }
    });
}
长期地址
遇到问题?请前往 GitHub 提 Issues。