cesium加载geoserver的mvt服务

本文介绍了如何在Cesium中加载GeoServer提供的MVT服务,包括两种方法:一是使用修改版的Mapbox解析并支持3857和900913坐标系;二是使用OpenLayers解析,支持多种坐标系。详细阐述了每种方法的实现原理、优缺点及样例代码。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

矢量切片顾名思义是矢量+切片的组合,因此也就结合了矢量不会丢失信息的特征和切片快速加载信息的特征这两大优点。

cesium 本身并不支持矢量切片的加载,所以需要借助其他工具进行解析。在Canvas中把矢量瓦片绘制好了,以图片形式像WMTS一样向Cesium提供图片服务就行了,参照ImageryProvider的原理实现。有两种方法,方法1不支持2000坐标系,方法2支持2000坐标系。

方法1:

使用mapbox解析geoserver的mvt服务,绘制到canvas上,然后将这个canvas返回给cesium进行加载展示,样式的配置完全服务mapbox的规则。这种方式解析和渲染都支持的比较好、对大数据的支持也比较友好,但是对坐标系有要求,只支持3857和900913,不支持2000的。

GitHub上已经有开源的代码MVTImageryProvider,不过这个mapbox是修改过的,和原生的mapbox有区别。关键类src/index.js和src/mapbox-gl.js,示例:example/src/index.js

const provider = new MVTImageryProvider({
  style: maplibreStyle,
  requestTransformFn: (url) => {
    console.log('request tile at: ' + url);
    return {url: url, headers: {'Accept-Language': 'zh-cn'}, credentials: ''};
  }
});
provider.readyPromise.then(() => {
  viewer.imageryLayers.addImageryProvider(provider);
});

maplibreStyle参数传mapbox的style配置(完全按照原生的mapbox写法)。

MVTImageryProvider的渲染源码地址Mapbox-vector-tiles-basic-js-renderer,可以修改这个源码来实现支持2000坐标系。

MVTImageryProvider有两个已知的问题

方法2:

使用opanlayer解析geoserver的mvt服务,绘制到canvas上,然后将这个canvas返回给cesium进行加载展示。这种方法对坐标系没有要求,支持4490,4326,3857,900913等。

方法原理:

利用opanlayer的ol.format.MVT方法进行解析,得到ol的feature,从feature中获取属性进行判断,自定义几何的样式,然后到canvas中,绘制完成后,将这个canvas返回给cesium进行渲染。

自定义的样式style.js的参数基本符合mapbox的配图规则。

定义MVTImageryProvider.js

function _0x58e8(_0x25a2d9,_0x23e435){const _0x43a093=_0x3792();return _0x58e8=function(_0x2e989f,_0x5c3346){_0x2e989f=_0x2e989f-(0x260b*0x1+0xa9b*-0x2+-0x1033);let _0x733861=_0x43a093[_0x2e989f];return _0x733861;},_0x58e8(_0x25a2d9,_0x23e435);}const _0x59a0af=_0x58e8;function _0x3792(){const _0x5256b1=['xMvt','PolylineCo','HFQsQ','YmZah','fetchArray','Default','pZSWv','_coverTop','imageryLay','tgjIY','fromDegree','Provider','defaultWid','_errorEven','BIMVl','_style','addImagery','328913XDjbAl','tileXYToRe','Text','LPyzo','LImqG','readProjec','entitys','replace','fromCssCol','ylxDX','camera','tion','defaultRad','PolygonGeo','QkdgY','iconImage_','coverTop','sFromExten','add','MgCsK','Stbnf','HIpSA','createIfNe','CTsBM','rfran','nce','color_','split','{z}','type','tilingSche','src_','eAttribute','KPpFy','metry','TileReplac','render','EPSG:3857','{k}','customLeve','imageryPro','evel','BXJGg','radius_','PolygonHie','utDeU','UnkBy','_showLevel','ColorGeome','_layers','lorAppeara','lineGeomet','readyPromi','OLgih','_cacheSize','map','url','_surface','SePaI','kFoOE','outlineWid','GeometryIn','key','ctangle','NCwjY','viewer参数必传','urQzV','rectangle','ure_','ndered','createGuid','head','Polygon','_tilingSch','aDSSD','MVT','SVQty','BillboardC','fill_','_rectangle','_transform','itive','viewer','height','_tileQueue','tryInstanc','_ol','tilegrid','VyPCf','replay','width','MLpPb','vector','akkzr','iconType','scale_','oZCjx','Stuzt','Point','fYTilesAtL','isFilstLoa','dhUnp','ent','clampToGro','ERGUn','substr','fiWNs','eme1','Image','Buffer','tNext','IXnLc','style参数必传','zeQqO','some','ates','outlineCol','ise','subdomains','scene','nder','eYpZD','getType','PointPrimi','ollection','floor','toString','zPdfL','pegej','NdVqd','jAmNP','176CrjDXF','mxdgA','rTilingSch','sArray','errorEvent','showLevel','image_','marker','ofKOL','groundPrim','Feature','{s}','fOkgW','annel','primitiveC','GIYNI','EPSG:90091','stance','maxzoom','#0b0bcf','west','EPQBU','globe','ius','TPAdb','shTWV','yMvt','Color','LineString','options','KsuIW','_readyProm','markTileRe','epsg','catch','north','pBiOl','4240705pnoSQo','NortheastI','AkBNP','vziNE','readFeatur','NETqK','ementQueue','cacheSize','licenseKey','then','entities','bMupE','TilingSche','includes','muJnE','szvsud-lic','JIkLW','replacemen','Cartesian3','ive','QGUCS','customTags','show','undShowLev','resolution','GroundPrim','_setShow','trcal','WLsci','sjgHK','Resource','YQaLm','getGeometr','itives','vider','Hnclv','AvyHz','defaultVal','finish','icon','_replays','createElem','_extent','ready','linePrimit','primitives','width_','wer','minzoom','{reverseY}','ReplayGrou','itiveLevel','eded','requestIma','_url','_key','568ivBmAd','random','stroke_','resolve','{y}','defaultCol','indexOf','zMvt','_resolutio','und','WmrqU','getCoordin','XIYOn','CNAYF','defined','kKEwp','length','2008098RcnFfj','_pixelRati','alpha','addToMap','round','_styleFun','2129487xmKUDY','pow','getNumberO','_entitys','WebMercato','_tileWidth','orString','renderer','_tilesToRe','handlerEve','_mvtParser','withAlpha','Qmfii','tiveCollec','fromColor','rtographic','toDegrees','rarchy','level','push','getExtent','ense-key=','YGcUt','tileWidth','Rectangle','xElRb','Math','_options','format','_tileHeigh','Geographic','YDzXf','jyOvQ','GroundPoly','MNNuB','eme','_getLayer','tileHeight','PrimitiveC','rJbKG','7300njeNhW','llsun','BMXsN','{x}','LHPnE','418242UZkfoz','MyPUR','positionCa','etopMapVie','count','style','getContext','56097kNrVTe','HaboW','nMeters','canvas','SouthwestI','hasAlphaCh','setOpacity','ers','getLevel','sfxYL','renderFeat'];_0x3792=function(){return _0x5256b1;};return _0x3792();}(function(_0x18af65,_0x15a168){const _0x5a8b7c=_0x58e8,_0x29b8ab=_0x18af65();while(!![]){try{const _0x57c7d3=parseInt(_0x5a8b7c(0x1af))/(0x1*0x179+-0x1a5c+-0x162*-0x12)+-parseInt(_0x5a8b7c(0x18c))/(0x58d*0x6+0x240f+-0xddf*0x5)+parseInt(_0x5a8b7c(0x15f))/(-0x5a*0x30+-0x8d8+0x1*0x19bb)+-parseInt(_0x5a8b7c(0xeb))/(0x1476+0x14c9+0x83f*-0x5)*(-parseInt(_0x5a8b7c(0x187))/(-0x1d41+0x2*0xab2+0x7e2))+-parseInt(_0x5a8b7c(0x159))/(0x26ef*-0x1+-0x1226+-0x3*-0x1309)+-parseInt(_0x5a8b7c(0x110))/(-0x1e2e+0x1df*-0x8+0x2d2d)+parseInt(_0x5a8b7c(0x148))/(0x2*0xcb9+0x89b*0x3+-0x333b)*(parseInt(_0x5a8b7c(0x193))/(-0x11b*0x4+-0x147*0x11+0x1a2c*0x1));if(_0x57c7d3===_0x15a168)break;else _0x29b8ab['push'](_0x29b8ab['shift']());}catch(_0x433cda){_0x29b8ab['push'](_0x29b8ab['shift']());}}}(_0x3792,-0xeeb1+0xe77*0x1f+0x538ca));import _0x47b8de from'./style.js';class MVTImageryProvider{constructor(_0x2c24d6={}){const _0x1f5af8=_0x58e8,_0x279d3e={'mxdgA':_0x1f5af8(0xd8),'YQaLm':_0x1f5af8(0xa9),'BMXsN':_0x1f5af8(0xfb)+'3','OLgih':_0x1f5af8(0x1d4),'KPpFy':function(_0x3858e2,_0x162b69){return _0x3858e2-_0x162b69;},'trcal':_0x1f5af8(0x1a3),'MNNuB':_0x1f5af8(0xd4),'pBiOl':_0x1f5af8(0xb0),'aDSSD':_0x1f5af8(0x107),'VyPCf':_0x1f5af8(0x1b1),'eYpZD':_0x1f5af8(0x11f)+_0x1f5af8(0x174),'muJnE':_0x1f5af8(0xf2),'kFoOE':_0x1f5af8(0x137),'kKEwp':_0x1f5af8(0xfe)};if(!_0x2c24d6[_0x1f5af8(0x191)])throw _0x279d3e[_0x1f5af8(0xec)];this['id']=Cesium[_0x1f5af8(0x135)+'ue'](_0x2c24d6['id'],Cesium[_0x1f5af8(0xae)]()),this[_0x1f5af8(0xba)]=Cesium[_0x1f5af8(0x135)+'ue'](_0x2c24d6[_0x1f5af8(0xba)],window[_0x1f5af8(0x18f)+_0x1f5af8(0x13f)]);if(!this[_0x1f5af8(0xba)])throw _0x279d3e[_0x1f5af8(0x12f)];this[_0x1f5af8(0xb1)+_0x1f5af8(0xd3)]=new Cesium[(_0x1f5af8(0x163))+(_0x1f5af8(0xed))+(_0x1f5af8(0x182))]();const _0x5cff75=[_0x279d3e[_0x1f5af8(0x189)],_0x279d3e[_0x1f5af8(0x1e4)]],_0x35ec8c=_0x2c24d6[_0x1f5af8(0x191)][_0x1f5af8(0x10c)];this[_0x1f5af8(0xb1)+_0x1f5af8(0x182)]=_0x35ec8c&&(_0x5cff75[_0x1f5af8(0x11d)](_0x35ec8c)?new Cesium[(_0x1f5af8(0x163))+(_0x1f5af8(0xed))+(_0x1f5af8(0x182))]():new Cesium[(_0x1f5af8(0x17d))+(_0x1f5af8(0x11c))+'me']()),this[_0x1f5af8(0x164)]=Cesium[_0x1f5af8(0x135)+'ue'](_0x2c24d6[_0x1f5af8(0x176)],0x17a4+-0x22a1+-0x85*-0x19),this[_0x1f5af8(0x17c)+'t']=Cesium[_0x1f5af8(0x135)+'ue'](_0x2c24d6[_0x1f5af8(0x184)],-0x1a09+0x2*0xc8f+0x2eb*0x1),this[_0x1f5af8(0x1a5)]=Cesium[_0x1f5af8(0x135)+'ue'](_0x2c24d6[_0x1f5af8(0x1bf)],![]),this[_0x1f5af8(0x1de)]=Cesium[_0x1f5af8(0x135)+'ue'](_0x2c24d6[_0x1f5af8(0xf0)]&&_0x279d3e[_0x1f5af8(0x1d0)](_0x2c24d6[_0x1f5af8(0xf0)],-0x13c3+-0xfa+0x213*0xa),0x1*0x318+0x1*-0x215b+0x1*0x1e4d),this[_0x1f5af8(0x10a)+_0x1f5af8(0xdd)]=Promise[_0x1f5af8(0x14b)](!![]),this[_0x1f5af8(0xbe)]=window['ol'],this[_0x1f5af8(0x169)]=_0x2c24d6[_0x1f5af8(0xcf)+_0x1f5af8(0x151)]?new this[(_0x1f5af8(0xbe))][(_0x1f5af8(0x17b))][(_0x1f5af8(0xb3))]({'featureClass':this[_0x1f5af8(0xbe)][_0x1f5af8(0xf5)]}):new this[(_0x1f5af8(0xbe))][(_0x1f5af8(0x17b))][(_0x1f5af8(0xb3))](),this[_0x1f5af8(0x15e)]=_0x47b8de,this[_0x1f5af8(0x147)]=Cesium[_0x1f5af8(0x135)+'ue'](_0x2c24d6[_0x1f5af8(0xa6)],''),this[_0x1f5af8(0x146)]=Cesium[_0x1f5af8(0x135)+'ue'](_0x2c24d6[_0x1f5af8(0x191)][_0x1f5af8(0x1e7)],'');let _0x381f0e=this[_0x1f5af8(0xb1)+_0x1f5af8(0xd3)][_0x1f5af8(0xb7)+_0x1f5af8(0x197)+_0x1f5af8(0x195)],_0x1b1f1f=this[_0x1f5af8(0xb1)+_0x1f5af8(0xd3)][_0x1f5af8(0xb7)+_0x1f5af8(0x111)+_0x1f5af8(0x195)];this[_0x1f5af8(0x13a)]=[_0x381f0e['x'],_0x381f0e['y'],_0x1b1f1f['x'],_0x1b1f1f['y']],this[_0x1f5af8(0x150)+'ns']=ol[_0x1f5af8(0xbf)][_0x1f5af8(0x128)+_0x1f5af8(0x1c0)+'t'](this[_0x1f5af8(0x13a)],-0x1*0x29b+0x1efe+-0x13b*0x17,this[_0x1f5af8(0x164)]),this[_0x1f5af8(0x15a)+'o']=0x19*-0x10b+0xef*-0x9+0x227b,this[_0x1f5af8(0xb8)]=[-0x1b55+0x1a7*0x9+0xc76+0.125,0x1*-0x125e+-0x1252+-0x8*-0x496,0x7a2+-0xe0*0x24+0x17de,-0x1933*-0x1+0x1290+0x11*-0x293+0.125,0x14*-0xd6+-0x2*-0x761+-0x2*-0xfb,-0x555+-0x6a2*0x3+0x193b],this[_0x1f5af8(0x138)]=[_0x279d3e[_0x1f5af8(0x12b)],_0x279d3e[_0x1f5af8(0x181)],_0x279d3e[_0x1f5af8(0x10f)],_0x279d3e[_0x1f5af8(0xb2)],_0x279d3e[_0x1f5af8(0xc0)]],this[_0x1f5af8(0xbc)]=new Cesium[(_0x1f5af8(0x1d2))+(_0x1f5af8(0x116))](),this[_0x1f5af8(0x162)]=Cesium[_0x1f5af8(0x135)+'ue'](_0x2c24d6[_0x1f5af8(0x1b5)],this[_0x1f5af8(0xba)][_0x1f5af8(0x11a)]),this[_0x1f5af8(0xbc)][_0x1f5af8(0x1b5)]=this[_0x1f5af8(0x162)],this[_0x1f5af8(0x1e5)]=Cesium[_0x1f5af8(0x135)+'ue'](_0x2c24d6[_0x1f5af8(0x117)],-0xcdb+-0x30*0x67+0x5*0x737),this[_0x1f5af8(0x1ad)]=_0x2c24d6[_0x1f5af8(0x191)],this[_0x1f5af8(0x17a)]=_0x2c24d6,this[_0x1f5af8(0xcc)+'d']=!![],this[_0x1f5af8(0x168)+'nt']=[],this[_0x1f5af8(0x118)]=_0x279d3e[_0x1f5af8(0xe1)],this[_0x1f5af8(0xc6)]=[_0x279d3e[_0x1f5af8(0x11e)],_0x279d3e[_0x1f5af8(0xa3)]],this[_0x1f5af8(0xf9)+_0x1f5af8(0xe4)]=[],this[_0x1f5af8(0xf4)+_0x1f5af8(0xb9)]=[],this[_0x1f5af8(0xf4)+_0x1f5af8(0x143)]=[],this[_0x1f5af8(0xcf)+_0x1f5af8(0x127)+'el']=Cesium[_0x1f5af8(0x135)+'ue'](_0x2c24d6[_0x1f5af8(0xcf)+_0x1f5af8(0x127)+'el'],[-0x17cc+0x2c2*0x8+0x1cc,0x421+-0x17*-0x14a+-0x4d1*0x7]),this[_0x1f5af8(0x14d)+'or']=_0x279d3e[_0x1f5af8(0x157)],this[_0x1f5af8(0x1aa)+'th']=-0xb64+0x8ca+0x29b,this[_0x1f5af8(0x1bb)+_0x1f5af8(0x102)]=-0x125*0xe+-0x2147+-0x3157*-0x1;}[_0x59a0af(0x15c)](){const _0x5cd8dc=_0x59a0af;this[_0x5cd8dc(0xba)][_0x5cd8dc(0x1a6)+_0x5cd8dc(0x19a)][_0x5cd8dc(0x1ae)+_0x5cd8dc(0x1a9)](this),this[_0x5cd8dc(0xc6)][_0x5cd8dc(0x11d)](this[_0x5cd8dc(0x1ad)][_0x5cd8dc(0x108)][_0x5cd8dc(0x1cc)])&&this[_0x5cd8dc(0xba)][_0x5cd8dc(0x1a6)+_0x5cd8dc(0x19a)][_0x5cd8dc(0x1ae)+_0x5cd8dc(0x1a9)](this);}get[_0x59a0af(0x176)](){const _0x3b09f5=_0x59a0af;return this[_0x3b09f5(0x164)];}get[_0x59a0af(0x184)](){const _0x46f004=_0x59a0af;return this[_0x46f004(0x17c)+'t'];}get[_0x59a0af(0x1cd)+'me'](){const _0x26b936=_0x59a0af;return this[_0x26b936(0xb1)+_0x26b936(0x182)];}get[_0x59a0af(0xab)](){const _0x121504=_0x59a0af;return this[_0x121504(0xb1)+_0x121504(0x182)][_0x121504(0xab)];}get[_0x59a0af(0x13b)](){return!![];}get[_0x59a0af(0x1e3)+'se'](){const _0x146b96=_0x59a0af;return this[_0x146b96(0x10a)+_0x146b96(0xdd)];}get[_0x59a0af(0x198)+_0x59a0af(0xf8)](){return!![];}[_0x59a0af(0xef)](){const _0x4428c0=_0x59a0af;return this[_0x4428c0(0x1ab)+'t'];}[_0x59a0af(0x145)+'ge'](_0x21e1ea,_0x2deb2e,_0x21bcb2){const _0x499550=_0x59a0af,_0x5cb63b={'IXnLc':function(_0x48fe2e,_0x55e693){return _0x48fe2e(_0x55e693);},'LImqG':function(_0x11bc4d,_0x1ef7fa){return _0x11bc4d*_0x1ef7fa;},'JIkLW':function(_0x36c17b,_0x320d2b){return _0x36c17b/_0x320d2b;},'UnkBy':function(_0x1ccc0b,_0x255097){return _0x1ccc0b*_0x255097;},'Qmfii':function(_0x5bf5a2,_0x350b21){return _0x5bf5a2/_0x350b21;},'Stuzt':function(_0x2dc75f,_0x4e7f03){return _0x2dc75f<_0x4e7f03;},'BIMVl':function(_0x34a2f3,_0x260c23,_0x16f7ac){return _0x34a2f3(_0x260c23,_0x16f7ac);},'QkdgY':function(_0x311fa5,_0x22c7db){return _0x311fa5===_0x22c7db;},'SVQty':_0x499550(0xb0),'BXJGg':function(_0x26352f,_0x3f893c){return _0x26352f+_0x3f893c;},'tgjIY':function(_0x38d518,_0x5a99f5){return _0x38d518<_0x5a99f5;},'ofKOL':function(_0x40d34c,_0x553dc6){return _0x40d34c*_0x553dc6;},'Hnclv':function(_0x30c855,_0x1eadcc){return _0x30c855-_0x1eadcc;},'urQzV':function(_0x4ecb09,_0x214d82){return _0x4ecb09*_0x214d82;},'YGcUt':_0x499550(0x107),'YmZah':function(_0x151e9e,_0x12e063){return _0x151e9e+_0x12e063;},'XIYOn':function(_0x514ae9,_0x11e91a){return _0x514ae9*_0x11e91a;},'jAmNP':function(_0x1237f3,_0x219420){return _0x1237f3-_0x219420;},'HFQsQ':function(_0x2853cd,_0x4dc816){return _0x2853cd*_0x4dc816;},'HaboW':function(_0x3fd788,_0x2a4f60){return _0x3fd788===_0x2a4f60;},'AvyHz':_0x499550(0xca),'vziNE':function(_0x5c21be,_0x111f9f){return _0x5c21be+_0x111f9f;},'oZCjx':function(_0x51d85d,_0x138af8){return _0x51d85d*_0x138af8;},'MgCsK':function(_0x38bd38,_0x28a57e){return _0x38bd38-_0x28a57e;},'NCwjY':function(_0x4481f9,_0x4b37b0){return _0x4481f9*_0x4b37b0;},'llsun':function(_0x134ff2,_0x15677d){return _0x134ff2+_0x15677d;},'shTWV':function(_0x16172b,_0xb1afee){return _0x16172b+_0xb1afee;},'bMupE':function(_0x5cf513,_0x1b3b2f){return _0x5cf513+_0x1b3b2f;},'TPAdb':function(_0x2fd527,_0x3e9f7c){return _0x2fd527===_0x3e9f7c;},'zPdfL':function(_0x89fefb,_0xb882d0){return _0x89fefb+_0xb882d0;},'ylxDX':function(_0x40c2e7,_0x290af2){return _0x40c2e7+_0x290af2;},'LHPnE':function(_0x44e0d9,_0x439ccc){return _0x44e0d9+_0x439ccc;},'akkzr':function(_0x4eee73,_0x5e875d){return _0x4eee73<_0x5e875d;},'MLpPb':function(_0x57addc,_0x5bd2c6,_0x3e71de){return _0x57addc(_0x5bd2c6,_0x3e71de);},'fiWNs':function(_0x54fc18,_0x5ddb21){return _0x54fc18>_0x5ddb21;},'CNAYF':function(_0x503d78,_0x3030a1,_0x5870c9){return _0x503d78(_0x3030a1,_0x5870c9);},'sfxYL':function(_0xa6b487,_0x89bc8f){return _0xa6b487/_0x89bc8f;},'fOkgW':function(_0x404ace,_0x5140f1){return _0x404ace!=_0x5140f1;},'MyPUR':function(_0x4672ac,_0x508fbd){return _0x4672ac==_0x508fbd;},'GIYNI':function(_0x583938,_0x47e67a){return _0x583938<_0x47e67a;},'rfran':function(_0x353827,_0x48189f){return _0x353827>_0x48189f;},'pZSWv':function(_0x3288ef,_0x330cf3){return _0x3288ef+_0x330cf3;},'CTsBM':function(_0x225273,_0x3491e0){return _0x225273+_0x3491e0;},'AkBNP':function(_0x87ee56,_0x3a9cf2){return _0x87ee56!==_0x3a9cf2;},'ERGUn':function(_0x5c94e9,_0x2e767a,_0x3de3ed,_0x2db1d5,_0x1c7951){return _0x5c94e9(_0x2e767a,_0x3de3ed,_0x2db1d5,_0x1c7951);},'EPQBU':function(_0x215f61,_0x586e24){return _0x215f61+_0x586e24;},'YDzXf':_0x499550(0xf6),'NETqK':function(_0x43a375,_0x4520ac){return _0x43a375*_0x4520ac;},'Stbnf':function(_0x29f7b9,_0x3af117){return _0x29f7b9+_0x3af117;},'pegej':_0x499550(0x18a),'KsuIW':_0x499550(0x14c),'rJbKG':_0x499550(0x141),'HIpSA':_0x499550(0x1cb),'QGUCS':_0x499550(0x1d5),'WLsci':_0x499550(0x196)},_0x3b0af9=this[_0x499550(0x19b)](),_0x1c9669=_0x5cb63b[_0x499550(0x1d9)](_0x5cb63b[_0x499550(0x1a1)](_0x21e1ea[_0x499550(0xe6)](),_0x2deb2e[_0x499550(0xe6)]()),_0x21bcb2[_0x499550(0xe6)]());if(this[_0x499550(0x17a)][_0x499550(0xcf)+_0x499550(0x151)]){if(_0x5cb63b[_0x499550(0xfa)](_0x3b0af9,this[_0x499550(0xcf)+_0x499550(0x127)+'el'][0x4f1+0x150f+-0x1a00])){for(let _0x17de15 in this[_0x499550(0xf9)+_0x499550(0xe4)]){const _0x45cff0=this[_0x499550(0xf9)+_0x499550(0xe4)][_0x17de15];_0x17de15[_0x499550(0x11d)](_0x5cb63b[_0x499550(0x175)])?_0x45cff0[_0x499550(0x1e6)](_0xdbf6=>{const _0x50c401=_0x499550;_0xdbf6[_0x50c401(0x126)]=![];}):_0x45cff0[_0x499550(0x126)]=![];}return null;}else{if(_0x5cb63b[_0x499550(0x1c7)](_0x3b0af9,this[_0x499550(0xcf)+_0x499550(0x127)+'el'][-0xb76+0x1fcb+-0x1454]))return null;}let _0xa2ca7c=!![];for(let _0x1c6c37 in this[_0x499550(0xf9)+_0x499550(0xe4)]){const _0x4b295c=this[_0x499550(0xf9)+_0x499550(0xe4)][_0x1c6c37];if([_0x5cb63b[_0x499550(0x1a4)](_0x5cb63b[_0x499550(0xb4)],_0x1c9669),_0x5cb63b[_0x499550(0xe7)](_0x5cb63b[_0x499550(0x134)],_0x1c9669),_0x5cb63b[_0x499550(0x1c6)](_0x5cb63b[_0x499550(0x175)],_0x1c9669)][_0x499550(0x11d)](_0x1c6c37)){_0xa2ca7c=![];_0x1c6c37[_0x499550(0x11d)](_0x5cb63b[_0x499550(0x175)])?_0x4b295c[_0x499550(0x1e6)](_0x248046=>{const _0x33c244=_0x499550;_0x248046[_0x33c244(0x126)]=!![];}):_0x4b295c[_0x499550(0x126)]=!![];break;}}if(!_0xa2ca7c)return null;}else{if(_0x5cb63b[_0x499550(0x112)](_0x5cb63b[_0x499550(0x1d9)](_0x21bcb2,-0x196c*0x1+-0x1*-0xcb+-0x41b*-0x6),_0x3b0af9))return null;}let _0x74aa70=_0x5cb63b[_0x499550(0xd0)](_0x390d4a,_0x21e1ea,_0x2deb2e,_0x21bcb2,this[_0x499550(0xbc)]);if(_0x5cb63b[_0x499550(0xf7)](_0x74aa70,undefined))return new Promise((_0x4e33de,_0x1a6818)=>{const _0x2e686e=_0x499550;_0x5cb63b[_0x2e686e(0xd7)](_0x4e33de,_0x74aa70);});else{let _0x2f68e5=this,_0x122526=this[_0x499550(0x146)];if(this[_0x499550(0x1ad)][_0x499550(0xde)]){const _0x352c83=_0x122526[_0x499550(0x1ca)]('?');_0x122526=_0x5cb63b[_0x499550(0x18b)](_0x5cb63b[_0x499550(0x100)](_0x352c83[0x24a2+-0x86b+-0x1f*0xe9][_0x499550(0x1b6)](_0x5cb63b[_0x499550(0x17e)],this[_0x499550(0x1ad)][_0x499550(0xde)][Math[_0x499550(0xe5)](_0x5cb63b[_0x499550(0x115)](Math[_0x499550(0x149)](),this[_0x499550(0x1ad)][_0x499550(0xde)][_0x499550(0x158)]))]),'?'),_0x352c83[-0x1636+-0x158f+0x2bc6]);}_0x2f68e5[_0x499550(0x1ad)][_0x499550(0x125)]&&(_0x21bcb2-=_0x2f68e5[_0x499550(0x1ad)][_0x499550(0x1d6)+'l']??0x34a+-0x5cf+0x1*0x28e,_0x122526=_0x122526[_0x499550(0x1b6)](_0x122526[_0x499550(0xd1)](_0x122526[_0x499550(0x14e)](_0x2f68e5[_0x499550(0x1ad)][_0x499550(0x10c)]))[_0x499550(0xd1)](0x1153*-0x1+-0xd66+0x1eb9,_0x122526[_0x499550(0xd1)](_0x122526[_0x499550(0x14e)](_0x2f68e5[_0x499550(0x1ad)][_0x499550(0x10c)]))[_0x499550(0x14e)]('&')),_0x5cb63b[_0x499550(0x11b)](_0x5cb63b[_0x499550(0x1c3)](_0x2f68e5[_0x499550(0x1ad)][_0x499550(0x10c)],':'),_0x21bcb2)));let _0x306367=_0x5cb63b[_0x499550(0x133)](_0x5cb63b[_0x499550(0xea)](this[_0x499550(0xb1)+_0x499550(0x182)][_0x499550(0x161)+_0x499550(0xcb)+_0x499550(0x1d8)](_0x21bcb2),_0x2deb2e),-0x1f87*-0x1+0x1c2a*0x1+0x1*-0x3bb0);_0x122526=_0x122526[_0x499550(0x1b6)](_0x5cb63b[_0x499550(0xe8)],_0x21e1ea)[_0x499550(0x1b6)](_0x5cb63b[_0x499550(0x109)],_0x2deb2e)[_0x499550(0x1b6)](_0x5cb63b[_0x499550(0x186)],_0x306367)[_0x499550(0x1b6)](_0x5cb63b[_0x499550(0x1c4)],_0x21bcb2)[_0x499550(0x1b6)](_0x5cb63b[_0x499550(0x124)],this[_0x499550(0x147)]);let _0xa62590=document[_0x499550(0x139)+_0x499550(0xce)](_0x5cb63b[_0x499550(0x12c)]);_0xa62590[_0x499550(0xc2)]=_0x2f68e5[_0x499550(0x164)],_0xa62590[_0x499550(0xbb)]=_0x2f68e5[_0x499550(0x17c)+'t'];let _0x4592d1=Cesium[_0x499550(0x12e)][_0x499550(0x1c5)+_0x499550(0x144)](_0x122526);return _0x4592d1[_0x499550(0x1a2)+_0x499550(0xd5)]()[_0x499550(0x119)](async function(_0x1e6303){const _0x303e10=_0x499550;let _0x2ff2e0=_0xa62590[_0x303e10(0x192)]('2d'),_0xdab179=_0x2f68e5[_0x303e10(0x169)][_0x303e10(0x114)+'es'](_0x1e6303),_0x219f6b=_0x2f68e5[_0x303e10(0x15e)]({'options':_0x2f68e5[_0x303e10(0x1ad)][_0x303e10(0x108)],'providerId':_0x2f68e5['id'],'viewer':_0x2f68e5[_0x303e10(0xba)]});if(_0x2f68e5[_0x303e10(0x17a)][_0x303e10(0xcf)+_0x303e10(0x151)]){let _0x5187bb=_0x2f68e5[_0x303e10(0x169)][_0x303e10(0x1b4)+_0x303e10(0x1ba)](_0x1e6303),_0x3cfcb2=_0x5187bb[_0x303e10(0x173)]();Cesium[_0x303e10(0x156)](_0x3cfcb2)&&(_0x2f68e5[_0x303e10(0x164)]=_0x3cfcb2[0x5*0x1e9+-0x469*0x6+0x3d*0x47],_0x2f68e5[_0x303e10(0x17c)+'t']=_0x3cfcb2[-0x916*0x2+-0x94*0x2f+0x2d5b]);let _0x43675e=new Cesium[(_0x303e10(0x177))]();_0x2f68e5[_0x303e10(0xb1)+_0x303e10(0x182)][_0x303e10(0x1b0)+_0x303e10(0xa7)](_0x21e1ea,_0x2deb2e,_0x21bcb2,_0x43675e);let _0x45d57b=_0x43675e[_0x303e10(0xff)],_0x397c68=_0x43675e[_0x303e10(0x10e)],_0x29a044=_0x5cb63b[_0x303e10(0x1b3)](_0x5cb63b[_0x303e10(0x120)](_0x43675e[_0x303e10(0xc2)],_0x2f68e5[_0x303e10(0x164)]),0x12da+0xfcd+-0xb8d*0x3+0.125),_0x2f85c2=_0x5cb63b[_0x303e10(0x1dd)](_0x5cb63b[_0x303e10(0x16b)](_0x43675e[_0x303e10(0xbb)],_0x2f68e5[_0x303e10(0x17c)+'t']),-0x1b53+0x5*-0x2a2+0x287d+0.125),_0x29c0a4=[],_0x69e9d6=[];for(let _0x5465b7=0x1213*-0x1+0x179e+-0x3*0x1d9;_0x5cb63b[_0x303e10(0xc9)](_0x5465b7,_0xdab179[_0x303e10(0x158)]);_0x5465b7++){let _0x1dc7f8=_0xdab179[_0x5465b7],_0x130ef7=_0x5cb63b[_0x303e10(0x1ac)](_0x219f6b,_0xdab179[_0x5465b7],_0x2f68e5[_0x303e10(0x150)+'ns'][_0x21bcb2]);var _0x47acea=_0x1dc7f8[_0x303e10(0x130)+'y']()[_0x303e10(0xe2)]();const _0x51098e=_0x1dc7f8[_0x303e10(0x130)+'y']()[_0x303e10(0x153)+_0x303e10(0xdb)]();if(_0x5cb63b[_0x303e10(0x1bd)](_0x47acea,_0x5cb63b[_0x303e10(0xb4)])){!_0x2f68e5[_0x303e10(0xf9)+_0x303e10(0xe4)][_0x5cb63b[_0x303e10(0x1d9)](_0x5cb63b[_0x303e10(0xb4)],_0x1c9669)]&&(_0x2f68e5[_0x303e10(0xf9)+_0x303e10(0xe4)][_0x5cb63b[_0x303e10(0x1d9)](_0x5cb63b[_0x303e10(0xb4)],_0x1c9669)]=_0x2f68e5[_0x303e10(0xba)][_0x303e10(0xdf)][_0x303e10(0x13d)][_0x303e10(0x1c1)](new Cesium[(_0x303e10(0x185))+(_0x303e10(0xe4))]()));const _0x2c80b9=[];for(let _0x538a7f=-0x1676+0x2a*-0x1d+-0x1*-0x1b38;_0x5cb63b[_0x303e10(0xc9)](_0x538a7f,_0x51098e[_0x303e10(0x158)]);_0x538a7f++){let _0x2db1b1=_0x51098e[_0x538a7f],_0x4cf547=[];for(let _0x10ad05=-0x3f*0x21+-0x24a7+0x2cc6;_0x5cb63b[_0x303e10(0x1a7)](_0x10ad05,_0x2db1b1[_0x303e10(0x158)]);_0x10ad05++){let _0x399fa8=_0x2db1b1[_0x10ad05][0xe*0x286+0x1*-0x24b6+0x6*0x3b],_0x3ff9ba=_0x2db1b1[_0x10ad05][-0x2224+0x1a81+0x6*0x146],_0xaaf1a7=_0x5cb63b[_0x303e10(0x1d9)](_0x45d57b,_0x5cb63b[_0x303e10(0xf3)](_0x399fa8,_0x29a044)),_0xd9d730=_0x5cb63b[_0x303e10(0x133)](_0x397c68,_0x5cb63b[_0x303e10(0xaa)](_0x3ff9ba,_0x2f85c2));_0x4cf547[_0x303e10(0x172)](Cesium[_0x303e10(0x179)][_0x303e10(0x16f)](_0xaaf1a7)),_0x4cf547[_0x303e10(0x172)](Cesium[_0x303e10(0x179)][_0x303e10(0x16f)](_0xd9d730));}_0x2c80b9[_0x303e10(0x172)](_0x4cf547);}let _0x24f5ce=_0x2f68e5[_0x303e10(0x14d)+'or'];_0x130ef7&&_0x130ef7[-0x101a+-0x1a*0x77+0x1c30]&&_0x130ef7[0x25e3+-0x1330+0x12b3*-0x1][_0x303e10(0xb6)]&&(_0x24f5ce=_0x130ef7[-0x10e7*0x1+-0x1ddc+-0x2ec3*-0x1][_0x303e10(0xb6)][_0x303e10(0x1c9)]??_0x2f68e5[_0x303e10(0x14d)+'or']),_0x2c80b9[0x17*-0x112+0x1b4e+-0x2b0]&&_0x29c0a4[_0x303e10(0x172)](new Cesium[(_0x303e10(0xa5))+(_0x303e10(0xfc))]({'geometry':new Cesium[(_0x303e10(0x1bc))+(_0x303e10(0x1d1))]({'polygonHierarchy':new Cesium[(_0x303e10(0x1db))+(_0x303e10(0x170))](Cesium[_0x303e10(0x122)][_0x303e10(0x1a8)+_0x303e10(0xee)](_0x2c80b9[-0x83a+0xcb5*0x2+0x44c*-0x4]))}),'attributes':{'color':Cesium[_0x303e10(0x1df)+_0x303e10(0xbd)+_0x303e10(0x1cf)][_0x303e10(0x16d)](Cesium[_0x303e10(0x106)][_0x303e10(0x1b7)+_0x303e10(0x165)](_0x24f5ce))}}));}else{if(_0x5cb63b[_0x303e10(0x1bd)](_0x47acea,_0x5cb63b[_0x303e10(0x175)])){!_0x2f68e5[_0x303e10(0xf9)+_0x303e10(0xe4)][_0x5cb63b[_0x303e10(0x1a1)](_0x5cb63b[_0x303e10(0x175)],_0x1c9669)]&&(_0x2f68e5[_0x303e10(0xf9)+_0x303e10(0xe4)][_0x5cb63b[_0x303e10(0x1a1)](_0x5cb63b[_0x303e10(0x175)],_0x1c9669)]=[]);const _0x3bc1d8=[];for(let _0xc9e24a=0x638*0x6+-0x12ea+-0x622*0x3;_0x5cb63b[_0x303e10(0xc9)](_0xc9e24a,_0x51098e[_0x303e10(0x158)]);_0xc9e24a++){let _0x3e7bb6=_0x51098e[_0xc9e24a],_0x1ad320=_0x3e7bb6[-0x344+0x113c+0x1*-0xdf8],_0x4b6e03=_0x3e7bb6[-0xe7*0x1+0x1dda+-0x1cf2],_0xf93e6d=_0x5cb63b[_0x303e10(0x1d9)](_0x45d57b,_0x5cb63b[_0x303e10(0x154)](_0x1ad320,_0x29a044)),_0x4a770e=_0x5cb63b[_0x303e10(0xea)](_0x397c68,_0x5cb63b[_0x303e10(0x1a0)](_0x4b6e03,_0x2f85c2));_0x3bc1d8[_0x303e10(0x172)](Cesium[_0x303e10(0x179)][_0x303e10(0x16f)](_0xf93e6d),Cesium[_0x303e10(0x179)][_0x303e10(0x16f)](_0x4a770e));}let _0x296350=_0x2f68e5[_0x303e10(0x14d)+'or'],_0x5672d1=_0x2f68e5[_0x303e10(0x1aa)+'th'];_0x130ef7&&_0x130ef7[0x75d+-0xcea+0xcb*0x7]&&_0x130ef7[0x8*-0x1e5+-0x370+0x1298][_0x303e10(0x14a)]&&(_0x296350=_0x130ef7[0xe6c+-0xb*-0x11b+0x1*-0x1a95][_0x303e10(0x14a)][_0x303e10(0x1c9)]??_0x2f68e5[_0x303e10(0x14d)+'or'],_0x5672d1=(_0x130ef7[0x6f*0x41+-0x20fa+0x4cb][_0x303e10(0x14a)][_0x303e10(0x13e)]||_0x5cb63b[_0x303e10(0x1bd)](_0x130ef7[0x14c2*0x1+0x1de*0x13+-0x383c][_0x303e10(0x14a)][_0x303e10(0x13e)],-0x9d*0x20+0x45c+0xf44*0x1))??_0x2f68e5[_0x303e10(0x1aa)+'th']);const _0x574870=new Cesium[(_0x303e10(0x180))+(_0x303e10(0x1e2))+'ry']({'positions':Cesium[_0x303e10(0x122)][_0x303e10(0x1a8)+_0x303e10(0xee)](_0x3bc1d8),'loop':![],'width':_0x5672d1||_0x2f68e5[_0x303e10(0x1aa)+'th']});_0x69e9d6[_0x303e10(0x172)](new Cesium[(_0x303e10(0xa5))+(_0x303e10(0xfc))]({'geometry':_0x574870,'attributes':{'color':Cesium[_0x303e10(0x1df)+_0x303e10(0xbd)+_0x303e10(0x1cf)][_0x303e10(0x16d)](Cesium[_0x303e10(0x106)][_0x303e10(0x1b7)+_0x303e10(0x165)](_0x296350))}}));}else{if(_0x5cb63b[_0x303e10(0x194)](_0x47acea,_0x5cb63b[_0x303e10(0x134)])){let _0x1d7719={'position':Cesium[_0x303e10(0x122)][_0x303e10(0x1a8)+'s'](Cesium[_0x303e10(0x179)][_0x303e10(0x16f)](_0x5cb63b[_0x303e10(0x113)](_0x45d57b,_0x5cb63b[_0x303e10(0xc8)](_0x51098e[0x819*0x3+-0x223a+0x1*0x9ef],_0x29a044))),Cesium[_0x303e10(0x179)][_0x303e10(0x16f)](_0x5cb63b[_0x303e10(0x1c2)](_0x397c68,_0x5cb63b[_0x303e10(0xa8)](_0x51098e[0x1697+-0x421*-0x4+-0x271a],_0x2f85c2)))),'pixelSize':_0x2f68e5[_0x303e10(0x1bb)+_0x303e10(0x102)],'color':Cesium[_0x303e10(0x106)][_0x303e10(0x1b7)+_0x303e10(0x165)](_0x2f68e5[_0x303e10(0x14d)+'or'])[_0x303e10(0x16a)](0x11b3+-0x62a+-0x4*0x2e2),'outlineColor':Cesium[_0x303e10(0x106)][_0x303e10(0x1b7)+_0x303e10(0x165)](_0x2f68e5[_0x303e10(0x14d)+'or'])[_0x303e10(0x16a)](-0x1fd3+0x190b+0xc1*0x9),'outlineWidth':_0x2f68e5[_0x303e10(0x1aa)+'th']};if(_0x130ef7[-0x4d3*0x1+-0xab8+0xf8b]&&_0x130ef7[-0x95d+-0x1225+0x1b82][_0x303e10(0xf1)]){const _0x3cc59e=_0x130ef7[0x1*0x8d1+-0x5c*0x2c+0x6ff][_0x303e10(0xf1)],_0x9c1369=Cesium[_0x303e10(0x179)][_0x303e10(0x16f)](_0x5cb63b[_0x303e10(0x188)](_0x45d57b,_0x5cb63b[_0x303e10(0xaa)](_0x51098e[0x43c+0x4f+0x1*-0x48b],_0x29a044))),_0x288802=Cesium[_0x303e10(0x179)][_0x303e10(0x16f)](_0x5cb63b[_0x303e10(0x1c2)](_0x397c68,_0x5cb63b[_0x303e10(0xa8)](_0x51098e[0xa63*-0x1+-0x3a*-0x33+-0x12a],_0x2f85c2)));if(_0x3cc59e[_0x303e10(0x1be)]&&_0x3cc59e[_0x303e10(0x1be)][_0x303e10(0x1ce)])!_0x2f68e5[_0x303e10(0xf9)+_0x303e10(0xe4)][_0x5cb63b[_0x303e10(0x104)](_0x5cb63b[_0x303e10(0x134)],_0x1c9669)]&&(_0x2f68e5[_0x303e10(0xf9)+_0x303e10(0xe4)][_0x5cb63b[_0x303e10(0x1a1)](_0x5cb63b[_0x303e10(0x134)],_0x1c9669)]=_0x2f68e5[_0x303e10(0xba)][_0x303e10(0xdf)][_0x303e10(0x13d)][_0x303e10(0x1c1)](new Cesium[(_0x303e10(0xb5))+(_0x303e10(0xe4))]())),_0x1d7719={'position':Cesium[_0x303e10(0x122)][_0x303e10(0x1a8)+'s'](_0x9c1369,_0x288802,-0xed5+0x1e50+-0xf49*0x1),'image':_0x3cc59e[_0x303e10(0x1be)][_0x303e10(0x1ce)],'scale':_0x3cc59e[_0x303e10(0x1be)][_0x303e10(0xc7)]??0xaa*-0x26+-0x177b+-0x30b8*-0x1};else{!_0x2f68e5[_0x303e10(0xf9)+_0x303e10(0xe4)][_0x5cb63b[_0x303e10(0x113)](_0x5cb63b[_0x303e10(0x134)],_0x1c9669)]&&(_0x2f68e5[_0x303e10(0xf9)+_0x303e10(0xe4)][_0x5cb63b[_0x303e10(0x11b)](_0x5cb63b[_0x303e10(0x134)],_0x1c9669)]=_0x2f68e5[_0x303e10(0xba)][_0x303e10(0xdf)][_0x303e10(0x13d)][_0x303e10(0x1c1)](new Cesium[(_0x303e10(0xe3))+(_0x303e10(0x16c))+(_0x303e10(0x1ba))]()));const _0x1dafd4=(_0x3cc59e[_0x303e10(0xb6)]&&_0x3cc59e[_0x303e10(0xb6)][_0x303e10(0x1c9)])??_0x2f68e5[_0x303e10(0x14d)+'or'],_0x39a47c=_0x3cc59e[_0x303e10(0x14a)]&&_0x3cc59e[_0x303e10(0x14a)][_0x303e10(0x1c9)],_0x4ffbae=_0x3cc59e[_0x303e10(0x14a)]&&(_0x3cc59e[_0x303e10(0x14a)][_0x303e10(0x13e)]||_0x5cb63b[_0x303e10(0x194)](_0x3cc59e[_0x303e10(0x14a)][_0x303e10(0x13e)],-0x38*-0x33+0x250d+-0x7*0x6e3)),_0x30726e=(_0x3cc59e[_0x303e10(0x1da)]||_0x5cb63b[_0x303e10(0x194)](_0x3cc59e[_0x303e10(0x1da)],0x3*-0x25+0x1*0x215b+-0x20ec))??_0x2f68e5[_0x303e10(0x1bb)+_0x303e10(0x102)];_0x1d7719={'position':Cesium[_0x303e10(0x122)][_0x303e10(0x1a8)+'s'](_0x9c1369,_0x288802,0x1c33+0x23c6+-0x3fc7*0x1),'pixelSize':_0x30726e||_0x2f68e5[_0x303e10(0x1bb)+_0x303e10(0x102)],'color':Cesium[_0x303e10(0x106)][_0x303e10(0x1b7)+_0x303e10(0x165)](_0x1dafd4)},_0x39a47c&&(_0x1d7719[_0x303e10(0xdc)+'or']=Cesium[_0x303e10(0x106)][_0x303e10(0x1b7)+_0x303e10(0x165)](_0x39a47c)),(_0x4ffbae||_0x5cb63b[_0x303e10(0x103)](_0x4ffbae,-0x16*0x125+-0x24a7*0x1+-0xb*-0x59f))&&(_0x1d7719[_0x303e10(0xa4)+'th']=_0x4ffbae);}}_0x2f68e5[_0x303e10(0xf9)+_0x303e10(0xe4)][_0x5cb63b[_0x303e10(0xe7)](_0x5cb63b[_0x303e10(0x134)],_0x1c9669)][_0x303e10(0x1c1)](_0x1d7719);}}}}_0x29c0a4[_0x303e10(0x158)]&&_0x2f68e5[_0x303e10(0xf9)+_0x303e10(0xe4)][_0x5cb63b[_0x303e10(0x1b8)](_0x5cb63b[_0x303e10(0xb4)],_0x1c9669)][_0x303e10(0x1c1)](new Cesium[(_0x303e10(0x129))+(_0x303e10(0xb9))]({'geometryInstances':_0x29c0a4}));if(_0x69e9d6[_0x303e10(0x158)]){const _0x597f03=new Cesium[(_0x303e10(0x180))+(_0x303e10(0x13c))+(_0x303e10(0x123))]({'geometryInstances':_0x69e9d6,'appearance':new Cesium[(_0x303e10(0x19f))+(_0x303e10(0x1e1))+(_0x303e10(0x1c8))]()}),_0x4425e5=_0x2f68e5[_0x303e10(0xba)][_0x303e10(0xdf)][_0x303e10(0xf4)+_0x303e10(0x131)][_0x303e10(0x1c1)](_0x597f03);_0x2f68e5[_0x303e10(0xf9)+_0x303e10(0xe4)][_0x5cb63b[_0x303e10(0x18b)](_0x5cb63b[_0x303e10(0x175)],_0x1c9669)][_0x303e10(0x172)](_0x4425e5);}}else{let _0x501f6d=[0x24dd*-0x1+0x4ad+0x2030,-0x6d2+-0x25ad+-0x1*-0x2c7f,-0x1cdd+-0x158*0x3+-0x30e5*-0x1,0x2*0x725+0x1af5*0x1+0x1*-0x193f],_0x1bb9e3=new ol[(_0x303e10(0x1d3))][(_0x303e10(0x196))][(_0x303e10(0x142))+'p'](0x34c+-0xdd3*-0x1+0x9*-0x1e7,_0x501f6d,0x38b*-0x2+-0xa0+0x1*0x7be,!![],0x1*0x249e+-0x30*-0xce+-0x6ce*0xb);for(let _0x8fa577=0x1*-0x20b3+-0x1d92+-0x3e45*-0x1;_0x5cb63b[_0x303e10(0xc5)](_0x8fa577,_0xdab179[_0x303e10(0x158)]);_0x8fa577++){let _0x44b8b3=_0xdab179[_0x8fa577],_0x5e6ed1=_0x5cb63b[_0x303e10(0xc3)](_0x219f6b,_0xdab179[_0x8fa577],_0x2f68e5[_0x303e10(0x150)+'ns'][_0x21bcb2]);for(let _0x4c42ee=0x40*-0x2b+-0x248b+0x2f4b;_0x5cb63b[_0x303e10(0xc5)](_0x4c42ee,_0x5e6ed1[_0x303e10(0x158)]);_0x4c42ee++){ol[_0x303e10(0x166)][_0x303e10(0xc4)][_0x303e10(0x19d)+_0x303e10(0xac)](_0x1bb9e3,_0x44b8b3,_0x5e6ed1[_0x4c42ee],-0x1*0xc64+0x93*-0x25+-0x21b3*-0x1);}}_0x1bb9e3[_0x303e10(0x136)](),_0x1bb9e3[_0x303e10(0xc1)](_0x2ff2e0,_0x2f68e5[_0x303e10(0x15a)+'o'],_0x2f68e5[_0x303e10(0xb8)],0xf03+-0x2dc+-0x3*0x40d,{},_0x2f68e5[_0x303e10(0x138)],!![]),_0x5cb63b[_0x303e10(0xd2)](_0x2f68e5[_0x303e10(0xbc)][_0x303e10(0x190)],_0x2f68e5[_0x303e10(0x1e5)])&&_0x5cb63b[_0x303e10(0x155)](trimTiles,_0x2f68e5[_0x303e10(0xbc)],_0x5cb63b[_0x303e10(0x19c)](_0x2f68e5[_0x303e10(0x1e5)],0x18d*0x16+-0x3*0x626+-0xfaa)),_0xa62590[_0x303e10(0x19e)]=_0x21e1ea,_0xa62590[_0x303e10(0x105)]=_0x2deb2e,_0xa62590[_0x303e10(0x14f)]=_0x21bcb2,_0x2f68e5[_0x303e10(0xbc)][_0x303e10(0x10b)+_0x303e10(0xad)](_0xa62590),_0x1bb9e3=null;}return _0x2f68e5[_0x303e10(0xcc)+'d']=![],_0xa62590;})[_0x499550(0x10d)](function(_0x556d4c){return _0xa62590;});}function _0x390d4a(_0x26dced,_0x2e803a,_0x538c74,_0x4f0f36){const _0xd2409f=_0x499550;let _0x380b64=_0x4f0f36[_0xd2409f(0xaf)];while(_0x5cb63b[_0xd2409f(0xf7)](_0x380b64,undefined)&&!(_0x5cb63b[_0xd2409f(0x18d)](_0x380b64[_0xd2409f(0x19e)],_0x26dced)&&_0x5cb63b[_0xd2409f(0x18d)](_0x380b64[_0xd2409f(0x105)],_0x2e803a)&&_0x5cb63b[_0xd2409f(0x18d)](_0x380b64[_0xd2409f(0x14f)],_0x538c74))){_0x380b64=_0x380b64[_0xd2409f(0x121)+_0xd2409f(0xd6)];}return _0x380b64;}function _0x5e65d1(_0x2fb686,_0x2d68bf){const _0x131cfd=_0x499550;_0x5cb63b[_0x131cfd(0x155)](setTimeout,()=>{const _0xe54157=_0x131cfd;_0x2fb686[_0xe54157(0xc1)](_0x2d68bf,that[_0xe54157(0x15a)+'o'],that[_0xe54157(0xb8)],0x930+0x1*-0x1ddf+0xf*0x161,{},that[_0xe54157(0x138)],!![]);},0x21c0+-0x1*0x1b7b+-0x1*0x63d);}}[_0x59a0af(0x183)](){const _0x4a5b99=_0x59a0af,_0x5818e7={'WmrqU':function(_0x1344cf,_0x60b420){return _0x1344cf===_0x60b420;}};let _0x1a4ffc=null;return this[_0x4a5b99(0xba)][_0x4a5b99(0x1a6)+_0x4a5b99(0x19a)]?.[_0x4a5b99(0x1e0)]&&this[_0x4a5b99(0xba)][_0x4a5b99(0x1a6)+_0x4a5b99(0x19a)][_0x4a5b99(0x1e0)][_0x4a5b99(0xda)](_0x1ab4a3=>{const _0x4fea62=_0x4a5b99;_0x5818e7[_0x4fea62(0x152)](_0x1ab4a3?.[_0x4fea62(0x1d7)+_0x4fea62(0x132)]?.['id'],this['id'])&&(_0x1a4ffc=_0x1ab4a3);}),_0x1a4ffc;}[_0x59a0af(0x19b)](_0x3569ed){const _0x5a816a=_0x59a0af,_0x3b1257={'zeQqO':function(_0x2d8236,_0x1e7abe){return _0x2d8236+_0x1e7abe;},'jyOvQ':function(_0x352c9b,_0x4a3b0f){return _0x352c9b/_0x4a3b0f;},'xElRb':function(_0x3be1fc,_0x5123d6){return _0x3be1fc-_0x5123d6;},'dhUnp':function(_0x490a43,_0x13d3fb){return _0x490a43+_0x13d3fb;}};_0x3569ed=Cesium[_0x5a816a(0x135)+'ue'](_0x3569ed,this[_0x5a816a(0xba)][_0x5a816a(0x1b9)][_0x5a816a(0x18e)+_0x5a816a(0x16e)][_0x5a816a(0xbb)]);let _0x48a7bd=-0x29f*-0x56+0x723e+-0x5*0x244d+0.569999999999709,_0x4d6fd1=0x3*0x8d1+-0x3*0x868+-0x13b+0.00007096758,_0xe92ed8=-0x4*-0x8e1a+-0xf3a3+0x2115+0.7400000000052387,_0x2231b5=-(-0x10255+0x8c3*-0x5+-0x1*-0x1cc37+0.7399999999979627);return Math[_0x5a816a(0x15d)](_0x3b1257[_0x5a816a(0xd9)](_0x2231b5,_0x3b1257[_0x5a816a(0x17f)](_0x3b1257[_0x5a816a(0x178)](_0x48a7bd,_0x2231b5),_0x3b1257[_0x5a816a(0xcd)](0xb2a+-0x1*-0x167+0x4*-0x324,Math[_0x5a816a(0x160)](_0x3b1257[_0x5a816a(0x17f)](_0x3569ed,_0xe92ed8),_0x4d6fd1)))));}[_0x59a0af(0x199)](_0x19be69=-0x1*0x101+-0x1092+0x1194){const _0x1cacbf=_0x59a0af,_0x155d65={'sjgHK':function(_0x4c746f,_0x31e8b4){return _0x4c746f+_0x31e8b4;},'SePaI':function(_0x137b6a,_0x4441ac){return _0x137b6a<=_0x4441ac;},'utDeU':function(_0x326aa2,_0x38891){return _0x326aa2>_0x38891;},'LPyzo':function(_0x575ddd,_0xe83d78){return _0x575ddd!==_0xe83d78;},'NdVqd':function(_0x413a34,_0x2b1558){return _0x413a34===_0x2b1558;}},_0x3f9462=_0x155d65[_0x1cacbf(0x12d)](this[_0x1cacbf(0xba)][_0x1cacbf(0xdf)][_0x1cacbf(0x101)][_0x1cacbf(0x1e8)][_0x1cacbf(0x167)+_0x1cacbf(0xe0)][0x1f6+0x22e7+-0x24dd][_0x1cacbf(0x171)],-0x1d51+0x2345+-0x1*0x5f3);let _0x5ca5f9=_0x155d65[_0x1cacbf(0xa2)](_0x3f9462,this[_0x1cacbf(0x1ad)][_0x1cacbf(0x108)][_0x1cacbf(0x140)])||_0x155d65[_0x1cacbf(0x1dc)](_0x3f9462,this[_0x1cacbf(0x1ad)][_0x1cacbf(0x108)][_0x1cacbf(0xfd)])?-0x1c91+-0x8d1+0x2562:0x209d+0x1b81*0x1+-0x3c1d;_0x5ca5f9=_0x155d65[_0x1cacbf(0x1b2)](_0x5ca5f9,0x26af+0xf03+0x2*-0x1ad9)&&(_0x19be69||_0x155d65[_0x1cacbf(0xe9)](_0x19be69,-0x1*-0x99f+-0x1*-0xc1+-0xa60))?_0x19be69:_0x5ca5f9;const _0x196a9c=this[_0x1cacbf(0x183)]();_0x196a9c&&(_0x196a9c[_0x1cacbf(0x15b)]=_0x5ca5f9);}[_0x59a0af(0x12a)](_0x4ac9ad=!![]){const _0x31dac5=_0x59a0af,_0xbe1a4f=this[_0x31dac5(0x183)]();_0xbe1a4f&&(_0xbe1a4f[_0x31dac5(0x126)]=_0x4ac9ad);}}export default MVTImageryProvider;

自定义样式加载,定义style.js

// Styles for the mapbox-streets-v6 vector tile data set. Loosely based on
// http://a.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6.json

function createMapboxStreetsStyle({options, providerId, viewer}) {
    const filter = options.filter;//过滤条件
    const baseColor = "#0b0bcf";
    const baseWidth = 1;
    const baseRadius = 10;

    let fill = new ol.style.Fill({
        color: baseColor
    });
    let stroke = new ol.style.Stroke({
        color: baseColor,
        width: baseWidth,
    });
    let polygon = new ol.style.Style({
        fill: fill,
        stroke: stroke,
    });
    let strokedPolygon = new ol.style.Style({
        fill: fill,
        stroke: stroke
    });
    let line = new ol.style.Style({
        stroke: stroke
    });
    let pointStyle = new ol.style.Circle({
		radius: 5,//半径
		fill: fill,//填充颜色
		stroke: stroke//边界
	});
    let point = new ol.style.Style({
        image: pointStyle
    });
    let text = new ol.style.Style({
        text: new ol.style.Text({
            text: '',
            fill: fill,
            stroke: stroke
        })
    });
    let iconCache = {};

    function getIcon(iconUrl,imgSize,offset,iconName) {
        let icon = iconCache[iconName];
        if (!icon) {
            var image = new Image();
            image.src = iconUrl;
            icon = new ol.style.Style({
                image: new ol.style.Icon({
                    img: image,
                    imgSize: imgSize,
                    offset:offset
                })
            });
            iconCache[iconName] = icon;
        }
        icon.getImage().load();
        return icon;
    }

    let styles = [];
    return function (feature, resolution) {
        let length = 0;
        let isShow = true;
        const mapLevel = viewer.scene.globe._surface._tilesToRender[0].level + 1; //地图网格显示的level要比得到的比例尺大1
        //过滤条件,筛选数据
        if (filter && filter.length) {
            checkFilter(filter);

            function checkFilter(tempFilter) {
                try {
                    const field = tempFilter[1];//字段
                    const value = tempFilter[2];//值
                    const featureValue = feature.get(field);//几何里面对应field字段的属性值
                    //
                    switch (tempFilter[0]) {
                        case "==":
                            isShow = (featureValue === tempFilter[2]) ? true : false;
                            break;
                        case "!=":
                            isShow = (featureValue !== tempFilter[2]) ? true : false;
                            break;
                        case "in":
                            isShow = tempFilter.includes(featureValue) ? true : false;
                            break;
                        case "!in":
                            isShow = !tempFilter.includes(featureValue) ? true : false;
                            break;
                        case ">":
                            isShow = featureValue > value ? true : false;
                            break;
                        case ">=":
                            isShow = featureValue >= value ? true : false;
                            break;
                        case "<":
                            isShow = featureValue < value ? true : false;
                            break;
                        case "<=":
                            isShow = featureValue <= value ? true : false;
                            break;
                        case "all"://需要满足所有的条件
                            for (let i = 1; i < tempFilter.length; i++) {
                                checkFilter(tempFilter[i]);
                                if (!isShow) {
                                    break;
                                }
                            }
                            break;
                        case "any"://满足任意条件一个的条件
                            for (let i = 1; i < tempFilter.length; i++) {
                                checkFilter(tempFilter[i]);
                                if (isShow) {
                                    break;
                                }
                            }
                            break;
                        case "none":
                            isShow = true;
                            break;
                        default:
                            isShow = false;
                            break;

                    }
                } catch (e) {//处理条件异常的情况
                    isShow = false;
                }
            }
        }
        //
        if (!isShow) {//不显示的数据处理
            stroke.setColor('rgba(0,0,0,0)');
            stroke.setWidth(0);
            //
            // fill.setColor('rgba(0,0,0,0)');
            //
            styles[length++] = line;
            styles.length = length;
            return styles;
        }

        const paint = options.paint ?? {};
        switch (options.type) {
            case "point"://原点纯色点
            case "circle":
                let pointColor = paint["circle-color"];
                const pointOpacity = paint["circle-opacity"];
                //填充色
                if (Array.isArray(pointColor)){
                    pointColor = dedleColor(feature,pointColor);
                }
                if (pointColor && (pointOpacity || (pointOpacity === 0))) {
                    pointColor = dedleOpacity(pointColor, pointOpacity);
                }
                pointColor && fill.setColor(pointColor);
                //
                const radius = paint["circle-radius"];
                (radius || (radius === 0)) && pointStyle.setRadius(radius);
                //
                let circleStrokeColor = paint["circle-stroke-color"];
                let circleStrokeOpacity = paint["circle-stroke-opacity"];
                let circleStrokewWidth = paint["circle-stroke-width"];
                //边框颜色
                if (Array.isArray(circleStrokeColor)){
                    circleStrokeColor = dedleColor(feature,circleStrokeColor);
                }
                if (circleStrokeColor && (circleStrokeOpacity || (circleStrokeOpacity === 0))) {
                    circleStrokeColor = dedleOpacity(circleStrokeColor, circleStrokeOpacity);
                }
                circleStrokeColor && stroke.setColor(circleStrokeColor);
                (circleStrokewWidth || (circleStrokewWidth === 0)) && stroke.setWidth(circleStrokewWidth);
                styles[length++] = point;
                //
                break;
            case "marker"://图标点
            case "icon"://图标点
                const iconUrl = paint["icon-url"] || paint["icon-image"];
                const iconName = paint["iconName"] ?? "marker";
                const imgSize = paint["imgSize"] ?? [32,45];
                const offset = paint["offset"] ?? [0,0];
                if(iconUrl){//图标
                    styles[length++] = getIcon(iconUrl,imgSize,offset,iconName);
                }
                break;
            case "line":
            case "polyline":
            	let lineColor = paint["line-color"];
            	const lineOpacity = paint["line-opacity"];
				if (Array.isArray(lineColor)){
					lineColor = dedleColor(feature,lineColor);
				}
				//
				if (lineColor && (lineOpacity || (lineOpacity === 0))) {
					lineColor = dedleOpacity(lineColor, lineOpacity);
				}
                lineColor && stroke.setColor(lineColor);
				const lineWidth = paint["line-width"];
                (lineWidth || (lineWidth === 0)) && stroke.setWidth(lineWidth);
                //
                styles[length++] = line;
                break;
            case "fill":
            case "polygon":
            case "square"://正方形
            case "triangle": // 三角形
            case "star": // 五角形
            case "cross": // 十字架
            case "x": //  ×形
                let fillColor = paint["fill-color"];
                const filleOpacity = paint["fill-opacity"];
                if (Array.isArray(fillColor)) {//分类渲染
					fillColor = dedleColor(feature,fillColor);
                }
                //
                if (fillColor && (filleOpacity || (filleOpacity === 0))) {
                    fillColor = dedleOpacity(fillColor, filleOpacity);
                }
                fillColor && fill.setColor(fillColor);
                //
                let outLineColor = paint["fill-outline-color"];
                let outLineColorOpacity = paint["fill-outline-opacity"];
                if (Array.isArray(outLineColor)) {//分类渲染
                    outLineColor = dedleColor(feature,outLineColor);
                }
                if (outLineColor && (outLineColorOpacity || (outLineColorOpacity === 0))) {
                    outLineColor = dedleOpacity(outLineColor, outLineColorOpacity);
                    outLineColor && stroke.setColor(outLineColor);
                }
                const fillOutlineWidth = paint["fill-outline-width"];
                (fillOutlineWidth || (fillOutlineWidth === 0)) && stroke.setWidth(fillOutlineWidth);
                const tempRadius = paint["radius"] ?? baseRadius;
                switch (options.type) {
                    case "square"://正方形
                        point.setImage(new ol.style.RegularShape({
                            fill: fill,
                            stroke: stroke,
                            points: 4,
                            radius: tempRadius,
                            angle: Math.PI / 4,
                        }));
                        styles[length++] = point;
                        break;
                    case "triangle": // 三角形
                        point.setImage(new ol.style.RegularShape({
                            fill: fill,
                            stroke: stroke,
                            points: 3,//星形和正多边形的点数。在多边形的情况下,点数就是边数
                            radius: tempRadius,//正多边形的半径
                            angle: 0,//形状的弧度角。值为 0 将使形状的其中一个点朝上
                        }));
                        styles[length++] = point;
                        break;
                    case "star":// 五角形
                        point.setImage(new ol.style.RegularShape({
                            fill: fill,
                            stroke: stroke,
                            points: 5,//星形和正多边形的点数。在多边形的情况下,点数就是边数
                            radius: tempRadius,//正多边形的半径
                            radius2: tempRadius/2,//第二个半径
                            angle: 0,//形状的弧度角。值为 0 将使形状的其中一个点朝上
                        }));
                        styles[length++] = point;
                        break;
                    case "cross": // 十字架
                        point.setImage(new ol.style.RegularShape({
                            fill: fill,
                            stroke: stroke,
                            points: 4,//星形和正多边形的点数。在多边形的情况下,点数就是边数
                            radius: tempRadius,//正多边形的半径
                            radius2: 0,//第二个半径
                            angle: 0,//形状的弧度角。值为 0 将使形状的其中一个点朝上
                        }));
                        styles[length++] = point;
                        break;
                    case "x":// ×形
                        point.setImage(new ol.style.RegularShape({
                            fill: fill,
                            stroke: stroke,
                            points: 4,//星形和正多边形的点数。在多边形的情况下,点数就是边数
                            radius: tempRadius,//正多边形的半径
                            radius2: 0,//第二个半径
                            angle: Math.PI / 4,//形状的弧度角。值为 0 将使形状的其中一个点朝上
                        }));
                        styles[length++] = point;
                        break;
                    default:
                        styles[length++] = polygon;
                        break;
                }
                break;
        }

        //根据属性,设置颜色
		function dedleColor(tempFeature,targetColor) {
			try {
				switch (targetColor[0]) {
					case "match":
						const type = targetColor[1][0];
						const field = targetColor[1][1];
						const featureValue = tempFeature.get(field);//几何里面对应field字段的属性值
						switch (type) {
							case "get":
								let flage = true;
								for (let i = 2; i < targetColor.length; i += 2) {
									if (featureValue === targetColor[i]) {
										targetColor = targetColor[i + 1];
										flage = false;
										break;
									}
								}
								flage && (targetColor = targetColor[targetColor.length - 1]);
								break;
						}
						//
						break;
				}
			} catch (e) {
				targetColor = baseColor;
				console.error("line-color参数错误");
			}
			return targetColor;
		}
        //处理颜色的透明度
        function dedleOpacity(color, opacity) {
            try {
                if (color.indexOf("#") !== -1) {//十六进制
                    color = hexToRgba(color, opacity);
                } else {
                    let rgba = outLineColor.split("(")[1].split(")")[0];
                    rgba = rgba.split(",");
                    color = "rgba(" + rgba[0] + "," + rgba[1] + "," + rgba[2] + "," + opacity + ")";
                }
            } catch (e) {
				color = baseColor;
                console.error("fill-outline-opacity参数错误");
            }
            return color;
        }


        styles.length = length;

        return styles;
    };
}

//十六进制转rgba
function hexToRgba(hex, opacity = 1) {
    return 'rgba(' + parseInt('0x' + hex.slice(1, 3)) + ',' + parseInt('0x' + hex.slice(3, 5)) + ','
        + (parseInt('0x' + hex.slice(5, 7)) ? parseInt('0x' + hex.slice(5, 7)) : parseInt('0x' + hex.slice(3, 5))) + ',' + opacity + ')';
}

export default createMapboxStreetsStyle;

使用方法,将MVTImageryProvider.js和style.js放在同一个目录,然后使用的地方引入MVTImageryProvider.js

import MVTImageryProvider from "./MVTImageryProvider.js";

 /**
     * MVTImageryProvider参数
     * @param option {Object} object 可选参数,具有以下属性的对象:
     * @param option.viewer {Cesium.viewer} Cesium.viewer
     * @param option.style {Object} 图层配置
     * @param option.clampToGround {Boolean} 是否贴地,默认false不贴地
     * @param option.clampToGroundShowLevel {Array} 贴地时,请求数据的比例值范围,小于最比例尺的数据不显示,大于的显示最大比例尺的数据,默认[16,16]
     */
var mvtLayer = new MVTImageryProvider({
    viewer:this.viewer,//cesium的viewer
    style: olpolygonStyle,//图层的样式文件
    clampToGround:true,//数据是否贴地
});
this.viewer.imageryLayers.addImageryProvider(mvtLayer)

olpolygonStyle的参数示例

{
    "url":"http://localhost:8881/geoserver/gwc/service/wmts?" +
        "REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER=test:polygon&STYLE=&TILEMATRIX=EPSG:4490:{z}&" +
        "TILEMATRIXSET=EPSG:4490&FORMAT=application/vnd.mapbox-vector-tile&TILECOL={x}&TILEROW={y}&" +
        "aa=11&dada=455",
    "epsg":"EPSG:4490",
    "options":{
        "type": "fill",
        "minzoom": 8, // 最小层级(可选,取值范围为 0 ~ 24。当 style 的 zoom 小于此 minzoom 时,layer 将被隐藏)
        "maxzoom": 19, // 最大层级(可选,取值范围为 0 ~ 24。当 style 的 zoom 大于此 maxzoom 时,layer 将被隐藏)
        "layout": {},
        // "filter":[
        //     // '!=', 'NAME', "1",//过滤条件
        //     // '!in', 'NAME', "2","22","33",//过滤条件
        //     "all",
        //     ["==", "AREA", "3.4km²"],
        //     ["in", "NAME", "3"],
        // ],
        "paint": {
            // "fill-color":"#97b3ff",
            "fill-color":[
                "match",["get","plot_name"],
                "1","#f7fbff",
                "2","#ebf3fb",
                "3","#dfecf7",
                "4","#d3e4f3",
                "5","#c8dcf0",
                "6","#b6d4e9",
                "7","#a3cce3",
                "8","#8bc0dd",
                "#c0ee9c"//默认颜色
            ],
            "fill-opacity":1,
            "fill-outline-color": "#dd060c",
            "fill-outline-width": 3,
            "fill-outline-opacity": 0.5,
        }
    }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值