@geops/rvf-mobility-web-component 0.1.125 → 0.1.127-beta.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.
- package/.lintstagedrc.js +1 -1
- package/CHANGELOG.md +12 -0
- package/dist/index.js +4025 -0
- package/doc/public/README.md +1 -1
- package/doc/src/app/layout.tsx +2 -2
- package/index.html +2 -2
- package/index.js +536 -65
- package/indexDoc.js +37 -0
- package/package.json +3 -3
- package/scripts/build.mjs +3 -1
- package/scripts/dev.mjs +4 -1
- package/src/OverlayContent/OverlayContent.tsx +17 -4
- package/src/icons/Loading/Loading.tsx +24 -0
- package/src/icons/Loading/index.ts +1 -0
- package/.vscode/settings.json +0 -2
package/indexDoc.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
(()=>{function Ke(e,t,o){let r=Math.min.apply(null,e),i=Math.min.apply(null,t),n=Math.max.apply(null,e),a=Math.max.apply(null,t);return pe(r,i,n,a,o)}function pe(e,t,o,r,i){return i?(i[0]=e,i[1]=t,i[2]=o,i[3]=r,i):[e,t,o,r]}function je(e){return pe(1/0,1/0,-1/0,-1/0,e)}function Je(e){return e[2]<e[0]||e[3]<e[1]}function fe(e,t,o,r){if(Je(e))return je(o);let i=[];if(r>1){let s=e[2]-e[0],l=e[3]-e[1];for(let u=0;u<r;++u)i.push(e[0]+s*u/r,e[1],e[2],e[1]+l*u/r,e[2]-s*u/r,e[3],e[0],e[3]-l*u/r)}else i=[e[0],e[1],e[2],e[1],e[2],e[3],e[0],e[3]];t(i,i,2);let n=[],a=[];for(let s=0,l=i.length;s<l;s+=2)n.push(i[s]),a.push(i[s+1]);return Ke(n,a,o)}function H(e){return e*180/Math.PI}function I(e){return e*Math.PI/180}function de(e,t){let o=e%t;return o*t<0?o+t:o}function U(e,t,o){if(e>=t&&e<o)return e;let r=o-t;return((e-t)%r+r)%r+t}var he={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};var K=class{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0?t.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||he[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}},M=K;var v=6378137,w=Math.PI*v,Ze=[-w,-w,w,w],Qe=[-180,-85,180,85],G=v*Math.log(Math.tan(Math.PI/2)),y=class extends M{constructor(t){super({code:t,units:"m",extent:Ze,global:!0,worldExtent:Qe,getPointResolution:function(o,r){return o/Math.cosh(r[1]/v)}})}},j=[new y("EPSG:3857"),new y("EPSG:102100"),new y("EPSG:102113"),new y("EPSG:900913"),new y("http://www.opengis.net/def/crs/EPSG/0/3857"),new y("http://www.opengis.net/gml/srs/epsg.xml#3857")];function me(e,t,o,r){let i=e.length;o=o>1?o:2,r=r??o,t===void 0&&(o>2?t=e.slice():t=new Array(i));for(let n=0;n<i;n+=r){t[n]=w*e[n]/180;let a=v*Math.log(Math.tan(Math.PI*(+e[n+1]+90)/360));a>G?a=G:a<-G&&(a=-G),t[n+1]=a}return t}function be(e,t,o,r){let i=e.length;o=o>1?o:2,r=r??o,t===void 0&&(o>2?t=e.slice():t=new Array(i));for(let n=0;n<i;n+=r)t[n]=180*e[n]/w,t[n+1]=360*Math.atan(Math.exp(e[n+1]/v))/Math.PI-90;return t}var et=6378137,ge=[-180,-90,180,90],tt=Math.PI*et/180,b=class extends M{constructor(t,o){super({code:t,units:"degrees",extent:ge,axisOrientation:o,global:!0,metersPerUnit:tt,worldExtent:ge})}},J=[new b("CRS:84"),new b("EPSG:4326","neu"),new b("urn:ogc:def:crs:OGC:1.3:CRS84"),new b("urn:ogc:def:crs:OGC:2:84"),new b("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new b("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new b("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];var Z={};function Ee(e){return Z[e]||Z[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function ye(e,t){Z[e]=t}var A={};function S(e,t,o){let r=e.getCode(),i=t.getCode();r in A||(A[r]={}),A[r][i]=o}function D(e,t){return e in A&&t in A[e]?A[e][t]:null}var V=.9996,p=.00669438,W=p*p,Y=W*p,T=p/(1-p),_e=Math.sqrt(1-p),R=(1-_e)/(1+_e),Ae=R*R,Q=Ae*R,ee=Q*R,Se=ee*R,Re=1-p/4-3*W/64-5*Y/256,ot=3*p/8+3*W/32+45*Y/1024,rt=15*W/256+45*Y/1024,it=35*Y/3072,nt=3/2*R-27/32*Q+269/512*Se,at=21/16*Ae-55/32*ee,st=151/96*Q-417/128*Se,lt=1097/512*ee,X=6378137;function ct(e,t,o){let r=e-5e5,a=(o.north?t:t-1e7)/V/(X*Re),s=a+nt*Math.sin(2*a)+at*Math.sin(4*a)+st*Math.sin(6*a)+lt*Math.sin(8*a),l=Math.sin(s),u=l*l,g=Math.cos(s),P=l/g,f=P*P,E=f*f,d=1-p*u,L=Math.sqrt(1-p*u),k=X/L,F=(1-p)/d,h=T*g**2,x=h*h,m=r/(k*V),N=m*m,O=N*m,ce=O*m,ue=ce*m,qe=ue*m,He=s-P/F*(N/2-ce/24*(5+3*f+10*h-4*x-9*T))+qe/720*(61+90*f+298*h+45*E-252*T-3*x),q=(m-O/6*(1+2*f+h)+ue/120*(5-2*h+28*f-3*x+8*T+24*E))/g;return q=U(q+I(Pe(o.number)),-Math.PI,Math.PI),[H(q),H(He)]}var Te=-80,Me=84,ut=-180,pt=180;function ft(e,t,o){e=U(e,ut,pt),t<Te?t=Te:t>Me&&(t=Me);let r=I(t),i=Math.sin(r),n=Math.cos(r),a=i/n,s=a*a,l=s*s,u=I(e),g=Pe(o.number),P=I(g),f=X/Math.sqrt(1-p*i**2),E=T*n**2,d=n*U(u-P,-Math.PI,Math.PI),L=d*d,k=L*d,F=k*d,h=F*d,x=h*d,m=X*(Re*r-ot*Math.sin(2*r)+rt*Math.sin(4*r)-it*Math.sin(6*r)),N=V*f*(d+k/6*(1-s+E)+h/120*(5-18*s+l+72*E-58*T))+5e5,O=V*(m+f*a*(L/2+F/24*(5-s+9*E+4*E**2)+x/720*(61-58*s+l+600*E-330*T)));return o.north||(O+=1e7),[N,O]}function Pe(e){return(e-1)*6-180+3}var dt=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function xe(e){let t=0;for(let i of dt){let n=e.match(i);if(n){t=parseInt(n[1]);break}}if(!t)return null;let o=0,r=!1;return t>32700&&t<32761?o=t-32700:t>32600&&t<32661&&(r=!0,o=t-32600),o?{number:o,north:r}:null}function we(e,t){return function(o,r,i,n){let a=o.length;i=i>1?i:2,n=n??i,r||(i>2?r=o.slice():r=new Array(a));for(let s=0;s<a;s+=n){let l=o[s],u=o[s+1],g=e(l,u,t);r[s]=g[0],r[s+1]=g[1]}return r}}function Oe(e){return xe(e)?new M({code:e,units:"m"}):null}function Ie(e){let t=xe(e.getCode());return t?{forward:we(ft,t),inverse:we(ct,t)}:null}var ht=[Ie],mt=[Oe];var bt=!0;function gt(e){bt=!(e===void 0?!0:e)}function Ce(e,t){if(t!==void 0){for(let o=0,r=e.length;o<r;++o)t[o]=e[o];t=t}else t=e.slice();return t}function oe(e){ye(e.getCode(),e),S(e,e,Ce)}function Et(e){e.forEach(oe)}function z(e){if(typeof e!="string")return e;let t=Ee(e);if(t)return t;for(let o of mt){let r=o(e);if(r)return r}return null}function ve(e){Et(e),e.forEach(function(t){e.forEach(function(o){t!==o&&S(t,o,Ce)})})}function yt(e,t,o,r){e.forEach(function(i){t.forEach(function(n){S(i,n,o),S(n,i,r)})})}function Le(e,t){return gt(),Ne(e,"EPSG:4326",t!==void 0?t:"EPSG:3857")}function ke(e,t){let o=Ne(e,t!==void 0?t:"EPSG:3857","EPSG:4326"),r=o[0];return(r<-180||r>180)&&(o[0]=de(r+180,360)-180),o}function _t(e,t){let o=e.getCode(),r=t.getCode(),i=D(o,r);if(i)return i;let n=null,a=null;for(let l of ht)n||(n=l(e)),a||(a=l(t));if(!n&&!a)return null;let s="EPSG:4326";if(a)if(n)i=te(n.inverse,a.forward);else{let l=D(o,s);l&&(i=te(l,a.forward))}else{let l=D(s,r);l&&(i=te(n.inverse,l))}return i&&(oe(e),oe(t),S(e,t,i)),i}function te(e,t){return function(o,r,i,n){return r=e(o,r,i,n),t(r,r,i,n)}}function Fe(e,t){let o=z(e),r=z(t);return _t(o,r)}function Ne(e,t,o){let r=Fe(t,o);if(!r){let i=z(t).getCode(),n=z(o).getCode();throw new Error(`No transform available between ${i} and ${n}`)}return r(e,void 0,e.length)}function Ue(e,t,o,r){let i=Fe(t,o);return fe(e,i,void 0,r)}function Tt(){ve(j),ve(J),yt(J,j,me,be)}Tt();var Ge="echtzeit",De="haltestellen",Ve="meldungen",Xe="liniennetz",We="mapset",Mt=[7.5,47.7,8.45,48.4],wt=Mt,re=Ue(wt,"EPSG:4326","EPSG:3857");window.fromLonLat=Le;window.toLonLat=ke;var c={bikeFrelo:"fahrradfrelo",bikeOthers:"fahrradandere",cargobikeFrelo:"cargobikefrelo",cargobikeOthers:"cargobikeandere",carGrf:"grueneflotte",carNatur:"naturenergie",carOthers:"autoandere",eroller:"e-roller",linesnetworkplan:Xe,mapset:We,mitfahrpunkte:"mitfahrpunkte",notifications:Ve,pois:"pois",realtime:Ge,sharedMobility:"sharedmobility",stations:De,tarifzonen:"tarifzonen",verkaufsstellen:"verkaufsstellen"},ao=Object.values(c),Ye=Object.values(c).filter(e=>![c.mapset,c.mitfahrpunkte,c.pois,c.stations,c.tarifzonen].includes(e)),so=[Ve,We,Ge,De,Xe,c.tarifzonen,c.verkaufsstellen,c.pois,c.sharedMobility],ze=Object.values(c).filter(e=>e!==c.tarifzonen&&e!==c.pois&&e!==c.realtime);var At='<a href="https://developer.geops.io/">geOps API key</a>',$e='<a href="https://developer.geops.io/apis/maps">geOps Maps API</a>',St='<a href="https://developer.geops.io/apis/stops">geOps Stops API</a>',ie='<a href="https://geops.com/en/solution/disruption-information">geOps MOCO API</a>',$='<a href="https://geops.com/en/solution/mapset">geOps Mapset API</a>',B='<a href="https://developer.geops.io/apis/realtime">geOps Realtime API</a>',Rt={apikey:{defaultValue:"5cc87b12d7c5370001c1d655cb6b0a94dc1a4b859313dc211675efd6",description:`Your ${At}`,public:!1},baselayer:{defaultValue:"de.rvf_moco",description:`The style's name from the ${$e}. <br/>Ex: base_dark_v2, base_bright_v2, ...`,public:!1},center:{description:"The center of the map in EPSG:3857 coordinates.<br/>Parameter required if extent is not set.",public:!0},details:{defaultValue:"true",description:"When a feature of a queryable layer is clicked, it displays informations about it.",public:!0,type:"boolean"},embed:{defaultValue:"false",description:"Toggle the embedded navigation mode.<br/>In this mode zooming with mouse wheel is deactivated and, on touch device, you can only navigate with two finger, a warning message is displayed to warn the user.",public:!0,type:"boolean"},extent:{defaultValue:re.join(","),description:"The map's extent in EPSG:3857 coordinates.<br/>Ex: 831634,5933959,940649,6173660 .<br/>Parameter required if center and zoom are not set.",public:!0},geolocation:{defaultValue:"true",description:"Toggle the display of the geolocation button or not.",public:!0,type:"boolean"},lang:{defaultValue:"de",description:"The language to use for the map. Supported languages are : de, en, fr, it.",public:!0},layers:{defaultValue:null,description:`A comma separated list of layers's name to make visible on load, others are hidden. If empty, all layers will be hidden except the baselayer.<br/>Layers available are ${Object.values(c).join(", ")}.`,public:!0},layersconfig:{description:`A JSON string to configure the layers and other components associated to it.<br/>
|
|
2
|
+
The layers available are : ${ze.toString()}.<br/>
|
|
3
|
+
Definition for a layer :
|
|
4
|
+
<pre style="font-size: 12px; overflow: auto;">{
|
|
5
|
+
"liniennetz": {
|
|
6
|
+
"link": {
|
|
7
|
+
"href": "https://www.rvf.de/fahrtinfo/netzplan",
|
|
8
|
+
"show": true,
|
|
9
|
+
"text": "Zu den Liniennetzpl\xE4nen"
|
|
10
|
+
},
|
|
11
|
+
"title": "Liniennetzpl\xE4ne"
|
|
12
|
+
}
|
|
13
|
+
"sharedmobility": {
|
|
14
|
+
"minZoom": 14
|
|
15
|
+
}
|
|
16
|
+
</pre>}
|
|
17
|
+
<br/>
|
|
18
|
+
where:
|
|
19
|
+
<ul style="list-style-type: disc; padding-left: 20px;">
|
|
20
|
+
<li><i>link</i> defined a external link displayed at the bottom of the detail view</li>
|
|
21
|
+
<ul style="list-style-type: disc; padding-left: 40px;">
|
|
22
|
+
<li><i>href</i> is the target of the link. The <i>href</i> can be template, for example for the meldungen layer you can use {{id}} to insert the id of the notification in the url.</li>
|
|
23
|
+
<li><i>text</i> is the text display as a link</li>
|
|
24
|
+
<li><i>show</i> show/hide the link in the details view</li>
|
|
25
|
+
</ul>
|
|
26
|
+
<li><i>featurelink</i> defined a external link used when you click on single feature in detail view</li>
|
|
27
|
+
<ul style="list-style-type: disc; padding-left: 40px;">
|
|
28
|
+
<li><i>href</i> is the target of the link. The <i>href</i> can be template, for example for the meldungen layer you can use {{id}} to insert the id of the notification in the url.</li>
|
|
29
|
+
</ul>
|
|
30
|
+
<li><i>title</i> is the title of the layer used in the details view header and in the layer tree, if not defined the layer name will be used.</li>
|
|
31
|
+
<li><i>minZoom</i> is the minimal zoom level at which the layer is visible (only <i>${c.sharedMobility}</i> layer).</li>
|
|
32
|
+
</ul>`,public:!0},layertree:{defaultValue:"true",description:"Show/hide the layers tree button in the toolbar.",public:!0,type:"boolean"},lineid:{description:"An id or a short/long name of a line to highlight. <br/>Ex: S1",public:!1},lnp:{defaultValue:"true",description:"Add the linesnetworkplans layer to the map. This layer will display lines network plans on the map.",public:!1,type:"boolean"},mainlink:{description:"A link displayed on bottom left of the map. The link can be a template, for example you can use {{x}} {{y}} {{z}} to insert the current position of the map in the url.<br/>Ex: http://mywebsite/mypage#map/{{x}}/{{y}}/{{z}}.",public:!0},mainlinktitle:{description:"A title for the mainlink, used as tooltip.",public:!0},mapset:{defaultValue:"false",description:"Add the mapset layer to the map. This layer will display mapset plans on the map. By default, it will load only the standard plans valid at the current time.",public:!0,type:"boolean"},mapsetplanid:{description:"An id of the mapset plan to display. Mostly for debugging purposes.",public:!1},mapsettags:{description:`The ${$} tags to get the plans from.`,public:!0},mapsettenants:{defaultValue:"rvf",description:`The ${$} tenant to get the plans from.`,public:!1},mapsettimestamp:{description:`The ${$} timestamp used to load valid standard plan. If not defined it will use the current time.`,public:!0},mapseturl:{defaultValue:"https://editor.mapset.io/api/v1/",description:`The ${$} url to use.`,public:!0},mapsurl:{defaultValue:"https://maps.geops.io",description:`The ${$e} url to use.`,public:!1},maxextent:{defaultValue:re.join(","),description:"The maximum extent of the map in EPSG:3857 coordinates.<br/>Ex: 831634,5933959,940649,6173660 .",public:!0},maxzoom:{defaultValue:"20",description:"The maximal zoom level of the map.",public:!0},minzoom:{description:"The minimal zoom level of the map.",public:!0},mots:{description:"Commas separated list of mots to display on the Realtime layer.<br/>Ex: rail,bus,coach,foot,tram,subway,gondola,funicular,ferry,car .",public:!1},notification:{defaultValue:"true",description:`Add the notification layer to the map. This layer will display informations about disruptions on the network. Data comes from
|
|
33
|
+
our ${ie} .`,public:!0,type:"boolean"},notificationat:{description:"An ISO date string used to display active notification at this date in the notification layer. If not defined the current date will be used.<br/>Ex: 2025-08-01T00:00:00Z .",public:!1},notificationid:{description:"An id of a notification to show details of.",public:!1},notificationlang:{defaultValue:"en,de,fr",description:"A comma separated list of languages supported by the notification, if a textual content is not available in the current lang it will try to display the content in one of these languages. Order is important. <br/>Supported languages are: en,de,fr,it",public:!0},notificationtenant:{defaultValue:"rvf",description:`The ${ie} tenant to get the notification from.`,public:!1},notificationurl:{defaultValue:"https://moco.geops.io/api/v2/",description:`The ${ie} url to use.`,public:!1},permalink:{defaultValue:"false",description:"if true, the current browser window url will be updated automatically with the parameters defined in the `permalinktemplate` attribute.",public:!0,type:"boolean"},permalinktemplate:{defaultValue:"#map/{{x}}/{{y}}/{{z}}",description:`A template string to read the current browser url. Hash (starting with #) and URL search parameters (starting with ?) are supported.<br/>
|
|
34
|
+
The template supports {{x}}, {{y}}, {{z}} and {{layers}} variables.<br/>
|
|
35
|
+
Ex: "?x={{x}}&y={{y}}&z={{z}}" or "#map/{{x}}/{{y}}/{{z}}" .`,public:!0},print:{defaultValue:"true",description:"Show/hide the print button in the toolbar.",public:!0,type:"boolean"},queryablelayers:{defaultValue:Ye.toString(),description:`A comma separated list of layers's name. The data of these layers will be queryable by click on the map (see selectedfeature event). If empty, all layers will not be queryable.<br/>
|
|
36
|
+
Layers available are ${Object.values(c).join(", ")}`,public:!0},realtime:{defaultValue:"true",description:`Add the realtime layer to the map. Data comes from the ${B} .`,public:!1,type:"boolean"},realtimebboxparameters:{defaultValue:"line_tags=RVF",description:"A space separated list of parameters to add to the realtime BBOX request to define custom behavior.<br/>Ex: graph=XXX line_tags=XXX.",public:!1},realtimeresturl:{defaultValue:"https://api.geops.io/tracker-http/v1/",description:`The ${B} REST API url to use for fetching infos about realtime data.`,public:!1},realtimetenant:{description:`The ${B} tenant to get the realtime data from.`,public:!1},realtimeurl:{defaultValue:"wss://api.geops.io/tracker-ws/v1/ws",description:`The ${B} url to use.`,public:!1},runs:{defaultValue:"false",description:"Shows the number of trips on a line in the sidebar, use only for debugging.",public:!0,type:"boolean"},search:{defaultValue:"false",description:"Toggle the search stops input.",public:!0,type:"boolean"},share:{defaultValue:"true",description:"Show/hide the share button in the toolbar.",public:!0,type:"boolean"},stationid:{description:"An id or a short/long name of a station to show details of.",public:!1},stopsurl:{defaultValue:"https://api.geops.io/stops/v1/",description:`The ${St} to use.`,public:!1},tenant:{description:"The tenant to use by default for all geOps APIs (Stops, Realtime, MOCO ...). Can be override for each API by other XXXXtenant parameters.",public:!1},toolbar:{defaultValue:"true",description:"Show/hide the toolbar on the top left.",public:!0,type:"boolean"},trainid:{description:"An id of a route to highlight on the map and to show details of.",public:!1},zoom:{description:"The zoom level of the map.",public:!0}},ne=Rt;var Pt={"mwc:attribute":{description:"Event fired when an web component's attribute is changed. The event data contains the list of all attributes and their values.",public:!1},"mwc:messageready":{description:"Only if the web-component is embedded in an iframe. Message event fired when the web component is ready to receive messages from parent window.",public:!1},"mwc:permalink":{description:"Event fired when the map's state changes. The event data contains the permalink URL search parameters as string.",public:!1},"mwc:selectedfeature":{description:"Event fired when a feature is selected on the map. The event data contains the selected feature in GeoJSON format.",public:!0},"mwc:singleclick":{description:"Event fired when the map is clicked. The event data contains the map coordinates in EPSG:3857 and the pixel coordinates.",public:!1},"mwc:stopssearchselect":{description:"Only when search attribute is 'true'. Event fired when a stop is selected in the stops search results. The event data contains the selected stop.",public:!1}},C=Pt;var xt='<a href="https://developer.geops.io/">geOps API key</a>',Be='<a href="https://geops.com/en/solution/disruption-information">geOps MOCO API</a>',Ot={apikey:{defaultValue:"5cc87b12d7c5370001c1d655cb6b0a94dc1a4b859313dc211675efd6",description:`Your ${xt}`,public:!1},lang:{defaultValue:"de",description:"The language to use for the notifications.",public:!0},notificationat:{description:"An ISO date string used to display active notification at this date in the notification layer. If not defined the current date will be used.<br/>Ex: 2025-08-01T00:00:00Z .",public:!1},notificationlang:{defaultValue:"en,de,fr",description:"A comma separated list of languages supported by the notification, if a textual content is not available in the current lang it will try to display the content in one of these languages. Order is important. <br/>Supported languages are: en,de,fr,it",public:!0},notificationtenant:{defaultValue:"rvf",description:`The ${Be} tenant to get the notification from.`,public:!1},notificationurl:{defaultValue:"https://moco.geops.io/api/v2/",description:`The ${Be} url to use.`,public:!1}},ae=Ot;var It='<a href="https://developer.geops.io/">geOps API key</a>',_='<a href="https://developer.geops.io/apis/stops">geOps Stops API</a>',vt={apikey:{description:`Your ${It}`,public:!0},bbox:{description:`The extent where to search the stops (minx,miny,maxx,maxy). See the ${_} documentation.`,public:!0},countrycode:{description:"The country code to filter the results (IT, DE, CH ...)",public:!0},event:{defaultValue:"mwc:stopssearchselect",description:"The event's name to listen to when a stop is selected.",public:!0},field:{description:`Which field to look up, default all of them, Possible values:id, name, coords. See the ${_} documentation.`,public:!0},lang:{defaultValue:"en",description:"The language to use for the search input texts. Supported languages are : de, en, fr, it.",public:!0},limit:{defaultValue:"5",description:`The number of suggestions to show. See the ${_} documentation.`,public:!0},mots:{description:`Commas separated list of mots used to filter the results (rail, bus, coach, foot, tram, subway, gondola, funicular, ferry, car). See the ${_} documentation.`,public:!0},onselect:{description:null,public:!1},params:{description:`JSON string with additional parameters to pass to the request to the API. Ex: {"{ 'key': 'value' }"}. See the ${_} documentation.`,public:!0},prefagencies:{description:`comma seperated list, order chooses which agency will be preferred as
|
|
37
|
+
ident_source (for id and code fields). Possible values: sbb, db. See the ${_} documentation.`,public:!0},reflocation:{description:`Coordinates in WGS84 (in lat,lon order) used to rank stops close to this position higher. See the ${_} documentation.`,public:!0},url:{defaultValue:"https://api.geops.io/stops/v1/",description:`The URL to the ${_}.`,public:!0}},se=vt;var Ct={"mwc:attribute":C["mwc:attribute"],"mwc:stopssearchselect":{description:"Event fired when a stop is selected in the stops search results. The event data contains the selected stop.",public:!0}},le=Ct;typeof window<"u"&&(window.MobilityMapAttributes=ne,window.MobilityMapEvents=C,window.MobilitySearchAttributes=se,window.MobilitySearchEvents=le,window.MobilityNotificationsAttributes=ae);var Mo={MobilityMapAttributes:ne,MobilityMapEvents:C,MobilityNotificationsAttributes:ae,MobilitySearchAttributes:se,MobilitySearchEvents:le};})();
|
package/package.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"name": "@geops/rvf-mobility-web-component",
|
|
3
3
|
"license": "UNLICENSED",
|
|
4
4
|
"description": "Web components for rvf in the domains of mobility and logistics.",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.127-beta.0",
|
|
6
6
|
"homepage": "https://rvf-mobility-web-component.vercel.app/",
|
|
7
7
|
"type": "module",
|
|
8
|
-
"main": "index.js",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"graphql": "^16.10.0",
|
|
11
11
|
"graphql-request": "^7.1.2",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"analyze": "yarn build && esbuild-analyzer . --port 8888",
|
|
64
|
-
"build": "yarn build:css && yarn build:js &&
|
|
64
|
+
"build": "rm -rf dist/* && yarn build:css && yarn build:js && rm -rf doc/public/*.js* && cp dist/* doc/public/",
|
|
65
65
|
"build:css": "yarn tailwind:component && yarn tailwind:website",
|
|
66
66
|
"build:js": "node scripts/build.mjs",
|
|
67
67
|
"cp": "generact --root src",
|
package/scripts/build.mjs
CHANGED
package/scripts/dev.mjs
CHANGED
|
@@ -8,9 +8,12 @@ const ctx = await esbuild.context({
|
|
|
8
8
|
".png": "dataurl",
|
|
9
9
|
".svg": "dataurl",
|
|
10
10
|
},
|
|
11
|
-
outdir: "
|
|
11
|
+
outdir: "dist",
|
|
12
12
|
plugins: [sassPlugin({ type: "css-text" })],
|
|
13
13
|
sourcemap: true,
|
|
14
|
+
splitting: true,
|
|
15
|
+
format: "esm",
|
|
16
|
+
// minify: true,
|
|
14
17
|
});
|
|
15
18
|
|
|
16
19
|
const { host, port } = await ctx.serve({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { lazy, Suspense } from "preact/compat";
|
|
1
2
|
import { twMerge } from "tailwind-merge";
|
|
2
3
|
|
|
3
|
-
import
|
|
4
|
+
import Loading from "../icons/Loading";
|
|
4
5
|
import LayerTreeMenu from "../LayerTreeMenu";
|
|
5
6
|
import OverlayDetails from "../OverlayDetails";
|
|
6
7
|
import OverlayHeader from "../OverlayHeader";
|
|
@@ -10,6 +11,9 @@ import useI18n from "../utils/hooks/useI18n";
|
|
|
10
11
|
import useMapContext from "../utils/hooks/useMapContext";
|
|
11
12
|
|
|
12
13
|
const contentClassName = `relative h-full overflow-x-hidden overflow-y-auto text-base bg-white`;
|
|
14
|
+
const LazyExportMenu = lazy(() => {
|
|
15
|
+
return import("../ExportMenu");
|
|
16
|
+
});
|
|
13
17
|
|
|
14
18
|
function OverlayContent({
|
|
15
19
|
hasDetails,
|
|
@@ -47,9 +51,18 @@ function OverlayContent({
|
|
|
47
51
|
}}
|
|
48
52
|
title={t("print_menu_title")}
|
|
49
53
|
></OverlayHeader>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
|
|
55
|
+
<Suspense
|
|
56
|
+
fallback={
|
|
57
|
+
<div className={"flex w-full items-center justify-start p-4"}>
|
|
58
|
+
<Loading />
|
|
59
|
+
</div>
|
|
60
|
+
}
|
|
61
|
+
>
|
|
62
|
+
<LazyExportMenu
|
|
63
|
+
className={twMerge(contentClassName, "flex flex-col gap-4 p-4")}
|
|
64
|
+
/>
|
|
65
|
+
</Suspense>
|
|
53
66
|
</>
|
|
54
67
|
)}
|
|
55
68
|
{hasLayerTree && isLayerTreeOpen && (
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { memo } from "react";
|
|
2
|
+
|
|
3
|
+
function Loading() {
|
|
4
|
+
return (
|
|
5
|
+
<svg
|
|
6
|
+
aria-hidden="true"
|
|
7
|
+
className="h-8 w-8 animate-spin"
|
|
8
|
+
fill="none"
|
|
9
|
+
viewBox="0 0 100 101"
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
>
|
|
12
|
+
<path
|
|
13
|
+
d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
|
|
14
|
+
fill="lightGray"
|
|
15
|
+
/>
|
|
16
|
+
<path
|
|
17
|
+
d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
|
|
18
|
+
fill="currentColor"
|
|
19
|
+
/>
|
|
20
|
+
</svg>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default memo(Loading);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Loading";
|
package/.vscode/settings.json
DELETED