soiz1 commited on
Commit
00a1dc5
·
verified ·
1 Parent(s): 922ef2f

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +23 -24
index.html CHANGED
@@ -597,34 +597,33 @@
597
  }));
598
  const t = map.getCenter();
599
  const n = map.getZoom();
600
- let o = `
601
- <div id="map" style="height: 600px; width: 100%;">
602
- <link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.3/dist/leaflet.css" />
603
- <script src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js"><\/script>
604
- <script>
605
- var map = L.map('map').setView([${t.lat}, ${t.lng}], ${n});
606
- L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
607
- attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap contributors'
608
- }).addTo(map);
609
 
610
- ${e.map(e => `
611
- var icon = L.icon({
612
- iconUrl: '${e.iconUrl}',
613
- iconSize: [${e.iconWidth}, ${e.iconHeight}],
614
- iconAnchor: [${e.iconWidth} / 2, ${e.iconHeight}],
615
- popupAnchor: [0, -${e.iconHeight}],
616
- tooltipAnchor: [${e.iconWidth} / 2, -${e.iconHeight} / 2]
617
- });
618
 
619
- var marker = L.marker([${e.lat}, ${e.lng}], {
620
- icon: icon,
621
- zIndexOffset: 1000
622
- }).addTo(map);
623
 
624
- ${e.popupContent ? `marker.bindPopup('${e.popupContent.replace(/'/g, "\\'").replace(/<\/script>/g, "<\\/script>")}');` : ""}
625
- ${e.tooltipContent ? `marker.bindTooltip('${e.tooltipContent.replace(/'/g, "\\'").replace(/<\/script>/g, "<\\/script>")}');` : ""}
626
  `).join("\n")}
627
- <\/script>
628
  `;
629
  o = o.replace(/iconUrl: 'marker-icon\.png'/g, `iconUrl: '${location.origin}/marker-icon.png'`);
630
  document.getElementById("output-html").value = o;
 
597
  }));
598
  const t = map.getCenter();
599
  const n = map.getZoom();
600
+ let o = `<div id="map" style="height: 600px; width: 100%;">
601
+ <link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.3/dist/leaflet.css" />
602
+ <script src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js"><\/script>
603
+ <script>
604
+ var map = L.map('map').setView([${t.lat}, ${t.lng}], ${n});
605
+ L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
606
+ attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap contributors'
607
+ }).addTo(map);
 
608
 
609
+ ${e.map(e => `
610
+ var icon = L.icon({
611
+ iconUrl: '${e.iconUrl}',
612
+ iconSize: [${e.iconWidth}, ${e.iconHeight}],
613
+ iconAnchor: [${e.iconWidth} / 2, ${e.iconHeight}],
614
+ popupAnchor: [0, -${e.iconHeight}],
615
+ tooltipAnchor: [${e.iconWidth} / 2, -${e.iconHeight} / 2]
616
+ });
617
 
618
+ var marker = L.marker([${e.lat}, ${e.lng}], {
619
+ icon: icon,
620
+ zIndexOffset: 1000
621
+ }).addTo(map);
622
 
623
+ ${e.popupContent ? `marker.bindPopup('${e.popupContent.replace(/'/g, "\\'").replace(/<\/script>/g, "<\\/script>")}');` : ""}
624
+ ${e.tooltipContent ? `marker.bindTooltip('${e.tooltipContent.replace(/'/g, "\\'").replace(/<\/script>/g, "<\\/script>")}');` : ""}
625
  `).join("\n")}
626
+ <\/script>
627
  `;
628
  o = o.replace(/iconUrl: 'marker-icon\.png'/g, `iconUrl: '${location.origin}/marker-icon.png'`);
629
  document.getElementById("output-html").value = o;