hi-ucs/front/public/leaflet/libs/openlayers/plugins/ol-mapbox-style/2.11.2/olms.js

12 lines
42 KiB
Vue
Raw Normal View History

2022-06-14 09:32:49 +08:00
/*!
*
* ol-mapbox-style
* Copyright 2016-present Boundless Spatial
* Copyright© 2000-2018 SuperMap Software Co. Ltd
* github: https://github.com/boundlessgeo/ol-mapbox-style
* github: https://github.com/SuperMap/ol-mapbox-style
* license: BSD 2-Clause "Simplified" License
* version: v3.0.0-beta.7
*
*/
olms=function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=35)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=function(e,t,n,o,f,p,y,m){if(!o){o=[];for(var O=78271.51696402048;o.length<21;O/=2)o.push(O)}if("string"==typeof t&&(t=JSON.parse(t)),8!=t.version)throw new Error("glStyle version 8 required.");if(p&&!y){var A=new Image;A.crossOrigin="anonymous",A.onload=function(){y=A,[A.width,A.height],e.changed()},A.src=p}var F=document.createElement("CANVAS").getContext("2d"),I={};function L(e,t,n){var o=n+","+t+","+e,r=I[o];if(!r){F.font=t;for(var a=F.measureText("M").width*n,i=e.split(" "),l="",s=[],u=0,c=i.length;u<c;++u){var d=i[u];F.measureText(l+d).width<=a?l+=(l?" ":"")+d:(l&&s.push(l),l=d)}l&&s.push(l),I[o]=r=s.join("\n")}return r}for(var G=(0,d.default)(t.layers),N={},D=[],B=void 0,z=0,j=G.length;z<j;++z){var E=G[z],Z=E.id;if("string"==typeof n&&E.source==n||-1!==n.indexOf(Z)){var K=E["source-layer"];B||(B=E.source);var J=N[K];J||(J=N[K]=[]),J.push({layer:E,index:z}),D.push(Z)}delete b[Z],delete M[Z]}var q={},H=[],V={},U=function(e,t){var n=e.getProperties();e.styleIds=e.styleIds||{};var d=N[n.layer];if(d){var p=o.indexOf(t);-1==p&&(p=Math.round((0,h.getZoomForResolution)(t,o)));for(var m=S[e.getGeometry().getType()],b={properties:n,type:m},O=-1,M=0,A=d.length;M<A;++M){var F=d[M],I=F.layer,G=I.id,D=I.layout||R,B=I.paint||R;if(!("none"===D.visibility||"minzoom"in I&&p<I.minzoom||"maxzoom"in I&&p>=I.maxzoom)){e.styleIds[p]=e.styleIds[p]||[];var z=I.filter,j=void 0,E=void 0;if(!z||C(G,z,b)){var Z=void 0,K=void 0,J=void 0,U=void 0,_=void 0,W=void 0,Y=F.index;if(3==m)if("fill-pattern"in B){var Q=x(G,B,"fill-pattern",p,n);if(Q&&(j=T(Q,n),y&&f&&f[j])){++O,-1===e.styleIds[p].indexOf(G)&&e.styleIds[p].push(G),(W=H[O])&&W.getFill()&&!W.getStroke()&&!W.getText()||(W=H[O]=new r.default({fill:new a.default})),J=W.getFill(),W.setZIndex(Y);var $=V[j];if(!$){var X=f[j],ee=document.createElement("canvas");ee.width=X.width,ee.height=X.height;var te=ee.getContext("2d");te.drawImage(y,X.x,X.y,X.width,X.height,0,0,X.width,X.height),$=te.createPattern(ee,"repeat"),V[j]=$}J.setColor($)}}else"fill-color"in B&&(K=x(G,B,"fill-opacity",p,n),(Z=P(x(G,B,"fill-color",p,n),K))&&(++O,-1===e.styleIds[p].indexOf(G)&&e.styleIds[p].push(G),(W=H[O])&&W.getFill()&&!W.getStroke()&&!W.getText()||(W=H[O]=new r.default({fill:new a.default})),(J=W.getFill()).setColor(Z),W.setZIndex(Y)),"fill-outline-color"in B?_=P(x(G,B,"fill-outline-color",p,n),K):"fill-antialias"in B&&(_=Z),_&&(++O,-1===e.styleIds[p].indexOf(G)&&e.styleIds[p].push(G),(W=H[O])&&W.getStroke()&&!W.getFill()&&!W.getText()||(W=H[O]=new r.default({stroke:new i.default})),(U=W.getStroke()).setLineCap(v["line-cap"]),U.setLineJoin(v["line-join"]),U.setMiterLimit(v["line-miter-limit"]),U.setColor(_),U.setWidth(1),U.setLineDash(null),W.setZIndex(Y)));1!=m&&function(){Z=!("line-pattern"in B)&&"line-color"in B?P(x(G,B,"line-color",p,n),x(G,B,"line-opacity",p,n)):void 0;var t=x(G,B,"line-width",p,n);Z&&t>0&&(++O,-1===e.styleIds[p].indexOf(G)&&e.styleIds[p].push(G),(W=H[O])&&W.getStroke()&&!W.getFill()&&!W.getText()||(W=H[O]=new r.default({stroke:new i.default})),(U=W.getStroke()).setLineCap(x(G,D,"line-cap",p,n)),U.setLineJoin(x(G,D,"line-join",p,n)),U.setMiterLimit(x(G,D,"line-miter-limit",p,n)),U.setColor(Z),U.setWidth(t),U.setLineDash(B["line-dasharray"]?x(G,B,"line-dasharray",p,n).map(fun