@geolonia/embed 2.0.0-pre.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (self.webpackChunk_geolonia_embed=self.webpackChunk_geolonia_embed||[]).push([[853],{7577:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>y}),o(2526),o(1817),o(9070);var i=o(2739),l=o.n(i),r=o(1235),s=o(8007),a=o.n(s);function n(e,t){for(var o=0;o<t.length;o++){var i=t[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var c="#000000",u="#FFFFFF",g="rgba(255, 0, 0, 0.4)",p="#FFFFFF";const y=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sourceName="vt-geolonia-simple-style",this.url=t}var t,o;return t=e,(o=[{key:"addTo",value:function(e){var t=this,o=e.getContainer();if(!o.dataset||!o.dataset.lng&&!o.dataset.lat){var i=!1;e.on("sourcedata",(function(o){if(o.sourceId===t.sourceName){var l=e.getSource(o.sourceId);!0===(l&&l.loaded())&&(i||(i=!0,e.fitBounds(l.bounds,{duration:0,padding:30})))}}))}e.addSource(this.sourceName,{type:"vector",url:this.url}),this.setPolygonGeometries(e),this.setLineGeometries(e),e.addLayer({id:"vt-geolonia-simple-style-polygon-symbol",type:"symbol",source:this.sourceName,"source-layer":"g-simplestyle-v1",filter:["==","$type","Polygon"],paint:{"text-color":["string",["get","text-color"],c],"text-halo-color":["string",["get","text-halo-color"],u],"text-halo-width":1},layout:{"text-field":["get","title"],"text-font":["Noto Sans Regular"],"text-size":12,"text-max-width":12,"text-allow-overlap":!1}}),e.addLayer({id:"vt-geolonia-simple-style-linestring-symbol",type:"symbol",source:this.sourceName,"source-layer":"g-simplestyle-v1",filter:["==","$type","LineString"],paint:{"text-color":["string",["get","text-color"],c],"text-halo-color":["string",["get","text-halo-color"],u],"text-halo-width":1},layout:{"symbol-placement":"line","text-field":["get","title"],"text-font":["Noto Sans Regular"],"text-size":12,"text-max-width":12,"text-allow-overlap":!1}}),this.setPointGeometries(e)}},{key:"setPolygonGeometries",value:function(e){e.addLayer({id:"vt-geolonia-simple-style-polygon",type:"fill",source:this.sourceName,"source-layer":"g-simplestyle-v1",filter:["==","$type","Polygon"],paint:{"fill-color":["string",["get","fill"],g],"fill-opacity":["number",["get","fill-opacity"],1],"fill-outline-color":["string",["get","stroke"],p]}}),this.setPopup(e,"vt-geolonia-simple-style-polygon")}},{key:"setLineGeometries",value:function(e){e.addLayer({id:"vt-geolonia-simple-style-linestring",type:"line",source:this.sourceName,"source-layer":"g-simplestyle-v1",filter:["==","$type","LineString"],paint:{"line-width":["number",["get","stroke-width"],2],"line-color":["string",["get","stroke"],g],"line-opacity":["number",["get","stroke-opacity"],1]},layout:{"line-cap":"round","line-join":"round"}}),this.setPopup(e,"vt-geolonia-simple-style-linestring")}},{key:"setPointGeometries",value:function(e){e.addLayer({id:"vt-circle-simple-style-points",type:"circle",source:this.sourceName,"source-layer":"g-simplestyle-v1",filter:["==","$type","Point"],paint:{"circle-radius":["case",["==","small",["get","marker-size"]],7,["==","large",["get","marker-size"]],13,9],"circle-color":["string",["get","marker-color"],g],"circle-opacity":["number",["get","fill-opacity"],1],"circle-stroke-width":["number",["get","stroke-width"],1],"circle-stroke-color":["string",["get","stroke"],p],"circle-stroke-opacity":["number",["get","stroke-opacity"],1]}}),e.addLayer({id:"vt-geolonia-simple-style-points",type:"symbol",source:this.sourceName,"source-layer":"g-simplestyle-v1",filter:["==","$type","Point"],paint:{"text-color":["string",["get","text-color"],c],"text-halo-color":["string",["get","text-halo-color"],u],"text-halo-width":1},layout:{"icon-image":["case",["==","large",["get","marker-size"]],["image",["concat",["get","marker-symbol"],"-15"]],["image",["concat",["get","marker-symbol"],"-11"]]],"text-field":["get","title"],"text-font":["Noto Sans Regular"],"text-size":12,"text-anchor":"top","text-max-width":12,"text-offset":["case",["==","small",["get","marker-size"]],["literal",[0,.6]],["==","large",["get","marker-size"]],["literal",[0,1.2]],["literal",[0,.8]]],"text-allow-overlap":!1}}),this.setPopup(e,"vt-circle-simple-style-points")}},{key:"setPopup",value:function(e,t){e.on("click",t,(function(t){var o=(0,r.Z)(t.features[0]).geometry.coordinates,i=t.features[0].properties.description;i&&(new(l().Popup)).setLngLat(o).setHTML(a()(i)).addTo(e)})),e.on("mouseenter",t,(function(t){t.features[0].properties.description&&(e.getCanvas().style.cursor="pointer")})),e.on("mouseleave",t,(function(){e.getCanvas().style.cursor=""}))}}])&&n(t.prototype,o),e}()},2868:()=>{},4777:()=>{},9830:()=>{},209:()=>{},7414:()=>{}}]);
1
+ "use strict";(self.webpackChunk_geolonia_embed=self.webpackChunk_geolonia_embed||[]).push([[577],{7577:(e,t,o)=>{o.r(t),o.d(t,{default:()=>y}),o(2526),o(1817),o(9070);var i=o(2739),l=o.n(i),r=o(1235),s=o(8007),a=o.n(s);function n(e,t){for(var o=0;o<t.length;o++){var i=t[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var c="#000000",u="#FFFFFF",g="rgba(255, 0, 0, 0.4)",p="#FFFFFF";const y=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sourceName="vt-geolonia-simple-style",this.url=t}var t,o;return t=e,(o=[{key:"addTo",value:function(e){var t=this,o=e.getContainer();if(!o.dataset||!o.dataset.lng&&!o.dataset.lat){var i=!1;e.on("sourcedata",(function(o){if(o.sourceId===t.sourceName){var l=e.getSource(o.sourceId);!0===(l&&l.loaded())&&(i||(i=!0,e.fitBounds(l.bounds,{duration:0,padding:30})))}}))}e.addSource(this.sourceName,{type:"vector",url:this.url}),this.setPolygonGeometries(e),this.setLineGeometries(e),e.addLayer({id:"vt-geolonia-simple-style-polygon-symbol",type:"symbol",source:this.sourceName,"source-layer":"g-simplestyle-v1",filter:["==","$type","Polygon"],paint:{"text-color":["string",["get","text-color"],c],"text-halo-color":["string",["get","text-halo-color"],u],"text-halo-width":1},layout:{"text-field":["get","title"],"text-font":["Noto Sans Regular"],"text-size":12,"text-max-width":12,"text-allow-overlap":!1}}),e.addLayer({id:"vt-geolonia-simple-style-linestring-symbol",type:"symbol",source:this.sourceName,"source-layer":"g-simplestyle-v1",filter:["==","$type","LineString"],paint:{"text-color":["string",["get","text-color"],c],"text-halo-color":["string",["get","text-halo-color"],u],"text-halo-width":1},layout:{"symbol-placement":"line","text-field":["get","title"],"text-font":["Noto Sans Regular"],"text-size":12,"text-max-width":12,"text-allow-overlap":!1}}),this.setPointGeometries(e)}},{key:"setPolygonGeometries",value:function(e){e.addLayer({id:"vt-geolonia-simple-style-polygon",type:"fill",source:this.sourceName,"source-layer":"g-simplestyle-v1",filter:["==","$type","Polygon"],paint:{"fill-color":["string",["get","fill"],g],"fill-opacity":["number",["get","fill-opacity"],1],"fill-outline-color":["string",["get","stroke"],p]}}),this.setPopup(e,"vt-geolonia-simple-style-polygon")}},{key:"setLineGeometries",value:function(e){e.addLayer({id:"vt-geolonia-simple-style-linestring",type:"line",source:this.sourceName,"source-layer":"g-simplestyle-v1",filter:["==","$type","LineString"],paint:{"line-width":["number",["get","stroke-width"],2],"line-color":["string",["get","stroke"],g],"line-opacity":["number",["get","stroke-opacity"],1]},layout:{"line-cap":"round","line-join":"round"}}),this.setPopup(e,"vt-geolonia-simple-style-linestring")}},{key:"setPointGeometries",value:function(e){e.addLayer({id:"vt-circle-simple-style-points",type:"circle",source:this.sourceName,"source-layer":"g-simplestyle-v1",filter:["==","$type","Point"],paint:{"circle-radius":["case",["==","small",["get","marker-size"]],7,["==","large",["get","marker-size"]],13,9],"circle-color":["string",["get","marker-color"],g],"circle-opacity":["number",["get","fill-opacity"],1],"circle-stroke-width":["number",["get","stroke-width"],1],"circle-stroke-color":["string",["get","stroke"],p],"circle-stroke-opacity":["number",["get","stroke-opacity"],1]}}),e.addLayer({id:"vt-geolonia-simple-style-points",type:"symbol",source:this.sourceName,"source-layer":"g-simplestyle-v1",filter:["==","$type","Point"],paint:{"text-color":["string",["get","text-color"],c],"text-halo-color":["string",["get","text-halo-color"],u],"text-halo-width":1},layout:{"icon-image":["case",["==","large",["get","marker-size"]],["image",["concat",["get","marker-symbol"],"-15"]],["image",["concat",["get","marker-symbol"],"-11"]]],"text-field":["get","title"],"text-font":["Noto Sans Regular"],"text-size":12,"text-anchor":"top","text-max-width":12,"text-offset":["case",["==","small",["get","marker-size"]],["literal",[0,.6]],["==","large",["get","marker-size"]],["literal",[0,1.2]],["literal",[0,.8]]],"text-allow-overlap":!1}}),this.setPopup(e,"vt-circle-simple-style-points")}},{key:"setPopup",value:function(e,t){e.on("click",t,(function(t){var o=(0,r.Z)(t.features[0]).geometry.coordinates,i=t.features[0].properties.description;i&&(new(l().Popup)).setLngLat(o).setHTML(a()(i)).addTo(e)})),e.on("mouseenter",t,(function(t){t.features[0].properties.description&&(e.getCanvas().style.cursor="pointer")})),e.on("mouseleave",t,(function(){e.getCanvas().style.cursor=""}))}}])&&n(t.prototype,o),e}()}}]);