Die Seite wurde neu angelegt: „mw.loader.using([], function () { function addCss(url) { if (document.querySelector('link[href="' + url + '"]')) { return; } var link = document.createElement('link'); link.rel = 'stylesheet'; link.href = url; document.head.appendChild(link); } function addScript(url) { return new Promise(function (resolve, reject) { if (document.querySelector('script[src="' + url + '"]')) { resolve(); return;…“
 
Keine Bearbeitungszusammenfassung
Zeile 34: Zeile 34:
     var lon = 15.4395;
     var lon = 15.4395;
     var zoom = 13;
     var zoom = 13;
// 1) Fullscreen-CSS laden (egal wann vor Nutzung)
  addCss('https://unpkg.com/leaflet.fullscreen@2.4.0/Control.FullScreen.css');
  // 2) Erst Fullscreen-JS laden, DANN Map erstellen
  addScript('https://unpkg.com/leaflet.fullscreen@2.4.0/Control.FullScreen.js')
    .then(function () {


     var map = L.map(el).setView([lat, lon], zoom);
     var map = L.map(el).setView([lat, lon], zoom);

Version vom 5. April 2026, 23:18 Uhr

mw.loader.using([], function () {
  function addCss(url) {
    if (document.querySelector('link[href="' + url + '"]')) {
      return;
    }
    var link = document.createElement('link');
    link.rel = 'stylesheet';
    link.href = url;
    document.head.appendChild(link);
  }

  function addScript(url) {
    return new Promise(function (resolve, reject) {
      if (document.querySelector('script[src="' + url + '"]')) {
        resolve();
        return;
      }
      var script = document.createElement('script');
      script.src = url;
      script.onload = resolve;
      script.onerror = reject;
      document.head.appendChild(script);
    });
  }

  function initMap() {
    var el = document.getElementById('mapdemo');
    if (!el || el.dataset.mapdemoReady) {
      return;
    }
    el.dataset.mapdemoReady = '1';

    var lat = 47.0707;
    var lon = 15.4395;
    var zoom = 13;

 // 1) Fullscreen-CSS laden (egal wann vor Nutzung)
  addCss('https://unpkg.com/leaflet.fullscreen@2.4.0/Control.FullScreen.css');

  // 2) Erst Fullscreen-JS laden, DANN Map erstellen
  addScript('https://unpkg.com/leaflet.fullscreen@2.4.0/Control.FullScreen.js')
    .then(function () {

    var map = L.map(el).setView([lat, lon], zoom);

    var orthofoto = L.tileLayer(
      'https://mapsneu.wien.gv.at/basemap/bmaporthofoto30cm/normal/google3857/{z}/{y}/{x}.jpeg',
      {
        attribution: 'basemap.at'
      }
    );

    var osm = L.tileLayer(
      'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
      {
        attribution: '© OpenStreetMap-Mitwirkende'
      }
    );

    orthofoto.addTo(map);

    L.marker([lat, lon]).addTo(map)
      .bindPopup('Test-Stecknadel')
      .openPopup();

    L.control.layers(
      {
        'Luftbild': orthofoto,
        'OSM': osm
      },
      {}
    ).addTo(map);
  }

  addCss('https://unpkg.com/leaflet@1.9.4/dist/leaflet.css');

  addScript('https://unpkg.com/leaflet@1.9.4/dist/leaflet.js')
    .then(initMap)
    .catch(function () {
      console.error('Leaflet konnte nicht geladen werden.');
    });
});