Update
This commit is contained in:
parent
8b1f218b8d
commit
01748c4020
|
@ -15,10 +15,14 @@
|
||||||
function createMap(center,zoom) {
|
function createMap(center,zoom) {
|
||||||
let map = L.map(mapContainer, {
|
let map = L.map(mapContainer, {
|
||||||
center: center,
|
center: center,
|
||||||
zoom: zoom
|
zoom: zoom,
|
||||||
});
|
});
|
||||||
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||||
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||||
|
minNativeZoom: 2,
|
||||||
|
minZoom: 2,
|
||||||
|
maxNativeZoom: 16,
|
||||||
|
maxZoom: 16,
|
||||||
}).addTo(map);
|
}).addTo(map);
|
||||||
return map
|
return map
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
import{S as t,i as a,a as e,b as s,l as r,s as o,e as n,n as i,d as l,h as c,o as p,r as h}from"./index-95aedb1a.js";function u(t){let a;return{c(){a=n("div"),this.c=i,l(a,"id","map")},m(e,r){s(e,a,r),t[2](a)},p:i,i:i,o:i,d(e){e&&c(a),t[2](null)}}}function m(t,a,e){let s,{callback:r=null}=a;function o(t,a){let e=L.map(s,{center:t,zoom:a});return L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(e),e}return p((()=>{r(o)})),t.$$set=t=>{"callback"in t&&e(1,r=t.callback)},[s,r,function(t){h[t?"unshift":"push"]((()=>{s=t,e(0,s)}))}]}class b extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.css';#map{height:var(--height);width:var(--width,100%);margin-bottom:var(--margin-bottom,0)\n }</style>",a(this,{target:this.shadowRoot,props:e(this.attributes),customElement:!0},m,u,o,{callback:1},null),t&&(t.target&&s(t.target,this,t.anchor),t.props&&(this.$set(t.props),r()))}static get observedAttributes(){return["callback"]}get callback(){return this.$$.ctx[1]}set callback(t){this.$$set({callback:t}),r()}}customElements.define("map-component",b);export{b as default};
|
import{S as t,i as a,a as e,b as s,l as o,s as r,e as i,n,d as l,h as c,o as p,r as m}from"./index-95aedb1a.js";function h(t){let a;return{c(){a=i("div"),this.c=n,l(a,"id","map")},m(e,o){s(e,a,o),t[2](a)},p:n,i:n,o:n,d(e){e&&c(a),t[2](null)}}}function u(t,a,e){let s,{callback:o=null}=a;function r(t,a){let e=L.map(s,{center:t,zoom:a});return L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',minNativeZoom:2,minZoom:2,maxNativeZoom:16,maxZoom:16}).addTo(e),e}return p((()=>{o(r)})),t.$$set=t=>{"callback"in t&&e(1,o=t.callback)},[s,o,function(t){m[t?"unshift":"push"]((()=>{s=t,e(0,s)}))}]}class b extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.css';#map{height:var(--height);width:var(--width,100%);margin-bottom:var(--margin-bottom,0)\n }</style>",a(this,{target:this.shadowRoot,props:e(this.attributes),customElement:!0},u,h,r,{callback:1},null),t&&(t.target&&s(t.target,this,t.anchor),t.props&&(this.$set(t.props),o()))}static get observedAttributes(){return["callback"]}get callback(){return this.$$.ctx[1]}set callback(t){this.$$set({callback:t}),o()}}customElements.define("map-component",b);export{b as default};
|
||||||
|
|
Loading…
Reference in New Issue