Greasy Fork is available in English.

Get OpenStreetMap Leaflet object

Get the Leaflet object of OpenStreetMap's website

Skrip ini tidak untuk dipasang secara langsung. Ini adalah pustaka skrip lain untuk disertakan dengan direktif meta // @require https://update.greatest.deepsurf.us/scripts/533461/1574689/Get%20OpenStreetMap%20Leaflet%20object.js

  1. // ==UserScript==
  2. // @name Get OpenStreetMap Leaflet object
  3. // @match *://www.openstreetmap.org/*
  4. // @version 1.0
  5. // @author CyrilSLi
  6. // @description Get the Leaflet object of OpenStreetMap's website
  7. // @license MIT
  8. // ==/UserScript==
  9.  
  10. unsafeWindow.userscriptMap = null;
  11. if (typeof L !== "undefined" && typeof L.Map !== "undefined") {
  12. L.Map.addInitHook(function () {
  13. if (this._container && this._container.id === "map") {
  14. unsafeWindow.userscriptMap = this;
  15. }
  16. });
  17. }