iclient-ol.js 5.5 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272101273101274101275101276101277101278101279101280101281101282101283101284101285101286101287101288101289101290101291101292101293101294101295101296101297101298101299101300101301101302101303101304101305101306101307101308101309101310101311101312101313101314101315101316101317101318101319101320101321101322101323101324101325101326101327101328101329101330101331101332101333101334101335101336101337101338101339101340101341101342101343101344101345101346101347101348101349101350101351101352101353101354101355101356101357101358101359101360101361101362101363101364101365101366101367101368101369101370101371101372101373101374101375101376101377101378101379101380101381101382101383101384101385101386101387101388101389101390101391101392101393101394101395101396101397101398101399101400101401101402101403101404101405101406101407101408101409101410101411101412101413101414101415101416101417101418101419101420101421101422101423101424101425101426101427101428101429101430101431101432101433101434101435101436101437101438101439101440101441101442101443101444101445101446101447101448101449101450101451101452101453101454101455101456101457101458101459101460101461101462101463101464101465101466101467101468101469101470101471101472101473101474101475101476101477101478101479101480101481101482101483101484101485101486101487101488101489101490101491101492101493101494101495101496101497101498101499101500101501101502101503101504101505101506101507101508101509101510101511101512101513101514101515101516101517101518101519101520101521101522101523101524101525101526101527101528101529101530101531101532101533101534101535101536101537101538101539101540101541101542101543101544101545101546101547101548101549101550101551101552101553101554101555101556101557101558101559101560101561101562101563101564101565101566101567101568101569101570101571101572101573101574101575101576101577101578101579101580101581101582101583101584101585101586101587101588101589101590101591101592101593101594101595101596101597101598101599101600101601101602101603101604101605101606101607101608101609101610101611101612101613101614101615101616101617101618101619101620101621101622101623101624101625101626101627101628101629101630101631101632101633101634101635101636101637101638101639101640101641101642101643101644101645101646101647101648101649101650101651101652101653101654101655101656101657101658101659101660101661101662101663101664101665101666101667101668101669101670101671101672101673101674101675101676101677101678101679101680101681101682101683101684101685101686101687101688101689101690101691101692101693101694101695101696101697101698101699101700101701101702101703101704101705101706101707101708101709101710101711101712101713101714101715101716101717101718101719101720101721101722101723101724101725101726101727101728101729101730101731101732101733101734101735101736101737101738101739101740101741101742101743101744101745101746101747101748101749101750101751101752101753101754101755101756101757101758101759101760101761101762101763101764101765101766101767101768101769101770101771101772101773101774101775101776101777101778101779101780101781101782101783101784101785101786101787101788101789101790101791101792101793101794101795101796101797101798101799101800101801101802101803101804101805101806101807101808101809101810101811101812101813101814101815101816101817101818101819101820101821101822101823101824101825101826101827101828101829101830101831101832101833101834101835101836101837101838101839101840101841101842101843101844101845101846101847101848101849101850101851101852101853101854101855101856101857101858101859101860101861101862101863101864101865101866101867101868101869101870101871101872101873101874101875101876101877101878101879101880101881101882101883101884101885101886101887101888101889101890101891101892101893101894101895101896101897101898101899101900101901101902101903101904101905101906101907101908101909101910101911101912101913101914101915101916101917101918101919101920101921101922101923101924101925101926101927101928101929101930101931101932101933101934101935101936101937101938101939101940101941101942101943101944101945101946101947101948101949101950101951101952101953101954101955101956101957101958101959101960101961101962101963101964101965101966101967101968101969101970101971101972101973101974101975101976101977101978101979101980101981101982101983101984101985101986101987101988101989101990101991101992101993101994101995101996101997101998101999102000102001102002102003102004102005102006102007102008102009102010102011102012102013102014102015102016102017102018102019102020102021102022102023102024102025102026102027102028102029102030102031102032102033102034102035102036102037102038102039102040102041102042102043102044102045102046102047102048102049102050102051102052102053102054102055102056102057102058102059102060102061102062102063102064102065102066102067102068102069102070102071102072102073102074102075102076102077102078102079102080102081102082102083102084102085102086102087102088102089102090102091102092102093102094102095102096102097102098102099102100102101102102102103102104102105102106102107102108102109102110102111102112102113102114102115102116102117102118102119102120102121102122102123102124102125102126102127102128102129102130102131102132102133102134102135102136102137102138102139102140102141102142102143102144102145102146102147102148102149102150102151102152102153102154102155102156102157102158102159102160102161102162102163102164102165102166102167102168102169102170102171102172102173102174102175102176102177102178102179102180102181102182102183102184102185102186102187102188102189102190102191102192102193102194102195102196102197102198102199102200102201102202102203102204102205102206102207102208102209102210102211102212102213102214102215102216102217102218102219102220102221102222102223102224102225102226102227102228102229102230102231102232102233102234102235102236102237102238102239102240102241102242102243102244102245102246102247102248102249102250102251102252102253102254102255102256102257102258102259102260102261102262102263102264102265102266102267102268102269102270102271102272102273102274102275102276102277102278102279102280102281102282102283102284102285102286102287102288102289102290102291102292102293102294102295102296102297102298102299102300102301102302102303102304102305102306102307102308102309102310102311102312102313102314102315102316102317102318102319102320102321102322102323102324102325102326102327102328102329102330102331102332102333102334102335102336102337102338102339102340102341102342102343102344102345102346102347102348102349102350102351102352102353102354102355102356102357102358102359102360102361102362102363102364102365102366102367102368102369102370102371102372102373102374102375102376102377102378102379102380102381102382102383102384102385102386102387102388102389102390102391102392102393102394102395102396102397102398102399102400102401102402102403102404102405102406102407102408102409102410102411102412102413102414102415102416102417102418102419102420102421102422102423102424102425102426102427102428102429102430102431102432102433102434102435102436102437102438102439102440102441102442102443102444102445102446102447102448102449102450102451102452102453102454102455102456102457102458102459102460102461102462102463102464102465102466102467102468102469102470102471102472102473102474102475102476102477102478102479102480102481102482102483102484102485102486102487102488102489102490102491102492102493102494102495102496102497102498102499102500102501102502102503102504102505102506102507102508102509102510102511102512102513102514102515102516102517102518102519102520102521102522102523102524102525102526102527102528102529102530102531102532102533102534102535102536102537102538102539102540102541102542102543102544102545102546102547102548102549102550102551102552102553102554102555102556102557102558102559102560102561102562102563102564102565102566102567102568102569102570102571102572102573102574102575102576102577102578102579102580102581102582102583102584102585102586102587102588102589102590102591102592102593102594102595102596102597102598102599102600102601102602102603102604102605102606102607102608102609102610102611102612102613102614102615102616102617102618102619102620102621102622102623102624102625102626102627102628102629102630102631102632102633102634102635102636102637102638102639102640102641102642102643102644102645102646102647102648102649102650102651102652102653102654102655102656102657102658102659102660102661102662102663102664102665102666102667102668102669102670102671102672102673102674102675102676102677102678102679102680102681102682102683102684102685102686102687102688102689102690102691102692102693102694102695102696102697102698102699102700102701102702102703102704102705102706102707102708102709102710102711102712102713102714102715102716102717102718102719102720102721102722102723102724102725102726102727102728102729102730102731102732102733102734102735102736102737102738102739102740102741102742102743102744102745102746102747102748102749102750102751102752102753102754102755102756102757102758102759102760102761102762102763102764102765102766102767102768102769102770102771102772102773102774102775102776102777102778102779102780102781102782102783102784102785102786102787102788102789102790102791102792102793102794102795102796102797102798102799102800102801102802102803102804102805102806102807102808102809102810102811102812102813102814102815102816102817102818102819102820102821102822102823102824102825102826102827102828102829102830102831102832102833102834102835102836102837102838102839102840102841102842102843102844102845102846102847102848102849102850102851102852102853102854102855102856102857102858102859102860102861102862102863102864102865102866102867102868102869102870102871102872102873102874102875102876102877102878102879102880102881102882102883102884102885102886102887102888102889102890102891102892102893102894102895102896102897102898102899102900102901102902102903102904102905102906102907102908102909102910102911102912102913102914102915102916102917102918102919102920102921102922102923102924102925102926102927102928102929102930102931102932102933102934102935102936102937102938102939102940102941102942102943102944102945102946102947102948102949102950102951102952102953102954102955102956102957102958102959102960102961102962102963102964102965102966102967102968102969102970102971102972102973102974102975102976102977102978102979102980102981102982102983102984102985102986102987102988102989102990102991102992102993102994102995102996102997102998102999103000103001103002103003103004103005103006103007103008103009103010103011103012103013103014103015103016103017103018103019103020103021103022103023103024103025103026103027103028103029103030103031103032103033103034103035103036103037103038103039103040103041103042103043103044103045103046103047103048103049103050103051103052103053103054103055103056103057103058103059103060103061103062103063103064103065103066103067103068103069103070103071103072103073103074103075103076103077103078103079103080103081103082103083103084103085103086103087103088103089103090103091103092103093103094103095103096103097103098103099103100103101103102103103103104103105103106103107103108103109103110103111103112103113103114103115103116103117103118103119103120103121103122103123103124103125103126103127103128103129103130103131103132103133103134103135103136103137103138103139103140103141103142103143103144103145103146103147103148103149103150103151103152103153103154103155103156103157103158103159103160103161103162103163103164103165103166103167103168103169103170103171103172103173103174103175103176103177103178103179103180103181103182103183103184103185103186103187103188103189103190103191103192103193103194103195103196103197103198103199103200103201103202103203103204103205103206103207103208103209103210103211103212103213103214103215103216103217103218103219103220103221103222103223103224103225103226103227103228103229103230103231103232103233103234103235103236103237103238103239103240103241103242103243103244103245103246103247103248103249103250103251103252103253103254103255103256103257103258103259103260103261103262103263103264103265103266103267103268103269103270103271103272103273103274103275103276103277103278103279103280103281103282103283103284103285103286103287103288103289103290103291103292103293103294103295103296103297103298103299103300103301103302103303103304103305103306103307103308103309103310103311103312103313103314103315103316103317103318103319103320103321103322103323103324103325103326103327103328103329103330103331103332103333103334103335103336103337103338103339103340103341103342103343103344103345103346103347103348103349103350103351103352103353103354103355103356103357103358103359103360103361103362103363103364103365103366103367103368103369103370103371103372103373103374103375103376103377103378103379103380103381103382103383103384103385103386103387103388103389103390103391103392103393103394103395103396103397103398103399103400103401103402103403103404103405103406103407103408103409103410103411103412103413103414103415103416103417103418103419103420103421103422103423103424103425103426103427103428103429103430103431103432103433103434103435103436103437103438103439103440103441103442103443103444103445103446103447103448103449103450103451103452103453103454103455103456103457103458103459103460103461103462103463103464103465103466103467103468103469103470103471103472103473103474103475103476103477103478103479103480103481103482103483103484103485103486103487103488103489103490103491103492103493103494103495103496103497103498103499103500103501103502103503103504103505103506103507103508103509103510103511103512103513103514103515103516103517103518103519103520103521103522103523103524103525103526103527103528103529103530103531103532103533103534103535103536103537103538103539103540103541103542103543103544103545103546103547103548103549103550103551103552103553103554103555103556103557103558103559103560103561103562103563103564103565103566103567103568103569103570103571103572103573103574103575103576103577103578103579103580103581103582103583103584103585103586103587103588103589103590103591103592103593103594103595103596103597103598103599103600103601103602103603103604103605103606103607103608103609103610103611103612103613103614103615103616103617103618103619103620103621103622103623103624103625103626103627103628103629103630103631103632103633103634103635103636103637103638103639103640103641103642103643103644103645103646103647103648103649103650103651103652103653103654103655103656103657103658103659103660103661103662103663103664103665103666103667103668103669103670103671103672103673103674103675103676103677103678103679103680103681103682103683103684103685103686103687103688103689103690103691103692103693103694103695103696103697103698103699103700103701103702103703103704103705103706103707103708103709103710103711103712103713103714103715103716103717103718103719103720103721103722103723103724103725103726103727103728103729103730103731103732103733103734103735103736103737103738103739103740103741103742103743103744103745103746103747103748103749103750103751103752103753103754103755103756103757103758103759103760103761103762103763103764103765103766103767103768103769103770103771103772103773103774103775103776103777103778103779103780103781103782103783103784103785103786103787103788103789103790103791103792103793103794103795103796103797103798103799103800103801103802103803103804103805103806103807103808103809103810103811103812103813103814103815103816103817103818103819103820103821103822103823103824103825103826103827103828103829103830103831103832103833103834103835103836103837103838103839103840103841103842103843103844103845103846103847103848103849103850103851103852103853103854103855103856103857103858103859103860103861103862103863103864103865103866103867103868103869103870103871103872103873103874103875103876103877103878103879103880103881103882103883103884103885103886103887103888103889103890103891103892103893103894103895103896103897103898103899103900103901103902103903103904103905103906103907103908103909103910103911103912103913103914103915103916103917103918103919103920103921103922103923103924103925103926103927103928103929103930103931103932103933103934103935103936103937103938103939103940103941103942103943103944103945103946103947103948103949103950103951103952103953103954103955103956103957103958103959103960103961103962103963103964103965103966103967103968103969103970103971103972103973103974103975103976103977103978103979103980103981103982103983103984103985103986103987103988103989103990103991103992103993103994103995103996103997103998103999104000104001104002104003104004104005104006104007104008104009104010104011104012104013104014104015104016104017104018104019104020104021104022104023104024104025104026104027104028104029104030104031104032104033104034104035104036104037104038104039104040104041104042104043104044104045104046104047104048104049104050104051104052104053104054104055104056104057104058104059104060104061104062104063104064104065104066104067104068104069104070104071104072104073104074104075104076104077104078104079104080104081104082104083104084104085104086104087104088104089104090104091104092104093104094104095104096104097104098104099104100104101104102104103104104104105104106104107104108104109104110104111104112104113104114104115104116104117104118104119104120104121104122104123104124104125104126104127104128104129104130104131104132104133104134104135104136104137104138104139104140104141104142104143104144104145104146104147104148104149104150104151104152104153104154104155104156104157104158104159104160104161104162104163104164104165104166104167104168104169104170104171104172104173104174104175104176104177104178104179104180104181104182104183104184104185104186104187104188104189104190104191104192104193104194104195104196104197104198104199104200104201104202104203104204104205104206104207104208104209104210104211104212104213104214104215104216104217104218104219104220104221104222104223104224104225104226104227104228104229104230104231104232104233104234104235104236104237104238104239104240104241104242104243104244104245104246104247104248104249104250104251104252104253104254104255104256104257104258104259104260104261104262104263104264104265104266104267104268104269104270104271104272104273104274104275104276104277104278104279104280104281104282104283104284104285104286104287104288104289104290104291104292104293104294104295104296104297104298104299104300104301104302104303104304104305104306104307104308104309104310104311104312104313104314104315104316104317104318104319104320104321104322104323104324104325104326104327104328104329104330104331104332104333104334104335104336104337104338104339104340104341104342104343104344104345104346104347104348104349104350104351104352104353104354104355104356104357104358104359104360104361104362104363104364104365104366104367104368104369104370104371104372104373104374104375104376104377104378104379104380104381104382104383104384104385104386104387104388104389104390104391104392104393104394104395104396104397104398104399104400104401104402104403104404104405104406104407104408104409104410104411104412104413104414104415104416104417104418104419104420104421104422104423104424104425104426104427104428104429104430104431104432104433104434104435104436104437104438104439104440104441104442104443104444104445104446104447104448104449104450104451104452104453104454104455104456104457104458104459104460104461104462104463104464104465104466104467104468104469104470104471104472104473104474104475104476104477104478104479104480104481104482104483104484104485104486104487104488104489104490104491104492104493104494104495104496104497104498104499104500104501104502104503104504104505104506104507104508104509104510104511104512104513104514104515104516104517104518104519104520104521104522104523104524104525104526104527104528104529104530104531104532104533104534104535104536104537104538104539104540104541104542104543104544104545104546104547104548104549104550104551104552104553104554104555104556104557104558104559104560104561104562104563104564104565104566104567104568104569104570104571104572104573104574104575104576104577104578104579104580104581104582104583104584104585104586104587104588104589104590104591104592104593104594104595104596104597104598104599104600104601104602104603104604104605104606104607104608104609104610104611104612104613104614104615104616104617104618104619104620104621104622104623104624104625104626104627104628104629104630104631104632104633104634104635104636104637104638104639104640104641104642104643104644104645104646104647104648104649104650104651104652104653104654104655104656104657104658104659104660104661104662104663104664104665104666104667104668104669104670104671104672104673104674104675104676104677104678104679104680104681104682104683104684104685104686104687104688104689104690104691104692104693104694104695104696104697104698104699104700104701104702104703104704104705104706104707104708104709104710104711104712104713104714104715104716104717104718104719104720104721104722104723104724104725104726104727104728104729104730104731104732104733104734104735104736104737104738104739104740104741104742104743104744104745104746104747104748104749104750104751104752104753104754104755104756104757104758104759104760104761104762104763104764104765104766104767104768104769104770104771104772104773104774104775104776104777104778104779104780104781104782104783104784104785104786104787104788104789104790104791104792104793104794104795104796104797104798104799104800104801104802104803104804104805104806104807104808104809104810104811104812104813104814104815104816104817104818104819104820104821104822104823104824104825104826104827104828104829104830104831104832104833104834104835104836104837104838104839104840104841104842104843104844104845104846104847104848104849104850104851104852104853104854104855104856104857104858104859104860104861104862104863104864104865104866104867104868104869104870104871104872104873104874104875104876104877104878104879104880104881104882104883104884104885104886104887104888104889104890104891104892104893104894104895104896104897104898104899104900104901104902104903104904104905104906104907104908104909104910104911104912104913104914104915104916104917104918104919104920104921104922104923104924104925104926104927104928104929104930104931104932104933104934104935104936104937104938104939104940104941104942104943104944104945104946104947104948104949104950104951104952104953104954104955104956104957104958104959104960104961104962104963104964104965104966104967104968104969104970104971104972104973104974104975104976104977104978104979104980104981104982104983104984104985104986104987104988104989104990104991104992104993104994104995104996104997104998104999105000105001105002105003105004105005105006105007105008105009105010105011105012105013105014105015105016105017105018105019105020105021105022105023105024105025105026105027105028105029105030105031105032105033105034105035105036105037105038105039105040105041105042105043105044105045105046105047105048105049105050105051105052105053105054105055105056105057105058105059105060105061105062105063105064105065105066105067105068105069105070105071105072105073105074105075105076105077105078105079105080105081105082105083105084105085105086105087105088105089105090105091105092105093105094105095105096105097105098105099105100105101105102105103105104105105105106105107105108105109105110105111105112105113105114105115105116105117105118105119105120105121105122105123105124105125105126105127105128105129105130105131105132105133105134105135105136105137105138105139105140105141105142105143105144105145105146105147105148105149105150105151105152105153105154105155105156105157105158105159105160105161105162105163105164105165105166105167105168105169105170105171105172105173105174105175105176105177105178105179105180105181105182105183105184105185105186105187105188105189105190105191105192105193105194105195105196105197105198105199105200105201105202105203105204105205105206105207105208105209105210105211105212105213105214105215105216105217105218105219105220105221105222105223105224105225105226105227105228105229105230105231105232105233105234105235105236105237105238105239105240105241105242105243105244105245105246105247105248105249105250105251105252105253105254105255105256105257105258105259105260105261105262105263105264105265105266105267105268105269105270105271105272105273105274105275105276105277105278105279105280105281105282105283105284105285105286105287105288105289105290105291105292105293105294105295105296105297105298105299105300105301105302105303105304105305105306105307105308105309105310105311105312105313105314105315105316105317105318105319105320105321105322105323105324105325105326105327105328105329105330105331105332105333105334105335105336105337105338105339105340105341105342105343105344105345105346105347105348105349105350105351105352105353105354105355105356105357105358105359105360105361105362105363105364105365105366105367105368105369105370105371105372105373105374105375105376105377105378105379105380105381105382105383105384105385105386105387105388105389105390105391105392105393105394105395105396105397105398105399105400105401105402105403105404105405105406105407105408105409105410105411105412105413105414105415105416105417105418105419105420105421105422105423105424105425105426105427105428105429105430105431105432105433105434105435105436105437105438105439105440105441105442105443105444105445105446105447105448105449105450105451105452105453105454105455105456105457105458105459105460105461105462105463105464105465105466105467105468105469105470105471105472105473105474105475105476105477105478105479105480105481105482105483105484105485105486105487105488105489105490105491105492105493105494105495105496105497105498105499105500105501105502105503105504105505105506105507105508105509105510105511105512105513105514105515105516105517105518105519105520105521105522105523105524105525105526105527105528105529105530105531105532105533105534105535105536105537105538105539105540105541105542105543105544105545105546105547105548105549105550105551105552105553105554105555105556105557105558105559105560105561105562105563105564105565105566105567105568105569105570105571105572105573105574105575105576105577105578105579105580105581105582105583105584105585105586105587105588105589105590105591105592105593105594105595105596105597105598105599105600105601105602105603105604105605105606105607105608105609105610105611105612105613105614105615105616105617105618105619105620105621105622105623105624105625105626105627105628105629105630105631105632105633105634105635105636105637105638105639105640105641105642105643105644105645105646105647105648105649105650105651105652105653105654105655105656105657105658105659105660105661105662105663105664105665105666105667105668105669105670105671105672105673105674105675105676105677105678105679105680105681105682105683105684105685105686105687105688105689105690105691105692105693105694105695105696105697105698105699105700105701105702105703105704105705105706105707105708105709105710105711105712105713105714105715105716105717105718105719105720105721105722105723105724105725105726105727105728105729105730105731105732105733105734105735105736105737105738105739105740105741105742105743105744105745105746105747105748105749105750105751105752105753105754105755105756105757105758105759105760105761105762105763105764105765105766105767105768105769105770105771105772105773105774105775105776105777105778105779105780105781105782105783105784105785105786105787105788105789105790105791105792105793105794105795105796105797105798105799105800105801105802105803105804105805105806105807105808105809105810105811105812105813105814105815105816105817105818105819105820105821105822105823105824105825105826105827105828105829105830105831105832105833105834105835105836105837105838105839105840105841105842105843105844105845105846105847105848105849105850105851105852105853105854105855105856105857105858105859105860105861105862105863105864105865105866105867105868105869105870105871105872105873105874105875105876105877105878105879105880105881105882105883105884105885105886105887105888105889105890105891105892105893105894105895105896105897105898105899105900105901105902105903105904105905105906105907105908105909105910105911105912105913105914105915105916105917105918105919105920105921105922105923105924105925105926105927105928105929105930105931105932105933105934105935105936105937105938105939105940105941105942105943105944105945105946105947105948105949105950105951105952105953105954105955105956105957105958105959105960105961105962105963105964105965105966105967105968105969105970105971105972105973105974105975105976105977105978105979105980105981105982105983105984105985105986105987105988105989105990105991105992105993105994105995105996105997105998105999106000106001106002106003106004106005106006106007106008106009106010106011106012106013106014106015106016106017106018106019106020106021106022106023106024106025106026106027106028106029106030106031106032106033106034106035106036106037106038106039106040106041106042106043106044106045106046106047106048106049106050106051106052106053106054106055106056106057106058106059106060106061106062106063106064106065106066106067106068106069106070106071106072106073106074106075106076106077106078106079106080106081106082106083106084106085106086106087106088106089106090106091106092106093106094106095106096106097106098106099106100106101106102106103106104106105106106106107106108106109106110106111106112106113106114106115106116106117106118106119106120106121106122106123106124106125106126106127106128106129106130106131106132106133106134106135106136106137106138106139106140106141106142106143106144106145106146106147106148106149106150106151106152106153106154106155106156106157106158106159106160106161106162106163106164106165106166106167106168106169106170106171106172106173106174106175106176106177106178106179106180106181106182106183106184106185106186106187106188106189106190106191106192106193106194106195106196106197106198106199106200106201106202106203106204106205106206106207106208106209106210106211106212106213106214106215106216106217106218106219106220106221106222106223106224106225106226106227106228106229106230106231106232106233106234106235106236106237106238106239106240106241106242106243106244106245106246106247106248106249106250106251106252106253106254106255106256106257106258106259106260106261106262106263106264106265106266106267106268106269106270106271106272106273106274106275106276106277106278106279106280106281106282106283106284106285106286106287106288106289106290106291106292106293106294106295106296106297106298106299106300106301106302106303106304106305106306106307106308106309106310106311106312106313106314106315106316106317106318106319106320106321106322106323106324106325106326106327106328106329106330106331106332106333106334106335106336106337106338106339106340106341106342106343106344106345106346106347106348106349106350106351106352106353106354106355106356106357106358106359106360106361106362106363106364106365106366106367106368106369106370106371106372106373106374106375106376106377106378106379106380106381106382106383106384106385106386106387106388106389106390106391106392106393106394106395106396106397106398106399106400106401106402106403106404106405106406106407106408106409106410106411106412106413106414106415106416106417106418106419106420106421106422106423106424106425106426106427106428106429106430106431106432106433106434106435106436106437106438106439106440106441106442106443106444106445106446106447106448106449106450106451106452106453106454106455106456106457106458106459106460106461106462106463106464106465106466106467106468106469106470106471106472106473106474106475106476106477106478106479106480106481106482106483106484106485106486106487106488106489106490106491106492106493106494106495106496106497106498106499106500106501106502106503106504106505106506106507106508106509106510106511106512106513106514106515106516106517106518106519106520106521106522106523106524106525106526106527106528106529106530106531106532106533106534106535106536106537106538106539106540106541106542106543106544106545106546106547106548106549106550106551106552106553106554106555106556106557106558106559106560106561106562106563106564106565106566106567106568106569106570106571106572106573106574106575106576106577106578106579106580106581106582106583106584106585106586106587106588106589106590106591106592106593106594106595106596106597106598106599106600106601106602106603106604106605106606106607106608106609106610106611106612106613106614106615106616106617106618106619106620106621106622106623106624106625106626106627106628106629106630106631106632106633106634106635106636106637106638106639106640106641106642106643106644106645106646106647106648106649106650106651106652106653106654106655106656106657106658106659106660106661106662106663106664106665106666106667106668106669106670106671106672106673106674106675106676106677106678106679106680106681106682106683106684106685106686106687106688106689106690106691106692106693106694106695106696106697106698106699106700106701106702106703106704106705106706106707106708106709106710106711106712106713106714106715106716106717106718106719106720106721106722106723106724106725106726106727106728106729106730106731106732106733106734106735106736106737106738106739106740106741106742106743106744106745106746106747106748106749106750106751106752106753106754106755106756106757106758106759106760106761106762106763106764106765106766106767106768106769106770106771106772106773106774106775106776106777106778106779106780106781106782106783106784106785106786106787106788106789106790106791106792106793106794106795106796106797106798106799106800106801106802106803106804106805106806106807106808106809106810106811106812106813106814106815106816106817106818106819106820106821106822106823106824106825106826106827106828106829106830106831106832106833106834106835106836106837106838106839106840106841106842106843106844106845106846106847106848106849106850106851106852106853106854106855106856106857106858106859106860106861106862106863106864106865106866106867106868106869106870106871106872106873106874106875106876106877106878106879106880106881106882106883106884106885106886106887106888106889106890106891106892106893106894106895106896106897106898106899106900106901106902106903106904106905106906106907106908106909106910106911106912106913106914106915106916106917106918106919106920106921106922106923106924106925106926106927106928106929106930106931106932106933106934106935106936106937106938106939106940106941106942106943106944106945106946106947106948106949106950106951106952106953106954106955106956106957106958106959106960106961106962106963106964106965106966106967106968106969106970106971106972106973106974106975106976106977106978106979106980106981106982106983106984106985106986106987106988106989106990106991106992106993106994106995106996106997106998106999107000107001107002107003107004107005107006107007107008107009107010107011107012107013107014107015107016107017107018107019107020107021107022107023107024107025107026107027107028107029107030107031107032107033107034107035107036107037107038107039107040107041107042107043107044107045107046107047107048107049107050107051107052107053107054107055107056107057107058107059107060107061107062107063107064107065107066107067107068107069107070107071107072107073107074107075107076107077107078107079107080107081107082107083107084107085107086107087107088107089107090107091107092107093107094107095107096107097107098107099107100107101107102107103107104107105107106107107107108107109107110107111107112107113107114107115107116107117107118107119107120107121107122107123107124107125107126107127107128107129107130107131107132107133107134107135107136107137107138107139107140107141107142107143107144107145107146107147107148107149107150107151107152107153107154107155107156107157107158107159107160107161107162107163107164107165107166107167107168107169107170107171107172107173107174107175107176107177107178107179107180107181107182107183107184107185107186107187107188107189107190107191107192107193107194107195107196107197107198107199107200107201107202107203107204107205107206107207107208107209107210107211107212107213107214107215107216107217107218107219107220107221107222107223107224107225107226107227107228107229107230107231107232107233107234107235107236107237107238107239107240107241107242107243107244107245107246107247107248107249107250107251107252107253107254107255107256107257107258107259107260107261107262107263107264107265107266107267107268107269107270107271107272107273107274107275107276107277107278107279107280107281107282107283107284107285107286107287107288107289107290107291107292107293107294107295107296107297107298107299107300107301107302107303107304107305107306107307107308107309107310107311107312107313107314107315107316107317107318107319107320107321107322107323107324107325107326107327107328107329107330107331107332107333107334107335107336107337107338107339107340107341107342107343107344107345107346107347107348107349107350107351107352107353107354107355107356107357107358107359107360107361107362107363107364107365107366107367107368107369107370107371107372107373107374107375107376107377107378107379107380107381107382107383107384107385107386107387107388107389107390107391107392107393107394107395107396107397107398107399107400107401107402107403107404107405107406107407107408107409107410107411107412107413107414107415107416107417107418107419107420107421107422107423107424107425107426107427107428107429107430107431107432107433107434107435107436107437107438107439107440107441107442107443107444107445107446107447107448107449107450107451107452107453107454107455107456107457107458107459107460107461107462107463107464107465107466107467107468107469107470107471107472107473107474107475107476107477107478107479107480107481107482107483107484107485107486107487107488107489107490107491107492107493107494107495107496107497107498107499107500107501107502107503107504107505107506107507107508107509107510107511107512107513107514107515107516107517107518107519107520107521107522107523107524107525107526107527107528107529107530107531107532107533107534107535107536107537107538107539107540107541107542107543107544107545107546107547107548107549107550107551107552107553107554107555107556107557107558107559107560107561107562107563107564107565107566107567107568107569107570107571107572107573107574107575107576107577107578107579107580107581107582107583107584107585107586107587107588107589107590107591107592107593107594107595107596107597107598107599107600107601107602107603107604107605107606107607107608107609107610107611107612107613107614107615107616107617107618107619107620107621107622107623107624107625107626107627107628107629107630107631107632107633107634107635107636107637107638107639107640107641107642107643107644107645107646107647107648107649107650107651107652107653107654107655107656107657107658107659107660107661107662107663107664107665107666107667107668107669107670107671107672107673107674107675107676107677107678107679107680107681107682107683107684107685107686107687107688107689107690107691107692107693107694107695107696107697107698107699107700107701107702107703107704107705107706107707107708107709107710107711107712107713107714107715107716107717107718107719107720107721107722107723107724107725107726107727107728107729107730107731107732107733107734107735107736107737107738107739107740107741107742107743107744107745107746107747107748107749107750107751107752107753107754107755107756107757107758107759107760107761107762107763107764107765107766107767107768107769107770107771107772107773107774107775107776107777107778107779107780107781107782107783107784107785107786107787107788107789107790107791107792107793107794107795107796107797107798107799107800107801107802107803107804107805107806107807107808107809107810107811107812107813107814107815107816107817107818107819107820107821107822107823107824107825107826107827107828107829107830107831107832107833107834107835107836107837107838107839107840107841107842107843107844107845107846107847107848107849107850107851107852107853107854107855107856107857107858107859107860107861107862107863107864107865107866107867107868107869107870107871107872107873107874107875107876107877107878107879107880107881107882107883107884107885107886107887107888107889107890107891107892107893107894107895107896107897107898107899107900107901107902107903107904107905107906107907107908107909107910107911107912107913107914107915107916107917107918107919107920107921107922107923107924107925107926107927107928107929107930107931107932107933107934107935107936107937107938107939107940107941107942107943107944107945107946107947107948107949107950107951107952107953107954107955107956107957107958107959107960107961107962107963107964107965107966107967107968107969107970107971107972107973107974107975107976107977107978107979107980107981107982107983107984107985107986107987107988107989107990107991107992107993107994107995107996107997107998107999108000108001108002108003108004108005108006108007108008108009108010108011108012108013108014108015108016108017108018108019108020108021108022108023108024108025108026108027108028108029108030108031108032108033108034108035108036108037108038108039108040108041108042108043108044108045108046108047108048108049108050108051108052108053108054108055108056108057108058108059108060108061108062108063108064108065108066108067108068108069108070108071108072108073108074108075108076108077108078108079108080108081108082108083108084108085108086108087108088108089108090108091108092108093108094108095108096108097108098108099108100108101108102108103108104108105108106108107108108108109108110108111108112108113108114108115108116108117108118108119108120108121108122108123108124108125108126108127108128108129108130108131108132108133108134108135108136108137108138108139108140108141108142108143108144108145108146108147108148108149108150108151108152108153108154108155108156108157108158108159108160108161108162108163108164108165108166108167108168108169108170108171108172108173108174108175108176108177108178108179108180108181108182108183108184108185108186108187108188108189108190108191108192108193108194108195108196108197108198108199108200108201108202108203108204108205108206108207108208108209108210108211108212108213108214108215108216108217108218108219108220108221108222108223108224108225108226108227108228108229108230108231108232108233108234108235108236108237108238108239108240108241108242108243108244108245108246108247108248108249108250108251108252108253108254108255108256108257108258108259108260108261108262108263108264108265108266108267108268108269108270108271108272108273108274108275108276108277108278108279108280108281108282108283108284108285108286108287108288108289108290108291108292108293108294108295108296108297108298108299108300108301108302108303108304108305108306108307108308108309108310108311108312108313108314108315108316108317108318108319108320108321108322108323108324108325108326108327108328108329108330108331108332108333108334108335108336108337108338108339108340108341108342108343108344108345108346108347108348108349108350108351108352108353108354108355108356108357108358108359108360108361108362108363108364108365108366108367108368108369108370108371108372108373108374108375108376108377108378108379108380108381108382108383108384108385108386108387108388108389108390108391108392108393108394108395108396108397108398108399108400108401108402108403108404108405108406108407108408108409108410108411108412108413108414108415108416108417108418108419108420108421108422108423108424108425108426108427108428108429108430108431108432108433108434108435108436108437108438108439108440108441108442108443108444108445108446108447108448108449108450108451108452108453108454108455108456108457108458108459108460108461108462108463108464108465108466108467108468108469108470108471108472108473108474108475108476108477108478108479108480108481108482108483108484108485108486108487108488108489108490108491108492108493108494108495108496108497108498108499108500108501108502108503108504108505108506108507108508108509108510108511108512108513108514108515108516108517108518108519108520108521108522108523108524108525108526108527108528108529108530108531108532108533108534108535108536108537108538108539108540108541108542108543108544108545108546108547108548108549108550108551108552108553108554108555108556108557108558108559108560108561108562108563108564108565108566108567108568108569108570108571108572108573108574108575108576108577108578108579108580108581108582108583108584108585108586108587108588108589108590108591108592108593108594108595108596108597108598108599108600108601108602108603108604108605108606108607108608108609108610108611108612108613108614108615108616108617108618108619108620108621108622108623108624108625108626108627108628108629108630108631108632108633108634108635108636108637108638108639108640108641108642108643108644108645108646108647108648108649108650108651108652108653108654108655108656108657108658108659108660108661108662108663108664108665108666108667108668108669108670108671108672108673108674108675108676108677108678108679108680108681108682108683108684108685108686108687108688108689108690108691108692108693108694108695108696108697108698108699108700108701108702108703108704108705108706108707108708108709108710108711108712108713108714108715108716108717108718108719108720108721108722108723108724108725108726108727108728108729108730108731108732108733108734108735108736108737108738108739108740108741108742108743108744108745108746108747108748108749108750108751108752108753108754108755108756108757108758108759108760108761108762108763108764108765108766108767108768108769108770108771108772108773108774108775108776108777108778108779108780108781108782108783108784108785108786108787108788108789108790108791108792108793108794108795108796108797108798108799108800108801108802108803108804108805108806108807108808108809108810108811108812108813108814108815108816108817108818108819108820108821108822108823108824108825108826108827108828108829108830108831108832108833108834108835108836108837108838108839108840108841108842108843108844108845108846108847108848108849108850108851108852108853108854108855108856108857108858108859108860108861108862108863108864108865108866108867108868108869108870108871108872108873108874108875108876108877108878108879108880108881108882108883108884108885108886108887108888108889108890108891108892108893108894108895108896108897108898108899108900108901108902108903108904108905108906108907108908108909108910108911108912108913108914108915108916108917108918108919108920108921108922108923108924108925108926108927108928108929108930108931108932108933108934108935108936108937108938108939108940108941108942108943108944108945108946108947108948108949108950108951108952108953108954108955108956108957108958108959108960108961108962108963108964108965108966108967108968108969108970108971108972108973108974108975108976108977108978108979108980108981108982108983108984108985108986108987108988108989108990108991108992108993108994108995108996108997108998108999109000109001109002109003109004109005109006109007109008109009109010109011109012109013109014109015109016109017109018109019109020109021109022109023109024109025109026109027109028109029109030109031109032109033109034109035109036109037109038109039109040109041109042109043109044109045109046109047109048109049109050109051109052109053109054109055109056109057109058109059109060109061109062109063109064109065109066109067109068109069109070109071109072109073109074109075109076109077109078109079109080109081109082109083109084109085109086109087109088109089109090109091109092109093109094109095109096109097109098109099109100109101109102109103109104109105109106109107109108109109109110109111109112109113109114109115109116109117109118109119109120109121109122109123109124109125109126109127109128109129109130109131109132109133109134109135109136109137109138109139109140109141109142109143109144109145109146109147109148109149109150109151109152109153109154109155109156109157109158109159109160109161109162109163109164109165109166109167109168109169109170109171109172109173109174109175109176109177109178109179109180109181109182109183109184109185109186109187109188109189109190109191109192109193109194109195109196109197109198109199109200109201109202109203109204109205109206109207109208109209109210109211109212109213109214109215109216109217109218109219109220109221109222109223109224109225109226109227109228109229109230109231109232109233109234109235109236109237109238109239109240109241109242109243109244109245109246109247109248109249109250109251109252109253109254109255109256109257109258109259109260109261109262109263109264109265109266109267109268109269109270109271109272109273109274109275109276109277109278109279109280109281109282109283109284109285109286109287109288109289109290109291109292109293109294109295109296109297109298109299109300109301109302109303109304109305109306109307109308109309109310109311109312109313109314109315109316109317109318109319109320109321109322109323109324109325109326109327109328109329109330109331109332109333109334109335109336109337109338109339109340109341109342109343109344109345109346109347109348109349109350109351109352109353109354109355109356109357109358109359109360109361109362109363109364109365109366109367109368109369109370109371109372109373109374109375109376109377109378109379109380109381109382109383109384109385109386109387109388109389109390109391109392109393109394109395109396109397109398109399109400109401109402109403109404109405109406109407109408109409109410109411109412109413109414109415109416109417109418109419109420109421109422109423109424109425109426109427109428109429109430109431109432109433109434109435109436109437109438109439109440109441109442109443109444109445109446109447109448109449109450109451109452109453109454109455109456109457109458109459109460109461109462109463109464109465109466109467109468109469109470109471109472109473109474109475109476109477109478109479109480109481109482109483109484109485109486109487109488109489109490109491109492109493109494109495109496109497109498109499109500109501109502109503109504109505109506109507109508109509109510109511109512109513109514109515109516109517109518109519109520109521109522109523109524109525109526109527109528109529109530109531109532109533109534109535109536109537109538109539109540109541109542109543109544109545109546109547109548109549109550109551109552109553109554109555109556109557109558109559109560109561109562109563109564109565109566109567109568109569109570109571109572109573109574109575109576109577109578109579109580109581109582109583109584109585109586109587109588109589109590109591109592109593109594109595109596109597109598109599109600109601109602109603109604109605109606109607109608109609109610109611109612109613109614109615109616109617109618109619109620109621109622109623109624109625109626109627109628109629109630109631109632109633109634109635109636109637109638109639109640109641109642109643109644109645109646109647109648109649109650109651109652109653109654109655109656109657109658109659109660109661109662109663109664109665109666109667109668109669109670109671109672109673109674109675109676109677109678109679109680109681109682109683109684109685109686109687109688109689109690109691109692109693109694109695109696109697109698109699109700109701109702109703109704109705109706109707109708109709109710109711109712109713109714109715109716109717109718109719109720109721109722109723109724109725109726109727109728109729109730109731109732109733109734109735109736109737109738109739109740109741109742109743109744109745109746109747109748109749109750109751109752109753109754109755109756109757109758109759109760109761109762109763109764109765109766109767109768109769109770109771109772109773109774109775109776109777109778109779109780109781109782109783109784109785109786109787109788109789109790109791109792109793109794109795109796109797109798109799109800109801109802109803109804109805109806109807109808109809109810109811109812109813109814109815109816109817109818109819109820109821109822109823109824109825109826109827109828109829109830109831109832109833109834109835109836109837109838109839109840109841109842109843109844109845109846109847109848109849109850109851109852109853109854109855109856109857109858109859109860109861109862109863109864109865109866109867109868109869109870109871109872109873109874109875109876109877109878109879109880109881109882109883109884109885109886109887109888109889109890109891109892109893109894109895109896109897109898109899109900109901109902109903109904109905109906109907109908109909109910109911109912109913109914109915109916109917109918109919109920109921109922109923109924109925109926109927109928109929109930109931109932109933109934109935109936109937109938109939109940109941109942109943109944109945109946109947109948109949109950109951109952109953109954109955109956109957109958109959109960109961109962109963109964109965109966109967109968109969109970109971109972109973109974109975109976109977109978109979109980109981109982109983109984109985109986109987109988109989109990109991109992109993109994109995109996109997109998109999110000110001110002110003110004110005110006110007110008110009110010110011110012110013110014110015110016110017110018110019110020110021110022110023110024110025110026110027110028110029110030110031110032110033110034110035110036110037110038110039110040110041110042110043110044110045110046110047110048110049110050110051110052110053110054110055110056110057110058110059110060110061110062110063110064110065110066110067110068110069110070110071110072110073110074110075110076110077110078110079110080110081110082110083110084110085110086110087110088110089110090110091110092110093110094110095110096110097110098110099110100110101110102110103110104110105110106110107110108110109110110110111110112110113110114110115110116110117110118110119110120110121110122110123110124110125110126110127110128110129110130110131110132110133110134110135110136110137110138110139110140110141110142110143110144110145110146110147110148110149110150110151110152110153110154110155110156110157110158110159110160110161110162110163110164110165110166110167110168110169110170110171110172110173110174110175110176110177110178110179110180110181110182110183110184110185110186110187110188110189110190110191110192110193110194110195110196110197110198110199110200110201110202110203110204110205110206110207110208110209110210110211110212110213110214110215110216110217110218110219110220110221110222110223110224110225110226110227110228110229110230110231110232110233110234110235110236110237110238110239110240110241110242110243110244110245110246110247110248110249110250110251110252110253110254110255110256110257110258110259110260110261110262110263110264110265110266110267110268110269110270110271110272110273110274110275110276110277110278110279110280110281110282110283110284110285110286110287110288110289110290110291110292110293110294110295110296110297110298110299110300110301110302110303110304110305110306110307110308110309110310110311110312110313110314110315110316110317110318110319110320110321110322110323110324110325110326110327110328110329110330110331110332110333110334110335110336110337110338110339110340110341110342110343110344110345110346110347110348110349110350110351110352110353110354110355110356110357110358110359110360110361110362110363110364110365110366110367110368110369110370110371110372110373110374110375110376110377110378110379110380110381110382110383110384110385110386110387110388110389110390110391110392110393110394110395110396110397110398110399110400110401110402110403110404110405110406110407110408110409110410110411110412110413110414110415110416110417110418110419110420110421110422110423110424110425110426110427110428110429110430110431110432110433110434110435110436110437110438110439110440110441110442110443110444110445110446110447110448110449110450110451110452110453110454110455110456110457110458110459110460110461110462110463110464110465110466110467110468110469110470110471110472110473110474110475110476110477110478110479110480110481110482110483110484110485110486110487110488110489110490110491110492110493110494110495110496110497110498110499110500110501110502110503110504110505110506110507110508110509110510110511110512110513110514110515110516110517110518110519110520110521110522110523110524110525110526110527110528110529110530110531110532110533110534110535110536110537110538110539110540110541110542110543110544110545110546110547110548110549110550110551110552110553110554110555110556110557110558110559110560110561110562110563110564110565110566110567110568110569110570110571110572110573110574110575110576110577110578110579110580110581110582110583110584110585110586110587110588110589110590110591110592110593110594110595110596110597110598110599110600110601110602110603110604110605110606110607110608110609110610110611110612110613110614110615110616110617110618110619110620110621110622110623110624110625110626110627110628110629110630110631110632110633110634110635110636110637110638110639110640110641110642110643110644110645110646110647110648110649110650110651110652110653110654110655110656110657110658110659110660110661110662110663110664110665110666110667110668110669110670110671110672110673110674110675110676110677110678110679110680110681110682110683110684110685110686110687110688110689110690110691110692110693110694110695110696110697110698110699110700110701110702110703110704110705110706110707110708110709110710110711110712110713110714110715110716110717110718110719110720110721110722110723110724110725110726110727110728110729110730110731110732110733110734110735110736110737110738110739110740110741110742110743110744110745110746110747110748110749110750110751110752110753110754110755110756110757110758110759110760110761110762110763110764110765110766110767110768110769110770110771110772110773110774110775110776110777110778110779110780110781110782110783110784110785110786110787110788110789110790110791110792110793110794110795110796110797110798110799110800110801110802110803110804110805110806110807110808110809110810110811110812110813110814110815110816110817110818110819110820110821110822110823110824110825110826110827110828110829110830110831110832110833110834110835110836110837110838110839110840110841110842110843110844110845110846110847110848110849110850110851110852110853110854110855110856110857110858110859110860110861110862110863110864110865110866110867110868110869110870110871110872110873110874110875110876110877110878110879110880110881110882110883110884110885110886110887110888110889110890110891110892110893110894110895110896110897110898110899110900110901110902110903110904110905110906110907110908110909110910110911110912110913110914110915110916110917110918110919110920110921110922110923110924110925110926110927110928110929110930110931110932110933110934110935110936110937110938110939110940110941110942110943110944110945110946110947110948110949110950110951110952110953110954110955110956110957110958110959110960110961110962110963110964110965110966110967110968110969110970110971110972110973110974110975110976110977110978110979110980110981110982110983110984110985110986110987110988110989110990110991110992110993110994110995110996110997110998110999111000111001111002111003111004111005111006111007111008111009111010111011111012111013111014111015111016111017111018111019111020111021111022111023111024111025111026111027111028111029111030111031111032111033111034111035111036111037111038111039111040111041111042111043111044111045111046111047111048111049111050111051111052111053111054111055111056111057111058111059111060111061111062111063111064111065111066111067111068111069111070111071111072111073111074111075111076111077111078111079111080111081111082111083111084111085111086111087111088111089111090111091111092111093111094111095111096111097111098111099111100111101111102111103111104111105111106111107111108111109111110111111111112111113111114111115111116111117111118111119111120111121111122111123111124111125111126111127111128111129111130111131111132111133111134111135111136111137111138111139111140111141111142111143111144111145111146111147111148111149111150111151111152111153111154111155111156111157111158111159111160111161111162111163111164111165111166111167111168111169111170111171111172111173111174111175111176111177111178111179111180111181111182111183111184111185111186111187111188111189111190111191111192111193111194111195111196111197111198111199111200111201111202111203111204111205111206111207111208111209111210111211111212111213111214111215111216111217111218111219111220111221111222111223111224111225111226111227111228111229111230111231111232111233111234111235111236111237111238111239111240111241111242111243111244111245111246111247111248111249111250111251111252111253111254111255111256111257111258111259111260111261111262111263111264111265111266111267111268111269111270111271111272111273111274111275111276111277111278111279111280111281111282111283111284111285111286111287111288111289111290111291111292111293111294111295111296111297111298111299111300111301111302111303111304111305111306111307111308111309111310111311111312111313111314111315111316111317111318111319111320111321111322111323111324111325111326111327111328111329111330111331111332111333111334111335111336111337111338111339111340111341111342111343111344111345111346111347111348111349111350111351111352111353111354111355111356111357111358111359111360111361111362111363111364111365111366111367111368111369111370111371111372111373111374111375111376111377111378111379111380111381111382111383111384111385111386111387111388111389111390111391111392111393111394111395111396111397111398111399111400111401111402111403111404111405111406111407111408111409111410111411111412111413111414111415111416111417111418111419111420111421111422111423111424111425111426111427111428111429111430111431111432111433111434111435111436111437111438111439111440111441111442111443111444111445111446111447111448111449111450111451111452111453111454111455111456111457111458111459111460111461111462111463111464111465111466111467111468111469111470111471111472111473111474111475111476111477111478111479111480111481111482111483111484111485111486111487111488111489111490111491111492111493111494111495111496111497111498111499111500111501111502111503111504111505111506111507111508111509111510111511111512111513111514111515111516111517111518111519111520111521111522111523111524111525111526111527111528111529111530111531111532111533111534111535111536111537111538111539111540111541111542111543111544111545111546111547111548111549111550111551111552111553111554111555111556111557111558111559111560111561111562111563111564111565111566111567111568111569111570111571111572111573111574111575111576111577111578111579111580111581111582111583111584111585111586111587111588111589111590111591111592111593111594111595111596111597111598111599111600111601111602111603111604111605111606111607111608111609111610111611111612111613111614111615111616111617111618111619111620111621111622111623111624111625111626111627111628111629111630111631111632111633111634111635111636111637111638111639111640111641111642111643111644111645111646111647111648111649111650111651111652111653111654111655111656111657111658111659111660111661111662111663111664111665111666111667111668111669111670111671111672111673111674111675111676111677111678111679111680111681111682111683111684111685111686111687111688111689111690111691111692111693111694111695111696111697111698111699111700111701111702111703111704111705111706111707111708111709111710111711111712111713111714111715111716111717111718111719111720111721111722111723111724111725111726111727111728111729111730111731111732111733111734111735111736111737111738111739111740111741111742111743111744111745111746111747111748111749111750111751111752111753111754111755111756111757111758111759111760111761111762111763111764111765111766111767111768111769111770111771111772111773111774111775111776111777111778111779111780111781111782111783111784111785111786111787111788111789111790111791111792111793111794111795111796111797111798111799111800111801111802111803111804111805111806111807111808111809111810111811111812111813111814111815111816111817111818111819111820111821111822111823111824111825111826111827111828111829111830111831111832111833111834111835111836111837111838111839111840111841111842111843111844111845111846111847111848111849111850111851111852111853111854111855111856111857111858111859111860111861111862111863111864111865111866111867111868111869111870111871111872111873111874111875111876111877111878111879111880111881111882111883111884111885111886111887111888111889111890111891111892111893111894111895111896111897111898111899111900111901111902111903111904111905111906111907111908111909111910111911111912111913111914111915111916111917111918111919111920111921111922111923111924111925111926111927111928111929111930111931111932111933111934111935111936111937111938111939111940111941111942111943111944111945111946111947111948111949111950111951111952111953111954111955111956111957111958111959111960111961111962111963111964111965111966111967111968111969111970111971111972111973111974111975111976111977111978111979111980111981111982111983111984111985111986111987111988111989111990111991111992111993111994111995111996111997111998111999112000112001112002112003112004112005112006112007112008112009112010112011112012112013112014112015112016112017112018112019112020112021112022112023112024112025112026112027112028112029112030112031112032112033112034112035112036112037112038112039112040112041112042112043112044112045112046112047112048112049112050112051112052112053112054112055112056112057112058112059112060112061112062112063112064112065112066112067112068112069112070112071112072112073112074112075112076112077112078112079112080112081112082112083112084112085112086112087112088112089112090112091112092112093112094112095112096112097112098112099112100112101112102112103112104112105112106112107112108112109112110112111112112112113112114112115112116112117112118112119112120112121112122112123112124112125112126112127112128112129112130112131112132112133112134112135112136112137112138112139112140112141112142112143112144112145112146112147112148112149112150112151112152112153112154112155112156112157112158112159112160112161112162112163112164112165112166112167112168112169112170112171112172112173112174112175112176112177112178112179112180112181112182112183112184112185112186112187112188112189112190112191112192112193112194112195112196112197112198112199112200112201112202112203112204112205112206112207112208112209112210112211112212112213112214112215112216112217112218112219112220112221112222112223112224112225112226112227112228112229112230112231112232112233112234112235112236112237112238112239112240112241112242112243112244112245112246112247112248112249112250112251112252112253112254112255112256112257112258112259112260112261112262112263112264112265112266112267112268112269112270112271112272112273112274112275112276112277112278112279112280112281112282112283112284112285112286112287112288112289112290112291112292112293112294112295112296112297112298112299112300112301112302112303112304112305112306112307112308112309112310112311112312112313112314112315112316112317112318112319112320112321112322112323112324112325112326112327112328112329112330112331112332112333112334112335112336112337112338112339112340112341112342112343112344112345112346112347112348112349112350112351112352112353112354112355112356112357112358112359112360112361112362112363112364112365112366112367112368112369112370112371112372112373112374112375112376112377112378112379112380112381112382112383112384112385112386112387112388112389112390112391112392112393112394112395112396112397112398112399112400112401112402112403112404112405112406112407112408112409112410112411112412112413112414112415112416112417112418112419112420112421112422112423112424112425112426112427112428112429112430112431112432112433112434112435112436112437112438112439112440112441112442112443112444112445112446112447112448112449112450112451112452112453112454112455112456112457112458112459112460112461112462112463112464112465112466112467112468112469112470112471112472112473112474112475112476112477112478112479112480112481112482112483112484112485112486112487112488112489112490112491112492112493112494112495112496112497112498112499112500112501112502112503112504112505112506112507112508112509112510112511112512112513112514112515112516112517112518112519112520112521112522112523112524112525112526112527112528112529112530112531112532112533112534112535112536112537112538112539112540112541112542112543112544112545112546112547112548112549112550112551112552112553112554112555112556112557112558112559112560112561112562112563112564112565112566112567112568112569112570112571112572112573112574112575112576112577112578112579112580112581112582112583112584112585112586112587112588112589112590112591112592112593112594112595112596112597112598112599112600112601112602112603112604112605112606112607112608112609112610112611112612112613112614112615112616112617112618112619112620112621112622112623112624112625112626112627112628112629112630112631112632112633112634112635112636112637112638112639112640112641112642112643112644112645112646112647112648112649112650112651112652112653112654112655112656112657112658112659112660112661112662112663112664112665112666112667112668112669112670112671112672112673112674112675112676112677112678112679112680112681112682112683112684112685112686112687112688112689112690112691112692112693112694112695112696112697112698112699112700112701112702112703112704112705112706112707112708112709112710112711112712112713112714112715112716112717112718112719112720112721112722112723112724112725112726112727112728112729112730112731112732112733112734112735112736112737112738112739112740112741112742112743112744112745112746112747112748112749112750112751112752112753112754112755112756112757112758112759112760112761112762112763112764112765112766112767112768112769112770112771112772112773112774112775112776112777112778112779112780112781112782112783112784112785112786112787112788112789112790112791112792112793112794112795112796112797112798112799112800112801112802112803112804112805112806112807112808112809112810112811112812112813112814112815112816112817112818112819112820112821112822112823112824112825112826112827112828112829112830112831112832112833112834112835112836112837112838112839112840112841112842112843112844112845112846112847112848112849112850112851112852112853112854112855112856112857112858112859112860112861112862112863112864112865112866112867112868112869112870112871112872112873112874112875112876112877112878112879112880112881112882112883112884112885112886112887112888112889112890112891112892112893112894112895112896112897112898112899112900112901112902112903112904112905112906112907112908112909112910112911112912112913112914112915112916112917112918112919112920112921112922112923112924112925112926112927112928112929112930112931112932112933112934112935112936112937112938112939112940112941112942112943112944112945112946112947112948112949112950112951112952112953112954112955112956112957112958112959112960112961112962112963112964112965112966112967112968112969112970112971112972112973112974112975112976112977112978112979112980112981112982112983112984112985112986112987112988112989112990112991112992112993112994112995112996112997112998112999113000113001113002113003113004113005113006113007113008113009113010113011113012113013113014113015113016113017113018113019113020113021113022113023113024113025113026113027113028113029113030113031113032113033113034113035113036113037113038113039113040113041113042113043113044113045113046113047113048113049113050113051113052113053113054113055113056113057113058113059113060113061113062113063113064113065113066113067113068113069113070113071113072113073113074113075113076113077113078113079113080113081113082113083113084113085113086113087113088113089113090113091113092113093113094113095113096113097113098113099113100113101113102113103113104113105113106113107113108113109113110113111113112113113113114113115113116113117113118113119113120113121113122113123113124113125113126113127113128113129113130113131113132113133113134113135113136113137113138113139113140113141113142113143113144113145113146113147113148113149113150113151113152113153113154113155113156113157113158113159113160113161113162113163113164113165113166113167113168113169113170113171113172113173113174113175113176113177113178113179113180113181113182113183113184113185113186113187113188113189113190113191113192113193113194113195113196113197113198113199113200113201113202113203113204113205113206113207113208113209113210113211113212113213113214113215113216113217113218113219113220113221113222113223113224113225113226113227113228113229113230113231113232113233113234113235113236113237113238113239113240113241113242113243113244113245113246113247113248113249113250113251113252113253113254113255113256113257113258113259113260113261113262113263113264113265113266113267113268113269113270113271113272113273113274113275113276113277113278113279113280113281113282113283113284113285113286113287113288113289113290113291113292113293113294113295113296113297113298113299113300113301113302113303113304113305113306113307113308113309113310113311113312113313113314113315113316113317113318113319113320113321113322113323113324113325113326113327113328113329113330113331113332113333113334113335113336113337113338113339113340113341113342113343113344113345113346113347113348113349113350113351113352113353113354113355113356113357113358113359113360113361113362113363113364113365113366113367113368113369113370113371113372113373113374113375113376113377113378113379113380113381113382113383113384113385113386113387113388113389113390113391113392113393113394113395113396113397113398113399113400113401113402113403113404113405113406113407113408113409113410113411113412113413113414113415113416113417113418113419113420113421113422113423113424113425113426113427113428113429113430113431113432113433113434113435113436113437113438113439113440113441113442113443113444113445113446113447113448113449113450113451113452113453113454113455113456113457113458113459113460113461113462113463113464113465113466113467113468113469113470113471113472113473113474113475113476113477113478113479113480113481113482113483113484113485113486113487113488113489113490113491113492113493113494113495113496113497113498113499113500113501113502113503113504113505113506113507113508113509113510113511113512113513113514113515113516113517113518113519113520113521113522113523113524113525113526113527113528113529113530113531113532113533113534113535113536113537113538113539113540113541113542113543113544113545113546113547113548113549113550113551113552113553113554113555113556113557113558113559113560113561113562113563113564113565113566113567113568113569113570113571113572113573113574113575113576113577113578113579113580113581113582113583113584113585113586113587113588113589113590113591113592113593113594113595113596113597113598113599113600113601113602113603113604113605113606113607113608113609113610113611113612113613113614113615113616113617113618113619113620113621113622113623113624113625113626113627113628113629113630113631113632113633113634113635113636113637113638113639113640113641113642113643113644113645113646113647113648113649113650113651113652113653113654113655113656113657113658113659113660113661113662113663113664113665113666113667113668113669113670113671113672113673113674113675113676113677113678113679113680113681113682113683113684113685113686113687113688113689113690113691113692113693113694113695113696113697113698113699113700113701113702113703113704113705113706113707113708113709113710113711113712113713113714113715113716113717113718113719113720113721113722113723113724113725113726113727113728113729113730113731113732113733113734113735113736113737113738113739113740113741113742113743113744113745113746113747113748113749113750113751113752113753113754113755113756113757113758113759113760113761113762113763113764113765113766113767113768113769113770113771113772113773113774113775113776113777113778113779113780113781113782113783113784113785113786113787113788113789113790113791113792113793113794113795113796113797113798113799113800113801113802113803113804113805113806113807113808113809113810113811113812113813113814113815113816113817113818113819113820113821113822113823113824113825113826113827113828113829113830113831113832113833113834113835113836113837113838113839113840113841113842113843113844113845113846113847113848113849113850113851113852113853113854113855113856113857113858113859113860113861113862113863113864113865113866113867113868113869113870113871113872113873113874113875113876113877113878113879113880113881113882113883113884113885113886113887113888113889113890113891113892113893113894113895113896113897113898113899113900113901113902113903113904113905113906113907113908113909113910113911113912113913113914113915113916113917113918113919113920113921113922113923113924113925113926113927113928113929113930113931113932113933113934113935113936113937113938113939113940113941113942113943113944113945113946113947113948113949113950113951113952113953113954113955113956113957113958113959113960113961113962113963113964113965113966113967113968113969113970113971113972113973113974113975113976113977113978113979113980113981113982113983113984113985113986113987113988113989113990113991113992113993113994113995113996113997113998113999114000114001114002114003114004114005114006114007114008114009114010114011114012114013114014114015114016114017114018114019114020114021114022114023114024114025114026114027114028114029114030114031114032114033114034114035114036114037114038114039114040114041114042114043114044114045114046114047114048114049114050114051114052114053114054114055114056114057114058114059114060114061114062114063114064114065114066114067114068114069114070114071114072114073114074114075114076114077114078114079114080114081114082114083114084114085114086114087114088114089114090114091114092114093114094114095114096114097114098114099114100114101114102114103114104114105114106114107114108114109114110114111114112114113114114114115114116114117114118114119114120114121114122114123114124114125114126114127114128114129114130114131114132114133114134114135114136114137114138114139114140114141114142114143114144114145114146114147114148114149114150114151114152114153114154114155114156114157114158114159114160114161114162114163114164114165114166114167114168114169114170114171114172114173114174114175114176114177114178114179114180114181114182114183114184114185114186114187114188114189114190114191114192114193114194114195114196114197114198114199114200114201114202114203114204114205114206114207114208114209114210114211114212114213114214114215114216114217114218114219114220114221114222114223114224114225114226114227114228114229114230114231114232114233114234114235114236114237114238114239114240114241114242114243114244114245114246114247114248114249114250114251114252114253114254114255114256114257114258114259114260114261114262114263114264114265114266114267114268114269114270114271114272114273114274114275114276114277114278114279114280114281114282114283114284114285114286114287114288114289114290114291114292114293114294114295114296114297114298114299114300114301114302114303114304114305114306114307114308114309114310114311114312114313114314114315114316114317114318114319114320114321114322114323114324114325114326114327114328114329114330114331114332114333114334114335114336114337114338114339114340114341114342114343114344114345114346114347114348114349114350114351114352114353114354114355114356114357114358114359114360114361114362114363114364114365114366114367114368114369114370114371114372114373114374114375114376114377114378114379114380114381114382114383114384114385114386114387114388114389114390114391114392114393114394114395114396114397114398114399114400114401114402114403114404114405114406114407114408114409114410114411114412114413114414114415114416114417114418114419114420114421114422114423114424114425114426114427114428114429114430114431114432114433114434114435114436114437114438114439114440114441114442114443114444114445114446114447114448114449114450114451114452114453114454114455114456114457114458114459114460114461114462114463114464114465114466114467114468114469114470114471114472114473114474114475114476114477114478114479114480114481114482114483114484114485114486114487114488114489114490114491114492114493114494114495114496114497114498114499114500114501114502114503114504114505114506114507114508114509114510114511114512114513114514114515114516114517114518114519114520114521114522114523114524114525114526114527114528114529114530114531114532114533114534114535114536114537114538114539114540114541114542114543114544114545114546114547114548114549114550114551114552114553114554114555114556114557114558114559114560114561114562114563114564114565114566114567114568114569114570114571114572114573114574114575114576114577114578114579114580114581114582114583114584114585114586114587114588114589114590114591114592114593114594114595114596114597114598114599114600114601114602114603114604114605114606114607114608114609114610114611114612114613114614114615114616114617114618114619114620114621114622114623114624114625114626114627114628114629114630114631114632114633114634114635114636114637114638114639114640114641114642114643114644114645114646114647114648114649114650114651114652114653114654114655114656114657114658114659114660114661114662114663114664114665114666114667114668114669114670114671114672114673114674114675114676114677114678114679114680114681114682114683114684114685114686114687114688114689114690114691114692114693114694114695114696114697114698114699114700114701114702114703114704114705114706114707114708114709114710114711114712114713114714114715114716114717114718114719114720114721114722114723114724114725114726114727114728114729114730114731114732114733114734114735114736114737114738114739114740114741114742114743114744114745114746114747114748114749114750114751114752114753114754114755114756114757114758114759114760114761114762114763114764114765114766114767114768114769114770114771114772114773114774114775114776114777114778114779114780114781114782114783114784114785114786114787114788114789114790114791114792114793114794114795114796114797114798114799114800114801114802114803114804114805114806114807114808114809114810114811114812114813114814114815114816114817114818114819114820114821114822114823114824114825114826114827114828114829114830114831114832114833114834114835114836114837114838114839114840114841114842114843114844114845114846114847114848114849114850114851114852114853114854114855114856114857114858114859114860114861114862114863114864114865114866114867114868114869114870114871114872114873114874114875114876114877114878114879114880114881114882114883114884114885114886114887114888114889114890114891114892114893114894114895114896114897114898114899114900114901114902114903114904114905114906114907114908114909114910114911114912114913114914114915114916114917114918114919114920114921114922114923114924114925114926114927114928114929114930114931114932114933114934114935114936114937114938114939114940114941114942114943114944114945114946114947114948114949114950114951114952114953114954114955114956114957114958114959114960114961114962114963114964114965114966114967114968114969114970114971114972114973114974114975114976114977114978114979114980114981114982114983114984114985114986114987114988114989114990114991114992114993114994114995114996114997114998114999115000115001115002115003115004115005115006115007115008115009115010115011115012115013115014115015115016115017115018115019115020115021115022115023115024115025115026115027115028115029115030115031115032115033115034115035115036115037115038115039115040115041115042115043115044115045115046115047115048115049115050115051115052115053115054115055115056115057115058115059115060115061115062115063115064115065115066115067115068115069115070115071115072115073115074115075115076115077115078115079115080115081115082115083115084115085115086115087115088115089115090115091115092115093115094115095115096115097115098115099115100115101115102115103115104115105115106115107115108115109115110115111115112115113115114115115115116115117115118115119115120115121115122115123115124115125115126115127115128115129115130115131115132115133115134115135115136115137115138115139115140115141115142115143115144115145115146115147115148115149115150115151115152115153115154115155115156115157115158115159115160115161115162115163115164115165115166115167115168115169115170115171115172115173115174115175115176115177115178115179115180115181115182115183115184115185115186115187115188115189115190115191115192115193115194115195115196115197115198115199115200115201115202115203115204115205115206115207115208115209115210115211115212115213115214115215115216115217115218115219115220115221115222115223115224115225115226115227115228115229115230115231115232115233115234115235115236115237115238115239115240115241115242115243115244115245115246115247115248115249115250115251115252115253115254115255115256115257115258115259115260115261115262115263115264115265115266115267115268115269115270115271115272115273115274115275115276115277115278115279115280115281115282115283115284115285115286115287115288115289115290115291115292115293115294115295115296115297115298115299115300115301115302115303115304115305115306115307115308115309115310115311115312115313115314115315115316115317115318115319115320115321115322115323115324115325115326115327115328115329115330115331115332115333115334115335115336115337115338115339115340115341115342115343115344115345115346115347115348115349115350115351115352115353115354115355115356115357115358115359115360115361115362115363115364115365115366115367115368115369115370115371115372115373115374115375115376115377115378115379115380115381115382115383115384115385115386115387115388115389115390115391115392115393115394115395115396115397115398115399115400115401115402115403115404115405115406115407115408115409115410115411115412115413115414115415115416115417115418115419115420115421115422115423115424115425115426115427115428115429115430115431115432115433115434115435115436115437115438115439115440115441115442115443115444115445115446115447115448115449115450115451115452115453115454115455115456115457115458115459115460115461115462115463115464115465115466115467115468115469115470115471115472115473115474115475115476115477115478115479115480115481115482115483115484115485115486115487115488115489115490115491115492115493115494115495115496115497115498115499115500115501115502115503115504115505115506115507115508115509115510115511115512115513115514115515115516115517115518115519115520115521115522115523115524115525115526115527115528115529115530115531115532115533115534115535115536115537115538115539115540115541115542115543115544115545115546115547115548115549115550115551115552115553115554115555115556115557115558115559115560115561115562115563115564115565115566115567115568115569115570115571115572115573115574115575115576115577115578115579115580115581115582115583115584115585115586115587115588115589115590115591115592115593115594115595115596115597115598115599115600115601115602115603115604115605115606115607115608115609115610115611115612115613115614115615115616115617115618115619115620115621115622115623115624115625115626115627115628115629115630115631115632115633115634115635115636115637115638115639115640115641115642115643115644115645115646115647115648115649115650115651115652115653115654115655115656115657115658115659115660115661115662115663115664115665115666115667115668115669115670115671115672115673115674115675115676115677115678115679115680115681115682115683115684115685115686115687115688115689115690115691115692115693115694115695115696115697115698115699115700115701115702115703115704115705115706115707115708115709115710115711115712115713115714115715115716115717115718115719115720115721115722115723115724115725115726115727115728115729115730115731115732115733115734115735115736115737115738115739115740115741115742115743115744115745115746115747115748115749115750115751115752115753115754115755115756115757115758115759115760115761115762115763115764115765115766115767115768115769115770115771115772115773115774115775115776115777115778115779115780115781115782115783115784115785115786115787115788115789115790115791115792115793115794115795115796115797115798115799115800115801115802115803115804115805115806115807115808115809115810115811115812115813115814115815115816115817115818115819115820115821115822115823115824115825115826115827115828115829115830115831115832115833115834115835115836115837115838115839115840115841115842115843115844115845115846115847115848115849115850115851115852115853115854115855115856115857115858115859115860115861115862115863115864115865115866115867115868115869115870115871115872115873115874115875115876115877115878115879115880115881115882115883115884115885115886115887115888115889115890115891115892115893115894115895115896115897115898115899115900115901115902115903115904115905115906115907115908115909115910115911115912115913115914115915115916115917115918115919115920115921115922115923115924115925115926115927115928115929115930115931115932115933115934115935115936115937115938115939115940115941115942115943115944115945115946115947115948115949115950115951115952115953115954115955115956115957115958115959115960115961115962115963115964115965115966115967115968115969115970115971115972115973115974115975115976115977115978115979115980115981115982115983115984115985115986115987115988115989115990115991115992115993115994115995115996115997115998115999116000116001116002116003116004116005116006116007116008116009116010116011116012116013116014116015116016116017116018116019116020116021116022116023116024116025116026116027116028116029116030116031116032116033116034116035116036116037116038116039116040116041116042116043116044116045116046116047116048116049116050116051116052116053116054116055116056116057116058116059116060116061116062116063116064116065116066116067116068116069116070116071116072116073116074116075116076116077116078116079116080116081116082116083116084116085116086116087116088116089116090116091116092116093116094116095116096116097116098116099116100116101116102116103116104116105116106116107116108116109116110116111116112116113116114116115116116116117116118116119116120116121116122116123116124116125116126116127116128116129116130116131116132116133116134116135116136116137116138116139116140116141116142116143116144116145116146116147116148116149116150116151116152116153116154116155116156116157116158116159116160116161116162116163116164116165116166116167116168116169116170116171116172116173116174116175116176116177116178116179116180116181116182116183116184116185116186116187116188116189116190116191116192116193116194116195116196116197116198116199116200116201116202116203116204116205116206116207116208116209116210116211116212116213116214116215116216116217116218116219116220116221116222116223116224116225116226116227116228116229116230116231116232116233116234116235116236116237116238116239116240116241116242116243116244116245116246116247116248116249116250116251116252116253116254116255116256116257116258116259116260116261116262116263116264116265116266116267116268116269116270116271116272116273116274116275116276116277116278116279116280116281116282116283116284116285116286116287116288116289116290116291116292116293116294116295116296116297116298116299116300116301116302116303116304116305116306116307116308116309116310116311116312116313116314116315116316116317116318116319116320116321116322116323116324116325116326116327116328116329116330116331116332116333116334116335116336116337116338116339116340116341116342116343116344116345116346116347116348116349116350116351116352116353116354116355116356116357116358116359116360116361116362116363116364116365116366116367116368116369116370116371116372116373116374116375116376116377116378116379116380116381116382116383116384116385116386116387116388116389116390116391116392116393116394116395116396116397116398116399116400116401116402116403116404116405116406116407116408116409116410116411116412116413116414116415116416116417116418116419116420116421116422116423116424116425116426116427116428116429116430116431116432116433116434116435116436116437116438116439116440116441116442116443116444116445116446116447116448116449116450116451116452116453116454116455116456116457116458116459116460116461116462116463116464116465116466116467116468116469116470116471116472116473116474116475116476116477116478116479116480116481116482116483116484116485116486116487116488116489116490116491116492116493116494116495116496116497116498116499116500116501116502116503116504116505116506116507116508116509116510116511116512116513116514116515116516116517116518116519116520116521116522116523116524116525116526116527116528116529116530116531116532116533116534116535116536116537116538116539116540116541116542116543116544116545116546116547116548116549116550116551116552116553116554116555116556116557116558116559116560116561116562116563116564116565116566116567116568116569116570116571116572116573116574116575116576116577116578116579116580116581116582116583116584116585116586116587116588116589116590116591116592116593116594116595116596116597116598116599116600116601116602116603116604116605116606116607116608116609116610116611116612116613116614116615116616116617116618116619116620116621116622116623116624116625116626116627116628116629116630116631116632116633116634116635116636116637116638116639116640116641116642116643116644116645116646116647116648116649116650116651116652116653116654116655116656116657116658116659116660116661116662116663116664116665116666116667116668116669116670116671116672116673116674116675116676116677116678116679116680116681116682116683116684116685116686116687116688116689116690116691116692116693116694116695116696116697116698116699116700116701116702116703116704116705116706116707116708116709116710116711116712116713116714116715116716116717116718116719116720116721116722116723116724116725116726116727116728116729116730116731116732116733116734116735116736116737116738116739116740116741116742116743116744116745116746116747116748116749116750116751116752116753116754116755116756116757116758116759116760116761116762116763116764116765116766116767116768116769116770116771116772116773116774116775116776116777116778116779116780116781116782116783116784116785116786116787116788116789116790116791116792116793116794116795116796116797116798116799116800116801116802116803116804116805116806116807116808116809116810116811116812116813116814116815116816116817116818116819116820116821116822116823116824116825116826116827116828116829116830116831116832116833116834116835116836116837116838116839116840116841116842116843116844116845116846116847116848116849116850116851116852116853116854116855116856116857116858116859116860116861116862116863116864116865116866116867116868116869116870116871116872116873116874116875116876116877116878116879116880116881116882116883116884116885116886116887116888116889116890116891116892116893116894116895116896116897116898116899116900116901116902116903116904116905116906116907116908116909116910116911116912116913116914116915116916116917116918116919116920116921116922116923116924116925116926116927116928116929116930116931116932116933116934116935116936116937116938116939116940116941116942116943116944116945116946116947116948116949116950116951116952116953116954116955116956116957116958116959116960116961116962116963116964116965116966116967116968116969116970116971116972116973116974116975116976116977116978116979116980116981116982116983116984116985116986116987116988116989116990116991116992116993116994116995116996116997116998116999117000117001117002117003117004117005117006117007117008117009117010117011117012117013117014117015117016117017117018117019117020117021117022117023117024117025117026117027117028117029117030117031117032117033117034117035117036117037117038117039117040117041117042117043117044117045117046117047117048117049117050117051117052117053117054117055117056117057117058117059117060117061117062117063117064117065117066117067117068117069117070117071117072117073117074117075117076117077117078117079117080117081117082117083117084117085117086117087117088117089117090117091117092117093117094117095117096117097117098117099117100117101117102117103117104117105117106117107117108117109117110117111117112117113117114117115117116117117117118117119117120117121117122117123117124117125117126117127117128117129117130117131117132117133117134117135117136117137117138117139117140117141117142117143117144117145117146117147117148117149117150117151117152117153117154117155117156117157117158117159117160117161117162117163117164117165117166117167117168117169117170117171117172117173117174117175117176117177117178117179117180117181117182117183117184117185117186117187117188117189117190117191117192117193117194117195117196117197117198117199117200117201117202117203117204117205117206117207117208117209117210117211117212117213117214117215117216117217117218117219117220117221117222117223117224117225117226117227117228117229117230117231117232117233117234117235117236117237117238117239117240117241117242117243117244117245117246117247117248117249117250117251117252117253117254117255117256117257117258117259117260117261117262117263117264117265117266117267117268117269117270117271117272117273117274117275117276117277117278117279117280117281117282117283117284117285117286117287117288117289117290117291117292117293117294117295117296117297117298117299117300117301117302117303117304117305117306117307117308117309117310117311117312117313117314117315117316117317117318117319117320117321117322117323117324117325117326117327117328117329117330117331117332117333117334117335117336117337117338117339117340117341117342117343117344117345117346117347117348117349117350117351117352117353117354117355117356117357117358117359117360117361117362117363117364117365117366117367117368117369117370117371117372117373117374117375117376117377117378117379117380117381117382117383117384117385117386117387117388117389117390117391117392117393117394117395117396117397117398117399117400117401117402117403117404117405117406117407117408117409117410117411117412117413117414117415117416117417117418117419117420117421117422117423117424117425117426117427117428117429117430117431117432117433117434117435117436117437117438117439117440117441117442117443117444117445117446117447117448117449117450117451117452117453117454117455117456117457117458117459117460117461117462117463117464117465117466117467117468117469117470117471117472117473117474117475117476117477117478117479117480117481117482117483117484117485117486117487117488117489117490117491117492117493117494117495117496117497117498117499117500117501117502117503117504117505117506117507117508117509117510117511117512117513117514117515117516117517117518117519117520117521117522117523117524117525117526117527117528117529117530117531117532117533117534117535117536117537117538117539117540117541117542117543117544117545117546117547117548117549117550117551117552117553117554117555117556117557117558117559117560117561117562117563117564117565117566117567117568117569117570117571117572117573117574117575117576117577117578117579117580117581117582117583117584117585117586117587117588117589117590117591117592117593117594117595117596117597117598117599117600117601117602117603117604117605117606117607117608117609117610117611117612117613117614117615117616117617117618117619117620117621117622117623117624117625117626117627117628117629117630117631117632117633117634117635117636117637117638117639117640117641117642117643117644117645117646117647117648117649117650117651117652117653117654117655117656117657117658117659117660117661117662117663117664117665117666117667117668117669117670117671117672117673117674117675117676117677117678117679117680117681117682117683117684117685117686117687117688117689117690117691117692117693117694117695117696117697117698117699117700117701117702117703117704117705117706117707117708117709117710117711117712117713117714117715117716117717117718117719117720117721117722117723117724117725117726117727117728117729117730117731117732117733117734117735117736117737117738117739117740117741117742117743117744117745117746117747117748117749117750117751117752117753117754117755117756117757117758117759117760117761117762117763117764117765117766117767117768117769117770117771117772117773117774117775117776117777117778117779117780117781117782117783117784117785117786117787117788117789117790117791117792117793117794117795117796117797117798117799117800117801117802117803117804117805117806117807117808117809117810117811117812117813117814117815117816117817117818117819117820117821117822117823117824117825117826117827117828117829117830117831117832117833117834117835117836117837117838117839117840117841117842117843117844117845117846117847117848117849117850117851117852117853117854117855117856117857117858117859117860117861117862117863117864117865117866117867117868117869117870117871117872117873117874117875117876117877117878117879117880117881117882117883117884117885117886117887117888117889117890117891117892117893117894117895117896117897117898117899117900117901117902117903117904117905117906117907117908117909117910117911117912117913117914117915117916117917117918117919117920117921117922117923117924117925117926117927117928117929117930117931117932117933117934117935117936117937117938117939117940117941117942117943117944117945117946117947117948117949117950117951117952117953117954117955117956117957117958117959117960117961117962117963117964117965117966117967117968117969117970117971117972117973117974117975117976117977117978117979117980117981117982117983117984117985117986117987117988117989117990117991117992117993117994117995117996117997117998117999118000118001118002118003118004118005118006118007118008118009118010118011118012118013118014118015118016118017118018118019118020118021118022118023118024118025118026118027118028118029118030118031118032118033118034118035118036118037118038118039118040118041118042118043118044118045118046118047118048118049118050118051118052118053118054118055118056118057118058118059118060118061118062118063118064118065118066118067118068118069118070118071118072118073118074118075118076118077118078118079118080118081118082118083118084118085118086118087118088118089118090118091118092118093118094118095118096118097118098118099118100118101118102118103118104118105118106118107118108118109118110118111118112118113118114118115118116118117118118118119118120118121118122118123118124118125118126118127118128118129118130118131118132118133118134118135118136118137118138118139118140118141118142118143118144118145118146118147118148118149118150118151118152118153118154118155118156118157118158118159118160118161118162118163118164118165118166118167118168118169118170118171118172118173118174118175118176118177118178118179118180118181118182118183118184118185118186118187118188118189118190118191118192118193118194118195118196118197118198118199118200118201118202118203118204118205118206118207118208118209118210118211118212118213118214118215118216118217118218118219118220118221118222118223118224118225118226118227118228118229118230118231118232118233118234118235118236118237118238118239118240118241118242118243118244118245118246118247118248118249118250118251118252118253118254118255118256118257118258118259118260118261118262118263118264118265118266118267118268118269118270118271118272118273118274118275118276118277118278118279118280118281118282118283118284118285118286118287118288118289118290118291118292118293118294118295118296118297118298118299118300118301118302118303118304118305118306118307118308118309118310118311118312118313118314118315118316118317118318118319118320118321118322118323118324118325118326118327118328118329118330118331118332118333118334118335118336118337118338118339118340118341118342118343118344118345118346118347118348118349118350118351118352118353118354118355118356118357118358118359118360118361118362118363118364118365118366118367118368118369118370118371118372118373118374118375118376118377118378118379118380118381118382118383118384118385118386118387118388118389118390118391118392118393118394118395118396118397118398118399118400118401118402118403118404118405118406118407118408118409118410118411118412118413118414118415118416118417118418118419118420118421118422118423118424118425118426118427118428118429118430118431118432118433118434118435118436118437118438118439118440118441118442118443118444118445118446118447118448118449118450118451118452118453118454118455118456118457118458118459118460118461118462118463118464118465118466118467118468118469118470118471118472118473118474118475118476118477118478118479118480118481118482118483118484118485118486118487118488118489118490118491118492118493118494118495118496118497118498118499118500118501118502118503118504118505118506118507118508118509118510118511118512118513118514118515118516118517118518118519118520118521118522118523118524118525118526118527118528118529118530118531118532118533118534118535118536118537118538118539118540118541118542118543118544118545118546118547118548118549118550118551118552118553118554118555118556118557118558118559118560118561118562118563118564118565118566118567118568118569118570118571118572118573118574118575118576118577118578118579118580118581118582118583118584118585118586118587118588118589118590118591118592118593118594118595118596118597118598118599118600118601118602118603118604118605118606118607118608118609118610118611118612118613118614118615118616118617118618118619118620118621118622118623118624118625118626118627118628118629118630118631118632118633118634118635118636118637118638118639118640118641118642118643118644118645118646118647118648118649118650118651118652118653118654118655118656118657118658118659118660118661118662118663118664118665118666118667118668118669118670118671118672118673118674118675118676118677118678118679118680118681118682118683118684118685118686118687118688118689118690118691118692118693118694118695118696118697118698118699118700118701118702118703118704118705118706118707118708118709118710118711118712118713118714118715118716118717118718118719118720118721118722118723118724118725118726118727118728118729118730118731118732118733118734118735118736118737118738118739118740118741118742118743118744118745118746118747118748118749118750118751118752118753118754118755118756118757118758118759118760118761118762118763118764118765118766118767118768118769118770118771118772118773118774118775118776118777118778118779118780118781118782118783118784118785118786118787118788118789118790118791118792118793118794118795118796118797118798118799118800118801118802118803118804118805118806118807118808118809118810118811118812118813118814118815118816118817118818118819118820118821118822118823118824118825118826118827118828118829118830118831118832118833118834118835118836118837118838118839118840118841118842118843118844118845118846118847118848118849118850118851118852118853118854118855118856118857118858118859118860118861118862118863118864118865118866118867118868118869118870118871118872118873118874118875118876118877118878118879118880118881118882118883118884118885118886118887118888118889118890118891118892118893118894118895118896118897118898118899118900118901118902118903118904118905118906118907118908118909118910118911118912118913118914118915118916118917118918118919118920118921118922118923118924118925118926118927118928118929118930118931118932118933118934118935118936118937118938118939118940118941118942118943118944118945118946118947118948118949118950118951118952118953118954118955118956118957118958118959118960118961118962118963118964118965118966118967118968118969118970118971118972118973118974118975118976118977118978118979118980118981118982118983118984118985118986118987118988118989118990118991118992118993118994118995118996118997118998118999119000119001119002119003119004119005119006119007119008119009119010119011119012119013119014119015119016119017119018119019119020119021119022119023119024119025119026119027119028119029119030119031119032119033119034119035119036119037119038119039119040119041119042119043119044119045119046119047119048119049119050119051119052119053119054119055119056119057119058119059119060119061119062119063119064119065119066119067119068119069119070119071119072119073119074119075119076119077119078119079119080119081119082119083119084119085119086119087119088119089119090119091119092119093119094119095119096119097119098119099119100119101119102119103119104119105119106119107119108119109119110119111119112119113119114119115119116119117119118119119119120119121119122119123119124119125119126119127119128119129119130119131119132119133119134119135119136119137119138119139119140119141119142119143119144119145119146119147119148119149119150119151119152119153119154119155119156119157119158119159119160119161119162119163119164119165119166119167119168119169119170119171119172119173119174119175119176119177119178119179119180119181119182119183119184119185119186119187119188119189119190119191119192119193119194119195119196119197119198119199119200119201119202119203119204119205119206119207119208119209119210119211119212119213119214119215119216119217119218119219119220119221119222119223119224119225119226119227119228119229119230119231119232119233119234119235119236119237119238119239119240119241119242119243119244119245119246119247119248119249119250119251119252119253119254119255119256119257119258119259119260119261119262119263119264119265119266119267119268119269119270119271119272119273119274119275119276119277119278119279119280119281119282119283119284119285119286119287119288119289119290119291119292119293119294119295119296119297119298119299119300119301119302119303119304119305119306119307119308119309119310119311119312119313119314119315119316119317119318119319119320119321119322119323119324119325119326119327119328119329119330119331119332119333119334119335119336119337119338119339119340119341119342119343119344119345119346119347119348119349119350119351119352119353119354119355119356119357119358119359119360119361119362119363119364119365119366119367119368119369119370119371119372119373119374119375119376119377119378119379119380119381119382119383119384119385119386119387119388119389119390119391119392119393119394119395119396119397119398119399119400119401119402119403119404119405119406119407119408119409119410119411119412119413119414119415119416119417119418119419119420119421119422119423119424119425119426119427119428119429119430119431119432119433119434119435119436119437119438119439119440119441119442119443119444119445119446119447119448119449119450119451119452119453119454119455119456119457119458119459119460119461119462119463119464119465119466119467119468119469119470119471119472119473119474119475119476119477119478119479119480119481119482119483119484119485119486119487119488119489119490119491119492119493119494119495119496119497119498119499119500119501119502119503119504119505119506119507119508119509119510119511119512119513119514119515119516119517119518119519119520119521119522119523119524119525119526119527119528119529119530119531119532119533119534119535119536119537119538119539119540119541119542119543119544119545119546119547119548119549119550119551119552119553119554119555119556119557119558119559119560119561119562119563119564119565119566119567119568119569119570119571119572119573119574119575119576119577119578119579119580119581119582119583119584119585119586119587119588119589119590119591119592119593119594119595119596119597119598119599119600119601119602119603119604119605119606119607119608119609119610119611119612119613119614119615119616119617119618119619119620119621119622119623119624119625119626119627119628119629119630119631119632119633119634119635119636119637119638119639119640119641119642119643119644119645119646119647119648119649119650119651119652119653119654119655119656119657119658119659119660119661119662119663119664119665119666119667119668119669119670119671119672119673119674119675119676119677119678119679119680119681119682119683119684119685119686119687119688119689119690119691119692119693119694119695119696119697119698119699119700119701119702119703119704119705119706119707119708119709119710119711119712119713119714119715119716119717119718119719119720119721119722119723119724119725119726119727119728119729119730119731119732119733119734119735119736119737119738119739119740119741119742119743119744119745119746119747119748119749119750119751119752119753119754119755119756119757119758119759119760119761119762119763119764119765119766119767119768119769119770119771119772119773119774119775119776119777119778119779119780119781119782119783119784119785119786119787119788119789119790119791119792119793119794119795119796119797119798119799119800119801119802119803119804119805119806119807119808119809119810119811119812119813119814119815119816119817119818119819119820119821119822119823119824119825119826119827119828119829119830119831119832119833119834119835119836119837119838119839119840119841119842119843119844119845119846119847119848119849119850119851119852119853119854119855119856119857119858119859119860119861119862119863119864119865119866119867119868119869119870119871119872119873119874119875119876119877119878119879119880119881119882119883119884119885119886119887119888119889119890119891119892119893119894119895119896119897119898119899119900119901119902119903119904119905119906119907119908119909119910119911119912119913119914119915119916119917119918119919119920119921119922119923119924119925119926119927119928119929119930119931119932119933119934119935119936119937119938119939119940119941119942119943119944119945119946119947119948119949119950119951119952119953119954119955119956119957119958119959119960119961119962119963119964119965119966119967119968119969119970119971119972119973119974119975119976119977119978119979119980119981119982119983119984119985119986119987119988119989119990119991119992119993119994119995119996119997119998119999120000120001120002120003120004120005120006120007120008120009120010120011120012120013120014120015120016120017120018120019120020120021120022120023120024120025120026120027120028120029120030120031120032120033120034120035120036120037120038120039120040120041120042120043120044120045120046120047120048120049120050120051120052120053120054120055120056120057120058120059120060120061120062120063120064120065120066120067120068120069120070120071120072120073120074120075120076120077120078120079120080120081120082120083120084120085120086120087120088120089120090120091120092120093120094120095120096120097120098120099120100120101120102120103120104120105120106120107120108120109120110120111120112120113120114120115120116120117120118120119120120120121120122120123120124120125120126120127120128120129120130120131120132120133120134120135120136120137120138120139120140120141120142120143120144120145120146120147120148120149120150120151120152120153120154120155120156120157120158120159120160120161120162120163120164120165120166120167120168120169120170120171120172120173120174120175120176120177120178120179120180120181120182120183120184120185120186120187120188120189120190120191120192120193120194120195120196120197120198120199120200120201120202120203120204120205120206120207120208120209120210120211120212120213120214120215120216120217120218120219120220120221120222120223120224120225120226120227120228120229120230120231120232120233120234120235120236120237120238120239120240120241120242120243120244120245120246120247120248120249120250120251120252120253120254120255120256120257120258120259120260120261120262120263120264120265120266120267120268120269120270120271120272120273120274120275120276120277120278120279120280120281120282120283120284120285120286120287120288120289120290120291120292120293120294120295120296120297120298120299120300120301120302120303120304120305120306120307120308120309120310120311120312120313120314120315120316120317120318120319120320120321120322120323120324120325120326120327120328120329120330120331120332120333120334120335120336120337120338120339120340120341120342120343120344120345120346120347120348120349120350120351120352120353120354120355120356120357120358120359120360120361120362120363120364120365120366120367120368120369120370120371120372120373120374120375120376120377120378120379120380120381120382120383120384120385120386120387120388120389120390120391120392120393120394120395120396120397120398120399120400120401120402120403120404120405120406120407120408120409120410120411120412120413120414120415120416120417120418120419120420120421120422120423120424120425120426120427120428120429120430120431120432120433120434120435120436120437120438120439120440120441120442120443120444120445120446120447120448120449120450120451120452120453120454120455120456120457120458120459120460120461120462120463120464120465120466120467120468120469120470120471120472120473120474120475120476120477120478120479120480120481120482120483120484120485120486120487120488120489120490120491120492120493120494120495120496120497120498120499120500120501120502120503120504120505120506120507120508120509120510120511120512120513120514120515120516120517120518120519120520120521120522120523120524120525120526120527120528120529120530120531120532120533120534120535120536120537120538120539120540120541120542120543120544120545120546120547120548120549120550120551120552120553120554120555120556120557120558120559120560120561120562120563120564120565120566120567120568120569120570120571120572120573120574120575120576120577120578120579120580120581120582120583120584120585120586120587120588120589120590120591120592120593120594120595120596120597120598120599120600120601120602120603120604120605120606120607120608120609120610120611120612120613120614120615120616120617120618120619120620120621120622120623120624120625120626120627120628120629120630120631120632120633120634120635120636120637120638120639120640120641120642120643120644120645120646120647120648120649120650120651120652120653120654120655120656120657120658120659120660120661120662120663120664120665120666120667120668120669120670120671120672120673120674120675120676120677120678120679120680120681120682120683120684120685120686120687120688120689120690120691120692120693120694120695120696120697120698120699120700120701120702120703120704120705120706120707120708120709120710120711120712120713120714120715120716120717120718120719120720120721120722120723120724120725120726120727120728120729120730120731120732120733120734120735120736120737120738120739120740120741120742120743120744120745120746120747120748120749120750120751120752120753120754120755120756120757120758120759120760120761120762120763120764120765120766120767120768120769120770120771120772120773120774120775120776120777120778120779120780120781120782120783120784120785120786120787120788120789120790120791120792120793120794120795120796120797120798120799120800120801120802120803120804120805120806120807120808120809120810120811120812120813120814120815120816120817120818120819120820120821120822120823120824120825120826120827120828120829120830120831120832120833120834120835120836120837120838120839120840120841120842120843120844120845120846120847120848120849120850120851120852120853120854120855120856120857120858120859120860120861120862120863120864120865120866120867120868120869120870120871120872120873120874120875120876120877120878120879120880120881120882120883120884120885120886120887120888120889120890120891120892120893120894120895120896120897120898120899120900120901120902120903120904120905120906120907120908120909120910120911120912120913120914120915120916120917120918120919120920120921120922120923120924120925120926120927120928120929120930120931120932120933120934120935120936120937120938120939120940120941120942120943120944120945120946120947120948120949120950120951120952120953120954120955120956120957120958120959120960120961120962120963120964120965120966120967120968120969120970120971120972120973120974120975120976120977120978120979120980120981120982120983120984120985120986120987120988120989120990120991120992120993120994120995120996120997120998120999121000121001121002121003121004121005121006121007121008121009121010121011121012121013121014121015121016121017121018121019121020121021121022121023121024121025121026121027121028121029121030121031121032121033121034121035121036121037121038121039121040121041121042121043121044121045121046121047121048121049121050121051121052121053121054121055121056121057121058121059121060121061121062121063121064121065121066121067121068121069121070121071121072121073121074121075121076121077121078121079121080121081121082121083121084121085121086121087121088121089121090121091121092121093121094121095121096121097121098121099121100121101121102121103121104121105121106121107121108121109121110121111121112121113121114121115121116121117121118121119121120121121121122121123121124121125121126121127121128121129121130121131121132121133121134121135121136121137121138121139121140121141121142121143121144121145121146121147121148121149121150121151121152121153121154121155121156121157121158121159121160121161121162121163121164121165121166121167121168121169121170121171121172121173121174121175121176121177121178121179121180121181121182121183121184121185121186121187121188121189121190121191121192121193121194121195121196121197121198121199121200121201121202121203121204121205121206121207121208121209121210121211121212121213121214121215121216121217121218121219121220121221121222121223121224121225121226121227121228121229121230121231121232121233121234121235121236121237121238121239121240121241121242121243121244121245121246121247121248121249121250121251121252121253121254121255121256121257121258121259121260121261121262121263121264121265121266121267121268121269121270121271121272121273121274121275121276121277121278121279121280121281121282121283121284121285121286121287121288121289121290121291121292121293121294121295121296121297121298121299121300121301121302121303121304121305121306121307121308121309121310121311121312121313121314121315121316121317121318121319121320121321121322121323121324121325121326121327121328121329121330121331121332121333121334121335121336121337121338121339121340121341121342121343121344121345121346121347121348121349121350121351121352121353121354121355121356121357121358121359121360121361121362121363121364121365121366121367121368121369121370121371121372121373121374121375121376121377121378121379121380121381121382121383121384121385121386121387121388121389121390121391121392121393121394121395121396121397121398121399121400121401121402121403121404121405121406121407121408121409121410121411121412121413121414121415121416121417121418121419121420121421121422121423121424121425121426121427121428121429121430121431121432121433121434121435121436121437121438121439121440121441121442121443121444121445121446121447121448121449121450121451121452121453121454121455121456121457121458121459121460121461121462121463121464121465121466121467121468121469121470121471121472121473121474121475121476121477121478121479121480121481121482121483121484121485121486121487121488121489121490121491121492121493121494121495121496121497121498121499121500121501121502121503121504121505121506121507121508121509121510121511121512121513121514121515121516121517121518121519121520121521121522121523121524121525121526121527121528121529121530121531121532121533121534121535121536121537121538121539121540121541121542121543121544121545121546121547121548121549121550121551121552121553121554121555121556121557121558121559121560121561121562121563121564121565121566121567121568121569121570121571121572121573121574121575121576121577121578121579121580121581121582121583121584121585121586121587121588121589121590121591121592121593121594121595121596121597121598121599121600121601121602121603121604121605121606121607121608121609121610121611121612121613121614121615121616121617121618121619121620121621121622121623121624121625121626121627121628121629121630121631121632121633121634121635121636121637121638121639121640121641121642121643121644121645121646121647121648121649121650121651121652121653121654121655121656121657121658121659121660121661121662121663121664121665121666121667121668121669121670121671121672121673121674121675121676121677121678121679121680121681121682121683121684121685121686121687121688121689121690121691121692121693121694121695121696121697121698121699121700121701121702121703121704121705121706121707121708121709121710121711121712121713121714121715121716121717121718121719121720121721121722121723121724121725121726121727121728121729121730121731121732121733121734121735121736121737121738121739121740121741121742121743121744121745121746121747121748121749121750121751121752121753121754121755121756121757121758121759121760121761121762121763121764121765121766121767121768121769121770121771121772121773121774121775121776121777121778121779121780121781121782121783121784121785121786121787121788121789121790121791121792121793121794121795121796121797121798121799121800121801121802121803121804121805121806121807121808121809121810121811121812121813121814121815121816121817121818121819121820121821121822121823121824121825121826121827121828121829121830121831121832121833121834121835121836121837121838121839121840121841121842121843121844121845121846121847121848121849121850121851121852121853121854121855121856121857121858121859121860121861121862121863121864121865121866121867121868121869121870121871121872121873121874121875121876121877121878121879121880121881121882121883121884121885121886121887121888121889121890121891121892121893121894121895121896121897121898121899121900121901121902121903121904121905121906121907121908121909121910121911121912121913121914121915121916121917121918121919121920121921121922121923121924121925121926121927121928121929121930121931121932121933121934121935121936121937121938121939121940121941121942121943121944121945121946121947121948121949121950121951121952121953121954121955121956121957121958121959121960121961121962121963121964121965121966121967121968121969121970121971121972121973121974121975121976121977121978121979121980121981121982121983121984121985121986121987121988121989121990121991121992121993121994121995121996121997121998121999122000122001122002122003122004122005122006122007122008122009122010122011122012122013122014122015122016122017122018122019122020122021122022122023122024122025122026122027122028122029122030122031122032122033122034122035122036122037122038122039122040122041122042122043122044122045122046122047122048122049122050122051122052122053122054122055122056122057122058122059122060122061122062122063122064122065122066122067122068122069122070122071122072122073122074122075122076122077122078122079122080122081122082122083122084122085122086122087122088122089122090122091122092122093122094122095122096122097122098122099122100122101122102122103122104122105122106122107122108122109122110122111122112122113122114122115122116122117122118122119122120122121122122122123122124122125122126122127122128122129122130122131122132122133122134122135122136122137122138122139122140122141122142122143122144122145122146122147122148122149122150122151122152122153122154122155122156122157122158122159122160122161122162122163122164122165122166122167122168122169122170122171122172122173122174122175122176122177122178122179122180122181122182122183122184122185122186122187122188122189122190122191122192122193122194122195122196122197122198122199122200122201122202122203122204122205122206122207122208122209122210122211122212122213122214122215122216122217122218122219122220122221122222122223122224122225122226122227122228122229122230122231122232122233122234122235122236122237122238122239122240122241122242122243122244122245122246122247122248122249122250122251122252122253122254122255122256122257122258122259122260122261122262122263122264122265122266122267122268122269122270122271122272122273122274122275122276122277122278122279122280122281122282122283122284122285122286122287122288122289122290122291122292122293122294122295122296122297122298122299122300122301122302122303122304122305122306122307122308122309122310122311122312122313122314122315122316122317122318122319122320122321122322122323122324122325122326122327122328122329122330122331122332122333122334122335122336122337122338122339122340122341122342122343122344122345122346122347122348122349122350122351122352122353122354122355122356122357122358122359122360122361122362122363122364122365122366122367122368122369122370122371122372122373122374122375122376122377122378122379122380122381122382122383122384122385122386122387122388122389122390122391122392122393122394122395122396122397122398122399122400122401122402122403122404122405122406122407122408122409122410122411122412122413122414122415122416122417122418122419122420122421122422122423122424122425122426122427122428122429122430122431122432122433122434122435122436122437122438122439122440122441122442122443122444122445122446122447122448122449122450122451122452122453122454122455122456122457122458122459122460122461122462122463122464122465122466122467122468122469122470122471122472122473122474122475122476122477122478122479122480122481122482122483122484122485122486122487122488122489122490122491122492122493122494122495122496122497122498122499122500122501122502122503122504122505122506122507122508122509122510122511122512122513122514122515122516122517122518122519122520122521122522122523122524122525122526122527122528122529122530122531122532122533122534122535122536122537122538122539122540122541122542122543122544122545122546122547122548122549122550122551122552122553122554122555122556122557122558122559122560122561122562122563122564122565122566122567122568122569122570122571122572122573122574122575122576122577122578122579122580122581122582122583122584122585122586122587122588122589122590122591122592122593122594122595122596122597122598122599122600122601122602122603122604122605122606122607122608122609122610122611122612122613122614122615122616122617122618122619122620122621122622122623122624122625122626122627122628122629122630122631122632122633122634122635122636122637122638122639122640122641122642122643122644122645122646122647122648122649122650122651122652122653122654122655122656122657122658122659122660122661122662122663122664122665122666122667122668122669122670122671122672122673122674122675122676122677122678122679122680122681122682122683122684122685122686122687122688122689122690122691122692122693122694122695122696122697122698122699122700122701122702122703122704122705122706122707122708122709122710122711122712122713122714122715122716122717122718122719122720122721122722122723122724122725122726122727122728122729122730122731122732122733122734122735122736122737122738122739122740122741122742122743122744122745122746122747122748122749122750122751122752122753122754122755122756122757122758122759122760122761122762122763122764122765122766122767122768122769122770122771122772122773122774122775122776122777122778122779122780122781122782122783122784122785122786122787122788122789122790122791122792122793122794122795122796122797122798122799122800122801122802122803122804122805122806122807122808122809122810122811122812122813122814122815122816122817122818122819122820122821122822122823122824122825122826122827122828122829122830122831122832122833122834122835122836122837122838122839122840122841122842122843122844122845122846122847122848122849122850122851122852122853122854122855122856122857122858122859122860122861122862122863122864122865122866122867122868122869122870122871122872122873122874122875122876122877122878122879122880122881122882122883122884122885122886122887122888122889122890122891122892122893122894122895122896122897122898122899122900122901122902122903122904122905122906122907122908122909122910122911122912122913122914122915122916122917122918122919122920122921122922122923122924122925122926122927122928122929122930122931122932122933122934122935122936122937122938122939122940122941122942122943122944122945122946122947122948122949122950122951122952122953122954122955122956122957122958122959122960122961122962122963122964122965122966122967122968122969122970122971122972122973122974122975122976122977122978122979122980122981122982122983122984122985122986122987122988122989122990122991122992122993122994122995122996122997122998122999123000123001123002123003123004123005123006123007123008123009123010123011123012123013123014123015123016123017123018123019123020123021123022123023123024123025123026123027123028123029123030123031123032123033123034123035123036123037123038123039123040123041123042123043123044123045123046123047123048123049123050123051123052123053123054123055123056123057123058123059123060123061123062123063123064123065123066123067123068123069123070123071123072123073123074123075123076123077123078123079123080123081123082123083123084123085123086123087123088123089123090123091123092123093123094123095123096123097123098123099123100123101123102123103123104123105123106123107123108123109123110123111123112123113123114123115123116123117123118123119123120123121123122123123123124123125123126123127123128123129123130123131123132123133123134123135123136123137123138123139123140123141123142123143123144123145123146123147123148123149123150123151123152123153123154123155123156123157123158123159123160123161123162123163123164123165123166123167123168123169123170123171123172123173123174123175123176123177123178123179123180123181123182123183123184123185123186123187123188123189123190123191123192123193123194123195123196123197123198123199123200123201123202123203123204123205123206123207123208123209123210123211123212123213123214123215123216123217123218123219123220123221123222123223123224123225123226123227123228123229123230123231123232123233123234123235123236123237123238123239123240123241123242123243123244123245123246123247123248123249123250123251123252123253123254123255123256123257123258123259123260123261123262123263123264123265123266123267123268123269123270123271123272123273123274123275123276123277123278123279123280123281123282123283123284123285123286123287123288123289123290123291123292123293123294123295123296123297123298123299123300123301123302123303123304123305123306123307123308123309123310123311123312123313123314123315123316123317123318123319123320123321123322123323123324123325123326123327123328123329123330123331123332123333123334123335123336123337123338123339123340123341123342123343123344123345123346123347123348123349123350123351123352123353123354123355123356123357123358123359123360123361123362123363123364123365123366123367123368123369123370123371123372123373123374123375123376123377123378123379123380123381123382123383123384123385123386123387123388123389123390123391123392123393123394123395123396123397123398123399123400123401123402123403123404123405123406123407123408123409123410123411123412123413123414123415123416123417123418123419123420123421123422123423123424123425123426123427123428123429123430123431123432123433123434123435123436123437123438123439123440123441123442123443123444123445123446123447123448123449123450123451123452123453123454123455123456123457123458123459123460123461123462123463123464123465123466123467123468123469123470123471123472123473123474123475123476123477123478123479123480123481123482123483123484123485123486123487123488123489123490123491123492123493123494123495123496123497123498123499123500123501123502123503123504123505123506123507123508123509123510123511123512123513123514123515123516123517123518123519123520123521123522123523123524123525123526123527123528123529123530123531123532123533123534123535123536123537123538123539123540123541123542123543123544123545123546123547123548123549123550123551123552123553123554123555123556123557123558123559123560123561123562123563123564123565123566123567123568123569123570123571123572123573123574123575123576123577123578123579123580123581123582123583123584123585123586123587123588123589123590123591123592123593123594123595123596123597123598123599123600123601123602123603123604123605123606123607123608123609123610123611123612123613123614123615123616123617123618123619123620123621123622123623123624123625123626123627123628123629123630123631123632123633123634123635123636123637123638123639123640123641123642123643123644123645123646123647123648123649123650123651123652123653123654123655123656123657123658123659123660123661123662123663123664123665123666123667123668123669123670123671123672123673123674123675123676123677123678123679123680123681123682123683123684123685123686123687123688123689123690123691123692123693123694123695123696123697123698123699123700123701123702123703123704123705123706123707123708123709123710123711123712123713123714123715123716123717123718123719123720123721123722123723123724123725123726123727123728123729123730123731123732123733123734123735123736123737123738123739123740123741123742123743123744123745123746123747123748123749123750123751123752123753123754123755123756123757123758123759123760123761123762123763123764123765123766123767123768123769123770123771123772123773123774123775123776123777123778123779123780123781123782123783123784123785123786123787123788123789123790123791123792123793123794123795123796123797123798123799123800123801123802123803123804123805123806123807123808123809123810123811123812123813123814123815123816123817123818123819123820123821123822123823123824123825123826123827123828123829123830123831123832123833123834123835123836123837123838123839123840123841123842123843123844123845123846123847123848123849123850123851123852123853123854123855123856123857123858123859123860123861123862123863123864123865123866123867123868123869123870123871123872123873123874123875123876123877123878123879123880123881123882123883123884123885123886123887123888123889123890123891123892123893123894123895123896123897123898123899123900123901123902123903123904123905123906123907123908123909123910123911123912123913123914123915123916123917123918123919123920123921123922123923123924123925123926123927123928123929123930123931123932123933123934123935123936123937123938123939123940123941123942123943123944123945123946123947123948123949123950123951123952123953123954123955123956123957123958123959123960123961123962123963123964123965123966123967123968123969123970123971123972123973123974123975123976123977123978123979123980123981123982123983123984123985123986123987123988123989123990123991123992123993123994123995123996123997123998123999124000124001124002124003124004124005124006124007124008124009124010124011124012124013124014124015124016124017124018124019124020124021124022124023124024124025124026124027124028124029124030124031124032124033124034124035124036124037124038124039124040124041124042124043124044124045124046124047124048124049124050124051124052124053124054124055124056124057124058124059124060124061124062124063124064124065124066124067124068124069124070124071124072124073124074124075124076124077124078124079124080124081124082124083124084124085124086124087124088124089124090124091124092124093124094124095124096124097124098124099124100124101124102124103124104124105124106124107124108124109124110124111124112124113124114124115124116124117124118124119124120124121124122124123124124124125124126124127124128124129124130124131124132124133124134124135124136124137124138124139124140124141124142124143124144124145124146124147124148124149124150124151124152124153124154124155124156124157124158124159124160124161124162124163124164124165124166124167124168124169124170124171124172124173124174124175124176124177124178124179124180124181124182124183124184124185124186124187124188124189124190124191124192124193124194124195124196124197124198124199124200124201124202124203124204124205124206124207124208124209124210124211124212124213124214124215124216124217124218124219124220124221124222124223124224124225124226124227124228124229124230124231124232124233124234124235124236124237124238124239124240124241124242124243
  1. /*!
  2. *
  3. * iclient-ol
  4. * Copyright© 2000 - 2023 SuperMap Software Co.Ltd
  5. * license: Apache-2.0
  6. * version: v11.1.0
  7. *
  8. */
  9. /******/ (function() { // webpackBootstrap
  10. /******/ var __webpack_modules__ = ({
  11. /***/ 5023:
  12. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  13. "use strict";
  14. var parent = __webpack_require__(6727);
  15. module.exports = parent;
  16. /***/ }),
  17. /***/ 3123:
  18. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  19. "use strict";
  20. var parent = __webpack_require__(8690);
  21. module.exports = parent;
  22. /***/ }),
  23. /***/ 879:
  24. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  25. "use strict";
  26. __webpack_require__(7422);
  27. var path = __webpack_require__(97);
  28. module.exports = path.Object.assign;
  29. /***/ }),
  30. /***/ 3723:
  31. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  32. "use strict";
  33. __webpack_require__(4835);
  34. var WrappedWellKnownSymbolModule = __webpack_require__(8384);
  35. module.exports = WrappedWellKnownSymbolModule.f('asyncIterator');
  36. /***/ }),
  37. /***/ 5980:
  38. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  39. "use strict";
  40. var isCallable = __webpack_require__(729);
  41. var tryToString = __webpack_require__(8434);
  42. var $TypeError = TypeError;
  43. // `Assert: IsCallable(argument) is true`
  44. module.exports = function (argument) {
  45. if (isCallable(argument)) return argument;
  46. throw $TypeError(tryToString(argument) + ' is not a function');
  47. };
  48. /***/ }),
  49. /***/ 7563:
  50. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  51. "use strict";
  52. var isObject = __webpack_require__(691);
  53. var $String = String;
  54. var $TypeError = TypeError;
  55. // `Assert: Type(argument) is Object`
  56. module.exports = function (argument) {
  57. if (isObject(argument)) return argument;
  58. throw $TypeError($String(argument) + ' is not an object');
  59. };
  60. /***/ }),
  61. /***/ 8632:
  62. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  63. "use strict";
  64. var toIndexedObject = __webpack_require__(6462);
  65. var toAbsoluteIndex = __webpack_require__(5333);
  66. var lengthOfArrayLike = __webpack_require__(6803);
  67. // `Array.prototype.{ indexOf, includes }` methods implementation
  68. var createMethod = function createMethod(IS_INCLUDES) {
  69. return function ($this, el, fromIndex) {
  70. var O = toIndexedObject($this);
  71. var length = lengthOfArrayLike(O);
  72. var index = toAbsoluteIndex(fromIndex, length);
  73. var value;
  74. // Array#includes uses SameValueZero equality algorithm
  75. // eslint-disable-next-line no-self-compare -- NaN check
  76. if (IS_INCLUDES && el != el) while (length > index) {
  77. value = O[index++];
  78. // eslint-disable-next-line no-self-compare -- NaN check
  79. if (value != value) return true;
  80. // Array#indexOf ignores holes, Array#includes - not
  81. } else for (; length > index; index++) {
  82. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  83. }
  84. return !IS_INCLUDES && -1;
  85. };
  86. };
  87. module.exports = {
  88. // `Array.prototype.includes` method
  89. // https://tc39.es/ecma262/#sec-array.prototype.includes
  90. includes: createMethod(true),
  91. // `Array.prototype.indexOf` method
  92. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  93. indexOf: createMethod(false)
  94. };
  95. /***/ }),
  96. /***/ 2177:
  97. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  98. "use strict";
  99. var uncurryThis = __webpack_require__(9738);
  100. var toString = uncurryThis({}.toString);
  101. var stringSlice = uncurryThis(''.slice);
  102. module.exports = function (it) {
  103. return stringSlice(toString(it), 8, -1);
  104. };
  105. /***/ }),
  106. /***/ 9029:
  107. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  108. "use strict";
  109. var hasOwn = __webpack_require__(1675);
  110. var ownKeys = __webpack_require__(9402);
  111. var getOwnPropertyDescriptorModule = __webpack_require__(7238);
  112. var definePropertyModule = __webpack_require__(704);
  113. module.exports = function (target, source, exceptions) {
  114. var keys = ownKeys(source);
  115. var defineProperty = definePropertyModule.f;
  116. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  117. for (var i = 0; i < keys.length; i++) {
  118. var key = keys[i];
  119. if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
  120. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  121. }
  122. }
  123. };
  124. /***/ }),
  125. /***/ 8268:
  126. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  127. "use strict";
  128. var DESCRIPTORS = __webpack_require__(6539);
  129. var definePropertyModule = __webpack_require__(704);
  130. var createPropertyDescriptor = __webpack_require__(4925);
  131. module.exports = DESCRIPTORS ? function (object, key, value) {
  132. return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
  133. } : function (object, key, value) {
  134. object[key] = value;
  135. return object;
  136. };
  137. /***/ }),
  138. /***/ 4925:
  139. /***/ (function(module) {
  140. "use strict";
  141. module.exports = function (bitmap, value) {
  142. return {
  143. enumerable: !(bitmap & 1),
  144. configurable: !(bitmap & 2),
  145. writable: !(bitmap & 4),
  146. value: value
  147. };
  148. };
  149. /***/ }),
  150. /***/ 7454:
  151. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  152. "use strict";
  153. var isCallable = __webpack_require__(729);
  154. var definePropertyModule = __webpack_require__(704);
  155. var makeBuiltIn = __webpack_require__(7948);
  156. var defineGlobalProperty = __webpack_require__(161);
  157. module.exports = function (O, key, value, options) {
  158. if (!options) options = {};
  159. var simple = options.enumerable;
  160. var name = options.name !== undefined ? options.name : key;
  161. if (isCallable(value)) makeBuiltIn(value, name, options);
  162. if (options.global) {
  163. if (simple) O[key] = value;else defineGlobalProperty(key, value);
  164. } else {
  165. try {
  166. if (!options.unsafe) delete O[key];else if (O[key]) simple = true;
  167. } catch (error) {/* empty */}
  168. if (simple) O[key] = value;else definePropertyModule.f(O, key, {
  169. value: value,
  170. enumerable: false,
  171. configurable: !options.nonConfigurable,
  172. writable: !options.nonWritable
  173. });
  174. }
  175. return O;
  176. };
  177. /***/ }),
  178. /***/ 161:
  179. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  180. "use strict";
  181. var global = __webpack_require__(5835);
  182. // eslint-disable-next-line es/no-object-defineproperty -- safe
  183. var defineProperty = Object.defineProperty;
  184. module.exports = function (key, value) {
  185. try {
  186. defineProperty(global, key, {
  187. value: value,
  188. configurable: true,
  189. writable: true
  190. });
  191. } catch (error) {
  192. global[key] = value;
  193. }
  194. return value;
  195. };
  196. /***/ }),
  197. /***/ 6539:
  198. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  199. "use strict";
  200. var fails = __webpack_require__(6583);
  201. // Detect IE8's incomplete defineProperty implementation
  202. module.exports = !fails(function () {
  203. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  204. return Object.defineProperty({}, 1, {
  205. get: function get() {
  206. return 7;
  207. }
  208. })[1] != 7;
  209. });
  210. /***/ }),
  211. /***/ 9967:
  212. /***/ (function(module) {
  213. "use strict";
  214. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  215. var documentAll = (typeof document === "undefined" ? "undefined" : _typeof(document)) == 'object' && document.all;
  216. // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
  217. // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
  218. var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;
  219. module.exports = {
  220. all: documentAll,
  221. IS_HTMLDDA: IS_HTMLDDA
  222. };
  223. /***/ }),
  224. /***/ 3343:
  225. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  226. "use strict";
  227. var global = __webpack_require__(5835);
  228. var isObject = __webpack_require__(691);
  229. var document = global.document;
  230. // typeof document.createElement is 'object' in old IE
  231. var EXISTS = isObject(document) && isObject(document.createElement);
  232. module.exports = function (it) {
  233. return EXISTS ? document.createElement(it) : {};
  234. };
  235. /***/ }),
  236. /***/ 1785:
  237. /***/ (function(module) {
  238. "use strict";
  239. module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
  240. /***/ }),
  241. /***/ 9282:
  242. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  243. "use strict";
  244. var global = __webpack_require__(5835);
  245. var userAgent = __webpack_require__(1785);
  246. var process = global.process;
  247. var Deno = global.Deno;
  248. var versions = process && process.versions || Deno && Deno.version;
  249. var v8 = versions && versions.v8;
  250. var match, version;
  251. if (v8) {
  252. match = v8.split('.');
  253. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  254. // but their correct versions are not interesting for us
  255. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  256. }
  257. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  258. // so check `userAgent` even if `.v8` exists, but 0
  259. if (!version && userAgent) {
  260. match = userAgent.match(/Edge\/(\d+)/);
  261. if (!match || match[1] >= 74) {
  262. match = userAgent.match(/Chrome\/(\d+)/);
  263. if (match) version = +match[1];
  264. }
  265. }
  266. module.exports = version;
  267. /***/ }),
  268. /***/ 8525:
  269. /***/ (function(module) {
  270. "use strict";
  271. // IE8- don't enum bug keys
  272. module.exports = ['constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf'];
  273. /***/ }),
  274. /***/ 7926:
  275. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  276. "use strict";
  277. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  278. var global = __webpack_require__(5835);
  279. var getOwnPropertyDescriptor = (__webpack_require__(7238).f);
  280. var createNonEnumerableProperty = __webpack_require__(8268);
  281. var defineBuiltIn = __webpack_require__(7454);
  282. var defineGlobalProperty = __webpack_require__(161);
  283. var copyConstructorProperties = __webpack_require__(9029);
  284. var isForced = __webpack_require__(3175);
  285. /*
  286. options.target - name of the target object
  287. options.global - target is the global object
  288. options.stat - export as static methods of target
  289. options.proto - export as prototype methods of target
  290. options.real - real prototype method for the `pure` version
  291. options.forced - export even if the native feature is available
  292. options.bind - bind methods to the target, required for the `pure` version
  293. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  294. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  295. options.sham - add a flag to not completely full polyfills
  296. options.enumerable - export as enumerable property
  297. options.dontCallGetSet - prevent calling a getter on target
  298. options.name - the .name of the function if it does not match the key
  299. */
  300. module.exports = function (options, source) {
  301. var TARGET = options.target;
  302. var GLOBAL = options.global;
  303. var STATIC = options.stat;
  304. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  305. if (GLOBAL) {
  306. target = global;
  307. } else if (STATIC) {
  308. target = global[TARGET] || defineGlobalProperty(TARGET, {});
  309. } else {
  310. target = (global[TARGET] || {}).prototype;
  311. }
  312. if (target) for (key in source) {
  313. sourceProperty = source[key];
  314. if (options.dontCallGetSet) {
  315. descriptor = getOwnPropertyDescriptor(target, key);
  316. targetProperty = descriptor && descriptor.value;
  317. } else targetProperty = target[key];
  318. FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  319. // contained in target
  320. if (!FORCED && targetProperty !== undefined) {
  321. if (_typeof(sourceProperty) == _typeof(targetProperty)) continue;
  322. copyConstructorProperties(sourceProperty, targetProperty);
  323. }
  324. // add a flag to not completely full polyfills
  325. if (options.sham || targetProperty && targetProperty.sham) {
  326. createNonEnumerableProperty(sourceProperty, 'sham', true);
  327. }
  328. defineBuiltIn(target, key, sourceProperty, options);
  329. }
  330. };
  331. /***/ }),
  332. /***/ 6583:
  333. /***/ (function(module) {
  334. "use strict";
  335. module.exports = function (exec) {
  336. try {
  337. return !!exec();
  338. } catch (error) {
  339. return true;
  340. }
  341. };
  342. /***/ }),
  343. /***/ 9096:
  344. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  345. "use strict";
  346. var fails = __webpack_require__(6583);
  347. module.exports = !fails(function () {
  348. // eslint-disable-next-line es/no-function-prototype-bind -- safe
  349. var test = function () {/* empty */}.bind();
  350. // eslint-disable-next-line no-prototype-builtins -- safe
  351. return typeof test != 'function' || test.hasOwnProperty('prototype');
  352. });
  353. /***/ }),
  354. /***/ 5057:
  355. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  356. "use strict";
  357. var NATIVE_BIND = __webpack_require__(9096);
  358. var call = Function.prototype.call;
  359. module.exports = NATIVE_BIND ? call.bind(call) : function () {
  360. return call.apply(call, arguments);
  361. };
  362. /***/ }),
  363. /***/ 1864:
  364. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  365. "use strict";
  366. var DESCRIPTORS = __webpack_require__(6539);
  367. var hasOwn = __webpack_require__(1675);
  368. var FunctionPrototype = Function.prototype;
  369. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  370. var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
  371. var EXISTS = hasOwn(FunctionPrototype, 'name');
  372. // additional protection from minified / mangled / dropped function names
  373. var PROPER = EXISTS && function something() {/* empty */}.name === 'something';
  374. var CONFIGURABLE = EXISTS && (!DESCRIPTORS || DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable);
  375. module.exports = {
  376. EXISTS: EXISTS,
  377. PROPER: PROPER,
  378. CONFIGURABLE: CONFIGURABLE
  379. };
  380. /***/ }),
  381. /***/ 9738:
  382. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  383. "use strict";
  384. var NATIVE_BIND = __webpack_require__(9096);
  385. var FunctionPrototype = Function.prototype;
  386. var call = FunctionPrototype.call;
  387. var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);
  388. module.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
  389. return function () {
  390. return call.apply(fn, arguments);
  391. };
  392. };
  393. /***/ }),
  394. /***/ 8078:
  395. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  396. "use strict";
  397. var global = __webpack_require__(5835);
  398. var isCallable = __webpack_require__(729);
  399. var aFunction = function aFunction(argument) {
  400. return isCallable(argument) ? argument : undefined;
  401. };
  402. module.exports = function (namespace, method) {
  403. return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];
  404. };
  405. /***/ }),
  406. /***/ 2337:
  407. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  408. "use strict";
  409. var aCallable = __webpack_require__(5980);
  410. var isNullOrUndefined = __webpack_require__(6254);
  411. // `GetMethod` abstract operation
  412. // https://tc39.es/ecma262/#sec-getmethod
  413. module.exports = function (V, P) {
  414. var func = V[P];
  415. return isNullOrUndefined(func) ? undefined : aCallable(func);
  416. };
  417. /***/ }),
  418. /***/ 5835:
  419. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  420. "use strict";
  421. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  422. var check = function check(it) {
  423. return it && it.Math == Math && it;
  424. };
  425. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  426. module.exports =
  427. // eslint-disable-next-line es/no-global-this -- safe
  428. check((typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis)) == 'object' && globalThis) || check((typeof window === "undefined" ? "undefined" : _typeof(window)) == 'object' && window) ||
  429. // eslint-disable-next-line no-restricted-globals -- safe
  430. check((typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self) || check((typeof __webpack_require__.g === "undefined" ? "undefined" : _typeof(__webpack_require__.g)) == 'object' && __webpack_require__.g) ||
  431. // eslint-disable-next-line no-new-func -- fallback
  432. function () {
  433. return this;
  434. }() || this || Function('return this')();
  435. /***/ }),
  436. /***/ 1675:
  437. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  438. "use strict";
  439. var uncurryThis = __webpack_require__(9738);
  440. var toObject = __webpack_require__(5825);
  441. var hasOwnProperty = uncurryThis({}.hasOwnProperty);
  442. // `HasOwnProperty` abstract operation
  443. // https://tc39.es/ecma262/#sec-hasownproperty
  444. // eslint-disable-next-line es/no-object-hasown -- safe
  445. module.exports = Object.hasOwn || function hasOwn(it, key) {
  446. return hasOwnProperty(toObject(it), key);
  447. };
  448. /***/ }),
  449. /***/ 940:
  450. /***/ (function(module) {
  451. "use strict";
  452. module.exports = {};
  453. /***/ }),
  454. /***/ 2175:
  455. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  456. "use strict";
  457. var DESCRIPTORS = __webpack_require__(6539);
  458. var fails = __webpack_require__(6583);
  459. var createElement = __webpack_require__(3343);
  460. // Thanks to IE8 for its funny defineProperty
  461. module.exports = !DESCRIPTORS && !fails(function () {
  462. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  463. return Object.defineProperty(createElement('div'), 'a', {
  464. get: function get() {
  465. return 7;
  466. }
  467. }).a != 7;
  468. });
  469. /***/ }),
  470. /***/ 5407:
  471. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  472. "use strict";
  473. var uncurryThis = __webpack_require__(9738);
  474. var fails = __webpack_require__(6583);
  475. var classof = __webpack_require__(2177);
  476. var $Object = Object;
  477. var split = uncurryThis(''.split);
  478. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  479. module.exports = fails(function () {
  480. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  481. // eslint-disable-next-line no-prototype-builtins -- safe
  482. return !$Object('z').propertyIsEnumerable(0);
  483. }) ? function (it) {
  484. return classof(it) == 'String' ? split(it, '') : $Object(it);
  485. } : $Object;
  486. /***/ }),
  487. /***/ 6111:
  488. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  489. "use strict";
  490. var uncurryThis = __webpack_require__(9738);
  491. var isCallable = __webpack_require__(729);
  492. var store = __webpack_require__(9700);
  493. var functionToString = uncurryThis(Function.toString);
  494. // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
  495. if (!isCallable(store.inspectSource)) {
  496. store.inspectSource = function (it) {
  497. return functionToString(it);
  498. };
  499. }
  500. module.exports = store.inspectSource;
  501. /***/ }),
  502. /***/ 4751:
  503. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  504. "use strict";
  505. var NATIVE_WEAK_MAP = __webpack_require__(9801);
  506. var global = __webpack_require__(5835);
  507. var isObject = __webpack_require__(691);
  508. var createNonEnumerableProperty = __webpack_require__(8268);
  509. var hasOwn = __webpack_require__(1675);
  510. var shared = __webpack_require__(9700);
  511. var sharedKey = __webpack_require__(7307);
  512. var hiddenKeys = __webpack_require__(940);
  513. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  514. var TypeError = global.TypeError;
  515. var WeakMap = global.WeakMap;
  516. var set, get, has;
  517. var enforce = function enforce(it) {
  518. return has(it) ? get(it) : set(it, {});
  519. };
  520. var getterFor = function getterFor(TYPE) {
  521. return function (it) {
  522. var state;
  523. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  524. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  525. }
  526. return state;
  527. };
  528. };
  529. if (NATIVE_WEAK_MAP || shared.state) {
  530. var store = shared.state || (shared.state = new WeakMap());
  531. /* eslint-disable no-self-assign -- prototype methods protection */
  532. store.get = store.get;
  533. store.has = store.has;
  534. store.set = store.set;
  535. /* eslint-enable no-self-assign -- prototype methods protection */
  536. set = function set(it, metadata) {
  537. if (store.has(it)) throw TypeError(OBJECT_ALREADY_INITIALIZED);
  538. metadata.facade = it;
  539. store.set(it, metadata);
  540. return metadata;
  541. };
  542. get = function get(it) {
  543. return store.get(it) || {};
  544. };
  545. has = function has(it) {
  546. return store.has(it);
  547. };
  548. } else {
  549. var STATE = sharedKey('state');
  550. hiddenKeys[STATE] = true;
  551. set = function set(it, metadata) {
  552. if (hasOwn(it, STATE)) throw TypeError(OBJECT_ALREADY_INITIALIZED);
  553. metadata.facade = it;
  554. createNonEnumerableProperty(it, STATE, metadata);
  555. return metadata;
  556. };
  557. get = function get(it) {
  558. return hasOwn(it, STATE) ? it[STATE] : {};
  559. };
  560. has = function has(it) {
  561. return hasOwn(it, STATE);
  562. };
  563. }
  564. module.exports = {
  565. set: set,
  566. get: get,
  567. has: has,
  568. enforce: enforce,
  569. getterFor: getterFor
  570. };
  571. /***/ }),
  572. /***/ 729:
  573. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  574. "use strict";
  575. var $documentAll = __webpack_require__(9967);
  576. var documentAll = $documentAll.all;
  577. // `IsCallable` abstract operation
  578. // https://tc39.es/ecma262/#sec-iscallable
  579. module.exports = $documentAll.IS_HTMLDDA ? function (argument) {
  580. return typeof argument == 'function' || argument === documentAll;
  581. } : function (argument) {
  582. return typeof argument == 'function';
  583. };
  584. /***/ }),
  585. /***/ 3175:
  586. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  587. "use strict";
  588. var fails = __webpack_require__(6583);
  589. var isCallable = __webpack_require__(729);
  590. var replacement = /#|\.prototype\./;
  591. var isForced = function isForced(feature, detection) {
  592. var value = data[normalize(feature)];
  593. return value == POLYFILL ? true : value == NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection;
  594. };
  595. var normalize = isForced.normalize = function (string) {
  596. return String(string).replace(replacement, '.').toLowerCase();
  597. };
  598. var data = isForced.data = {};
  599. var NATIVE = isForced.NATIVE = 'N';
  600. var POLYFILL = isForced.POLYFILL = 'P';
  601. module.exports = isForced;
  602. /***/ }),
  603. /***/ 6254:
  604. /***/ (function(module) {
  605. "use strict";
  606. // we can't use just `it == null` since of `document.all` special case
  607. // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
  608. module.exports = function (it) {
  609. return it === null || it === undefined;
  610. };
  611. /***/ }),
  612. /***/ 691:
  613. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  614. "use strict";
  615. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  616. var isCallable = __webpack_require__(729);
  617. var $documentAll = __webpack_require__(9967);
  618. var documentAll = $documentAll.all;
  619. module.exports = $documentAll.IS_HTMLDDA ? function (it) {
  620. return _typeof(it) == 'object' ? it !== null : isCallable(it) || it === documentAll;
  621. } : function (it) {
  622. return _typeof(it) == 'object' ? it !== null : isCallable(it);
  623. };
  624. /***/ }),
  625. /***/ 1437:
  626. /***/ (function(module) {
  627. "use strict";
  628. module.exports = false;
  629. /***/ }),
  630. /***/ 4192:
  631. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  632. "use strict";
  633. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  634. var getBuiltIn = __webpack_require__(8078);
  635. var isCallable = __webpack_require__(729);
  636. var isPrototypeOf = __webpack_require__(5522);
  637. var USE_SYMBOL_AS_UID = __webpack_require__(7860);
  638. var $Object = Object;
  639. module.exports = USE_SYMBOL_AS_UID ? function (it) {
  640. return _typeof(it) == 'symbol';
  641. } : function (it) {
  642. var $Symbol = getBuiltIn('Symbol');
  643. return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
  644. };
  645. /***/ }),
  646. /***/ 6803:
  647. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  648. "use strict";
  649. var toLength = __webpack_require__(5108);
  650. // `LengthOfArrayLike` abstract operation
  651. // https://tc39.es/ecma262/#sec-lengthofarraylike
  652. module.exports = function (obj) {
  653. return toLength(obj.length);
  654. };
  655. /***/ }),
  656. /***/ 7948:
  657. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  658. "use strict";
  659. var uncurryThis = __webpack_require__(9738);
  660. var fails = __webpack_require__(6583);
  661. var isCallable = __webpack_require__(729);
  662. var hasOwn = __webpack_require__(1675);
  663. var DESCRIPTORS = __webpack_require__(6539);
  664. var CONFIGURABLE_FUNCTION_NAME = (__webpack_require__(1864).CONFIGURABLE);
  665. var inspectSource = __webpack_require__(6111);
  666. var InternalStateModule = __webpack_require__(4751);
  667. var enforceInternalState = InternalStateModule.enforce;
  668. var getInternalState = InternalStateModule.get;
  669. var $String = String;
  670. // eslint-disable-next-line es/no-object-defineproperty -- safe
  671. var defineProperty = Object.defineProperty;
  672. var stringSlice = uncurryThis(''.slice);
  673. var replace = uncurryThis(''.replace);
  674. var join = uncurryThis([].join);
  675. var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () {
  676. return defineProperty(function () {/* empty */}, 'length', {
  677. value: 8
  678. }).length !== 8;
  679. });
  680. var TEMPLATE = String(String).split('String');
  681. var makeBuiltIn = module.exports = function (value, name, options) {
  682. if (stringSlice($String(name), 0, 7) === 'Symbol(') {
  683. name = '[' + replace($String(name), /^Symbol\(([^)]*)\)/, '$1') + ']';
  684. }
  685. if (options && options.getter) name = 'get ' + name;
  686. if (options && options.setter) name = 'set ' + name;
  687. if (!hasOwn(value, 'name') || CONFIGURABLE_FUNCTION_NAME && value.name !== name) {
  688. if (DESCRIPTORS) defineProperty(value, 'name', {
  689. value: name,
  690. configurable: true
  691. });else value.name = name;
  692. }
  693. if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {
  694. defineProperty(value, 'length', {
  695. value: options.arity
  696. });
  697. }
  698. try {
  699. if (options && hasOwn(options, 'constructor') && options.constructor) {
  700. if (DESCRIPTORS) defineProperty(value, 'prototype', {
  701. writable: false
  702. });
  703. // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
  704. } else if (value.prototype) value.prototype = undefined;
  705. } catch (error) {/* empty */}
  706. var state = enforceInternalState(value);
  707. if (!hasOwn(state, 'source')) {
  708. state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
  709. }
  710. return value;
  711. };
  712. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  713. // eslint-disable-next-line no-extend-native -- required
  714. Function.prototype.toString = makeBuiltIn(function toString() {
  715. return isCallable(this) && getInternalState(this).source || inspectSource(this);
  716. }, 'toString');
  717. /***/ }),
  718. /***/ 4920:
  719. /***/ (function(module) {
  720. "use strict";
  721. var ceil = Math.ceil;
  722. var floor = Math.floor;
  723. // `Math.trunc` method
  724. // https://tc39.es/ecma262/#sec-math.trunc
  725. // eslint-disable-next-line es/no-math-trunc -- safe
  726. module.exports = Math.trunc || function trunc(x) {
  727. var n = +x;
  728. return (n > 0 ? floor : ceil)(n);
  729. };
  730. /***/ }),
  731. /***/ 7328:
  732. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  733. "use strict";
  734. var DESCRIPTORS = __webpack_require__(6539);
  735. var uncurryThis = __webpack_require__(9738);
  736. var call = __webpack_require__(5057);
  737. var fails = __webpack_require__(6583);
  738. var objectKeys = __webpack_require__(5403);
  739. var getOwnPropertySymbolsModule = __webpack_require__(7485);
  740. var propertyIsEnumerableModule = __webpack_require__(5339);
  741. var toObject = __webpack_require__(5825);
  742. var IndexedObject = __webpack_require__(5407);
  743. // eslint-disable-next-line es/no-object-assign -- safe
  744. var $assign = Object.assign;
  745. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  746. var defineProperty = Object.defineProperty;
  747. var concat = uncurryThis([].concat);
  748. // `Object.assign` method
  749. // https://tc39.es/ecma262/#sec-object.assign
  750. module.exports = !$assign || fails(function () {
  751. // should have correct order of operations (Edge bug)
  752. if (DESCRIPTORS && $assign({
  753. b: 1
  754. }, $assign(defineProperty({}, 'a', {
  755. enumerable: true,
  756. get: function get() {
  757. defineProperty(this, 'b', {
  758. value: 3,
  759. enumerable: false
  760. });
  761. }
  762. }), {
  763. b: 2
  764. })).b !== 1) return true;
  765. // should work with symbols and should have deterministic property order (V8 bug)
  766. var A = {};
  767. var B = {};
  768. // eslint-disable-next-line es/no-symbol -- safe
  769. var symbol = Symbol();
  770. var alphabet = 'abcdefghijklmnopqrst';
  771. A[symbol] = 7;
  772. alphabet.split('').forEach(function (chr) {
  773. B[chr] = chr;
  774. });
  775. return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
  776. }) ? function assign(target, source) {
  777. // eslint-disable-line no-unused-vars -- required for `.length`
  778. var T = toObject(target);
  779. var argumentsLength = arguments.length;
  780. var index = 1;
  781. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  782. var propertyIsEnumerable = propertyIsEnumerableModule.f;
  783. while (argumentsLength > index) {
  784. var S = IndexedObject(arguments[index++]);
  785. var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
  786. var length = keys.length;
  787. var j = 0;
  788. var key;
  789. while (length > j) {
  790. key = keys[j++];
  791. if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
  792. }
  793. }
  794. return T;
  795. } : $assign;
  796. /***/ }),
  797. /***/ 704:
  798. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  799. "use strict";
  800. var DESCRIPTORS = __webpack_require__(6539);
  801. var IE8_DOM_DEFINE = __webpack_require__(2175);
  802. var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(4821);
  803. var anObject = __webpack_require__(7563);
  804. var toPropertyKey = __webpack_require__(9737);
  805. var $TypeError = TypeError;
  806. // eslint-disable-next-line es/no-object-defineproperty -- safe
  807. var $defineProperty = Object.defineProperty;
  808. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  809. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  810. var ENUMERABLE = 'enumerable';
  811. var CONFIGURABLE = 'configurable';
  812. var WRITABLE = 'writable';
  813. // `Object.defineProperty` method
  814. // https://tc39.es/ecma262/#sec-object.defineproperty
  815. exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
  816. anObject(O);
  817. P = toPropertyKey(P);
  818. anObject(Attributes);
  819. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  820. var current = $getOwnPropertyDescriptor(O, P);
  821. if (current && current[WRITABLE]) {
  822. O[P] = Attributes.value;
  823. Attributes = {
  824. configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
  825. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  826. writable: false
  827. };
  828. }
  829. }
  830. return $defineProperty(O, P, Attributes);
  831. } : $defineProperty : function defineProperty(O, P, Attributes) {
  832. anObject(O);
  833. P = toPropertyKey(P);
  834. anObject(Attributes);
  835. if (IE8_DOM_DEFINE) try {
  836. return $defineProperty(O, P, Attributes);
  837. } catch (error) {/* empty */}
  838. if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
  839. if ('value' in Attributes) O[P] = Attributes.value;
  840. return O;
  841. };
  842. /***/ }),
  843. /***/ 7238:
  844. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  845. "use strict";
  846. var DESCRIPTORS = __webpack_require__(6539);
  847. var call = __webpack_require__(5057);
  848. var propertyIsEnumerableModule = __webpack_require__(5339);
  849. var createPropertyDescriptor = __webpack_require__(4925);
  850. var toIndexedObject = __webpack_require__(6462);
  851. var toPropertyKey = __webpack_require__(9737);
  852. var hasOwn = __webpack_require__(1675);
  853. var IE8_DOM_DEFINE = __webpack_require__(2175);
  854. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  855. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  856. // `Object.getOwnPropertyDescriptor` method
  857. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  858. exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  859. O = toIndexedObject(O);
  860. P = toPropertyKey(P);
  861. if (IE8_DOM_DEFINE) try {
  862. return $getOwnPropertyDescriptor(O, P);
  863. } catch (error) {/* empty */}
  864. if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
  865. };
  866. /***/ }),
  867. /***/ 5454:
  868. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  869. "use strict";
  870. var internalObjectKeys = __webpack_require__(497);
  871. var enumBugKeys = __webpack_require__(8525);
  872. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  873. // `Object.getOwnPropertyNames` method
  874. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  875. // eslint-disable-next-line es/no-object-getownpropertynames -- safe
  876. exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  877. return internalObjectKeys(O, hiddenKeys);
  878. };
  879. /***/ }),
  880. /***/ 7485:
  881. /***/ (function(__unused_webpack_module, exports) {
  882. "use strict";
  883. // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
  884. exports.f = Object.getOwnPropertySymbols;
  885. /***/ }),
  886. /***/ 5522:
  887. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  888. "use strict";
  889. var uncurryThis = __webpack_require__(9738);
  890. module.exports = uncurryThis({}.isPrototypeOf);
  891. /***/ }),
  892. /***/ 497:
  893. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  894. "use strict";
  895. var uncurryThis = __webpack_require__(9738);
  896. var hasOwn = __webpack_require__(1675);
  897. var toIndexedObject = __webpack_require__(6462);
  898. var indexOf = (__webpack_require__(8632).indexOf);
  899. var hiddenKeys = __webpack_require__(940);
  900. var push = uncurryThis([].push);
  901. module.exports = function (object, names) {
  902. var O = toIndexedObject(object);
  903. var i = 0;
  904. var result = [];
  905. var key;
  906. for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
  907. // Don't enum bug & hidden keys
  908. while (names.length > i) if (hasOwn(O, key = names[i++])) {
  909. ~indexOf(result, key) || push(result, key);
  910. }
  911. return result;
  912. };
  913. /***/ }),
  914. /***/ 5403:
  915. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  916. "use strict";
  917. var internalObjectKeys = __webpack_require__(497);
  918. var enumBugKeys = __webpack_require__(8525);
  919. // `Object.keys` method
  920. // https://tc39.es/ecma262/#sec-object.keys
  921. // eslint-disable-next-line es/no-object-keys -- safe
  922. module.exports = Object.keys || function keys(O) {
  923. return internalObjectKeys(O, enumBugKeys);
  924. };
  925. /***/ }),
  926. /***/ 5339:
  927. /***/ (function(__unused_webpack_module, exports) {
  928. "use strict";
  929. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  930. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  931. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  932. // Nashorn ~ JDK8 bug
  933. var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({
  934. 1: 2
  935. }, 1);
  936. // `Object.prototype.propertyIsEnumerable` method implementation
  937. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  938. exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  939. var descriptor = getOwnPropertyDescriptor(this, V);
  940. return !!descriptor && descriptor.enumerable;
  941. } : $propertyIsEnumerable;
  942. /***/ }),
  943. /***/ 2821:
  944. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  945. "use strict";
  946. var call = __webpack_require__(5057);
  947. var isCallable = __webpack_require__(729);
  948. var isObject = __webpack_require__(691);
  949. var $TypeError = TypeError;
  950. // `OrdinaryToPrimitive` abstract operation
  951. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  952. module.exports = function (input, pref) {
  953. var fn, val;
  954. if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
  955. if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
  956. if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
  957. throw $TypeError("Can't convert object to primitive value");
  958. };
  959. /***/ }),
  960. /***/ 9402:
  961. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  962. "use strict";
  963. var getBuiltIn = __webpack_require__(8078);
  964. var uncurryThis = __webpack_require__(9738);
  965. var getOwnPropertyNamesModule = __webpack_require__(5454);
  966. var getOwnPropertySymbolsModule = __webpack_require__(7485);
  967. var anObject = __webpack_require__(7563);
  968. var concat = uncurryThis([].concat);
  969. // all object keys, includes non-enumerable and symbols
  970. module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  971. var keys = getOwnPropertyNamesModule.f(anObject(it));
  972. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  973. return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
  974. };
  975. /***/ }),
  976. /***/ 97:
  977. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  978. "use strict";
  979. var global = __webpack_require__(5835);
  980. module.exports = global;
  981. /***/ }),
  982. /***/ 1894:
  983. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  984. "use strict";
  985. var isNullOrUndefined = __webpack_require__(6254);
  986. var $TypeError = TypeError;
  987. // `RequireObjectCoercible` abstract operation
  988. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  989. module.exports = function (it) {
  990. if (isNullOrUndefined(it)) throw $TypeError("Can't call method on " + it);
  991. return it;
  992. };
  993. /***/ }),
  994. /***/ 7307:
  995. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  996. "use strict";
  997. var shared = __webpack_require__(5464);
  998. var uid = __webpack_require__(6065);
  999. var keys = shared('keys');
  1000. module.exports = function (key) {
  1001. return keys[key] || (keys[key] = uid(key));
  1002. };
  1003. /***/ }),
  1004. /***/ 9700:
  1005. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1006. "use strict";
  1007. var global = __webpack_require__(5835);
  1008. var defineGlobalProperty = __webpack_require__(161);
  1009. var SHARED = '__core-js_shared__';
  1010. var store = global[SHARED] || defineGlobalProperty(SHARED, {});
  1011. module.exports = store;
  1012. /***/ }),
  1013. /***/ 5464:
  1014. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1015. "use strict";
  1016. var IS_PURE = __webpack_require__(1437);
  1017. var store = __webpack_require__(9700);
  1018. (module.exports = function (key, value) {
  1019. return store[key] || (store[key] = value !== undefined ? value : {});
  1020. })('versions', []).push({
  1021. version: '3.32.0',
  1022. mode: IS_PURE ? 'pure' : 'global',
  1023. copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
  1024. license: 'https://github.com/zloirock/core-js/blob/v3.32.0/LICENSE',
  1025. source: 'https://github.com/zloirock/core-js'
  1026. });
  1027. /***/ }),
  1028. /***/ 4993:
  1029. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1030. "use strict";
  1031. /* eslint-disable es/no-symbol -- required for testing */
  1032. var V8_VERSION = __webpack_require__(9282);
  1033. var fails = __webpack_require__(6583);
  1034. var global = __webpack_require__(5835);
  1035. var $String = global.String;
  1036. // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
  1037. module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
  1038. var symbol = Symbol();
  1039. // Chrome 38 Symbol has incorrect toString conversion
  1040. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  1041. // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
  1042. // of course, fail.
  1043. return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||
  1044. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  1045. !Symbol.sham && V8_VERSION && V8_VERSION < 41;
  1046. });
  1047. /***/ }),
  1048. /***/ 5333:
  1049. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1050. "use strict";
  1051. var toIntegerOrInfinity = __webpack_require__(1087);
  1052. var max = Math.max;
  1053. var min = Math.min;
  1054. // Helper for a popular repeating case of the spec:
  1055. // Let integer be ? ToInteger(index).
  1056. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  1057. module.exports = function (index, length) {
  1058. var integer = toIntegerOrInfinity(index);
  1059. return integer < 0 ? max(integer + length, 0) : min(integer, length);
  1060. };
  1061. /***/ }),
  1062. /***/ 6462:
  1063. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1064. "use strict";
  1065. // toObject with fallback for non-array-like ES3 strings
  1066. var IndexedObject = __webpack_require__(5407);
  1067. var requireObjectCoercible = __webpack_require__(1894);
  1068. module.exports = function (it) {
  1069. return IndexedObject(requireObjectCoercible(it));
  1070. };
  1071. /***/ }),
  1072. /***/ 1087:
  1073. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1074. "use strict";
  1075. var trunc = __webpack_require__(4920);
  1076. // `ToIntegerOrInfinity` abstract operation
  1077. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  1078. module.exports = function (argument) {
  1079. var number = +argument;
  1080. // eslint-disable-next-line no-self-compare -- NaN check
  1081. return number !== number || number === 0 ? 0 : trunc(number);
  1082. };
  1083. /***/ }),
  1084. /***/ 5108:
  1085. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1086. "use strict";
  1087. var toIntegerOrInfinity = __webpack_require__(1087);
  1088. var min = Math.min;
  1089. // `ToLength` abstract operation
  1090. // https://tc39.es/ecma262/#sec-tolength
  1091. module.exports = function (argument) {
  1092. return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  1093. };
  1094. /***/ }),
  1095. /***/ 5825:
  1096. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1097. "use strict";
  1098. var requireObjectCoercible = __webpack_require__(1894);
  1099. var $Object = Object;
  1100. // `ToObject` abstract operation
  1101. // https://tc39.es/ecma262/#sec-toobject
  1102. module.exports = function (argument) {
  1103. return $Object(requireObjectCoercible(argument));
  1104. };
  1105. /***/ }),
  1106. /***/ 1044:
  1107. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1108. "use strict";
  1109. var call = __webpack_require__(5057);
  1110. var isObject = __webpack_require__(691);
  1111. var isSymbol = __webpack_require__(4192);
  1112. var getMethod = __webpack_require__(2337);
  1113. var ordinaryToPrimitive = __webpack_require__(2821);
  1114. var wellKnownSymbol = __webpack_require__(3121);
  1115. var $TypeError = TypeError;
  1116. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  1117. // `ToPrimitive` abstract operation
  1118. // https://tc39.es/ecma262/#sec-toprimitive
  1119. module.exports = function (input, pref) {
  1120. if (!isObject(input) || isSymbol(input)) return input;
  1121. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  1122. var result;
  1123. if (exoticToPrim) {
  1124. if (pref === undefined) pref = 'default';
  1125. result = call(exoticToPrim, input, pref);
  1126. if (!isObject(result) || isSymbol(result)) return result;
  1127. throw $TypeError("Can't convert object to primitive value");
  1128. }
  1129. if (pref === undefined) pref = 'number';
  1130. return ordinaryToPrimitive(input, pref);
  1131. };
  1132. /***/ }),
  1133. /***/ 9737:
  1134. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1135. "use strict";
  1136. var toPrimitive = __webpack_require__(1044);
  1137. var isSymbol = __webpack_require__(4192);
  1138. // `ToPropertyKey` abstract operation
  1139. // https://tc39.es/ecma262/#sec-topropertykey
  1140. module.exports = function (argument) {
  1141. var key = toPrimitive(argument, 'string');
  1142. return isSymbol(key) ? key : key + '';
  1143. };
  1144. /***/ }),
  1145. /***/ 8434:
  1146. /***/ (function(module) {
  1147. "use strict";
  1148. var $String = String;
  1149. module.exports = function (argument) {
  1150. try {
  1151. return $String(argument);
  1152. } catch (error) {
  1153. return 'Object';
  1154. }
  1155. };
  1156. /***/ }),
  1157. /***/ 6065:
  1158. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1159. "use strict";
  1160. var uncurryThis = __webpack_require__(9738);
  1161. var id = 0;
  1162. var postfix = Math.random();
  1163. var toString = uncurryThis(1.0.toString);
  1164. module.exports = function (key) {
  1165. return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
  1166. };
  1167. /***/ }),
  1168. /***/ 7860:
  1169. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1170. "use strict";
  1171. /* eslint-disable es/no-symbol -- required for testing */
  1172. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  1173. var NATIVE_SYMBOL = __webpack_require__(4993);
  1174. module.exports = NATIVE_SYMBOL && !Symbol.sham && _typeof(Symbol.iterator) == 'symbol';
  1175. /***/ }),
  1176. /***/ 4821:
  1177. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1178. "use strict";
  1179. var DESCRIPTORS = __webpack_require__(6539);
  1180. var fails = __webpack_require__(6583);
  1181. // V8 ~ Chrome 36-
  1182. // https://bugs.chromium.org/p/v8/issues/detail?id=3334
  1183. module.exports = DESCRIPTORS && fails(function () {
  1184. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  1185. return Object.defineProperty(function () {/* empty */}, 'prototype', {
  1186. value: 42,
  1187. writable: false
  1188. }).prototype != 42;
  1189. });
  1190. /***/ }),
  1191. /***/ 9801:
  1192. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1193. "use strict";
  1194. var global = __webpack_require__(5835);
  1195. var isCallable = __webpack_require__(729);
  1196. var WeakMap = global.WeakMap;
  1197. module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap));
  1198. /***/ }),
  1199. /***/ 5336:
  1200. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1201. "use strict";
  1202. var path = __webpack_require__(97);
  1203. var hasOwn = __webpack_require__(1675);
  1204. var wrappedWellKnownSymbolModule = __webpack_require__(8384);
  1205. var defineProperty = (__webpack_require__(704).f);
  1206. module.exports = function (NAME) {
  1207. var _Symbol = path.Symbol || (path.Symbol = {});
  1208. if (!hasOwn(_Symbol, NAME)) defineProperty(_Symbol, NAME, {
  1209. value: wrappedWellKnownSymbolModule.f(NAME)
  1210. });
  1211. };
  1212. /***/ }),
  1213. /***/ 8384:
  1214. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  1215. "use strict";
  1216. var wellKnownSymbol = __webpack_require__(3121);
  1217. exports.f = wellKnownSymbol;
  1218. /***/ }),
  1219. /***/ 3121:
  1220. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1221. "use strict";
  1222. var global = __webpack_require__(5835);
  1223. var shared = __webpack_require__(5464);
  1224. var hasOwn = __webpack_require__(1675);
  1225. var uid = __webpack_require__(6065);
  1226. var NATIVE_SYMBOL = __webpack_require__(4993);
  1227. var USE_SYMBOL_AS_UID = __webpack_require__(7860);
  1228. var _Symbol = global.Symbol;
  1229. var WellKnownSymbolsStore = shared('wks');
  1230. var createWellKnownSymbol = USE_SYMBOL_AS_UID ? _Symbol['for'] || _Symbol : _Symbol && _Symbol.withoutSetter || uid;
  1231. module.exports = function (name) {
  1232. if (!hasOwn(WellKnownSymbolsStore, name)) {
  1233. WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(_Symbol, name) ? _Symbol[name] : createWellKnownSymbol('Symbol.' + name);
  1234. }
  1235. return WellKnownSymbolsStore[name];
  1236. };
  1237. /***/ }),
  1238. /***/ 7422:
  1239. /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
  1240. "use strict";
  1241. var $ = __webpack_require__(7926);
  1242. var assign = __webpack_require__(7328);
  1243. // `Object.assign` method
  1244. // https://tc39.es/ecma262/#sec-object.assign
  1245. // eslint-disable-next-line es/no-object-assign -- required for testing
  1246. $({
  1247. target: 'Object',
  1248. stat: true,
  1249. arity: 2,
  1250. forced: Object.assign !== assign
  1251. }, {
  1252. assign: assign
  1253. });
  1254. /***/ }),
  1255. /***/ 4835:
  1256. /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
  1257. "use strict";
  1258. var defineWellKnownSymbol = __webpack_require__(5336);
  1259. // `Symbol.asyncIterator` well-known symbol
  1260. // https://tc39.es/ecma262/#sec-symbol.asynciterator
  1261. defineWellKnownSymbol('asyncIterator');
  1262. /***/ }),
  1263. /***/ 6727:
  1264. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1265. "use strict";
  1266. var parent = __webpack_require__(879);
  1267. module.exports = parent;
  1268. /***/ }),
  1269. /***/ 8690:
  1270. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1271. "use strict";
  1272. var parent = __webpack_require__(3723);
  1273. module.exports = parent;
  1274. /***/ }),
  1275. /***/ 5937:
  1276. /***/ (function(module) {
  1277. (function (self) {
  1278. 'use strict';
  1279. // if __disableNativeFetch is set to true, the it will always polyfill fetch
  1280. // with Ajax.
  1281. if (!self.__disableNativeFetch && self.fetch) {
  1282. return;
  1283. }
  1284. function normalizeName(name) {
  1285. if (typeof name !== 'string') {
  1286. name = String(name);
  1287. }
  1288. if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
  1289. throw new TypeError('Invalid character in header field name');
  1290. }
  1291. return name.toLowerCase();
  1292. }
  1293. function normalizeValue(value) {
  1294. if (typeof value !== 'string') {
  1295. value = String(value);
  1296. }
  1297. return value;
  1298. }
  1299. function Headers(headers) {
  1300. this.map = {};
  1301. if (headers instanceof Headers) {
  1302. headers.forEach(function (value, name) {
  1303. this.append(name, value);
  1304. }, this);
  1305. } else if (headers) {
  1306. Object.getOwnPropertyNames(headers).forEach(function (name) {
  1307. this.append(name, headers[name]);
  1308. }, this);
  1309. }
  1310. }
  1311. Headers.prototype.append = function (name, value) {
  1312. name = normalizeName(name);
  1313. value = normalizeValue(value);
  1314. var list = this.map[name];
  1315. if (!list) {
  1316. list = [];
  1317. this.map[name] = list;
  1318. }
  1319. list.push(value);
  1320. };
  1321. Headers.prototype['delete'] = function (name) {
  1322. delete this.map[normalizeName(name)];
  1323. };
  1324. Headers.prototype.get = function (name) {
  1325. var values = this.map[normalizeName(name)];
  1326. return values ? values[0] : null;
  1327. };
  1328. Headers.prototype.getAll = function (name) {
  1329. return this.map[normalizeName(name)] || [];
  1330. };
  1331. Headers.prototype.has = function (name) {
  1332. return this.map.hasOwnProperty(normalizeName(name));
  1333. };
  1334. Headers.prototype.set = function (name, value) {
  1335. this.map[normalizeName(name)] = [normalizeValue(value)];
  1336. };
  1337. Headers.prototype.forEach = function (callback, thisArg) {
  1338. Object.getOwnPropertyNames(this.map).forEach(function (name) {
  1339. this.map[name].forEach(function (value) {
  1340. callback.call(thisArg, value, name, this);
  1341. }, this);
  1342. }, this);
  1343. };
  1344. function consumed(body) {
  1345. if (body.bodyUsed) {
  1346. return Promise.reject(new TypeError('Already read'));
  1347. }
  1348. body.bodyUsed = true;
  1349. }
  1350. function fileReaderReady(reader) {
  1351. return new Promise(function (resolve, reject) {
  1352. reader.onload = function () {
  1353. resolve(reader.result);
  1354. };
  1355. reader.onerror = function () {
  1356. reject(reader.error);
  1357. };
  1358. });
  1359. }
  1360. function readBlobAsArrayBuffer(blob) {
  1361. var reader = new FileReader();
  1362. reader.readAsArrayBuffer(blob);
  1363. return fileReaderReady(reader);
  1364. }
  1365. function readBlobAsText(blob, options) {
  1366. var reader = new FileReader();
  1367. var contentType = options.headers.map['content-type'] ? options.headers.map['content-type'].toString() : '';
  1368. var regex = /charset\=[0-9a-zA-Z\-\_]*;?/;
  1369. var _charset = blob.type.match(regex) || contentType.match(regex);
  1370. var args = [blob];
  1371. if (_charset) {
  1372. args.push(_charset[0].replace(/^charset\=/, '').replace(/;$/, ''));
  1373. }
  1374. reader.readAsText.apply(reader, args);
  1375. return fileReaderReady(reader);
  1376. }
  1377. var support = {
  1378. blob: 'FileReader' in self && 'Blob' in self && function () {
  1379. try {
  1380. new Blob();
  1381. return true;
  1382. } catch (e) {
  1383. return false;
  1384. }
  1385. }(),
  1386. formData: 'FormData' in self,
  1387. arrayBuffer: 'ArrayBuffer' in self
  1388. };
  1389. function Body() {
  1390. this.bodyUsed = false;
  1391. this._initBody = function (body, options) {
  1392. this._bodyInit = body;
  1393. if (typeof body === 'string') {
  1394. this._bodyText = body;
  1395. } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
  1396. this._bodyBlob = body;
  1397. this._options = options;
  1398. } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
  1399. this._bodyFormData = body;
  1400. } else if (!body) {
  1401. this._bodyText = '';
  1402. } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {
  1403. // Only support ArrayBuffers for POST method.
  1404. // Receiving ArrayBuffers happens via Blobs, instead.
  1405. } else {
  1406. throw new Error('unsupported BodyInit type');
  1407. }
  1408. };
  1409. if (support.blob) {
  1410. this.blob = function () {
  1411. var rejected = consumed(this);
  1412. if (rejected) {
  1413. return rejected;
  1414. }
  1415. if (this._bodyBlob) {
  1416. return Promise.resolve(this._bodyBlob);
  1417. } else if (this._bodyFormData) {
  1418. throw new Error('could not read FormData body as blob');
  1419. } else {
  1420. return Promise.resolve(new Blob([this._bodyText]));
  1421. }
  1422. };
  1423. this.arrayBuffer = function () {
  1424. return this.blob().then(readBlobAsArrayBuffer);
  1425. };
  1426. this.text = function () {
  1427. var rejected = consumed(this);
  1428. if (rejected) {
  1429. return rejected;
  1430. }
  1431. if (this._bodyBlob) {
  1432. return readBlobAsText(this._bodyBlob, this._options);
  1433. } else if (this._bodyFormData) {
  1434. throw new Error('could not read FormData body as text');
  1435. } else {
  1436. return Promise.resolve(this._bodyText);
  1437. }
  1438. };
  1439. } else {
  1440. this.text = function () {
  1441. var rejected = consumed(this);
  1442. return rejected ? rejected : Promise.resolve(this._bodyText);
  1443. };
  1444. }
  1445. if (support.formData) {
  1446. this.formData = function () {
  1447. return this.text().then(decode);
  1448. };
  1449. }
  1450. this.json = function () {
  1451. return this.text().then(JSON.parse);
  1452. };
  1453. return this;
  1454. }
  1455. // HTTP methods whose capitalization should be normalized
  1456. var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];
  1457. function normalizeMethod(method) {
  1458. var upcased = method.toUpperCase();
  1459. return methods.indexOf(upcased) > -1 ? upcased : method;
  1460. }
  1461. function Request(input, options) {
  1462. options = options || {};
  1463. var body = options.body;
  1464. if (Request.prototype.isPrototypeOf(input)) {
  1465. if (input.bodyUsed) {
  1466. throw new TypeError('Already read');
  1467. }
  1468. this.url = input.url;
  1469. this.credentials = input.credentials;
  1470. if (!options.headers) {
  1471. this.headers = new Headers(input.headers);
  1472. }
  1473. this.method = input.method;
  1474. this.mode = input.mode;
  1475. if (!body) {
  1476. body = input._bodyInit;
  1477. input.bodyUsed = true;
  1478. }
  1479. } else {
  1480. this.url = input;
  1481. }
  1482. this.credentials = options.credentials || this.credentials || 'omit';
  1483. if (options.headers || !this.headers) {
  1484. this.headers = new Headers(options.headers);
  1485. }
  1486. this.method = normalizeMethod(options.method || this.method || 'GET');
  1487. this.mode = options.mode || this.mode || null;
  1488. this.referrer = null;
  1489. if ((this.method === 'GET' || this.method === 'HEAD') && body) {
  1490. throw new TypeError('Body not allowed for GET or HEAD requests');
  1491. }
  1492. this._initBody(body, options);
  1493. }
  1494. Request.prototype.clone = function () {
  1495. return new Request(this);
  1496. };
  1497. function decode(body) {
  1498. var form = new FormData();
  1499. body.trim().split('&').forEach(function (bytes) {
  1500. if (bytes) {
  1501. var split = bytes.split('=');
  1502. var name = split.shift().replace(/\+/g, ' ');
  1503. var value = split.join('=').replace(/\+/g, ' ');
  1504. form.append(decodeURIComponent(name), decodeURIComponent(value));
  1505. }
  1506. });
  1507. return form;
  1508. }
  1509. function headers(xhr) {
  1510. var head = new Headers();
  1511. var pairs = xhr.getAllResponseHeaders().trim().split('\n');
  1512. pairs.forEach(function (header) {
  1513. var split = header.trim().split(':');
  1514. var key = split.shift().trim();
  1515. var value = split.join(':').trim();
  1516. head.append(key, value);
  1517. });
  1518. return head;
  1519. }
  1520. Body.call(Request.prototype);
  1521. function Response(bodyInit, options) {
  1522. if (!options) {
  1523. options = {};
  1524. }
  1525. this._initBody(bodyInit, options);
  1526. this.type = 'default';
  1527. this.status = options.status;
  1528. this.ok = this.status >= 200 && this.status < 300;
  1529. this.statusText = options.statusText;
  1530. this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers);
  1531. this.url = options.url || '';
  1532. }
  1533. Body.call(Response.prototype);
  1534. Response.prototype.clone = function () {
  1535. return new Response(this._bodyInit, {
  1536. status: this.status,
  1537. statusText: this.statusText,
  1538. headers: new Headers(this.headers),
  1539. url: this.url
  1540. });
  1541. };
  1542. Response.error = function () {
  1543. var response = new Response(null, {
  1544. status: 0,
  1545. statusText: ''
  1546. });
  1547. response.type = 'error';
  1548. return response;
  1549. };
  1550. var redirectStatuses = [301, 302, 303, 307, 308];
  1551. Response.redirect = function (url, status) {
  1552. if (redirectStatuses.indexOf(status) === -1) {
  1553. throw new RangeError('Invalid status code');
  1554. }
  1555. return new Response(null, {
  1556. status: status,
  1557. headers: {
  1558. location: url
  1559. }
  1560. });
  1561. };
  1562. self.Headers = Headers;
  1563. self.Request = Request;
  1564. self.Response = Response;
  1565. self.fetch = function (input, init) {
  1566. return new Promise(function (resolve, reject) {
  1567. var request;
  1568. if (Request.prototype.isPrototypeOf(input) && !init) {
  1569. request = input;
  1570. } else {
  1571. request = new Request(input, init);
  1572. }
  1573. var xhr = new XMLHttpRequest();
  1574. function responseURL() {
  1575. if ('responseURL' in xhr) {
  1576. return xhr.responseURL;
  1577. }
  1578. // Avoid security warnings on getResponseHeader when not allowed by CORS
  1579. if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {
  1580. return xhr.getResponseHeader('X-Request-URL');
  1581. }
  1582. return;
  1583. }
  1584. var __onLoadHandled = false;
  1585. function onload() {
  1586. if (xhr.readyState !== 4) {
  1587. return;
  1588. }
  1589. var status = xhr.status === 1223 ? 204 : xhr.status;
  1590. if (status < 100 || status > 599) {
  1591. if (__onLoadHandled) {
  1592. return;
  1593. } else {
  1594. __onLoadHandled = true;
  1595. }
  1596. reject(new TypeError('Network request failed'));
  1597. return;
  1598. }
  1599. var options = {
  1600. status: status,
  1601. statusText: xhr.statusText,
  1602. headers: headers(xhr),
  1603. url: responseURL()
  1604. };
  1605. var body = 'response' in xhr ? xhr.response : xhr.responseText;
  1606. if (__onLoadHandled) {
  1607. return;
  1608. } else {
  1609. __onLoadHandled = true;
  1610. }
  1611. resolve(new Response(body, options));
  1612. }
  1613. xhr.onreadystatechange = onload;
  1614. xhr.onload = onload;
  1615. xhr.onerror = function () {
  1616. if (__onLoadHandled) {
  1617. return;
  1618. } else {
  1619. __onLoadHandled = true;
  1620. }
  1621. reject(new TypeError('Network request failed'));
  1622. };
  1623. xhr.open(request.method, request.url, true);
  1624. // `withCredentials` should be setted after calling `.open` in IE10
  1625. // http://stackoverflow.com/a/19667959/1219343
  1626. try {
  1627. if (request.credentials === 'include') {
  1628. if ('withCredentials' in xhr) {
  1629. xhr.withCredentials = true;
  1630. } else {
  1631. console && console.warn && console.warn('withCredentials is not supported, you can ignore this warning');
  1632. }
  1633. }
  1634. } catch (e) {
  1635. console && console.warn && console.warn('set withCredentials error:' + e);
  1636. }
  1637. if ('responseType' in xhr && support.blob) {
  1638. xhr.responseType = 'blob';
  1639. }
  1640. request.headers.forEach(function (value, name) {
  1641. xhr.setRequestHeader(name, value);
  1642. });
  1643. xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
  1644. });
  1645. };
  1646. self.fetch.polyfill = true;
  1647. // Support CommonJS
  1648. if ( true && module.exports) {
  1649. module.exports = self.fetch;
  1650. }
  1651. })(typeof self !== 'undefined' ? self : this);
  1652. /***/ }),
  1653. /***/ 4238:
  1654. /***/ (function(module, exports) {
  1655. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  1656. if (true) {
  1657. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, module], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  1658. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  1659. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  1660. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  1661. } else { var mod; }
  1662. })(this, function (exports, module) {
  1663. 'use strict';
  1664. var defaultOptions = {
  1665. timeout: 5000,
  1666. jsonpCallback: 'callback',
  1667. jsonpCallbackFunction: null
  1668. };
  1669. function generateCallbackFunction() {
  1670. return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);
  1671. }
  1672. function clearFunction(functionName) {
  1673. // IE8 throws an exception when you try to delete a property on window
  1674. // http://stackoverflow.com/a/1824228/751089
  1675. try {
  1676. delete window[functionName];
  1677. } catch (e) {
  1678. window[functionName] = undefined;
  1679. }
  1680. }
  1681. function removeScript(scriptId) {
  1682. var script = document.getElementById(scriptId);
  1683. if (script) {
  1684. document.getElementsByTagName('head')[0].removeChild(script);
  1685. }
  1686. }
  1687. function fetchJsonp(_url) {
  1688. var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
  1689. // to avoid param reassign
  1690. var url = _url;
  1691. var timeout = options.timeout || defaultOptions.timeout;
  1692. var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;
  1693. var timeoutId = undefined;
  1694. return new Promise(function (resolve, reject) {
  1695. var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();
  1696. var scriptId = jsonpCallback + '_' + callbackFunction;
  1697. window[callbackFunction] = function (response) {
  1698. resolve({
  1699. ok: true,
  1700. // keep consistent with fetch API
  1701. json: function json() {
  1702. return Promise.resolve(response);
  1703. }
  1704. });
  1705. if (timeoutId) clearTimeout(timeoutId);
  1706. removeScript(scriptId);
  1707. clearFunction(callbackFunction);
  1708. };
  1709. // Check if the user set their own params, and if not add a ? to start a list of params
  1710. url += url.indexOf('?') === -1 ? '?' : '&';
  1711. var jsonpScript = document.createElement('script');
  1712. jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);
  1713. if (options.charset) {
  1714. jsonpScript.setAttribute('charset', options.charset);
  1715. }
  1716. jsonpScript.id = scriptId;
  1717. document.getElementsByTagName('head')[0].appendChild(jsonpScript);
  1718. timeoutId = setTimeout(function () {
  1719. reject(new Error('JSONP request to ' + _url + ' timed out'));
  1720. clearFunction(callbackFunction);
  1721. removeScript(scriptId);
  1722. window[callbackFunction] = function () {
  1723. clearFunction(callbackFunction);
  1724. };
  1725. }, timeout);
  1726. // Caught if got 404/500
  1727. jsonpScript.onerror = function () {
  1728. reject(new Error('JSONP request to ' + _url + ' failed'));
  1729. clearFunction(callbackFunction);
  1730. removeScript(scriptId);
  1731. if (timeoutId) clearTimeout(timeoutId);
  1732. };
  1733. });
  1734. }
  1735. // export as global function
  1736. /*
  1737. let local;
  1738. if (typeof global !== 'undefined') {
  1739. local = global;
  1740. } else if (typeof self !== 'undefined') {
  1741. local = self;
  1742. } else {
  1743. try {
  1744. local = Function('return this')();
  1745. } catch (e) {
  1746. throw new Error('polyfill failed because global object is unavailable in this environment');
  1747. }
  1748. }
  1749. local.fetchJsonp = fetchJsonp;
  1750. */
  1751. module.exports = fetchJsonp;
  1752. });
  1753. /***/ }),
  1754. /***/ 4634:
  1755. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  1756. "use strict";
  1757. Object.defineProperty(exports, "__esModule", ({
  1758. value: true
  1759. }));
  1760. exports.Builder = void 0;
  1761. var byte_buffer_js_1 = __webpack_require__(1603);
  1762. var constants_js_1 = __webpack_require__(1083);
  1763. var Builder = /** @class */function () {
  1764. /**
  1765. * Create a FlatBufferBuilder.
  1766. */
  1767. function Builder(opt_initial_size) {
  1768. /** Minimum alignment encountered so far. */
  1769. this.minalign = 1;
  1770. /** The vtable for the current table. */
  1771. this.vtable = null;
  1772. /** The amount of fields we're actually using. */
  1773. this.vtable_in_use = 0;
  1774. /** Whether we are currently serializing a table. */
  1775. this.isNested = false;
  1776. /** Starting offset of the current struct/table. */
  1777. this.object_start = 0;
  1778. /** List of offsets of all vtables. */
  1779. this.vtables = [];
  1780. /** For the current vector being built. */
  1781. this.vector_num_elems = 0;
  1782. /** False omits default values from the serialized data */
  1783. this.force_defaults = false;
  1784. this.string_maps = null;
  1785. var initial_size;
  1786. if (!opt_initial_size) {
  1787. initial_size = 1024;
  1788. } else {
  1789. initial_size = opt_initial_size;
  1790. }
  1791. /**
  1792. * @type {ByteBuffer}
  1793. * @private
  1794. */
  1795. this.bb = byte_buffer_js_1.ByteBuffer.allocate(initial_size);
  1796. this.space = initial_size;
  1797. }
  1798. Builder.prototype.clear = function () {
  1799. this.bb.clear();
  1800. this.space = this.bb.capacity();
  1801. this.minalign = 1;
  1802. this.vtable = null;
  1803. this.vtable_in_use = 0;
  1804. this.isNested = false;
  1805. this.object_start = 0;
  1806. this.vtables = [];
  1807. this.vector_num_elems = 0;
  1808. this.force_defaults = false;
  1809. this.string_maps = null;
  1810. };
  1811. /**
  1812. * In order to save space, fields that are set to their default value
  1813. * don't get serialized into the buffer. Forcing defaults provides a
  1814. * way to manually disable this optimization.
  1815. *
  1816. * @param forceDefaults true always serializes default values
  1817. */
  1818. Builder.prototype.forceDefaults = function (forceDefaults) {
  1819. this.force_defaults = forceDefaults;
  1820. };
  1821. /**
  1822. * Get the ByteBuffer representing the FlatBuffer. Only call this after you've
  1823. * called finish(). The actual data starts at the ByteBuffer's current position,
  1824. * not necessarily at 0.
  1825. */
  1826. Builder.prototype.dataBuffer = function () {
  1827. return this.bb;
  1828. };
  1829. /**
  1830. * Get the bytes representing the FlatBuffer. Only call this after you've
  1831. * called finish().
  1832. */
  1833. Builder.prototype.asUint8Array = function () {
  1834. return this.bb.bytes().subarray(this.bb.position(), this.bb.position() + this.offset());
  1835. };
  1836. /**
  1837. * Prepare to write an element of `size` after `additional_bytes` have been
  1838. * written, e.g. if you write a string, you need to align such the int length
  1839. * field is aligned to 4 bytes, and the string data follows it directly. If all
  1840. * you need to do is alignment, `additional_bytes` will be 0.
  1841. *
  1842. * @param size This is the of the new element to write
  1843. * @param additional_bytes The padding size
  1844. */
  1845. Builder.prototype.prep = function (size, additional_bytes) {
  1846. // Track the biggest thing we've ever aligned to.
  1847. if (size > this.minalign) {
  1848. this.minalign = size;
  1849. }
  1850. // Find the amount of alignment needed such that `size` is properly
  1851. // aligned after `additional_bytes`
  1852. var align_size = ~(this.bb.capacity() - this.space + additional_bytes) + 1 & size - 1;
  1853. // Reallocate the buffer if needed.
  1854. while (this.space < align_size + size + additional_bytes) {
  1855. var old_buf_size = this.bb.capacity();
  1856. this.bb = Builder.growByteBuffer(this.bb);
  1857. this.space += this.bb.capacity() - old_buf_size;
  1858. }
  1859. this.pad(align_size);
  1860. };
  1861. Builder.prototype.pad = function (byte_size) {
  1862. for (var i = 0; i < byte_size; i++) {
  1863. this.bb.writeInt8(--this.space, 0);
  1864. }
  1865. };
  1866. Builder.prototype.writeInt8 = function (value) {
  1867. this.bb.writeInt8(this.space -= 1, value);
  1868. };
  1869. Builder.prototype.writeInt16 = function (value) {
  1870. this.bb.writeInt16(this.space -= 2, value);
  1871. };
  1872. Builder.prototype.writeInt32 = function (value) {
  1873. this.bb.writeInt32(this.space -= 4, value);
  1874. };
  1875. Builder.prototype.writeInt64 = function (value) {
  1876. this.bb.writeInt64(this.space -= 8, value);
  1877. };
  1878. Builder.prototype.writeFloat32 = function (value) {
  1879. this.bb.writeFloat32(this.space -= 4, value);
  1880. };
  1881. Builder.prototype.writeFloat64 = function (value) {
  1882. this.bb.writeFloat64(this.space -= 8, value);
  1883. };
  1884. /**
  1885. * Add an `int8` to the buffer, properly aligned, and grows the buffer (if necessary).
  1886. * @param value The `int8` to add the the buffer.
  1887. */
  1888. Builder.prototype.addInt8 = function (value) {
  1889. this.prep(1, 0);
  1890. this.writeInt8(value);
  1891. };
  1892. /**
  1893. * Add an `int16` to the buffer, properly aligned, and grows the buffer (if necessary).
  1894. * @param value The `int16` to add the the buffer.
  1895. */
  1896. Builder.prototype.addInt16 = function (value) {
  1897. this.prep(2, 0);
  1898. this.writeInt16(value);
  1899. };
  1900. /**
  1901. * Add an `int32` to the buffer, properly aligned, and grows the buffer (if necessary).
  1902. * @param value The `int32` to add the the buffer.
  1903. */
  1904. Builder.prototype.addInt32 = function (value) {
  1905. this.prep(4, 0);
  1906. this.writeInt32(value);
  1907. };
  1908. /**
  1909. * Add an `int64` to the buffer, properly aligned, and grows the buffer (if necessary).
  1910. * @param value The `int64` to add the the buffer.
  1911. */
  1912. Builder.prototype.addInt64 = function (value) {
  1913. this.prep(8, 0);
  1914. this.writeInt64(value);
  1915. };
  1916. /**
  1917. * Add a `float32` to the buffer, properly aligned, and grows the buffer (if necessary).
  1918. * @param value The `float32` to add the the buffer.
  1919. */
  1920. Builder.prototype.addFloat32 = function (value) {
  1921. this.prep(4, 0);
  1922. this.writeFloat32(value);
  1923. };
  1924. /**
  1925. * Add a `float64` to the buffer, properly aligned, and grows the buffer (if necessary).
  1926. * @param value The `float64` to add the the buffer.
  1927. */
  1928. Builder.prototype.addFloat64 = function (value) {
  1929. this.prep(8, 0);
  1930. this.writeFloat64(value);
  1931. };
  1932. Builder.prototype.addFieldInt8 = function (voffset, value, defaultValue) {
  1933. if (this.force_defaults || value != defaultValue) {
  1934. this.addInt8(value);
  1935. this.slot(voffset);
  1936. }
  1937. };
  1938. Builder.prototype.addFieldInt16 = function (voffset, value, defaultValue) {
  1939. if (this.force_defaults || value != defaultValue) {
  1940. this.addInt16(value);
  1941. this.slot(voffset);
  1942. }
  1943. };
  1944. Builder.prototype.addFieldInt32 = function (voffset, value, defaultValue) {
  1945. if (this.force_defaults || value != defaultValue) {
  1946. this.addInt32(value);
  1947. this.slot(voffset);
  1948. }
  1949. };
  1950. Builder.prototype.addFieldInt64 = function (voffset, value, defaultValue) {
  1951. if (this.force_defaults || value !== defaultValue) {
  1952. this.addInt64(value);
  1953. this.slot(voffset);
  1954. }
  1955. };
  1956. Builder.prototype.addFieldFloat32 = function (voffset, value, defaultValue) {
  1957. if (this.force_defaults || value != defaultValue) {
  1958. this.addFloat32(value);
  1959. this.slot(voffset);
  1960. }
  1961. };
  1962. Builder.prototype.addFieldFloat64 = function (voffset, value, defaultValue) {
  1963. if (this.force_defaults || value != defaultValue) {
  1964. this.addFloat64(value);
  1965. this.slot(voffset);
  1966. }
  1967. };
  1968. Builder.prototype.addFieldOffset = function (voffset, value, defaultValue) {
  1969. if (this.force_defaults || value != defaultValue) {
  1970. this.addOffset(value);
  1971. this.slot(voffset);
  1972. }
  1973. };
  1974. /**
  1975. * Structs are stored inline, so nothing additional is being added. `d` is always 0.
  1976. */
  1977. Builder.prototype.addFieldStruct = function (voffset, value, defaultValue) {
  1978. if (value != defaultValue) {
  1979. this.nested(value);
  1980. this.slot(voffset);
  1981. }
  1982. };
  1983. /**
  1984. * Structures are always stored inline, they need to be created right
  1985. * where they're used. You'll get this assertion failure if you
  1986. * created it elsewhere.
  1987. */
  1988. Builder.prototype.nested = function (obj) {
  1989. if (obj != this.offset()) {
  1990. throw new Error('FlatBuffers: struct must be serialized inline.');
  1991. }
  1992. };
  1993. /**
  1994. * Should not be creating any other object, string or vector
  1995. * while an object is being constructed
  1996. */
  1997. Builder.prototype.notNested = function () {
  1998. if (this.isNested) {
  1999. throw new Error('FlatBuffers: object serialization must not be nested.');
  2000. }
  2001. };
  2002. /**
  2003. * Set the current vtable at `voffset` to the current location in the buffer.
  2004. */
  2005. Builder.prototype.slot = function (voffset) {
  2006. if (this.vtable !== null) this.vtable[voffset] = this.offset();
  2007. };
  2008. /**
  2009. * @returns Offset relative to the end of the buffer.
  2010. */
  2011. Builder.prototype.offset = function () {
  2012. return this.bb.capacity() - this.space;
  2013. };
  2014. /**
  2015. * Doubles the size of the backing ByteBuffer and copies the old data towards
  2016. * the end of the new buffer (since we build the buffer backwards).
  2017. *
  2018. * @param bb The current buffer with the existing data
  2019. * @returns A new byte buffer with the old data copied
  2020. * to it. The data is located at the end of the buffer.
  2021. *
  2022. * uint8Array.set() formally takes {Array<number>|ArrayBufferView}, so to pass
  2023. * it a uint8Array we need to suppress the type check:
  2024. * @suppress {checkTypes}
  2025. */
  2026. Builder.growByteBuffer = function (bb) {
  2027. var old_buf_size = bb.capacity();
  2028. // Ensure we don't grow beyond what fits in an int.
  2029. if (old_buf_size & 0xC0000000) {
  2030. throw new Error('FlatBuffers: cannot grow buffer beyond 2 gigabytes.');
  2031. }
  2032. var new_buf_size = old_buf_size << 1;
  2033. var nbb = byte_buffer_js_1.ByteBuffer.allocate(new_buf_size);
  2034. nbb.setPosition(new_buf_size - old_buf_size);
  2035. nbb.bytes().set(bb.bytes(), new_buf_size - old_buf_size);
  2036. return nbb;
  2037. };
  2038. /**
  2039. * Adds on offset, relative to where it will be written.
  2040. *
  2041. * @param offset The offset to add.
  2042. */
  2043. Builder.prototype.addOffset = function (offset) {
  2044. this.prep(constants_js_1.SIZEOF_INT, 0); // Ensure alignment is already done.
  2045. this.writeInt32(this.offset() - offset + constants_js_1.SIZEOF_INT);
  2046. };
  2047. /**
  2048. * Start encoding a new object in the buffer. Users will not usually need to
  2049. * call this directly. The FlatBuffers compiler will generate helper methods
  2050. * that call this method internally.
  2051. */
  2052. Builder.prototype.startObject = function (numfields) {
  2053. this.notNested();
  2054. if (this.vtable == null) {
  2055. this.vtable = [];
  2056. }
  2057. this.vtable_in_use = numfields;
  2058. for (var i = 0; i < numfields; i++) {
  2059. this.vtable[i] = 0; // This will push additional elements as needed
  2060. }
  2061. this.isNested = true;
  2062. this.object_start = this.offset();
  2063. };
  2064. /**
  2065. * Finish off writing the object that is under construction.
  2066. *
  2067. * @returns The offset to the object inside `dataBuffer`
  2068. */
  2069. Builder.prototype.endObject = function () {
  2070. if (this.vtable == null || !this.isNested) {
  2071. throw new Error('FlatBuffers: endObject called without startObject');
  2072. }
  2073. this.addInt32(0);
  2074. var vtableloc = this.offset();
  2075. // Trim trailing zeroes.
  2076. var i = this.vtable_in_use - 1;
  2077. // eslint-disable-next-line no-empty
  2078. for (; i >= 0 && this.vtable[i] == 0; i--) {}
  2079. var trimmed_size = i + 1;
  2080. // Write out the current vtable.
  2081. for (; i >= 0; i--) {
  2082. // Offset relative to the start of the table.
  2083. this.addInt16(this.vtable[i] != 0 ? vtableloc - this.vtable[i] : 0);
  2084. }
  2085. var standard_fields = 2; // The fields below:
  2086. this.addInt16(vtableloc - this.object_start);
  2087. var len = (trimmed_size + standard_fields) * constants_js_1.SIZEOF_SHORT;
  2088. this.addInt16(len);
  2089. // Search for an existing vtable that matches the current one.
  2090. var existing_vtable = 0;
  2091. var vt1 = this.space;
  2092. outer_loop: for (i = 0; i < this.vtables.length; i++) {
  2093. var vt2 = this.bb.capacity() - this.vtables[i];
  2094. if (len == this.bb.readInt16(vt2)) {
  2095. for (var j = constants_js_1.SIZEOF_SHORT; j < len; j += constants_js_1.SIZEOF_SHORT) {
  2096. if (this.bb.readInt16(vt1 + j) != this.bb.readInt16(vt2 + j)) {
  2097. continue outer_loop;
  2098. }
  2099. }
  2100. existing_vtable = this.vtables[i];
  2101. break;
  2102. }
  2103. }
  2104. if (existing_vtable) {
  2105. // Found a match:
  2106. // Remove the current vtable.
  2107. this.space = this.bb.capacity() - vtableloc;
  2108. // Point table to existing vtable.
  2109. this.bb.writeInt32(this.space, existing_vtable - vtableloc);
  2110. } else {
  2111. // No match:
  2112. // Add the location of the current vtable to the list of vtables.
  2113. this.vtables.push(this.offset());
  2114. // Point table to current vtable.
  2115. this.bb.writeInt32(this.bb.capacity() - vtableloc, this.offset() - vtableloc);
  2116. }
  2117. this.isNested = false;
  2118. return vtableloc;
  2119. };
  2120. /**
  2121. * Finalize a buffer, poiting to the given `root_table`.
  2122. */
  2123. Builder.prototype.finish = function (root_table, opt_file_identifier, opt_size_prefix) {
  2124. var size_prefix = opt_size_prefix ? constants_js_1.SIZE_PREFIX_LENGTH : 0;
  2125. if (opt_file_identifier) {
  2126. var file_identifier = opt_file_identifier;
  2127. this.prep(this.minalign, constants_js_1.SIZEOF_INT + constants_js_1.FILE_IDENTIFIER_LENGTH + size_prefix);
  2128. if (file_identifier.length != constants_js_1.FILE_IDENTIFIER_LENGTH) {
  2129. throw new Error('FlatBuffers: file identifier must be length ' + constants_js_1.FILE_IDENTIFIER_LENGTH);
  2130. }
  2131. for (var i = constants_js_1.FILE_IDENTIFIER_LENGTH - 1; i >= 0; i--) {
  2132. this.writeInt8(file_identifier.charCodeAt(i));
  2133. }
  2134. }
  2135. this.prep(this.minalign, constants_js_1.SIZEOF_INT + size_prefix);
  2136. this.addOffset(root_table);
  2137. if (size_prefix) {
  2138. this.addInt32(this.bb.capacity() - this.space);
  2139. }
  2140. this.bb.setPosition(this.space);
  2141. };
  2142. /**
  2143. * Finalize a size prefixed buffer, pointing to the given `root_table`.
  2144. */
  2145. Builder.prototype.finishSizePrefixed = function (root_table, opt_file_identifier) {
  2146. this.finish(root_table, opt_file_identifier, true);
  2147. };
  2148. /**
  2149. * This checks a required field has been set in a given table that has
  2150. * just been constructed.
  2151. */
  2152. Builder.prototype.requiredField = function (table, field) {
  2153. var table_start = this.bb.capacity() - table;
  2154. var vtable_start = table_start - this.bb.readInt32(table_start);
  2155. var ok = this.bb.readInt16(vtable_start + field) != 0;
  2156. // If this fails, the caller will show what field needs to be set.
  2157. if (!ok) {
  2158. throw new Error('FlatBuffers: field ' + field + ' must be set');
  2159. }
  2160. };
  2161. /**
  2162. * Start a new array/vector of objects. Users usually will not call
  2163. * this directly. The FlatBuffers compiler will create a start/end
  2164. * method for vector types in generated code.
  2165. *
  2166. * @param elem_size The size of each element in the array
  2167. * @param num_elems The number of elements in the array
  2168. * @param alignment The alignment of the array
  2169. */
  2170. Builder.prototype.startVector = function (elem_size, num_elems, alignment) {
  2171. this.notNested();
  2172. this.vector_num_elems = num_elems;
  2173. this.prep(constants_js_1.SIZEOF_INT, elem_size * num_elems);
  2174. this.prep(alignment, elem_size * num_elems); // Just in case alignment > int.
  2175. };
  2176. /**
  2177. * Finish off the creation of an array and all its elements. The array must be
  2178. * created with `startVector`.
  2179. *
  2180. * @returns The offset at which the newly created array
  2181. * starts.
  2182. */
  2183. Builder.prototype.endVector = function () {
  2184. this.writeInt32(this.vector_num_elems);
  2185. return this.offset();
  2186. };
  2187. /**
  2188. * Encode the string `s` in the buffer using UTF-8. If the string passed has
  2189. * already been seen, we return the offset of the already written string
  2190. *
  2191. * @param s The string to encode
  2192. * @return The offset in the buffer where the encoded string starts
  2193. */
  2194. Builder.prototype.createSharedString = function (s) {
  2195. if (!s) {
  2196. return 0;
  2197. }
  2198. if (!this.string_maps) {
  2199. this.string_maps = new Map();
  2200. }
  2201. if (this.string_maps.has(s)) {
  2202. return this.string_maps.get(s);
  2203. }
  2204. var offset = this.createString(s);
  2205. this.string_maps.set(s, offset);
  2206. return offset;
  2207. };
  2208. /**
  2209. * Encode the string `s` in the buffer using UTF-8. If a Uint8Array is passed
  2210. * instead of a string, it is assumed to contain valid UTF-8 encoded data.
  2211. *
  2212. * @param s The string to encode
  2213. * @return The offset in the buffer where the encoded string starts
  2214. */
  2215. Builder.prototype.createString = function (s) {
  2216. if (s === null || s === undefined) {
  2217. return 0;
  2218. }
  2219. var utf8;
  2220. if (s instanceof Uint8Array) {
  2221. utf8 = s;
  2222. } else {
  2223. utf8 = [];
  2224. var i = 0;
  2225. while (i < s.length) {
  2226. var codePoint = void 0;
  2227. // Decode UTF-16
  2228. var a = s.charCodeAt(i++);
  2229. if (a < 0xD800 || a >= 0xDC00) {
  2230. codePoint = a;
  2231. } else {
  2232. var b = s.charCodeAt(i++);
  2233. codePoint = (a << 10) + b + (0x10000 - (0xD800 << 10) - 0xDC00);
  2234. }
  2235. // Encode UTF-8
  2236. if (codePoint < 0x80) {
  2237. utf8.push(codePoint);
  2238. } else {
  2239. if (codePoint < 0x800) {
  2240. utf8.push(codePoint >> 6 & 0x1F | 0xC0);
  2241. } else {
  2242. if (codePoint < 0x10000) {
  2243. utf8.push(codePoint >> 12 & 0x0F | 0xE0);
  2244. } else {
  2245. utf8.push(codePoint >> 18 & 0x07 | 0xF0, codePoint >> 12 & 0x3F | 0x80);
  2246. }
  2247. utf8.push(codePoint >> 6 & 0x3F | 0x80);
  2248. }
  2249. utf8.push(codePoint & 0x3F | 0x80);
  2250. }
  2251. }
  2252. }
  2253. this.addInt8(0);
  2254. this.startVector(1, utf8.length, 1);
  2255. this.bb.setPosition(this.space -= utf8.length);
  2256. for (var i = 0, offset = this.space, bytes = this.bb.bytes(); i < utf8.length; i++) {
  2257. bytes[offset++] = utf8[i];
  2258. }
  2259. return this.endVector();
  2260. };
  2261. /**
  2262. * A helper function to pack an object
  2263. *
  2264. * @returns offset of obj
  2265. */
  2266. Builder.prototype.createObjectOffset = function (obj) {
  2267. if (obj === null) {
  2268. return 0;
  2269. }
  2270. if (typeof obj === 'string') {
  2271. return this.createString(obj);
  2272. } else {
  2273. return obj.pack(this);
  2274. }
  2275. };
  2276. /**
  2277. * A helper function to pack a list of object
  2278. *
  2279. * @returns list of offsets of each non null object
  2280. */
  2281. Builder.prototype.createObjectOffsetList = function (list) {
  2282. var ret = [];
  2283. for (var i = 0; i < list.length; ++i) {
  2284. var val = list[i];
  2285. if (val !== null) {
  2286. ret.push(this.createObjectOffset(val));
  2287. } else {
  2288. throw new Error('FlatBuffers: Argument for createObjectOffsetList cannot contain null.');
  2289. }
  2290. }
  2291. return ret;
  2292. };
  2293. Builder.prototype.createStructOffsetList = function (list, startFunc) {
  2294. startFunc(this, list.length);
  2295. this.createObjectOffsetList(list);
  2296. return this.endVector();
  2297. };
  2298. return Builder;
  2299. }();
  2300. exports.Builder = Builder;
  2301. /***/ }),
  2302. /***/ 1603:
  2303. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  2304. "use strict";
  2305. Object.defineProperty(exports, "__esModule", ({
  2306. value: true
  2307. }));
  2308. exports.ByteBuffer = void 0;
  2309. var constants_js_1 = __webpack_require__(1083);
  2310. var utils_js_1 = __webpack_require__(8700);
  2311. var encoding_js_1 = __webpack_require__(1958);
  2312. var ByteBuffer = /** @class */function () {
  2313. /**
  2314. * Create a new ByteBuffer with a given array of bytes (`Uint8Array`)
  2315. */
  2316. function ByteBuffer(bytes_) {
  2317. this.bytes_ = bytes_;
  2318. this.position_ = 0;
  2319. }
  2320. /**
  2321. * Create and allocate a new ByteBuffer with a given size.
  2322. */
  2323. ByteBuffer.allocate = function (byte_size) {
  2324. return new ByteBuffer(new Uint8Array(byte_size));
  2325. };
  2326. ByteBuffer.prototype.clear = function () {
  2327. this.position_ = 0;
  2328. };
  2329. /**
  2330. * Get the underlying `Uint8Array`.
  2331. */
  2332. ByteBuffer.prototype.bytes = function () {
  2333. return this.bytes_;
  2334. };
  2335. /**
  2336. * Get the buffer's position.
  2337. */
  2338. ByteBuffer.prototype.position = function () {
  2339. return this.position_;
  2340. };
  2341. /**
  2342. * Set the buffer's position.
  2343. */
  2344. ByteBuffer.prototype.setPosition = function (position) {
  2345. this.position_ = position;
  2346. };
  2347. /**
  2348. * Get the buffer's capacity.
  2349. */
  2350. ByteBuffer.prototype.capacity = function () {
  2351. return this.bytes_.length;
  2352. };
  2353. ByteBuffer.prototype.readInt8 = function (offset) {
  2354. return this.readUint8(offset) << 24 >> 24;
  2355. };
  2356. ByteBuffer.prototype.readUint8 = function (offset) {
  2357. return this.bytes_[offset];
  2358. };
  2359. ByteBuffer.prototype.readInt16 = function (offset) {
  2360. return this.readUint16(offset) << 16 >> 16;
  2361. };
  2362. ByteBuffer.prototype.readUint16 = function (offset) {
  2363. return this.bytes_[offset] | this.bytes_[offset + 1] << 8;
  2364. };
  2365. ByteBuffer.prototype.readInt32 = function (offset) {
  2366. return this.bytes_[offset] | this.bytes_[offset + 1] << 8 | this.bytes_[offset + 2] << 16 | this.bytes_[offset + 3] << 24;
  2367. };
  2368. ByteBuffer.prototype.readUint32 = function (offset) {
  2369. return this.readInt32(offset) >>> 0;
  2370. };
  2371. ByteBuffer.prototype.readInt64 = function (offset) {
  2372. return BigInt.asIntN(64, BigInt(this.readUint32(offset)) + (BigInt(this.readUint32(offset + 4)) << BigInt(32)));
  2373. };
  2374. ByteBuffer.prototype.readUint64 = function (offset) {
  2375. return BigInt.asUintN(64, BigInt(this.readUint32(offset)) + (BigInt(this.readUint32(offset + 4)) << BigInt(32)));
  2376. };
  2377. ByteBuffer.prototype.readFloat32 = function (offset) {
  2378. utils_js_1.int32[0] = this.readInt32(offset);
  2379. return utils_js_1.float32[0];
  2380. };
  2381. ByteBuffer.prototype.readFloat64 = function (offset) {
  2382. utils_js_1.int32[utils_js_1.isLittleEndian ? 0 : 1] = this.readInt32(offset);
  2383. utils_js_1.int32[utils_js_1.isLittleEndian ? 1 : 0] = this.readInt32(offset + 4);
  2384. return utils_js_1.float64[0];
  2385. };
  2386. ByteBuffer.prototype.writeInt8 = function (offset, value) {
  2387. this.bytes_[offset] = value;
  2388. };
  2389. ByteBuffer.prototype.writeUint8 = function (offset, value) {
  2390. this.bytes_[offset] = value;
  2391. };
  2392. ByteBuffer.prototype.writeInt16 = function (offset, value) {
  2393. this.bytes_[offset] = value;
  2394. this.bytes_[offset + 1] = value >> 8;
  2395. };
  2396. ByteBuffer.prototype.writeUint16 = function (offset, value) {
  2397. this.bytes_[offset] = value;
  2398. this.bytes_[offset + 1] = value >> 8;
  2399. };
  2400. ByteBuffer.prototype.writeInt32 = function (offset, value) {
  2401. this.bytes_[offset] = value;
  2402. this.bytes_[offset + 1] = value >> 8;
  2403. this.bytes_[offset + 2] = value >> 16;
  2404. this.bytes_[offset + 3] = value >> 24;
  2405. };
  2406. ByteBuffer.prototype.writeUint32 = function (offset, value) {
  2407. this.bytes_[offset] = value;
  2408. this.bytes_[offset + 1] = value >> 8;
  2409. this.bytes_[offset + 2] = value >> 16;
  2410. this.bytes_[offset + 3] = value >> 24;
  2411. };
  2412. ByteBuffer.prototype.writeInt64 = function (offset, value) {
  2413. this.writeInt32(offset, Number(BigInt.asIntN(32, value)));
  2414. this.writeInt32(offset + 4, Number(BigInt.asIntN(32, value >> BigInt(32))));
  2415. };
  2416. ByteBuffer.prototype.writeUint64 = function (offset, value) {
  2417. this.writeUint32(offset, Number(BigInt.asUintN(32, value)));
  2418. this.writeUint32(offset + 4, Number(BigInt.asUintN(32, value >> BigInt(32))));
  2419. };
  2420. ByteBuffer.prototype.writeFloat32 = function (offset, value) {
  2421. utils_js_1.float32[0] = value;
  2422. this.writeInt32(offset, utils_js_1.int32[0]);
  2423. };
  2424. ByteBuffer.prototype.writeFloat64 = function (offset, value) {
  2425. utils_js_1.float64[0] = value;
  2426. this.writeInt32(offset, utils_js_1.int32[utils_js_1.isLittleEndian ? 0 : 1]);
  2427. this.writeInt32(offset + 4, utils_js_1.int32[utils_js_1.isLittleEndian ? 1 : 0]);
  2428. };
  2429. /**
  2430. * Return the file identifier. Behavior is undefined for FlatBuffers whose
  2431. * schema does not include a file_identifier (likely points at padding or the
  2432. * start of a the root vtable).
  2433. */
  2434. ByteBuffer.prototype.getBufferIdentifier = function () {
  2435. if (this.bytes_.length < this.position_ + constants_js_1.SIZEOF_INT + constants_js_1.FILE_IDENTIFIER_LENGTH) {
  2436. throw new Error('FlatBuffers: ByteBuffer is too short to contain an identifier.');
  2437. }
  2438. var result = "";
  2439. for (var i = 0; i < constants_js_1.FILE_IDENTIFIER_LENGTH; i++) {
  2440. result += String.fromCharCode(this.readInt8(this.position_ + constants_js_1.SIZEOF_INT + i));
  2441. }
  2442. return result;
  2443. };
  2444. /**
  2445. * Look up a field in the vtable, return an offset into the object, or 0 if the
  2446. * field is not present.
  2447. */
  2448. ByteBuffer.prototype.__offset = function (bb_pos, vtable_offset) {
  2449. var vtable = bb_pos - this.readInt32(bb_pos);
  2450. return vtable_offset < this.readInt16(vtable) ? this.readInt16(vtable + vtable_offset) : 0;
  2451. };
  2452. /**
  2453. * Initialize any Table-derived type to point to the union at the given offset.
  2454. */
  2455. ByteBuffer.prototype.__union = function (t, offset) {
  2456. t.bb_pos = offset + this.readInt32(offset);
  2457. t.bb = this;
  2458. return t;
  2459. };
  2460. /**
  2461. * Create a JavaScript string from UTF-8 data stored inside the FlatBuffer.
  2462. * This allocates a new string and converts to wide chars upon each access.
  2463. *
  2464. * To avoid the conversion to UTF-16, pass Encoding.UTF8_BYTES as
  2465. * the "optionalEncoding" argument. This is useful for avoiding conversion to
  2466. * and from UTF-16 when the data will just be packaged back up in another
  2467. * FlatBuffer later on.
  2468. *
  2469. * @param offset
  2470. * @param opt_encoding Defaults to UTF16_STRING
  2471. */
  2472. ByteBuffer.prototype.__string = function (offset, opt_encoding) {
  2473. offset += this.readInt32(offset);
  2474. var length = this.readInt32(offset);
  2475. var result = '';
  2476. var i = 0;
  2477. offset += constants_js_1.SIZEOF_INT;
  2478. if (opt_encoding === encoding_js_1.Encoding.UTF8_BYTES) {
  2479. return this.bytes_.subarray(offset, offset + length);
  2480. }
  2481. while (i < length) {
  2482. var codePoint = void 0;
  2483. // Decode UTF-8
  2484. var a = this.readUint8(offset + i++);
  2485. if (a < 0xC0) {
  2486. codePoint = a;
  2487. } else {
  2488. var b = this.readUint8(offset + i++);
  2489. if (a < 0xE0) {
  2490. codePoint = (a & 0x1F) << 6 | b & 0x3F;
  2491. } else {
  2492. var c = this.readUint8(offset + i++);
  2493. if (a < 0xF0) {
  2494. codePoint = (a & 0x0F) << 12 | (b & 0x3F) << 6 | c & 0x3F;
  2495. } else {
  2496. var d = this.readUint8(offset + i++);
  2497. codePoint = (a & 0x07) << 18 | (b & 0x3F) << 12 | (c & 0x3F) << 6 | d & 0x3F;
  2498. }
  2499. }
  2500. }
  2501. // Encode UTF-16
  2502. if (codePoint < 0x10000) {
  2503. result += String.fromCharCode(codePoint);
  2504. } else {
  2505. codePoint -= 0x10000;
  2506. result += String.fromCharCode((codePoint >> 10) + 0xD800, (codePoint & (1 << 10) - 1) + 0xDC00);
  2507. }
  2508. }
  2509. return result;
  2510. };
  2511. /**
  2512. * Handle unions that can contain string as its member, if a Table-derived type then initialize it,
  2513. * if a string then return a new one
  2514. *
  2515. * WARNING: strings are immutable in JS so we can't change the string that the user gave us, this
  2516. * makes the behaviour of __union_with_string different compared to __union
  2517. */
  2518. ByteBuffer.prototype.__union_with_string = function (o, offset) {
  2519. if (typeof o === 'string') {
  2520. return this.__string(offset);
  2521. }
  2522. return this.__union(o, offset);
  2523. };
  2524. /**
  2525. * Retrieve the relative offset stored at "offset"
  2526. */
  2527. ByteBuffer.prototype.__indirect = function (offset) {
  2528. return offset + this.readInt32(offset);
  2529. };
  2530. /**
  2531. * Get the start of data of a vector whose offset is stored at "offset" in this object.
  2532. */
  2533. ByteBuffer.prototype.__vector = function (offset) {
  2534. return offset + this.readInt32(offset) + constants_js_1.SIZEOF_INT; // data starts after the length
  2535. };
  2536. /**
  2537. * Get the length of a vector whose offset is stored at "offset" in this object.
  2538. */
  2539. ByteBuffer.prototype.__vector_len = function (offset) {
  2540. return this.readInt32(offset + this.readInt32(offset));
  2541. };
  2542. ByteBuffer.prototype.__has_identifier = function (ident) {
  2543. if (ident.length != constants_js_1.FILE_IDENTIFIER_LENGTH) {
  2544. throw new Error('FlatBuffers: file identifier must be length ' + constants_js_1.FILE_IDENTIFIER_LENGTH);
  2545. }
  2546. for (var i = 0; i < constants_js_1.FILE_IDENTIFIER_LENGTH; i++) {
  2547. if (ident.charCodeAt(i) != this.readInt8(this.position() + constants_js_1.SIZEOF_INT + i)) {
  2548. return false;
  2549. }
  2550. }
  2551. return true;
  2552. };
  2553. /**
  2554. * A helper function for generating list for obj api
  2555. */
  2556. ByteBuffer.prototype.createScalarList = function (listAccessor, listLength) {
  2557. var ret = [];
  2558. for (var i = 0; i < listLength; ++i) {
  2559. if (listAccessor(i) !== null) {
  2560. ret.push(listAccessor(i));
  2561. }
  2562. }
  2563. return ret;
  2564. };
  2565. /**
  2566. * A helper function for generating list for obj api
  2567. * @param listAccessor function that accepts an index and return data at that index
  2568. * @param listLength listLength
  2569. * @param res result list
  2570. */
  2571. ByteBuffer.prototype.createObjList = function (listAccessor, listLength) {
  2572. var ret = [];
  2573. for (var i = 0; i < listLength; ++i) {
  2574. var val = listAccessor(i);
  2575. if (val !== null) {
  2576. ret.push(val.unpack());
  2577. }
  2578. }
  2579. return ret;
  2580. };
  2581. return ByteBuffer;
  2582. }();
  2583. exports.ByteBuffer = ByteBuffer;
  2584. /***/ }),
  2585. /***/ 1083:
  2586. /***/ (function(__unused_webpack_module, exports) {
  2587. "use strict";
  2588. Object.defineProperty(exports, "__esModule", ({
  2589. value: true
  2590. }));
  2591. exports.SIZE_PREFIX_LENGTH = exports.FILE_IDENTIFIER_LENGTH = exports.SIZEOF_INT = exports.SIZEOF_SHORT = void 0;
  2592. exports.SIZEOF_SHORT = 2;
  2593. exports.SIZEOF_INT = 4;
  2594. exports.FILE_IDENTIFIER_LENGTH = 4;
  2595. exports.SIZE_PREFIX_LENGTH = 4;
  2596. /***/ }),
  2597. /***/ 1958:
  2598. /***/ (function(__unused_webpack_module, exports) {
  2599. "use strict";
  2600. Object.defineProperty(exports, "__esModule", ({
  2601. value: true
  2602. }));
  2603. exports.Encoding = void 0;
  2604. var Encoding;
  2605. (function (Encoding) {
  2606. Encoding[Encoding["UTF8_BYTES"] = 1] = "UTF8_BYTES";
  2607. Encoding[Encoding["UTF16_STRING"] = 2] = "UTF16_STRING";
  2608. })(Encoding = exports.Encoding || (exports.Encoding = {}));
  2609. /***/ }),
  2610. /***/ 1095:
  2611. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  2612. "use strict";
  2613. var __webpack_unused_export__;
  2614. __webpack_unused_export__ = ({
  2615. value: true
  2616. });
  2617. exports.cZ = __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = exports.XU = __webpack_unused_export__ = __webpack_unused_export__ = __webpack_unused_export__ = void 0;
  2618. var constants_js_1 = __webpack_require__(1083);
  2619. __webpack_unused_export__ = ({
  2620. enumerable: true,
  2621. get: function get() {
  2622. return constants_js_1.SIZEOF_SHORT;
  2623. }
  2624. });
  2625. var constants_js_2 = __webpack_require__(1083);
  2626. __webpack_unused_export__ = ({
  2627. enumerable: true,
  2628. get: function get() {
  2629. return constants_js_2.SIZEOF_INT;
  2630. }
  2631. });
  2632. var constants_js_3 = __webpack_require__(1083);
  2633. __webpack_unused_export__ = ({
  2634. enumerable: true,
  2635. get: function get() {
  2636. return constants_js_3.FILE_IDENTIFIER_LENGTH;
  2637. }
  2638. });
  2639. var constants_js_4 = __webpack_require__(1083);
  2640. Object.defineProperty(exports, "XU", ({
  2641. enumerable: true,
  2642. get: function get() {
  2643. return constants_js_4.SIZE_PREFIX_LENGTH;
  2644. }
  2645. }));
  2646. var utils_js_1 = __webpack_require__(8700);
  2647. __webpack_unused_export__ = ({
  2648. enumerable: true,
  2649. get: function get() {
  2650. return utils_js_1.int32;
  2651. }
  2652. });
  2653. __webpack_unused_export__ = ({
  2654. enumerable: true,
  2655. get: function get() {
  2656. return utils_js_1.float32;
  2657. }
  2658. });
  2659. __webpack_unused_export__ = ({
  2660. enumerable: true,
  2661. get: function get() {
  2662. return utils_js_1.float64;
  2663. }
  2664. });
  2665. __webpack_unused_export__ = ({
  2666. enumerable: true,
  2667. get: function get() {
  2668. return utils_js_1.isLittleEndian;
  2669. }
  2670. });
  2671. var encoding_js_1 = __webpack_require__(1958);
  2672. __webpack_unused_export__ = ({
  2673. enumerable: true,
  2674. get: function get() {
  2675. return encoding_js_1.Encoding;
  2676. }
  2677. });
  2678. var builder_js_1 = __webpack_require__(4634);
  2679. __webpack_unused_export__ = ({
  2680. enumerable: true,
  2681. get: function get() {
  2682. return builder_js_1.Builder;
  2683. }
  2684. });
  2685. var byte_buffer_js_1 = __webpack_require__(1603);
  2686. Object.defineProperty(exports, "cZ", ({
  2687. enumerable: true,
  2688. get: function get() {
  2689. return byte_buffer_js_1.ByteBuffer;
  2690. }
  2691. }));
  2692. /***/ }),
  2693. /***/ 8700:
  2694. /***/ (function(__unused_webpack_module, exports) {
  2695. "use strict";
  2696. Object.defineProperty(exports, "__esModule", ({
  2697. value: true
  2698. }));
  2699. exports.isLittleEndian = exports.float64 = exports.float32 = exports.int32 = void 0;
  2700. exports.int32 = new Int32Array(2);
  2701. exports.float32 = new Float32Array(exports.int32.buffer);
  2702. exports.float64 = new Float64Array(exports.int32.buffer);
  2703. exports.isLittleEndian = new Uint16Array(new Uint8Array([1, 0]).buffer)[0] === 1;
  2704. /***/ }),
  2705. /***/ 8813:
  2706. /***/ (function(module) {
  2707. var containers = []; // will store container HTMLElement references
  2708. var styleElements = []; // will store {prepend: HTMLElement, append: HTMLElement}
  2709. var usage = 'insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).';
  2710. function insertCss(css, options) {
  2711. options = options || {};
  2712. if (css === undefined) {
  2713. throw new Error(usage);
  2714. }
  2715. var position = options.prepend === true ? 'prepend' : 'append';
  2716. var container = options.container !== undefined ? options.container : document.querySelector('head');
  2717. var containerId = containers.indexOf(container);
  2718. // first time we see this container, create the necessary entries
  2719. if (containerId === -1) {
  2720. containerId = containers.push(container) - 1;
  2721. styleElements[containerId] = {};
  2722. }
  2723. // try to get the correponding container + position styleElement, create it otherwise
  2724. var styleElement;
  2725. if (styleElements[containerId] !== undefined && styleElements[containerId][position] !== undefined) {
  2726. styleElement = styleElements[containerId][position];
  2727. } else {
  2728. styleElement = styleElements[containerId][position] = createStyleElement();
  2729. if (position === 'prepend') {
  2730. container.insertBefore(styleElement, container.childNodes[0]);
  2731. } else {
  2732. container.appendChild(styleElement);
  2733. }
  2734. }
  2735. // strip potential UTF-8 BOM if css was read from a file
  2736. if (css.charCodeAt(0) === 0xFEFF) {
  2737. css = css.substr(1, css.length);
  2738. }
  2739. // actually add the stylesheet
  2740. if (styleElement.styleSheet) {
  2741. styleElement.styleSheet.cssText += css;
  2742. } else {
  2743. styleElement.textContent += css;
  2744. }
  2745. return styleElement;
  2746. }
  2747. ;
  2748. function createStyleElement() {
  2749. var styleElement = document.createElement('style');
  2750. styleElement.setAttribute('type', 'text/css');
  2751. return styleElement;
  2752. }
  2753. module.exports = insertCss;
  2754. module.exports.insertCss = insertCss;
  2755. /***/ }),
  2756. /***/ 2138:
  2757. /***/ (function(module, exports, __webpack_require__) {
  2758. /* module decorator */ module = __webpack_require__.nmd(module);
  2759. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  2760. /**
  2761. * lodash (Custom Build) <https://lodash.com/>
  2762. * Build: `lodash modularize exports="npm" -o ./`
  2763. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  2764. * Released under MIT license <https://lodash.com/license>
  2765. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  2766. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  2767. */
  2768. /** Used as the size to enable large array optimizations. */
  2769. var LARGE_ARRAY_SIZE = 200;
  2770. /** Used to stand-in for `undefined` hash values. */
  2771. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  2772. /** Used as references for various `Number` constants. */
  2773. var MAX_SAFE_INTEGER = 9007199254740991;
  2774. /** `Object#toString` result references. */
  2775. var argsTag = '[object Arguments]',
  2776. arrayTag = '[object Array]',
  2777. boolTag = '[object Boolean]',
  2778. dateTag = '[object Date]',
  2779. errorTag = '[object Error]',
  2780. funcTag = '[object Function]',
  2781. genTag = '[object GeneratorFunction]',
  2782. mapTag = '[object Map]',
  2783. numberTag = '[object Number]',
  2784. objectTag = '[object Object]',
  2785. promiseTag = '[object Promise]',
  2786. regexpTag = '[object RegExp]',
  2787. setTag = '[object Set]',
  2788. stringTag = '[object String]',
  2789. symbolTag = '[object Symbol]',
  2790. weakMapTag = '[object WeakMap]';
  2791. var arrayBufferTag = '[object ArrayBuffer]',
  2792. dataViewTag = '[object DataView]',
  2793. float32Tag = '[object Float32Array]',
  2794. float64Tag = '[object Float64Array]',
  2795. int8Tag = '[object Int8Array]',
  2796. int16Tag = '[object Int16Array]',
  2797. int32Tag = '[object Int32Array]',
  2798. uint8Tag = '[object Uint8Array]',
  2799. uint8ClampedTag = '[object Uint8ClampedArray]',
  2800. uint16Tag = '[object Uint16Array]',
  2801. uint32Tag = '[object Uint32Array]';
  2802. /**
  2803. * Used to match `RegExp`
  2804. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  2805. */
  2806. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  2807. /** Used to match `RegExp` flags from their coerced string values. */
  2808. var reFlags = /\w*$/;
  2809. /** Used to detect host constructors (Safari). */
  2810. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  2811. /** Used to detect unsigned integer values. */
  2812. var reIsUint = /^(?:0|[1-9]\d*)$/;
  2813. /** Used to identify `toStringTag` values supported by `_.clone`. */
  2814. var cloneableTags = {};
  2815. cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  2816. cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
  2817. /** Detect free variable `global` from Node.js. */
  2818. var freeGlobal = (typeof __webpack_require__.g === "undefined" ? "undefined" : _typeof(__webpack_require__.g)) == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  2819. /** Detect free variable `self`. */
  2820. var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
  2821. /** Used as a reference to the global object. */
  2822. var root = freeGlobal || freeSelf || Function('return this')();
  2823. /** Detect free variable `exports`. */
  2824. var freeExports = ( false ? 0 : _typeof(exports)) == 'object' && exports && !exports.nodeType && exports;
  2825. /** Detect free variable `module`. */
  2826. var freeModule = freeExports && ( false ? 0 : _typeof(module)) == 'object' && module && !module.nodeType && module;
  2827. /** Detect the popular CommonJS extension `module.exports`. */
  2828. var moduleExports = freeModule && freeModule.exports === freeExports;
  2829. /**
  2830. * Adds the key-value `pair` to `map`.
  2831. *
  2832. * @private
  2833. * @param {Object} map The map to modify.
  2834. * @param {Array} pair The key-value pair to add.
  2835. * @returns {Object} Returns `map`.
  2836. */
  2837. function addMapEntry(map, pair) {
  2838. // Don't return `map.set` because it's not chainable in IE 11.
  2839. map.set(pair[0], pair[1]);
  2840. return map;
  2841. }
  2842. /**
  2843. * Adds `value` to `set`.
  2844. *
  2845. * @private
  2846. * @param {Object} set The set to modify.
  2847. * @param {*} value The value to add.
  2848. * @returns {Object} Returns `set`.
  2849. */
  2850. function addSetEntry(set, value) {
  2851. // Don't return `set.add` because it's not chainable in IE 11.
  2852. set.add(value);
  2853. return set;
  2854. }
  2855. /**
  2856. * A specialized version of `_.forEach` for arrays without support for
  2857. * iteratee shorthands.
  2858. *
  2859. * @private
  2860. * @param {Array} [array] The array to iterate over.
  2861. * @param {Function} iteratee The function invoked per iteration.
  2862. * @returns {Array} Returns `array`.
  2863. */
  2864. function arrayEach(array, iteratee) {
  2865. var index = -1,
  2866. length = array ? array.length : 0;
  2867. while (++index < length) {
  2868. if (iteratee(array[index], index, array) === false) {
  2869. break;
  2870. }
  2871. }
  2872. return array;
  2873. }
  2874. /**
  2875. * Appends the elements of `values` to `array`.
  2876. *
  2877. * @private
  2878. * @param {Array} array The array to modify.
  2879. * @param {Array} values The values to append.
  2880. * @returns {Array} Returns `array`.
  2881. */
  2882. function arrayPush(array, values) {
  2883. var index = -1,
  2884. length = values.length,
  2885. offset = array.length;
  2886. while (++index < length) {
  2887. array[offset + index] = values[index];
  2888. }
  2889. return array;
  2890. }
  2891. /**
  2892. * A specialized version of `_.reduce` for arrays without support for
  2893. * iteratee shorthands.
  2894. *
  2895. * @private
  2896. * @param {Array} [array] The array to iterate over.
  2897. * @param {Function} iteratee The function invoked per iteration.
  2898. * @param {*} [accumulator] The initial value.
  2899. * @param {boolean} [initAccum] Specify using the first element of `array` as
  2900. * the initial value.
  2901. * @returns {*} Returns the accumulated value.
  2902. */
  2903. function arrayReduce(array, iteratee, accumulator, initAccum) {
  2904. var index = -1,
  2905. length = array ? array.length : 0;
  2906. if (initAccum && length) {
  2907. accumulator = array[++index];
  2908. }
  2909. while (++index < length) {
  2910. accumulator = iteratee(accumulator, array[index], index, array);
  2911. }
  2912. return accumulator;
  2913. }
  2914. /**
  2915. * The base implementation of `_.times` without support for iteratee shorthands
  2916. * or max array length checks.
  2917. *
  2918. * @private
  2919. * @param {number} n The number of times to invoke `iteratee`.
  2920. * @param {Function} iteratee The function invoked per iteration.
  2921. * @returns {Array} Returns the array of results.
  2922. */
  2923. function baseTimes(n, iteratee) {
  2924. var index = -1,
  2925. result = Array(n);
  2926. while (++index < n) {
  2927. result[index] = iteratee(index);
  2928. }
  2929. return result;
  2930. }
  2931. /**
  2932. * Gets the value at `key` of `object`.
  2933. *
  2934. * @private
  2935. * @param {Object} [object] The object to query.
  2936. * @param {string} key The key of the property to get.
  2937. * @returns {*} Returns the property value.
  2938. */
  2939. function getValue(object, key) {
  2940. return object == null ? undefined : object[key];
  2941. }
  2942. /**
  2943. * Checks if `value` is a host object in IE < 9.
  2944. *
  2945. * @private
  2946. * @param {*} value The value to check.
  2947. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  2948. */
  2949. function isHostObject(value) {
  2950. // Many host objects are `Object` objects that can coerce to strings
  2951. // despite having improperly defined `toString` methods.
  2952. var result = false;
  2953. if (value != null && typeof value.toString != 'function') {
  2954. try {
  2955. result = !!(value + '');
  2956. } catch (e) {}
  2957. }
  2958. return result;
  2959. }
  2960. /**
  2961. * Converts `map` to its key-value pairs.
  2962. *
  2963. * @private
  2964. * @param {Object} map The map to convert.
  2965. * @returns {Array} Returns the key-value pairs.
  2966. */
  2967. function mapToArray(map) {
  2968. var index = -1,
  2969. result = Array(map.size);
  2970. map.forEach(function (value, key) {
  2971. result[++index] = [key, value];
  2972. });
  2973. return result;
  2974. }
  2975. /**
  2976. * Creates a unary function that invokes `func` with its argument transformed.
  2977. *
  2978. * @private
  2979. * @param {Function} func The function to wrap.
  2980. * @param {Function} transform The argument transform.
  2981. * @returns {Function} Returns the new function.
  2982. */
  2983. function overArg(func, transform) {
  2984. return function (arg) {
  2985. return func(transform(arg));
  2986. };
  2987. }
  2988. /**
  2989. * Converts `set` to an array of its values.
  2990. *
  2991. * @private
  2992. * @param {Object} set The set to convert.
  2993. * @returns {Array} Returns the values.
  2994. */
  2995. function setToArray(set) {
  2996. var index = -1,
  2997. result = Array(set.size);
  2998. set.forEach(function (value) {
  2999. result[++index] = value;
  3000. });
  3001. return result;
  3002. }
  3003. /** Used for built-in method references. */
  3004. var arrayProto = Array.prototype,
  3005. funcProto = Function.prototype,
  3006. objectProto = Object.prototype;
  3007. /** Used to detect overreaching core-js shims. */
  3008. var coreJsData = root['__core-js_shared__'];
  3009. /** Used to detect methods masquerading as native. */
  3010. var maskSrcKey = function () {
  3011. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  3012. return uid ? 'Symbol(src)_1.' + uid : '';
  3013. }();
  3014. /** Used to resolve the decompiled source of functions. */
  3015. var funcToString = funcProto.toString;
  3016. /** Used to check objects for own properties. */
  3017. var hasOwnProperty = objectProto.hasOwnProperty;
  3018. /**
  3019. * Used to resolve the
  3020. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  3021. * of values.
  3022. */
  3023. var objectToString = objectProto.toString;
  3024. /** Used to detect if a method is native. */
  3025. var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
  3026. /** Built-in value references. */
  3027. var Buffer = moduleExports ? root.Buffer : undefined,
  3028. _Symbol = root.Symbol,
  3029. Uint8Array = root.Uint8Array,
  3030. getPrototype = overArg(Object.getPrototypeOf, Object),
  3031. objectCreate = Object.create,
  3032. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  3033. splice = arrayProto.splice;
  3034. /* Built-in method references for those with the same name as other `lodash` methods. */
  3035. var nativeGetSymbols = Object.getOwnPropertySymbols,
  3036. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  3037. nativeKeys = overArg(Object.keys, Object);
  3038. /* Built-in method references that are verified to be native. */
  3039. var DataView = getNative(root, 'DataView'),
  3040. Map = getNative(root, 'Map'),
  3041. Promise = getNative(root, 'Promise'),
  3042. Set = getNative(root, 'Set'),
  3043. WeakMap = getNative(root, 'WeakMap'),
  3044. nativeCreate = getNative(Object, 'create');
  3045. /** Used to detect maps, sets, and weakmaps. */
  3046. var dataViewCtorString = toSource(DataView),
  3047. mapCtorString = toSource(Map),
  3048. promiseCtorString = toSource(Promise),
  3049. setCtorString = toSource(Set),
  3050. weakMapCtorString = toSource(WeakMap);
  3051. /** Used to convert symbols to primitives and strings. */
  3052. var symbolProto = _Symbol ? _Symbol.prototype : undefined,
  3053. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
  3054. /**
  3055. * Creates a hash object.
  3056. *
  3057. * @private
  3058. * @constructor
  3059. * @param {Array} [entries] The key-value pairs to cache.
  3060. */
  3061. function Hash(entries) {
  3062. var index = -1,
  3063. length = entries ? entries.length : 0;
  3064. this.clear();
  3065. while (++index < length) {
  3066. var entry = entries[index];
  3067. this.set(entry[0], entry[1]);
  3068. }
  3069. }
  3070. /**
  3071. * Removes all key-value entries from the hash.
  3072. *
  3073. * @private
  3074. * @name clear
  3075. * @memberOf Hash
  3076. */
  3077. function hashClear() {
  3078. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  3079. }
  3080. /**
  3081. * Removes `key` and its value from the hash.
  3082. *
  3083. * @private
  3084. * @name delete
  3085. * @memberOf Hash
  3086. * @param {Object} hash The hash to modify.
  3087. * @param {string} key The key of the value to remove.
  3088. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3089. */
  3090. function hashDelete(key) {
  3091. return this.has(key) && delete this.__data__[key];
  3092. }
  3093. /**
  3094. * Gets the hash value for `key`.
  3095. *
  3096. * @private
  3097. * @name get
  3098. * @memberOf Hash
  3099. * @param {string} key The key of the value to get.
  3100. * @returns {*} Returns the entry value.
  3101. */
  3102. function hashGet(key) {
  3103. var data = this.__data__;
  3104. if (nativeCreate) {
  3105. var result = data[key];
  3106. return result === HASH_UNDEFINED ? undefined : result;
  3107. }
  3108. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3109. }
  3110. /**
  3111. * Checks if a hash value for `key` exists.
  3112. *
  3113. * @private
  3114. * @name has
  3115. * @memberOf Hash
  3116. * @param {string} key The key of the entry to check.
  3117. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3118. */
  3119. function hashHas(key) {
  3120. var data = this.__data__;
  3121. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  3122. }
  3123. /**
  3124. * Sets the hash `key` to `value`.
  3125. *
  3126. * @private
  3127. * @name set
  3128. * @memberOf Hash
  3129. * @param {string} key The key of the value to set.
  3130. * @param {*} value The value to set.
  3131. * @returns {Object} Returns the hash instance.
  3132. */
  3133. function hashSet(key, value) {
  3134. var data = this.__data__;
  3135. data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
  3136. return this;
  3137. }
  3138. // Add methods to `Hash`.
  3139. Hash.prototype.clear = hashClear;
  3140. Hash.prototype['delete'] = hashDelete;
  3141. Hash.prototype.get = hashGet;
  3142. Hash.prototype.has = hashHas;
  3143. Hash.prototype.set = hashSet;
  3144. /**
  3145. * Creates an list cache object.
  3146. *
  3147. * @private
  3148. * @constructor
  3149. * @param {Array} [entries] The key-value pairs to cache.
  3150. */
  3151. function ListCache(entries) {
  3152. var index = -1,
  3153. length = entries ? entries.length : 0;
  3154. this.clear();
  3155. while (++index < length) {
  3156. var entry = entries[index];
  3157. this.set(entry[0], entry[1]);
  3158. }
  3159. }
  3160. /**
  3161. * Removes all key-value entries from the list cache.
  3162. *
  3163. * @private
  3164. * @name clear
  3165. * @memberOf ListCache
  3166. */
  3167. function listCacheClear() {
  3168. this.__data__ = [];
  3169. }
  3170. /**
  3171. * Removes `key` and its value from the list cache.
  3172. *
  3173. * @private
  3174. * @name delete
  3175. * @memberOf ListCache
  3176. * @param {string} key The key of the value to remove.
  3177. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3178. */
  3179. function listCacheDelete(key) {
  3180. var data = this.__data__,
  3181. index = assocIndexOf(data, key);
  3182. if (index < 0) {
  3183. return false;
  3184. }
  3185. var lastIndex = data.length - 1;
  3186. if (index == lastIndex) {
  3187. data.pop();
  3188. } else {
  3189. splice.call(data, index, 1);
  3190. }
  3191. return true;
  3192. }
  3193. /**
  3194. * Gets the list cache value for `key`.
  3195. *
  3196. * @private
  3197. * @name get
  3198. * @memberOf ListCache
  3199. * @param {string} key The key of the value to get.
  3200. * @returns {*} Returns the entry value.
  3201. */
  3202. function listCacheGet(key) {
  3203. var data = this.__data__,
  3204. index = assocIndexOf(data, key);
  3205. return index < 0 ? undefined : data[index][1];
  3206. }
  3207. /**
  3208. * Checks if a list cache value for `key` exists.
  3209. *
  3210. * @private
  3211. * @name has
  3212. * @memberOf ListCache
  3213. * @param {string} key The key of the entry to check.
  3214. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3215. */
  3216. function listCacheHas(key) {
  3217. return assocIndexOf(this.__data__, key) > -1;
  3218. }
  3219. /**
  3220. * Sets the list cache `key` to `value`.
  3221. *
  3222. * @private
  3223. * @name set
  3224. * @memberOf ListCache
  3225. * @param {string} key The key of the value to set.
  3226. * @param {*} value The value to set.
  3227. * @returns {Object} Returns the list cache instance.
  3228. */
  3229. function listCacheSet(key, value) {
  3230. var data = this.__data__,
  3231. index = assocIndexOf(data, key);
  3232. if (index < 0) {
  3233. data.push([key, value]);
  3234. } else {
  3235. data[index][1] = value;
  3236. }
  3237. return this;
  3238. }
  3239. // Add methods to `ListCache`.
  3240. ListCache.prototype.clear = listCacheClear;
  3241. ListCache.prototype['delete'] = listCacheDelete;
  3242. ListCache.prototype.get = listCacheGet;
  3243. ListCache.prototype.has = listCacheHas;
  3244. ListCache.prototype.set = listCacheSet;
  3245. /**
  3246. * Creates a map cache object to store key-value pairs.
  3247. *
  3248. * @private
  3249. * @constructor
  3250. * @param {Array} [entries] The key-value pairs to cache.
  3251. */
  3252. function MapCache(entries) {
  3253. var index = -1,
  3254. length = entries ? entries.length : 0;
  3255. this.clear();
  3256. while (++index < length) {
  3257. var entry = entries[index];
  3258. this.set(entry[0], entry[1]);
  3259. }
  3260. }
  3261. /**
  3262. * Removes all key-value entries from the map.
  3263. *
  3264. * @private
  3265. * @name clear
  3266. * @memberOf MapCache
  3267. */
  3268. function mapCacheClear() {
  3269. this.__data__ = {
  3270. 'hash': new Hash(),
  3271. 'map': new (Map || ListCache)(),
  3272. 'string': new Hash()
  3273. };
  3274. }
  3275. /**
  3276. * Removes `key` and its value from the map.
  3277. *
  3278. * @private
  3279. * @name delete
  3280. * @memberOf MapCache
  3281. * @param {string} key The key of the value to remove.
  3282. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3283. */
  3284. function mapCacheDelete(key) {
  3285. return getMapData(this, key)['delete'](key);
  3286. }
  3287. /**
  3288. * Gets the map value for `key`.
  3289. *
  3290. * @private
  3291. * @name get
  3292. * @memberOf MapCache
  3293. * @param {string} key The key of the value to get.
  3294. * @returns {*} Returns the entry value.
  3295. */
  3296. function mapCacheGet(key) {
  3297. return getMapData(this, key).get(key);
  3298. }
  3299. /**
  3300. * Checks if a map value for `key` exists.
  3301. *
  3302. * @private
  3303. * @name has
  3304. * @memberOf MapCache
  3305. * @param {string} key The key of the entry to check.
  3306. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3307. */
  3308. function mapCacheHas(key) {
  3309. return getMapData(this, key).has(key);
  3310. }
  3311. /**
  3312. * Sets the map `key` to `value`.
  3313. *
  3314. * @private
  3315. * @name set
  3316. * @memberOf MapCache
  3317. * @param {string} key The key of the value to set.
  3318. * @param {*} value The value to set.
  3319. * @returns {Object} Returns the map cache instance.
  3320. */
  3321. function mapCacheSet(key, value) {
  3322. getMapData(this, key).set(key, value);
  3323. return this;
  3324. }
  3325. // Add methods to `MapCache`.
  3326. MapCache.prototype.clear = mapCacheClear;
  3327. MapCache.prototype['delete'] = mapCacheDelete;
  3328. MapCache.prototype.get = mapCacheGet;
  3329. MapCache.prototype.has = mapCacheHas;
  3330. MapCache.prototype.set = mapCacheSet;
  3331. /**
  3332. * Creates a stack cache object to store key-value pairs.
  3333. *
  3334. * @private
  3335. * @constructor
  3336. * @param {Array} [entries] The key-value pairs to cache.
  3337. */
  3338. function Stack(entries) {
  3339. this.__data__ = new ListCache(entries);
  3340. }
  3341. /**
  3342. * Removes all key-value entries from the stack.
  3343. *
  3344. * @private
  3345. * @name clear
  3346. * @memberOf Stack
  3347. */
  3348. function stackClear() {
  3349. this.__data__ = new ListCache();
  3350. }
  3351. /**
  3352. * Removes `key` and its value from the stack.
  3353. *
  3354. * @private
  3355. * @name delete
  3356. * @memberOf Stack
  3357. * @param {string} key The key of the value to remove.
  3358. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3359. */
  3360. function stackDelete(key) {
  3361. return this.__data__['delete'](key);
  3362. }
  3363. /**
  3364. * Gets the stack value for `key`.
  3365. *
  3366. * @private
  3367. * @name get
  3368. * @memberOf Stack
  3369. * @param {string} key The key of the value to get.
  3370. * @returns {*} Returns the entry value.
  3371. */
  3372. function stackGet(key) {
  3373. return this.__data__.get(key);
  3374. }
  3375. /**
  3376. * Checks if a stack value for `key` exists.
  3377. *
  3378. * @private
  3379. * @name has
  3380. * @memberOf Stack
  3381. * @param {string} key The key of the entry to check.
  3382. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3383. */
  3384. function stackHas(key) {
  3385. return this.__data__.has(key);
  3386. }
  3387. /**
  3388. * Sets the stack `key` to `value`.
  3389. *
  3390. * @private
  3391. * @name set
  3392. * @memberOf Stack
  3393. * @param {string} key The key of the value to set.
  3394. * @param {*} value The value to set.
  3395. * @returns {Object} Returns the stack cache instance.
  3396. */
  3397. function stackSet(key, value) {
  3398. var cache = this.__data__;
  3399. if (cache instanceof ListCache) {
  3400. var pairs = cache.__data__;
  3401. if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
  3402. pairs.push([key, value]);
  3403. return this;
  3404. }
  3405. cache = this.__data__ = new MapCache(pairs);
  3406. }
  3407. cache.set(key, value);
  3408. return this;
  3409. }
  3410. // Add methods to `Stack`.
  3411. Stack.prototype.clear = stackClear;
  3412. Stack.prototype['delete'] = stackDelete;
  3413. Stack.prototype.get = stackGet;
  3414. Stack.prototype.has = stackHas;
  3415. Stack.prototype.set = stackSet;
  3416. /**
  3417. * Creates an array of the enumerable property names of the array-like `value`.
  3418. *
  3419. * @private
  3420. * @param {*} value The value to query.
  3421. * @param {boolean} inherited Specify returning inherited property names.
  3422. * @returns {Array} Returns the array of property names.
  3423. */
  3424. function arrayLikeKeys(value, inherited) {
  3425. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  3426. // Safari 9 makes `arguments.length` enumerable in strict mode.
  3427. var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
  3428. var length = result.length,
  3429. skipIndexes = !!length;
  3430. for (var key in value) {
  3431. if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
  3432. result.push(key);
  3433. }
  3434. }
  3435. return result;
  3436. }
  3437. /**
  3438. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3439. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3440. * for equality comparisons.
  3441. *
  3442. * @private
  3443. * @param {Object} object The object to modify.
  3444. * @param {string} key The key of the property to assign.
  3445. * @param {*} value The value to assign.
  3446. */
  3447. function assignValue(object, key, value) {
  3448. var objValue = object[key];
  3449. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) {
  3450. object[key] = value;
  3451. }
  3452. }
  3453. /**
  3454. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3455. *
  3456. * @private
  3457. * @param {Array} array The array to inspect.
  3458. * @param {*} key The key to search for.
  3459. * @returns {number} Returns the index of the matched value, else `-1`.
  3460. */
  3461. function assocIndexOf(array, key) {
  3462. var length = array.length;
  3463. while (length--) {
  3464. if (eq(array[length][0], key)) {
  3465. return length;
  3466. }
  3467. }
  3468. return -1;
  3469. }
  3470. /**
  3471. * The base implementation of `_.assign` without support for multiple sources
  3472. * or `customizer` functions.
  3473. *
  3474. * @private
  3475. * @param {Object} object The destination object.
  3476. * @param {Object} source The source object.
  3477. * @returns {Object} Returns `object`.
  3478. */
  3479. function baseAssign(object, source) {
  3480. return object && copyObject(source, keys(source), object);
  3481. }
  3482. /**
  3483. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3484. * traversed objects.
  3485. *
  3486. * @private
  3487. * @param {*} value The value to clone.
  3488. * @param {boolean} [isDeep] Specify a deep clone.
  3489. * @param {boolean} [isFull] Specify a clone including symbols.
  3490. * @param {Function} [customizer] The function to customize cloning.
  3491. * @param {string} [key] The key of `value`.
  3492. * @param {Object} [object] The parent object of `value`.
  3493. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3494. * @returns {*} Returns the cloned value.
  3495. */
  3496. function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
  3497. var result;
  3498. if (customizer) {
  3499. result = object ? customizer(value, key, object, stack) : customizer(value);
  3500. }
  3501. if (result !== undefined) {
  3502. return result;
  3503. }
  3504. if (!isObject(value)) {
  3505. return value;
  3506. }
  3507. var isArr = isArray(value);
  3508. if (isArr) {
  3509. result = initCloneArray(value);
  3510. if (!isDeep) {
  3511. return copyArray(value, result);
  3512. }
  3513. } else {
  3514. var tag = getTag(value),
  3515. isFunc = tag == funcTag || tag == genTag;
  3516. if (isBuffer(value)) {
  3517. return cloneBuffer(value, isDeep);
  3518. }
  3519. if (tag == objectTag || tag == argsTag || isFunc && !object) {
  3520. if (isHostObject(value)) {
  3521. return object ? value : {};
  3522. }
  3523. result = initCloneObject(isFunc ? {} : value);
  3524. if (!isDeep) {
  3525. return copySymbols(value, baseAssign(result, value));
  3526. }
  3527. } else {
  3528. if (!cloneableTags[tag]) {
  3529. return object ? value : {};
  3530. }
  3531. result = initCloneByTag(value, tag, baseClone, isDeep);
  3532. }
  3533. }
  3534. // Check for circular references and return its corresponding clone.
  3535. stack || (stack = new Stack());
  3536. var stacked = stack.get(value);
  3537. if (stacked) {
  3538. return stacked;
  3539. }
  3540. stack.set(value, result);
  3541. if (!isArr) {
  3542. var props = isFull ? getAllKeys(value) : keys(value);
  3543. }
  3544. arrayEach(props || value, function (subValue, key) {
  3545. if (props) {
  3546. key = subValue;
  3547. subValue = value[key];
  3548. }
  3549. // Recursively populate clone (susceptible to call stack limits).
  3550. assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
  3551. });
  3552. return result;
  3553. }
  3554. /**
  3555. * The base implementation of `_.create` without support for assigning
  3556. * properties to the created object.
  3557. *
  3558. * @private
  3559. * @param {Object} prototype The object to inherit from.
  3560. * @returns {Object} Returns the new object.
  3561. */
  3562. function baseCreate(proto) {
  3563. return isObject(proto) ? objectCreate(proto) : {};
  3564. }
  3565. /**
  3566. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3567. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3568. * symbols of `object`.
  3569. *
  3570. * @private
  3571. * @param {Object} object The object to query.
  3572. * @param {Function} keysFunc The function to get the keys of `object`.
  3573. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3574. * @returns {Array} Returns the array of property names and symbols.
  3575. */
  3576. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3577. var result = keysFunc(object);
  3578. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3579. }
  3580. /**
  3581. * The base implementation of `getTag`.
  3582. *
  3583. * @private
  3584. * @param {*} value The value to query.
  3585. * @returns {string} Returns the `toStringTag`.
  3586. */
  3587. function baseGetTag(value) {
  3588. return objectToString.call(value);
  3589. }
  3590. /**
  3591. * The base implementation of `_.isNative` without bad shim checks.
  3592. *
  3593. * @private
  3594. * @param {*} value The value to check.
  3595. * @returns {boolean} Returns `true` if `value` is a native function,
  3596. * else `false`.
  3597. */
  3598. function baseIsNative(value) {
  3599. if (!isObject(value) || isMasked(value)) {
  3600. return false;
  3601. }
  3602. var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
  3603. return pattern.test(toSource(value));
  3604. }
  3605. /**
  3606. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  3607. *
  3608. * @private
  3609. * @param {Object} object The object to query.
  3610. * @returns {Array} Returns the array of property names.
  3611. */
  3612. function baseKeys(object) {
  3613. if (!isPrototype(object)) {
  3614. return nativeKeys(object);
  3615. }
  3616. var result = [];
  3617. for (var key in Object(object)) {
  3618. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  3619. result.push(key);
  3620. }
  3621. }
  3622. return result;
  3623. }
  3624. /**
  3625. * Creates a clone of `buffer`.
  3626. *
  3627. * @private
  3628. * @param {Buffer} buffer The buffer to clone.
  3629. * @param {boolean} [isDeep] Specify a deep clone.
  3630. * @returns {Buffer} Returns the cloned buffer.
  3631. */
  3632. function cloneBuffer(buffer, isDeep) {
  3633. if (isDeep) {
  3634. return buffer.slice();
  3635. }
  3636. var result = new buffer.constructor(buffer.length);
  3637. buffer.copy(result);
  3638. return result;
  3639. }
  3640. /**
  3641. * Creates a clone of `arrayBuffer`.
  3642. *
  3643. * @private
  3644. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  3645. * @returns {ArrayBuffer} Returns the cloned array buffer.
  3646. */
  3647. function cloneArrayBuffer(arrayBuffer) {
  3648. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  3649. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  3650. return result;
  3651. }
  3652. /**
  3653. * Creates a clone of `dataView`.
  3654. *
  3655. * @private
  3656. * @param {Object} dataView The data view to clone.
  3657. * @param {boolean} [isDeep] Specify a deep clone.
  3658. * @returns {Object} Returns the cloned data view.
  3659. */
  3660. function cloneDataView(dataView, isDeep) {
  3661. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  3662. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  3663. }
  3664. /**
  3665. * Creates a clone of `map`.
  3666. *
  3667. * @private
  3668. * @param {Object} map The map to clone.
  3669. * @param {Function} cloneFunc The function to clone values.
  3670. * @param {boolean} [isDeep] Specify a deep clone.
  3671. * @returns {Object} Returns the cloned map.
  3672. */
  3673. function cloneMap(map, isDeep, cloneFunc) {
  3674. var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);
  3675. return arrayReduce(array, addMapEntry, new map.constructor());
  3676. }
  3677. /**
  3678. * Creates a clone of `regexp`.
  3679. *
  3680. * @private
  3681. * @param {Object} regexp The regexp to clone.
  3682. * @returns {Object} Returns the cloned regexp.
  3683. */
  3684. function cloneRegExp(regexp) {
  3685. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  3686. result.lastIndex = regexp.lastIndex;
  3687. return result;
  3688. }
  3689. /**
  3690. * Creates a clone of `set`.
  3691. *
  3692. * @private
  3693. * @param {Object} set The set to clone.
  3694. * @param {Function} cloneFunc The function to clone values.
  3695. * @param {boolean} [isDeep] Specify a deep clone.
  3696. * @returns {Object} Returns the cloned set.
  3697. */
  3698. function cloneSet(set, isDeep, cloneFunc) {
  3699. var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);
  3700. return arrayReduce(array, addSetEntry, new set.constructor());
  3701. }
  3702. /**
  3703. * Creates a clone of the `symbol` object.
  3704. *
  3705. * @private
  3706. * @param {Object} symbol The symbol object to clone.
  3707. * @returns {Object} Returns the cloned symbol object.
  3708. */
  3709. function cloneSymbol(symbol) {
  3710. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  3711. }
  3712. /**
  3713. * Creates a clone of `typedArray`.
  3714. *
  3715. * @private
  3716. * @param {Object} typedArray The typed array to clone.
  3717. * @param {boolean} [isDeep] Specify a deep clone.
  3718. * @returns {Object} Returns the cloned typed array.
  3719. */
  3720. function cloneTypedArray(typedArray, isDeep) {
  3721. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  3722. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  3723. }
  3724. /**
  3725. * Copies the values of `source` to `array`.
  3726. *
  3727. * @private
  3728. * @param {Array} source The array to copy values from.
  3729. * @param {Array} [array=[]] The array to copy values to.
  3730. * @returns {Array} Returns `array`.
  3731. */
  3732. function copyArray(source, array) {
  3733. var index = -1,
  3734. length = source.length;
  3735. array || (array = Array(length));
  3736. while (++index < length) {
  3737. array[index] = source[index];
  3738. }
  3739. return array;
  3740. }
  3741. /**
  3742. * Copies properties of `source` to `object`.
  3743. *
  3744. * @private
  3745. * @param {Object} source The object to copy properties from.
  3746. * @param {Array} props The property identifiers to copy.
  3747. * @param {Object} [object={}] The object to copy properties to.
  3748. * @param {Function} [customizer] The function to customize copied values.
  3749. * @returns {Object} Returns `object`.
  3750. */
  3751. function copyObject(source, props, object, customizer) {
  3752. object || (object = {});
  3753. var index = -1,
  3754. length = props.length;
  3755. while (++index < length) {
  3756. var key = props[index];
  3757. var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined;
  3758. assignValue(object, key, newValue === undefined ? source[key] : newValue);
  3759. }
  3760. return object;
  3761. }
  3762. /**
  3763. * Copies own symbol properties of `source` to `object`.
  3764. *
  3765. * @private
  3766. * @param {Object} source The object to copy symbols from.
  3767. * @param {Object} [object={}] The object to copy symbols to.
  3768. * @returns {Object} Returns `object`.
  3769. */
  3770. function copySymbols(source, object) {
  3771. return copyObject(source, getSymbols(source), object);
  3772. }
  3773. /**
  3774. * Creates an array of own enumerable property names and symbols of `object`.
  3775. *
  3776. * @private
  3777. * @param {Object} object The object to query.
  3778. * @returns {Array} Returns the array of property names and symbols.
  3779. */
  3780. function getAllKeys(object) {
  3781. return baseGetAllKeys(object, keys, getSymbols);
  3782. }
  3783. /**
  3784. * Gets the data for `map`.
  3785. *
  3786. * @private
  3787. * @param {Object} map The map to query.
  3788. * @param {string} key The reference key.
  3789. * @returns {*} Returns the map data.
  3790. */
  3791. function getMapData(map, key) {
  3792. var data = map.__data__;
  3793. return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
  3794. }
  3795. /**
  3796. * Gets the native function at `key` of `object`.
  3797. *
  3798. * @private
  3799. * @param {Object} object The object to query.
  3800. * @param {string} key The key of the method to get.
  3801. * @returns {*} Returns the function if it's native, else `undefined`.
  3802. */
  3803. function getNative(object, key) {
  3804. var value = getValue(object, key);
  3805. return baseIsNative(value) ? value : undefined;
  3806. }
  3807. /**
  3808. * Creates an array of the own enumerable symbol properties of `object`.
  3809. *
  3810. * @private
  3811. * @param {Object} object The object to query.
  3812. * @returns {Array} Returns the array of symbols.
  3813. */
  3814. var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
  3815. /**
  3816. * Gets the `toStringTag` of `value`.
  3817. *
  3818. * @private
  3819. * @param {*} value The value to query.
  3820. * @returns {string} Returns the `toStringTag`.
  3821. */
  3822. var getTag = baseGetTag;
  3823. // Fallback for data views, maps, sets, and weak maps in IE 11,
  3824. // for data views in Edge < 14, and promises in Node.js.
  3825. if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
  3826. getTag = function getTag(value) {
  3827. var result = objectToString.call(value),
  3828. Ctor = result == objectTag ? value.constructor : undefined,
  3829. ctorString = Ctor ? toSource(Ctor) : undefined;
  3830. if (ctorString) {
  3831. switch (ctorString) {
  3832. case dataViewCtorString:
  3833. return dataViewTag;
  3834. case mapCtorString:
  3835. return mapTag;
  3836. case promiseCtorString:
  3837. return promiseTag;
  3838. case setCtorString:
  3839. return setTag;
  3840. case weakMapCtorString:
  3841. return weakMapTag;
  3842. }
  3843. }
  3844. return result;
  3845. };
  3846. }
  3847. /**
  3848. * Initializes an array clone.
  3849. *
  3850. * @private
  3851. * @param {Array} array The array to clone.
  3852. * @returns {Array} Returns the initialized clone.
  3853. */
  3854. function initCloneArray(array) {
  3855. var length = array.length,
  3856. result = array.constructor(length);
  3857. // Add properties assigned by `RegExp#exec`.
  3858. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  3859. result.index = array.index;
  3860. result.input = array.input;
  3861. }
  3862. return result;
  3863. }
  3864. /**
  3865. * Initializes an object clone.
  3866. *
  3867. * @private
  3868. * @param {Object} object The object to clone.
  3869. * @returns {Object} Returns the initialized clone.
  3870. */
  3871. function initCloneObject(object) {
  3872. return typeof object.constructor == 'function' && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
  3873. }
  3874. /**
  3875. * Initializes an object clone based on its `toStringTag`.
  3876. *
  3877. * **Note:** This function only supports cloning values with tags of
  3878. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  3879. *
  3880. * @private
  3881. * @param {Object} object The object to clone.
  3882. * @param {string} tag The `toStringTag` of the object to clone.
  3883. * @param {Function} cloneFunc The function to clone values.
  3884. * @param {boolean} [isDeep] Specify a deep clone.
  3885. * @returns {Object} Returns the initialized clone.
  3886. */
  3887. function initCloneByTag(object, tag, cloneFunc, isDeep) {
  3888. var Ctor = object.constructor;
  3889. switch (tag) {
  3890. case arrayBufferTag:
  3891. return cloneArrayBuffer(object);
  3892. case boolTag:
  3893. case dateTag:
  3894. return new Ctor(+object);
  3895. case dataViewTag:
  3896. return cloneDataView(object, isDeep);
  3897. case float32Tag:
  3898. case float64Tag:
  3899. case int8Tag:
  3900. case int16Tag:
  3901. case int32Tag:
  3902. case uint8Tag:
  3903. case uint8ClampedTag:
  3904. case uint16Tag:
  3905. case uint32Tag:
  3906. return cloneTypedArray(object, isDeep);
  3907. case mapTag:
  3908. return cloneMap(object, isDeep, cloneFunc);
  3909. case numberTag:
  3910. case stringTag:
  3911. return new Ctor(object);
  3912. case regexpTag:
  3913. return cloneRegExp(object);
  3914. case setTag:
  3915. return cloneSet(object, isDeep, cloneFunc);
  3916. case symbolTag:
  3917. return cloneSymbol(object);
  3918. }
  3919. }
  3920. /**
  3921. * Checks if `value` is a valid array-like index.
  3922. *
  3923. * @private
  3924. * @param {*} value The value to check.
  3925. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  3926. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  3927. */
  3928. function isIndex(value, length) {
  3929. length = length == null ? MAX_SAFE_INTEGER : length;
  3930. return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
  3931. }
  3932. /**
  3933. * Checks if `value` is suitable for use as unique object key.
  3934. *
  3935. * @private
  3936. * @param {*} value The value to check.
  3937. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  3938. */
  3939. function isKeyable(value) {
  3940. var type = _typeof(value);
  3941. return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
  3942. }
  3943. /**
  3944. * Checks if `func` has its source masked.
  3945. *
  3946. * @private
  3947. * @param {Function} func The function to check.
  3948. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  3949. */
  3950. function isMasked(func) {
  3951. return !!maskSrcKey && maskSrcKey in func;
  3952. }
  3953. /**
  3954. * Checks if `value` is likely a prototype object.
  3955. *
  3956. * @private
  3957. * @param {*} value The value to check.
  3958. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  3959. */
  3960. function isPrototype(value) {
  3961. var Ctor = value && value.constructor,
  3962. proto = typeof Ctor == 'function' && Ctor.prototype || objectProto;
  3963. return value === proto;
  3964. }
  3965. /**
  3966. * Converts `func` to its source code.
  3967. *
  3968. * @private
  3969. * @param {Function} func The function to process.
  3970. * @returns {string} Returns the source code.
  3971. */
  3972. function toSource(func) {
  3973. if (func != null) {
  3974. try {
  3975. return funcToString.call(func);
  3976. } catch (e) {}
  3977. try {
  3978. return func + '';
  3979. } catch (e) {}
  3980. }
  3981. return '';
  3982. }
  3983. /**
  3984. * This method is like `_.clone` except that it recursively clones `value`.
  3985. *
  3986. * @static
  3987. * @memberOf _
  3988. * @since 1.0.0
  3989. * @category Lang
  3990. * @param {*} value The value to recursively clone.
  3991. * @returns {*} Returns the deep cloned value.
  3992. * @see _.clone
  3993. * @example
  3994. *
  3995. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  3996. *
  3997. * var deep = _.cloneDeep(objects);
  3998. * console.log(deep[0] === objects[0]);
  3999. * // => false
  4000. */
  4001. function cloneDeep(value) {
  4002. return baseClone(value, true, true);
  4003. }
  4004. /**
  4005. * Performs a
  4006. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  4007. * comparison between two values to determine if they are equivalent.
  4008. *
  4009. * @static
  4010. * @memberOf _
  4011. * @since 4.0.0
  4012. * @category Lang
  4013. * @param {*} value The value to compare.
  4014. * @param {*} other The other value to compare.
  4015. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4016. * @example
  4017. *
  4018. * var object = { 'a': 1 };
  4019. * var other = { 'a': 1 };
  4020. *
  4021. * _.eq(object, object);
  4022. * // => true
  4023. *
  4024. * _.eq(object, other);
  4025. * // => false
  4026. *
  4027. * _.eq('a', 'a');
  4028. * // => true
  4029. *
  4030. * _.eq('a', Object('a'));
  4031. * // => false
  4032. *
  4033. * _.eq(NaN, NaN);
  4034. * // => true
  4035. */
  4036. function eq(value, other) {
  4037. return value === other || value !== value && other !== other;
  4038. }
  4039. /**
  4040. * Checks if `value` is likely an `arguments` object.
  4041. *
  4042. * @static
  4043. * @memberOf _
  4044. * @since 0.1.0
  4045. * @category Lang
  4046. * @param {*} value The value to check.
  4047. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4048. * else `false`.
  4049. * @example
  4050. *
  4051. * _.isArguments(function() { return arguments; }());
  4052. * // => true
  4053. *
  4054. * _.isArguments([1, 2, 3]);
  4055. * // => false
  4056. */
  4057. function isArguments(value) {
  4058. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  4059. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
  4060. }
  4061. /**
  4062. * Checks if `value` is classified as an `Array` object.
  4063. *
  4064. * @static
  4065. * @memberOf _
  4066. * @since 0.1.0
  4067. * @category Lang
  4068. * @param {*} value The value to check.
  4069. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  4070. * @example
  4071. *
  4072. * _.isArray([1, 2, 3]);
  4073. * // => true
  4074. *
  4075. * _.isArray(document.body.children);
  4076. * // => false
  4077. *
  4078. * _.isArray('abc');
  4079. * // => false
  4080. *
  4081. * _.isArray(_.noop);
  4082. * // => false
  4083. */
  4084. var isArray = Array.isArray;
  4085. /**
  4086. * Checks if `value` is array-like. A value is considered array-like if it's
  4087. * not a function and has a `value.length` that's an integer greater than or
  4088. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  4089. *
  4090. * @static
  4091. * @memberOf _
  4092. * @since 4.0.0
  4093. * @category Lang
  4094. * @param {*} value The value to check.
  4095. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  4096. * @example
  4097. *
  4098. * _.isArrayLike([1, 2, 3]);
  4099. * // => true
  4100. *
  4101. * _.isArrayLike(document.body.children);
  4102. * // => true
  4103. *
  4104. * _.isArrayLike('abc');
  4105. * // => true
  4106. *
  4107. * _.isArrayLike(_.noop);
  4108. * // => false
  4109. */
  4110. function isArrayLike(value) {
  4111. return value != null && isLength(value.length) && !isFunction(value);
  4112. }
  4113. /**
  4114. * This method is like `_.isArrayLike` except that it also checks if `value`
  4115. * is an object.
  4116. *
  4117. * @static
  4118. * @memberOf _
  4119. * @since 4.0.0
  4120. * @category Lang
  4121. * @param {*} value The value to check.
  4122. * @returns {boolean} Returns `true` if `value` is an array-like object,
  4123. * else `false`.
  4124. * @example
  4125. *
  4126. * _.isArrayLikeObject([1, 2, 3]);
  4127. * // => true
  4128. *
  4129. * _.isArrayLikeObject(document.body.children);
  4130. * // => true
  4131. *
  4132. * _.isArrayLikeObject('abc');
  4133. * // => false
  4134. *
  4135. * _.isArrayLikeObject(_.noop);
  4136. * // => false
  4137. */
  4138. function isArrayLikeObject(value) {
  4139. return isObjectLike(value) && isArrayLike(value);
  4140. }
  4141. /**
  4142. * Checks if `value` is a buffer.
  4143. *
  4144. * @static
  4145. * @memberOf _
  4146. * @since 4.3.0
  4147. * @category Lang
  4148. * @param {*} value The value to check.
  4149. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  4150. * @example
  4151. *
  4152. * _.isBuffer(new Buffer(2));
  4153. * // => true
  4154. *
  4155. * _.isBuffer(new Uint8Array(2));
  4156. * // => false
  4157. */
  4158. var isBuffer = nativeIsBuffer || stubFalse;
  4159. /**
  4160. * Checks if `value` is classified as a `Function` object.
  4161. *
  4162. * @static
  4163. * @memberOf _
  4164. * @since 0.1.0
  4165. * @category Lang
  4166. * @param {*} value The value to check.
  4167. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  4168. * @example
  4169. *
  4170. * _.isFunction(_);
  4171. * // => true
  4172. *
  4173. * _.isFunction(/abc/);
  4174. * // => false
  4175. */
  4176. function isFunction(value) {
  4177. // The use of `Object#toString` avoids issues with the `typeof` operator
  4178. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  4179. var tag = isObject(value) ? objectToString.call(value) : '';
  4180. return tag == funcTag || tag == genTag;
  4181. }
  4182. /**
  4183. * Checks if `value` is a valid array-like length.
  4184. *
  4185. * **Note:** This method is loosely based on
  4186. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  4187. *
  4188. * @static
  4189. * @memberOf _
  4190. * @since 4.0.0
  4191. * @category Lang
  4192. * @param {*} value The value to check.
  4193. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  4194. * @example
  4195. *
  4196. * _.isLength(3);
  4197. * // => true
  4198. *
  4199. * _.isLength(Number.MIN_VALUE);
  4200. * // => false
  4201. *
  4202. * _.isLength(Infinity);
  4203. * // => false
  4204. *
  4205. * _.isLength('3');
  4206. * // => false
  4207. */
  4208. function isLength(value) {
  4209. return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  4210. }
  4211. /**
  4212. * Checks if `value` is the
  4213. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  4214. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  4215. *
  4216. * @static
  4217. * @memberOf _
  4218. * @since 0.1.0
  4219. * @category Lang
  4220. * @param {*} value The value to check.
  4221. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  4222. * @example
  4223. *
  4224. * _.isObject({});
  4225. * // => true
  4226. *
  4227. * _.isObject([1, 2, 3]);
  4228. * // => true
  4229. *
  4230. * _.isObject(_.noop);
  4231. * // => true
  4232. *
  4233. * _.isObject(null);
  4234. * // => false
  4235. */
  4236. function isObject(value) {
  4237. var type = _typeof(value);
  4238. return !!value && (type == 'object' || type == 'function');
  4239. }
  4240. /**
  4241. * Checks if `value` is object-like. A value is object-like if it's not `null`
  4242. * and has a `typeof` result of "object".
  4243. *
  4244. * @static
  4245. * @memberOf _
  4246. * @since 4.0.0
  4247. * @category Lang
  4248. * @param {*} value The value to check.
  4249. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  4250. * @example
  4251. *
  4252. * _.isObjectLike({});
  4253. * // => true
  4254. *
  4255. * _.isObjectLike([1, 2, 3]);
  4256. * // => true
  4257. *
  4258. * _.isObjectLike(_.noop);
  4259. * // => false
  4260. *
  4261. * _.isObjectLike(null);
  4262. * // => false
  4263. */
  4264. function isObjectLike(value) {
  4265. return !!value && _typeof(value) == 'object';
  4266. }
  4267. /**
  4268. * Creates an array of the own enumerable property names of `object`.
  4269. *
  4270. * **Note:** Non-object values are coerced to objects. See the
  4271. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  4272. * for more details.
  4273. *
  4274. * @static
  4275. * @since 0.1.0
  4276. * @memberOf _
  4277. * @category Object
  4278. * @param {Object} object The object to query.
  4279. * @returns {Array} Returns the array of property names.
  4280. * @example
  4281. *
  4282. * function Foo() {
  4283. * this.a = 1;
  4284. * this.b = 2;
  4285. * }
  4286. *
  4287. * Foo.prototype.c = 3;
  4288. *
  4289. * _.keys(new Foo);
  4290. * // => ['a', 'b'] (iteration order is not guaranteed)
  4291. *
  4292. * _.keys('hi');
  4293. * // => ['0', '1']
  4294. */
  4295. function keys(object) {
  4296. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  4297. }
  4298. /**
  4299. * This method returns a new empty array.
  4300. *
  4301. * @static
  4302. * @memberOf _
  4303. * @since 4.13.0
  4304. * @category Util
  4305. * @returns {Array} Returns the new empty array.
  4306. * @example
  4307. *
  4308. * var arrays = _.times(2, _.stubArray);
  4309. *
  4310. * console.log(arrays);
  4311. * // => [[], []]
  4312. *
  4313. * console.log(arrays[0] === arrays[1]);
  4314. * // => false
  4315. */
  4316. function stubArray() {
  4317. return [];
  4318. }
  4319. /**
  4320. * This method returns `false`.
  4321. *
  4322. * @static
  4323. * @memberOf _
  4324. * @since 4.13.0
  4325. * @category Util
  4326. * @returns {boolean} Returns `false`.
  4327. * @example
  4328. *
  4329. * _.times(2, _.stubFalse);
  4330. * // => [false, false]
  4331. */
  4332. function stubFalse() {
  4333. return false;
  4334. }
  4335. module.exports = cloneDeep;
  4336. /***/ }),
  4337. /***/ 4940:
  4338. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  4339. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  4340. /**
  4341. * lodash (Custom Build) <https://lodash.com/>
  4342. * Build: `lodash modularize exports="npm" -o ./`
  4343. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  4344. * Released under MIT license <https://lodash.com/license>
  4345. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  4346. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  4347. */
  4348. /** Used as the size to enable large array optimizations. */
  4349. var LARGE_ARRAY_SIZE = 200;
  4350. /** Used to stand-in for `undefined` hash values. */
  4351. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  4352. /** Used as references for various `Number` constants. */
  4353. var MAX_SAFE_INTEGER = 9007199254740991;
  4354. /** `Object#toString` result references. */
  4355. var argsTag = '[object Arguments]',
  4356. funcTag = '[object Function]',
  4357. genTag = '[object GeneratorFunction]';
  4358. /**
  4359. * Used to match `RegExp`
  4360. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  4361. */
  4362. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  4363. /** Used to detect host constructors (Safari). */
  4364. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  4365. /** Detect free variable `global` from Node.js. */
  4366. var freeGlobal = (typeof __webpack_require__.g === "undefined" ? "undefined" : _typeof(__webpack_require__.g)) == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  4367. /** Detect free variable `self`. */
  4368. var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
  4369. /** Used as a reference to the global object. */
  4370. var root = freeGlobal || freeSelf || Function('return this')();
  4371. /**
  4372. * A faster alternative to `Function#apply`, this function invokes `func`
  4373. * with the `this` binding of `thisArg` and the arguments of `args`.
  4374. *
  4375. * @private
  4376. * @param {Function} func The function to invoke.
  4377. * @param {*} thisArg The `this` binding of `func`.
  4378. * @param {Array} args The arguments to invoke `func` with.
  4379. * @returns {*} Returns the result of `func`.
  4380. */
  4381. function apply(func, thisArg, args) {
  4382. switch (args.length) {
  4383. case 0:
  4384. return func.call(thisArg);
  4385. case 1:
  4386. return func.call(thisArg, args[0]);
  4387. case 2:
  4388. return func.call(thisArg, args[0], args[1]);
  4389. case 3:
  4390. return func.call(thisArg, args[0], args[1], args[2]);
  4391. }
  4392. return func.apply(thisArg, args);
  4393. }
  4394. /**
  4395. * A specialized version of `_.includes` for arrays without support for
  4396. * specifying an index to search from.
  4397. *
  4398. * @private
  4399. * @param {Array} [array] The array to inspect.
  4400. * @param {*} target The value to search for.
  4401. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  4402. */
  4403. function arrayIncludes(array, value) {
  4404. var length = array ? array.length : 0;
  4405. return !!length && baseIndexOf(array, value, 0) > -1;
  4406. }
  4407. /**
  4408. * This function is like `arrayIncludes` except that it accepts a comparator.
  4409. *
  4410. * @private
  4411. * @param {Array} [array] The array to inspect.
  4412. * @param {*} target The value to search for.
  4413. * @param {Function} comparator The comparator invoked per element.
  4414. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  4415. */
  4416. function arrayIncludesWith(array, value, comparator) {
  4417. var index = -1,
  4418. length = array ? array.length : 0;
  4419. while (++index < length) {
  4420. if (comparator(value, array[index])) {
  4421. return true;
  4422. }
  4423. }
  4424. return false;
  4425. }
  4426. /**
  4427. * A specialized version of `_.map` for arrays without support for iteratee
  4428. * shorthands.
  4429. *
  4430. * @private
  4431. * @param {Array} [array] The array to iterate over.
  4432. * @param {Function} iteratee The function invoked per iteration.
  4433. * @returns {Array} Returns the new mapped array.
  4434. */
  4435. function arrayMap(array, iteratee) {
  4436. var index = -1,
  4437. length = array ? array.length : 0,
  4438. result = Array(length);
  4439. while (++index < length) {
  4440. result[index] = iteratee(array[index], index, array);
  4441. }
  4442. return result;
  4443. }
  4444. /**
  4445. * Appends the elements of `values` to `array`.
  4446. *
  4447. * @private
  4448. * @param {Array} array The array to modify.
  4449. * @param {Array} values The values to append.
  4450. * @returns {Array} Returns `array`.
  4451. */
  4452. function arrayPush(array, values) {
  4453. var index = -1,
  4454. length = values.length,
  4455. offset = array.length;
  4456. while (++index < length) {
  4457. array[offset + index] = values[index];
  4458. }
  4459. return array;
  4460. }
  4461. /**
  4462. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  4463. * support for iteratee shorthands.
  4464. *
  4465. * @private
  4466. * @param {Array} array The array to inspect.
  4467. * @param {Function} predicate The function invoked per iteration.
  4468. * @param {number} fromIndex The index to search from.
  4469. * @param {boolean} [fromRight] Specify iterating from right to left.
  4470. * @returns {number} Returns the index of the matched value, else `-1`.
  4471. */
  4472. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  4473. var length = array.length,
  4474. index = fromIndex + (fromRight ? 1 : -1);
  4475. while (fromRight ? index-- : ++index < length) {
  4476. if (predicate(array[index], index, array)) {
  4477. return index;
  4478. }
  4479. }
  4480. return -1;
  4481. }
  4482. /**
  4483. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  4484. *
  4485. * @private
  4486. * @param {Array} array The array to inspect.
  4487. * @param {*} value The value to search for.
  4488. * @param {number} fromIndex The index to search from.
  4489. * @returns {number} Returns the index of the matched value, else `-1`.
  4490. */
  4491. function baseIndexOf(array, value, fromIndex) {
  4492. if (value !== value) {
  4493. return baseFindIndex(array, baseIsNaN, fromIndex);
  4494. }
  4495. var index = fromIndex - 1,
  4496. length = array.length;
  4497. while (++index < length) {
  4498. if (array[index] === value) {
  4499. return index;
  4500. }
  4501. }
  4502. return -1;
  4503. }
  4504. /**
  4505. * The base implementation of `_.isNaN` without support for number objects.
  4506. *
  4507. * @private
  4508. * @param {*} value The value to check.
  4509. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  4510. */
  4511. function baseIsNaN(value) {
  4512. return value !== value;
  4513. }
  4514. /**
  4515. * The base implementation of `_.unary` without support for storing metadata.
  4516. *
  4517. * @private
  4518. * @param {Function} func The function to cap arguments for.
  4519. * @returns {Function} Returns the new capped function.
  4520. */
  4521. function baseUnary(func) {
  4522. return function (value) {
  4523. return func(value);
  4524. };
  4525. }
  4526. /**
  4527. * Checks if a cache value for `key` exists.
  4528. *
  4529. * @private
  4530. * @param {Object} cache The cache to query.
  4531. * @param {string} key The key of the entry to check.
  4532. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  4533. */
  4534. function cacheHas(cache, key) {
  4535. return cache.has(key);
  4536. }
  4537. /**
  4538. * Gets the value at `key` of `object`.
  4539. *
  4540. * @private
  4541. * @param {Object} [object] The object to query.
  4542. * @param {string} key The key of the property to get.
  4543. * @returns {*} Returns the property value.
  4544. */
  4545. function getValue(object, key) {
  4546. return object == null ? undefined : object[key];
  4547. }
  4548. /**
  4549. * Checks if `value` is a host object in IE < 9.
  4550. *
  4551. * @private
  4552. * @param {*} value The value to check.
  4553. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  4554. */
  4555. function isHostObject(value) {
  4556. // Many host objects are `Object` objects that can coerce to strings
  4557. // despite having improperly defined `toString` methods.
  4558. var result = false;
  4559. if (value != null && typeof value.toString != 'function') {
  4560. try {
  4561. result = !!(value + '');
  4562. } catch (e) {}
  4563. }
  4564. return result;
  4565. }
  4566. /** Used for built-in method references. */
  4567. var arrayProto = Array.prototype,
  4568. funcProto = Function.prototype,
  4569. objectProto = Object.prototype;
  4570. /** Used to detect overreaching core-js shims. */
  4571. var coreJsData = root['__core-js_shared__'];
  4572. /** Used to detect methods masquerading as native. */
  4573. var maskSrcKey = function () {
  4574. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  4575. return uid ? 'Symbol(src)_1.' + uid : '';
  4576. }();
  4577. /** Used to resolve the decompiled source of functions. */
  4578. var funcToString = funcProto.toString;
  4579. /** Used to check objects for own properties. */
  4580. var hasOwnProperty = objectProto.hasOwnProperty;
  4581. /**
  4582. * Used to resolve the
  4583. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  4584. * of values.
  4585. */
  4586. var objectToString = objectProto.toString;
  4587. /** Used to detect if a method is native. */
  4588. var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
  4589. /** Built-in value references. */
  4590. var _Symbol = root.Symbol,
  4591. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  4592. splice = arrayProto.splice,
  4593. spreadableSymbol = _Symbol ? _Symbol.isConcatSpreadable : undefined;
  4594. /* Built-in method references for those with the same name as other `lodash` methods. */
  4595. var nativeMax = Math.max;
  4596. /* Built-in method references that are verified to be native. */
  4597. var Map = getNative(root, 'Map'),
  4598. nativeCreate = getNative(Object, 'create');
  4599. /**
  4600. * Creates a hash object.
  4601. *
  4602. * @private
  4603. * @constructor
  4604. * @param {Array} [entries] The key-value pairs to cache.
  4605. */
  4606. function Hash(entries) {
  4607. var index = -1,
  4608. length = entries ? entries.length : 0;
  4609. this.clear();
  4610. while (++index < length) {
  4611. var entry = entries[index];
  4612. this.set(entry[0], entry[1]);
  4613. }
  4614. }
  4615. /**
  4616. * Removes all key-value entries from the hash.
  4617. *
  4618. * @private
  4619. * @name clear
  4620. * @memberOf Hash
  4621. */
  4622. function hashClear() {
  4623. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  4624. }
  4625. /**
  4626. * Removes `key` and its value from the hash.
  4627. *
  4628. * @private
  4629. * @name delete
  4630. * @memberOf Hash
  4631. * @param {Object} hash The hash to modify.
  4632. * @param {string} key The key of the value to remove.
  4633. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  4634. */
  4635. function hashDelete(key) {
  4636. return this.has(key) && delete this.__data__[key];
  4637. }
  4638. /**
  4639. * Gets the hash value for `key`.
  4640. *
  4641. * @private
  4642. * @name get
  4643. * @memberOf Hash
  4644. * @param {string} key The key of the value to get.
  4645. * @returns {*} Returns the entry value.
  4646. */
  4647. function hashGet(key) {
  4648. var data = this.__data__;
  4649. if (nativeCreate) {
  4650. var result = data[key];
  4651. return result === HASH_UNDEFINED ? undefined : result;
  4652. }
  4653. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  4654. }
  4655. /**
  4656. * Checks if a hash value for `key` exists.
  4657. *
  4658. * @private
  4659. * @name has
  4660. * @memberOf Hash
  4661. * @param {string} key The key of the entry to check.
  4662. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  4663. */
  4664. function hashHas(key) {
  4665. var data = this.__data__;
  4666. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  4667. }
  4668. /**
  4669. * Sets the hash `key` to `value`.
  4670. *
  4671. * @private
  4672. * @name set
  4673. * @memberOf Hash
  4674. * @param {string} key The key of the value to set.
  4675. * @param {*} value The value to set.
  4676. * @returns {Object} Returns the hash instance.
  4677. */
  4678. function hashSet(key, value) {
  4679. var data = this.__data__;
  4680. data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
  4681. return this;
  4682. }
  4683. // Add methods to `Hash`.
  4684. Hash.prototype.clear = hashClear;
  4685. Hash.prototype['delete'] = hashDelete;
  4686. Hash.prototype.get = hashGet;
  4687. Hash.prototype.has = hashHas;
  4688. Hash.prototype.set = hashSet;
  4689. /**
  4690. * Creates an list cache object.
  4691. *
  4692. * @private
  4693. * @constructor
  4694. * @param {Array} [entries] The key-value pairs to cache.
  4695. */
  4696. function ListCache(entries) {
  4697. var index = -1,
  4698. length = entries ? entries.length : 0;
  4699. this.clear();
  4700. while (++index < length) {
  4701. var entry = entries[index];
  4702. this.set(entry[0], entry[1]);
  4703. }
  4704. }
  4705. /**
  4706. * Removes all key-value entries from the list cache.
  4707. *
  4708. * @private
  4709. * @name clear
  4710. * @memberOf ListCache
  4711. */
  4712. function listCacheClear() {
  4713. this.__data__ = [];
  4714. }
  4715. /**
  4716. * Removes `key` and its value from the list cache.
  4717. *
  4718. * @private
  4719. * @name delete
  4720. * @memberOf ListCache
  4721. * @param {string} key The key of the value to remove.
  4722. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  4723. */
  4724. function listCacheDelete(key) {
  4725. var data = this.__data__,
  4726. index = assocIndexOf(data, key);
  4727. if (index < 0) {
  4728. return false;
  4729. }
  4730. var lastIndex = data.length - 1;
  4731. if (index == lastIndex) {
  4732. data.pop();
  4733. } else {
  4734. splice.call(data, index, 1);
  4735. }
  4736. return true;
  4737. }
  4738. /**
  4739. * Gets the list cache value for `key`.
  4740. *
  4741. * @private
  4742. * @name get
  4743. * @memberOf ListCache
  4744. * @param {string} key The key of the value to get.
  4745. * @returns {*} Returns the entry value.
  4746. */
  4747. function listCacheGet(key) {
  4748. var data = this.__data__,
  4749. index = assocIndexOf(data, key);
  4750. return index < 0 ? undefined : data[index][1];
  4751. }
  4752. /**
  4753. * Checks if a list cache value for `key` exists.
  4754. *
  4755. * @private
  4756. * @name has
  4757. * @memberOf ListCache
  4758. * @param {string} key The key of the entry to check.
  4759. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  4760. */
  4761. function listCacheHas(key) {
  4762. return assocIndexOf(this.__data__, key) > -1;
  4763. }
  4764. /**
  4765. * Sets the list cache `key` to `value`.
  4766. *
  4767. * @private
  4768. * @name set
  4769. * @memberOf ListCache
  4770. * @param {string} key The key of the value to set.
  4771. * @param {*} value The value to set.
  4772. * @returns {Object} Returns the list cache instance.
  4773. */
  4774. function listCacheSet(key, value) {
  4775. var data = this.__data__,
  4776. index = assocIndexOf(data, key);
  4777. if (index < 0) {
  4778. data.push([key, value]);
  4779. } else {
  4780. data[index][1] = value;
  4781. }
  4782. return this;
  4783. }
  4784. // Add methods to `ListCache`.
  4785. ListCache.prototype.clear = listCacheClear;
  4786. ListCache.prototype['delete'] = listCacheDelete;
  4787. ListCache.prototype.get = listCacheGet;
  4788. ListCache.prototype.has = listCacheHas;
  4789. ListCache.prototype.set = listCacheSet;
  4790. /**
  4791. * Creates a map cache object to store key-value pairs.
  4792. *
  4793. * @private
  4794. * @constructor
  4795. * @param {Array} [entries] The key-value pairs to cache.
  4796. */
  4797. function MapCache(entries) {
  4798. var index = -1,
  4799. length = entries ? entries.length : 0;
  4800. this.clear();
  4801. while (++index < length) {
  4802. var entry = entries[index];
  4803. this.set(entry[0], entry[1]);
  4804. }
  4805. }
  4806. /**
  4807. * Removes all key-value entries from the map.
  4808. *
  4809. * @private
  4810. * @name clear
  4811. * @memberOf MapCache
  4812. */
  4813. function mapCacheClear() {
  4814. this.__data__ = {
  4815. 'hash': new Hash(),
  4816. 'map': new (Map || ListCache)(),
  4817. 'string': new Hash()
  4818. };
  4819. }
  4820. /**
  4821. * Removes `key` and its value from the map.
  4822. *
  4823. * @private
  4824. * @name delete
  4825. * @memberOf MapCache
  4826. * @param {string} key The key of the value to remove.
  4827. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  4828. */
  4829. function mapCacheDelete(key) {
  4830. return getMapData(this, key)['delete'](key);
  4831. }
  4832. /**
  4833. * Gets the map value for `key`.
  4834. *
  4835. * @private
  4836. * @name get
  4837. * @memberOf MapCache
  4838. * @param {string} key The key of the value to get.
  4839. * @returns {*} Returns the entry value.
  4840. */
  4841. function mapCacheGet(key) {
  4842. return getMapData(this, key).get(key);
  4843. }
  4844. /**
  4845. * Checks if a map value for `key` exists.
  4846. *
  4847. * @private
  4848. * @name has
  4849. * @memberOf MapCache
  4850. * @param {string} key The key of the entry to check.
  4851. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  4852. */
  4853. function mapCacheHas(key) {
  4854. return getMapData(this, key).has(key);
  4855. }
  4856. /**
  4857. * Sets the map `key` to `value`.
  4858. *
  4859. * @private
  4860. * @name set
  4861. * @memberOf MapCache
  4862. * @param {string} key The key of the value to set.
  4863. * @param {*} value The value to set.
  4864. * @returns {Object} Returns the map cache instance.
  4865. */
  4866. function mapCacheSet(key, value) {
  4867. getMapData(this, key).set(key, value);
  4868. return this;
  4869. }
  4870. // Add methods to `MapCache`.
  4871. MapCache.prototype.clear = mapCacheClear;
  4872. MapCache.prototype['delete'] = mapCacheDelete;
  4873. MapCache.prototype.get = mapCacheGet;
  4874. MapCache.prototype.has = mapCacheHas;
  4875. MapCache.prototype.set = mapCacheSet;
  4876. /**
  4877. *
  4878. * Creates an array cache object to store unique values.
  4879. *
  4880. * @private
  4881. * @constructor
  4882. * @param {Array} [values] The values to cache.
  4883. */
  4884. function SetCache(values) {
  4885. var index = -1,
  4886. length = values ? values.length : 0;
  4887. this.__data__ = new MapCache();
  4888. while (++index < length) {
  4889. this.add(values[index]);
  4890. }
  4891. }
  4892. /**
  4893. * Adds `value` to the array cache.
  4894. *
  4895. * @private
  4896. * @name add
  4897. * @memberOf SetCache
  4898. * @alias push
  4899. * @param {*} value The value to cache.
  4900. * @returns {Object} Returns the cache instance.
  4901. */
  4902. function setCacheAdd(value) {
  4903. this.__data__.set(value, HASH_UNDEFINED);
  4904. return this;
  4905. }
  4906. /**
  4907. * Checks if `value` is in the array cache.
  4908. *
  4909. * @private
  4910. * @name has
  4911. * @memberOf SetCache
  4912. * @param {*} value The value to search for.
  4913. * @returns {number} Returns `true` if `value` is found, else `false`.
  4914. */
  4915. function setCacheHas(value) {
  4916. return this.__data__.has(value);
  4917. }
  4918. // Add methods to `SetCache`.
  4919. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  4920. SetCache.prototype.has = setCacheHas;
  4921. /**
  4922. * Gets the index at which the `key` is found in `array` of key-value pairs.
  4923. *
  4924. * @private
  4925. * @param {Array} array The array to inspect.
  4926. * @param {*} key The key to search for.
  4927. * @returns {number} Returns the index of the matched value, else `-1`.
  4928. */
  4929. function assocIndexOf(array, key) {
  4930. var length = array.length;
  4931. while (length--) {
  4932. if (eq(array[length][0], key)) {
  4933. return length;
  4934. }
  4935. }
  4936. return -1;
  4937. }
  4938. /**
  4939. * The base implementation of methods like `_.difference` without support
  4940. * for excluding multiple arrays or iteratee shorthands.
  4941. *
  4942. * @private
  4943. * @param {Array} array The array to inspect.
  4944. * @param {Array} values The values to exclude.
  4945. * @param {Function} [iteratee] The iteratee invoked per element.
  4946. * @param {Function} [comparator] The comparator invoked per element.
  4947. * @returns {Array} Returns the new array of filtered values.
  4948. */
  4949. function baseDifference(array, values, iteratee, comparator) {
  4950. var index = -1,
  4951. includes = arrayIncludes,
  4952. isCommon = true,
  4953. length = array.length,
  4954. result = [],
  4955. valuesLength = values.length;
  4956. if (!length) {
  4957. return result;
  4958. }
  4959. if (iteratee) {
  4960. values = arrayMap(values, baseUnary(iteratee));
  4961. }
  4962. if (comparator) {
  4963. includes = arrayIncludesWith;
  4964. isCommon = false;
  4965. } else if (values.length >= LARGE_ARRAY_SIZE) {
  4966. includes = cacheHas;
  4967. isCommon = false;
  4968. values = new SetCache(values);
  4969. }
  4970. outer: while (++index < length) {
  4971. var value = array[index],
  4972. computed = iteratee ? iteratee(value) : value;
  4973. value = comparator || value !== 0 ? value : 0;
  4974. if (isCommon && computed === computed) {
  4975. var valuesIndex = valuesLength;
  4976. while (valuesIndex--) {
  4977. if (values[valuesIndex] === computed) {
  4978. continue outer;
  4979. }
  4980. }
  4981. result.push(value);
  4982. } else if (!includes(values, computed, comparator)) {
  4983. result.push(value);
  4984. }
  4985. }
  4986. return result;
  4987. }
  4988. /**
  4989. * The base implementation of `_.flatten` with support for restricting flattening.
  4990. *
  4991. * @private
  4992. * @param {Array} array The array to flatten.
  4993. * @param {number} depth The maximum recursion depth.
  4994. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  4995. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  4996. * @param {Array} [result=[]] The initial result value.
  4997. * @returns {Array} Returns the new flattened array.
  4998. */
  4999. function baseFlatten(array, depth, predicate, isStrict, result) {
  5000. var index = -1,
  5001. length = array.length;
  5002. predicate || (predicate = isFlattenable);
  5003. result || (result = []);
  5004. while (++index < length) {
  5005. var value = array[index];
  5006. if (depth > 0 && predicate(value)) {
  5007. if (depth > 1) {
  5008. // Recursively flatten arrays (susceptible to call stack limits).
  5009. baseFlatten(value, depth - 1, predicate, isStrict, result);
  5010. } else {
  5011. arrayPush(result, value);
  5012. }
  5013. } else if (!isStrict) {
  5014. result[result.length] = value;
  5015. }
  5016. }
  5017. return result;
  5018. }
  5019. /**
  5020. * The base implementation of `_.isNative` without bad shim checks.
  5021. *
  5022. * @private
  5023. * @param {*} value The value to check.
  5024. * @returns {boolean} Returns `true` if `value` is a native function,
  5025. * else `false`.
  5026. */
  5027. function baseIsNative(value) {
  5028. if (!isObject(value) || isMasked(value)) {
  5029. return false;
  5030. }
  5031. var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
  5032. return pattern.test(toSource(value));
  5033. }
  5034. /**
  5035. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  5036. *
  5037. * @private
  5038. * @param {Function} func The function to apply a rest parameter to.
  5039. * @param {number} [start=func.length-1] The start position of the rest parameter.
  5040. * @returns {Function} Returns the new function.
  5041. */
  5042. function baseRest(func, start) {
  5043. start = nativeMax(start === undefined ? func.length - 1 : start, 0);
  5044. return function () {
  5045. var args = arguments,
  5046. index = -1,
  5047. length = nativeMax(args.length - start, 0),
  5048. array = Array(length);
  5049. while (++index < length) {
  5050. array[index] = args[start + index];
  5051. }
  5052. index = -1;
  5053. var otherArgs = Array(start + 1);
  5054. while (++index < start) {
  5055. otherArgs[index] = args[index];
  5056. }
  5057. otherArgs[start] = array;
  5058. return apply(func, this, otherArgs);
  5059. };
  5060. }
  5061. /**
  5062. * Gets the data for `map`.
  5063. *
  5064. * @private
  5065. * @param {Object} map The map to query.
  5066. * @param {string} key The reference key.
  5067. * @returns {*} Returns the map data.
  5068. */
  5069. function getMapData(map, key) {
  5070. var data = map.__data__;
  5071. return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
  5072. }
  5073. /**
  5074. * Gets the native function at `key` of `object`.
  5075. *
  5076. * @private
  5077. * @param {Object} object The object to query.
  5078. * @param {string} key The key of the method to get.
  5079. * @returns {*} Returns the function if it's native, else `undefined`.
  5080. */
  5081. function getNative(object, key) {
  5082. var value = getValue(object, key);
  5083. return baseIsNative(value) ? value : undefined;
  5084. }
  5085. /**
  5086. * Checks if `value` is a flattenable `arguments` object or array.
  5087. *
  5088. * @private
  5089. * @param {*} value The value to check.
  5090. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  5091. */
  5092. function isFlattenable(value) {
  5093. return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
  5094. }
  5095. /**
  5096. * Checks if `value` is suitable for use as unique object key.
  5097. *
  5098. * @private
  5099. * @param {*} value The value to check.
  5100. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  5101. */
  5102. function isKeyable(value) {
  5103. var type = _typeof(value);
  5104. return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
  5105. }
  5106. /**
  5107. * Checks if `func` has its source masked.
  5108. *
  5109. * @private
  5110. * @param {Function} func The function to check.
  5111. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  5112. */
  5113. function isMasked(func) {
  5114. return !!maskSrcKey && maskSrcKey in func;
  5115. }
  5116. /**
  5117. * Converts `func` to its source code.
  5118. *
  5119. * @private
  5120. * @param {Function} func The function to process.
  5121. * @returns {string} Returns the source code.
  5122. */
  5123. function toSource(func) {
  5124. if (func != null) {
  5125. try {
  5126. return funcToString.call(func);
  5127. } catch (e) {}
  5128. try {
  5129. return func + '';
  5130. } catch (e) {}
  5131. }
  5132. return '';
  5133. }
  5134. /**
  5135. * Creates an array of `array` values not included in the other given arrays
  5136. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  5137. * for equality comparisons. The order of result values is determined by the
  5138. * order they occur in the first array.
  5139. *
  5140. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  5141. *
  5142. * @static
  5143. * @memberOf _
  5144. * @since 0.1.0
  5145. * @category Array
  5146. * @param {Array} array The array to inspect.
  5147. * @param {...Array} [values] The values to exclude.
  5148. * @returns {Array} Returns the new array of filtered values.
  5149. * @see _.without, _.xor
  5150. * @example
  5151. *
  5152. * _.difference([2, 1], [2, 3]);
  5153. * // => [1]
  5154. */
  5155. var difference = baseRest(function (array, values) {
  5156. return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : [];
  5157. });
  5158. /**
  5159. * Performs a
  5160. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  5161. * comparison between two values to determine if they are equivalent.
  5162. *
  5163. * @static
  5164. * @memberOf _
  5165. * @since 4.0.0
  5166. * @category Lang
  5167. * @param {*} value The value to compare.
  5168. * @param {*} other The other value to compare.
  5169. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  5170. * @example
  5171. *
  5172. * var object = { 'a': 1 };
  5173. * var other = { 'a': 1 };
  5174. *
  5175. * _.eq(object, object);
  5176. * // => true
  5177. *
  5178. * _.eq(object, other);
  5179. * // => false
  5180. *
  5181. * _.eq('a', 'a');
  5182. * // => true
  5183. *
  5184. * _.eq('a', Object('a'));
  5185. * // => false
  5186. *
  5187. * _.eq(NaN, NaN);
  5188. * // => true
  5189. */
  5190. function eq(value, other) {
  5191. return value === other || value !== value && other !== other;
  5192. }
  5193. /**
  5194. * Checks if `value` is likely an `arguments` object.
  5195. *
  5196. * @static
  5197. * @memberOf _
  5198. * @since 0.1.0
  5199. * @category Lang
  5200. * @param {*} value The value to check.
  5201. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  5202. * else `false`.
  5203. * @example
  5204. *
  5205. * _.isArguments(function() { return arguments; }());
  5206. * // => true
  5207. *
  5208. * _.isArguments([1, 2, 3]);
  5209. * // => false
  5210. */
  5211. function isArguments(value) {
  5212. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  5213. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
  5214. }
  5215. /**
  5216. * Checks if `value` is classified as an `Array` object.
  5217. *
  5218. * @static
  5219. * @memberOf _
  5220. * @since 0.1.0
  5221. * @category Lang
  5222. * @param {*} value The value to check.
  5223. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  5224. * @example
  5225. *
  5226. * _.isArray([1, 2, 3]);
  5227. * // => true
  5228. *
  5229. * _.isArray(document.body.children);
  5230. * // => false
  5231. *
  5232. * _.isArray('abc');
  5233. * // => false
  5234. *
  5235. * _.isArray(_.noop);
  5236. * // => false
  5237. */
  5238. var isArray = Array.isArray;
  5239. /**
  5240. * Checks if `value` is array-like. A value is considered array-like if it's
  5241. * not a function and has a `value.length` that's an integer greater than or
  5242. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  5243. *
  5244. * @static
  5245. * @memberOf _
  5246. * @since 4.0.0
  5247. * @category Lang
  5248. * @param {*} value The value to check.
  5249. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  5250. * @example
  5251. *
  5252. * _.isArrayLike([1, 2, 3]);
  5253. * // => true
  5254. *
  5255. * _.isArrayLike(document.body.children);
  5256. * // => true
  5257. *
  5258. * _.isArrayLike('abc');
  5259. * // => true
  5260. *
  5261. * _.isArrayLike(_.noop);
  5262. * // => false
  5263. */
  5264. function isArrayLike(value) {
  5265. return value != null && isLength(value.length) && !isFunction(value);
  5266. }
  5267. /**
  5268. * This method is like `_.isArrayLike` except that it also checks if `value`
  5269. * is an object.
  5270. *
  5271. * @static
  5272. * @memberOf _
  5273. * @since 4.0.0
  5274. * @category Lang
  5275. * @param {*} value The value to check.
  5276. * @returns {boolean} Returns `true` if `value` is an array-like object,
  5277. * else `false`.
  5278. * @example
  5279. *
  5280. * _.isArrayLikeObject([1, 2, 3]);
  5281. * // => true
  5282. *
  5283. * _.isArrayLikeObject(document.body.children);
  5284. * // => true
  5285. *
  5286. * _.isArrayLikeObject('abc');
  5287. * // => false
  5288. *
  5289. * _.isArrayLikeObject(_.noop);
  5290. * // => false
  5291. */
  5292. function isArrayLikeObject(value) {
  5293. return isObjectLike(value) && isArrayLike(value);
  5294. }
  5295. /**
  5296. * Checks if `value` is classified as a `Function` object.
  5297. *
  5298. * @static
  5299. * @memberOf _
  5300. * @since 0.1.0
  5301. * @category Lang
  5302. * @param {*} value The value to check.
  5303. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  5304. * @example
  5305. *
  5306. * _.isFunction(_);
  5307. * // => true
  5308. *
  5309. * _.isFunction(/abc/);
  5310. * // => false
  5311. */
  5312. function isFunction(value) {
  5313. // The use of `Object#toString` avoids issues with the `typeof` operator
  5314. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  5315. var tag = isObject(value) ? objectToString.call(value) : '';
  5316. return tag == funcTag || tag == genTag;
  5317. }
  5318. /**
  5319. * Checks if `value` is a valid array-like length.
  5320. *
  5321. * **Note:** This method is loosely based on
  5322. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  5323. *
  5324. * @static
  5325. * @memberOf _
  5326. * @since 4.0.0
  5327. * @category Lang
  5328. * @param {*} value The value to check.
  5329. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  5330. * @example
  5331. *
  5332. * _.isLength(3);
  5333. * // => true
  5334. *
  5335. * _.isLength(Number.MIN_VALUE);
  5336. * // => false
  5337. *
  5338. * _.isLength(Infinity);
  5339. * // => false
  5340. *
  5341. * _.isLength('3');
  5342. * // => false
  5343. */
  5344. function isLength(value) {
  5345. return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  5346. }
  5347. /**
  5348. * Checks if `value` is the
  5349. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  5350. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  5351. *
  5352. * @static
  5353. * @memberOf _
  5354. * @since 0.1.0
  5355. * @category Lang
  5356. * @param {*} value The value to check.
  5357. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  5358. * @example
  5359. *
  5360. * _.isObject({});
  5361. * // => true
  5362. *
  5363. * _.isObject([1, 2, 3]);
  5364. * // => true
  5365. *
  5366. * _.isObject(_.noop);
  5367. * // => true
  5368. *
  5369. * _.isObject(null);
  5370. * // => false
  5371. */
  5372. function isObject(value) {
  5373. var type = _typeof(value);
  5374. return !!value && (type == 'object' || type == 'function');
  5375. }
  5376. /**
  5377. * Checks if `value` is object-like. A value is object-like if it's not `null`
  5378. * and has a `typeof` result of "object".
  5379. *
  5380. * @static
  5381. * @memberOf _
  5382. * @since 4.0.0
  5383. * @category Lang
  5384. * @param {*} value The value to check.
  5385. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  5386. * @example
  5387. *
  5388. * _.isObjectLike({});
  5389. * // => true
  5390. *
  5391. * _.isObjectLike([1, 2, 3]);
  5392. * // => true
  5393. *
  5394. * _.isObjectLike(_.noop);
  5395. * // => false
  5396. *
  5397. * _.isObjectLike(null);
  5398. * // => false
  5399. */
  5400. function isObjectLike(value) {
  5401. return !!value && _typeof(value) == 'object';
  5402. }
  5403. module.exports = difference;
  5404. /***/ }),
  5405. /***/ 1944:
  5406. /***/ (function(module, exports, __webpack_require__) {
  5407. /* module decorator */ module = __webpack_require__.nmd(module);
  5408. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  5409. /**
  5410. * lodash (Custom Build) <https://lodash.com/>
  5411. * Build: `lodash modularize exports="npm" -o ./`
  5412. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  5413. * Released under MIT license <https://lodash.com/license>
  5414. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  5415. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  5416. */
  5417. /** Used as the size to enable large array optimizations. */
  5418. var LARGE_ARRAY_SIZE = 200;
  5419. /** Used as the `TypeError` message for "Functions" methods. */
  5420. var FUNC_ERROR_TEXT = 'Expected a function';
  5421. /** Used to stand-in for `undefined` hash values. */
  5422. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  5423. /** Used to compose bitmasks for comparison styles. */
  5424. var UNORDERED_COMPARE_FLAG = 1,
  5425. PARTIAL_COMPARE_FLAG = 2;
  5426. /** Used as references for various `Number` constants. */
  5427. var INFINITY = 1 / 0,
  5428. MAX_SAFE_INTEGER = 9007199254740991;
  5429. /** `Object#toString` result references. */
  5430. var argsTag = '[object Arguments]',
  5431. arrayTag = '[object Array]',
  5432. boolTag = '[object Boolean]',
  5433. dateTag = '[object Date]',
  5434. errorTag = '[object Error]',
  5435. funcTag = '[object Function]',
  5436. genTag = '[object GeneratorFunction]',
  5437. mapTag = '[object Map]',
  5438. numberTag = '[object Number]',
  5439. objectTag = '[object Object]',
  5440. promiseTag = '[object Promise]',
  5441. regexpTag = '[object RegExp]',
  5442. setTag = '[object Set]',
  5443. stringTag = '[object String]',
  5444. symbolTag = '[object Symbol]',
  5445. weakMapTag = '[object WeakMap]';
  5446. var arrayBufferTag = '[object ArrayBuffer]',
  5447. dataViewTag = '[object DataView]',
  5448. float32Tag = '[object Float32Array]',
  5449. float64Tag = '[object Float64Array]',
  5450. int8Tag = '[object Int8Array]',
  5451. int16Tag = '[object Int16Array]',
  5452. int32Tag = '[object Int32Array]',
  5453. uint8Tag = '[object Uint8Array]',
  5454. uint8ClampedTag = '[object Uint8ClampedArray]',
  5455. uint16Tag = '[object Uint16Array]',
  5456. uint32Tag = '[object Uint32Array]';
  5457. /** Used to match property names within property paths. */
  5458. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  5459. reIsPlainProp = /^\w*$/,
  5460. reLeadingDot = /^\./,
  5461. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  5462. /**
  5463. * Used to match `RegExp`
  5464. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  5465. */
  5466. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  5467. /** Used to match backslashes in property paths. */
  5468. var reEscapeChar = /\\(\\)?/g;
  5469. /** Used to detect host constructors (Safari). */
  5470. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  5471. /** Used to detect unsigned integer values. */
  5472. var reIsUint = /^(?:0|[1-9]\d*)$/;
  5473. /** Used to identify `toStringTag` values of typed arrays. */
  5474. var typedArrayTags = {};
  5475. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
  5476. typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
  5477. /** Detect free variable `global` from Node.js. */
  5478. var freeGlobal = (typeof __webpack_require__.g === "undefined" ? "undefined" : _typeof(__webpack_require__.g)) == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  5479. /** Detect free variable `self`. */
  5480. var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
  5481. /** Used as a reference to the global object. */
  5482. var root = freeGlobal || freeSelf || Function('return this')();
  5483. /** Detect free variable `exports`. */
  5484. var freeExports = ( false ? 0 : _typeof(exports)) == 'object' && exports && !exports.nodeType && exports;
  5485. /** Detect free variable `module`. */
  5486. var freeModule = freeExports && ( false ? 0 : _typeof(module)) == 'object' && module && !module.nodeType && module;
  5487. /** Detect the popular CommonJS extension `module.exports`. */
  5488. var moduleExports = freeModule && freeModule.exports === freeExports;
  5489. /** Detect free variable `process` from Node.js. */
  5490. var freeProcess = moduleExports && freeGlobal.process;
  5491. /** Used to access faster Node.js helpers. */
  5492. var nodeUtil = function () {
  5493. try {
  5494. return freeProcess && freeProcess.binding('util');
  5495. } catch (e) {}
  5496. }();
  5497. /* Node.js helper references. */
  5498. var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  5499. /**
  5500. * A specialized version of `_.some` for arrays without support for iteratee
  5501. * shorthands.
  5502. *
  5503. * @private
  5504. * @param {Array} [array] The array to iterate over.
  5505. * @param {Function} predicate The function invoked per iteration.
  5506. * @returns {boolean} Returns `true` if any element passes the predicate check,
  5507. * else `false`.
  5508. */
  5509. function arraySome(array, predicate) {
  5510. var index = -1,
  5511. length = array ? array.length : 0;
  5512. while (++index < length) {
  5513. if (predicate(array[index], index, array)) {
  5514. return true;
  5515. }
  5516. }
  5517. return false;
  5518. }
  5519. /**
  5520. * The base implementation of `_.property` without support for deep paths.
  5521. *
  5522. * @private
  5523. * @param {string} key The key of the property to get.
  5524. * @returns {Function} Returns the new accessor function.
  5525. */
  5526. function baseProperty(key) {
  5527. return function (object) {
  5528. return object == null ? undefined : object[key];
  5529. };
  5530. }
  5531. /**
  5532. * The base implementation of `_.times` without support for iteratee shorthands
  5533. * or max array length checks.
  5534. *
  5535. * @private
  5536. * @param {number} n The number of times to invoke `iteratee`.
  5537. * @param {Function} iteratee The function invoked per iteration.
  5538. * @returns {Array} Returns the array of results.
  5539. */
  5540. function baseTimes(n, iteratee) {
  5541. var index = -1,
  5542. result = Array(n);
  5543. while (++index < n) {
  5544. result[index] = iteratee(index);
  5545. }
  5546. return result;
  5547. }
  5548. /**
  5549. * The base implementation of `_.unary` without support for storing metadata.
  5550. *
  5551. * @private
  5552. * @param {Function} func The function to cap arguments for.
  5553. * @returns {Function} Returns the new capped function.
  5554. */
  5555. function baseUnary(func) {
  5556. return function (value) {
  5557. return func(value);
  5558. };
  5559. }
  5560. /**
  5561. * Gets the value at `key` of `object`.
  5562. *
  5563. * @private
  5564. * @param {Object} [object] The object to query.
  5565. * @param {string} key The key of the property to get.
  5566. * @returns {*} Returns the property value.
  5567. */
  5568. function getValue(object, key) {
  5569. return object == null ? undefined : object[key];
  5570. }
  5571. /**
  5572. * Checks if `value` is a host object in IE < 9.
  5573. *
  5574. * @private
  5575. * @param {*} value The value to check.
  5576. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  5577. */
  5578. function isHostObject(value) {
  5579. // Many host objects are `Object` objects that can coerce to strings
  5580. // despite having improperly defined `toString` methods.
  5581. var result = false;
  5582. if (value != null && typeof value.toString != 'function') {
  5583. try {
  5584. result = !!(value + '');
  5585. } catch (e) {}
  5586. }
  5587. return result;
  5588. }
  5589. /**
  5590. * Converts `map` to its key-value pairs.
  5591. *
  5592. * @private
  5593. * @param {Object} map The map to convert.
  5594. * @returns {Array} Returns the key-value pairs.
  5595. */
  5596. function mapToArray(map) {
  5597. var index = -1,
  5598. result = Array(map.size);
  5599. map.forEach(function (value, key) {
  5600. result[++index] = [key, value];
  5601. });
  5602. return result;
  5603. }
  5604. /**
  5605. * Creates a unary function that invokes `func` with its argument transformed.
  5606. *
  5607. * @private
  5608. * @param {Function} func The function to wrap.
  5609. * @param {Function} transform The argument transform.
  5610. * @returns {Function} Returns the new function.
  5611. */
  5612. function overArg(func, transform) {
  5613. return function (arg) {
  5614. return func(transform(arg));
  5615. };
  5616. }
  5617. /**
  5618. * Converts `set` to an array of its values.
  5619. *
  5620. * @private
  5621. * @param {Object} set The set to convert.
  5622. * @returns {Array} Returns the values.
  5623. */
  5624. function setToArray(set) {
  5625. var index = -1,
  5626. result = Array(set.size);
  5627. set.forEach(function (value) {
  5628. result[++index] = value;
  5629. });
  5630. return result;
  5631. }
  5632. /** Used for built-in method references. */
  5633. var arrayProto = Array.prototype,
  5634. funcProto = Function.prototype,
  5635. objectProto = Object.prototype;
  5636. /** Used to detect overreaching core-js shims. */
  5637. var coreJsData = root['__core-js_shared__'];
  5638. /** Used to detect methods masquerading as native. */
  5639. var maskSrcKey = function () {
  5640. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  5641. return uid ? 'Symbol(src)_1.' + uid : '';
  5642. }();
  5643. /** Used to resolve the decompiled source of functions. */
  5644. var funcToString = funcProto.toString;
  5645. /** Used to check objects for own properties. */
  5646. var hasOwnProperty = objectProto.hasOwnProperty;
  5647. /**
  5648. * Used to resolve the
  5649. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  5650. * of values.
  5651. */
  5652. var objectToString = objectProto.toString;
  5653. /** Used to detect if a method is native. */
  5654. var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
  5655. /** Built-in value references. */
  5656. var _Symbol = root.Symbol,
  5657. Uint8Array = root.Uint8Array,
  5658. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  5659. splice = arrayProto.splice;
  5660. /* Built-in method references for those with the same name as other `lodash` methods. */
  5661. var nativeKeys = overArg(Object.keys, Object);
  5662. /* Built-in method references that are verified to be native. */
  5663. var DataView = getNative(root, 'DataView'),
  5664. Map = getNative(root, 'Map'),
  5665. Promise = getNative(root, 'Promise'),
  5666. Set = getNative(root, 'Set'),
  5667. WeakMap = getNative(root, 'WeakMap'),
  5668. nativeCreate = getNative(Object, 'create');
  5669. /** Used to detect maps, sets, and weakmaps. */
  5670. var dataViewCtorString = toSource(DataView),
  5671. mapCtorString = toSource(Map),
  5672. promiseCtorString = toSource(Promise),
  5673. setCtorString = toSource(Set),
  5674. weakMapCtorString = toSource(WeakMap);
  5675. /** Used to convert symbols to primitives and strings. */
  5676. var symbolProto = _Symbol ? _Symbol.prototype : undefined,
  5677. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  5678. symbolToString = symbolProto ? symbolProto.toString : undefined;
  5679. /**
  5680. * Creates a hash object.
  5681. *
  5682. * @private
  5683. * @constructor
  5684. * @param {Array} [entries] The key-value pairs to cache.
  5685. */
  5686. function Hash(entries) {
  5687. var index = -1,
  5688. length = entries ? entries.length : 0;
  5689. this.clear();
  5690. while (++index < length) {
  5691. var entry = entries[index];
  5692. this.set(entry[0], entry[1]);
  5693. }
  5694. }
  5695. /**
  5696. * Removes all key-value entries from the hash.
  5697. *
  5698. * @private
  5699. * @name clear
  5700. * @memberOf Hash
  5701. */
  5702. function hashClear() {
  5703. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  5704. }
  5705. /**
  5706. * Removes `key` and its value from the hash.
  5707. *
  5708. * @private
  5709. * @name delete
  5710. * @memberOf Hash
  5711. * @param {Object} hash The hash to modify.
  5712. * @param {string} key The key of the value to remove.
  5713. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  5714. */
  5715. function hashDelete(key) {
  5716. return this.has(key) && delete this.__data__[key];
  5717. }
  5718. /**
  5719. * Gets the hash value for `key`.
  5720. *
  5721. * @private
  5722. * @name get
  5723. * @memberOf Hash
  5724. * @param {string} key The key of the value to get.
  5725. * @returns {*} Returns the entry value.
  5726. */
  5727. function hashGet(key) {
  5728. var data = this.__data__;
  5729. if (nativeCreate) {
  5730. var result = data[key];
  5731. return result === HASH_UNDEFINED ? undefined : result;
  5732. }
  5733. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  5734. }
  5735. /**
  5736. * Checks if a hash value for `key` exists.
  5737. *
  5738. * @private
  5739. * @name has
  5740. * @memberOf Hash
  5741. * @param {string} key The key of the entry to check.
  5742. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  5743. */
  5744. function hashHas(key) {
  5745. var data = this.__data__;
  5746. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  5747. }
  5748. /**
  5749. * Sets the hash `key` to `value`.
  5750. *
  5751. * @private
  5752. * @name set
  5753. * @memberOf Hash
  5754. * @param {string} key The key of the value to set.
  5755. * @param {*} value The value to set.
  5756. * @returns {Object} Returns the hash instance.
  5757. */
  5758. function hashSet(key, value) {
  5759. var data = this.__data__;
  5760. data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
  5761. return this;
  5762. }
  5763. // Add methods to `Hash`.
  5764. Hash.prototype.clear = hashClear;
  5765. Hash.prototype['delete'] = hashDelete;
  5766. Hash.prototype.get = hashGet;
  5767. Hash.prototype.has = hashHas;
  5768. Hash.prototype.set = hashSet;
  5769. /**
  5770. * Creates an list cache object.
  5771. *
  5772. * @private
  5773. * @constructor
  5774. * @param {Array} [entries] The key-value pairs to cache.
  5775. */
  5776. function ListCache(entries) {
  5777. var index = -1,
  5778. length = entries ? entries.length : 0;
  5779. this.clear();
  5780. while (++index < length) {
  5781. var entry = entries[index];
  5782. this.set(entry[0], entry[1]);
  5783. }
  5784. }
  5785. /**
  5786. * Removes all key-value entries from the list cache.
  5787. *
  5788. * @private
  5789. * @name clear
  5790. * @memberOf ListCache
  5791. */
  5792. function listCacheClear() {
  5793. this.__data__ = [];
  5794. }
  5795. /**
  5796. * Removes `key` and its value from the list cache.
  5797. *
  5798. * @private
  5799. * @name delete
  5800. * @memberOf ListCache
  5801. * @param {string} key The key of the value to remove.
  5802. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  5803. */
  5804. function listCacheDelete(key) {
  5805. var data = this.__data__,
  5806. index = assocIndexOf(data, key);
  5807. if (index < 0) {
  5808. return false;
  5809. }
  5810. var lastIndex = data.length - 1;
  5811. if (index == lastIndex) {
  5812. data.pop();
  5813. } else {
  5814. splice.call(data, index, 1);
  5815. }
  5816. return true;
  5817. }
  5818. /**
  5819. * Gets the list cache value for `key`.
  5820. *
  5821. * @private
  5822. * @name get
  5823. * @memberOf ListCache
  5824. * @param {string} key The key of the value to get.
  5825. * @returns {*} Returns the entry value.
  5826. */
  5827. function listCacheGet(key) {
  5828. var data = this.__data__,
  5829. index = assocIndexOf(data, key);
  5830. return index < 0 ? undefined : data[index][1];
  5831. }
  5832. /**
  5833. * Checks if a list cache value for `key` exists.
  5834. *
  5835. * @private
  5836. * @name has
  5837. * @memberOf ListCache
  5838. * @param {string} key The key of the entry to check.
  5839. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  5840. */
  5841. function listCacheHas(key) {
  5842. return assocIndexOf(this.__data__, key) > -1;
  5843. }
  5844. /**
  5845. * Sets the list cache `key` to `value`.
  5846. *
  5847. * @private
  5848. * @name set
  5849. * @memberOf ListCache
  5850. * @param {string} key The key of the value to set.
  5851. * @param {*} value The value to set.
  5852. * @returns {Object} Returns the list cache instance.
  5853. */
  5854. function listCacheSet(key, value) {
  5855. var data = this.__data__,
  5856. index = assocIndexOf(data, key);
  5857. if (index < 0) {
  5858. data.push([key, value]);
  5859. } else {
  5860. data[index][1] = value;
  5861. }
  5862. return this;
  5863. }
  5864. // Add methods to `ListCache`.
  5865. ListCache.prototype.clear = listCacheClear;
  5866. ListCache.prototype['delete'] = listCacheDelete;
  5867. ListCache.prototype.get = listCacheGet;
  5868. ListCache.prototype.has = listCacheHas;
  5869. ListCache.prototype.set = listCacheSet;
  5870. /**
  5871. * Creates a map cache object to store key-value pairs.
  5872. *
  5873. * @private
  5874. * @constructor
  5875. * @param {Array} [entries] The key-value pairs to cache.
  5876. */
  5877. function MapCache(entries) {
  5878. var index = -1,
  5879. length = entries ? entries.length : 0;
  5880. this.clear();
  5881. while (++index < length) {
  5882. var entry = entries[index];
  5883. this.set(entry[0], entry[1]);
  5884. }
  5885. }
  5886. /**
  5887. * Removes all key-value entries from the map.
  5888. *
  5889. * @private
  5890. * @name clear
  5891. * @memberOf MapCache
  5892. */
  5893. function mapCacheClear() {
  5894. this.__data__ = {
  5895. 'hash': new Hash(),
  5896. 'map': new (Map || ListCache)(),
  5897. 'string': new Hash()
  5898. };
  5899. }
  5900. /**
  5901. * Removes `key` and its value from the map.
  5902. *
  5903. * @private
  5904. * @name delete
  5905. * @memberOf MapCache
  5906. * @param {string} key The key of the value to remove.
  5907. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  5908. */
  5909. function mapCacheDelete(key) {
  5910. return getMapData(this, key)['delete'](key);
  5911. }
  5912. /**
  5913. * Gets the map value for `key`.
  5914. *
  5915. * @private
  5916. * @name get
  5917. * @memberOf MapCache
  5918. * @param {string} key The key of the value to get.
  5919. * @returns {*} Returns the entry value.
  5920. */
  5921. function mapCacheGet(key) {
  5922. return getMapData(this, key).get(key);
  5923. }
  5924. /**
  5925. * Checks if a map value for `key` exists.
  5926. *
  5927. * @private
  5928. * @name has
  5929. * @memberOf MapCache
  5930. * @param {string} key The key of the entry to check.
  5931. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  5932. */
  5933. function mapCacheHas(key) {
  5934. return getMapData(this, key).has(key);
  5935. }
  5936. /**
  5937. * Sets the map `key` to `value`.
  5938. *
  5939. * @private
  5940. * @name set
  5941. * @memberOf MapCache
  5942. * @param {string} key The key of the value to set.
  5943. * @param {*} value The value to set.
  5944. * @returns {Object} Returns the map cache instance.
  5945. */
  5946. function mapCacheSet(key, value) {
  5947. getMapData(this, key).set(key, value);
  5948. return this;
  5949. }
  5950. // Add methods to `MapCache`.
  5951. MapCache.prototype.clear = mapCacheClear;
  5952. MapCache.prototype['delete'] = mapCacheDelete;
  5953. MapCache.prototype.get = mapCacheGet;
  5954. MapCache.prototype.has = mapCacheHas;
  5955. MapCache.prototype.set = mapCacheSet;
  5956. /**
  5957. *
  5958. * Creates an array cache object to store unique values.
  5959. *
  5960. * @private
  5961. * @constructor
  5962. * @param {Array} [values] The values to cache.
  5963. */
  5964. function SetCache(values) {
  5965. var index = -1,
  5966. length = values ? values.length : 0;
  5967. this.__data__ = new MapCache();
  5968. while (++index < length) {
  5969. this.add(values[index]);
  5970. }
  5971. }
  5972. /**
  5973. * Adds `value` to the array cache.
  5974. *
  5975. * @private
  5976. * @name add
  5977. * @memberOf SetCache
  5978. * @alias push
  5979. * @param {*} value The value to cache.
  5980. * @returns {Object} Returns the cache instance.
  5981. */
  5982. function setCacheAdd(value) {
  5983. this.__data__.set(value, HASH_UNDEFINED);
  5984. return this;
  5985. }
  5986. /**
  5987. * Checks if `value` is in the array cache.
  5988. *
  5989. * @private
  5990. * @name has
  5991. * @memberOf SetCache
  5992. * @param {*} value The value to search for.
  5993. * @returns {number} Returns `true` if `value` is found, else `false`.
  5994. */
  5995. function setCacheHas(value) {
  5996. return this.__data__.has(value);
  5997. }
  5998. // Add methods to `SetCache`.
  5999. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  6000. SetCache.prototype.has = setCacheHas;
  6001. /**
  6002. * Creates a stack cache object to store key-value pairs.
  6003. *
  6004. * @private
  6005. * @constructor
  6006. * @param {Array} [entries] The key-value pairs to cache.
  6007. */
  6008. function Stack(entries) {
  6009. this.__data__ = new ListCache(entries);
  6010. }
  6011. /**
  6012. * Removes all key-value entries from the stack.
  6013. *
  6014. * @private
  6015. * @name clear
  6016. * @memberOf Stack
  6017. */
  6018. function stackClear() {
  6019. this.__data__ = new ListCache();
  6020. }
  6021. /**
  6022. * Removes `key` and its value from the stack.
  6023. *
  6024. * @private
  6025. * @name delete
  6026. * @memberOf Stack
  6027. * @param {string} key The key of the value to remove.
  6028. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  6029. */
  6030. function stackDelete(key) {
  6031. return this.__data__['delete'](key);
  6032. }
  6033. /**
  6034. * Gets the stack value for `key`.
  6035. *
  6036. * @private
  6037. * @name get
  6038. * @memberOf Stack
  6039. * @param {string} key The key of the value to get.
  6040. * @returns {*} Returns the entry value.
  6041. */
  6042. function stackGet(key) {
  6043. return this.__data__.get(key);
  6044. }
  6045. /**
  6046. * Checks if a stack value for `key` exists.
  6047. *
  6048. * @private
  6049. * @name has
  6050. * @memberOf Stack
  6051. * @param {string} key The key of the entry to check.
  6052. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  6053. */
  6054. function stackHas(key) {
  6055. return this.__data__.has(key);
  6056. }
  6057. /**
  6058. * Sets the stack `key` to `value`.
  6059. *
  6060. * @private
  6061. * @name set
  6062. * @memberOf Stack
  6063. * @param {string} key The key of the value to set.
  6064. * @param {*} value The value to set.
  6065. * @returns {Object} Returns the stack cache instance.
  6066. */
  6067. function stackSet(key, value) {
  6068. var cache = this.__data__;
  6069. if (cache instanceof ListCache) {
  6070. var pairs = cache.__data__;
  6071. if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
  6072. pairs.push([key, value]);
  6073. return this;
  6074. }
  6075. cache = this.__data__ = new MapCache(pairs);
  6076. }
  6077. cache.set(key, value);
  6078. return this;
  6079. }
  6080. // Add methods to `Stack`.
  6081. Stack.prototype.clear = stackClear;
  6082. Stack.prototype['delete'] = stackDelete;
  6083. Stack.prototype.get = stackGet;
  6084. Stack.prototype.has = stackHas;
  6085. Stack.prototype.set = stackSet;
  6086. /**
  6087. * Creates an array of the enumerable property names of the array-like `value`.
  6088. *
  6089. * @private
  6090. * @param {*} value The value to query.
  6091. * @param {boolean} inherited Specify returning inherited property names.
  6092. * @returns {Array} Returns the array of property names.
  6093. */
  6094. function arrayLikeKeys(value, inherited) {
  6095. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  6096. // Safari 9 makes `arguments.length` enumerable in strict mode.
  6097. var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
  6098. var length = result.length,
  6099. skipIndexes = !!length;
  6100. for (var key in value) {
  6101. if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
  6102. result.push(key);
  6103. }
  6104. }
  6105. return result;
  6106. }
  6107. /**
  6108. * Gets the index at which the `key` is found in `array` of key-value pairs.
  6109. *
  6110. * @private
  6111. * @param {Array} array The array to inspect.
  6112. * @param {*} key The key to search for.
  6113. * @returns {number} Returns the index of the matched value, else `-1`.
  6114. */
  6115. function assocIndexOf(array, key) {
  6116. var length = array.length;
  6117. while (length--) {
  6118. if (eq(array[length][0], key)) {
  6119. return length;
  6120. }
  6121. }
  6122. return -1;
  6123. }
  6124. /**
  6125. * The base implementation of `_.get` without support for default values.
  6126. *
  6127. * @private
  6128. * @param {Object} object The object to query.
  6129. * @param {Array|string} path The path of the property to get.
  6130. * @returns {*} Returns the resolved value.
  6131. */
  6132. function baseGet(object, path) {
  6133. path = isKey(path, object) ? [path] : castPath(path);
  6134. var index = 0,
  6135. length = path.length;
  6136. while (object != null && index < length) {
  6137. object = object[toKey(path[index++])];
  6138. }
  6139. return index && index == length ? object : undefined;
  6140. }
  6141. /**
  6142. * The base implementation of `getTag`.
  6143. *
  6144. * @private
  6145. * @param {*} value The value to query.
  6146. * @returns {string} Returns the `toStringTag`.
  6147. */
  6148. function baseGetTag(value) {
  6149. return objectToString.call(value);
  6150. }
  6151. /**
  6152. * The base implementation of `_.hasIn` without support for deep paths.
  6153. *
  6154. * @private
  6155. * @param {Object} [object] The object to query.
  6156. * @param {Array|string} key The key to check.
  6157. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  6158. */
  6159. function baseHasIn(object, key) {
  6160. return object != null && key in Object(object);
  6161. }
  6162. /**
  6163. * The base implementation of `_.isEqual` which supports partial comparisons
  6164. * and tracks traversed objects.
  6165. *
  6166. * @private
  6167. * @param {*} value The value to compare.
  6168. * @param {*} other The other value to compare.
  6169. * @param {Function} [customizer] The function to customize comparisons.
  6170. * @param {boolean} [bitmask] The bitmask of comparison flags.
  6171. * The bitmask may be composed of the following flags:
  6172. * 1 - Unordered comparison
  6173. * 2 - Partial comparison
  6174. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  6175. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  6176. */
  6177. function baseIsEqual(value, other, customizer, bitmask, stack) {
  6178. if (value === other) {
  6179. return true;
  6180. }
  6181. if (value == null || other == null || !isObject(value) && !isObjectLike(other)) {
  6182. return value !== value && other !== other;
  6183. }
  6184. return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);
  6185. }
  6186. /**
  6187. * A specialized version of `baseIsEqual` for arrays and objects which performs
  6188. * deep comparisons and tracks traversed objects enabling objects with circular
  6189. * references to be compared.
  6190. *
  6191. * @private
  6192. * @param {Object} object The object to compare.
  6193. * @param {Object} other The other object to compare.
  6194. * @param {Function} equalFunc The function to determine equivalents of values.
  6195. * @param {Function} [customizer] The function to customize comparisons.
  6196. * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`
  6197. * for more details.
  6198. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  6199. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6200. */
  6201. function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {
  6202. var objIsArr = isArray(object),
  6203. othIsArr = isArray(other),
  6204. objTag = arrayTag,
  6205. othTag = arrayTag;
  6206. if (!objIsArr) {
  6207. objTag = getTag(object);
  6208. objTag = objTag == argsTag ? objectTag : objTag;
  6209. }
  6210. if (!othIsArr) {
  6211. othTag = getTag(other);
  6212. othTag = othTag == argsTag ? objectTag : othTag;
  6213. }
  6214. var objIsObj = objTag == objectTag && !isHostObject(object),
  6215. othIsObj = othTag == objectTag && !isHostObject(other),
  6216. isSameTag = objTag == othTag;
  6217. if (isSameTag && !objIsObj) {
  6218. stack || (stack = new Stack());
  6219. return objIsArr || isTypedArray(object) ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);
  6220. }
  6221. if (!(bitmask & PARTIAL_COMPARE_FLAG)) {
  6222. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  6223. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  6224. if (objIsWrapped || othIsWrapped) {
  6225. var objUnwrapped = objIsWrapped ? object.value() : object,
  6226. othUnwrapped = othIsWrapped ? other.value() : other;
  6227. stack || (stack = new Stack());
  6228. return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);
  6229. }
  6230. }
  6231. if (!isSameTag) {
  6232. return false;
  6233. }
  6234. stack || (stack = new Stack());
  6235. return equalObjects(object, other, equalFunc, customizer, bitmask, stack);
  6236. }
  6237. /**
  6238. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  6239. *
  6240. * @private
  6241. * @param {Object} object The object to inspect.
  6242. * @param {Object} source The object of property values to match.
  6243. * @param {Array} matchData The property names, values, and compare flags to match.
  6244. * @param {Function} [customizer] The function to customize comparisons.
  6245. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  6246. */
  6247. function baseIsMatch(object, source, matchData, customizer) {
  6248. var index = matchData.length,
  6249. length = index,
  6250. noCustomizer = !customizer;
  6251. if (object == null) {
  6252. return !length;
  6253. }
  6254. object = Object(object);
  6255. while (index--) {
  6256. var data = matchData[index];
  6257. if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
  6258. return false;
  6259. }
  6260. }
  6261. while (++index < length) {
  6262. data = matchData[index];
  6263. var key = data[0],
  6264. objValue = object[key],
  6265. srcValue = data[1];
  6266. if (noCustomizer && data[2]) {
  6267. if (objValue === undefined && !(key in object)) {
  6268. return false;
  6269. }
  6270. } else {
  6271. var stack = new Stack();
  6272. if (customizer) {
  6273. var result = customizer(objValue, srcValue, key, object, source, stack);
  6274. }
  6275. if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result)) {
  6276. return false;
  6277. }
  6278. }
  6279. }
  6280. return true;
  6281. }
  6282. /**
  6283. * The base implementation of `_.isNative` without bad shim checks.
  6284. *
  6285. * @private
  6286. * @param {*} value The value to check.
  6287. * @returns {boolean} Returns `true` if `value` is a native function,
  6288. * else `false`.
  6289. */
  6290. function baseIsNative(value) {
  6291. if (!isObject(value) || isMasked(value)) {
  6292. return false;
  6293. }
  6294. var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
  6295. return pattern.test(toSource(value));
  6296. }
  6297. /**
  6298. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  6299. *
  6300. * @private
  6301. * @param {*} value The value to check.
  6302. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  6303. */
  6304. function baseIsTypedArray(value) {
  6305. return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)];
  6306. }
  6307. /**
  6308. * The base implementation of `_.iteratee`.
  6309. *
  6310. * @private
  6311. * @param {*} [value=_.identity] The value to convert to an iteratee.
  6312. * @returns {Function} Returns the iteratee.
  6313. */
  6314. function baseIteratee(value) {
  6315. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  6316. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  6317. if (typeof value == 'function') {
  6318. return value;
  6319. }
  6320. if (value == null) {
  6321. return identity;
  6322. }
  6323. if (_typeof(value) == 'object') {
  6324. return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
  6325. }
  6326. return property(value);
  6327. }
  6328. /**
  6329. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  6330. *
  6331. * @private
  6332. * @param {Object} object The object to query.
  6333. * @returns {Array} Returns the array of property names.
  6334. */
  6335. function baseKeys(object) {
  6336. if (!isPrototype(object)) {
  6337. return nativeKeys(object);
  6338. }
  6339. var result = [];
  6340. for (var key in Object(object)) {
  6341. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  6342. result.push(key);
  6343. }
  6344. }
  6345. return result;
  6346. }
  6347. /**
  6348. * The base implementation of `_.matches` which doesn't clone `source`.
  6349. *
  6350. * @private
  6351. * @param {Object} source The object of property values to match.
  6352. * @returns {Function} Returns the new spec function.
  6353. */
  6354. function baseMatches(source) {
  6355. var matchData = getMatchData(source);
  6356. if (matchData.length == 1 && matchData[0][2]) {
  6357. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  6358. }
  6359. return function (object) {
  6360. return object === source || baseIsMatch(object, source, matchData);
  6361. };
  6362. }
  6363. /**
  6364. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  6365. *
  6366. * @private
  6367. * @param {string} path The path of the property to get.
  6368. * @param {*} srcValue The value to match.
  6369. * @returns {Function} Returns the new spec function.
  6370. */
  6371. function baseMatchesProperty(path, srcValue) {
  6372. if (isKey(path) && isStrictComparable(srcValue)) {
  6373. return matchesStrictComparable(toKey(path), srcValue);
  6374. }
  6375. return function (object) {
  6376. var objValue = get(object, path);
  6377. return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);
  6378. };
  6379. }
  6380. /**
  6381. * A specialized version of `baseProperty` which supports deep paths.
  6382. *
  6383. * @private
  6384. * @param {Array|string} path The path of the property to get.
  6385. * @returns {Function} Returns the new accessor function.
  6386. */
  6387. function basePropertyDeep(path) {
  6388. return function (object) {
  6389. return baseGet(object, path);
  6390. };
  6391. }
  6392. /**
  6393. * The base implementation of `_.pullAt` without support for individual
  6394. * indexes or capturing the removed elements.
  6395. *
  6396. * @private
  6397. * @param {Array} array The array to modify.
  6398. * @param {number[]} indexes The indexes of elements to remove.
  6399. * @returns {Array} Returns `array`.
  6400. */
  6401. function basePullAt(array, indexes) {
  6402. var length = array ? indexes.length : 0,
  6403. lastIndex = length - 1;
  6404. while (length--) {
  6405. var index = indexes[length];
  6406. if (length == lastIndex || index !== previous) {
  6407. var previous = index;
  6408. if (isIndex(index)) {
  6409. splice.call(array, index, 1);
  6410. } else if (!isKey(index, array)) {
  6411. var path = castPath(index),
  6412. object = parent(array, path);
  6413. if (object != null) {
  6414. delete object[toKey(last(path))];
  6415. }
  6416. } else {
  6417. delete array[toKey(index)];
  6418. }
  6419. }
  6420. }
  6421. return array;
  6422. }
  6423. /**
  6424. * The base implementation of `_.slice` without an iteratee call guard.
  6425. *
  6426. * @private
  6427. * @param {Array} array The array to slice.
  6428. * @param {number} [start=0] The start position.
  6429. * @param {number} [end=array.length] The end position.
  6430. * @returns {Array} Returns the slice of `array`.
  6431. */
  6432. function baseSlice(array, start, end) {
  6433. var index = -1,
  6434. length = array.length;
  6435. if (start < 0) {
  6436. start = -start > length ? 0 : length + start;
  6437. }
  6438. end = end > length ? length : end;
  6439. if (end < 0) {
  6440. end += length;
  6441. }
  6442. length = start > end ? 0 : end - start >>> 0;
  6443. start >>>= 0;
  6444. var result = Array(length);
  6445. while (++index < length) {
  6446. result[index] = array[index + start];
  6447. }
  6448. return result;
  6449. }
  6450. /**
  6451. * The base implementation of `_.toString` which doesn't convert nullish
  6452. * values to empty strings.
  6453. *
  6454. * @private
  6455. * @param {*} value The value to process.
  6456. * @returns {string} Returns the string.
  6457. */
  6458. function baseToString(value) {
  6459. // Exit early for strings to avoid a performance hit in some environments.
  6460. if (typeof value == 'string') {
  6461. return value;
  6462. }
  6463. if (isSymbol(value)) {
  6464. return symbolToString ? symbolToString.call(value) : '';
  6465. }
  6466. var result = value + '';
  6467. return result == '0' && 1 / value == -INFINITY ? '-0' : result;
  6468. }
  6469. /**
  6470. * Casts `value` to a path array if it's not one.
  6471. *
  6472. * @private
  6473. * @param {*} value The value to inspect.
  6474. * @returns {Array} Returns the cast property path array.
  6475. */
  6476. function castPath(value) {
  6477. return isArray(value) ? value : stringToPath(value);
  6478. }
  6479. /**
  6480. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6481. * partial deep comparisons.
  6482. *
  6483. * @private
  6484. * @param {Array} array The array to compare.
  6485. * @param {Array} other The other array to compare.
  6486. * @param {Function} equalFunc The function to determine equivalents of values.
  6487. * @param {Function} customizer The function to customize comparisons.
  6488. * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
  6489. * for more details.
  6490. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6491. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6492. */
  6493. function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
  6494. var isPartial = bitmask & PARTIAL_COMPARE_FLAG,
  6495. arrLength = array.length,
  6496. othLength = other.length;
  6497. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6498. return false;
  6499. }
  6500. // Assume cyclic values are equal.
  6501. var stacked = stack.get(array);
  6502. if (stacked && stack.get(other)) {
  6503. return stacked == other;
  6504. }
  6505. var index = -1,
  6506. result = true,
  6507. seen = bitmask & UNORDERED_COMPARE_FLAG ? new SetCache() : undefined;
  6508. stack.set(array, other);
  6509. stack.set(other, array);
  6510. // Ignore non-index properties.
  6511. while (++index < arrLength) {
  6512. var arrValue = array[index],
  6513. othValue = other[index];
  6514. if (customizer) {
  6515. var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
  6516. }
  6517. if (compared !== undefined) {
  6518. if (compared) {
  6519. continue;
  6520. }
  6521. result = false;
  6522. break;
  6523. }
  6524. // Recursively compare arrays (susceptible to call stack limits).
  6525. if (seen) {
  6526. if (!arraySome(other, function (othValue, othIndex) {
  6527. if (!seen.has(othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {
  6528. return seen.add(othIndex);
  6529. }
  6530. })) {
  6531. result = false;
  6532. break;
  6533. }
  6534. } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {
  6535. result = false;
  6536. break;
  6537. }
  6538. }
  6539. stack['delete'](array);
  6540. stack['delete'](other);
  6541. return result;
  6542. }
  6543. /**
  6544. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6545. * the same `toStringTag`.
  6546. *
  6547. * **Note:** This function only supports comparing values with tags of
  6548. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6549. *
  6550. * @private
  6551. * @param {Object} object The object to compare.
  6552. * @param {Object} other The other object to compare.
  6553. * @param {string} tag The `toStringTag` of the objects to compare.
  6554. * @param {Function} equalFunc The function to determine equivalents of values.
  6555. * @param {Function} customizer The function to customize comparisons.
  6556. * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
  6557. * for more details.
  6558. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6559. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6560. */
  6561. function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
  6562. switch (tag) {
  6563. case dataViewTag:
  6564. if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
  6565. return false;
  6566. }
  6567. object = object.buffer;
  6568. other = other.buffer;
  6569. case arrayBufferTag:
  6570. if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6571. return false;
  6572. }
  6573. return true;
  6574. case boolTag:
  6575. case dateTag:
  6576. case numberTag:
  6577. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6578. // Invalid dates are coerced to `NaN`.
  6579. return eq(+object, +other);
  6580. case errorTag:
  6581. return object.name == other.name && object.message == other.message;
  6582. case regexpTag:
  6583. case stringTag:
  6584. // Coerce regexes to strings and treat strings, primitives and objects,
  6585. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6586. // for more details.
  6587. return object == other + '';
  6588. case mapTag:
  6589. var convert = mapToArray;
  6590. case setTag:
  6591. var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
  6592. convert || (convert = setToArray);
  6593. if (object.size != other.size && !isPartial) {
  6594. return false;
  6595. }
  6596. // Assume cyclic values are equal.
  6597. var stacked = stack.get(object);
  6598. if (stacked) {
  6599. return stacked == other;
  6600. }
  6601. bitmask |= UNORDERED_COMPARE_FLAG;
  6602. // Recursively compare objects (susceptible to call stack limits).
  6603. stack.set(object, other);
  6604. var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);
  6605. stack['delete'](object);
  6606. return result;
  6607. case symbolTag:
  6608. if (symbolValueOf) {
  6609. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6610. }
  6611. }
  6612. return false;
  6613. }
  6614. /**
  6615. * A specialized version of `baseIsEqualDeep` for objects with support for
  6616. * partial deep comparisons.
  6617. *
  6618. * @private
  6619. * @param {Object} object The object to compare.
  6620. * @param {Object} other The other object to compare.
  6621. * @param {Function} equalFunc The function to determine equivalents of values.
  6622. * @param {Function} customizer The function to customize comparisons.
  6623. * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
  6624. * for more details.
  6625. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6626. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6627. */
  6628. function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
  6629. var isPartial = bitmask & PARTIAL_COMPARE_FLAG,
  6630. objProps = keys(object),
  6631. objLength = objProps.length,
  6632. othProps = keys(other),
  6633. othLength = othProps.length;
  6634. if (objLength != othLength && !isPartial) {
  6635. return false;
  6636. }
  6637. var index = objLength;
  6638. while (index--) {
  6639. var key = objProps[index];
  6640. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6641. return false;
  6642. }
  6643. }
  6644. // Assume cyclic values are equal.
  6645. var stacked = stack.get(object);
  6646. if (stacked && stack.get(other)) {
  6647. return stacked == other;
  6648. }
  6649. var result = true;
  6650. stack.set(object, other);
  6651. stack.set(other, object);
  6652. var skipCtor = isPartial;
  6653. while (++index < objLength) {
  6654. key = objProps[index];
  6655. var objValue = object[key],
  6656. othValue = other[key];
  6657. if (customizer) {
  6658. var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
  6659. }
  6660. // Recursively compare objects (susceptible to call stack limits).
  6661. if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack) : compared)) {
  6662. result = false;
  6663. break;
  6664. }
  6665. skipCtor || (skipCtor = key == 'constructor');
  6666. }
  6667. if (result && !skipCtor) {
  6668. var objCtor = object.constructor,
  6669. othCtor = other.constructor;
  6670. // Non `Object` object instances with different constructors are not equal.
  6671. if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6672. result = false;
  6673. }
  6674. }
  6675. stack['delete'](object);
  6676. stack['delete'](other);
  6677. return result;
  6678. }
  6679. /**
  6680. * Gets the data for `map`.
  6681. *
  6682. * @private
  6683. * @param {Object} map The map to query.
  6684. * @param {string} key The reference key.
  6685. * @returns {*} Returns the map data.
  6686. */
  6687. function getMapData(map, key) {
  6688. var data = map.__data__;
  6689. return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
  6690. }
  6691. /**
  6692. * Gets the property names, values, and compare flags of `object`.
  6693. *
  6694. * @private
  6695. * @param {Object} object The object to query.
  6696. * @returns {Array} Returns the match data of `object`.
  6697. */
  6698. function getMatchData(object) {
  6699. var result = keys(object),
  6700. length = result.length;
  6701. while (length--) {
  6702. var key = result[length],
  6703. value = object[key];
  6704. result[length] = [key, value, isStrictComparable(value)];
  6705. }
  6706. return result;
  6707. }
  6708. /**
  6709. * Gets the native function at `key` of `object`.
  6710. *
  6711. * @private
  6712. * @param {Object} object The object to query.
  6713. * @param {string} key The key of the method to get.
  6714. * @returns {*} Returns the function if it's native, else `undefined`.
  6715. */
  6716. function getNative(object, key) {
  6717. var value = getValue(object, key);
  6718. return baseIsNative(value) ? value : undefined;
  6719. }
  6720. /**
  6721. * Gets the `toStringTag` of `value`.
  6722. *
  6723. * @private
  6724. * @param {*} value The value to query.
  6725. * @returns {string} Returns the `toStringTag`.
  6726. */
  6727. var getTag = baseGetTag;
  6728. // Fallback for data views, maps, sets, and weak maps in IE 11,
  6729. // for data views in Edge < 14, and promises in Node.js.
  6730. if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
  6731. getTag = function getTag(value) {
  6732. var result = objectToString.call(value),
  6733. Ctor = result == objectTag ? value.constructor : undefined,
  6734. ctorString = Ctor ? toSource(Ctor) : undefined;
  6735. if (ctorString) {
  6736. switch (ctorString) {
  6737. case dataViewCtorString:
  6738. return dataViewTag;
  6739. case mapCtorString:
  6740. return mapTag;
  6741. case promiseCtorString:
  6742. return promiseTag;
  6743. case setCtorString:
  6744. return setTag;
  6745. case weakMapCtorString:
  6746. return weakMapTag;
  6747. }
  6748. }
  6749. return result;
  6750. };
  6751. }
  6752. /**
  6753. * Checks if `path` exists on `object`.
  6754. *
  6755. * @private
  6756. * @param {Object} object The object to query.
  6757. * @param {Array|string} path The path to check.
  6758. * @param {Function} hasFunc The function to check properties.
  6759. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6760. */
  6761. function hasPath(object, path, hasFunc) {
  6762. path = isKey(path, object) ? [path] : castPath(path);
  6763. var result,
  6764. index = -1,
  6765. length = path.length;
  6766. while (++index < length) {
  6767. var key = toKey(path[index]);
  6768. if (!(result = object != null && hasFunc(object, key))) {
  6769. break;
  6770. }
  6771. object = object[key];
  6772. }
  6773. if (result) {
  6774. return result;
  6775. }
  6776. var length = object ? object.length : 0;
  6777. return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
  6778. }
  6779. /**
  6780. * Checks if `value` is a valid array-like index.
  6781. *
  6782. * @private
  6783. * @param {*} value The value to check.
  6784. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6785. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6786. */
  6787. function isIndex(value, length) {
  6788. length = length == null ? MAX_SAFE_INTEGER : length;
  6789. return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
  6790. }
  6791. /**
  6792. * Checks if `value` is a property name and not a property path.
  6793. *
  6794. * @private
  6795. * @param {*} value The value to check.
  6796. * @param {Object} [object] The object to query keys on.
  6797. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  6798. */
  6799. function isKey(value, object) {
  6800. if (isArray(value)) {
  6801. return false;
  6802. }
  6803. var type = _typeof(value);
  6804. if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) {
  6805. return true;
  6806. }
  6807. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
  6808. }
  6809. /**
  6810. * Checks if `value` is suitable for use as unique object key.
  6811. *
  6812. * @private
  6813. * @param {*} value The value to check.
  6814. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  6815. */
  6816. function isKeyable(value) {
  6817. var type = _typeof(value);
  6818. return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
  6819. }
  6820. /**
  6821. * Checks if `func` has its source masked.
  6822. *
  6823. * @private
  6824. * @param {Function} func The function to check.
  6825. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  6826. */
  6827. function isMasked(func) {
  6828. return !!maskSrcKey && maskSrcKey in func;
  6829. }
  6830. /**
  6831. * Checks if `value` is likely a prototype object.
  6832. *
  6833. * @private
  6834. * @param {*} value The value to check.
  6835. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  6836. */
  6837. function isPrototype(value) {
  6838. var Ctor = value && value.constructor,
  6839. proto = typeof Ctor == 'function' && Ctor.prototype || objectProto;
  6840. return value === proto;
  6841. }
  6842. /**
  6843. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  6844. *
  6845. * @private
  6846. * @param {*} value The value to check.
  6847. * @returns {boolean} Returns `true` if `value` if suitable for strict
  6848. * equality comparisons, else `false`.
  6849. */
  6850. function isStrictComparable(value) {
  6851. return value === value && !isObject(value);
  6852. }
  6853. /**
  6854. * A specialized version of `matchesProperty` for source values suitable
  6855. * for strict equality comparisons, i.e. `===`.
  6856. *
  6857. * @private
  6858. * @param {string} key The key of the property to get.
  6859. * @param {*} srcValue The value to match.
  6860. * @returns {Function} Returns the new spec function.
  6861. */
  6862. function matchesStrictComparable(key, srcValue) {
  6863. return function (object) {
  6864. if (object == null) {
  6865. return false;
  6866. }
  6867. return object[key] === srcValue && (srcValue !== undefined || key in Object(object));
  6868. };
  6869. }
  6870. /**
  6871. * Gets the parent value at `path` of `object`.
  6872. *
  6873. * @private
  6874. * @param {Object} object The object to query.
  6875. * @param {Array} path The path to get the parent value of.
  6876. * @returns {*} Returns the parent value.
  6877. */
  6878. function parent(object, path) {
  6879. return path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
  6880. }
  6881. /**
  6882. * Converts `string` to a property path array.
  6883. *
  6884. * @private
  6885. * @param {string} string The string to convert.
  6886. * @returns {Array} Returns the property path array.
  6887. */
  6888. var stringToPath = memoize(function (string) {
  6889. string = toString(string);
  6890. var result = [];
  6891. if (reLeadingDot.test(string)) {
  6892. result.push('');
  6893. }
  6894. string.replace(rePropName, function (match, number, quote, string) {
  6895. result.push(quote ? string.replace(reEscapeChar, '$1') : number || match);
  6896. });
  6897. return result;
  6898. });
  6899. /**
  6900. * Converts `value` to a string key if it's not a string or symbol.
  6901. *
  6902. * @private
  6903. * @param {*} value The value to inspect.
  6904. * @returns {string|symbol} Returns the key.
  6905. */
  6906. function toKey(value) {
  6907. if (typeof value == 'string' || isSymbol(value)) {
  6908. return value;
  6909. }
  6910. var result = value + '';
  6911. return result == '0' && 1 / value == -INFINITY ? '-0' : result;
  6912. }
  6913. /**
  6914. * Converts `func` to its source code.
  6915. *
  6916. * @private
  6917. * @param {Function} func The function to process.
  6918. * @returns {string} Returns the source code.
  6919. */
  6920. function toSource(func) {
  6921. if (func != null) {
  6922. try {
  6923. return funcToString.call(func);
  6924. } catch (e) {}
  6925. try {
  6926. return func + '';
  6927. } catch (e) {}
  6928. }
  6929. return '';
  6930. }
  6931. /**
  6932. * Gets the last element of `array`.
  6933. *
  6934. * @static
  6935. * @memberOf _
  6936. * @since 0.1.0
  6937. * @category Array
  6938. * @param {Array} array The array to query.
  6939. * @returns {*} Returns the last element of `array`.
  6940. * @example
  6941. *
  6942. * _.last([1, 2, 3]);
  6943. * // => 3
  6944. */
  6945. function last(array) {
  6946. var length = array ? array.length : 0;
  6947. return length ? array[length - 1] : undefined;
  6948. }
  6949. /**
  6950. * Removes all elements from `array` that `predicate` returns truthy for
  6951. * and returns an array of the removed elements. The predicate is invoked
  6952. * with three arguments: (value, index, array).
  6953. *
  6954. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  6955. * to pull elements from an array by value.
  6956. *
  6957. * @static
  6958. * @memberOf _
  6959. * @since 2.0.0
  6960. * @category Array
  6961. * @param {Array} array The array to modify.
  6962. * @param {Function} [predicate=_.identity]
  6963. * The function invoked per iteration.
  6964. * @returns {Array} Returns the new array of removed elements.
  6965. * @example
  6966. *
  6967. * var array = [1, 2, 3, 4];
  6968. * var evens = _.remove(array, function(n) {
  6969. * return n % 2 == 0;
  6970. * });
  6971. *
  6972. * console.log(array);
  6973. * // => [1, 3]
  6974. *
  6975. * console.log(evens);
  6976. * // => [2, 4]
  6977. */
  6978. function remove(array, predicate) {
  6979. var result = [];
  6980. if (!(array && array.length)) {
  6981. return result;
  6982. }
  6983. var index = -1,
  6984. indexes = [],
  6985. length = array.length;
  6986. predicate = baseIteratee(predicate, 3);
  6987. while (++index < length) {
  6988. var value = array[index];
  6989. if (predicate(value, index, array)) {
  6990. result.push(value);
  6991. indexes.push(index);
  6992. }
  6993. }
  6994. basePullAt(array, indexes);
  6995. return result;
  6996. }
  6997. /**
  6998. * Creates a function that memoizes the result of `func`. If `resolver` is
  6999. * provided, it determines the cache key for storing the result based on the
  7000. * arguments provided to the memoized function. By default, the first argument
  7001. * provided to the memoized function is used as the map cache key. The `func`
  7002. * is invoked with the `this` binding of the memoized function.
  7003. *
  7004. * **Note:** The cache is exposed as the `cache` property on the memoized
  7005. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  7006. * constructor with one whose instances implement the
  7007. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  7008. * method interface of `delete`, `get`, `has`, and `set`.
  7009. *
  7010. * @static
  7011. * @memberOf _
  7012. * @since 0.1.0
  7013. * @category Function
  7014. * @param {Function} func The function to have its output memoized.
  7015. * @param {Function} [resolver] The function to resolve the cache key.
  7016. * @returns {Function} Returns the new memoized function.
  7017. * @example
  7018. *
  7019. * var object = { 'a': 1, 'b': 2 };
  7020. * var other = { 'c': 3, 'd': 4 };
  7021. *
  7022. * var values = _.memoize(_.values);
  7023. * values(object);
  7024. * // => [1, 2]
  7025. *
  7026. * values(other);
  7027. * // => [3, 4]
  7028. *
  7029. * object.a = 2;
  7030. * values(object);
  7031. * // => [1, 2]
  7032. *
  7033. * // Modify the result cache.
  7034. * values.cache.set(object, ['a', 'b']);
  7035. * values(object);
  7036. * // => ['a', 'b']
  7037. *
  7038. * // Replace `_.memoize.Cache`.
  7039. * _.memoize.Cache = WeakMap;
  7040. */
  7041. function memoize(func, resolver) {
  7042. if (typeof func != 'function' || resolver && typeof resolver != 'function') {
  7043. throw new TypeError(FUNC_ERROR_TEXT);
  7044. }
  7045. var memoized = function memoized() {
  7046. var args = arguments,
  7047. key = resolver ? resolver.apply(this, args) : args[0],
  7048. cache = memoized.cache;
  7049. if (cache.has(key)) {
  7050. return cache.get(key);
  7051. }
  7052. var result = func.apply(this, args);
  7053. memoized.cache = cache.set(key, result);
  7054. return result;
  7055. };
  7056. memoized.cache = new (memoize.Cache || MapCache)();
  7057. return memoized;
  7058. }
  7059. // Assign cache to `_.memoize`.
  7060. memoize.Cache = MapCache;
  7061. /**
  7062. * Performs a
  7063. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7064. * comparison between two values to determine if they are equivalent.
  7065. *
  7066. * @static
  7067. * @memberOf _
  7068. * @since 4.0.0
  7069. * @category Lang
  7070. * @param {*} value The value to compare.
  7071. * @param {*} other The other value to compare.
  7072. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  7073. * @example
  7074. *
  7075. * var object = { 'a': 1 };
  7076. * var other = { 'a': 1 };
  7077. *
  7078. * _.eq(object, object);
  7079. * // => true
  7080. *
  7081. * _.eq(object, other);
  7082. * // => false
  7083. *
  7084. * _.eq('a', 'a');
  7085. * // => true
  7086. *
  7087. * _.eq('a', Object('a'));
  7088. * // => false
  7089. *
  7090. * _.eq(NaN, NaN);
  7091. * // => true
  7092. */
  7093. function eq(value, other) {
  7094. return value === other || value !== value && other !== other;
  7095. }
  7096. /**
  7097. * Checks if `value` is likely an `arguments` object.
  7098. *
  7099. * @static
  7100. * @memberOf _
  7101. * @since 0.1.0
  7102. * @category Lang
  7103. * @param {*} value The value to check.
  7104. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  7105. * else `false`.
  7106. * @example
  7107. *
  7108. * _.isArguments(function() { return arguments; }());
  7109. * // => true
  7110. *
  7111. * _.isArguments([1, 2, 3]);
  7112. * // => false
  7113. */
  7114. function isArguments(value) {
  7115. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  7116. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
  7117. }
  7118. /**
  7119. * Checks if `value` is classified as an `Array` object.
  7120. *
  7121. * @static
  7122. * @memberOf _
  7123. * @since 0.1.0
  7124. * @category Lang
  7125. * @param {*} value The value to check.
  7126. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  7127. * @example
  7128. *
  7129. * _.isArray([1, 2, 3]);
  7130. * // => true
  7131. *
  7132. * _.isArray(document.body.children);
  7133. * // => false
  7134. *
  7135. * _.isArray('abc');
  7136. * // => false
  7137. *
  7138. * _.isArray(_.noop);
  7139. * // => false
  7140. */
  7141. var isArray = Array.isArray;
  7142. /**
  7143. * Checks if `value` is array-like. A value is considered array-like if it's
  7144. * not a function and has a `value.length` that's an integer greater than or
  7145. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  7146. *
  7147. * @static
  7148. * @memberOf _
  7149. * @since 4.0.0
  7150. * @category Lang
  7151. * @param {*} value The value to check.
  7152. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  7153. * @example
  7154. *
  7155. * _.isArrayLike([1, 2, 3]);
  7156. * // => true
  7157. *
  7158. * _.isArrayLike(document.body.children);
  7159. * // => true
  7160. *
  7161. * _.isArrayLike('abc');
  7162. * // => true
  7163. *
  7164. * _.isArrayLike(_.noop);
  7165. * // => false
  7166. */
  7167. function isArrayLike(value) {
  7168. return value != null && isLength(value.length) && !isFunction(value);
  7169. }
  7170. /**
  7171. * This method is like `_.isArrayLike` except that it also checks if `value`
  7172. * is an object.
  7173. *
  7174. * @static
  7175. * @memberOf _
  7176. * @since 4.0.0
  7177. * @category Lang
  7178. * @param {*} value The value to check.
  7179. * @returns {boolean} Returns `true` if `value` is an array-like object,
  7180. * else `false`.
  7181. * @example
  7182. *
  7183. * _.isArrayLikeObject([1, 2, 3]);
  7184. * // => true
  7185. *
  7186. * _.isArrayLikeObject(document.body.children);
  7187. * // => true
  7188. *
  7189. * _.isArrayLikeObject('abc');
  7190. * // => false
  7191. *
  7192. * _.isArrayLikeObject(_.noop);
  7193. * // => false
  7194. */
  7195. function isArrayLikeObject(value) {
  7196. return isObjectLike(value) && isArrayLike(value);
  7197. }
  7198. /**
  7199. * Checks if `value` is classified as a `Function` object.
  7200. *
  7201. * @static
  7202. * @memberOf _
  7203. * @since 0.1.0
  7204. * @category Lang
  7205. * @param {*} value The value to check.
  7206. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  7207. * @example
  7208. *
  7209. * _.isFunction(_);
  7210. * // => true
  7211. *
  7212. * _.isFunction(/abc/);
  7213. * // => false
  7214. */
  7215. function isFunction(value) {
  7216. // The use of `Object#toString` avoids issues with the `typeof` operator
  7217. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  7218. var tag = isObject(value) ? objectToString.call(value) : '';
  7219. return tag == funcTag || tag == genTag;
  7220. }
  7221. /**
  7222. * Checks if `value` is a valid array-like length.
  7223. *
  7224. * **Note:** This method is loosely based on
  7225. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  7226. *
  7227. * @static
  7228. * @memberOf _
  7229. * @since 4.0.0
  7230. * @category Lang
  7231. * @param {*} value The value to check.
  7232. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  7233. * @example
  7234. *
  7235. * _.isLength(3);
  7236. * // => true
  7237. *
  7238. * _.isLength(Number.MIN_VALUE);
  7239. * // => false
  7240. *
  7241. * _.isLength(Infinity);
  7242. * // => false
  7243. *
  7244. * _.isLength('3');
  7245. * // => false
  7246. */
  7247. function isLength(value) {
  7248. return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  7249. }
  7250. /**
  7251. * Checks if `value` is the
  7252. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  7253. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  7254. *
  7255. * @static
  7256. * @memberOf _
  7257. * @since 0.1.0
  7258. * @category Lang
  7259. * @param {*} value The value to check.
  7260. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  7261. * @example
  7262. *
  7263. * _.isObject({});
  7264. * // => true
  7265. *
  7266. * _.isObject([1, 2, 3]);
  7267. * // => true
  7268. *
  7269. * _.isObject(_.noop);
  7270. * // => true
  7271. *
  7272. * _.isObject(null);
  7273. * // => false
  7274. */
  7275. function isObject(value) {
  7276. var type = _typeof(value);
  7277. return !!value && (type == 'object' || type == 'function');
  7278. }
  7279. /**
  7280. * Checks if `value` is object-like. A value is object-like if it's not `null`
  7281. * and has a `typeof` result of "object".
  7282. *
  7283. * @static
  7284. * @memberOf _
  7285. * @since 4.0.0
  7286. * @category Lang
  7287. * @param {*} value The value to check.
  7288. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  7289. * @example
  7290. *
  7291. * _.isObjectLike({});
  7292. * // => true
  7293. *
  7294. * _.isObjectLike([1, 2, 3]);
  7295. * // => true
  7296. *
  7297. * _.isObjectLike(_.noop);
  7298. * // => false
  7299. *
  7300. * _.isObjectLike(null);
  7301. * // => false
  7302. */
  7303. function isObjectLike(value) {
  7304. return !!value && _typeof(value) == 'object';
  7305. }
  7306. /**
  7307. * Checks if `value` is classified as a `Symbol` primitive or object.
  7308. *
  7309. * @static
  7310. * @memberOf _
  7311. * @since 4.0.0
  7312. * @category Lang
  7313. * @param {*} value The value to check.
  7314. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  7315. * @example
  7316. *
  7317. * _.isSymbol(Symbol.iterator);
  7318. * // => true
  7319. *
  7320. * _.isSymbol('abc');
  7321. * // => false
  7322. */
  7323. function isSymbol(value) {
  7324. return _typeof(value) == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag;
  7325. }
  7326. /**
  7327. * Checks if `value` is classified as a typed array.
  7328. *
  7329. * @static
  7330. * @memberOf _
  7331. * @since 3.0.0
  7332. * @category Lang
  7333. * @param {*} value The value to check.
  7334. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  7335. * @example
  7336. *
  7337. * _.isTypedArray(new Uint8Array);
  7338. * // => true
  7339. *
  7340. * _.isTypedArray([]);
  7341. * // => false
  7342. */
  7343. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  7344. /**
  7345. * Converts `value` to a string. An empty string is returned for `null`
  7346. * and `undefined` values. The sign of `-0` is preserved.
  7347. *
  7348. * @static
  7349. * @memberOf _
  7350. * @since 4.0.0
  7351. * @category Lang
  7352. * @param {*} value The value to process.
  7353. * @returns {string} Returns the string.
  7354. * @example
  7355. *
  7356. * _.toString(null);
  7357. * // => ''
  7358. *
  7359. * _.toString(-0);
  7360. * // => '-0'
  7361. *
  7362. * _.toString([1, 2, 3]);
  7363. * // => '1,2,3'
  7364. */
  7365. function toString(value) {
  7366. return value == null ? '' : baseToString(value);
  7367. }
  7368. /**
  7369. * Gets the value at `path` of `object`. If the resolved value is
  7370. * `undefined`, the `defaultValue` is returned in its place.
  7371. *
  7372. * @static
  7373. * @memberOf _
  7374. * @since 3.7.0
  7375. * @category Object
  7376. * @param {Object} object The object to query.
  7377. * @param {Array|string} path The path of the property to get.
  7378. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  7379. * @returns {*} Returns the resolved value.
  7380. * @example
  7381. *
  7382. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  7383. *
  7384. * _.get(object, 'a[0].b.c');
  7385. * // => 3
  7386. *
  7387. * _.get(object, ['a', '0', 'b', 'c']);
  7388. * // => 3
  7389. *
  7390. * _.get(object, 'a.b.c', 'default');
  7391. * // => 'default'
  7392. */
  7393. function get(object, path, defaultValue) {
  7394. var result = object == null ? undefined : baseGet(object, path);
  7395. return result === undefined ? defaultValue : result;
  7396. }
  7397. /**
  7398. * Checks if `path` is a direct or inherited property of `object`.
  7399. *
  7400. * @static
  7401. * @memberOf _
  7402. * @since 4.0.0
  7403. * @category Object
  7404. * @param {Object} object The object to query.
  7405. * @param {Array|string} path The path to check.
  7406. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  7407. * @example
  7408. *
  7409. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  7410. *
  7411. * _.hasIn(object, 'a');
  7412. * // => true
  7413. *
  7414. * _.hasIn(object, 'a.b');
  7415. * // => true
  7416. *
  7417. * _.hasIn(object, ['a', 'b']);
  7418. * // => true
  7419. *
  7420. * _.hasIn(object, 'b');
  7421. * // => false
  7422. */
  7423. function hasIn(object, path) {
  7424. return object != null && hasPath(object, path, baseHasIn);
  7425. }
  7426. /**
  7427. * Creates an array of the own enumerable property names of `object`.
  7428. *
  7429. * **Note:** Non-object values are coerced to objects. See the
  7430. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7431. * for more details.
  7432. *
  7433. * @static
  7434. * @since 0.1.0
  7435. * @memberOf _
  7436. * @category Object
  7437. * @param {Object} object The object to query.
  7438. * @returns {Array} Returns the array of property names.
  7439. * @example
  7440. *
  7441. * function Foo() {
  7442. * this.a = 1;
  7443. * this.b = 2;
  7444. * }
  7445. *
  7446. * Foo.prototype.c = 3;
  7447. *
  7448. * _.keys(new Foo);
  7449. * // => ['a', 'b'] (iteration order is not guaranteed)
  7450. *
  7451. * _.keys('hi');
  7452. * // => ['0', '1']
  7453. */
  7454. function keys(object) {
  7455. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  7456. }
  7457. /**
  7458. * This method returns the first argument it receives.
  7459. *
  7460. * @static
  7461. * @since 0.1.0
  7462. * @memberOf _
  7463. * @category Util
  7464. * @param {*} value Any value.
  7465. * @returns {*} Returns `value`.
  7466. * @example
  7467. *
  7468. * var object = { 'a': 1 };
  7469. *
  7470. * console.log(_.identity(object) === object);
  7471. * // => true
  7472. */
  7473. function identity(value) {
  7474. return value;
  7475. }
  7476. /**
  7477. * Creates a function that returns the value at `path` of a given object.
  7478. *
  7479. * @static
  7480. * @memberOf _
  7481. * @since 2.4.0
  7482. * @category Util
  7483. * @param {Array|string} path The path of the property to get.
  7484. * @returns {Function} Returns the new accessor function.
  7485. * @example
  7486. *
  7487. * var objects = [
  7488. * { 'a': { 'b': 2 } },
  7489. * { 'a': { 'b': 1 } }
  7490. * ];
  7491. *
  7492. * _.map(objects, _.property('a.b'));
  7493. * // => [2, 1]
  7494. *
  7495. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  7496. * // => [1, 2]
  7497. */
  7498. function property(path) {
  7499. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  7500. }
  7501. module.exports = remove;
  7502. /***/ }),
  7503. /***/ 7820:
  7504. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  7505. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  7506. /**
  7507. * lodash (Custom Build) <https://lodash.com/>
  7508. * Build: `lodash modularize exports="npm" -o ./`
  7509. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  7510. * Released under MIT license <https://lodash.com/license>
  7511. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  7512. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  7513. */
  7514. /** Used as references for various `Number` constants. */
  7515. var MAX_SAFE_INTEGER = 9007199254740991;
  7516. /** `Object#toString` result references. */
  7517. var argsTag = '[object Arguments]',
  7518. funcTag = '[object Function]',
  7519. genTag = '[object GeneratorFunction]',
  7520. mapTag = '[object Map]',
  7521. objectTag = '[object Object]',
  7522. promiseTag = '[object Promise]',
  7523. setTag = '[object Set]',
  7524. weakMapTag = '[object WeakMap]';
  7525. var dataViewTag = '[object DataView]';
  7526. /**
  7527. * Used to match `RegExp`
  7528. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  7529. */
  7530. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  7531. /** Used to detect host constructors (Safari). */
  7532. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  7533. /** Used to detect unsigned integer values. */
  7534. var reIsUint = /^(?:0|[1-9]\d*)$/;
  7535. /** Detect free variable `global` from Node.js. */
  7536. var freeGlobal = (typeof __webpack_require__.g === "undefined" ? "undefined" : _typeof(__webpack_require__.g)) == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  7537. /** Detect free variable `self`. */
  7538. var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
  7539. /** Used as a reference to the global object. */
  7540. var root = freeGlobal || freeSelf || Function('return this')();
  7541. /**
  7542. * A specialized version of `_.map` for arrays without support for iteratee
  7543. * shorthands.
  7544. *
  7545. * @private
  7546. * @param {Array} [array] The array to iterate over.
  7547. * @param {Function} iteratee The function invoked per iteration.
  7548. * @returns {Array} Returns the new mapped array.
  7549. */
  7550. function arrayMap(array, iteratee) {
  7551. var index = -1,
  7552. length = array ? array.length : 0,
  7553. result = Array(length);
  7554. while (++index < length) {
  7555. result[index] = iteratee(array[index], index, array);
  7556. }
  7557. return result;
  7558. }
  7559. /**
  7560. * The base implementation of `_.times` without support for iteratee shorthands
  7561. * or max array length checks.
  7562. *
  7563. * @private
  7564. * @param {number} n The number of times to invoke `iteratee`.
  7565. * @param {Function} iteratee The function invoked per iteration.
  7566. * @returns {Array} Returns the array of results.
  7567. */
  7568. function baseTimes(n, iteratee) {
  7569. var index = -1,
  7570. result = Array(n);
  7571. while (++index < n) {
  7572. result[index] = iteratee(index);
  7573. }
  7574. return result;
  7575. }
  7576. /**
  7577. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  7578. * of key-value pairs for `object` corresponding to the property names of `props`.
  7579. *
  7580. * @private
  7581. * @param {Object} object The object to query.
  7582. * @param {Array} props The property names to get values for.
  7583. * @returns {Object} Returns the key-value pairs.
  7584. */
  7585. function baseToPairs(object, props) {
  7586. return arrayMap(props, function (key) {
  7587. return [key, object[key]];
  7588. });
  7589. }
  7590. /**
  7591. * Gets the value at `key` of `object`.
  7592. *
  7593. * @private
  7594. * @param {Object} [object] The object to query.
  7595. * @param {string} key The key of the property to get.
  7596. * @returns {*} Returns the property value.
  7597. */
  7598. function getValue(object, key) {
  7599. return object == null ? undefined : object[key];
  7600. }
  7601. /**
  7602. * Checks if `value` is a host object in IE < 9.
  7603. *
  7604. * @private
  7605. * @param {*} value The value to check.
  7606. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  7607. */
  7608. function isHostObject(value) {
  7609. // Many host objects are `Object` objects that can coerce to strings
  7610. // despite having improperly defined `toString` methods.
  7611. var result = false;
  7612. if (value != null && typeof value.toString != 'function') {
  7613. try {
  7614. result = !!(value + '');
  7615. } catch (e) {}
  7616. }
  7617. return result;
  7618. }
  7619. /**
  7620. * Converts `map` to its key-value pairs.
  7621. *
  7622. * @private
  7623. * @param {Object} map The map to convert.
  7624. * @returns {Array} Returns the key-value pairs.
  7625. */
  7626. function mapToArray(map) {
  7627. var index = -1,
  7628. result = Array(map.size);
  7629. map.forEach(function (value, key) {
  7630. result[++index] = [key, value];
  7631. });
  7632. return result;
  7633. }
  7634. /**
  7635. * Creates a unary function that invokes `func` with its argument transformed.
  7636. *
  7637. * @private
  7638. * @param {Function} func The function to wrap.
  7639. * @param {Function} transform The argument transform.
  7640. * @returns {Function} Returns the new function.
  7641. */
  7642. function overArg(func, transform) {
  7643. return function (arg) {
  7644. return func(transform(arg));
  7645. };
  7646. }
  7647. /**
  7648. * Converts `set` to its value-value pairs.
  7649. *
  7650. * @private
  7651. * @param {Object} set The set to convert.
  7652. * @returns {Array} Returns the value-value pairs.
  7653. */
  7654. function setToPairs(set) {
  7655. var index = -1,
  7656. result = Array(set.size);
  7657. set.forEach(function (value) {
  7658. result[++index] = [value, value];
  7659. });
  7660. return result;
  7661. }
  7662. /** Used for built-in method references. */
  7663. var funcProto = Function.prototype,
  7664. objectProto = Object.prototype;
  7665. /** Used to detect overreaching core-js shims. */
  7666. var coreJsData = root['__core-js_shared__'];
  7667. /** Used to detect methods masquerading as native. */
  7668. var maskSrcKey = function () {
  7669. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  7670. return uid ? 'Symbol(src)_1.' + uid : '';
  7671. }();
  7672. /** Used to resolve the decompiled source of functions. */
  7673. var funcToString = funcProto.toString;
  7674. /** Used to check objects for own properties. */
  7675. var hasOwnProperty = objectProto.hasOwnProperty;
  7676. /**
  7677. * Used to resolve the
  7678. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  7679. * of values.
  7680. */
  7681. var objectToString = objectProto.toString;
  7682. /** Used to detect if a method is native. */
  7683. var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
  7684. /** Built-in value references. */
  7685. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  7686. /* Built-in method references for those with the same name as other `lodash` methods. */
  7687. var nativeKeys = overArg(Object.keys, Object);
  7688. /* Built-in method references that are verified to be native. */
  7689. var DataView = getNative(root, 'DataView'),
  7690. Map = getNative(root, 'Map'),
  7691. Promise = getNative(root, 'Promise'),
  7692. Set = getNative(root, 'Set'),
  7693. WeakMap = getNative(root, 'WeakMap');
  7694. /** Used to detect maps, sets, and weakmaps. */
  7695. var dataViewCtorString = toSource(DataView),
  7696. mapCtorString = toSource(Map),
  7697. promiseCtorString = toSource(Promise),
  7698. setCtorString = toSource(Set),
  7699. weakMapCtorString = toSource(WeakMap);
  7700. /**
  7701. * Creates an array of the enumerable property names of the array-like `value`.
  7702. *
  7703. * @private
  7704. * @param {*} value The value to query.
  7705. * @param {boolean} inherited Specify returning inherited property names.
  7706. * @returns {Array} Returns the array of property names.
  7707. */
  7708. function arrayLikeKeys(value, inherited) {
  7709. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  7710. // Safari 9 makes `arguments.length` enumerable in strict mode.
  7711. var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
  7712. var length = result.length,
  7713. skipIndexes = !!length;
  7714. for (var key in value) {
  7715. if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
  7716. result.push(key);
  7717. }
  7718. }
  7719. return result;
  7720. }
  7721. /**
  7722. * The base implementation of `getTag`.
  7723. *
  7724. * @private
  7725. * @param {*} value The value to query.
  7726. * @returns {string} Returns the `toStringTag`.
  7727. */
  7728. function baseGetTag(value) {
  7729. return objectToString.call(value);
  7730. }
  7731. /**
  7732. * The base implementation of `_.isNative` without bad shim checks.
  7733. *
  7734. * @private
  7735. * @param {*} value The value to check.
  7736. * @returns {boolean} Returns `true` if `value` is a native function,
  7737. * else `false`.
  7738. */
  7739. function baseIsNative(value) {
  7740. if (!isObject(value) || isMasked(value)) {
  7741. return false;
  7742. }
  7743. var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
  7744. return pattern.test(toSource(value));
  7745. }
  7746. /**
  7747. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  7748. *
  7749. * @private
  7750. * @param {Object} object The object to query.
  7751. * @returns {Array} Returns the array of property names.
  7752. */
  7753. function baseKeys(object) {
  7754. if (!isPrototype(object)) {
  7755. return nativeKeys(object);
  7756. }
  7757. var result = [];
  7758. for (var key in Object(object)) {
  7759. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  7760. result.push(key);
  7761. }
  7762. }
  7763. return result;
  7764. }
  7765. /**
  7766. * Creates a `_.toPairs` or `_.toPairsIn` function.
  7767. *
  7768. * @private
  7769. * @param {Function} keysFunc The function to get the keys of a given object.
  7770. * @returns {Function} Returns the new pairs function.
  7771. */
  7772. function createToPairs(keysFunc) {
  7773. return function (object) {
  7774. var tag = getTag(object);
  7775. if (tag == mapTag) {
  7776. return mapToArray(object);
  7777. }
  7778. if (tag == setTag) {
  7779. return setToPairs(object);
  7780. }
  7781. return baseToPairs(object, keysFunc(object));
  7782. };
  7783. }
  7784. /**
  7785. * Gets the native function at `key` of `object`.
  7786. *
  7787. * @private
  7788. * @param {Object} object The object to query.
  7789. * @param {string} key The key of the method to get.
  7790. * @returns {*} Returns the function if it's native, else `undefined`.
  7791. */
  7792. function getNative(object, key) {
  7793. var value = getValue(object, key);
  7794. return baseIsNative(value) ? value : undefined;
  7795. }
  7796. /**
  7797. * Gets the `toStringTag` of `value`.
  7798. *
  7799. * @private
  7800. * @param {*} value The value to query.
  7801. * @returns {string} Returns the `toStringTag`.
  7802. */
  7803. var getTag = baseGetTag;
  7804. // Fallback for data views, maps, sets, and weak maps in IE 11,
  7805. // for data views in Edge < 14, and promises in Node.js.
  7806. if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
  7807. getTag = function getTag(value) {
  7808. var result = objectToString.call(value),
  7809. Ctor = result == objectTag ? value.constructor : undefined,
  7810. ctorString = Ctor ? toSource(Ctor) : undefined;
  7811. if (ctorString) {
  7812. switch (ctorString) {
  7813. case dataViewCtorString:
  7814. return dataViewTag;
  7815. case mapCtorString:
  7816. return mapTag;
  7817. case promiseCtorString:
  7818. return promiseTag;
  7819. case setCtorString:
  7820. return setTag;
  7821. case weakMapCtorString:
  7822. return weakMapTag;
  7823. }
  7824. }
  7825. return result;
  7826. };
  7827. }
  7828. /**
  7829. * Checks if `value` is a valid array-like index.
  7830. *
  7831. * @private
  7832. * @param {*} value The value to check.
  7833. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  7834. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  7835. */
  7836. function isIndex(value, length) {
  7837. length = length == null ? MAX_SAFE_INTEGER : length;
  7838. return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
  7839. }
  7840. /**
  7841. * Checks if `func` has its source masked.
  7842. *
  7843. * @private
  7844. * @param {Function} func The function to check.
  7845. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7846. */
  7847. function isMasked(func) {
  7848. return !!maskSrcKey && maskSrcKey in func;
  7849. }
  7850. /**
  7851. * Checks if `value` is likely a prototype object.
  7852. *
  7853. * @private
  7854. * @param {*} value The value to check.
  7855. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7856. */
  7857. function isPrototype(value) {
  7858. var Ctor = value && value.constructor,
  7859. proto = typeof Ctor == 'function' && Ctor.prototype || objectProto;
  7860. return value === proto;
  7861. }
  7862. /**
  7863. * Converts `func` to its source code.
  7864. *
  7865. * @private
  7866. * @param {Function} func The function to process.
  7867. * @returns {string} Returns the source code.
  7868. */
  7869. function toSource(func) {
  7870. if (func != null) {
  7871. try {
  7872. return funcToString.call(func);
  7873. } catch (e) {}
  7874. try {
  7875. return func + '';
  7876. } catch (e) {}
  7877. }
  7878. return '';
  7879. }
  7880. /**
  7881. * Checks if `value` is likely an `arguments` object.
  7882. *
  7883. * @static
  7884. * @memberOf _
  7885. * @since 0.1.0
  7886. * @category Lang
  7887. * @param {*} value The value to check.
  7888. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  7889. * else `false`.
  7890. * @example
  7891. *
  7892. * _.isArguments(function() { return arguments; }());
  7893. * // => true
  7894. *
  7895. * _.isArguments([1, 2, 3]);
  7896. * // => false
  7897. */
  7898. function isArguments(value) {
  7899. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  7900. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
  7901. }
  7902. /**
  7903. * Checks if `value` is classified as an `Array` object.
  7904. *
  7905. * @static
  7906. * @memberOf _
  7907. * @since 0.1.0
  7908. * @category Lang
  7909. * @param {*} value The value to check.
  7910. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  7911. * @example
  7912. *
  7913. * _.isArray([1, 2, 3]);
  7914. * // => true
  7915. *
  7916. * _.isArray(document.body.children);
  7917. * // => false
  7918. *
  7919. * _.isArray('abc');
  7920. * // => false
  7921. *
  7922. * _.isArray(_.noop);
  7923. * // => false
  7924. */
  7925. var isArray = Array.isArray;
  7926. /**
  7927. * Checks if `value` is array-like. A value is considered array-like if it's
  7928. * not a function and has a `value.length` that's an integer greater than or
  7929. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  7930. *
  7931. * @static
  7932. * @memberOf _
  7933. * @since 4.0.0
  7934. * @category Lang
  7935. * @param {*} value The value to check.
  7936. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  7937. * @example
  7938. *
  7939. * _.isArrayLike([1, 2, 3]);
  7940. * // => true
  7941. *
  7942. * _.isArrayLike(document.body.children);
  7943. * // => true
  7944. *
  7945. * _.isArrayLike('abc');
  7946. * // => true
  7947. *
  7948. * _.isArrayLike(_.noop);
  7949. * // => false
  7950. */
  7951. function isArrayLike(value) {
  7952. return value != null && isLength(value.length) && !isFunction(value);
  7953. }
  7954. /**
  7955. * This method is like `_.isArrayLike` except that it also checks if `value`
  7956. * is an object.
  7957. *
  7958. * @static
  7959. * @memberOf _
  7960. * @since 4.0.0
  7961. * @category Lang
  7962. * @param {*} value The value to check.
  7963. * @returns {boolean} Returns `true` if `value` is an array-like object,
  7964. * else `false`.
  7965. * @example
  7966. *
  7967. * _.isArrayLikeObject([1, 2, 3]);
  7968. * // => true
  7969. *
  7970. * _.isArrayLikeObject(document.body.children);
  7971. * // => true
  7972. *
  7973. * _.isArrayLikeObject('abc');
  7974. * // => false
  7975. *
  7976. * _.isArrayLikeObject(_.noop);
  7977. * // => false
  7978. */
  7979. function isArrayLikeObject(value) {
  7980. return isObjectLike(value) && isArrayLike(value);
  7981. }
  7982. /**
  7983. * Checks if `value` is classified as a `Function` object.
  7984. *
  7985. * @static
  7986. * @memberOf _
  7987. * @since 0.1.0
  7988. * @category Lang
  7989. * @param {*} value The value to check.
  7990. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  7991. * @example
  7992. *
  7993. * _.isFunction(_);
  7994. * // => true
  7995. *
  7996. * _.isFunction(/abc/);
  7997. * // => false
  7998. */
  7999. function isFunction(value) {
  8000. // The use of `Object#toString` avoids issues with the `typeof` operator
  8001. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  8002. var tag = isObject(value) ? objectToString.call(value) : '';
  8003. return tag == funcTag || tag == genTag;
  8004. }
  8005. /**
  8006. * Checks if `value` is a valid array-like length.
  8007. *
  8008. * **Note:** This method is loosely based on
  8009. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  8010. *
  8011. * @static
  8012. * @memberOf _
  8013. * @since 4.0.0
  8014. * @category Lang
  8015. * @param {*} value The value to check.
  8016. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  8017. * @example
  8018. *
  8019. * _.isLength(3);
  8020. * // => true
  8021. *
  8022. * _.isLength(Number.MIN_VALUE);
  8023. * // => false
  8024. *
  8025. * _.isLength(Infinity);
  8026. * // => false
  8027. *
  8028. * _.isLength('3');
  8029. * // => false
  8030. */
  8031. function isLength(value) {
  8032. return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  8033. }
  8034. /**
  8035. * Checks if `value` is the
  8036. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  8037. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  8038. *
  8039. * @static
  8040. * @memberOf _
  8041. * @since 0.1.0
  8042. * @category Lang
  8043. * @param {*} value The value to check.
  8044. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  8045. * @example
  8046. *
  8047. * _.isObject({});
  8048. * // => true
  8049. *
  8050. * _.isObject([1, 2, 3]);
  8051. * // => true
  8052. *
  8053. * _.isObject(_.noop);
  8054. * // => true
  8055. *
  8056. * _.isObject(null);
  8057. * // => false
  8058. */
  8059. function isObject(value) {
  8060. var type = _typeof(value);
  8061. return !!value && (type == 'object' || type == 'function');
  8062. }
  8063. /**
  8064. * Checks if `value` is object-like. A value is object-like if it's not `null`
  8065. * and has a `typeof` result of "object".
  8066. *
  8067. * @static
  8068. * @memberOf _
  8069. * @since 4.0.0
  8070. * @category Lang
  8071. * @param {*} value The value to check.
  8072. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  8073. * @example
  8074. *
  8075. * _.isObjectLike({});
  8076. * // => true
  8077. *
  8078. * _.isObjectLike([1, 2, 3]);
  8079. * // => true
  8080. *
  8081. * _.isObjectLike(_.noop);
  8082. * // => false
  8083. *
  8084. * _.isObjectLike(null);
  8085. * // => false
  8086. */
  8087. function isObjectLike(value) {
  8088. return !!value && _typeof(value) == 'object';
  8089. }
  8090. /**
  8091. * Creates an array of the own enumerable property names of `object`.
  8092. *
  8093. * **Note:** Non-object values are coerced to objects. See the
  8094. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  8095. * for more details.
  8096. *
  8097. * @static
  8098. * @since 0.1.0
  8099. * @memberOf _
  8100. * @category Object
  8101. * @param {Object} object The object to query.
  8102. * @returns {Array} Returns the array of property names.
  8103. * @example
  8104. *
  8105. * function Foo() {
  8106. * this.a = 1;
  8107. * this.b = 2;
  8108. * }
  8109. *
  8110. * Foo.prototype.c = 3;
  8111. *
  8112. * _.keys(new Foo);
  8113. * // => ['a', 'b'] (iteration order is not guaranteed)
  8114. *
  8115. * _.keys('hi');
  8116. * // => ['0', '1']
  8117. */
  8118. function keys(object) {
  8119. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  8120. }
  8121. /**
  8122. * Creates an array of own enumerable string keyed-value pairs for `object`
  8123. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  8124. * entries are returned.
  8125. *
  8126. * @static
  8127. * @memberOf _
  8128. * @since 4.0.0
  8129. * @alias entries
  8130. * @category Object
  8131. * @param {Object} object The object to query.
  8132. * @returns {Array} Returns the key-value pairs.
  8133. * @example
  8134. *
  8135. * function Foo() {
  8136. * this.a = 1;
  8137. * this.b = 2;
  8138. * }
  8139. *
  8140. * Foo.prototype.c = 3;
  8141. *
  8142. * _.toPairs(new Foo);
  8143. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  8144. */
  8145. var toPairs = createToPairs(keys);
  8146. module.exports = toPairs;
  8147. /***/ }),
  8148. /***/ 9819:
  8149. /***/ (function(module, exports, __webpack_require__) {
  8150. /* module decorator */ module = __webpack_require__.nmd(module);
  8151. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  8152. /**
  8153. * lodash (Custom Build) <https://lodash.com/>
  8154. * Build: `lodash modularize exports="npm" -o ./`
  8155. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  8156. * Released under MIT license <https://lodash.com/license>
  8157. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  8158. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  8159. */
  8160. /** Used as the size to enable large array optimizations. */
  8161. var LARGE_ARRAY_SIZE = 200;
  8162. /** Used as the `TypeError` message for "Functions" methods. */
  8163. var FUNC_ERROR_TEXT = 'Expected a function';
  8164. /** Used to stand-in for `undefined` hash values. */
  8165. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  8166. /** Used to compose bitmasks for comparison styles. */
  8167. var UNORDERED_COMPARE_FLAG = 1,
  8168. PARTIAL_COMPARE_FLAG = 2;
  8169. /** Used as references for various `Number` constants. */
  8170. var INFINITY = 1 / 0,
  8171. MAX_SAFE_INTEGER = 9007199254740991;
  8172. /** `Object#toString` result references. */
  8173. var argsTag = '[object Arguments]',
  8174. arrayTag = '[object Array]',
  8175. boolTag = '[object Boolean]',
  8176. dateTag = '[object Date]',
  8177. errorTag = '[object Error]',
  8178. funcTag = '[object Function]',
  8179. genTag = '[object GeneratorFunction]',
  8180. mapTag = '[object Map]',
  8181. numberTag = '[object Number]',
  8182. objectTag = '[object Object]',
  8183. promiseTag = '[object Promise]',
  8184. regexpTag = '[object RegExp]',
  8185. setTag = '[object Set]',
  8186. stringTag = '[object String]',
  8187. symbolTag = '[object Symbol]',
  8188. weakMapTag = '[object WeakMap]';
  8189. var arrayBufferTag = '[object ArrayBuffer]',
  8190. dataViewTag = '[object DataView]',
  8191. float32Tag = '[object Float32Array]',
  8192. float64Tag = '[object Float64Array]',
  8193. int8Tag = '[object Int8Array]',
  8194. int16Tag = '[object Int16Array]',
  8195. int32Tag = '[object Int32Array]',
  8196. uint8Tag = '[object Uint8Array]',
  8197. uint8ClampedTag = '[object Uint8ClampedArray]',
  8198. uint16Tag = '[object Uint16Array]',
  8199. uint32Tag = '[object Uint32Array]';
  8200. /** Used to match property names within property paths. */
  8201. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  8202. reIsPlainProp = /^\w*$/,
  8203. reLeadingDot = /^\./,
  8204. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  8205. /**
  8206. * Used to match `RegExp`
  8207. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  8208. */
  8209. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  8210. /** Used to match backslashes in property paths. */
  8211. var reEscapeChar = /\\(\\)?/g;
  8212. /** Used to detect host constructors (Safari). */
  8213. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  8214. /** Used to detect unsigned integer values. */
  8215. var reIsUint = /^(?:0|[1-9]\d*)$/;
  8216. /** Used to identify `toStringTag` values of typed arrays. */
  8217. var typedArrayTags = {};
  8218. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
  8219. typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
  8220. /** Detect free variable `global` from Node.js. */
  8221. var freeGlobal = (typeof __webpack_require__.g === "undefined" ? "undefined" : _typeof(__webpack_require__.g)) == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  8222. /** Detect free variable `self`. */
  8223. var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
  8224. /** Used as a reference to the global object. */
  8225. var root = freeGlobal || freeSelf || Function('return this')();
  8226. /** Detect free variable `exports`. */
  8227. var freeExports = ( false ? 0 : _typeof(exports)) == 'object' && exports && !exports.nodeType && exports;
  8228. /** Detect free variable `module`. */
  8229. var freeModule = freeExports && ( false ? 0 : _typeof(module)) == 'object' && module && !module.nodeType && module;
  8230. /** Detect the popular CommonJS extension `module.exports`. */
  8231. var moduleExports = freeModule && freeModule.exports === freeExports;
  8232. /** Detect free variable `process` from Node.js. */
  8233. var freeProcess = moduleExports && freeGlobal.process;
  8234. /** Used to access faster Node.js helpers. */
  8235. var nodeUtil = function () {
  8236. try {
  8237. return freeProcess && freeProcess.binding('util');
  8238. } catch (e) {}
  8239. }();
  8240. /* Node.js helper references. */
  8241. var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  8242. /**
  8243. * A specialized version of `_.includes` for arrays without support for
  8244. * specifying an index to search from.
  8245. *
  8246. * @private
  8247. * @param {Array} [array] The array to inspect.
  8248. * @param {*} target The value to search for.
  8249. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  8250. */
  8251. function arrayIncludes(array, value) {
  8252. var length = array ? array.length : 0;
  8253. return !!length && baseIndexOf(array, value, 0) > -1;
  8254. }
  8255. /**
  8256. * This function is like `arrayIncludes` except that it accepts a comparator.
  8257. *
  8258. * @private
  8259. * @param {Array} [array] The array to inspect.
  8260. * @param {*} target The value to search for.
  8261. * @param {Function} comparator The comparator invoked per element.
  8262. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  8263. */
  8264. function arrayIncludesWith(array, value, comparator) {
  8265. var index = -1,
  8266. length = array ? array.length : 0;
  8267. while (++index < length) {
  8268. if (comparator(value, array[index])) {
  8269. return true;
  8270. }
  8271. }
  8272. return false;
  8273. }
  8274. /**
  8275. * A specialized version of `_.some` for arrays without support for iteratee
  8276. * shorthands.
  8277. *
  8278. * @private
  8279. * @param {Array} [array] The array to iterate over.
  8280. * @param {Function} predicate The function invoked per iteration.
  8281. * @returns {boolean} Returns `true` if any element passes the predicate check,
  8282. * else `false`.
  8283. */
  8284. function arraySome(array, predicate) {
  8285. var index = -1,
  8286. length = array ? array.length : 0;
  8287. while (++index < length) {
  8288. if (predicate(array[index], index, array)) {
  8289. return true;
  8290. }
  8291. }
  8292. return false;
  8293. }
  8294. /**
  8295. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  8296. * support for iteratee shorthands.
  8297. *
  8298. * @private
  8299. * @param {Array} array The array to inspect.
  8300. * @param {Function} predicate The function invoked per iteration.
  8301. * @param {number} fromIndex The index to search from.
  8302. * @param {boolean} [fromRight] Specify iterating from right to left.
  8303. * @returns {number} Returns the index of the matched value, else `-1`.
  8304. */
  8305. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  8306. var length = array.length,
  8307. index = fromIndex + (fromRight ? 1 : -1);
  8308. while (fromRight ? index-- : ++index < length) {
  8309. if (predicate(array[index], index, array)) {
  8310. return index;
  8311. }
  8312. }
  8313. return -1;
  8314. }
  8315. /**
  8316. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  8317. *
  8318. * @private
  8319. * @param {Array} array The array to inspect.
  8320. * @param {*} value The value to search for.
  8321. * @param {number} fromIndex The index to search from.
  8322. * @returns {number} Returns the index of the matched value, else `-1`.
  8323. */
  8324. function baseIndexOf(array, value, fromIndex) {
  8325. if (value !== value) {
  8326. return baseFindIndex(array, baseIsNaN, fromIndex);
  8327. }
  8328. var index = fromIndex - 1,
  8329. length = array.length;
  8330. while (++index < length) {
  8331. if (array[index] === value) {
  8332. return index;
  8333. }
  8334. }
  8335. return -1;
  8336. }
  8337. /**
  8338. * The base implementation of `_.isNaN` without support for number objects.
  8339. *
  8340. * @private
  8341. * @param {*} value The value to check.
  8342. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  8343. */
  8344. function baseIsNaN(value) {
  8345. return value !== value;
  8346. }
  8347. /**
  8348. * The base implementation of `_.property` without support for deep paths.
  8349. *
  8350. * @private
  8351. * @param {string} key The key of the property to get.
  8352. * @returns {Function} Returns the new accessor function.
  8353. */
  8354. function baseProperty(key) {
  8355. return function (object) {
  8356. return object == null ? undefined : object[key];
  8357. };
  8358. }
  8359. /**
  8360. * The base implementation of `_.times` without support for iteratee shorthands
  8361. * or max array length checks.
  8362. *
  8363. * @private
  8364. * @param {number} n The number of times to invoke `iteratee`.
  8365. * @param {Function} iteratee The function invoked per iteration.
  8366. * @returns {Array} Returns the array of results.
  8367. */
  8368. function baseTimes(n, iteratee) {
  8369. var index = -1,
  8370. result = Array(n);
  8371. while (++index < n) {
  8372. result[index] = iteratee(index);
  8373. }
  8374. return result;
  8375. }
  8376. /**
  8377. * The base implementation of `_.unary` without support for storing metadata.
  8378. *
  8379. * @private
  8380. * @param {Function} func The function to cap arguments for.
  8381. * @returns {Function} Returns the new capped function.
  8382. */
  8383. function baseUnary(func) {
  8384. return function (value) {
  8385. return func(value);
  8386. };
  8387. }
  8388. /**
  8389. * Checks if a cache value for `key` exists.
  8390. *
  8391. * @private
  8392. * @param {Object} cache The cache to query.
  8393. * @param {string} key The key of the entry to check.
  8394. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  8395. */
  8396. function cacheHas(cache, key) {
  8397. return cache.has(key);
  8398. }
  8399. /**
  8400. * Gets the value at `key` of `object`.
  8401. *
  8402. * @private
  8403. * @param {Object} [object] The object to query.
  8404. * @param {string} key The key of the property to get.
  8405. * @returns {*} Returns the property value.
  8406. */
  8407. function getValue(object, key) {
  8408. return object == null ? undefined : object[key];
  8409. }
  8410. /**
  8411. * Checks if `value` is a host object in IE < 9.
  8412. *
  8413. * @private
  8414. * @param {*} value The value to check.
  8415. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  8416. */
  8417. function isHostObject(value) {
  8418. // Many host objects are `Object` objects that can coerce to strings
  8419. // despite having improperly defined `toString` methods.
  8420. var result = false;
  8421. if (value != null && typeof value.toString != 'function') {
  8422. try {
  8423. result = !!(value + '');
  8424. } catch (e) {}
  8425. }
  8426. return result;
  8427. }
  8428. /**
  8429. * Converts `map` to its key-value pairs.
  8430. *
  8431. * @private
  8432. * @param {Object} map The map to convert.
  8433. * @returns {Array} Returns the key-value pairs.
  8434. */
  8435. function mapToArray(map) {
  8436. var index = -1,
  8437. result = Array(map.size);
  8438. map.forEach(function (value, key) {
  8439. result[++index] = [key, value];
  8440. });
  8441. return result;
  8442. }
  8443. /**
  8444. * Creates a unary function that invokes `func` with its argument transformed.
  8445. *
  8446. * @private
  8447. * @param {Function} func The function to wrap.
  8448. * @param {Function} transform The argument transform.
  8449. * @returns {Function} Returns the new function.
  8450. */
  8451. function overArg(func, transform) {
  8452. return function (arg) {
  8453. return func(transform(arg));
  8454. };
  8455. }
  8456. /**
  8457. * Converts `set` to an array of its values.
  8458. *
  8459. * @private
  8460. * @param {Object} set The set to convert.
  8461. * @returns {Array} Returns the values.
  8462. */
  8463. function setToArray(set) {
  8464. var index = -1,
  8465. result = Array(set.size);
  8466. set.forEach(function (value) {
  8467. result[++index] = value;
  8468. });
  8469. return result;
  8470. }
  8471. /** Used for built-in method references. */
  8472. var arrayProto = Array.prototype,
  8473. funcProto = Function.prototype,
  8474. objectProto = Object.prototype;
  8475. /** Used to detect overreaching core-js shims. */
  8476. var coreJsData = root['__core-js_shared__'];
  8477. /** Used to detect methods masquerading as native. */
  8478. var maskSrcKey = function () {
  8479. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  8480. return uid ? 'Symbol(src)_1.' + uid : '';
  8481. }();
  8482. /** Used to resolve the decompiled source of functions. */
  8483. var funcToString = funcProto.toString;
  8484. /** Used to check objects for own properties. */
  8485. var hasOwnProperty = objectProto.hasOwnProperty;
  8486. /**
  8487. * Used to resolve the
  8488. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  8489. * of values.
  8490. */
  8491. var objectToString = objectProto.toString;
  8492. /** Used to detect if a method is native. */
  8493. var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
  8494. /** Built-in value references. */
  8495. var _Symbol = root.Symbol,
  8496. Uint8Array = root.Uint8Array,
  8497. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  8498. splice = arrayProto.splice;
  8499. /* Built-in method references for those with the same name as other `lodash` methods. */
  8500. var nativeKeys = overArg(Object.keys, Object);
  8501. /* Built-in method references that are verified to be native. */
  8502. var DataView = getNative(root, 'DataView'),
  8503. Map = getNative(root, 'Map'),
  8504. Promise = getNative(root, 'Promise'),
  8505. Set = getNative(root, 'Set'),
  8506. WeakMap = getNative(root, 'WeakMap'),
  8507. nativeCreate = getNative(Object, 'create');
  8508. /** Used to detect maps, sets, and weakmaps. */
  8509. var dataViewCtorString = toSource(DataView),
  8510. mapCtorString = toSource(Map),
  8511. promiseCtorString = toSource(Promise),
  8512. setCtorString = toSource(Set),
  8513. weakMapCtorString = toSource(WeakMap);
  8514. /** Used to convert symbols to primitives and strings. */
  8515. var symbolProto = _Symbol ? _Symbol.prototype : undefined,
  8516. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  8517. symbolToString = symbolProto ? symbolProto.toString : undefined;
  8518. /**
  8519. * Creates a hash object.
  8520. *
  8521. * @private
  8522. * @constructor
  8523. * @param {Array} [entries] The key-value pairs to cache.
  8524. */
  8525. function Hash(entries) {
  8526. var index = -1,
  8527. length = entries ? entries.length : 0;
  8528. this.clear();
  8529. while (++index < length) {
  8530. var entry = entries[index];
  8531. this.set(entry[0], entry[1]);
  8532. }
  8533. }
  8534. /**
  8535. * Removes all key-value entries from the hash.
  8536. *
  8537. * @private
  8538. * @name clear
  8539. * @memberOf Hash
  8540. */
  8541. function hashClear() {
  8542. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  8543. }
  8544. /**
  8545. * Removes `key` and its value from the hash.
  8546. *
  8547. * @private
  8548. * @name delete
  8549. * @memberOf Hash
  8550. * @param {Object} hash The hash to modify.
  8551. * @param {string} key The key of the value to remove.
  8552. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  8553. */
  8554. function hashDelete(key) {
  8555. return this.has(key) && delete this.__data__[key];
  8556. }
  8557. /**
  8558. * Gets the hash value for `key`.
  8559. *
  8560. * @private
  8561. * @name get
  8562. * @memberOf Hash
  8563. * @param {string} key The key of the value to get.
  8564. * @returns {*} Returns the entry value.
  8565. */
  8566. function hashGet(key) {
  8567. var data = this.__data__;
  8568. if (nativeCreate) {
  8569. var result = data[key];
  8570. return result === HASH_UNDEFINED ? undefined : result;
  8571. }
  8572. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  8573. }
  8574. /**
  8575. * Checks if a hash value for `key` exists.
  8576. *
  8577. * @private
  8578. * @name has
  8579. * @memberOf Hash
  8580. * @param {string} key The key of the entry to check.
  8581. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  8582. */
  8583. function hashHas(key) {
  8584. var data = this.__data__;
  8585. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  8586. }
  8587. /**
  8588. * Sets the hash `key` to `value`.
  8589. *
  8590. * @private
  8591. * @name set
  8592. * @memberOf Hash
  8593. * @param {string} key The key of the value to set.
  8594. * @param {*} value The value to set.
  8595. * @returns {Object} Returns the hash instance.
  8596. */
  8597. function hashSet(key, value) {
  8598. var data = this.__data__;
  8599. data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
  8600. return this;
  8601. }
  8602. // Add methods to `Hash`.
  8603. Hash.prototype.clear = hashClear;
  8604. Hash.prototype['delete'] = hashDelete;
  8605. Hash.prototype.get = hashGet;
  8606. Hash.prototype.has = hashHas;
  8607. Hash.prototype.set = hashSet;
  8608. /**
  8609. * Creates an list cache object.
  8610. *
  8611. * @private
  8612. * @constructor
  8613. * @param {Array} [entries] The key-value pairs to cache.
  8614. */
  8615. function ListCache(entries) {
  8616. var index = -1,
  8617. length = entries ? entries.length : 0;
  8618. this.clear();
  8619. while (++index < length) {
  8620. var entry = entries[index];
  8621. this.set(entry[0], entry[1]);
  8622. }
  8623. }
  8624. /**
  8625. * Removes all key-value entries from the list cache.
  8626. *
  8627. * @private
  8628. * @name clear
  8629. * @memberOf ListCache
  8630. */
  8631. function listCacheClear() {
  8632. this.__data__ = [];
  8633. }
  8634. /**
  8635. * Removes `key` and its value from the list cache.
  8636. *
  8637. * @private
  8638. * @name delete
  8639. * @memberOf ListCache
  8640. * @param {string} key The key of the value to remove.
  8641. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  8642. */
  8643. function listCacheDelete(key) {
  8644. var data = this.__data__,
  8645. index = assocIndexOf(data, key);
  8646. if (index < 0) {
  8647. return false;
  8648. }
  8649. var lastIndex = data.length - 1;
  8650. if (index == lastIndex) {
  8651. data.pop();
  8652. } else {
  8653. splice.call(data, index, 1);
  8654. }
  8655. return true;
  8656. }
  8657. /**
  8658. * Gets the list cache value for `key`.
  8659. *
  8660. * @private
  8661. * @name get
  8662. * @memberOf ListCache
  8663. * @param {string} key The key of the value to get.
  8664. * @returns {*} Returns the entry value.
  8665. */
  8666. function listCacheGet(key) {
  8667. var data = this.__data__,
  8668. index = assocIndexOf(data, key);
  8669. return index < 0 ? undefined : data[index][1];
  8670. }
  8671. /**
  8672. * Checks if a list cache value for `key` exists.
  8673. *
  8674. * @private
  8675. * @name has
  8676. * @memberOf ListCache
  8677. * @param {string} key The key of the entry to check.
  8678. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  8679. */
  8680. function listCacheHas(key) {
  8681. return assocIndexOf(this.__data__, key) > -1;
  8682. }
  8683. /**
  8684. * Sets the list cache `key` to `value`.
  8685. *
  8686. * @private
  8687. * @name set
  8688. * @memberOf ListCache
  8689. * @param {string} key The key of the value to set.
  8690. * @param {*} value The value to set.
  8691. * @returns {Object} Returns the list cache instance.
  8692. */
  8693. function listCacheSet(key, value) {
  8694. var data = this.__data__,
  8695. index = assocIndexOf(data, key);
  8696. if (index < 0) {
  8697. data.push([key, value]);
  8698. } else {
  8699. data[index][1] = value;
  8700. }
  8701. return this;
  8702. }
  8703. // Add methods to `ListCache`.
  8704. ListCache.prototype.clear = listCacheClear;
  8705. ListCache.prototype['delete'] = listCacheDelete;
  8706. ListCache.prototype.get = listCacheGet;
  8707. ListCache.prototype.has = listCacheHas;
  8708. ListCache.prototype.set = listCacheSet;
  8709. /**
  8710. * Creates a map cache object to store key-value pairs.
  8711. *
  8712. * @private
  8713. * @constructor
  8714. * @param {Array} [entries] The key-value pairs to cache.
  8715. */
  8716. function MapCache(entries) {
  8717. var index = -1,
  8718. length = entries ? entries.length : 0;
  8719. this.clear();
  8720. while (++index < length) {
  8721. var entry = entries[index];
  8722. this.set(entry[0], entry[1]);
  8723. }
  8724. }
  8725. /**
  8726. * Removes all key-value entries from the map.
  8727. *
  8728. * @private
  8729. * @name clear
  8730. * @memberOf MapCache
  8731. */
  8732. function mapCacheClear() {
  8733. this.__data__ = {
  8734. 'hash': new Hash(),
  8735. 'map': new (Map || ListCache)(),
  8736. 'string': new Hash()
  8737. };
  8738. }
  8739. /**
  8740. * Removes `key` and its value from the map.
  8741. *
  8742. * @private
  8743. * @name delete
  8744. * @memberOf MapCache
  8745. * @param {string} key The key of the value to remove.
  8746. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  8747. */
  8748. function mapCacheDelete(key) {
  8749. return getMapData(this, key)['delete'](key);
  8750. }
  8751. /**
  8752. * Gets the map value for `key`.
  8753. *
  8754. * @private
  8755. * @name get
  8756. * @memberOf MapCache
  8757. * @param {string} key The key of the value to get.
  8758. * @returns {*} Returns the entry value.
  8759. */
  8760. function mapCacheGet(key) {
  8761. return getMapData(this, key).get(key);
  8762. }
  8763. /**
  8764. * Checks if a map value for `key` exists.
  8765. *
  8766. * @private
  8767. * @name has
  8768. * @memberOf MapCache
  8769. * @param {string} key The key of the entry to check.
  8770. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  8771. */
  8772. function mapCacheHas(key) {
  8773. return getMapData(this, key).has(key);
  8774. }
  8775. /**
  8776. * Sets the map `key` to `value`.
  8777. *
  8778. * @private
  8779. * @name set
  8780. * @memberOf MapCache
  8781. * @param {string} key The key of the value to set.
  8782. * @param {*} value The value to set.
  8783. * @returns {Object} Returns the map cache instance.
  8784. */
  8785. function mapCacheSet(key, value) {
  8786. getMapData(this, key).set(key, value);
  8787. return this;
  8788. }
  8789. // Add methods to `MapCache`.
  8790. MapCache.prototype.clear = mapCacheClear;
  8791. MapCache.prototype['delete'] = mapCacheDelete;
  8792. MapCache.prototype.get = mapCacheGet;
  8793. MapCache.prototype.has = mapCacheHas;
  8794. MapCache.prototype.set = mapCacheSet;
  8795. /**
  8796. *
  8797. * Creates an array cache object to store unique values.
  8798. *
  8799. * @private
  8800. * @constructor
  8801. * @param {Array} [values] The values to cache.
  8802. */
  8803. function SetCache(values) {
  8804. var index = -1,
  8805. length = values ? values.length : 0;
  8806. this.__data__ = new MapCache();
  8807. while (++index < length) {
  8808. this.add(values[index]);
  8809. }
  8810. }
  8811. /**
  8812. * Adds `value` to the array cache.
  8813. *
  8814. * @private
  8815. * @name add
  8816. * @memberOf SetCache
  8817. * @alias push
  8818. * @param {*} value The value to cache.
  8819. * @returns {Object} Returns the cache instance.
  8820. */
  8821. function setCacheAdd(value) {
  8822. this.__data__.set(value, HASH_UNDEFINED);
  8823. return this;
  8824. }
  8825. /**
  8826. * Checks if `value` is in the array cache.
  8827. *
  8828. * @private
  8829. * @name has
  8830. * @memberOf SetCache
  8831. * @param {*} value The value to search for.
  8832. * @returns {number} Returns `true` if `value` is found, else `false`.
  8833. */
  8834. function setCacheHas(value) {
  8835. return this.__data__.has(value);
  8836. }
  8837. // Add methods to `SetCache`.
  8838. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  8839. SetCache.prototype.has = setCacheHas;
  8840. /**
  8841. * Creates a stack cache object to store key-value pairs.
  8842. *
  8843. * @private
  8844. * @constructor
  8845. * @param {Array} [entries] The key-value pairs to cache.
  8846. */
  8847. function Stack(entries) {
  8848. this.__data__ = new ListCache(entries);
  8849. }
  8850. /**
  8851. * Removes all key-value entries from the stack.
  8852. *
  8853. * @private
  8854. * @name clear
  8855. * @memberOf Stack
  8856. */
  8857. function stackClear() {
  8858. this.__data__ = new ListCache();
  8859. }
  8860. /**
  8861. * Removes `key` and its value from the stack.
  8862. *
  8863. * @private
  8864. * @name delete
  8865. * @memberOf Stack
  8866. * @param {string} key The key of the value to remove.
  8867. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  8868. */
  8869. function stackDelete(key) {
  8870. return this.__data__['delete'](key);
  8871. }
  8872. /**
  8873. * Gets the stack value for `key`.
  8874. *
  8875. * @private
  8876. * @name get
  8877. * @memberOf Stack
  8878. * @param {string} key The key of the value to get.
  8879. * @returns {*} Returns the entry value.
  8880. */
  8881. function stackGet(key) {
  8882. return this.__data__.get(key);
  8883. }
  8884. /**
  8885. * Checks if a stack value for `key` exists.
  8886. *
  8887. * @private
  8888. * @name has
  8889. * @memberOf Stack
  8890. * @param {string} key The key of the entry to check.
  8891. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  8892. */
  8893. function stackHas(key) {
  8894. return this.__data__.has(key);
  8895. }
  8896. /**
  8897. * Sets the stack `key` to `value`.
  8898. *
  8899. * @private
  8900. * @name set
  8901. * @memberOf Stack
  8902. * @param {string} key The key of the value to set.
  8903. * @param {*} value The value to set.
  8904. * @returns {Object} Returns the stack cache instance.
  8905. */
  8906. function stackSet(key, value) {
  8907. var cache = this.__data__;
  8908. if (cache instanceof ListCache) {
  8909. var pairs = cache.__data__;
  8910. if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
  8911. pairs.push([key, value]);
  8912. return this;
  8913. }
  8914. cache = this.__data__ = new MapCache(pairs);
  8915. }
  8916. cache.set(key, value);
  8917. return this;
  8918. }
  8919. // Add methods to `Stack`.
  8920. Stack.prototype.clear = stackClear;
  8921. Stack.prototype['delete'] = stackDelete;
  8922. Stack.prototype.get = stackGet;
  8923. Stack.prototype.has = stackHas;
  8924. Stack.prototype.set = stackSet;
  8925. /**
  8926. * Creates an array of the enumerable property names of the array-like `value`.
  8927. *
  8928. * @private
  8929. * @param {*} value The value to query.
  8930. * @param {boolean} inherited Specify returning inherited property names.
  8931. * @returns {Array} Returns the array of property names.
  8932. */
  8933. function arrayLikeKeys(value, inherited) {
  8934. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  8935. // Safari 9 makes `arguments.length` enumerable in strict mode.
  8936. var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
  8937. var length = result.length,
  8938. skipIndexes = !!length;
  8939. for (var key in value) {
  8940. if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
  8941. result.push(key);
  8942. }
  8943. }
  8944. return result;
  8945. }
  8946. /**
  8947. * Gets the index at which the `key` is found in `array` of key-value pairs.
  8948. *
  8949. * @private
  8950. * @param {Array} array The array to inspect.
  8951. * @param {*} key The key to search for.
  8952. * @returns {number} Returns the index of the matched value, else `-1`.
  8953. */
  8954. function assocIndexOf(array, key) {
  8955. var length = array.length;
  8956. while (length--) {
  8957. if (eq(array[length][0], key)) {
  8958. return length;
  8959. }
  8960. }
  8961. return -1;
  8962. }
  8963. /**
  8964. * The base implementation of `_.get` without support for default values.
  8965. *
  8966. * @private
  8967. * @param {Object} object The object to query.
  8968. * @param {Array|string} path The path of the property to get.
  8969. * @returns {*} Returns the resolved value.
  8970. */
  8971. function baseGet(object, path) {
  8972. path = isKey(path, object) ? [path] : castPath(path);
  8973. var index = 0,
  8974. length = path.length;
  8975. while (object != null && index < length) {
  8976. object = object[toKey(path[index++])];
  8977. }
  8978. return index && index == length ? object : undefined;
  8979. }
  8980. /**
  8981. * The base implementation of `getTag`.
  8982. *
  8983. * @private
  8984. * @param {*} value The value to query.
  8985. * @returns {string} Returns the `toStringTag`.
  8986. */
  8987. function baseGetTag(value) {
  8988. return objectToString.call(value);
  8989. }
  8990. /**
  8991. * The base implementation of `_.hasIn` without support for deep paths.
  8992. *
  8993. * @private
  8994. * @param {Object} [object] The object to query.
  8995. * @param {Array|string} key The key to check.
  8996. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  8997. */
  8998. function baseHasIn(object, key) {
  8999. return object != null && key in Object(object);
  9000. }
  9001. /**
  9002. * The base implementation of `_.isEqual` which supports partial comparisons
  9003. * and tracks traversed objects.
  9004. *
  9005. * @private
  9006. * @param {*} value The value to compare.
  9007. * @param {*} other The other value to compare.
  9008. * @param {Function} [customizer] The function to customize comparisons.
  9009. * @param {boolean} [bitmask] The bitmask of comparison flags.
  9010. * The bitmask may be composed of the following flags:
  9011. * 1 - Unordered comparison
  9012. * 2 - Partial comparison
  9013. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  9014. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  9015. */
  9016. function baseIsEqual(value, other, customizer, bitmask, stack) {
  9017. if (value === other) {
  9018. return true;
  9019. }
  9020. if (value == null || other == null || !isObject(value) && !isObjectLike(other)) {
  9021. return value !== value && other !== other;
  9022. }
  9023. return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);
  9024. }
  9025. /**
  9026. * A specialized version of `baseIsEqual` for arrays and objects which performs
  9027. * deep comparisons and tracks traversed objects enabling objects with circular
  9028. * references to be compared.
  9029. *
  9030. * @private
  9031. * @param {Object} object The object to compare.
  9032. * @param {Object} other The other object to compare.
  9033. * @param {Function} equalFunc The function to determine equivalents of values.
  9034. * @param {Function} [customizer] The function to customize comparisons.
  9035. * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`
  9036. * for more details.
  9037. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  9038. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  9039. */
  9040. function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {
  9041. var objIsArr = isArray(object),
  9042. othIsArr = isArray(other),
  9043. objTag = arrayTag,
  9044. othTag = arrayTag;
  9045. if (!objIsArr) {
  9046. objTag = getTag(object);
  9047. objTag = objTag == argsTag ? objectTag : objTag;
  9048. }
  9049. if (!othIsArr) {
  9050. othTag = getTag(other);
  9051. othTag = othTag == argsTag ? objectTag : othTag;
  9052. }
  9053. var objIsObj = objTag == objectTag && !isHostObject(object),
  9054. othIsObj = othTag == objectTag && !isHostObject(other),
  9055. isSameTag = objTag == othTag;
  9056. if (isSameTag && !objIsObj) {
  9057. stack || (stack = new Stack());
  9058. return objIsArr || isTypedArray(object) ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);
  9059. }
  9060. if (!(bitmask & PARTIAL_COMPARE_FLAG)) {
  9061. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  9062. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  9063. if (objIsWrapped || othIsWrapped) {
  9064. var objUnwrapped = objIsWrapped ? object.value() : object,
  9065. othUnwrapped = othIsWrapped ? other.value() : other;
  9066. stack || (stack = new Stack());
  9067. return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);
  9068. }
  9069. }
  9070. if (!isSameTag) {
  9071. return false;
  9072. }
  9073. stack || (stack = new Stack());
  9074. return equalObjects(object, other, equalFunc, customizer, bitmask, stack);
  9075. }
  9076. /**
  9077. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  9078. *
  9079. * @private
  9080. * @param {Object} object The object to inspect.
  9081. * @param {Object} source The object of property values to match.
  9082. * @param {Array} matchData The property names, values, and compare flags to match.
  9083. * @param {Function} [customizer] The function to customize comparisons.
  9084. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  9085. */
  9086. function baseIsMatch(object, source, matchData, customizer) {
  9087. var index = matchData.length,
  9088. length = index,
  9089. noCustomizer = !customizer;
  9090. if (object == null) {
  9091. return !length;
  9092. }
  9093. object = Object(object);
  9094. while (index--) {
  9095. var data = matchData[index];
  9096. if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
  9097. return false;
  9098. }
  9099. }
  9100. while (++index < length) {
  9101. data = matchData[index];
  9102. var key = data[0],
  9103. objValue = object[key],
  9104. srcValue = data[1];
  9105. if (noCustomizer && data[2]) {
  9106. if (objValue === undefined && !(key in object)) {
  9107. return false;
  9108. }
  9109. } else {
  9110. var stack = new Stack();
  9111. if (customizer) {
  9112. var result = customizer(objValue, srcValue, key, object, source, stack);
  9113. }
  9114. if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result)) {
  9115. return false;
  9116. }
  9117. }
  9118. }
  9119. return true;
  9120. }
  9121. /**
  9122. * The base implementation of `_.isNative` without bad shim checks.
  9123. *
  9124. * @private
  9125. * @param {*} value The value to check.
  9126. * @returns {boolean} Returns `true` if `value` is a native function,
  9127. * else `false`.
  9128. */
  9129. function baseIsNative(value) {
  9130. if (!isObject(value) || isMasked(value)) {
  9131. return false;
  9132. }
  9133. var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
  9134. return pattern.test(toSource(value));
  9135. }
  9136. /**
  9137. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  9138. *
  9139. * @private
  9140. * @param {*} value The value to check.
  9141. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  9142. */
  9143. function baseIsTypedArray(value) {
  9144. return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)];
  9145. }
  9146. /**
  9147. * The base implementation of `_.iteratee`.
  9148. *
  9149. * @private
  9150. * @param {*} [value=_.identity] The value to convert to an iteratee.
  9151. * @returns {Function} Returns the iteratee.
  9152. */
  9153. function baseIteratee(value) {
  9154. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  9155. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  9156. if (typeof value == 'function') {
  9157. return value;
  9158. }
  9159. if (value == null) {
  9160. return identity;
  9161. }
  9162. if (_typeof(value) == 'object') {
  9163. return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
  9164. }
  9165. return property(value);
  9166. }
  9167. /**
  9168. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  9169. *
  9170. * @private
  9171. * @param {Object} object The object to query.
  9172. * @returns {Array} Returns the array of property names.
  9173. */
  9174. function baseKeys(object) {
  9175. if (!isPrototype(object)) {
  9176. return nativeKeys(object);
  9177. }
  9178. var result = [];
  9179. for (var key in Object(object)) {
  9180. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  9181. result.push(key);
  9182. }
  9183. }
  9184. return result;
  9185. }
  9186. /**
  9187. * The base implementation of `_.matches` which doesn't clone `source`.
  9188. *
  9189. * @private
  9190. * @param {Object} source The object of property values to match.
  9191. * @returns {Function} Returns the new spec function.
  9192. */
  9193. function baseMatches(source) {
  9194. var matchData = getMatchData(source);
  9195. if (matchData.length == 1 && matchData[0][2]) {
  9196. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  9197. }
  9198. return function (object) {
  9199. return object === source || baseIsMatch(object, source, matchData);
  9200. };
  9201. }
  9202. /**
  9203. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  9204. *
  9205. * @private
  9206. * @param {string} path The path of the property to get.
  9207. * @param {*} srcValue The value to match.
  9208. * @returns {Function} Returns the new spec function.
  9209. */
  9210. function baseMatchesProperty(path, srcValue) {
  9211. if (isKey(path) && isStrictComparable(srcValue)) {
  9212. return matchesStrictComparable(toKey(path), srcValue);
  9213. }
  9214. return function (object) {
  9215. var objValue = get(object, path);
  9216. return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);
  9217. };
  9218. }
  9219. /**
  9220. * A specialized version of `baseProperty` which supports deep paths.
  9221. *
  9222. * @private
  9223. * @param {Array|string} path The path of the property to get.
  9224. * @returns {Function} Returns the new accessor function.
  9225. */
  9226. function basePropertyDeep(path) {
  9227. return function (object) {
  9228. return baseGet(object, path);
  9229. };
  9230. }
  9231. /**
  9232. * The base implementation of `_.toString` which doesn't convert nullish
  9233. * values to empty strings.
  9234. *
  9235. * @private
  9236. * @param {*} value The value to process.
  9237. * @returns {string} Returns the string.
  9238. */
  9239. function baseToString(value) {
  9240. // Exit early for strings to avoid a performance hit in some environments.
  9241. if (typeof value == 'string') {
  9242. return value;
  9243. }
  9244. if (isSymbol(value)) {
  9245. return symbolToString ? symbolToString.call(value) : '';
  9246. }
  9247. var result = value + '';
  9248. return result == '0' && 1 / value == -INFINITY ? '-0' : result;
  9249. }
  9250. /**
  9251. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  9252. *
  9253. * @private
  9254. * @param {Array} array The array to inspect.
  9255. * @param {Function} [iteratee] The iteratee invoked per element.
  9256. * @param {Function} [comparator] The comparator invoked per element.
  9257. * @returns {Array} Returns the new duplicate free array.
  9258. */
  9259. function baseUniq(array, iteratee, comparator) {
  9260. var index = -1,
  9261. includes = arrayIncludes,
  9262. length = array.length,
  9263. isCommon = true,
  9264. result = [],
  9265. seen = result;
  9266. if (comparator) {
  9267. isCommon = false;
  9268. includes = arrayIncludesWith;
  9269. } else if (length >= LARGE_ARRAY_SIZE) {
  9270. var set = iteratee ? null : createSet(array);
  9271. if (set) {
  9272. return setToArray(set);
  9273. }
  9274. isCommon = false;
  9275. includes = cacheHas;
  9276. seen = new SetCache();
  9277. } else {
  9278. seen = iteratee ? [] : result;
  9279. }
  9280. outer: while (++index < length) {
  9281. var value = array[index],
  9282. computed = iteratee ? iteratee(value) : value;
  9283. value = comparator || value !== 0 ? value : 0;
  9284. if (isCommon && computed === computed) {
  9285. var seenIndex = seen.length;
  9286. while (seenIndex--) {
  9287. if (seen[seenIndex] === computed) {
  9288. continue outer;
  9289. }
  9290. }
  9291. if (iteratee) {
  9292. seen.push(computed);
  9293. }
  9294. result.push(value);
  9295. } else if (!includes(seen, computed, comparator)) {
  9296. if (seen !== result) {
  9297. seen.push(computed);
  9298. }
  9299. result.push(value);
  9300. }
  9301. }
  9302. return result;
  9303. }
  9304. /**
  9305. * Casts `value` to a path array if it's not one.
  9306. *
  9307. * @private
  9308. * @param {*} value The value to inspect.
  9309. * @returns {Array} Returns the cast property path array.
  9310. */
  9311. function castPath(value) {
  9312. return isArray(value) ? value : stringToPath(value);
  9313. }
  9314. /**
  9315. * Creates a set object of `values`.
  9316. *
  9317. * @private
  9318. * @param {Array} values The values to add to the set.
  9319. * @returns {Object} Returns the new set.
  9320. */
  9321. var createSet = !(Set && 1 / setToArray(new Set([, -0]))[1] == INFINITY) ? noop : function (values) {
  9322. return new Set(values);
  9323. };
  9324. /**
  9325. * A specialized version of `baseIsEqualDeep` for arrays with support for
  9326. * partial deep comparisons.
  9327. *
  9328. * @private
  9329. * @param {Array} array The array to compare.
  9330. * @param {Array} other The other array to compare.
  9331. * @param {Function} equalFunc The function to determine equivalents of values.
  9332. * @param {Function} customizer The function to customize comparisons.
  9333. * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
  9334. * for more details.
  9335. * @param {Object} stack Tracks traversed `array` and `other` objects.
  9336. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  9337. */
  9338. function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
  9339. var isPartial = bitmask & PARTIAL_COMPARE_FLAG,
  9340. arrLength = array.length,
  9341. othLength = other.length;
  9342. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  9343. return false;
  9344. }
  9345. // Assume cyclic values are equal.
  9346. var stacked = stack.get(array);
  9347. if (stacked && stack.get(other)) {
  9348. return stacked == other;
  9349. }
  9350. var index = -1,
  9351. result = true,
  9352. seen = bitmask & UNORDERED_COMPARE_FLAG ? new SetCache() : undefined;
  9353. stack.set(array, other);
  9354. stack.set(other, array);
  9355. // Ignore non-index properties.
  9356. while (++index < arrLength) {
  9357. var arrValue = array[index],
  9358. othValue = other[index];
  9359. if (customizer) {
  9360. var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
  9361. }
  9362. if (compared !== undefined) {
  9363. if (compared) {
  9364. continue;
  9365. }
  9366. result = false;
  9367. break;
  9368. }
  9369. // Recursively compare arrays (susceptible to call stack limits).
  9370. if (seen) {
  9371. if (!arraySome(other, function (othValue, othIndex) {
  9372. if (!seen.has(othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {
  9373. return seen.add(othIndex);
  9374. }
  9375. })) {
  9376. result = false;
  9377. break;
  9378. }
  9379. } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {
  9380. result = false;
  9381. break;
  9382. }
  9383. }
  9384. stack['delete'](array);
  9385. stack['delete'](other);
  9386. return result;
  9387. }
  9388. /**
  9389. * A specialized version of `baseIsEqualDeep` for comparing objects of
  9390. * the same `toStringTag`.
  9391. *
  9392. * **Note:** This function only supports comparing values with tags of
  9393. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  9394. *
  9395. * @private
  9396. * @param {Object} object The object to compare.
  9397. * @param {Object} other The other object to compare.
  9398. * @param {string} tag The `toStringTag` of the objects to compare.
  9399. * @param {Function} equalFunc The function to determine equivalents of values.
  9400. * @param {Function} customizer The function to customize comparisons.
  9401. * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
  9402. * for more details.
  9403. * @param {Object} stack Tracks traversed `object` and `other` objects.
  9404. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  9405. */
  9406. function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
  9407. switch (tag) {
  9408. case dataViewTag:
  9409. if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
  9410. return false;
  9411. }
  9412. object = object.buffer;
  9413. other = other.buffer;
  9414. case arrayBufferTag:
  9415. if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  9416. return false;
  9417. }
  9418. return true;
  9419. case boolTag:
  9420. case dateTag:
  9421. case numberTag:
  9422. // Coerce booleans to `1` or `0` and dates to milliseconds.
  9423. // Invalid dates are coerced to `NaN`.
  9424. return eq(+object, +other);
  9425. case errorTag:
  9426. return object.name == other.name && object.message == other.message;
  9427. case regexpTag:
  9428. case stringTag:
  9429. // Coerce regexes to strings and treat strings, primitives and objects,
  9430. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  9431. // for more details.
  9432. return object == other + '';
  9433. case mapTag:
  9434. var convert = mapToArray;
  9435. case setTag:
  9436. var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
  9437. convert || (convert = setToArray);
  9438. if (object.size != other.size && !isPartial) {
  9439. return false;
  9440. }
  9441. // Assume cyclic values are equal.
  9442. var stacked = stack.get(object);
  9443. if (stacked) {
  9444. return stacked == other;
  9445. }
  9446. bitmask |= UNORDERED_COMPARE_FLAG;
  9447. // Recursively compare objects (susceptible to call stack limits).
  9448. stack.set(object, other);
  9449. var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);
  9450. stack['delete'](object);
  9451. return result;
  9452. case symbolTag:
  9453. if (symbolValueOf) {
  9454. return symbolValueOf.call(object) == symbolValueOf.call(other);
  9455. }
  9456. }
  9457. return false;
  9458. }
  9459. /**
  9460. * A specialized version of `baseIsEqualDeep` for objects with support for
  9461. * partial deep comparisons.
  9462. *
  9463. * @private
  9464. * @param {Object} object The object to compare.
  9465. * @param {Object} other The other object to compare.
  9466. * @param {Function} equalFunc The function to determine equivalents of values.
  9467. * @param {Function} customizer The function to customize comparisons.
  9468. * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
  9469. * for more details.
  9470. * @param {Object} stack Tracks traversed `object` and `other` objects.
  9471. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  9472. */
  9473. function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
  9474. var isPartial = bitmask & PARTIAL_COMPARE_FLAG,
  9475. objProps = keys(object),
  9476. objLength = objProps.length,
  9477. othProps = keys(other),
  9478. othLength = othProps.length;
  9479. if (objLength != othLength && !isPartial) {
  9480. return false;
  9481. }
  9482. var index = objLength;
  9483. while (index--) {
  9484. var key = objProps[index];
  9485. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  9486. return false;
  9487. }
  9488. }
  9489. // Assume cyclic values are equal.
  9490. var stacked = stack.get(object);
  9491. if (stacked && stack.get(other)) {
  9492. return stacked == other;
  9493. }
  9494. var result = true;
  9495. stack.set(object, other);
  9496. stack.set(other, object);
  9497. var skipCtor = isPartial;
  9498. while (++index < objLength) {
  9499. key = objProps[index];
  9500. var objValue = object[key],
  9501. othValue = other[key];
  9502. if (customizer) {
  9503. var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
  9504. }
  9505. // Recursively compare objects (susceptible to call stack limits).
  9506. if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack) : compared)) {
  9507. result = false;
  9508. break;
  9509. }
  9510. skipCtor || (skipCtor = key == 'constructor');
  9511. }
  9512. if (result && !skipCtor) {
  9513. var objCtor = object.constructor,
  9514. othCtor = other.constructor;
  9515. // Non `Object` object instances with different constructors are not equal.
  9516. if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  9517. result = false;
  9518. }
  9519. }
  9520. stack['delete'](object);
  9521. stack['delete'](other);
  9522. return result;
  9523. }
  9524. /**
  9525. * Gets the data for `map`.
  9526. *
  9527. * @private
  9528. * @param {Object} map The map to query.
  9529. * @param {string} key The reference key.
  9530. * @returns {*} Returns the map data.
  9531. */
  9532. function getMapData(map, key) {
  9533. var data = map.__data__;
  9534. return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
  9535. }
  9536. /**
  9537. * Gets the property names, values, and compare flags of `object`.
  9538. *
  9539. * @private
  9540. * @param {Object} object The object to query.
  9541. * @returns {Array} Returns the match data of `object`.
  9542. */
  9543. function getMatchData(object) {
  9544. var result = keys(object),
  9545. length = result.length;
  9546. while (length--) {
  9547. var key = result[length],
  9548. value = object[key];
  9549. result[length] = [key, value, isStrictComparable(value)];
  9550. }
  9551. return result;
  9552. }
  9553. /**
  9554. * Gets the native function at `key` of `object`.
  9555. *
  9556. * @private
  9557. * @param {Object} object The object to query.
  9558. * @param {string} key The key of the method to get.
  9559. * @returns {*} Returns the function if it's native, else `undefined`.
  9560. */
  9561. function getNative(object, key) {
  9562. var value = getValue(object, key);
  9563. return baseIsNative(value) ? value : undefined;
  9564. }
  9565. /**
  9566. * Gets the `toStringTag` of `value`.
  9567. *
  9568. * @private
  9569. * @param {*} value The value to query.
  9570. * @returns {string} Returns the `toStringTag`.
  9571. */
  9572. var getTag = baseGetTag;
  9573. // Fallback for data views, maps, sets, and weak maps in IE 11,
  9574. // for data views in Edge < 14, and promises in Node.js.
  9575. if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
  9576. getTag = function getTag(value) {
  9577. var result = objectToString.call(value),
  9578. Ctor = result == objectTag ? value.constructor : undefined,
  9579. ctorString = Ctor ? toSource(Ctor) : undefined;
  9580. if (ctorString) {
  9581. switch (ctorString) {
  9582. case dataViewCtorString:
  9583. return dataViewTag;
  9584. case mapCtorString:
  9585. return mapTag;
  9586. case promiseCtorString:
  9587. return promiseTag;
  9588. case setCtorString:
  9589. return setTag;
  9590. case weakMapCtorString:
  9591. return weakMapTag;
  9592. }
  9593. }
  9594. return result;
  9595. };
  9596. }
  9597. /**
  9598. * Checks if `path` exists on `object`.
  9599. *
  9600. * @private
  9601. * @param {Object} object The object to query.
  9602. * @param {Array|string} path The path to check.
  9603. * @param {Function} hasFunc The function to check properties.
  9604. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  9605. */
  9606. function hasPath(object, path, hasFunc) {
  9607. path = isKey(path, object) ? [path] : castPath(path);
  9608. var result,
  9609. index = -1,
  9610. length = path.length;
  9611. while (++index < length) {
  9612. var key = toKey(path[index]);
  9613. if (!(result = object != null && hasFunc(object, key))) {
  9614. break;
  9615. }
  9616. object = object[key];
  9617. }
  9618. if (result) {
  9619. return result;
  9620. }
  9621. var length = object ? object.length : 0;
  9622. return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
  9623. }
  9624. /**
  9625. * Checks if `value` is a valid array-like index.
  9626. *
  9627. * @private
  9628. * @param {*} value The value to check.
  9629. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  9630. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  9631. */
  9632. function isIndex(value, length) {
  9633. length = length == null ? MAX_SAFE_INTEGER : length;
  9634. return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
  9635. }
  9636. /**
  9637. * Checks if `value` is a property name and not a property path.
  9638. *
  9639. * @private
  9640. * @param {*} value The value to check.
  9641. * @param {Object} [object] The object to query keys on.
  9642. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  9643. */
  9644. function isKey(value, object) {
  9645. if (isArray(value)) {
  9646. return false;
  9647. }
  9648. var type = _typeof(value);
  9649. if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) {
  9650. return true;
  9651. }
  9652. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
  9653. }
  9654. /**
  9655. * Checks if `value` is suitable for use as unique object key.
  9656. *
  9657. * @private
  9658. * @param {*} value The value to check.
  9659. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  9660. */
  9661. function isKeyable(value) {
  9662. var type = _typeof(value);
  9663. return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
  9664. }
  9665. /**
  9666. * Checks if `func` has its source masked.
  9667. *
  9668. * @private
  9669. * @param {Function} func The function to check.
  9670. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  9671. */
  9672. function isMasked(func) {
  9673. return !!maskSrcKey && maskSrcKey in func;
  9674. }
  9675. /**
  9676. * Checks if `value` is likely a prototype object.
  9677. *
  9678. * @private
  9679. * @param {*} value The value to check.
  9680. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  9681. */
  9682. function isPrototype(value) {
  9683. var Ctor = value && value.constructor,
  9684. proto = typeof Ctor == 'function' && Ctor.prototype || objectProto;
  9685. return value === proto;
  9686. }
  9687. /**
  9688. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  9689. *
  9690. * @private
  9691. * @param {*} value The value to check.
  9692. * @returns {boolean} Returns `true` if `value` if suitable for strict
  9693. * equality comparisons, else `false`.
  9694. */
  9695. function isStrictComparable(value) {
  9696. return value === value && !isObject(value);
  9697. }
  9698. /**
  9699. * A specialized version of `matchesProperty` for source values suitable
  9700. * for strict equality comparisons, i.e. `===`.
  9701. *
  9702. * @private
  9703. * @param {string} key The key of the property to get.
  9704. * @param {*} srcValue The value to match.
  9705. * @returns {Function} Returns the new spec function.
  9706. */
  9707. function matchesStrictComparable(key, srcValue) {
  9708. return function (object) {
  9709. if (object == null) {
  9710. return false;
  9711. }
  9712. return object[key] === srcValue && (srcValue !== undefined || key in Object(object));
  9713. };
  9714. }
  9715. /**
  9716. * Converts `string` to a property path array.
  9717. *
  9718. * @private
  9719. * @param {string} string The string to convert.
  9720. * @returns {Array} Returns the property path array.
  9721. */
  9722. var stringToPath = memoize(function (string) {
  9723. string = toString(string);
  9724. var result = [];
  9725. if (reLeadingDot.test(string)) {
  9726. result.push('');
  9727. }
  9728. string.replace(rePropName, function (match, number, quote, string) {
  9729. result.push(quote ? string.replace(reEscapeChar, '$1') : number || match);
  9730. });
  9731. return result;
  9732. });
  9733. /**
  9734. * Converts `value` to a string key if it's not a string or symbol.
  9735. *
  9736. * @private
  9737. * @param {*} value The value to inspect.
  9738. * @returns {string|symbol} Returns the key.
  9739. */
  9740. function toKey(value) {
  9741. if (typeof value == 'string' || isSymbol(value)) {
  9742. return value;
  9743. }
  9744. var result = value + '';
  9745. return result == '0' && 1 / value == -INFINITY ? '-0' : result;
  9746. }
  9747. /**
  9748. * Converts `func` to its source code.
  9749. *
  9750. * @private
  9751. * @param {Function} func The function to process.
  9752. * @returns {string} Returns the source code.
  9753. */
  9754. function toSource(func) {
  9755. if (func != null) {
  9756. try {
  9757. return funcToString.call(func);
  9758. } catch (e) {}
  9759. try {
  9760. return func + '';
  9761. } catch (e) {}
  9762. }
  9763. return '';
  9764. }
  9765. /**
  9766. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9767. * invoked for each element in `array` to generate the criterion by which
  9768. * uniqueness is computed. The iteratee is invoked with one argument: (value).
  9769. *
  9770. * @static
  9771. * @memberOf _
  9772. * @since 4.0.0
  9773. * @category Array
  9774. * @param {Array} array The array to inspect.
  9775. * @param {Function} [iteratee=_.identity]
  9776. * The iteratee invoked per element.
  9777. * @returns {Array} Returns the new duplicate free array.
  9778. * @example
  9779. *
  9780. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9781. * // => [2.1, 1.2]
  9782. *
  9783. * // The `_.property` iteratee shorthand.
  9784. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9785. * // => [{ 'x': 1 }, { 'x': 2 }]
  9786. */
  9787. function uniqBy(array, iteratee) {
  9788. return array && array.length ? baseUniq(array, baseIteratee(iteratee, 2)) : [];
  9789. }
  9790. /**
  9791. * Creates a function that memoizes the result of `func`. If `resolver` is
  9792. * provided, it determines the cache key for storing the result based on the
  9793. * arguments provided to the memoized function. By default, the first argument
  9794. * provided to the memoized function is used as the map cache key. The `func`
  9795. * is invoked with the `this` binding of the memoized function.
  9796. *
  9797. * **Note:** The cache is exposed as the `cache` property on the memoized
  9798. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  9799. * constructor with one whose instances implement the
  9800. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  9801. * method interface of `delete`, `get`, `has`, and `set`.
  9802. *
  9803. * @static
  9804. * @memberOf _
  9805. * @since 0.1.0
  9806. * @category Function
  9807. * @param {Function} func The function to have its output memoized.
  9808. * @param {Function} [resolver] The function to resolve the cache key.
  9809. * @returns {Function} Returns the new memoized function.
  9810. * @example
  9811. *
  9812. * var object = { 'a': 1, 'b': 2 };
  9813. * var other = { 'c': 3, 'd': 4 };
  9814. *
  9815. * var values = _.memoize(_.values);
  9816. * values(object);
  9817. * // => [1, 2]
  9818. *
  9819. * values(other);
  9820. * // => [3, 4]
  9821. *
  9822. * object.a = 2;
  9823. * values(object);
  9824. * // => [1, 2]
  9825. *
  9826. * // Modify the result cache.
  9827. * values.cache.set(object, ['a', 'b']);
  9828. * values(object);
  9829. * // => ['a', 'b']
  9830. *
  9831. * // Replace `_.memoize.Cache`.
  9832. * _.memoize.Cache = WeakMap;
  9833. */
  9834. function memoize(func, resolver) {
  9835. if (typeof func != 'function' || resolver && typeof resolver != 'function') {
  9836. throw new TypeError(FUNC_ERROR_TEXT);
  9837. }
  9838. var memoized = function memoized() {
  9839. var args = arguments,
  9840. key = resolver ? resolver.apply(this, args) : args[0],
  9841. cache = memoized.cache;
  9842. if (cache.has(key)) {
  9843. return cache.get(key);
  9844. }
  9845. var result = func.apply(this, args);
  9846. memoized.cache = cache.set(key, result);
  9847. return result;
  9848. };
  9849. memoized.cache = new (memoize.Cache || MapCache)();
  9850. return memoized;
  9851. }
  9852. // Assign cache to `_.memoize`.
  9853. memoize.Cache = MapCache;
  9854. /**
  9855. * Performs a
  9856. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9857. * comparison between two values to determine if they are equivalent.
  9858. *
  9859. * @static
  9860. * @memberOf _
  9861. * @since 4.0.0
  9862. * @category Lang
  9863. * @param {*} value The value to compare.
  9864. * @param {*} other The other value to compare.
  9865. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  9866. * @example
  9867. *
  9868. * var object = { 'a': 1 };
  9869. * var other = { 'a': 1 };
  9870. *
  9871. * _.eq(object, object);
  9872. * // => true
  9873. *
  9874. * _.eq(object, other);
  9875. * // => false
  9876. *
  9877. * _.eq('a', 'a');
  9878. * // => true
  9879. *
  9880. * _.eq('a', Object('a'));
  9881. * // => false
  9882. *
  9883. * _.eq(NaN, NaN);
  9884. * // => true
  9885. */
  9886. function eq(value, other) {
  9887. return value === other || value !== value && other !== other;
  9888. }
  9889. /**
  9890. * Checks if `value` is likely an `arguments` object.
  9891. *
  9892. * @static
  9893. * @memberOf _
  9894. * @since 0.1.0
  9895. * @category Lang
  9896. * @param {*} value The value to check.
  9897. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  9898. * else `false`.
  9899. * @example
  9900. *
  9901. * _.isArguments(function() { return arguments; }());
  9902. * // => true
  9903. *
  9904. * _.isArguments([1, 2, 3]);
  9905. * // => false
  9906. */
  9907. function isArguments(value) {
  9908. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  9909. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
  9910. }
  9911. /**
  9912. * Checks if `value` is classified as an `Array` object.
  9913. *
  9914. * @static
  9915. * @memberOf _
  9916. * @since 0.1.0
  9917. * @category Lang
  9918. * @param {*} value The value to check.
  9919. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  9920. * @example
  9921. *
  9922. * _.isArray([1, 2, 3]);
  9923. * // => true
  9924. *
  9925. * _.isArray(document.body.children);
  9926. * // => false
  9927. *
  9928. * _.isArray('abc');
  9929. * // => false
  9930. *
  9931. * _.isArray(_.noop);
  9932. * // => false
  9933. */
  9934. var isArray = Array.isArray;
  9935. /**
  9936. * Checks if `value` is array-like. A value is considered array-like if it's
  9937. * not a function and has a `value.length` that's an integer greater than or
  9938. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  9939. *
  9940. * @static
  9941. * @memberOf _
  9942. * @since 4.0.0
  9943. * @category Lang
  9944. * @param {*} value The value to check.
  9945. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  9946. * @example
  9947. *
  9948. * _.isArrayLike([1, 2, 3]);
  9949. * // => true
  9950. *
  9951. * _.isArrayLike(document.body.children);
  9952. * // => true
  9953. *
  9954. * _.isArrayLike('abc');
  9955. * // => true
  9956. *
  9957. * _.isArrayLike(_.noop);
  9958. * // => false
  9959. */
  9960. function isArrayLike(value) {
  9961. return value != null && isLength(value.length) && !isFunction(value);
  9962. }
  9963. /**
  9964. * This method is like `_.isArrayLike` except that it also checks if `value`
  9965. * is an object.
  9966. *
  9967. * @static
  9968. * @memberOf _
  9969. * @since 4.0.0
  9970. * @category Lang
  9971. * @param {*} value The value to check.
  9972. * @returns {boolean} Returns `true` if `value` is an array-like object,
  9973. * else `false`.
  9974. * @example
  9975. *
  9976. * _.isArrayLikeObject([1, 2, 3]);
  9977. * // => true
  9978. *
  9979. * _.isArrayLikeObject(document.body.children);
  9980. * // => true
  9981. *
  9982. * _.isArrayLikeObject('abc');
  9983. * // => false
  9984. *
  9985. * _.isArrayLikeObject(_.noop);
  9986. * // => false
  9987. */
  9988. function isArrayLikeObject(value) {
  9989. return isObjectLike(value) && isArrayLike(value);
  9990. }
  9991. /**
  9992. * Checks if `value` is classified as a `Function` object.
  9993. *
  9994. * @static
  9995. * @memberOf _
  9996. * @since 0.1.0
  9997. * @category Lang
  9998. * @param {*} value The value to check.
  9999. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  10000. * @example
  10001. *
  10002. * _.isFunction(_);
  10003. * // => true
  10004. *
  10005. * _.isFunction(/abc/);
  10006. * // => false
  10007. */
  10008. function isFunction(value) {
  10009. // The use of `Object#toString` avoids issues with the `typeof` operator
  10010. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  10011. var tag = isObject(value) ? objectToString.call(value) : '';
  10012. return tag == funcTag || tag == genTag;
  10013. }
  10014. /**
  10015. * Checks if `value` is a valid array-like length.
  10016. *
  10017. * **Note:** This method is loosely based on
  10018. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  10019. *
  10020. * @static
  10021. * @memberOf _
  10022. * @since 4.0.0
  10023. * @category Lang
  10024. * @param {*} value The value to check.
  10025. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  10026. * @example
  10027. *
  10028. * _.isLength(3);
  10029. * // => true
  10030. *
  10031. * _.isLength(Number.MIN_VALUE);
  10032. * // => false
  10033. *
  10034. * _.isLength(Infinity);
  10035. * // => false
  10036. *
  10037. * _.isLength('3');
  10038. * // => false
  10039. */
  10040. function isLength(value) {
  10041. return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  10042. }
  10043. /**
  10044. * Checks if `value` is the
  10045. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  10046. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  10047. *
  10048. * @static
  10049. * @memberOf _
  10050. * @since 0.1.0
  10051. * @category Lang
  10052. * @param {*} value The value to check.
  10053. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  10054. * @example
  10055. *
  10056. * _.isObject({});
  10057. * // => true
  10058. *
  10059. * _.isObject([1, 2, 3]);
  10060. * // => true
  10061. *
  10062. * _.isObject(_.noop);
  10063. * // => true
  10064. *
  10065. * _.isObject(null);
  10066. * // => false
  10067. */
  10068. function isObject(value) {
  10069. var type = _typeof(value);
  10070. return !!value && (type == 'object' || type == 'function');
  10071. }
  10072. /**
  10073. * Checks if `value` is object-like. A value is object-like if it's not `null`
  10074. * and has a `typeof` result of "object".
  10075. *
  10076. * @static
  10077. * @memberOf _
  10078. * @since 4.0.0
  10079. * @category Lang
  10080. * @param {*} value The value to check.
  10081. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  10082. * @example
  10083. *
  10084. * _.isObjectLike({});
  10085. * // => true
  10086. *
  10087. * _.isObjectLike([1, 2, 3]);
  10088. * // => true
  10089. *
  10090. * _.isObjectLike(_.noop);
  10091. * // => false
  10092. *
  10093. * _.isObjectLike(null);
  10094. * // => false
  10095. */
  10096. function isObjectLike(value) {
  10097. return !!value && _typeof(value) == 'object';
  10098. }
  10099. /**
  10100. * Checks if `value` is classified as a `Symbol` primitive or object.
  10101. *
  10102. * @static
  10103. * @memberOf _
  10104. * @since 4.0.0
  10105. * @category Lang
  10106. * @param {*} value The value to check.
  10107. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  10108. * @example
  10109. *
  10110. * _.isSymbol(Symbol.iterator);
  10111. * // => true
  10112. *
  10113. * _.isSymbol('abc');
  10114. * // => false
  10115. */
  10116. function isSymbol(value) {
  10117. return _typeof(value) == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag;
  10118. }
  10119. /**
  10120. * Checks if `value` is classified as a typed array.
  10121. *
  10122. * @static
  10123. * @memberOf _
  10124. * @since 3.0.0
  10125. * @category Lang
  10126. * @param {*} value The value to check.
  10127. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  10128. * @example
  10129. *
  10130. * _.isTypedArray(new Uint8Array);
  10131. * // => true
  10132. *
  10133. * _.isTypedArray([]);
  10134. * // => false
  10135. */
  10136. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  10137. /**
  10138. * Converts `value` to a string. An empty string is returned for `null`
  10139. * and `undefined` values. The sign of `-0` is preserved.
  10140. *
  10141. * @static
  10142. * @memberOf _
  10143. * @since 4.0.0
  10144. * @category Lang
  10145. * @param {*} value The value to process.
  10146. * @returns {string} Returns the string.
  10147. * @example
  10148. *
  10149. * _.toString(null);
  10150. * // => ''
  10151. *
  10152. * _.toString(-0);
  10153. * // => '-0'
  10154. *
  10155. * _.toString([1, 2, 3]);
  10156. * // => '1,2,3'
  10157. */
  10158. function toString(value) {
  10159. return value == null ? '' : baseToString(value);
  10160. }
  10161. /**
  10162. * Gets the value at `path` of `object`. If the resolved value is
  10163. * `undefined`, the `defaultValue` is returned in its place.
  10164. *
  10165. * @static
  10166. * @memberOf _
  10167. * @since 3.7.0
  10168. * @category Object
  10169. * @param {Object} object The object to query.
  10170. * @param {Array|string} path The path of the property to get.
  10171. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  10172. * @returns {*} Returns the resolved value.
  10173. * @example
  10174. *
  10175. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  10176. *
  10177. * _.get(object, 'a[0].b.c');
  10178. * // => 3
  10179. *
  10180. * _.get(object, ['a', '0', 'b', 'c']);
  10181. * // => 3
  10182. *
  10183. * _.get(object, 'a.b.c', 'default');
  10184. * // => 'default'
  10185. */
  10186. function get(object, path, defaultValue) {
  10187. var result = object == null ? undefined : baseGet(object, path);
  10188. return result === undefined ? defaultValue : result;
  10189. }
  10190. /**
  10191. * Checks if `path` is a direct or inherited property of `object`.
  10192. *
  10193. * @static
  10194. * @memberOf _
  10195. * @since 4.0.0
  10196. * @category Object
  10197. * @param {Object} object The object to query.
  10198. * @param {Array|string} path The path to check.
  10199. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  10200. * @example
  10201. *
  10202. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  10203. *
  10204. * _.hasIn(object, 'a');
  10205. * // => true
  10206. *
  10207. * _.hasIn(object, 'a.b');
  10208. * // => true
  10209. *
  10210. * _.hasIn(object, ['a', 'b']);
  10211. * // => true
  10212. *
  10213. * _.hasIn(object, 'b');
  10214. * // => false
  10215. */
  10216. function hasIn(object, path) {
  10217. return object != null && hasPath(object, path, baseHasIn);
  10218. }
  10219. /**
  10220. * Creates an array of the own enumerable property names of `object`.
  10221. *
  10222. * **Note:** Non-object values are coerced to objects. See the
  10223. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  10224. * for more details.
  10225. *
  10226. * @static
  10227. * @since 0.1.0
  10228. * @memberOf _
  10229. * @category Object
  10230. * @param {Object} object The object to query.
  10231. * @returns {Array} Returns the array of property names.
  10232. * @example
  10233. *
  10234. * function Foo() {
  10235. * this.a = 1;
  10236. * this.b = 2;
  10237. * }
  10238. *
  10239. * Foo.prototype.c = 3;
  10240. *
  10241. * _.keys(new Foo);
  10242. * // => ['a', 'b'] (iteration order is not guaranteed)
  10243. *
  10244. * _.keys('hi');
  10245. * // => ['0', '1']
  10246. */
  10247. function keys(object) {
  10248. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  10249. }
  10250. /**
  10251. * This method returns the first argument it receives.
  10252. *
  10253. * @static
  10254. * @since 0.1.0
  10255. * @memberOf _
  10256. * @category Util
  10257. * @param {*} value Any value.
  10258. * @returns {*} Returns `value`.
  10259. * @example
  10260. *
  10261. * var object = { 'a': 1 };
  10262. *
  10263. * console.log(_.identity(object) === object);
  10264. * // => true
  10265. */
  10266. function identity(value) {
  10267. return value;
  10268. }
  10269. /**
  10270. * This method returns `undefined`.
  10271. *
  10272. * @static
  10273. * @memberOf _
  10274. * @since 2.3.0
  10275. * @category Util
  10276. * @example
  10277. *
  10278. * _.times(2, _.noop);
  10279. * // => [undefined, undefined]
  10280. */
  10281. function noop() {
  10282. // No operation performed.
  10283. }
  10284. /**
  10285. * Creates a function that returns the value at `path` of a given object.
  10286. *
  10287. * @static
  10288. * @memberOf _
  10289. * @since 2.4.0
  10290. * @category Util
  10291. * @param {Array|string} path The path of the property to get.
  10292. * @returns {Function} Returns the new accessor function.
  10293. * @example
  10294. *
  10295. * var objects = [
  10296. * { 'a': { 'b': 2 } },
  10297. * { 'a': { 'b': 1 } }
  10298. * ];
  10299. *
  10300. * _.map(objects, _.property('a.b'));
  10301. * // => [2, 1]
  10302. *
  10303. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  10304. * // => [1, 2]
  10305. */
  10306. function property(path) {
  10307. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  10308. }
  10309. module.exports = uniqBy;
  10310. /***/ }),
  10311. /***/ 4689:
  10312. /***/ (function(module, exports, __webpack_require__) {
  10313. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  10314. (function (global, factory) {
  10315. ( false ? 0 : _typeof(exports)) === 'object' && "object" !== 'undefined' ? module.exports = factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  10316. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  10317. (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
  10318. __WEBPACK_AMD_DEFINE_FACTORY__),
  10319. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0;
  10320. })(this, function () {
  10321. 'use strict';
  10322. var globals = function globals(defs) {
  10323. defs('EPSG:4326', "+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees");
  10324. defs('EPSG:4269', "+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees");
  10325. defs('EPSG:3857', "+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");
  10326. defs.WGS84 = defs['EPSG:4326'];
  10327. defs['EPSG:3785'] = defs['EPSG:3857']; // maintain backward compat, official code is 3857
  10328. defs.GOOGLE = defs['EPSG:3857'];
  10329. defs['EPSG:900913'] = defs['EPSG:3857'];
  10330. defs['EPSG:102113'] = defs['EPSG:3857'];
  10331. };
  10332. var PJD_3PARAM = 1;
  10333. var PJD_7PARAM = 2;
  10334. var PJD_GRIDSHIFT = 3;
  10335. var PJD_WGS84 = 4; // WGS84 or equivalent
  10336. var PJD_NODATUM = 5; // WGS84 or equivalent
  10337. var SRS_WGS84_SEMIMAJOR = 6378137.0; // only used in grid shift transforms
  10338. var SRS_WGS84_SEMIMINOR = 6356752.314; // only used in grid shift transforms
  10339. var SRS_WGS84_ESQUARED = 0.0066943799901413165; // only used in grid shift transforms
  10340. var SEC_TO_RAD = 4.84813681109535993589914102357e-6;
  10341. var HALF_PI = Math.PI / 2;
  10342. // ellipoid pj_set_ell.c
  10343. var SIXTH = 0.1666666666666666667;
  10344. /* 1/6 */
  10345. var RA4 = 0.04722222222222222222;
  10346. /* 17/360 */
  10347. var RA6 = 0.02215608465608465608;
  10348. var EPSLN = 1.0e-10;
  10349. // you'd think you could use Number.EPSILON above but that makes
  10350. // Mollweide get into an infinate loop.
  10351. var D2R = 0.01745329251994329577;
  10352. var R2D = 57.29577951308232088;
  10353. var FORTPI = Math.PI / 4;
  10354. var TWO_PI = Math.PI * 2;
  10355. // SPI is slightly greater than Math.PI, so values that exceed the -180..180
  10356. // degree range by a tiny amount don't get wrapped. This prevents points that
  10357. // have drifted from their original location along the 180th meridian (due to
  10358. // floating point error) from changing their sign.
  10359. var SPI = 3.14159265359;
  10360. var exports$1 = {};
  10361. exports$1.greenwich = 0.0; //"0dE",
  10362. exports$1.lisbon = -9.131906111111; //"9d07'54.862\"W",
  10363. exports$1.paris = 2.337229166667; //"2d20'14.025\"E",
  10364. exports$1.bogota = -74.080916666667; //"74d04'51.3\"W",
  10365. exports$1.madrid = -3.687938888889; //"3d41'16.58\"W",
  10366. exports$1.rome = 12.452333333333; //"12d27'8.4\"E",
  10367. exports$1.bern = 7.439583333333; //"7d26'22.5\"E",
  10368. exports$1.jakarta = 106.807719444444; //"106d48'27.79\"E",
  10369. exports$1.ferro = -17.666666666667; //"17d40'W",
  10370. exports$1.brussels = 4.367975; //"4d22'4.71\"E",
  10371. exports$1.stockholm = 18.058277777778; //"18d3'29.8\"E",
  10372. exports$1.athens = 23.7163375; //"23d42'58.815\"E",
  10373. exports$1.oslo = 10.722916666667; //"10d43'22.5\"E"
  10374. var _units = {
  10375. ft: {
  10376. to_meter: 0.3048
  10377. },
  10378. 'us-ft': {
  10379. to_meter: 1200 / 3937
  10380. }
  10381. };
  10382. var ignoredChar = /[\s_\-\/\(\)]/g;
  10383. function match(obj, key) {
  10384. if (obj[key]) {
  10385. return obj[key];
  10386. }
  10387. var keys = Object.keys(obj);
  10388. var lkey = key.toLowerCase().replace(ignoredChar, '');
  10389. var i = -1;
  10390. var testkey, processedKey;
  10391. while (++i < keys.length) {
  10392. testkey = keys[i];
  10393. processedKey = testkey.toLowerCase().replace(ignoredChar, '');
  10394. if (processedKey === lkey) {
  10395. return obj[testkey];
  10396. }
  10397. }
  10398. }
  10399. var parseProj = function parseProj(defData) {
  10400. var self = {};
  10401. var paramObj = defData.split('+').map(function (v) {
  10402. return v.trim();
  10403. }).filter(function (a) {
  10404. return a;
  10405. }).reduce(function (p, a) {
  10406. var split = a.split('=');
  10407. split.push(true);
  10408. p[split[0].toLowerCase()] = split[1];
  10409. return p;
  10410. }, {});
  10411. var paramName, paramVal, paramOutname;
  10412. var params = {
  10413. proj: 'projName',
  10414. datum: 'datumCode',
  10415. rf: function rf(v) {
  10416. self.rf = parseFloat(v);
  10417. },
  10418. lat_0: function lat_0(v) {
  10419. self.lat0 = v * D2R;
  10420. },
  10421. lat_1: function lat_1(v) {
  10422. self.lat1 = v * D2R;
  10423. },
  10424. lat_2: function lat_2(v) {
  10425. self.lat2 = v * D2R;
  10426. },
  10427. lat_ts: function lat_ts(v) {
  10428. self.lat_ts = v * D2R;
  10429. },
  10430. lon_0: function lon_0(v) {
  10431. self.long0 = v * D2R;
  10432. },
  10433. lon_1: function lon_1(v) {
  10434. self.long1 = v * D2R;
  10435. },
  10436. lon_2: function lon_2(v) {
  10437. self.long2 = v * D2R;
  10438. },
  10439. alpha: function alpha(v) {
  10440. self.alpha = parseFloat(v) * D2R;
  10441. },
  10442. gamma: function gamma(v) {
  10443. self.rectified_grid_angle = parseFloat(v);
  10444. },
  10445. lonc: function lonc(v) {
  10446. self.longc = v * D2R;
  10447. },
  10448. x_0: function x_0(v) {
  10449. self.x0 = parseFloat(v);
  10450. },
  10451. y_0: function y_0(v) {
  10452. self.y0 = parseFloat(v);
  10453. },
  10454. k_0: function k_0(v) {
  10455. self.k0 = parseFloat(v);
  10456. },
  10457. k: function k(v) {
  10458. self.k0 = parseFloat(v);
  10459. },
  10460. a: function a(v) {
  10461. self.a = parseFloat(v);
  10462. },
  10463. b: function b(v) {
  10464. self.b = parseFloat(v);
  10465. },
  10466. r_a: function r_a() {
  10467. self.R_A = true;
  10468. },
  10469. zone: function zone(v) {
  10470. self.zone = parseInt(v, 10);
  10471. },
  10472. south: function south() {
  10473. self.utmSouth = true;
  10474. },
  10475. towgs84: function towgs84(v) {
  10476. self.datum_params = v.split(",").map(function (a) {
  10477. return parseFloat(a);
  10478. });
  10479. },
  10480. to_meter: function to_meter(v) {
  10481. self.to_meter = parseFloat(v);
  10482. },
  10483. units: function units(v) {
  10484. self.units = v;
  10485. var unit = match(_units, v);
  10486. if (unit) {
  10487. self.to_meter = unit.to_meter;
  10488. }
  10489. },
  10490. from_greenwich: function from_greenwich(v) {
  10491. self.from_greenwich = v * D2R;
  10492. },
  10493. pm: function pm(v) {
  10494. var pm = match(exports$1, v);
  10495. self.from_greenwich = (pm ? pm : parseFloat(v)) * D2R;
  10496. },
  10497. nadgrids: function nadgrids(v) {
  10498. if (v === '@null') {
  10499. self.datumCode = 'none';
  10500. } else {
  10501. self.nadgrids = v;
  10502. }
  10503. },
  10504. axis: function axis(v) {
  10505. var legalAxis = "ewnsud";
  10506. if (v.length === 3 && legalAxis.indexOf(v.substr(0, 1)) !== -1 && legalAxis.indexOf(v.substr(1, 1)) !== -1 && legalAxis.indexOf(v.substr(2, 1)) !== -1) {
  10507. self.axis = v;
  10508. }
  10509. },
  10510. approx: function approx() {
  10511. self.approx = true;
  10512. }
  10513. };
  10514. for (paramName in paramObj) {
  10515. paramVal = paramObj[paramName];
  10516. if (paramName in params) {
  10517. paramOutname = params[paramName];
  10518. if (typeof paramOutname === 'function') {
  10519. paramOutname(paramVal);
  10520. } else {
  10521. self[paramOutname] = paramVal;
  10522. }
  10523. } else {
  10524. self[paramName] = paramVal;
  10525. }
  10526. }
  10527. if (typeof self.datumCode === 'string' && self.datumCode !== "WGS84") {
  10528. self.datumCode = self.datumCode.toLowerCase();
  10529. }
  10530. return self;
  10531. };
  10532. var NEUTRAL = 1;
  10533. var KEYWORD = 2;
  10534. var NUMBER = 3;
  10535. var QUOTED = 4;
  10536. var AFTERQUOTE = 5;
  10537. var ENDED = -1;
  10538. var whitespace = /\s/;
  10539. var latin = /[A-Za-z]/;
  10540. var keyword = /[A-Za-z84_]/;
  10541. var endThings = /[,\]]/;
  10542. var digets = /[\d\.E\-\+]/;
  10543. // const ignoredChar = /[\s_\-\/\(\)]/g;
  10544. function Parser(text) {
  10545. if (typeof text !== 'string') {
  10546. throw new Error('not a string');
  10547. }
  10548. this.text = text.trim();
  10549. this.level = 0;
  10550. this.place = 0;
  10551. this.root = null;
  10552. this.stack = [];
  10553. this.currentObject = null;
  10554. this.state = NEUTRAL;
  10555. }
  10556. Parser.prototype.readCharicter = function () {
  10557. var _char = this.text[this.place++];
  10558. if (this.state !== QUOTED) {
  10559. while (whitespace.test(_char)) {
  10560. if (this.place >= this.text.length) {
  10561. return;
  10562. }
  10563. _char = this.text[this.place++];
  10564. }
  10565. }
  10566. switch (this.state) {
  10567. case NEUTRAL:
  10568. return this.neutral(_char);
  10569. case KEYWORD:
  10570. return this.keyword(_char);
  10571. case QUOTED:
  10572. return this.quoted(_char);
  10573. case AFTERQUOTE:
  10574. return this.afterquote(_char);
  10575. case NUMBER:
  10576. return this.number(_char);
  10577. case ENDED:
  10578. return;
  10579. }
  10580. };
  10581. Parser.prototype.afterquote = function (_char2) {
  10582. if (_char2 === '"') {
  10583. this.word += '"';
  10584. this.state = QUOTED;
  10585. return;
  10586. }
  10587. if (endThings.test(_char2)) {
  10588. this.word = this.word.trim();
  10589. this.afterItem(_char2);
  10590. return;
  10591. }
  10592. throw new Error('havn\'t handled "' + _char2 + '" in afterquote yet, index ' + this.place);
  10593. };
  10594. Parser.prototype.afterItem = function (_char3) {
  10595. if (_char3 === ',') {
  10596. if (this.word !== null) {
  10597. this.currentObject.push(this.word);
  10598. }
  10599. this.word = null;
  10600. this.state = NEUTRAL;
  10601. return;
  10602. }
  10603. if (_char3 === ']') {
  10604. this.level--;
  10605. if (this.word !== null) {
  10606. this.currentObject.push(this.word);
  10607. this.word = null;
  10608. }
  10609. this.state = NEUTRAL;
  10610. this.currentObject = this.stack.pop();
  10611. if (!this.currentObject) {
  10612. this.state = ENDED;
  10613. }
  10614. return;
  10615. }
  10616. };
  10617. Parser.prototype.number = function (_char4) {
  10618. if (digets.test(_char4)) {
  10619. this.word += _char4;
  10620. return;
  10621. }
  10622. if (endThings.test(_char4)) {
  10623. this.word = parseFloat(this.word);
  10624. this.afterItem(_char4);
  10625. return;
  10626. }
  10627. throw new Error('havn\'t handled "' + _char4 + '" in number yet, index ' + this.place);
  10628. };
  10629. Parser.prototype.quoted = function (_char5) {
  10630. if (_char5 === '"') {
  10631. this.state = AFTERQUOTE;
  10632. return;
  10633. }
  10634. this.word += _char5;
  10635. return;
  10636. };
  10637. Parser.prototype.keyword = function (_char6) {
  10638. if (keyword.test(_char6)) {
  10639. this.word += _char6;
  10640. return;
  10641. }
  10642. if (_char6 === '[') {
  10643. var newObjects = [];
  10644. newObjects.push(this.word);
  10645. this.level++;
  10646. if (this.root === null) {
  10647. this.root = newObjects;
  10648. } else {
  10649. this.currentObject.push(newObjects);
  10650. }
  10651. this.stack.push(this.currentObject);
  10652. this.currentObject = newObjects;
  10653. this.state = NEUTRAL;
  10654. return;
  10655. }
  10656. if (endThings.test(_char6)) {
  10657. this.afterItem(_char6);
  10658. return;
  10659. }
  10660. throw new Error('havn\'t handled "' + _char6 + '" in keyword yet, index ' + this.place);
  10661. };
  10662. Parser.prototype.neutral = function (_char7) {
  10663. if (latin.test(_char7)) {
  10664. this.word = _char7;
  10665. this.state = KEYWORD;
  10666. return;
  10667. }
  10668. if (_char7 === '"') {
  10669. this.word = '';
  10670. this.state = QUOTED;
  10671. return;
  10672. }
  10673. if (digets.test(_char7)) {
  10674. this.word = _char7;
  10675. this.state = NUMBER;
  10676. return;
  10677. }
  10678. if (endThings.test(_char7)) {
  10679. this.afterItem(_char7);
  10680. return;
  10681. }
  10682. throw new Error('havn\'t handled "' + _char7 + '" in neutral yet, index ' + this.place);
  10683. };
  10684. Parser.prototype.output = function () {
  10685. while (this.place < this.text.length) {
  10686. this.readCharicter();
  10687. }
  10688. if (this.state === ENDED) {
  10689. return this.root;
  10690. }
  10691. throw new Error('unable to parse string "' + this.text + '". State is ' + this.state);
  10692. };
  10693. function parseString(txt) {
  10694. var parser = new Parser(txt);
  10695. return parser.output();
  10696. }
  10697. function mapit(obj, key, value) {
  10698. if (Array.isArray(key)) {
  10699. value.unshift(key);
  10700. key = null;
  10701. }
  10702. var thing = key ? {} : obj;
  10703. var out = value.reduce(function (newObj, item) {
  10704. sExpr(item, newObj);
  10705. return newObj;
  10706. }, thing);
  10707. if (key) {
  10708. obj[key] = out;
  10709. }
  10710. }
  10711. function sExpr(v, obj) {
  10712. if (!Array.isArray(v)) {
  10713. obj[v] = true;
  10714. return;
  10715. }
  10716. var key = v.shift();
  10717. if (key === 'PARAMETER') {
  10718. key = v.shift();
  10719. }
  10720. if (v.length === 1) {
  10721. if (Array.isArray(v[0])) {
  10722. obj[key] = {};
  10723. sExpr(v[0], obj[key]);
  10724. return;
  10725. }
  10726. obj[key] = v[0];
  10727. return;
  10728. }
  10729. if (!v.length) {
  10730. obj[key] = true;
  10731. return;
  10732. }
  10733. if (key === 'TOWGS84') {
  10734. obj[key] = v;
  10735. return;
  10736. }
  10737. if (key === 'AXIS') {
  10738. if (!(key in obj)) {
  10739. obj[key] = [];
  10740. }
  10741. obj[key].push(v);
  10742. return;
  10743. }
  10744. if (!Array.isArray(key)) {
  10745. obj[key] = {};
  10746. }
  10747. var i;
  10748. switch (key) {
  10749. case 'UNIT':
  10750. case 'PRIMEM':
  10751. case 'VERT_DATUM':
  10752. obj[key] = {
  10753. name: v[0].toLowerCase(),
  10754. convert: v[1]
  10755. };
  10756. if (v.length === 3) {
  10757. sExpr(v[2], obj[key]);
  10758. }
  10759. return;
  10760. case 'SPHEROID':
  10761. case 'ELLIPSOID':
  10762. obj[key] = {
  10763. name: v[0],
  10764. a: v[1],
  10765. rf: v[2]
  10766. };
  10767. if (v.length === 4) {
  10768. sExpr(v[3], obj[key]);
  10769. }
  10770. return;
  10771. case 'PROJECTEDCRS':
  10772. case 'PROJCRS':
  10773. case 'GEOGCS':
  10774. case 'GEOCCS':
  10775. case 'PROJCS':
  10776. case 'LOCAL_CS':
  10777. case 'GEODCRS':
  10778. case 'GEODETICCRS':
  10779. case 'GEODETICDATUM':
  10780. case 'EDATUM':
  10781. case 'ENGINEERINGDATUM':
  10782. case 'VERT_CS':
  10783. case 'VERTCRS':
  10784. case 'VERTICALCRS':
  10785. case 'COMPD_CS':
  10786. case 'COMPOUNDCRS':
  10787. case 'ENGINEERINGCRS':
  10788. case 'ENGCRS':
  10789. case 'FITTED_CS':
  10790. case 'LOCAL_DATUM':
  10791. case 'DATUM':
  10792. v[0] = ['name', v[0]];
  10793. mapit(obj, key, v);
  10794. return;
  10795. default:
  10796. i = -1;
  10797. while (++i < v.length) {
  10798. if (!Array.isArray(v[i])) {
  10799. return sExpr(v, obj[key]);
  10800. }
  10801. }
  10802. return mapit(obj, key, v);
  10803. }
  10804. }
  10805. var D2R$1 = 0.01745329251994329577;
  10806. function rename(obj, params) {
  10807. var outName = params[0];
  10808. var inName = params[1];
  10809. if (!(outName in obj) && inName in obj) {
  10810. obj[outName] = obj[inName];
  10811. if (params.length === 3) {
  10812. obj[outName] = params[2](obj[outName]);
  10813. }
  10814. }
  10815. }
  10816. function d2r(input) {
  10817. return input * D2R$1;
  10818. }
  10819. function cleanWKT(wkt) {
  10820. if (wkt.type === 'GEOGCS') {
  10821. wkt.projName = 'longlat';
  10822. } else if (wkt.type === 'LOCAL_CS') {
  10823. wkt.projName = 'identity';
  10824. wkt.local = true;
  10825. } else {
  10826. if (_typeof(wkt.PROJECTION) === 'object') {
  10827. wkt.projName = Object.keys(wkt.PROJECTION)[0];
  10828. } else {
  10829. wkt.projName = wkt.PROJECTION;
  10830. }
  10831. }
  10832. if (wkt.AXIS) {
  10833. var axisOrder = '';
  10834. for (var i = 0, ii = wkt.AXIS.length; i < ii; ++i) {
  10835. var axis = [wkt.AXIS[i][0].toLowerCase(), wkt.AXIS[i][1].toLowerCase()];
  10836. if (axis[0].indexOf('north') !== -1 || (axis[0] === 'y' || axis[0] === 'lat') && axis[1] === 'north') {
  10837. axisOrder += 'n';
  10838. } else if (axis[0].indexOf('south') !== -1 || (axis[0] === 'y' || axis[0] === 'lat') && axis[1] === 'south') {
  10839. axisOrder += 's';
  10840. } else if (axis[0].indexOf('east') !== -1 || (axis[0] === 'x' || axis[0] === 'lon') && axis[1] === 'east') {
  10841. axisOrder += 'e';
  10842. } else if (axis[0].indexOf('west') !== -1 || (axis[0] === 'x' || axis[0] === 'lon') && axis[1] === 'west') {
  10843. axisOrder += 'w';
  10844. }
  10845. }
  10846. if (axisOrder.length === 2) {
  10847. axisOrder += 'u';
  10848. }
  10849. if (axisOrder.length === 3) {
  10850. wkt.axis = axisOrder;
  10851. }
  10852. }
  10853. if (wkt.UNIT) {
  10854. wkt.units = wkt.UNIT.name.toLowerCase();
  10855. if (wkt.units === 'metre') {
  10856. wkt.units = 'meter';
  10857. }
  10858. if (wkt.UNIT.convert) {
  10859. if (wkt.type === 'GEOGCS') {
  10860. if (wkt.DATUM && wkt.DATUM.SPHEROID) {
  10861. wkt.to_meter = wkt.UNIT.convert * wkt.DATUM.SPHEROID.a;
  10862. }
  10863. } else {
  10864. wkt.to_meter = wkt.UNIT.convert;
  10865. }
  10866. }
  10867. }
  10868. var geogcs = wkt.GEOGCS;
  10869. if (wkt.type === 'GEOGCS') {
  10870. geogcs = wkt;
  10871. }
  10872. if (geogcs) {
  10873. //if(wkt.GEOGCS.PRIMEM&&wkt.GEOGCS.PRIMEM.convert){
  10874. // wkt.from_greenwich=wkt.GEOGCS.PRIMEM.convert*D2R;
  10875. //}
  10876. if (geogcs.DATUM) {
  10877. wkt.datumCode = geogcs.DATUM.name.toLowerCase();
  10878. } else {
  10879. wkt.datumCode = geogcs.name.toLowerCase();
  10880. }
  10881. if (wkt.datumCode.slice(0, 2) === 'd_') {
  10882. wkt.datumCode = wkt.datumCode.slice(2);
  10883. }
  10884. if (wkt.datumCode === 'new_zealand_geodetic_datum_1949' || wkt.datumCode === 'new_zealand_1949') {
  10885. wkt.datumCode = 'nzgd49';
  10886. }
  10887. if (wkt.datumCode === 'wgs_1984' || wkt.datumCode === 'world_geodetic_system_1984') {
  10888. if (wkt.PROJECTION === 'Mercator_Auxiliary_Sphere') {
  10889. wkt.sphere = true;
  10890. }
  10891. wkt.datumCode = 'wgs84';
  10892. }
  10893. if (wkt.datumCode.slice(-6) === '_ferro') {
  10894. wkt.datumCode = wkt.datumCode.slice(0, -6);
  10895. }
  10896. if (wkt.datumCode.slice(-8) === '_jakarta') {
  10897. wkt.datumCode = wkt.datumCode.slice(0, -8);
  10898. }
  10899. if (~wkt.datumCode.indexOf('belge')) {
  10900. wkt.datumCode = 'rnb72';
  10901. }
  10902. if (geogcs.DATUM && geogcs.DATUM.SPHEROID) {
  10903. wkt.ellps = geogcs.DATUM.SPHEROID.name.replace('_19', '').replace(/[Cc]larke\_18/, 'clrk');
  10904. if (wkt.ellps.toLowerCase().slice(0, 13) === 'international') {
  10905. wkt.ellps = 'intl';
  10906. }
  10907. wkt.a = geogcs.DATUM.SPHEROID.a;
  10908. wkt.rf = parseFloat(geogcs.DATUM.SPHEROID.rf, 10);
  10909. }
  10910. if (geogcs.DATUM && geogcs.DATUM.TOWGS84) {
  10911. wkt.datum_params = geogcs.DATUM.TOWGS84;
  10912. }
  10913. if (~wkt.datumCode.indexOf('osgb_1936')) {
  10914. wkt.datumCode = 'osgb36';
  10915. }
  10916. if (~wkt.datumCode.indexOf('osni_1952')) {
  10917. wkt.datumCode = 'osni52';
  10918. }
  10919. if (~wkt.datumCode.indexOf('tm65') || ~wkt.datumCode.indexOf('geodetic_datum_of_1965')) {
  10920. wkt.datumCode = 'ire65';
  10921. }
  10922. if (wkt.datumCode === 'ch1903+') {
  10923. wkt.datumCode = 'ch1903';
  10924. }
  10925. if (~wkt.datumCode.indexOf('israel')) {
  10926. wkt.datumCode = 'isr93';
  10927. }
  10928. }
  10929. if (wkt.b && !isFinite(wkt.b)) {
  10930. wkt.b = wkt.a;
  10931. }
  10932. function toMeter(input) {
  10933. var ratio = wkt.to_meter || 1;
  10934. return input * ratio;
  10935. }
  10936. var renamer = function renamer(a) {
  10937. return rename(wkt, a);
  10938. };
  10939. var list = [['standard_parallel_1', 'Standard_Parallel_1'], ['standard_parallel_1', 'Latitude of 1st standard parallel'], ['standard_parallel_2', 'Standard_Parallel_2'], ['standard_parallel_2', 'Latitude of 2nd standard parallel'], ['false_easting', 'False_Easting'], ['false_easting', 'False easting'], ['false-easting', 'Easting at false origin'], ['false_northing', 'False_Northing'], ['false_northing', 'False northing'], ['false_northing', 'Northing at false origin'], ['central_meridian', 'Central_Meridian'], ['central_meridian', 'Longitude of natural origin'], ['central_meridian', 'Longitude of false origin'], ['latitude_of_origin', 'Latitude_Of_Origin'], ['latitude_of_origin', 'Central_Parallel'], ['latitude_of_origin', 'Latitude of natural origin'], ['latitude_of_origin', 'Latitude of false origin'], ['scale_factor', 'Scale_Factor'], ['k0', 'scale_factor'], ['latitude_of_center', 'Latitude_Of_Center'], ['latitude_of_center', 'Latitude_of_center'], ['lat0', 'latitude_of_center', d2r], ['longitude_of_center', 'Longitude_Of_Center'], ['longitude_of_center', 'Longitude_of_center'], ['longc', 'longitude_of_center', d2r], ['x0', 'false_easting', toMeter], ['y0', 'false_northing', toMeter], ['long0', 'central_meridian', d2r], ['lat0', 'latitude_of_origin', d2r], ['lat0', 'standard_parallel_1', d2r], ['lat1', 'standard_parallel_1', d2r], ['lat2', 'standard_parallel_2', d2r], ['azimuth', 'Azimuth'], ['alpha', 'azimuth', d2r], ['srsCode', 'name']];
  10940. list.forEach(renamer);
  10941. if (!wkt.long0 && wkt.longc && (wkt.projName === 'Albers_Conic_Equal_Area' || wkt.projName === 'Lambert_Azimuthal_Equal_Area')) {
  10942. wkt.long0 = wkt.longc;
  10943. }
  10944. if (!wkt.lat_ts && wkt.lat1 && (wkt.projName === 'Stereographic_South_Pole' || wkt.projName === 'Polar Stereographic (variant B)')) {
  10945. wkt.lat0 = d2r(wkt.lat1 > 0 ? 90 : -90);
  10946. wkt.lat_ts = wkt.lat1;
  10947. }
  10948. }
  10949. var wkt = function wkt(_wkt) {
  10950. var lisp = parseString(_wkt);
  10951. var type = lisp.shift();
  10952. var name = lisp.shift();
  10953. lisp.unshift(['name', name]);
  10954. lisp.unshift(['type', type]);
  10955. var obj = {};
  10956. sExpr(lisp, obj);
  10957. cleanWKT(obj);
  10958. return obj;
  10959. };
  10960. function defs(name) {
  10961. /*global console*/
  10962. var that = this;
  10963. if (arguments.length === 2) {
  10964. var def = arguments[1];
  10965. if (typeof def === 'string') {
  10966. if (def.charAt(0) === '+') {
  10967. defs[name] = parseProj(arguments[1]);
  10968. } else {
  10969. defs[name] = wkt(arguments[1]);
  10970. }
  10971. } else {
  10972. defs[name] = def;
  10973. }
  10974. } else if (arguments.length === 1) {
  10975. if (Array.isArray(name)) {
  10976. return name.map(function (v) {
  10977. if (Array.isArray(v)) {
  10978. defs.apply(that, v);
  10979. } else {
  10980. defs(v);
  10981. }
  10982. });
  10983. } else if (typeof name === 'string') {
  10984. if (name in defs) {
  10985. return defs[name];
  10986. }
  10987. } else if ('EPSG' in name) {
  10988. defs['EPSG:' + name.EPSG] = name;
  10989. } else if ('ESRI' in name) {
  10990. defs['ESRI:' + name.ESRI] = name;
  10991. } else if ('IAU2000' in name) {
  10992. defs['IAU2000:' + name.IAU2000] = name;
  10993. } else {
  10994. console.log(name);
  10995. }
  10996. return;
  10997. }
  10998. }
  10999. globals(defs);
  11000. function testObj(code) {
  11001. return typeof code === 'string';
  11002. }
  11003. function testDef(code) {
  11004. return code in defs;
  11005. }
  11006. var codeWords = ['PROJECTEDCRS', 'PROJCRS', 'GEOGCS', 'GEOCCS', 'PROJCS', 'LOCAL_CS', 'GEODCRS', 'GEODETICCRS', 'GEODETICDATUM', 'ENGCRS', 'ENGINEERINGCRS'];
  11007. function testWKT(code) {
  11008. return codeWords.some(function (word) {
  11009. return code.indexOf(word) > -1;
  11010. });
  11011. }
  11012. var codes = ['3857', '900913', '3785', '102113'];
  11013. function checkMercator(item) {
  11014. var auth = match(item, 'authority');
  11015. if (!auth) {
  11016. return;
  11017. }
  11018. var code = match(auth, 'epsg');
  11019. return code && codes.indexOf(code) > -1;
  11020. }
  11021. function checkProjStr(item) {
  11022. var ext = match(item, 'extension');
  11023. if (!ext) {
  11024. return;
  11025. }
  11026. return match(ext, 'proj4');
  11027. }
  11028. function testProj(code) {
  11029. return code[0] === '+';
  11030. }
  11031. function parse(code) {
  11032. if (testObj(code)) {
  11033. //check to see if this is a WKT string
  11034. if (testDef(code)) {
  11035. return defs[code];
  11036. }
  11037. if (testWKT(code)) {
  11038. var out = wkt(code);
  11039. // test of spetial case, due to this being a very common and often malformed
  11040. if (checkMercator(out)) {
  11041. return defs['EPSG:3857'];
  11042. }
  11043. var maybeProjStr = checkProjStr(out);
  11044. if (maybeProjStr) {
  11045. return parseProj(maybeProjStr);
  11046. }
  11047. return out;
  11048. }
  11049. if (testProj(code)) {
  11050. return parseProj(code);
  11051. }
  11052. } else {
  11053. return code;
  11054. }
  11055. }
  11056. var extend = function extend(destination, source) {
  11057. destination = destination || {};
  11058. var value, property;
  11059. if (!source) {
  11060. return destination;
  11061. }
  11062. for (property in source) {
  11063. value = source[property];
  11064. if (value !== undefined) {
  11065. destination[property] = value;
  11066. }
  11067. }
  11068. return destination;
  11069. };
  11070. var msfnz = function msfnz(eccent, sinphi, cosphi) {
  11071. var con = eccent * sinphi;
  11072. return cosphi / Math.sqrt(1 - con * con);
  11073. };
  11074. var sign = function sign(x) {
  11075. return x < 0 ? -1 : 1;
  11076. };
  11077. var adjust_lon = function adjust_lon(x) {
  11078. return Math.abs(x) <= SPI ? x : x - sign(x) * TWO_PI;
  11079. };
  11080. var tsfnz = function tsfnz(eccent, phi, sinphi) {
  11081. var con = eccent * sinphi;
  11082. var com = 0.5 * eccent;
  11083. con = Math.pow((1 - con) / (1 + con), com);
  11084. return Math.tan(0.5 * (HALF_PI - phi)) / con;
  11085. };
  11086. var phi2z = function phi2z(eccent, ts) {
  11087. var eccnth = 0.5 * eccent;
  11088. var con, dphi;
  11089. var phi = HALF_PI - 2 * Math.atan(ts);
  11090. for (var i = 0; i <= 15; i++) {
  11091. con = eccent * Math.sin(phi);
  11092. dphi = HALF_PI - 2 * Math.atan(ts * Math.pow((1 - con) / (1 + con), eccnth)) - phi;
  11093. phi += dphi;
  11094. if (Math.abs(dphi) <= 0.0000000001) {
  11095. return phi;
  11096. }
  11097. }
  11098. //console.log("phi2z has NoConvergence");
  11099. return -9999;
  11100. };
  11101. function init() {
  11102. var con = this.b / this.a;
  11103. this.es = 1 - con * con;
  11104. if (!('x0' in this)) {
  11105. this.x0 = 0;
  11106. }
  11107. if (!('y0' in this)) {
  11108. this.y0 = 0;
  11109. }
  11110. this.e = Math.sqrt(this.es);
  11111. if (this.lat_ts) {
  11112. if (this.sphere) {
  11113. this.k0 = Math.cos(this.lat_ts);
  11114. } else {
  11115. this.k0 = msfnz(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));
  11116. }
  11117. } else {
  11118. if (!this.k0) {
  11119. if (this.k) {
  11120. this.k0 = this.k;
  11121. } else {
  11122. this.k0 = 1;
  11123. }
  11124. }
  11125. }
  11126. }
  11127. /* Mercator forward equations--mapping lat,long to x,y
  11128. --------------------------------------------------*/
  11129. function forward(p) {
  11130. var lon = p.x;
  11131. var lat = p.y;
  11132. // convert to radians
  11133. if (lat * R2D > 90 && lat * R2D < -90 && lon * R2D > 180 && lon * R2D < -180) {
  11134. return null;
  11135. }
  11136. var x, y;
  11137. if (Math.abs(Math.abs(lat) - HALF_PI) <= EPSLN) {
  11138. return null;
  11139. } else {
  11140. if (this.sphere) {
  11141. x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0);
  11142. y = this.y0 + this.a * this.k0 * Math.log(Math.tan(FORTPI + 0.5 * lat));
  11143. } else {
  11144. var sinphi = Math.sin(lat);
  11145. var ts = tsfnz(this.e, lat, sinphi);
  11146. x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0);
  11147. y = this.y0 - this.a * this.k0 * Math.log(ts);
  11148. }
  11149. p.x = x;
  11150. p.y = y;
  11151. return p;
  11152. }
  11153. }
  11154. /* Mercator inverse equations--mapping x,y to lat/long
  11155. --------------------------------------------------*/
  11156. function inverse(p) {
  11157. var x = p.x - this.x0;
  11158. var y = p.y - this.y0;
  11159. var lon, lat;
  11160. if (this.sphere) {
  11161. lat = HALF_PI - 2 * Math.atan(Math.exp(-y / (this.a * this.k0)));
  11162. } else {
  11163. var ts = Math.exp(-y / (this.a * this.k0));
  11164. lat = phi2z(this.e, ts);
  11165. if (lat === -9999) {
  11166. return null;
  11167. }
  11168. }
  11169. lon = adjust_lon(this.long0 + x / (this.a * this.k0));
  11170. p.x = lon;
  11171. p.y = lat;
  11172. return p;
  11173. }
  11174. var names$1 = ["Mercator", "Popular Visualisation Pseudo Mercator", "Mercator_1SP", "Mercator_Auxiliary_Sphere", "merc"];
  11175. var merc = {
  11176. init: init,
  11177. forward: forward,
  11178. inverse: inverse,
  11179. names: names$1
  11180. };
  11181. function init$1() {
  11182. //no-op for longlat
  11183. }
  11184. function identity(pt) {
  11185. return pt;
  11186. }
  11187. var names$2 = ["longlat", "identity"];
  11188. var longlat = {
  11189. init: init$1,
  11190. forward: identity,
  11191. inverse: identity,
  11192. names: names$2
  11193. };
  11194. var projs = [merc, longlat];
  11195. var names = {};
  11196. var projStore = [];
  11197. function add(proj, i) {
  11198. var len = projStore.length;
  11199. if (!proj.names) {
  11200. console.log(i);
  11201. return true;
  11202. }
  11203. projStore[len] = proj;
  11204. proj.names.forEach(function (n) {
  11205. names[n.toLowerCase()] = len;
  11206. });
  11207. return this;
  11208. }
  11209. function get(name) {
  11210. if (!name) {
  11211. return false;
  11212. }
  11213. var n = name.toLowerCase();
  11214. if (typeof names[n] !== 'undefined' && projStore[names[n]]) {
  11215. return projStore[names[n]];
  11216. }
  11217. }
  11218. function start() {
  11219. projs.forEach(add);
  11220. }
  11221. var projections = {
  11222. start: start,
  11223. add: add,
  11224. get: get
  11225. };
  11226. var exports$2 = {};
  11227. exports$2.MERIT = {
  11228. a: 6378137.0,
  11229. rf: 298.257,
  11230. ellipseName: "MERIT 1983"
  11231. };
  11232. exports$2.SGS85 = {
  11233. a: 6378136.0,
  11234. rf: 298.257,
  11235. ellipseName: "Soviet Geodetic System 85"
  11236. };
  11237. exports$2.GRS80 = {
  11238. a: 6378137.0,
  11239. rf: 298.257222101,
  11240. ellipseName: "GRS 1980(IUGG, 1980)"
  11241. };
  11242. exports$2.IAU76 = {
  11243. a: 6378140.0,
  11244. rf: 298.257,
  11245. ellipseName: "IAU 1976"
  11246. };
  11247. exports$2.airy = {
  11248. a: 6377563.396,
  11249. b: 6356256.910,
  11250. ellipseName: "Airy 1830"
  11251. };
  11252. exports$2.APL4 = {
  11253. a: 6378137,
  11254. rf: 298.25,
  11255. ellipseName: "Appl. Physics. 1965"
  11256. };
  11257. exports$2.NWL9D = {
  11258. a: 6378145.0,
  11259. rf: 298.25,
  11260. ellipseName: "Naval Weapons Lab., 1965"
  11261. };
  11262. exports$2.mod_airy = {
  11263. a: 6377340.189,
  11264. b: 6356034.446,
  11265. ellipseName: "Modified Airy"
  11266. };
  11267. exports$2.andrae = {
  11268. a: 6377104.43,
  11269. rf: 300.0,
  11270. ellipseName: "Andrae 1876 (Den., Iclnd.)"
  11271. };
  11272. exports$2.aust_SA = {
  11273. a: 6378160.0,
  11274. rf: 298.25,
  11275. ellipseName: "Australian Natl & S. Amer. 1969"
  11276. };
  11277. exports$2.GRS67 = {
  11278. a: 6378160.0,
  11279. rf: 298.2471674270,
  11280. ellipseName: "GRS 67(IUGG 1967)"
  11281. };
  11282. exports$2.bessel = {
  11283. a: 6377397.155,
  11284. rf: 299.1528128,
  11285. ellipseName: "Bessel 1841"
  11286. };
  11287. exports$2.bess_nam = {
  11288. a: 6377483.865,
  11289. rf: 299.1528128,
  11290. ellipseName: "Bessel 1841 (Namibia)"
  11291. };
  11292. exports$2.clrk66 = {
  11293. a: 6378206.4,
  11294. b: 6356583.8,
  11295. ellipseName: "Clarke 1866"
  11296. };
  11297. exports$2.clrk80 = {
  11298. a: 6378249.145,
  11299. rf: 293.4663,
  11300. ellipseName: "Clarke 1880 mod."
  11301. };
  11302. exports$2.clrk80ign = {
  11303. a: 6378249.2,
  11304. b: 6356515,
  11305. rf: 293.4660213,
  11306. ellipseName: "Clarke 1880 (IGN)"
  11307. };
  11308. exports$2.clrk58 = {
  11309. a: 6378293.645208759,
  11310. rf: 294.2606763692654,
  11311. ellipseName: "Clarke 1858"
  11312. };
  11313. exports$2.CPM = {
  11314. a: 6375738.7,
  11315. rf: 334.29,
  11316. ellipseName: "Comm. des Poids et Mesures 1799"
  11317. };
  11318. exports$2.delmbr = {
  11319. a: 6376428.0,
  11320. rf: 311.5,
  11321. ellipseName: "Delambre 1810 (Belgium)"
  11322. };
  11323. exports$2.engelis = {
  11324. a: 6378136.05,
  11325. rf: 298.2566,
  11326. ellipseName: "Engelis 1985"
  11327. };
  11328. exports$2.evrst30 = {
  11329. a: 6377276.345,
  11330. rf: 300.8017,
  11331. ellipseName: "Everest 1830"
  11332. };
  11333. exports$2.evrst48 = {
  11334. a: 6377304.063,
  11335. rf: 300.8017,
  11336. ellipseName: "Everest 1948"
  11337. };
  11338. exports$2.evrst56 = {
  11339. a: 6377301.243,
  11340. rf: 300.8017,
  11341. ellipseName: "Everest 1956"
  11342. };
  11343. exports$2.evrst69 = {
  11344. a: 6377295.664,
  11345. rf: 300.8017,
  11346. ellipseName: "Everest 1969"
  11347. };
  11348. exports$2.evrstSS = {
  11349. a: 6377298.556,
  11350. rf: 300.8017,
  11351. ellipseName: "Everest (Sabah & Sarawak)"
  11352. };
  11353. exports$2.fschr60 = {
  11354. a: 6378166.0,
  11355. rf: 298.3,
  11356. ellipseName: "Fischer (Mercury Datum) 1960"
  11357. };
  11358. exports$2.fschr60m = {
  11359. a: 6378155.0,
  11360. rf: 298.3,
  11361. ellipseName: "Fischer 1960"
  11362. };
  11363. exports$2.fschr68 = {
  11364. a: 6378150.0,
  11365. rf: 298.3,
  11366. ellipseName: "Fischer 1968"
  11367. };
  11368. exports$2.helmert = {
  11369. a: 6378200.0,
  11370. rf: 298.3,
  11371. ellipseName: "Helmert 1906"
  11372. };
  11373. exports$2.hough = {
  11374. a: 6378270.0,
  11375. rf: 297.0,
  11376. ellipseName: "Hough"
  11377. };
  11378. exports$2.intl = {
  11379. a: 6378388.0,
  11380. rf: 297.0,
  11381. ellipseName: "International 1909 (Hayford)"
  11382. };
  11383. exports$2.kaula = {
  11384. a: 6378163.0,
  11385. rf: 298.24,
  11386. ellipseName: "Kaula 1961"
  11387. };
  11388. exports$2.lerch = {
  11389. a: 6378139.0,
  11390. rf: 298.257,
  11391. ellipseName: "Lerch 1979"
  11392. };
  11393. exports$2.mprts = {
  11394. a: 6397300.0,
  11395. rf: 191.0,
  11396. ellipseName: "Maupertius 1738"
  11397. };
  11398. exports$2.new_intl = {
  11399. a: 6378157.5,
  11400. b: 6356772.2,
  11401. ellipseName: "New International 1967"
  11402. };
  11403. exports$2.plessis = {
  11404. a: 6376523.0,
  11405. rf: 6355863.0,
  11406. ellipseName: "Plessis 1817 (France)"
  11407. };
  11408. exports$2.krass = {
  11409. a: 6378245.0,
  11410. rf: 298.3,
  11411. ellipseName: "Krassovsky, 1942"
  11412. };
  11413. exports$2.SEasia = {
  11414. a: 6378155.0,
  11415. b: 6356773.3205,
  11416. ellipseName: "Southeast Asia"
  11417. };
  11418. exports$2.walbeck = {
  11419. a: 6376896.0,
  11420. b: 6355834.8467,
  11421. ellipseName: "Walbeck"
  11422. };
  11423. exports$2.WGS60 = {
  11424. a: 6378165.0,
  11425. rf: 298.3,
  11426. ellipseName: "WGS 60"
  11427. };
  11428. exports$2.WGS66 = {
  11429. a: 6378145.0,
  11430. rf: 298.25,
  11431. ellipseName: "WGS 66"
  11432. };
  11433. exports$2.WGS7 = {
  11434. a: 6378135.0,
  11435. rf: 298.26,
  11436. ellipseName: "WGS 72"
  11437. };
  11438. var WGS84 = exports$2.WGS84 = {
  11439. a: 6378137.0,
  11440. rf: 298.257223563,
  11441. ellipseName: "WGS 84"
  11442. };
  11443. exports$2.sphere = {
  11444. a: 6370997.0,
  11445. b: 6370997.0,
  11446. ellipseName: "Normal Sphere (r=6370997)"
  11447. };
  11448. function eccentricity(a, b, rf, R_A) {
  11449. var a2 = a * a; // used in geocentric
  11450. var b2 = b * b; // used in geocentric
  11451. var es = (a2 - b2) / a2; // e ^ 2
  11452. var e = 0;
  11453. if (R_A) {
  11454. a *= 1 - es * (SIXTH + es * (RA4 + es * RA6));
  11455. a2 = a * a;
  11456. es = 0;
  11457. } else {
  11458. e = Math.sqrt(es); // eccentricity
  11459. }
  11460. var ep2 = (a2 - b2) / b2; // used in geocentric
  11461. return {
  11462. es: es,
  11463. e: e,
  11464. ep2: ep2
  11465. };
  11466. }
  11467. function sphere(a, b, rf, ellps, sphere) {
  11468. if (!a) {
  11469. // do we have an ellipsoid?
  11470. var ellipse = match(exports$2, ellps);
  11471. if (!ellipse) {
  11472. ellipse = WGS84;
  11473. }
  11474. a = ellipse.a;
  11475. b = ellipse.b;
  11476. rf = ellipse.rf;
  11477. }
  11478. if (rf && !b) {
  11479. b = (1.0 - 1.0 / rf) * a;
  11480. }
  11481. if (rf === 0 || Math.abs(a - b) < EPSLN) {
  11482. sphere = true;
  11483. b = a;
  11484. }
  11485. return {
  11486. a: a,
  11487. b: b,
  11488. rf: rf,
  11489. sphere: sphere
  11490. };
  11491. }
  11492. var exports$3 = {};
  11493. exports$3.wgs84 = {
  11494. towgs84: "0,0,0",
  11495. ellipse: "WGS84",
  11496. datumName: "WGS84"
  11497. };
  11498. exports$3.ch1903 = {
  11499. towgs84: "674.374,15.056,405.346",
  11500. ellipse: "bessel",
  11501. datumName: "swiss"
  11502. };
  11503. exports$3.ggrs87 = {
  11504. towgs84: "-199.87,74.79,246.62",
  11505. ellipse: "GRS80",
  11506. datumName: "Greek_Geodetic_Reference_System_1987"
  11507. };
  11508. exports$3.nad83 = {
  11509. towgs84: "0,0,0",
  11510. ellipse: "GRS80",
  11511. datumName: "North_American_Datum_1983"
  11512. };
  11513. exports$3.nad27 = {
  11514. nadgrids: "@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",
  11515. ellipse: "clrk66",
  11516. datumName: "North_American_Datum_1927"
  11517. };
  11518. exports$3.potsdam = {
  11519. towgs84: "598.1,73.7,418.2,0.202,0.045,-2.455,6.7",
  11520. ellipse: "bessel",
  11521. datumName: "Potsdam Rauenberg 1950 DHDN"
  11522. };
  11523. exports$3.carthage = {
  11524. towgs84: "-263.0,6.0,431.0",
  11525. ellipse: "clark80",
  11526. datumName: "Carthage 1934 Tunisia"
  11527. };
  11528. exports$3.hermannskogel = {
  11529. towgs84: "577.326,90.129,463.919,5.137,1.474,5.297,2.4232",
  11530. ellipse: "bessel",
  11531. datumName: "Hermannskogel"
  11532. };
  11533. exports$3.osni52 = {
  11534. towgs84: "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",
  11535. ellipse: "airy",
  11536. datumName: "Irish National"
  11537. };
  11538. exports$3.ire65 = {
  11539. towgs84: "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",
  11540. ellipse: "mod_airy",
  11541. datumName: "Ireland 1965"
  11542. };
  11543. exports$3.rassadiran = {
  11544. towgs84: "-133.63,-157.5,-158.62",
  11545. ellipse: "intl",
  11546. datumName: "Rassadiran"
  11547. };
  11548. exports$3.nzgd49 = {
  11549. towgs84: "59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",
  11550. ellipse: "intl",
  11551. datumName: "New Zealand Geodetic Datum 1949"
  11552. };
  11553. exports$3.osgb36 = {
  11554. towgs84: "446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",
  11555. ellipse: "airy",
  11556. datumName: "Airy 1830"
  11557. };
  11558. exports$3.s_jtsk = {
  11559. towgs84: "589,76,480",
  11560. ellipse: 'bessel',
  11561. datumName: 'S-JTSK (Ferro)'
  11562. };
  11563. exports$3.beduaram = {
  11564. towgs84: '-106,-87,188',
  11565. ellipse: 'clrk80',
  11566. datumName: 'Beduaram'
  11567. };
  11568. exports$3.gunung_segara = {
  11569. towgs84: '-403,684,41',
  11570. ellipse: 'bessel',
  11571. datumName: 'Gunung Segara Jakarta'
  11572. };
  11573. exports$3.rnb72 = {
  11574. towgs84: "106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",
  11575. ellipse: "intl",
  11576. datumName: "Reseau National Belge 1972"
  11577. };
  11578. function datum(datumCode, datum_params, a, b, es, ep2, nadgrids) {
  11579. var out = {};
  11580. if (datumCode === undefined || datumCode === 'none') {
  11581. out.datum_type = PJD_NODATUM;
  11582. } else {
  11583. out.datum_type = PJD_WGS84;
  11584. }
  11585. if (datum_params) {
  11586. out.datum_params = datum_params.map(parseFloat);
  11587. if (out.datum_params[0] !== 0 || out.datum_params[1] !== 0 || out.datum_params[2] !== 0) {
  11588. out.datum_type = PJD_3PARAM;
  11589. }
  11590. if (out.datum_params.length > 3) {
  11591. if (out.datum_params[3] !== 0 || out.datum_params[4] !== 0 || out.datum_params[5] !== 0 || out.datum_params[6] !== 0) {
  11592. out.datum_type = PJD_7PARAM;
  11593. out.datum_params[3] *= SEC_TO_RAD;
  11594. out.datum_params[4] *= SEC_TO_RAD;
  11595. out.datum_params[5] *= SEC_TO_RAD;
  11596. out.datum_params[6] = out.datum_params[6] / 1000000.0 + 1.0;
  11597. }
  11598. }
  11599. }
  11600. if (nadgrids) {
  11601. out.datum_type = PJD_GRIDSHIFT;
  11602. out.grids = nadgrids;
  11603. }
  11604. out.a = a; //datum object also uses these values
  11605. out.b = b;
  11606. out.es = es;
  11607. out.ep2 = ep2;
  11608. return out;
  11609. }
  11610. /**
  11611. * Resources for details of NTv2 file formats:
  11612. * - https://web.archive.org/web/20140127204822if_/http://www.mgs.gov.on.ca:80/stdprodconsume/groups/content/@mgs/@iandit/documents/resourcelist/stel02_047447.pdf
  11613. * - http://mimaka.com/help/gs/html/004_NTV2%20Data%20Format.htm
  11614. */
  11615. var loadedNadgrids = {};
  11616. /**
  11617. * Load a binary NTv2 file (.gsb) to a key that can be used in a proj string like +nadgrids=<key>. Pass the NTv2 file
  11618. * as an ArrayBuffer.
  11619. */
  11620. function nadgrid(key, data) {
  11621. var view = new DataView(data);
  11622. var isLittleEndian = detectLittleEndian(view);
  11623. var header = readHeader(view, isLittleEndian);
  11624. if (header.nSubgrids > 1) {
  11625. console.log('Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored');
  11626. }
  11627. var subgrids = readSubgrids(view, header, isLittleEndian);
  11628. var nadgrid = {
  11629. header: header,
  11630. subgrids: subgrids
  11631. };
  11632. loadedNadgrids[key] = nadgrid;
  11633. return nadgrid;
  11634. }
  11635. /**
  11636. * Given a proj4 value for nadgrids, return an array of loaded grids
  11637. */
  11638. function getNadgrids(nadgrids) {
  11639. // Format details: http://proj.maptools.org/gen_parms.html
  11640. if (nadgrids === undefined) {
  11641. return null;
  11642. }
  11643. var grids = nadgrids.split(',');
  11644. return grids.map(parseNadgridString);
  11645. }
  11646. function parseNadgridString(value) {
  11647. if (value.length === 0) {
  11648. return null;
  11649. }
  11650. var optional = value[0] === '@';
  11651. if (optional) {
  11652. value = value.slice(1);
  11653. }
  11654. if (value === 'null') {
  11655. return {
  11656. name: 'null',
  11657. mandatory: !optional,
  11658. grid: null,
  11659. isNull: true
  11660. };
  11661. }
  11662. return {
  11663. name: value,
  11664. mandatory: !optional,
  11665. grid: loadedNadgrids[value] || null,
  11666. isNull: false
  11667. };
  11668. }
  11669. function secondsToRadians(seconds) {
  11670. return seconds / 3600 * Math.PI / 180;
  11671. }
  11672. function detectLittleEndian(view) {
  11673. var nFields = view.getInt32(8, false);
  11674. if (nFields === 11) {
  11675. return false;
  11676. }
  11677. nFields = view.getInt32(8, true);
  11678. if (nFields !== 11) {
  11679. console.warn('Failed to detect nadgrid endian-ness, defaulting to little-endian');
  11680. }
  11681. return true;
  11682. }
  11683. function readHeader(view, isLittleEndian) {
  11684. return {
  11685. nFields: view.getInt32(8, isLittleEndian),
  11686. nSubgridFields: view.getInt32(24, isLittleEndian),
  11687. nSubgrids: view.getInt32(40, isLittleEndian),
  11688. shiftType: decodeString(view, 56, 56 + 8).trim(),
  11689. fromSemiMajorAxis: view.getFloat64(120, isLittleEndian),
  11690. fromSemiMinorAxis: view.getFloat64(136, isLittleEndian),
  11691. toSemiMajorAxis: view.getFloat64(152, isLittleEndian),
  11692. toSemiMinorAxis: view.getFloat64(168, isLittleEndian)
  11693. };
  11694. }
  11695. function decodeString(view, start, end) {
  11696. return String.fromCharCode.apply(null, new Uint8Array(view.buffer.slice(start, end)));
  11697. }
  11698. function readSubgrids(view, header, isLittleEndian) {
  11699. var gridOffset = 176;
  11700. var grids = [];
  11701. for (var i = 0; i < header.nSubgrids; i++) {
  11702. var subHeader = readGridHeader(view, gridOffset, isLittleEndian);
  11703. var nodes = readGridNodes(view, gridOffset, subHeader, isLittleEndian);
  11704. var lngColumnCount = Math.round(1 + (subHeader.upperLongitude - subHeader.lowerLongitude) / subHeader.longitudeInterval);
  11705. var latColumnCount = Math.round(1 + (subHeader.upperLatitude - subHeader.lowerLatitude) / subHeader.latitudeInterval);
  11706. // Proj4 operates on radians whereas the coordinates are in seconds in the grid
  11707. grids.push({
  11708. ll: [secondsToRadians(subHeader.lowerLongitude), secondsToRadians(subHeader.lowerLatitude)],
  11709. del: [secondsToRadians(subHeader.longitudeInterval), secondsToRadians(subHeader.latitudeInterval)],
  11710. lim: [lngColumnCount, latColumnCount],
  11711. count: subHeader.gridNodeCount,
  11712. cvs: mapNodes(nodes)
  11713. });
  11714. }
  11715. return grids;
  11716. }
  11717. function mapNodes(nodes) {
  11718. return nodes.map(function (r) {
  11719. return [secondsToRadians(r.longitudeShift), secondsToRadians(r.latitudeShift)];
  11720. });
  11721. }
  11722. function readGridHeader(view, offset, isLittleEndian) {
  11723. return {
  11724. name: decodeString(view, offset + 8, offset + 16).trim(),
  11725. parent: decodeString(view, offset + 24, offset + 24 + 8).trim(),
  11726. lowerLatitude: view.getFloat64(offset + 72, isLittleEndian),
  11727. upperLatitude: view.getFloat64(offset + 88, isLittleEndian),
  11728. lowerLongitude: view.getFloat64(offset + 104, isLittleEndian),
  11729. upperLongitude: view.getFloat64(offset + 120, isLittleEndian),
  11730. latitudeInterval: view.getFloat64(offset + 136, isLittleEndian),
  11731. longitudeInterval: view.getFloat64(offset + 152, isLittleEndian),
  11732. gridNodeCount: view.getInt32(offset + 168, isLittleEndian)
  11733. };
  11734. }
  11735. function readGridNodes(view, offset, gridHeader, isLittleEndian) {
  11736. var nodesOffset = offset + 176;
  11737. var gridRecordLength = 16;
  11738. var gridShiftRecords = [];
  11739. for (var i = 0; i < gridHeader.gridNodeCount; i++) {
  11740. var record = {
  11741. latitudeShift: view.getFloat32(nodesOffset + i * gridRecordLength, isLittleEndian),
  11742. longitudeShift: view.getFloat32(nodesOffset + i * gridRecordLength + 4, isLittleEndian),
  11743. latitudeAccuracy: view.getFloat32(nodesOffset + i * gridRecordLength + 8, isLittleEndian),
  11744. longitudeAccuracy: view.getFloat32(nodesOffset + i * gridRecordLength + 12, isLittleEndian)
  11745. };
  11746. gridShiftRecords.push(record);
  11747. }
  11748. return gridShiftRecords;
  11749. }
  11750. function Projection(srsCode, callback) {
  11751. if (!(this instanceof Projection)) {
  11752. return new Projection(srsCode);
  11753. }
  11754. callback = callback || function (error) {
  11755. if (error) {
  11756. throw error;
  11757. }
  11758. };
  11759. var json = parse(srsCode);
  11760. if (_typeof(json) !== 'object') {
  11761. callback(srsCode);
  11762. return;
  11763. }
  11764. var ourProj = Projection.projections.get(json.projName);
  11765. if (!ourProj) {
  11766. callback(srsCode);
  11767. return;
  11768. }
  11769. if (json.datumCode && json.datumCode !== 'none') {
  11770. var datumDef = match(exports$3, json.datumCode);
  11771. if (datumDef) {
  11772. json.datum_params = json.datum_params || (datumDef.towgs84 ? datumDef.towgs84.split(',') : null);
  11773. json.ellps = datumDef.ellipse;
  11774. json.datumName = datumDef.datumName ? datumDef.datumName : json.datumCode;
  11775. }
  11776. }
  11777. json.k0 = json.k0 || 1.0;
  11778. json.axis = json.axis || 'enu';
  11779. json.ellps = json.ellps || 'wgs84';
  11780. json.lat1 = json.lat1 || json.lat0; // Lambert_Conformal_Conic_1SP, for example, needs this
  11781. var sphere_ = sphere(json.a, json.b, json.rf, json.ellps, json.sphere);
  11782. var ecc = eccentricity(sphere_.a, sphere_.b, sphere_.rf, json.R_A);
  11783. var nadgrids = getNadgrids(json.nadgrids);
  11784. var datumObj = json.datum || datum(json.datumCode, json.datum_params, sphere_.a, sphere_.b, ecc.es, ecc.ep2, nadgrids);
  11785. extend(this, json); // transfer everything over from the projection because we don't know what we'll need
  11786. extend(this, ourProj); // transfer all the methods from the projection
  11787. // copy the 4 things over we calculated in deriveConstants.sphere
  11788. this.a = sphere_.a;
  11789. this.b = sphere_.b;
  11790. this.rf = sphere_.rf;
  11791. this.sphere = sphere_.sphere;
  11792. // copy the 3 things we calculated in deriveConstants.eccentricity
  11793. this.es = ecc.es;
  11794. this.e = ecc.e;
  11795. this.ep2 = ecc.ep2;
  11796. // add in the datum object
  11797. this.datum = datumObj;
  11798. // init the projection
  11799. this.init();
  11800. // legecy callback from back in the day when it went to spatialreference.org
  11801. callback(null, this);
  11802. }
  11803. Projection.projections = projections;
  11804. Projection.projections.start();
  11805. 'use strict';
  11806. function compareDatums(source, dest) {
  11807. if (source.datum_type !== dest.datum_type) {
  11808. return false; // false, datums are not equal
  11809. } else if (source.a !== dest.a || Math.abs(source.es - dest.es) > 0.000000000050) {
  11810. // the tolerance for es is to ensure that GRS80 and WGS84
  11811. // are considered identical
  11812. return false;
  11813. } else if (source.datum_type === PJD_3PARAM) {
  11814. return source.datum_params[0] === dest.datum_params[0] && source.datum_params[1] === dest.datum_params[1] && source.datum_params[2] === dest.datum_params[2];
  11815. } else if (source.datum_type === PJD_7PARAM) {
  11816. return source.datum_params[0] === dest.datum_params[0] && source.datum_params[1] === dest.datum_params[1] && source.datum_params[2] === dest.datum_params[2] && source.datum_params[3] === dest.datum_params[3] && source.datum_params[4] === dest.datum_params[4] && source.datum_params[5] === dest.datum_params[5] && source.datum_params[6] === dest.datum_params[6];
  11817. } else {
  11818. return true; // datums are equal
  11819. }
  11820. } // cs_compare_datums()
  11821. /*
  11822. * The function Convert_Geodetic_To_Geocentric converts geodetic coordinates
  11823. * (latitude, longitude, and height) to geocentric coordinates (X, Y, Z),
  11824. * according to the current ellipsoid parameters.
  11825. *
  11826. * Latitude : Geodetic latitude in radians (input)
  11827. * Longitude : Geodetic longitude in radians (input)
  11828. * Height : Geodetic height, in meters (input)
  11829. * X : Calculated Geocentric X coordinate, in meters (output)
  11830. * Y : Calculated Geocentric Y coordinate, in meters (output)
  11831. * Z : Calculated Geocentric Z coordinate, in meters (output)
  11832. *
  11833. */
  11834. function geodeticToGeocentric(p, es, a) {
  11835. var Longitude = p.x;
  11836. var Latitude = p.y;
  11837. var Height = p.z ? p.z : 0; //Z value not always supplied
  11838. var Rn; /* Earth radius at location */
  11839. var Sin_Lat; /* Math.sin(Latitude) */
  11840. var Sin2_Lat; /* Square of Math.sin(Latitude) */
  11841. var Cos_Lat; /* Math.cos(Latitude) */
  11842. /*
  11843. ** Don't blow up if Latitude is just a little out of the value
  11844. ** range as it may just be a rounding issue. Also removed longitude
  11845. ** test, it should be wrapped by Math.cos() and Math.sin(). NFW for PROJ.4, Sep/2001.
  11846. */
  11847. if (Latitude < -HALF_PI && Latitude > -1.001 * HALF_PI) {
  11848. Latitude = -HALF_PI;
  11849. } else if (Latitude > HALF_PI && Latitude < 1.001 * HALF_PI) {
  11850. Latitude = HALF_PI;
  11851. } else if (Latitude < -HALF_PI) {
  11852. /* Latitude out of range */
  11853. //..reportError('geocent:lat out of range:' + Latitude);
  11854. return {
  11855. x: -Infinity,
  11856. y: -Infinity,
  11857. z: p.z
  11858. };
  11859. } else if (Latitude > HALF_PI) {
  11860. /* Latitude out of range */
  11861. return {
  11862. x: Infinity,
  11863. y: Infinity,
  11864. z: p.z
  11865. };
  11866. }
  11867. if (Longitude > Math.PI) {
  11868. Longitude -= 2 * Math.PI;
  11869. }
  11870. Sin_Lat = Math.sin(Latitude);
  11871. Cos_Lat = Math.cos(Latitude);
  11872. Sin2_Lat = Sin_Lat * Sin_Lat;
  11873. Rn = a / Math.sqrt(1.0e0 - es * Sin2_Lat);
  11874. return {
  11875. x: (Rn + Height) * Cos_Lat * Math.cos(Longitude),
  11876. y: (Rn + Height) * Cos_Lat * Math.sin(Longitude),
  11877. z: (Rn * (1 - es) + Height) * Sin_Lat
  11878. };
  11879. } // cs_geodetic_to_geocentric()
  11880. function geocentricToGeodetic(p, es, a, b) {
  11881. /* local defintions and variables */
  11882. /* end-criterium of loop, accuracy of sin(Latitude) */
  11883. var genau = 1e-12;
  11884. var genau2 = genau * genau;
  11885. var maxiter = 30;
  11886. var P; /* distance between semi-minor axis and location */
  11887. var RR; /* distance between center and location */
  11888. var CT; /* sin of geocentric latitude */
  11889. var ST; /* cos of geocentric latitude */
  11890. var RX;
  11891. var RK;
  11892. var RN; /* Earth radius at location */
  11893. var CPHI0; /* cos of start or old geodetic latitude in iterations */
  11894. var SPHI0; /* sin of start or old geodetic latitude in iterations */
  11895. var CPHI; /* cos of searched geodetic latitude */
  11896. var SPHI; /* sin of searched geodetic latitude */
  11897. var SDPHI; /* end-criterium: addition-theorem of sin(Latitude(iter)-Latitude(iter-1)) */
  11898. var iter; /* # of continous iteration, max. 30 is always enough (s.a.) */
  11899. var X = p.x;
  11900. var Y = p.y;
  11901. var Z = p.z ? p.z : 0.0; //Z value not always supplied
  11902. var Longitude;
  11903. var Latitude;
  11904. var Height;
  11905. P = Math.sqrt(X * X + Y * Y);
  11906. RR = Math.sqrt(X * X + Y * Y + Z * Z);
  11907. /* special cases for latitude and longitude */
  11908. if (P / a < genau) {
  11909. /* special case, if P=0. (X=0., Y=0.) */
  11910. Longitude = 0.0;
  11911. /* if (X,Y,Z)=(0.,0.,0.) then Height becomes semi-minor axis
  11912. * of ellipsoid (=center of mass), Latitude becomes PI/2 */
  11913. if (RR / a < genau) {
  11914. Latitude = HALF_PI;
  11915. Height = -b;
  11916. return {
  11917. x: p.x,
  11918. y: p.y,
  11919. z: p.z
  11920. };
  11921. }
  11922. } else {
  11923. /* ellipsoidal (geodetic) longitude
  11924. * interval: -PI < Longitude <= +PI */
  11925. Longitude = Math.atan2(Y, X);
  11926. }
  11927. /* --------------------------------------------------------------
  11928. * Following iterative algorithm was developped by
  11929. * "Institut for Erdmessung", University of Hannover, July 1988.
  11930. * Internet: www.ife.uni-hannover.de
  11931. * Iterative computation of CPHI,SPHI and Height.
  11932. * Iteration of CPHI and SPHI to 10**-12 radian resp.
  11933. * 2*10**-7 arcsec.
  11934. * --------------------------------------------------------------
  11935. */
  11936. CT = Z / RR;
  11937. ST = P / RR;
  11938. RX = 1.0 / Math.sqrt(1.0 - es * (2.0 - es) * ST * ST);
  11939. CPHI0 = ST * (1.0 - es) * RX;
  11940. SPHI0 = CT * RX;
  11941. iter = 0;
  11942. /* loop to find sin(Latitude) resp. Latitude
  11943. * until |sin(Latitude(iter)-Latitude(iter-1))| < genau */
  11944. do {
  11945. iter++;
  11946. RN = a / Math.sqrt(1.0 - es * SPHI0 * SPHI0);
  11947. /* ellipsoidal (geodetic) height */
  11948. Height = P * CPHI0 + Z * SPHI0 - RN * (1.0 - es * SPHI0 * SPHI0);
  11949. RK = es * RN / (RN + Height);
  11950. RX = 1.0 / Math.sqrt(1.0 - RK * (2.0 - RK) * ST * ST);
  11951. CPHI = ST * (1.0 - RK) * RX;
  11952. SPHI = CT * RX;
  11953. SDPHI = SPHI * CPHI0 - CPHI * SPHI0;
  11954. CPHI0 = CPHI;
  11955. SPHI0 = SPHI;
  11956. } while (SDPHI * SDPHI > genau2 && iter < maxiter);
  11957. /* ellipsoidal (geodetic) latitude */
  11958. Latitude = Math.atan(SPHI / Math.abs(CPHI));
  11959. return {
  11960. x: Longitude,
  11961. y: Latitude,
  11962. z: Height
  11963. };
  11964. } // cs_geocentric_to_geodetic()
  11965. /****************************************************************/
  11966. // pj_geocentic_to_wgs84( p )
  11967. // p = point to transform in geocentric coordinates (x,y,z)
  11968. /** point object, nothing fancy, just allows values to be
  11969. passed back and forth by reference rather than by value.
  11970. Other point classes may be used as long as they have
  11971. x and y properties, which will get modified in the transform method.
  11972. */
  11973. function geocentricToWgs84(p, datum_type, datum_params) {
  11974. if (datum_type === PJD_3PARAM) {
  11975. // if( x[io] === HUGE_VAL )
  11976. // continue;
  11977. return {
  11978. x: p.x + datum_params[0],
  11979. y: p.y + datum_params[1],
  11980. z: p.z + datum_params[2]
  11981. };
  11982. } else if (datum_type === PJD_7PARAM) {
  11983. var Dx_BF = datum_params[0];
  11984. var Dy_BF = datum_params[1];
  11985. var Dz_BF = datum_params[2];
  11986. var Rx_BF = datum_params[3];
  11987. var Ry_BF = datum_params[4];
  11988. var Rz_BF = datum_params[5];
  11989. var M_BF = datum_params[6];
  11990. // if( x[io] === HUGE_VAL )
  11991. // continue;
  11992. return {
  11993. x: M_BF * (p.x - Rz_BF * p.y + Ry_BF * p.z) + Dx_BF,
  11994. y: M_BF * (Rz_BF * p.x + p.y - Rx_BF * p.z) + Dy_BF,
  11995. z: M_BF * (-Ry_BF * p.x + Rx_BF * p.y + p.z) + Dz_BF
  11996. };
  11997. }
  11998. } // cs_geocentric_to_wgs84
  11999. /****************************************************************/
  12000. // pj_geocentic_from_wgs84()
  12001. // coordinate system definition,
  12002. // point to transform in geocentric coordinates (x,y,z)
  12003. function geocentricFromWgs84(p, datum_type, datum_params) {
  12004. if (datum_type === PJD_3PARAM) {
  12005. //if( x[io] === HUGE_VAL )
  12006. // continue;
  12007. return {
  12008. x: p.x - datum_params[0],
  12009. y: p.y - datum_params[1],
  12010. z: p.z - datum_params[2]
  12011. };
  12012. } else if (datum_type === PJD_7PARAM) {
  12013. var Dx_BF = datum_params[0];
  12014. var Dy_BF = datum_params[1];
  12015. var Dz_BF = datum_params[2];
  12016. var Rx_BF = datum_params[3];
  12017. var Ry_BF = datum_params[4];
  12018. var Rz_BF = datum_params[5];
  12019. var M_BF = datum_params[6];
  12020. var x_tmp = (p.x - Dx_BF) / M_BF;
  12021. var y_tmp = (p.y - Dy_BF) / M_BF;
  12022. var z_tmp = (p.z - Dz_BF) / M_BF;
  12023. //if( x[io] === HUGE_VAL )
  12024. // continue;
  12025. return {
  12026. x: x_tmp + Rz_BF * y_tmp - Ry_BF * z_tmp,
  12027. y: -Rz_BF * x_tmp + y_tmp + Rx_BF * z_tmp,
  12028. z: Ry_BF * x_tmp - Rx_BF * y_tmp + z_tmp
  12029. };
  12030. } //cs_geocentric_from_wgs84()
  12031. }
  12032. function checkParams(type) {
  12033. return type === PJD_3PARAM || type === PJD_7PARAM;
  12034. }
  12035. var datum_transform = function datum_transform(source, dest, point) {
  12036. // Short cut if the datums are identical.
  12037. if (compareDatums(source, dest)) {
  12038. return point; // in this case, zero is sucess,
  12039. // whereas cs_compare_datums returns 1 to indicate TRUE
  12040. // confusing, should fix this
  12041. }
  12042. // Explicitly skip datum transform by setting 'datum=none' as parameter for either source or dest
  12043. if (source.datum_type === PJD_NODATUM || dest.datum_type === PJD_NODATUM) {
  12044. return point;
  12045. }
  12046. // If this datum requires grid shifts, then apply it to geodetic coordinates.
  12047. var source_a = source.a;
  12048. var source_es = source.es;
  12049. if (source.datum_type === PJD_GRIDSHIFT) {
  12050. var gridShiftCode = applyGridShift(source, false, point);
  12051. if (gridShiftCode !== 0) {
  12052. return undefined;
  12053. }
  12054. source_a = SRS_WGS84_SEMIMAJOR;
  12055. source_es = SRS_WGS84_ESQUARED;
  12056. }
  12057. var dest_a = dest.a;
  12058. var dest_b = dest.b;
  12059. var dest_es = dest.es;
  12060. if (dest.datum_type === PJD_GRIDSHIFT) {
  12061. dest_a = SRS_WGS84_SEMIMAJOR;
  12062. dest_b = SRS_WGS84_SEMIMINOR;
  12063. dest_es = SRS_WGS84_ESQUARED;
  12064. }
  12065. // Do we need to go through geocentric coordinates?
  12066. if (source_es === dest_es && source_a === dest_a && !checkParams(source.datum_type) && !checkParams(dest.datum_type)) {
  12067. return point;
  12068. }
  12069. // Convert to geocentric coordinates.
  12070. point = geodeticToGeocentric(point, source_es, source_a);
  12071. // Convert between datums
  12072. if (checkParams(source.datum_type)) {
  12073. point = geocentricToWgs84(point, source.datum_type, source.datum_params);
  12074. }
  12075. if (checkParams(dest.datum_type)) {
  12076. point = geocentricFromWgs84(point, dest.datum_type, dest.datum_params);
  12077. }
  12078. point = geocentricToGeodetic(point, dest_es, dest_a, dest_b);
  12079. if (dest.datum_type === PJD_GRIDSHIFT) {
  12080. var destGridShiftResult = applyGridShift(dest, true, point);
  12081. if (destGridShiftResult !== 0) {
  12082. return undefined;
  12083. }
  12084. }
  12085. return point;
  12086. };
  12087. function applyGridShift(source, inverse, point) {
  12088. if (source.grids === null || source.grids.length === 0) {
  12089. console.log('Grid shift grids not found');
  12090. return -1;
  12091. }
  12092. var input = {
  12093. x: -point.x,
  12094. y: point.y
  12095. };
  12096. var output = {
  12097. x: Number.NaN,
  12098. y: Number.NaN
  12099. };
  12100. var attemptedGrids = [];
  12101. for (var i = 0; i < source.grids.length; i++) {
  12102. var grid = source.grids[i];
  12103. attemptedGrids.push(grid.name);
  12104. if (grid.isNull) {
  12105. output = input;
  12106. break;
  12107. }
  12108. if (grid.grid === null) {
  12109. if (grid.mandatory) {
  12110. console.log("Unable to find mandatory grid '" + grid.name + "'");
  12111. return -1;
  12112. }
  12113. continue;
  12114. }
  12115. var subgrid = grid.grid.subgrids[0];
  12116. // skip tables that don't match our point at all
  12117. var epsilon = (Math.abs(subgrid.del[1]) + Math.abs(subgrid.del[0])) / 10000.0;
  12118. var minX = subgrid.ll[0] - epsilon;
  12119. var minY = subgrid.ll[1] - epsilon;
  12120. var maxX = subgrid.ll[0] + (subgrid.lim[0] - 1) * subgrid.del[0] + epsilon;
  12121. var maxY = subgrid.ll[1] + (subgrid.lim[1] - 1) * subgrid.del[1] + epsilon;
  12122. if (minY > input.y || minX > input.x || maxY < input.y || maxX < input.x) {
  12123. continue;
  12124. }
  12125. output = applySubgridShift(input, inverse, subgrid);
  12126. if (!isNaN(output.x)) {
  12127. break;
  12128. }
  12129. }
  12130. if (isNaN(output.x)) {
  12131. console.log("Failed to find a grid shift table for location '" + -input.x * R2D + " " + input.y * R2D + " tried: '" + attemptedGrids + "'");
  12132. return -1;
  12133. }
  12134. point.x = -output.x;
  12135. point.y = output.y;
  12136. return 0;
  12137. }
  12138. function applySubgridShift(pin, inverse, ct) {
  12139. var val = {
  12140. x: Number.NaN,
  12141. y: Number.NaN
  12142. };
  12143. if (isNaN(pin.x)) {
  12144. return val;
  12145. }
  12146. var tb = {
  12147. x: pin.x,
  12148. y: pin.y
  12149. };
  12150. tb.x -= ct.ll[0];
  12151. tb.y -= ct.ll[1];
  12152. tb.x = adjust_lon(tb.x - Math.PI) + Math.PI;
  12153. var t = nadInterpolate(tb, ct);
  12154. if (inverse) {
  12155. if (isNaN(t.x)) {
  12156. return val;
  12157. }
  12158. t.x = tb.x - t.x;
  12159. t.y = tb.y - t.y;
  12160. var i = 9,
  12161. tol = 1e-12;
  12162. var dif, del;
  12163. do {
  12164. del = nadInterpolate(t, ct);
  12165. if (isNaN(del.x)) {
  12166. console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");
  12167. break;
  12168. }
  12169. dif = {
  12170. x: tb.x - (del.x + t.x),
  12171. y: tb.y - (del.y + t.y)
  12172. };
  12173. t.x += dif.x;
  12174. t.y += dif.y;
  12175. } while (i-- && Math.abs(dif.x) > tol && Math.abs(dif.y) > tol);
  12176. if (i < 0) {
  12177. console.log("Inverse grid shift iterator failed to converge.");
  12178. return val;
  12179. }
  12180. val.x = adjust_lon(t.x + ct.ll[0]);
  12181. val.y = t.y + ct.ll[1];
  12182. } else {
  12183. if (!isNaN(t.x)) {
  12184. val.x = pin.x + t.x;
  12185. val.y = pin.y + t.y;
  12186. }
  12187. }
  12188. return val;
  12189. }
  12190. function nadInterpolate(pin, ct) {
  12191. var t = {
  12192. x: pin.x / ct.del[0],
  12193. y: pin.y / ct.del[1]
  12194. };
  12195. var indx = {
  12196. x: Math.floor(t.x),
  12197. y: Math.floor(t.y)
  12198. };
  12199. var frct = {
  12200. x: t.x - 1.0 * indx.x,
  12201. y: t.y - 1.0 * indx.y
  12202. };
  12203. var val = {
  12204. x: Number.NaN,
  12205. y: Number.NaN
  12206. };
  12207. var inx;
  12208. if (indx.x < 0 || indx.x >= ct.lim[0]) {
  12209. return val;
  12210. }
  12211. if (indx.y < 0 || indx.y >= ct.lim[1]) {
  12212. return val;
  12213. }
  12214. inx = indx.y * ct.lim[0] + indx.x;
  12215. var f00 = {
  12216. x: ct.cvs[inx][0],
  12217. y: ct.cvs[inx][1]
  12218. };
  12219. inx++;
  12220. var f10 = {
  12221. x: ct.cvs[inx][0],
  12222. y: ct.cvs[inx][1]
  12223. };
  12224. inx += ct.lim[0];
  12225. var f11 = {
  12226. x: ct.cvs[inx][0],
  12227. y: ct.cvs[inx][1]
  12228. };
  12229. inx--;
  12230. var f01 = {
  12231. x: ct.cvs[inx][0],
  12232. y: ct.cvs[inx][1]
  12233. };
  12234. var m11 = frct.x * frct.y,
  12235. m10 = frct.x * (1.0 - frct.y),
  12236. m00 = (1.0 - frct.x) * (1.0 - frct.y),
  12237. m01 = (1.0 - frct.x) * frct.y;
  12238. val.x = m00 * f00.x + m10 * f10.x + m01 * f01.x + m11 * f11.x;
  12239. val.y = m00 * f00.y + m10 * f10.y + m01 * f01.y + m11 * f11.y;
  12240. return val;
  12241. }
  12242. var adjust_axis = function adjust_axis(crs, denorm, point) {
  12243. var xin = point.x,
  12244. yin = point.y,
  12245. zin = point.z || 0.0;
  12246. var v, t, i;
  12247. var out = {};
  12248. for (i = 0; i < 3; i++) {
  12249. if (denorm && i === 2 && point.z === undefined) {
  12250. continue;
  12251. }
  12252. if (i === 0) {
  12253. v = xin;
  12254. if ("ew".indexOf(crs.axis[i]) !== -1) {
  12255. t = 'x';
  12256. } else {
  12257. t = 'y';
  12258. }
  12259. } else if (i === 1) {
  12260. v = yin;
  12261. if ("ns".indexOf(crs.axis[i]) !== -1) {
  12262. t = 'y';
  12263. } else {
  12264. t = 'x';
  12265. }
  12266. } else {
  12267. v = zin;
  12268. t = 'z';
  12269. }
  12270. switch (crs.axis[i]) {
  12271. case 'e':
  12272. out[t] = v;
  12273. break;
  12274. case 'w':
  12275. out[t] = -v;
  12276. break;
  12277. case 'n':
  12278. out[t] = v;
  12279. break;
  12280. case 's':
  12281. out[t] = -v;
  12282. break;
  12283. case 'u':
  12284. if (point[t] !== undefined) {
  12285. out.z = v;
  12286. }
  12287. break;
  12288. case 'd':
  12289. if (point[t] !== undefined) {
  12290. out.z = -v;
  12291. }
  12292. break;
  12293. default:
  12294. //console.log("ERROR: unknow axis ("+crs.axis[i]+") - check definition of "+crs.projName);
  12295. return null;
  12296. }
  12297. }
  12298. return out;
  12299. };
  12300. var toPoint = function toPoint(array) {
  12301. var out = {
  12302. x: array[0],
  12303. y: array[1]
  12304. };
  12305. if (array.length > 2) {
  12306. out.z = array[2];
  12307. }
  12308. if (array.length > 3) {
  12309. out.m = array[3];
  12310. }
  12311. return out;
  12312. };
  12313. var checkSanity = function checkSanity(point) {
  12314. checkCoord(point.x);
  12315. checkCoord(point.y);
  12316. };
  12317. function checkCoord(num) {
  12318. if (typeof Number.isFinite === 'function') {
  12319. if (Number.isFinite(num)) {
  12320. return;
  12321. }
  12322. throw new TypeError('coordinates must be finite numbers');
  12323. }
  12324. if (typeof num !== 'number' || num !== num || !isFinite(num)) {
  12325. throw new TypeError('coordinates must be finite numbers');
  12326. }
  12327. }
  12328. function checkNotWGS(source, dest) {
  12329. return (source.datum.datum_type === PJD_3PARAM || source.datum.datum_type === PJD_7PARAM || source.datum.datum_type === PJD_GRIDSHIFT) && dest.datumCode !== 'WGS84' || (dest.datum.datum_type === PJD_3PARAM || dest.datum.datum_type === PJD_7PARAM || dest.datum.datum_type === PJD_GRIDSHIFT) && source.datumCode !== 'WGS84';
  12330. }
  12331. function transform(source, dest, point, enforceAxis) {
  12332. var wgs84;
  12333. if (Array.isArray(point)) {
  12334. point = toPoint(point);
  12335. } else {
  12336. // Clone the point object so inputs don't get modified
  12337. point = {
  12338. x: point.x,
  12339. y: point.y,
  12340. z: point.z,
  12341. m: point.m
  12342. };
  12343. }
  12344. var hasZ = point.z !== undefined;
  12345. checkSanity(point);
  12346. // Workaround for datum shifts towgs84, if either source or destination projection is not wgs84
  12347. if (source.datum && dest.datum && checkNotWGS(source, dest)) {
  12348. wgs84 = new Projection('WGS84');
  12349. point = transform(source, wgs84, point, enforceAxis);
  12350. source = wgs84;
  12351. }
  12352. // DGR, 2010/11/12
  12353. if (enforceAxis && source.axis !== 'enu') {
  12354. point = adjust_axis(source, false, point);
  12355. }
  12356. // Transform source points to long/lat, if they aren't already.
  12357. if (source.projName === 'longlat') {
  12358. point = {
  12359. x: point.x * D2R,
  12360. y: point.y * D2R,
  12361. z: point.z || 0
  12362. };
  12363. } else {
  12364. if (source.to_meter) {
  12365. point = {
  12366. x: point.x * source.to_meter,
  12367. y: point.y * source.to_meter,
  12368. z: point.z || 0
  12369. };
  12370. }
  12371. point = source.inverse(point); // Convert Cartesian to longlat
  12372. if (!point) {
  12373. return;
  12374. }
  12375. }
  12376. // Adjust for the prime meridian if necessary
  12377. if (source.from_greenwich) {
  12378. point.x += source.from_greenwich;
  12379. }
  12380. // Convert datums if needed, and if possible.
  12381. point = datum_transform(source.datum, dest.datum, point);
  12382. if (!point) {
  12383. return;
  12384. }
  12385. // Adjust for the prime meridian if necessary
  12386. if (dest.from_greenwich) {
  12387. point = {
  12388. x: point.x - dest.from_greenwich,
  12389. y: point.y,
  12390. z: point.z || 0
  12391. };
  12392. }
  12393. if (dest.projName === 'longlat') {
  12394. // convert radians to decimal degrees
  12395. point = {
  12396. x: point.x * R2D,
  12397. y: point.y * R2D,
  12398. z: point.z || 0
  12399. };
  12400. } else {
  12401. // else project
  12402. point = dest.forward(point);
  12403. if (dest.to_meter) {
  12404. point = {
  12405. x: point.x / dest.to_meter,
  12406. y: point.y / dest.to_meter,
  12407. z: point.z || 0
  12408. };
  12409. }
  12410. }
  12411. // DGR, 2010/11/12
  12412. if (enforceAxis && dest.axis !== 'enu') {
  12413. return adjust_axis(dest, true, point);
  12414. }
  12415. if (!hasZ) {
  12416. delete point.z;
  12417. }
  12418. return point;
  12419. }
  12420. var wgs84 = Projection('WGS84');
  12421. function transformer(from, to, coords, enforceAxis) {
  12422. var transformedArray, out, keys;
  12423. if (Array.isArray(coords)) {
  12424. transformedArray = transform(from, to, coords, enforceAxis) || {
  12425. x: NaN,
  12426. y: NaN
  12427. };
  12428. if (coords.length > 2) {
  12429. if (typeof from.name !== 'undefined' && from.name === 'geocent' || typeof to.name !== 'undefined' && to.name === 'geocent') {
  12430. if (typeof transformedArray.z === 'number') {
  12431. return [transformedArray.x, transformedArray.y, transformedArray.z].concat(coords.splice(3));
  12432. } else {
  12433. return [transformedArray.x, transformedArray.y, coords[2]].concat(coords.splice(3));
  12434. }
  12435. } else {
  12436. return [transformedArray.x, transformedArray.y].concat(coords.splice(2));
  12437. }
  12438. } else {
  12439. return [transformedArray.x, transformedArray.y];
  12440. }
  12441. } else {
  12442. out = transform(from, to, coords, enforceAxis);
  12443. keys = Object.keys(coords);
  12444. if (keys.length === 2) {
  12445. return out;
  12446. }
  12447. keys.forEach(function (key) {
  12448. if (typeof from.name !== 'undefined' && from.name === 'geocent' || typeof to.name !== 'undefined' && to.name === 'geocent') {
  12449. if (key === 'x' || key === 'y' || key === 'z') {
  12450. return;
  12451. }
  12452. } else {
  12453. if (key === 'x' || key === 'y') {
  12454. return;
  12455. }
  12456. }
  12457. out[key] = coords[key];
  12458. });
  12459. return out;
  12460. }
  12461. }
  12462. function checkProj(item) {
  12463. if (item instanceof Projection) {
  12464. return item;
  12465. }
  12466. if (item.oProj) {
  12467. return item.oProj;
  12468. }
  12469. return Projection(item);
  12470. }
  12471. function proj4$1(fromProj, toProj, coord) {
  12472. fromProj = checkProj(fromProj);
  12473. var single = false;
  12474. var obj;
  12475. if (typeof toProj === 'undefined') {
  12476. toProj = fromProj;
  12477. fromProj = wgs84;
  12478. single = true;
  12479. } else if (typeof toProj.x !== 'undefined' || Array.isArray(toProj)) {
  12480. coord = toProj;
  12481. toProj = fromProj;
  12482. fromProj = wgs84;
  12483. single = true;
  12484. }
  12485. toProj = checkProj(toProj);
  12486. if (coord) {
  12487. return transformer(fromProj, toProj, coord);
  12488. } else {
  12489. obj = {
  12490. forward: function forward(coords, enforceAxis) {
  12491. return transformer(fromProj, toProj, coords, enforceAxis);
  12492. },
  12493. inverse: function inverse(coords, enforceAxis) {
  12494. return transformer(toProj, fromProj, coords, enforceAxis);
  12495. }
  12496. };
  12497. if (single) {
  12498. obj.oProj = toProj;
  12499. }
  12500. return obj;
  12501. }
  12502. }
  12503. /**
  12504. * UTM zones are grouped, and assigned to one of a group of 6
  12505. * sets.
  12506. *
  12507. * {int} @private
  12508. */
  12509. var NUM_100K_SETS = 6;
  12510. /**
  12511. * The column letters (for easting) of the lower left value, per
  12512. * set.
  12513. *
  12514. * {string} @private
  12515. */
  12516. var SET_ORIGIN_COLUMN_LETTERS = 'AJSAJS';
  12517. /**
  12518. * The row letters (for northing) of the lower left value, per
  12519. * set.
  12520. *
  12521. * {string} @private
  12522. */
  12523. var SET_ORIGIN_ROW_LETTERS = 'AFAFAF';
  12524. var A = 65; // A
  12525. var I = 73; // I
  12526. var O = 79; // O
  12527. var V = 86; // V
  12528. var Z = 90; // Z
  12529. var mgrs = {
  12530. forward: forward$1,
  12531. inverse: inverse$1,
  12532. toPoint: toPoint$1
  12533. };
  12534. /**
  12535. * Conversion of lat/lon to MGRS.
  12536. *
  12537. * @param {object} ll Object literal with lat and lon properties on a
  12538. * WGS84 ellipsoid.
  12539. * @param {int} accuracy Accuracy in digits (5 for 1 m, 4 for 10 m, 3 for
  12540. * 100 m, 2 for 1000 m or 1 for 10000 m). Optional, default is 5.
  12541. * @return {string} the MGRS string for the given location and accuracy.
  12542. */
  12543. function forward$1(ll, accuracy) {
  12544. accuracy = accuracy || 5; // default accuracy 1m
  12545. return encode(LLtoUTM({
  12546. lat: ll[1],
  12547. lon: ll[0]
  12548. }), accuracy);
  12549. }
  12550. /**
  12551. * Conversion of MGRS to lat/lon.
  12552. *
  12553. * @param {string} mgrs MGRS string.
  12554. * @return {array} An array with left (longitude), bottom (latitude), right
  12555. * (longitude) and top (latitude) values in WGS84, representing the
  12556. * bounding box for the provided MGRS reference.
  12557. */
  12558. function inverse$1(mgrs) {
  12559. var bbox = UTMtoLL(decode(mgrs.toUpperCase()));
  12560. if (bbox.lat && bbox.lon) {
  12561. return [bbox.lon, bbox.lat, bbox.lon, bbox.lat];
  12562. }
  12563. return [bbox.left, bbox.bottom, bbox.right, bbox.top];
  12564. }
  12565. function toPoint$1(mgrs) {
  12566. var bbox = UTMtoLL(decode(mgrs.toUpperCase()));
  12567. if (bbox.lat && bbox.lon) {
  12568. return [bbox.lon, bbox.lat];
  12569. }
  12570. return [(bbox.left + bbox.right) / 2, (bbox.top + bbox.bottom) / 2];
  12571. }
  12572. /**
  12573. * Conversion from degrees to radians.
  12574. *
  12575. * @private
  12576. * @param {number} deg the angle in degrees.
  12577. * @return {number} the angle in radians.
  12578. */
  12579. function degToRad(deg) {
  12580. return deg * (Math.PI / 180.0);
  12581. }
  12582. /**
  12583. * Conversion from radians to degrees.
  12584. *
  12585. * @private
  12586. * @param {number} rad the angle in radians.
  12587. * @return {number} the angle in degrees.
  12588. */
  12589. function radToDeg(rad) {
  12590. return 180.0 * (rad / Math.PI);
  12591. }
  12592. /**
  12593. * Converts a set of Longitude and Latitude co-ordinates to UTM
  12594. * using the WGS84 ellipsoid.
  12595. *
  12596. * @private
  12597. * @param {object} ll Object literal with lat and lon properties
  12598. * representing the WGS84 coordinate to be converted.
  12599. * @return {object} Object literal containing the UTM value with easting,
  12600. * northing, zoneNumber and zoneLetter properties, and an optional
  12601. * accuracy property in digits. Returns null if the conversion failed.
  12602. */
  12603. function LLtoUTM(ll) {
  12604. var Lat = ll.lat;
  12605. var Long = ll.lon;
  12606. var a = 6378137.0; //ellip.radius;
  12607. var eccSquared = 0.00669438; //ellip.eccsq;
  12608. var k0 = 0.9996;
  12609. var LongOrigin;
  12610. var eccPrimeSquared;
  12611. var N, T, C, A, M;
  12612. var LatRad = degToRad(Lat);
  12613. var LongRad = degToRad(Long);
  12614. var LongOriginRad;
  12615. var ZoneNumber;
  12616. // (int)
  12617. ZoneNumber = Math.floor((Long + 180) / 6) + 1;
  12618. //Make sure the longitude 180.00 is in Zone 60
  12619. if (Long === 180) {
  12620. ZoneNumber = 60;
  12621. }
  12622. // Special zone for Norway
  12623. if (Lat >= 56.0 && Lat < 64.0 && Long >= 3.0 && Long < 12.0) {
  12624. ZoneNumber = 32;
  12625. }
  12626. // Special zones for Svalbard
  12627. if (Lat >= 72.0 && Lat < 84.0) {
  12628. if (Long >= 0.0 && Long < 9.0) {
  12629. ZoneNumber = 31;
  12630. } else if (Long >= 9.0 && Long < 21.0) {
  12631. ZoneNumber = 33;
  12632. } else if (Long >= 21.0 && Long < 33.0) {
  12633. ZoneNumber = 35;
  12634. } else if (Long >= 33.0 && Long < 42.0) {
  12635. ZoneNumber = 37;
  12636. }
  12637. }
  12638. LongOrigin = (ZoneNumber - 1) * 6 - 180 + 3; //+3 puts origin
  12639. // in middle of
  12640. // zone
  12641. LongOriginRad = degToRad(LongOrigin);
  12642. eccPrimeSquared = eccSquared / (1 - eccSquared);
  12643. N = a / Math.sqrt(1 - eccSquared * Math.sin(LatRad) * Math.sin(LatRad));
  12644. T = Math.tan(LatRad) * Math.tan(LatRad);
  12645. C = eccPrimeSquared * Math.cos(LatRad) * Math.cos(LatRad);
  12646. A = Math.cos(LatRad) * (LongRad - LongOriginRad);
  12647. M = a * ((1 - eccSquared / 4 - 3 * eccSquared * eccSquared / 64 - 5 * eccSquared * eccSquared * eccSquared / 256) * LatRad - (3 * eccSquared / 8 + 3 * eccSquared * eccSquared / 32 + 45 * eccSquared * eccSquared * eccSquared / 1024) * Math.sin(2 * LatRad) + (15 * eccSquared * eccSquared / 256 + 45 * eccSquared * eccSquared * eccSquared / 1024) * Math.sin(4 * LatRad) - 35 * eccSquared * eccSquared * eccSquared / 3072 * Math.sin(6 * LatRad));
  12648. var UTMEasting = k0 * N * (A + (1 - T + C) * A * A * A / 6.0 + (5 - 18 * T + T * T + 72 * C - 58 * eccPrimeSquared) * A * A * A * A * A / 120.0) + 500000.0;
  12649. var UTMNorthing = k0 * (M + N * Math.tan(LatRad) * (A * A / 2 + (5 - T + 9 * C + 4 * C * C) * A * A * A * A / 24.0 + (61 - 58 * T + T * T + 600 * C - 330 * eccPrimeSquared) * A * A * A * A * A * A / 720.0));
  12650. if (Lat < 0.0) {
  12651. UTMNorthing += 10000000.0; //10000000 meter offset for
  12652. // southern hemisphere
  12653. }
  12654. return {
  12655. northing: Math.round(UTMNorthing),
  12656. easting: Math.round(UTMEasting),
  12657. zoneNumber: ZoneNumber,
  12658. zoneLetter: getLetterDesignator(Lat)
  12659. };
  12660. }
  12661. /**
  12662. * Converts UTM coords to lat/long, using the WGS84 ellipsoid. This is a convenience
  12663. * class where the Zone can be specified as a single string eg."60N" which
  12664. * is then broken down into the ZoneNumber and ZoneLetter.
  12665. *
  12666. * @private
  12667. * @param {object} utm An object literal with northing, easting, zoneNumber
  12668. * and zoneLetter properties. If an optional accuracy property is
  12669. * provided (in meters), a bounding box will be returned instead of
  12670. * latitude and longitude.
  12671. * @return {object} An object literal containing either lat and lon values
  12672. * (if no accuracy was provided), or top, right, bottom and left values
  12673. * for the bounding box calculated according to the provided accuracy.
  12674. * Returns null if the conversion failed.
  12675. */
  12676. function UTMtoLL(utm) {
  12677. var UTMNorthing = utm.northing;
  12678. var UTMEasting = utm.easting;
  12679. var zoneLetter = utm.zoneLetter;
  12680. var zoneNumber = utm.zoneNumber;
  12681. // check the ZoneNummber is valid
  12682. if (zoneNumber < 0 || zoneNumber > 60) {
  12683. return null;
  12684. }
  12685. var k0 = 0.9996;
  12686. var a = 6378137.0; //ellip.radius;
  12687. var eccSquared = 0.00669438; //ellip.eccsq;
  12688. var eccPrimeSquared;
  12689. var e1 = (1 - Math.sqrt(1 - eccSquared)) / (1 + Math.sqrt(1 - eccSquared));
  12690. var N1, T1, C1, R1, D, M;
  12691. var LongOrigin;
  12692. var mu, phi1Rad;
  12693. // remove 500,000 meter offset for longitude
  12694. var x = UTMEasting - 500000.0;
  12695. var y = UTMNorthing;
  12696. // We must know somehow if we are in the Northern or Southern
  12697. // hemisphere, this is the only time we use the letter So even
  12698. // if the Zone letter isn't exactly correct it should indicate
  12699. // the hemisphere correctly
  12700. if (zoneLetter < 'N') {
  12701. y -= 10000000.0; // remove 10,000,000 meter offset used
  12702. // for southern hemisphere
  12703. }
  12704. // There are 60 zones with zone 1 being at West -180 to -174
  12705. LongOrigin = (zoneNumber - 1) * 6 - 180 + 3; // +3 puts origin
  12706. // in middle of
  12707. // zone
  12708. eccPrimeSquared = eccSquared / (1 - eccSquared);
  12709. M = y / k0;
  12710. mu = M / (a * (1 - eccSquared / 4 - 3 * eccSquared * eccSquared / 64 - 5 * eccSquared * eccSquared * eccSquared / 256));
  12711. phi1Rad = mu + (3 * e1 / 2 - 27 * e1 * e1 * e1 / 32) * Math.sin(2 * mu) + (21 * e1 * e1 / 16 - 55 * e1 * e1 * e1 * e1 / 32) * Math.sin(4 * mu) + 151 * e1 * e1 * e1 / 96 * Math.sin(6 * mu);
  12712. // double phi1 = ProjMath.radToDeg(phi1Rad);
  12713. N1 = a / Math.sqrt(1 - eccSquared * Math.sin(phi1Rad) * Math.sin(phi1Rad));
  12714. T1 = Math.tan(phi1Rad) * Math.tan(phi1Rad);
  12715. C1 = eccPrimeSquared * Math.cos(phi1Rad) * Math.cos(phi1Rad);
  12716. R1 = a * (1 - eccSquared) / Math.pow(1 - eccSquared * Math.sin(phi1Rad) * Math.sin(phi1Rad), 1.5);
  12717. D = x / (N1 * k0);
  12718. var lat = phi1Rad - N1 * Math.tan(phi1Rad) / R1 * (D * D / 2 - (5 + 3 * T1 + 10 * C1 - 4 * C1 * C1 - 9 * eccPrimeSquared) * D * D * D * D / 24 + (61 + 90 * T1 + 298 * C1 + 45 * T1 * T1 - 252 * eccPrimeSquared - 3 * C1 * C1) * D * D * D * D * D * D / 720);
  12719. lat = radToDeg(lat);
  12720. var lon = (D - (1 + 2 * T1 + C1) * D * D * D / 6 + (5 - 2 * C1 + 28 * T1 - 3 * C1 * C1 + 8 * eccPrimeSquared + 24 * T1 * T1) * D * D * D * D * D / 120) / Math.cos(phi1Rad);
  12721. lon = LongOrigin + radToDeg(lon);
  12722. var result;
  12723. if (utm.accuracy) {
  12724. var topRight = UTMtoLL({
  12725. northing: utm.northing + utm.accuracy,
  12726. easting: utm.easting + utm.accuracy,
  12727. zoneLetter: utm.zoneLetter,
  12728. zoneNumber: utm.zoneNumber
  12729. });
  12730. result = {
  12731. top: topRight.lat,
  12732. right: topRight.lon,
  12733. bottom: lat,
  12734. left: lon
  12735. };
  12736. } else {
  12737. result = {
  12738. lat: lat,
  12739. lon: lon
  12740. };
  12741. }
  12742. return result;
  12743. }
  12744. /**
  12745. * Calculates the MGRS letter designator for the given latitude.
  12746. *
  12747. * @private
  12748. * @param {number} lat The latitude in WGS84 to get the letter designator
  12749. * for.
  12750. * @return {char} The letter designator.
  12751. */
  12752. function getLetterDesignator(lat) {
  12753. //This is here as an error flag to show that the Latitude is
  12754. //outside MGRS limits
  12755. var LetterDesignator = 'Z';
  12756. if (84 >= lat && lat >= 72) {
  12757. LetterDesignator = 'X';
  12758. } else if (72 > lat && lat >= 64) {
  12759. LetterDesignator = 'W';
  12760. } else if (64 > lat && lat >= 56) {
  12761. LetterDesignator = 'V';
  12762. } else if (56 > lat && lat >= 48) {
  12763. LetterDesignator = 'U';
  12764. } else if (48 > lat && lat >= 40) {
  12765. LetterDesignator = 'T';
  12766. } else if (40 > lat && lat >= 32) {
  12767. LetterDesignator = 'S';
  12768. } else if (32 > lat && lat >= 24) {
  12769. LetterDesignator = 'R';
  12770. } else if (24 > lat && lat >= 16) {
  12771. LetterDesignator = 'Q';
  12772. } else if (16 > lat && lat >= 8) {
  12773. LetterDesignator = 'P';
  12774. } else if (8 > lat && lat >= 0) {
  12775. LetterDesignator = 'N';
  12776. } else if (0 > lat && lat >= -8) {
  12777. LetterDesignator = 'M';
  12778. } else if (-8 > lat && lat >= -16) {
  12779. LetterDesignator = 'L';
  12780. } else if (-16 > lat && lat >= -24) {
  12781. LetterDesignator = 'K';
  12782. } else if (-24 > lat && lat >= -32) {
  12783. LetterDesignator = 'J';
  12784. } else if (-32 > lat && lat >= -40) {
  12785. LetterDesignator = 'H';
  12786. } else if (-40 > lat && lat >= -48) {
  12787. LetterDesignator = 'G';
  12788. } else if (-48 > lat && lat >= -56) {
  12789. LetterDesignator = 'F';
  12790. } else if (-56 > lat && lat >= -64) {
  12791. LetterDesignator = 'E';
  12792. } else if (-64 > lat && lat >= -72) {
  12793. LetterDesignator = 'D';
  12794. } else if (-72 > lat && lat >= -80) {
  12795. LetterDesignator = 'C';
  12796. }
  12797. return LetterDesignator;
  12798. }
  12799. /**
  12800. * Encodes a UTM location as MGRS string.
  12801. *
  12802. * @private
  12803. * @param {object} utm An object literal with easting, northing,
  12804. * zoneLetter, zoneNumber
  12805. * @param {number} accuracy Accuracy in digits (1-5).
  12806. * @return {string} MGRS string for the given UTM location.
  12807. */
  12808. function encode(utm, accuracy) {
  12809. // prepend with leading zeroes
  12810. var seasting = "00000" + utm.easting,
  12811. snorthing = "00000" + utm.northing;
  12812. return utm.zoneNumber + utm.zoneLetter + get100kID(utm.easting, utm.northing, utm.zoneNumber) + seasting.substr(seasting.length - 5, accuracy) + snorthing.substr(snorthing.length - 5, accuracy);
  12813. }
  12814. /**
  12815. * Get the two letter 100k designator for a given UTM easting,
  12816. * northing and zone number value.
  12817. *
  12818. * @private
  12819. * @param {number} easting
  12820. * @param {number} northing
  12821. * @param {number} zoneNumber
  12822. * @return the two letter 100k designator for the given UTM location.
  12823. */
  12824. function get100kID(easting, northing, zoneNumber) {
  12825. var setParm = get100kSetForZone(zoneNumber);
  12826. var setColumn = Math.floor(easting / 100000);
  12827. var setRow = Math.floor(northing / 100000) % 20;
  12828. return getLetter100kID(setColumn, setRow, setParm);
  12829. }
  12830. /**
  12831. * Given a UTM zone number, figure out the MGRS 100K set it is in.
  12832. *
  12833. * @private
  12834. * @param {number} i An UTM zone number.
  12835. * @return {number} the 100k set the UTM zone is in.
  12836. */
  12837. function get100kSetForZone(i) {
  12838. var setParm = i % NUM_100K_SETS;
  12839. if (setParm === 0) {
  12840. setParm = NUM_100K_SETS;
  12841. }
  12842. return setParm;
  12843. }
  12844. /**
  12845. * Get the two-letter MGRS 100k designator given information
  12846. * translated from the UTM northing, easting and zone number.
  12847. *
  12848. * @private
  12849. * @param {number} column the column index as it relates to the MGRS
  12850. * 100k set spreadsheet, created from the UTM easting.
  12851. * Values are 1-8.
  12852. * @param {number} row the row index as it relates to the MGRS 100k set
  12853. * spreadsheet, created from the UTM northing value. Values
  12854. * are from 0-19.
  12855. * @param {number} parm the set block, as it relates to the MGRS 100k set
  12856. * spreadsheet, created from the UTM zone. Values are from
  12857. * 1-60.
  12858. * @return two letter MGRS 100k code.
  12859. */
  12860. function getLetter100kID(column, row, parm) {
  12861. // colOrigin and rowOrigin are the letters at the origin of the set
  12862. var index = parm - 1;
  12863. var colOrigin = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(index);
  12864. var rowOrigin = SET_ORIGIN_ROW_LETTERS.charCodeAt(index);
  12865. // colInt and rowInt are the letters to build to return
  12866. var colInt = colOrigin + column - 1;
  12867. var rowInt = rowOrigin + row;
  12868. var rollover = false;
  12869. if (colInt > Z) {
  12870. colInt = colInt - Z + A - 1;
  12871. rollover = true;
  12872. }
  12873. if (colInt === I || colOrigin < I && colInt > I || (colInt > I || colOrigin < I) && rollover) {
  12874. colInt++;
  12875. }
  12876. if (colInt === O || colOrigin < O && colInt > O || (colInt > O || colOrigin < O) && rollover) {
  12877. colInt++;
  12878. if (colInt === I) {
  12879. colInt++;
  12880. }
  12881. }
  12882. if (colInt > Z) {
  12883. colInt = colInt - Z + A - 1;
  12884. }
  12885. if (rowInt > V) {
  12886. rowInt = rowInt - V + A - 1;
  12887. rollover = true;
  12888. } else {
  12889. rollover = false;
  12890. }
  12891. if (rowInt === I || rowOrigin < I && rowInt > I || (rowInt > I || rowOrigin < I) && rollover) {
  12892. rowInt++;
  12893. }
  12894. if (rowInt === O || rowOrigin < O && rowInt > O || (rowInt > O || rowOrigin < O) && rollover) {
  12895. rowInt++;
  12896. if (rowInt === I) {
  12897. rowInt++;
  12898. }
  12899. }
  12900. if (rowInt > V) {
  12901. rowInt = rowInt - V + A - 1;
  12902. }
  12903. var twoLetter = String.fromCharCode(colInt) + String.fromCharCode(rowInt);
  12904. return twoLetter;
  12905. }
  12906. /**
  12907. * Decode the UTM parameters from a MGRS string.
  12908. *
  12909. * @private
  12910. * @param {string} mgrsString an UPPERCASE coordinate string is expected.
  12911. * @return {object} An object literal with easting, northing, zoneLetter,
  12912. * zoneNumber and accuracy (in meters) properties.
  12913. */
  12914. function decode(mgrsString) {
  12915. if (mgrsString && mgrsString.length === 0) {
  12916. throw "MGRSPoint coverting from nothing";
  12917. }
  12918. var length = mgrsString.length;
  12919. var hunK = null;
  12920. var sb = "";
  12921. var testChar;
  12922. var i = 0;
  12923. // get Zone number
  12924. while (!/[A-Z]/.test(testChar = mgrsString.charAt(i))) {
  12925. if (i >= 2) {
  12926. throw "MGRSPoint bad conversion from: " + mgrsString;
  12927. }
  12928. sb += testChar;
  12929. i++;
  12930. }
  12931. var zoneNumber = parseInt(sb, 10);
  12932. if (i === 0 || i + 3 > length) {
  12933. // A good MGRS string has to be 4-5 digits long,
  12934. // ##AAA/#AAA at least.
  12935. throw "MGRSPoint bad conversion from: " + mgrsString;
  12936. }
  12937. var zoneLetter = mgrsString.charAt(i++);
  12938. // Should we check the zone letter here? Why not.
  12939. if (zoneLetter <= 'A' || zoneLetter === 'B' || zoneLetter === 'Y' || zoneLetter >= 'Z' || zoneLetter === 'I' || zoneLetter === 'O') {
  12940. throw "MGRSPoint zone letter " + zoneLetter + " not handled: " + mgrsString;
  12941. }
  12942. hunK = mgrsString.substring(i, i += 2);
  12943. var set = get100kSetForZone(zoneNumber);
  12944. var east100k = getEastingFromChar(hunK.charAt(0), set);
  12945. var north100k = getNorthingFromChar(hunK.charAt(1), set);
  12946. // We have a bug where the northing may be 2000000 too low.
  12947. // How
  12948. // do we know when to roll over?
  12949. while (north100k < getMinNorthing(zoneLetter)) {
  12950. north100k += 2000000;
  12951. }
  12952. // calculate the char index for easting/northing separator
  12953. var remainder = length - i;
  12954. if (remainder % 2 !== 0) {
  12955. throw "MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters" + mgrsString;
  12956. }
  12957. var sep = remainder / 2;
  12958. var sepEasting = 0.0;
  12959. var sepNorthing = 0.0;
  12960. var accuracyBonus, sepEastingString, sepNorthingString, easting, northing;
  12961. if (sep > 0) {
  12962. accuracyBonus = 100000.0 / Math.pow(10, sep);
  12963. sepEastingString = mgrsString.substring(i, i + sep);
  12964. sepEasting = parseFloat(sepEastingString) * accuracyBonus;
  12965. sepNorthingString = mgrsString.substring(i + sep);
  12966. sepNorthing = parseFloat(sepNorthingString) * accuracyBonus;
  12967. }
  12968. easting = sepEasting + east100k;
  12969. northing = sepNorthing + north100k;
  12970. return {
  12971. easting: easting,
  12972. northing: northing,
  12973. zoneLetter: zoneLetter,
  12974. zoneNumber: zoneNumber,
  12975. accuracy: accuracyBonus
  12976. };
  12977. }
  12978. /**
  12979. * Given the first letter from a two-letter MGRS 100k zone, and given the
  12980. * MGRS table set for the zone number, figure out the easting value that
  12981. * should be added to the other, secondary easting value.
  12982. *
  12983. * @private
  12984. * @param {char} e The first letter from a two-letter MGRS 100´k zone.
  12985. * @param {number} set The MGRS table set for the zone number.
  12986. * @return {number} The easting value for the given letter and set.
  12987. */
  12988. function getEastingFromChar(e, set) {
  12989. // colOrigin is the letter at the origin of the set for the
  12990. // column
  12991. var curCol = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(set - 1);
  12992. var eastingValue = 100000.0;
  12993. var rewindMarker = false;
  12994. while (curCol !== e.charCodeAt(0)) {
  12995. curCol++;
  12996. if (curCol === I) {
  12997. curCol++;
  12998. }
  12999. if (curCol === O) {
  13000. curCol++;
  13001. }
  13002. if (curCol > Z) {
  13003. if (rewindMarker) {
  13004. throw "Bad character: " + e;
  13005. }
  13006. curCol = A;
  13007. rewindMarker = true;
  13008. }
  13009. eastingValue += 100000.0;
  13010. }
  13011. return eastingValue;
  13012. }
  13013. /**
  13014. * Given the second letter from a two-letter MGRS 100k zone, and given the
  13015. * MGRS table set for the zone number, figure out the northing value that
  13016. * should be added to the other, secondary northing value. You have to
  13017. * remember that Northings are determined from the equator, and the vertical
  13018. * cycle of letters mean a 2000000 additional northing meters. This happens
  13019. * approx. every 18 degrees of latitude. This method does *NOT* count any
  13020. * additional northings. You have to figure out how many 2000000 meters need
  13021. * to be added for the zone letter of the MGRS coordinate.
  13022. *
  13023. * @private
  13024. * @param {char} n Second letter of the MGRS 100k zone
  13025. * @param {number} set The MGRS table set number, which is dependent on the
  13026. * UTM zone number.
  13027. * @return {number} The northing value for the given letter and set.
  13028. */
  13029. function getNorthingFromChar(n, set) {
  13030. if (n > 'V') {
  13031. throw "MGRSPoint given invalid Northing " + n;
  13032. }
  13033. // rowOrigin is the letter at the origin of the set for the
  13034. // column
  13035. var curRow = SET_ORIGIN_ROW_LETTERS.charCodeAt(set - 1);
  13036. var northingValue = 0.0;
  13037. var rewindMarker = false;
  13038. while (curRow !== n.charCodeAt(0)) {
  13039. curRow++;
  13040. if (curRow === I) {
  13041. curRow++;
  13042. }
  13043. if (curRow === O) {
  13044. curRow++;
  13045. }
  13046. // fixing a bug making whole application hang in this loop
  13047. // when 'n' is a wrong character
  13048. if (curRow > V) {
  13049. if (rewindMarker) {
  13050. // making sure that this loop ends
  13051. throw "Bad character: " + n;
  13052. }
  13053. curRow = A;
  13054. rewindMarker = true;
  13055. }
  13056. northingValue += 100000.0;
  13057. }
  13058. return northingValue;
  13059. }
  13060. /**
  13061. * The function getMinNorthing returns the minimum northing value of a MGRS
  13062. * zone.
  13063. *
  13064. * Ported from Geotrans' c Lattitude_Band_Value structure table.
  13065. *
  13066. * @private
  13067. * @param {char} zoneLetter The MGRS zone to get the min northing for.
  13068. * @return {number}
  13069. */
  13070. function getMinNorthing(zoneLetter) {
  13071. var northing;
  13072. switch (zoneLetter) {
  13073. case 'C':
  13074. northing = 1100000.0;
  13075. break;
  13076. case 'D':
  13077. northing = 2000000.0;
  13078. break;
  13079. case 'E':
  13080. northing = 2800000.0;
  13081. break;
  13082. case 'F':
  13083. northing = 3700000.0;
  13084. break;
  13085. case 'G':
  13086. northing = 4600000.0;
  13087. break;
  13088. case 'H':
  13089. northing = 5500000.0;
  13090. break;
  13091. case 'J':
  13092. northing = 6400000.0;
  13093. break;
  13094. case 'K':
  13095. northing = 7300000.0;
  13096. break;
  13097. case 'L':
  13098. northing = 8200000.0;
  13099. break;
  13100. case 'M':
  13101. northing = 9100000.0;
  13102. break;
  13103. case 'N':
  13104. northing = 0.0;
  13105. break;
  13106. case 'P':
  13107. northing = 800000.0;
  13108. break;
  13109. case 'Q':
  13110. northing = 1700000.0;
  13111. break;
  13112. case 'R':
  13113. northing = 2600000.0;
  13114. break;
  13115. case 'S':
  13116. northing = 3500000.0;
  13117. break;
  13118. case 'T':
  13119. northing = 4400000.0;
  13120. break;
  13121. case 'U':
  13122. northing = 5300000.0;
  13123. break;
  13124. case 'V':
  13125. northing = 6200000.0;
  13126. break;
  13127. case 'W':
  13128. northing = 7000000.0;
  13129. break;
  13130. case 'X':
  13131. northing = 7900000.0;
  13132. break;
  13133. default:
  13134. northing = -1.0;
  13135. }
  13136. if (northing >= 0.0) {
  13137. return northing;
  13138. } else {
  13139. throw "Invalid zone letter: " + zoneLetter;
  13140. }
  13141. }
  13142. function Point(x, y, z) {
  13143. if (!(this instanceof Point)) {
  13144. return new Point(x, y, z);
  13145. }
  13146. if (Array.isArray(x)) {
  13147. this.x = x[0];
  13148. this.y = x[1];
  13149. this.z = x[2] || 0.0;
  13150. } else if (_typeof(x) === 'object') {
  13151. this.x = x.x;
  13152. this.y = x.y;
  13153. this.z = x.z || 0.0;
  13154. } else if (typeof x === 'string' && typeof y === 'undefined') {
  13155. var coords = x.split(',');
  13156. this.x = parseFloat(coords[0], 10);
  13157. this.y = parseFloat(coords[1], 10);
  13158. this.z = parseFloat(coords[2], 10) || 0.0;
  13159. } else {
  13160. this.x = x;
  13161. this.y = y;
  13162. this.z = z || 0.0;
  13163. }
  13164. console.warn('proj4.Point will be removed in version 3, use proj4.toPoint');
  13165. }
  13166. Point.fromMGRS = function (mgrsStr) {
  13167. return new Point(toPoint$1(mgrsStr));
  13168. };
  13169. Point.prototype.toMGRS = function (accuracy) {
  13170. return forward$1([this.x, this.y], accuracy);
  13171. };
  13172. var C00 = 1;
  13173. var C02 = 0.25;
  13174. var C04 = 0.046875;
  13175. var C06 = 0.01953125;
  13176. var C08 = 0.01068115234375;
  13177. var C22 = 0.75;
  13178. var C44 = 0.46875;
  13179. var C46 = 0.01302083333333333333;
  13180. var C48 = 0.00712076822916666666;
  13181. var C66 = 0.36458333333333333333;
  13182. var C68 = 0.00569661458333333333;
  13183. var C88 = 0.3076171875;
  13184. var pj_enfn = function pj_enfn(es) {
  13185. var en = [];
  13186. en[0] = C00 - es * (C02 + es * (C04 + es * (C06 + es * C08)));
  13187. en[1] = es * (C22 - es * (C04 + es * (C06 + es * C08)));
  13188. var t = es * es;
  13189. en[2] = t * (C44 - es * (C46 + es * C48));
  13190. t *= es;
  13191. en[3] = t * (C66 - es * C68);
  13192. en[4] = t * es * C88;
  13193. return en;
  13194. };
  13195. var pj_mlfn = function pj_mlfn(phi, sphi, cphi, en) {
  13196. cphi *= sphi;
  13197. sphi *= sphi;
  13198. return en[0] * phi - cphi * (en[1] + sphi * (en[2] + sphi * (en[3] + sphi * en[4])));
  13199. };
  13200. var MAX_ITER = 20;
  13201. var pj_inv_mlfn = function pj_inv_mlfn(arg, es, en) {
  13202. var k = 1 / (1 - es);
  13203. var phi = arg;
  13204. for (var i = MAX_ITER; i; --i) {
  13205. /* rarely goes over 2 iterations */
  13206. var s = Math.sin(phi);
  13207. var t = 1 - es * s * s;
  13208. //t = this.pj_mlfn(phi, s, Math.cos(phi), en) - arg;
  13209. //phi -= t * (t * Math.sqrt(t)) * k;
  13210. t = (pj_mlfn(phi, s, Math.cos(phi), en) - arg) * (t * Math.sqrt(t)) * k;
  13211. phi -= t;
  13212. if (Math.abs(t) < EPSLN) {
  13213. return phi;
  13214. }
  13215. }
  13216. //..reportError("cass:pj_inv_mlfn: Convergence error");
  13217. return phi;
  13218. };
  13219. // Heavily based on this tmerc projection implementation
  13220. // https://github.com/mbloch/mapshaper-proj/blob/master/src/projections/tmerc.js
  13221. function init$2() {
  13222. this.x0 = this.x0 !== undefined ? this.x0 : 0;
  13223. this.y0 = this.y0 !== undefined ? this.y0 : 0;
  13224. this.long0 = this.long0 !== undefined ? this.long0 : 0;
  13225. this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;
  13226. if (this.es) {
  13227. this.en = pj_enfn(this.es);
  13228. this.ml0 = pj_mlfn(this.lat0, Math.sin(this.lat0), Math.cos(this.lat0), this.en);
  13229. }
  13230. }
  13231. /**
  13232. Transverse Mercator Forward - long/lat to x/y
  13233. long/lat in radians
  13234. */
  13235. function forward$2(p) {
  13236. var lon = p.x;
  13237. var lat = p.y;
  13238. var delta_lon = adjust_lon(lon - this.long0);
  13239. var con;
  13240. var x, y;
  13241. var sin_phi = Math.sin(lat);
  13242. var cos_phi = Math.cos(lat);
  13243. if (!this.es) {
  13244. var b = cos_phi * Math.sin(delta_lon);
  13245. if (Math.abs(Math.abs(b) - 1) < EPSLN) {
  13246. return 93;
  13247. } else {
  13248. x = 0.5 * this.a * this.k0 * Math.log((1 + b) / (1 - b)) + this.x0;
  13249. y = cos_phi * Math.cos(delta_lon) / Math.sqrt(1 - Math.pow(b, 2));
  13250. b = Math.abs(y);
  13251. if (b >= 1) {
  13252. if (b - 1 > EPSLN) {
  13253. return 93;
  13254. } else {
  13255. y = 0;
  13256. }
  13257. } else {
  13258. y = Math.acos(y);
  13259. }
  13260. if (lat < 0) {
  13261. y = -y;
  13262. }
  13263. y = this.a * this.k0 * (y - this.lat0) + this.y0;
  13264. }
  13265. } else {
  13266. var al = cos_phi * delta_lon;
  13267. var als = Math.pow(al, 2);
  13268. var c = this.ep2 * Math.pow(cos_phi, 2);
  13269. var cs = Math.pow(c, 2);
  13270. var tq = Math.abs(cos_phi) > EPSLN ? Math.tan(lat) : 0;
  13271. var t = Math.pow(tq, 2);
  13272. var ts = Math.pow(t, 2);
  13273. con = 1 - this.es * Math.pow(sin_phi, 2);
  13274. al = al / Math.sqrt(con);
  13275. var ml = pj_mlfn(lat, sin_phi, cos_phi, this.en);
  13276. x = this.a * (this.k0 * al * (1 + als / 6 * (1 - t + c + als / 20 * (5 - 18 * t + ts + 14 * c - 58 * t * c + als / 42 * (61 + 179 * ts - ts * t - 479 * t))))) + this.x0;
  13277. y = this.a * (this.k0 * (ml - this.ml0 + sin_phi * delta_lon * al / 2 * (1 + als / 12 * (5 - t + 9 * c + 4 * cs + als / 30 * (61 + ts - 58 * t + 270 * c - 330 * t * c + als / 56 * (1385 + 543 * ts - ts * t - 3111 * t)))))) + this.y0;
  13278. }
  13279. p.x = x;
  13280. p.y = y;
  13281. return p;
  13282. }
  13283. /**
  13284. Transverse Mercator Inverse - x/y to long/lat
  13285. */
  13286. function inverse$2(p) {
  13287. var con, phi;
  13288. var lat, lon;
  13289. var x = (p.x - this.x0) * (1 / this.a);
  13290. var y = (p.y - this.y0) * (1 / this.a);
  13291. if (!this.es) {
  13292. var f = Math.exp(x / this.k0);
  13293. var g = 0.5 * (f - 1 / f);
  13294. var temp = this.lat0 + y / this.k0;
  13295. var h = Math.cos(temp);
  13296. con = Math.sqrt((1 - Math.pow(h, 2)) / (1 + Math.pow(g, 2)));
  13297. lat = Math.asin(con);
  13298. if (y < 0) {
  13299. lat = -lat;
  13300. }
  13301. if (g === 0 && h === 0) {
  13302. lon = 0;
  13303. } else {
  13304. lon = adjust_lon(Math.atan2(g, h) + this.long0);
  13305. }
  13306. } else {
  13307. // ellipsoidal form
  13308. con = this.ml0 + y / this.k0;
  13309. phi = pj_inv_mlfn(con, this.es, this.en);
  13310. if (Math.abs(phi) < HALF_PI) {
  13311. var sin_phi = Math.sin(phi);
  13312. var cos_phi = Math.cos(phi);
  13313. var tan_phi = Math.abs(cos_phi) > EPSLN ? Math.tan(phi) : 0;
  13314. var c = this.ep2 * Math.pow(cos_phi, 2);
  13315. var cs = Math.pow(c, 2);
  13316. var t = Math.pow(tan_phi, 2);
  13317. var ts = Math.pow(t, 2);
  13318. con = 1 - this.es * Math.pow(sin_phi, 2);
  13319. var d = x * Math.sqrt(con) / this.k0;
  13320. var ds = Math.pow(d, 2);
  13321. con = con * tan_phi;
  13322. lat = phi - con * ds / (1 - this.es) * 0.5 * (1 - ds / 12 * (5 + 3 * t - 9 * c * t + c - 4 * cs - ds / 30 * (61 + 90 * t - 252 * c * t + 45 * ts + 46 * c - ds / 56 * (1385 + 3633 * t + 4095 * ts + 1574 * ts * t))));
  13323. lon = adjust_lon(this.long0 + d * (1 - ds / 6 * (1 + 2 * t + c - ds / 20 * (5 + 28 * t + 24 * ts + 8 * c * t + 6 * c - ds / 42 * (61 + 662 * t + 1320 * ts + 720 * ts * t)))) / cos_phi);
  13324. } else {
  13325. lat = HALF_PI * sign(y);
  13326. lon = 0;
  13327. }
  13328. }
  13329. p.x = lon;
  13330. p.y = lat;
  13331. return p;
  13332. }
  13333. var names$3 = ["Fast_Transverse_Mercator", "Fast Transverse Mercator"];
  13334. var tmerc = {
  13335. init: init$2,
  13336. forward: forward$2,
  13337. inverse: inverse$2,
  13338. names: names$3
  13339. };
  13340. var sinh = function sinh(x) {
  13341. var r = Math.exp(x);
  13342. r = (r - 1 / r) / 2;
  13343. return r;
  13344. };
  13345. var hypot = function hypot(x, y) {
  13346. x = Math.abs(x);
  13347. y = Math.abs(y);
  13348. var a = Math.max(x, y);
  13349. var b = Math.min(x, y) / (a ? a : 1);
  13350. return a * Math.sqrt(1 + Math.pow(b, 2));
  13351. };
  13352. var log1py = function log1py(x) {
  13353. var y = 1 + x;
  13354. var z = y - 1;
  13355. return z === 0 ? x : x * Math.log(y) / z;
  13356. };
  13357. var asinhy = function asinhy(x) {
  13358. var y = Math.abs(x);
  13359. y = log1py(y * (1 + y / (hypot(1, y) + 1)));
  13360. return x < 0 ? -y : y;
  13361. };
  13362. var gatg = function gatg(pp, B) {
  13363. var cos_2B = 2 * Math.cos(2 * B);
  13364. var i = pp.length - 1;
  13365. var h1 = pp[i];
  13366. var h2 = 0;
  13367. var h;
  13368. while (--i >= 0) {
  13369. h = -h2 + cos_2B * h1 + pp[i];
  13370. h2 = h1;
  13371. h1 = h;
  13372. }
  13373. return B + h * Math.sin(2 * B);
  13374. };
  13375. var clens = function clens(pp, arg_r) {
  13376. var r = 2 * Math.cos(arg_r);
  13377. var i = pp.length - 1;
  13378. var hr1 = pp[i];
  13379. var hr2 = 0;
  13380. var hr;
  13381. while (--i >= 0) {
  13382. hr = -hr2 + r * hr1 + pp[i];
  13383. hr2 = hr1;
  13384. hr1 = hr;
  13385. }
  13386. return Math.sin(arg_r) * hr;
  13387. };
  13388. var cosh = function cosh(x) {
  13389. var r = Math.exp(x);
  13390. r = (r + 1 / r) / 2;
  13391. return r;
  13392. };
  13393. var clens_cmplx = function clens_cmplx(pp, arg_r, arg_i) {
  13394. var sin_arg_r = Math.sin(arg_r);
  13395. var cos_arg_r = Math.cos(arg_r);
  13396. var sinh_arg_i = sinh(arg_i);
  13397. var cosh_arg_i = cosh(arg_i);
  13398. var r = 2 * cos_arg_r * cosh_arg_i;
  13399. var i = -2 * sin_arg_r * sinh_arg_i;
  13400. var j = pp.length - 1;
  13401. var hr = pp[j];
  13402. var hi1 = 0;
  13403. var hr1 = 0;
  13404. var hi = 0;
  13405. var hr2;
  13406. var hi2;
  13407. while (--j >= 0) {
  13408. hr2 = hr1;
  13409. hi2 = hi1;
  13410. hr1 = hr;
  13411. hi1 = hi;
  13412. hr = -hr2 + r * hr1 - i * hi1 + pp[j];
  13413. hi = -hi2 + i * hr1 + r * hi1;
  13414. }
  13415. r = sin_arg_r * cosh_arg_i;
  13416. i = cos_arg_r * sinh_arg_i;
  13417. return [r * hr - i * hi, r * hi + i * hr];
  13418. };
  13419. // Heavily based on this etmerc projection implementation
  13420. // https://github.com/mbloch/mapshaper-proj/blob/master/src/projections/etmerc.js
  13421. function init$3() {
  13422. if (!this.approx && (isNaN(this.es) || this.es <= 0)) {
  13423. throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');
  13424. }
  13425. if (this.approx) {
  13426. // When '+approx' is set, use tmerc instead
  13427. tmerc.init.apply(this);
  13428. this.forward = tmerc.forward;
  13429. this.inverse = tmerc.inverse;
  13430. }
  13431. this.x0 = this.x0 !== undefined ? this.x0 : 0;
  13432. this.y0 = this.y0 !== undefined ? this.y0 : 0;
  13433. this.long0 = this.long0 !== undefined ? this.long0 : 0;
  13434. this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;
  13435. this.cgb = [];
  13436. this.cbg = [];
  13437. this.utg = [];
  13438. this.gtu = [];
  13439. var f = this.es / (1 + Math.sqrt(1 - this.es));
  13440. var n = f / (2 - f);
  13441. var np = n;
  13442. this.cgb[0] = n * (2 + n * (-2 / 3 + n * (-2 + n * (116 / 45 + n * (26 / 45 + n * (-2854 / 675))))));
  13443. this.cbg[0] = n * (-2 + n * (2 / 3 + n * (4 / 3 + n * (-82 / 45 + n * (32 / 45 + n * (4642 / 4725))))));
  13444. np = np * n;
  13445. this.cgb[1] = np * (7 / 3 + n * (-8 / 5 + n * (-227 / 45 + n * (2704 / 315 + n * (2323 / 945)))));
  13446. this.cbg[1] = np * (5 / 3 + n * (-16 / 15 + n * (-13 / 9 + n * (904 / 315 + n * (-1522 / 945)))));
  13447. np = np * n;
  13448. this.cgb[2] = np * (56 / 15 + n * (-136 / 35 + n * (-1262 / 105 + n * (73814 / 2835))));
  13449. this.cbg[2] = np * (-26 / 15 + n * (34 / 21 + n * (8 / 5 + n * (-12686 / 2835))));
  13450. np = np * n;
  13451. this.cgb[3] = np * (4279 / 630 + n * (-332 / 35 + n * (-399572 / 14175)));
  13452. this.cbg[3] = np * (1237 / 630 + n * (-12 / 5 + n * (-24832 / 14175)));
  13453. np = np * n;
  13454. this.cgb[4] = np * (4174 / 315 + n * (-144838 / 6237));
  13455. this.cbg[4] = np * (-734 / 315 + n * (109598 / 31185));
  13456. np = np * n;
  13457. this.cgb[5] = np * (601676 / 22275);
  13458. this.cbg[5] = np * (444337 / 155925);
  13459. np = Math.pow(n, 2);
  13460. this.Qn = this.k0 / (1 + n) * (1 + np * (1 / 4 + np * (1 / 64 + np / 256)));
  13461. this.utg[0] = n * (-0.5 + n * (2 / 3 + n * (-37 / 96 + n * (1 / 360 + n * (81 / 512 + n * (-96199 / 604800))))));
  13462. this.gtu[0] = n * (0.5 + n * (-2 / 3 + n * (5 / 16 + n * (41 / 180 + n * (-127 / 288 + n * (7891 / 37800))))));
  13463. this.utg[1] = np * (-1 / 48 + n * (-1 / 15 + n * (437 / 1440 + n * (-46 / 105 + n * (1118711 / 3870720)))));
  13464. this.gtu[1] = np * (13 / 48 + n * (-3 / 5 + n * (557 / 1440 + n * (281 / 630 + n * (-1983433 / 1935360)))));
  13465. np = np * n;
  13466. this.utg[2] = np * (-17 / 480 + n * (37 / 840 + n * (209 / 4480 + n * (-5569 / 90720))));
  13467. this.gtu[2] = np * (61 / 240 + n * (-103 / 140 + n * (15061 / 26880 + n * (167603 / 181440))));
  13468. np = np * n;
  13469. this.utg[3] = np * (-4397 / 161280 + n * (11 / 504 + n * (830251 / 7257600)));
  13470. this.gtu[3] = np * (49561 / 161280 + n * (-179 / 168 + n * (6601661 / 7257600)));
  13471. np = np * n;
  13472. this.utg[4] = np * (-4583 / 161280 + n * (108847 / 3991680));
  13473. this.gtu[4] = np * (34729 / 80640 + n * (-3418889 / 1995840));
  13474. np = np * n;
  13475. this.utg[5] = np * (-20648693 / 638668800);
  13476. this.gtu[5] = np * (212378941 / 319334400);
  13477. var Z = gatg(this.cbg, this.lat0);
  13478. this.Zb = -this.Qn * (Z + clens(this.gtu, 2 * Z));
  13479. }
  13480. function forward$3(p) {
  13481. var Ce = adjust_lon(p.x - this.long0);
  13482. var Cn = p.y;
  13483. Cn = gatg(this.cbg, Cn);
  13484. var sin_Cn = Math.sin(Cn);
  13485. var cos_Cn = Math.cos(Cn);
  13486. var sin_Ce = Math.sin(Ce);
  13487. var cos_Ce = Math.cos(Ce);
  13488. Cn = Math.atan2(sin_Cn, cos_Ce * cos_Cn);
  13489. Ce = Math.atan2(sin_Ce * cos_Cn, hypot(sin_Cn, cos_Cn * cos_Ce));
  13490. Ce = asinhy(Math.tan(Ce));
  13491. var tmp = clens_cmplx(this.gtu, 2 * Cn, 2 * Ce);
  13492. Cn = Cn + tmp[0];
  13493. Ce = Ce + tmp[1];
  13494. var x;
  13495. var y;
  13496. if (Math.abs(Ce) <= 2.623395162778) {
  13497. x = this.a * (this.Qn * Ce) + this.x0;
  13498. y = this.a * (this.Qn * Cn + this.Zb) + this.y0;
  13499. } else {
  13500. x = Infinity;
  13501. y = Infinity;
  13502. }
  13503. p.x = x;
  13504. p.y = y;
  13505. return p;
  13506. }
  13507. function inverse$3(p) {
  13508. var Ce = (p.x - this.x0) * (1 / this.a);
  13509. var Cn = (p.y - this.y0) * (1 / this.a);
  13510. Cn = (Cn - this.Zb) / this.Qn;
  13511. Ce = Ce / this.Qn;
  13512. var lon;
  13513. var lat;
  13514. if (Math.abs(Ce) <= 2.623395162778) {
  13515. var tmp = clens_cmplx(this.utg, 2 * Cn, 2 * Ce);
  13516. Cn = Cn + tmp[0];
  13517. Ce = Ce + tmp[1];
  13518. Ce = Math.atan(sinh(Ce));
  13519. var sin_Cn = Math.sin(Cn);
  13520. var cos_Cn = Math.cos(Cn);
  13521. var sin_Ce = Math.sin(Ce);
  13522. var cos_Ce = Math.cos(Ce);
  13523. Cn = Math.atan2(sin_Cn * cos_Ce, hypot(sin_Ce, cos_Ce * cos_Cn));
  13524. Ce = Math.atan2(sin_Ce, cos_Ce * cos_Cn);
  13525. lon = adjust_lon(Ce + this.long0);
  13526. lat = gatg(this.cgb, Cn);
  13527. } else {
  13528. lon = Infinity;
  13529. lat = Infinity;
  13530. }
  13531. p.x = lon;
  13532. p.y = lat;
  13533. return p;
  13534. }
  13535. var names$4 = ["Extended_Transverse_Mercator", "Extended Transverse Mercator", "etmerc", "Transverse_Mercator", "Transverse Mercator", "tmerc"];
  13536. var etmerc = {
  13537. init: init$3,
  13538. forward: forward$3,
  13539. inverse: inverse$3,
  13540. names: names$4
  13541. };
  13542. var adjust_zone = function adjust_zone(zone, lon) {
  13543. if (zone === undefined) {
  13544. zone = Math.floor((adjust_lon(lon) + Math.PI) * 30 / Math.PI) + 1;
  13545. if (zone < 0) {
  13546. return 0;
  13547. } else if (zone > 60) {
  13548. return 60;
  13549. }
  13550. }
  13551. return zone;
  13552. };
  13553. var dependsOn = 'etmerc';
  13554. function init$4() {
  13555. var zone = adjust_zone(this.zone, this.long0);
  13556. if (zone === undefined) {
  13557. throw new Error('unknown utm zone');
  13558. }
  13559. this.lat0 = 0;
  13560. this.long0 = (6 * Math.abs(zone) - 183) * D2R;
  13561. this.x0 = 500000;
  13562. this.y0 = this.utmSouth ? 10000000 : 0;
  13563. this.k0 = 0.9996;
  13564. etmerc.init.apply(this);
  13565. this.forward = etmerc.forward;
  13566. this.inverse = etmerc.inverse;
  13567. }
  13568. var names$5 = ["Universal Transverse Mercator System", "utm"];
  13569. var utm = {
  13570. init: init$4,
  13571. names: names$5,
  13572. dependsOn: dependsOn
  13573. };
  13574. var srat = function srat(esinp, exp) {
  13575. return Math.pow((1 - esinp) / (1 + esinp), exp);
  13576. };
  13577. var MAX_ITER$1 = 20;
  13578. function init$6() {
  13579. var sphi = Math.sin(this.lat0);
  13580. var cphi = Math.cos(this.lat0);
  13581. cphi *= cphi;
  13582. this.rc = Math.sqrt(1 - this.es) / (1 - this.es * sphi * sphi);
  13583. this.C = Math.sqrt(1 + this.es * cphi * cphi / (1 - this.es));
  13584. this.phic0 = Math.asin(sphi / this.C);
  13585. this.ratexp = 0.5 * this.C * this.e;
  13586. this.K = Math.tan(0.5 * this.phic0 + FORTPI) / (Math.pow(Math.tan(0.5 * this.lat0 + FORTPI), this.C) * srat(this.e * sphi, this.ratexp));
  13587. }
  13588. function forward$5(p) {
  13589. var lon = p.x;
  13590. var lat = p.y;
  13591. p.y = 2 * Math.atan(this.K * Math.pow(Math.tan(0.5 * lat + FORTPI), this.C) * srat(this.e * Math.sin(lat), this.ratexp)) - HALF_PI;
  13592. p.x = this.C * lon;
  13593. return p;
  13594. }
  13595. function inverse$5(p) {
  13596. var DEL_TOL = 1e-14;
  13597. var lon = p.x / this.C;
  13598. var lat = p.y;
  13599. var num = Math.pow(Math.tan(0.5 * lat + FORTPI) / this.K, 1 / this.C);
  13600. for (var i = MAX_ITER$1; i > 0; --i) {
  13601. lat = 2 * Math.atan(num * srat(this.e * Math.sin(p.y), -0.5 * this.e)) - HALF_PI;
  13602. if (Math.abs(lat - p.y) < DEL_TOL) {
  13603. break;
  13604. }
  13605. p.y = lat;
  13606. }
  13607. /* convergence failed */
  13608. if (!i) {
  13609. return null;
  13610. }
  13611. p.x = lon;
  13612. p.y = lat;
  13613. return p;
  13614. }
  13615. var names$7 = ["gauss"];
  13616. var gauss = {
  13617. init: init$6,
  13618. forward: forward$5,
  13619. inverse: inverse$5,
  13620. names: names$7
  13621. };
  13622. function init$5() {
  13623. gauss.init.apply(this);
  13624. if (!this.rc) {
  13625. return;
  13626. }
  13627. this.sinc0 = Math.sin(this.phic0);
  13628. this.cosc0 = Math.cos(this.phic0);
  13629. this.R2 = 2 * this.rc;
  13630. if (!this.title) {
  13631. this.title = "Oblique Stereographic Alternative";
  13632. }
  13633. }
  13634. function forward$4(p) {
  13635. var sinc, cosc, cosl, k;
  13636. p.x = adjust_lon(p.x - this.long0);
  13637. gauss.forward.apply(this, [p]);
  13638. sinc = Math.sin(p.y);
  13639. cosc = Math.cos(p.y);
  13640. cosl = Math.cos(p.x);
  13641. k = this.k0 * this.R2 / (1 + this.sinc0 * sinc + this.cosc0 * cosc * cosl);
  13642. p.x = k * cosc * Math.sin(p.x);
  13643. p.y = k * (this.cosc0 * sinc - this.sinc0 * cosc * cosl);
  13644. p.x = this.a * p.x + this.x0;
  13645. p.y = this.a * p.y + this.y0;
  13646. return p;
  13647. }
  13648. function inverse$4(p) {
  13649. var sinc, cosc, lon, lat, rho;
  13650. p.x = (p.x - this.x0) / this.a;
  13651. p.y = (p.y - this.y0) / this.a;
  13652. p.x /= this.k0;
  13653. p.y /= this.k0;
  13654. if (rho = Math.sqrt(p.x * p.x + p.y * p.y)) {
  13655. var c = 2 * Math.atan2(rho, this.R2);
  13656. sinc = Math.sin(c);
  13657. cosc = Math.cos(c);
  13658. lat = Math.asin(cosc * this.sinc0 + p.y * sinc * this.cosc0 / rho);
  13659. lon = Math.atan2(p.x * sinc, rho * this.cosc0 * cosc - p.y * this.sinc0 * sinc);
  13660. } else {
  13661. lat = this.phic0;
  13662. lon = 0;
  13663. }
  13664. p.x = lon;
  13665. p.y = lat;
  13666. gauss.inverse.apply(this, [p]);
  13667. p.x = adjust_lon(p.x + this.long0);
  13668. return p;
  13669. }
  13670. var names$6 = ["Stereographic_North_Pole", "Oblique_Stereographic", "Polar_Stereographic", "sterea", "Oblique Stereographic Alternative", "Double_Stereographic"];
  13671. var sterea = {
  13672. init: init$5,
  13673. forward: forward$4,
  13674. inverse: inverse$4,
  13675. names: names$6
  13676. };
  13677. function ssfn_(phit, sinphi, eccen) {
  13678. sinphi *= eccen;
  13679. return Math.tan(0.5 * (HALF_PI + phit)) * Math.pow((1 - sinphi) / (1 + sinphi), 0.5 * eccen);
  13680. }
  13681. function init$7() {
  13682. this.coslat0 = Math.cos(this.lat0);
  13683. this.sinlat0 = Math.sin(this.lat0);
  13684. if (this.sphere) {
  13685. if (this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= EPSLN) {
  13686. this.k0 = 0.5 * (1 + sign(this.lat0) * Math.sin(this.lat_ts));
  13687. }
  13688. } else {
  13689. if (Math.abs(this.coslat0) <= EPSLN) {
  13690. if (this.lat0 > 0) {
  13691. //North pole
  13692. //trace('stere:north pole');
  13693. this.con = 1;
  13694. } else {
  13695. //South pole
  13696. //trace('stere:south pole');
  13697. this.con = -1;
  13698. }
  13699. }
  13700. this.cons = Math.sqrt(Math.pow(1 + this.e, 1 + this.e) * Math.pow(1 - this.e, 1 - this.e));
  13701. if (this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= EPSLN) {
  13702. this.k0 = 0.5 * this.cons * msfnz(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) / tsfnz(this.e, this.con * this.lat_ts, this.con * Math.sin(this.lat_ts));
  13703. }
  13704. this.ms1 = msfnz(this.e, this.sinlat0, this.coslat0);
  13705. this.X0 = 2 * Math.atan(this.ssfn_(this.lat0, this.sinlat0, this.e)) - HALF_PI;
  13706. this.cosX0 = Math.cos(this.X0);
  13707. this.sinX0 = Math.sin(this.X0);
  13708. }
  13709. }
  13710. // Stereographic forward equations--mapping lat,long to x,y
  13711. function forward$6(p) {
  13712. var lon = p.x;
  13713. var lat = p.y;
  13714. var sinlat = Math.sin(lat);
  13715. var coslat = Math.cos(lat);
  13716. var A, X, sinX, cosX, ts, rh;
  13717. var dlon = adjust_lon(lon - this.long0);
  13718. if (Math.abs(Math.abs(lon - this.long0) - Math.PI) <= EPSLN && Math.abs(lat + this.lat0) <= EPSLN) {
  13719. //case of the origine point
  13720. //trace('stere:this is the origin point');
  13721. p.x = NaN;
  13722. p.y = NaN;
  13723. return p;
  13724. }
  13725. if (this.sphere) {
  13726. //trace('stere:sphere case');
  13727. A = 2 * this.k0 / (1 + this.sinlat0 * sinlat + this.coslat0 * coslat * Math.cos(dlon));
  13728. p.x = this.a * A * coslat * Math.sin(dlon) + this.x0;
  13729. p.y = this.a * A * (this.coslat0 * sinlat - this.sinlat0 * coslat * Math.cos(dlon)) + this.y0;
  13730. return p;
  13731. } else {
  13732. X = 2 * Math.atan(this.ssfn_(lat, sinlat, this.e)) - HALF_PI;
  13733. cosX = Math.cos(X);
  13734. sinX = Math.sin(X);
  13735. if (Math.abs(this.coslat0) <= EPSLN) {
  13736. ts = tsfnz(this.e, lat * this.con, this.con * sinlat);
  13737. rh = 2 * this.a * this.k0 * ts / this.cons;
  13738. p.x = this.x0 + rh * Math.sin(lon - this.long0);
  13739. p.y = this.y0 - this.con * rh * Math.cos(lon - this.long0);
  13740. //trace(p.toString());
  13741. return p;
  13742. } else if (Math.abs(this.sinlat0) < EPSLN) {
  13743. //Eq
  13744. //trace('stere:equateur');
  13745. A = 2 * this.a * this.k0 / (1 + cosX * Math.cos(dlon));
  13746. p.y = A * sinX;
  13747. } else {
  13748. //other case
  13749. //trace('stere:normal case');
  13750. A = 2 * this.a * this.k0 * this.ms1 / (this.cosX0 * (1 + this.sinX0 * sinX + this.cosX0 * cosX * Math.cos(dlon)));
  13751. p.y = A * (this.cosX0 * sinX - this.sinX0 * cosX * Math.cos(dlon)) + this.y0;
  13752. }
  13753. p.x = A * cosX * Math.sin(dlon) + this.x0;
  13754. }
  13755. //trace(p.toString());
  13756. return p;
  13757. }
  13758. //* Stereographic inverse equations--mapping x,y to lat/long
  13759. function inverse$6(p) {
  13760. p.x -= this.x0;
  13761. p.y -= this.y0;
  13762. var lon, lat, ts, ce, Chi;
  13763. var rh = Math.sqrt(p.x * p.x + p.y * p.y);
  13764. if (this.sphere) {
  13765. var c = 2 * Math.atan(rh / (2 * this.a * this.k0));
  13766. lon = this.long0;
  13767. lat = this.lat0;
  13768. if (rh <= EPSLN) {
  13769. p.x = lon;
  13770. p.y = lat;
  13771. return p;
  13772. }
  13773. lat = Math.asin(Math.cos(c) * this.sinlat0 + p.y * Math.sin(c) * this.coslat0 / rh);
  13774. if (Math.abs(this.coslat0) < EPSLN) {
  13775. if (this.lat0 > 0) {
  13776. lon = adjust_lon(this.long0 + Math.atan2(p.x, -1 * p.y));
  13777. } else {
  13778. lon = adjust_lon(this.long0 + Math.atan2(p.x, p.y));
  13779. }
  13780. } else {
  13781. lon = adjust_lon(this.long0 + Math.atan2(p.x * Math.sin(c), rh * this.coslat0 * Math.cos(c) - p.y * this.sinlat0 * Math.sin(c)));
  13782. }
  13783. p.x = lon;
  13784. p.y = lat;
  13785. return p;
  13786. } else {
  13787. if (Math.abs(this.coslat0) <= EPSLN) {
  13788. if (rh <= EPSLN) {
  13789. lat = this.lat0;
  13790. lon = this.long0;
  13791. p.x = lon;
  13792. p.y = lat;
  13793. //trace(p.toString());
  13794. return p;
  13795. }
  13796. p.x *= this.con;
  13797. p.y *= this.con;
  13798. ts = rh * this.cons / (2 * this.a * this.k0);
  13799. lat = this.con * phi2z(this.e, ts);
  13800. lon = this.con * adjust_lon(this.con * this.long0 + Math.atan2(p.x, -1 * p.y));
  13801. } else {
  13802. ce = 2 * Math.atan(rh * this.cosX0 / (2 * this.a * this.k0 * this.ms1));
  13803. lon = this.long0;
  13804. if (rh <= EPSLN) {
  13805. Chi = this.X0;
  13806. } else {
  13807. Chi = Math.asin(Math.cos(ce) * this.sinX0 + p.y * Math.sin(ce) * this.cosX0 / rh);
  13808. lon = adjust_lon(this.long0 + Math.atan2(p.x * Math.sin(ce), rh * this.cosX0 * Math.cos(ce) - p.y * this.sinX0 * Math.sin(ce)));
  13809. }
  13810. lat = -1 * phi2z(this.e, Math.tan(0.5 * (HALF_PI + Chi)));
  13811. }
  13812. }
  13813. p.x = lon;
  13814. p.y = lat;
  13815. //trace(p.toString());
  13816. return p;
  13817. }
  13818. var names$8 = ["stere", "Stereographic_South_Pole", "Polar Stereographic (variant B)"];
  13819. var stere = {
  13820. init: init$7,
  13821. forward: forward$6,
  13822. inverse: inverse$6,
  13823. names: names$8,
  13824. ssfn_: ssfn_
  13825. };
  13826. /*
  13827. references:
  13828. Formules et constantes pour le Calcul pour la
  13829. projection cylindrique conforme à axe oblique et pour la transformation entre
  13830. des systèmes de référence.
  13831. http://www.swisstopo.admin.ch/internet/swisstopo/fr/home/topics/survey/sys/refsys/switzerland.parsysrelated1.31216.downloadList.77004.DownloadFile.tmp/swissprojectionfr.pdf
  13832. */
  13833. function init$8() {
  13834. var phy0 = this.lat0;
  13835. this.lambda0 = this.long0;
  13836. var sinPhy0 = Math.sin(phy0);
  13837. var semiMajorAxis = this.a;
  13838. var invF = this.rf;
  13839. var flattening = 1 / invF;
  13840. var e2 = 2 * flattening - Math.pow(flattening, 2);
  13841. var e = this.e = Math.sqrt(e2);
  13842. this.R = this.k0 * semiMajorAxis * Math.sqrt(1 - e2) / (1 - e2 * Math.pow(sinPhy0, 2));
  13843. this.alpha = Math.sqrt(1 + e2 / (1 - e2) * Math.pow(Math.cos(phy0), 4));
  13844. this.b0 = Math.asin(sinPhy0 / this.alpha);
  13845. var k1 = Math.log(Math.tan(Math.PI / 4 + this.b0 / 2));
  13846. var k2 = Math.log(Math.tan(Math.PI / 4 + phy0 / 2));
  13847. var k3 = Math.log((1 + e * sinPhy0) / (1 - e * sinPhy0));
  13848. this.K = k1 - this.alpha * k2 + this.alpha * e / 2 * k3;
  13849. }
  13850. function forward$7(p) {
  13851. var Sa1 = Math.log(Math.tan(Math.PI / 4 - p.y / 2));
  13852. var Sa2 = this.e / 2 * Math.log((1 + this.e * Math.sin(p.y)) / (1 - this.e * Math.sin(p.y)));
  13853. var S = -this.alpha * (Sa1 + Sa2) + this.K;
  13854. // spheric latitude
  13855. var b = 2 * (Math.atan(Math.exp(S)) - Math.PI / 4);
  13856. // spheric longitude
  13857. var I = this.alpha * (p.x - this.lambda0);
  13858. // psoeudo equatorial rotation
  13859. var rotI = Math.atan(Math.sin(I) / (Math.sin(this.b0) * Math.tan(b) + Math.cos(this.b0) * Math.cos(I)));
  13860. var rotB = Math.asin(Math.cos(this.b0) * Math.sin(b) - Math.sin(this.b0) * Math.cos(b) * Math.cos(I));
  13861. p.y = this.R / 2 * Math.log((1 + Math.sin(rotB)) / (1 - Math.sin(rotB))) + this.y0;
  13862. p.x = this.R * rotI + this.x0;
  13863. return p;
  13864. }
  13865. function inverse$7(p) {
  13866. var Y = p.x - this.x0;
  13867. var X = p.y - this.y0;
  13868. var rotI = Y / this.R;
  13869. var rotB = 2 * (Math.atan(Math.exp(X / this.R)) - Math.PI / 4);
  13870. var b = Math.asin(Math.cos(this.b0) * Math.sin(rotB) + Math.sin(this.b0) * Math.cos(rotB) * Math.cos(rotI));
  13871. var I = Math.atan(Math.sin(rotI) / (Math.cos(this.b0) * Math.cos(rotI) - Math.sin(this.b0) * Math.tan(rotB)));
  13872. var lambda = this.lambda0 + I / this.alpha;
  13873. var S = 0;
  13874. var phy = b;
  13875. var prevPhy = -1000;
  13876. var iteration = 0;
  13877. while (Math.abs(phy - prevPhy) > 0.0000001) {
  13878. if (++iteration > 20) {
  13879. //...reportError("omercFwdInfinity");
  13880. return;
  13881. }
  13882. //S = Math.log(Math.tan(Math.PI / 4 + phy / 2));
  13883. S = 1 / this.alpha * (Math.log(Math.tan(Math.PI / 4 + b / 2)) - this.K) + this.e * Math.log(Math.tan(Math.PI / 4 + Math.asin(this.e * Math.sin(phy)) / 2));
  13884. prevPhy = phy;
  13885. phy = 2 * Math.atan(Math.exp(S)) - Math.PI / 2;
  13886. }
  13887. p.x = lambda;
  13888. p.y = phy;
  13889. return p;
  13890. }
  13891. var names$9 = ["somerc"];
  13892. var somerc = {
  13893. init: init$8,
  13894. forward: forward$7,
  13895. inverse: inverse$7,
  13896. names: names$9
  13897. };
  13898. var TOL = 1e-7;
  13899. function isTypeA(P) {
  13900. var typeAProjections = ['Hotine_Oblique_Mercator', 'Hotine_Oblique_Mercator_Azimuth_Natural_Origin'];
  13901. var projectionName = _typeof(P.PROJECTION) === "object" ? Object.keys(P.PROJECTION)[0] : P.PROJECTION;
  13902. return 'no_uoff' in P || 'no_off' in P || typeAProjections.indexOf(projectionName) !== -1;
  13903. }
  13904. /* Initialize the Oblique Mercator projection
  13905. ------------------------------------------*/
  13906. function init$9() {
  13907. var con,
  13908. com,
  13909. cosph0,
  13910. D,
  13911. F,
  13912. H,
  13913. L,
  13914. sinph0,
  13915. p,
  13916. J,
  13917. gamma = 0,
  13918. gamma0,
  13919. lamc = 0,
  13920. lam1 = 0,
  13921. lam2 = 0,
  13922. phi1 = 0,
  13923. phi2 = 0,
  13924. alpha_c = 0;
  13925. // only Type A uses the no_off or no_uoff property
  13926. // https://github.com/OSGeo/proj.4/issues/104
  13927. this.no_off = isTypeA(this);
  13928. this.no_rot = 'no_rot' in this;
  13929. var alp = false;
  13930. if ("alpha" in this) {
  13931. alp = true;
  13932. }
  13933. var gam = false;
  13934. if ("rectified_grid_angle" in this) {
  13935. gam = true;
  13936. }
  13937. if (alp) {
  13938. alpha_c = this.alpha;
  13939. }
  13940. if (gam) {
  13941. gamma = this.rectified_grid_angle * D2R;
  13942. }
  13943. if (alp || gam) {
  13944. lamc = this.longc;
  13945. } else {
  13946. lam1 = this.long1;
  13947. phi1 = this.lat1;
  13948. lam2 = this.long2;
  13949. phi2 = this.lat2;
  13950. if (Math.abs(phi1 - phi2) <= TOL || (con = Math.abs(phi1)) <= TOL || Math.abs(con - HALF_PI) <= TOL || Math.abs(Math.abs(this.lat0) - HALF_PI) <= TOL || Math.abs(Math.abs(phi2) - HALF_PI) <= TOL) {
  13951. throw new Error();
  13952. }
  13953. }
  13954. var one_es = 1.0 - this.es;
  13955. com = Math.sqrt(one_es);
  13956. if (Math.abs(this.lat0) > EPSLN) {
  13957. sinph0 = Math.sin(this.lat0);
  13958. cosph0 = Math.cos(this.lat0);
  13959. con = 1 - this.es * sinph0 * sinph0;
  13960. this.B = cosph0 * cosph0;
  13961. this.B = Math.sqrt(1 + this.es * this.B * this.B / one_es);
  13962. this.A = this.B * this.k0 * com / con;
  13963. D = this.B * com / (cosph0 * Math.sqrt(con));
  13964. F = D * D - 1;
  13965. if (F <= 0) {
  13966. F = 0;
  13967. } else {
  13968. F = Math.sqrt(F);
  13969. if (this.lat0 < 0) {
  13970. F = -F;
  13971. }
  13972. }
  13973. this.E = F += D;
  13974. this.E *= Math.pow(tsfnz(this.e, this.lat0, sinph0), this.B);
  13975. } else {
  13976. this.B = 1 / com;
  13977. this.A = this.k0;
  13978. this.E = D = F = 1;
  13979. }
  13980. if (alp || gam) {
  13981. if (alp) {
  13982. gamma0 = Math.asin(Math.sin(alpha_c) / D);
  13983. if (!gam) {
  13984. gamma = alpha_c;
  13985. }
  13986. } else {
  13987. gamma0 = gamma;
  13988. alpha_c = Math.asin(D * Math.sin(gamma0));
  13989. }
  13990. this.lam0 = lamc - Math.asin(0.5 * (F - 1 / F) * Math.tan(gamma0)) / this.B;
  13991. } else {
  13992. H = Math.pow(tsfnz(this.e, phi1, Math.sin(phi1)), this.B);
  13993. L = Math.pow(tsfnz(this.e, phi2, Math.sin(phi2)), this.B);
  13994. F = this.E / H;
  13995. p = (L - H) / (L + H);
  13996. J = this.E * this.E;
  13997. J = (J - L * H) / (J + L * H);
  13998. con = lam1 - lam2;
  13999. if (con < -Math.pi) {
  14000. lam2 -= TWO_PI;
  14001. } else if (con > Math.pi) {
  14002. lam2 += TWO_PI;
  14003. }
  14004. this.lam0 = adjust_lon(0.5 * (lam1 + lam2) - Math.atan(J * Math.tan(0.5 * this.B * (lam1 - lam2)) / p) / this.B);
  14005. gamma0 = Math.atan(2 * Math.sin(this.B * adjust_lon(lam1 - this.lam0)) / (F - 1 / F));
  14006. gamma = alpha_c = Math.asin(D * Math.sin(gamma0));
  14007. }
  14008. this.singam = Math.sin(gamma0);
  14009. this.cosgam = Math.cos(gamma0);
  14010. this.sinrot = Math.sin(gamma);
  14011. this.cosrot = Math.cos(gamma);
  14012. this.rB = 1 / this.B;
  14013. this.ArB = this.A * this.rB;
  14014. this.BrA = 1 / this.ArB;
  14015. if (this.no_off) {
  14016. this.u_0 = 0;
  14017. } else {
  14018. this.u_0 = Math.abs(this.ArB * Math.atan(Math.sqrt(D * D - 1) / Math.cos(alpha_c)));
  14019. if (this.lat0 < 0) {
  14020. this.u_0 = -this.u_0;
  14021. }
  14022. }
  14023. F = 0.5 * gamma0;
  14024. this.v_pole_n = this.ArB * Math.log(Math.tan(FORTPI - F));
  14025. this.v_pole_s = this.ArB * Math.log(Math.tan(FORTPI + F));
  14026. }
  14027. /* Oblique Mercator forward equations--mapping lat,long to x,y
  14028. ----------------------------------------------------------*/
  14029. function forward$8(p) {
  14030. var coords = {};
  14031. var S, T, U, V, W, temp, u, v;
  14032. p.x = p.x - this.lam0;
  14033. if (Math.abs(Math.abs(p.y) - HALF_PI) > EPSLN) {
  14034. W = this.E / Math.pow(tsfnz(this.e, p.y, Math.sin(p.y)), this.B);
  14035. temp = 1 / W;
  14036. S = 0.5 * (W - temp);
  14037. T = 0.5 * (W + temp);
  14038. V = Math.sin(this.B * p.x);
  14039. U = (S * this.singam - V * this.cosgam) / T;
  14040. if (Math.abs(Math.abs(U) - 1.0) < EPSLN) {
  14041. throw new Error();
  14042. }
  14043. v = 0.5 * this.ArB * Math.log((1 - U) / (1 + U));
  14044. temp = Math.cos(this.B * p.x);
  14045. if (Math.abs(temp) < TOL) {
  14046. u = this.A * p.x;
  14047. } else {
  14048. u = this.ArB * Math.atan2(S * this.cosgam + V * this.singam, temp);
  14049. }
  14050. } else {
  14051. v = p.y > 0 ? this.v_pole_n : this.v_pole_s;
  14052. u = this.ArB * p.y;
  14053. }
  14054. if (this.no_rot) {
  14055. coords.x = u;
  14056. coords.y = v;
  14057. } else {
  14058. u -= this.u_0;
  14059. coords.x = v * this.cosrot + u * this.sinrot;
  14060. coords.y = u * this.cosrot - v * this.sinrot;
  14061. }
  14062. coords.x = this.a * coords.x + this.x0;
  14063. coords.y = this.a * coords.y + this.y0;
  14064. return coords;
  14065. }
  14066. function inverse$8(p) {
  14067. var u, v, Qp, Sp, Tp, Vp, Up;
  14068. var coords = {};
  14069. p.x = (p.x - this.x0) * (1.0 / this.a);
  14070. p.y = (p.y - this.y0) * (1.0 / this.a);
  14071. if (this.no_rot) {
  14072. v = p.y;
  14073. u = p.x;
  14074. } else {
  14075. v = p.x * this.cosrot - p.y * this.sinrot;
  14076. u = p.y * this.cosrot + p.x * this.sinrot + this.u_0;
  14077. }
  14078. Qp = Math.exp(-this.BrA * v);
  14079. Sp = 0.5 * (Qp - 1 / Qp);
  14080. Tp = 0.5 * (Qp + 1 / Qp);
  14081. Vp = Math.sin(this.BrA * u);
  14082. Up = (Vp * this.cosgam + Sp * this.singam) / Tp;
  14083. if (Math.abs(Math.abs(Up) - 1) < EPSLN) {
  14084. coords.x = 0;
  14085. coords.y = Up < 0 ? -HALF_PI : HALF_PI;
  14086. } else {
  14087. coords.y = this.E / Math.sqrt((1 + Up) / (1 - Up));
  14088. coords.y = phi2z(this.e, Math.pow(coords.y, 1 / this.B));
  14089. if (coords.y === Infinity) {
  14090. throw new Error();
  14091. }
  14092. coords.x = -this.rB * Math.atan2(Sp * this.cosgam - Vp * this.singam, Math.cos(this.BrA * u));
  14093. }
  14094. coords.x += this.lam0;
  14095. return coords;
  14096. }
  14097. var names$10 = ["Hotine_Oblique_Mercator", "Hotine Oblique Mercator", "Hotine_Oblique_Mercator_Azimuth_Natural_Origin", "Hotine_Oblique_Mercator_Two_Point_Natural_Origin", "Hotine_Oblique_Mercator_Azimuth_Center", "Oblique_Mercator", "omerc"];
  14098. var omerc = {
  14099. init: init$9,
  14100. forward: forward$8,
  14101. inverse: inverse$8,
  14102. names: names$10
  14103. };
  14104. function init$10() {
  14105. //double lat0; /* the reference latitude */
  14106. //double long0; /* the reference longitude */
  14107. //double lat1; /* first standard parallel */
  14108. //double lat2; /* second standard parallel */
  14109. //double r_maj; /* major axis */
  14110. //double r_min; /* minor axis */
  14111. //double false_east; /* x offset in meters */
  14112. //double false_north; /* y offset in meters */
  14113. //the above value can be set with proj4.defs
  14114. //example: proj4.defs("EPSG:2154","+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs");
  14115. if (!this.lat2) {
  14116. this.lat2 = this.lat1;
  14117. } //if lat2 is not defined
  14118. if (!this.k0) {
  14119. this.k0 = 1;
  14120. }
  14121. this.x0 = this.x0 || 0;
  14122. this.y0 = this.y0 || 0;
  14123. // Standard Parallels cannot be equal and on opposite sides of the equator
  14124. if (Math.abs(this.lat1 + this.lat2) < EPSLN) {
  14125. return;
  14126. }
  14127. var temp = this.b / this.a;
  14128. this.e = Math.sqrt(1 - temp * temp);
  14129. var sin1 = Math.sin(this.lat1);
  14130. var cos1 = Math.cos(this.lat1);
  14131. var ms1 = msfnz(this.e, sin1, cos1);
  14132. var ts1 = tsfnz(this.e, this.lat1, sin1);
  14133. var sin2 = Math.sin(this.lat2);
  14134. var cos2 = Math.cos(this.lat2);
  14135. var ms2 = msfnz(this.e, sin2, cos2);
  14136. var ts2 = tsfnz(this.e, this.lat2, sin2);
  14137. var ts0 = tsfnz(this.e, this.lat0, Math.sin(this.lat0));
  14138. if (Math.abs(this.lat1 - this.lat2) > EPSLN) {
  14139. this.ns = Math.log(ms1 / ms2) / Math.log(ts1 / ts2);
  14140. } else {
  14141. this.ns = sin1;
  14142. }
  14143. if (isNaN(this.ns)) {
  14144. this.ns = sin1;
  14145. }
  14146. this.f0 = ms1 / (this.ns * Math.pow(ts1, this.ns));
  14147. this.rh = this.a * this.f0 * Math.pow(ts0, this.ns);
  14148. if (!this.title) {
  14149. this.title = "Lambert Conformal Conic";
  14150. }
  14151. }
  14152. // Lambert Conformal conic forward equations--mapping lat,long to x,y
  14153. // -----------------------------------------------------------------
  14154. function forward$9(p) {
  14155. var lon = p.x;
  14156. var lat = p.y;
  14157. // singular cases :
  14158. if (Math.abs(2 * Math.abs(lat) - Math.PI) <= EPSLN) {
  14159. lat = sign(lat) * (HALF_PI - 2 * EPSLN);
  14160. }
  14161. var con = Math.abs(Math.abs(lat) - HALF_PI);
  14162. var ts, rh1;
  14163. if (con > EPSLN) {
  14164. ts = tsfnz(this.e, lat, Math.sin(lat));
  14165. rh1 = this.a * this.f0 * Math.pow(ts, this.ns);
  14166. } else {
  14167. con = lat * this.ns;
  14168. if (con <= 0) {
  14169. return null;
  14170. }
  14171. rh1 = 0;
  14172. }
  14173. var theta = this.ns * adjust_lon(lon - this.long0);
  14174. p.x = this.k0 * (rh1 * Math.sin(theta)) + this.x0;
  14175. p.y = this.k0 * (this.rh - rh1 * Math.cos(theta)) + this.y0;
  14176. return p;
  14177. }
  14178. // Lambert Conformal Conic inverse equations--mapping x,y to lat/long
  14179. // -----------------------------------------------------------------
  14180. function inverse$9(p) {
  14181. var rh1, con, ts;
  14182. var lat, lon;
  14183. var x = (p.x - this.x0) / this.k0;
  14184. var y = this.rh - (p.y - this.y0) / this.k0;
  14185. if (this.ns > 0) {
  14186. rh1 = Math.sqrt(x * x + y * y);
  14187. con = 1;
  14188. } else {
  14189. rh1 = -Math.sqrt(x * x + y * y);
  14190. con = -1;
  14191. }
  14192. var theta = 0;
  14193. if (rh1 !== 0) {
  14194. theta = Math.atan2(con * x, con * y);
  14195. }
  14196. if (rh1 !== 0 || this.ns > 0) {
  14197. con = 1 / this.ns;
  14198. ts = Math.pow(rh1 / (this.a * this.f0), con);
  14199. lat = phi2z(this.e, ts);
  14200. if (lat === -9999) {
  14201. return null;
  14202. }
  14203. } else {
  14204. lat = -HALF_PI;
  14205. }
  14206. lon = adjust_lon(theta / this.ns + this.long0);
  14207. p.x = lon;
  14208. p.y = lat;
  14209. return p;
  14210. }
  14211. var names$11 = ["Lambert Tangential Conformal Conic Projection", "Lambert_Conformal_Conic", "Lambert_Conformal_Conic_1SP", "Lambert_Conformal_Conic_2SP", "lcc", "Lambert Conic Conformal (1SP)", "Lambert Conic Conformal (2SP)"];
  14212. var lcc = {
  14213. init: init$10,
  14214. forward: forward$9,
  14215. inverse: inverse$9,
  14216. names: names$11
  14217. };
  14218. function init$11() {
  14219. this.a = 6377397.155;
  14220. this.es = 0.006674372230614;
  14221. this.e = Math.sqrt(this.es);
  14222. if (!this.lat0) {
  14223. this.lat0 = 0.863937979737193;
  14224. }
  14225. if (!this.long0) {
  14226. this.long0 = 0.7417649320975901 - 0.308341501185665;
  14227. }
  14228. /* if scale not set default to 0.9999 */
  14229. if (!this.k0) {
  14230. this.k0 = 0.9999;
  14231. }
  14232. this.s45 = 0.785398163397448; /* 45 */
  14233. this.s90 = 2 * this.s45;
  14234. this.fi0 = this.lat0;
  14235. this.e2 = this.es;
  14236. this.e = Math.sqrt(this.e2);
  14237. this.alfa = Math.sqrt(1 + this.e2 * Math.pow(Math.cos(this.fi0), 4) / (1 - this.e2));
  14238. this.uq = 1.04216856380474;
  14239. this.u0 = Math.asin(Math.sin(this.fi0) / this.alfa);
  14240. this.g = Math.pow((1 + this.e * Math.sin(this.fi0)) / (1 - this.e * Math.sin(this.fi0)), this.alfa * this.e / 2);
  14241. this.k = Math.tan(this.u0 / 2 + this.s45) / Math.pow(Math.tan(this.fi0 / 2 + this.s45), this.alfa) * this.g;
  14242. this.k1 = this.k0;
  14243. this.n0 = this.a * Math.sqrt(1 - this.e2) / (1 - this.e2 * Math.pow(Math.sin(this.fi0), 2));
  14244. this.s0 = 1.37008346281555;
  14245. this.n = Math.sin(this.s0);
  14246. this.ro0 = this.k1 * this.n0 / Math.tan(this.s0);
  14247. this.ad = this.s90 - this.uq;
  14248. }
  14249. /* ellipsoid */
  14250. /* calculate xy from lat/lon */
  14251. /* Constants, identical to inverse transform function */
  14252. function forward$10(p) {
  14253. var gfi, u, deltav, s, d, eps, ro;
  14254. var lon = p.x;
  14255. var lat = p.y;
  14256. var delta_lon = adjust_lon(lon - this.long0);
  14257. /* Transformation */
  14258. gfi = Math.pow((1 + this.e * Math.sin(lat)) / (1 - this.e * Math.sin(lat)), this.alfa * this.e / 2);
  14259. u = 2 * (Math.atan(this.k * Math.pow(Math.tan(lat / 2 + this.s45), this.alfa) / gfi) - this.s45);
  14260. deltav = -delta_lon * this.alfa;
  14261. s = Math.asin(Math.cos(this.ad) * Math.sin(u) + Math.sin(this.ad) * Math.cos(u) * Math.cos(deltav));
  14262. d = Math.asin(Math.cos(u) * Math.sin(deltav) / Math.cos(s));
  14263. eps = this.n * d;
  14264. ro = this.ro0 * Math.pow(Math.tan(this.s0 / 2 + this.s45), this.n) / Math.pow(Math.tan(s / 2 + this.s45), this.n);
  14265. p.y = ro * Math.cos(eps) / 1;
  14266. p.x = ro * Math.sin(eps) / 1;
  14267. if (!this.czech) {
  14268. p.y *= -1;
  14269. p.x *= -1;
  14270. }
  14271. return p;
  14272. }
  14273. /* calculate lat/lon from xy */
  14274. function inverse$10(p) {
  14275. var u, deltav, s, d, eps, ro, fi1;
  14276. var ok;
  14277. /* Transformation */
  14278. /* revert y, x*/
  14279. var tmp = p.x;
  14280. p.x = p.y;
  14281. p.y = tmp;
  14282. if (!this.czech) {
  14283. p.y *= -1;
  14284. p.x *= -1;
  14285. }
  14286. ro = Math.sqrt(p.x * p.x + p.y * p.y);
  14287. eps = Math.atan2(p.y, p.x);
  14288. d = eps / Math.sin(this.s0);
  14289. s = 2 * (Math.atan(Math.pow(this.ro0 / ro, 1 / this.n) * Math.tan(this.s0 / 2 + this.s45)) - this.s45);
  14290. u = Math.asin(Math.cos(this.ad) * Math.sin(s) - Math.sin(this.ad) * Math.cos(s) * Math.cos(d));
  14291. deltav = Math.asin(Math.cos(s) * Math.sin(d) / Math.cos(u));
  14292. p.x = this.long0 - deltav / this.alfa;
  14293. fi1 = u;
  14294. ok = 0;
  14295. var iter = 0;
  14296. do {
  14297. p.y = 2 * (Math.atan(Math.pow(this.k, -1 / this.alfa) * Math.pow(Math.tan(u / 2 + this.s45), 1 / this.alfa) * Math.pow((1 + this.e * Math.sin(fi1)) / (1 - this.e * Math.sin(fi1)), this.e / 2)) - this.s45);
  14298. if (Math.abs(fi1 - p.y) < 0.0000000001) {
  14299. ok = 1;
  14300. }
  14301. fi1 = p.y;
  14302. iter += 1;
  14303. } while (ok === 0 && iter < 15);
  14304. if (iter >= 15) {
  14305. return null;
  14306. }
  14307. return p;
  14308. }
  14309. var names$12 = ["Krovak", "krovak"];
  14310. var krovak = {
  14311. init: init$11,
  14312. forward: forward$10,
  14313. inverse: inverse$10,
  14314. names: names$12
  14315. };
  14316. var mlfn = function mlfn(e0, e1, e2, e3, phi) {
  14317. return e0 * phi - e1 * Math.sin(2 * phi) + e2 * Math.sin(4 * phi) - e3 * Math.sin(6 * phi);
  14318. };
  14319. var e0fn = function e0fn(x) {
  14320. return 1 - 0.25 * x * (1 + x / 16 * (3 + 1.25 * x));
  14321. };
  14322. var e1fn = function e1fn(x) {
  14323. return 0.375 * x * (1 + 0.25 * x * (1 + 0.46875 * x));
  14324. };
  14325. var e2fn = function e2fn(x) {
  14326. return 0.05859375 * x * x * (1 + 0.75 * x);
  14327. };
  14328. var e3fn = function e3fn(x) {
  14329. return x * x * x * (35 / 3072);
  14330. };
  14331. var gN = function gN(a, e, sinphi) {
  14332. var temp = e * sinphi;
  14333. return a / Math.sqrt(1 - temp * temp);
  14334. };
  14335. var adjust_lat = function adjust_lat(x) {
  14336. return Math.abs(x) < HALF_PI ? x : x - sign(x) * Math.PI;
  14337. };
  14338. var imlfn = function imlfn(ml, e0, e1, e2, e3) {
  14339. var phi;
  14340. var dphi;
  14341. phi = ml / e0;
  14342. for (var i = 0; i < 15; i++) {
  14343. dphi = (ml - (e0 * phi - e1 * Math.sin(2 * phi) + e2 * Math.sin(4 * phi) - e3 * Math.sin(6 * phi))) / (e0 - 2 * e1 * Math.cos(2 * phi) + 4 * e2 * Math.cos(4 * phi) - 6 * e3 * Math.cos(6 * phi));
  14344. phi += dphi;
  14345. if (Math.abs(dphi) <= 0.0000000001) {
  14346. return phi;
  14347. }
  14348. }
  14349. //..reportError("IMLFN-CONV:Latitude failed to converge after 15 iterations");
  14350. return NaN;
  14351. };
  14352. function init$12() {
  14353. if (!this.sphere) {
  14354. this.e0 = e0fn(this.es);
  14355. this.e1 = e1fn(this.es);
  14356. this.e2 = e2fn(this.es);
  14357. this.e3 = e3fn(this.es);
  14358. this.ml0 = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, this.lat0);
  14359. }
  14360. }
  14361. /* Cassini forward equations--mapping lat,long to x,y
  14362. -----------------------------------------------------------------------*/
  14363. function forward$11(p) {
  14364. /* Forward equations
  14365. -----------------*/
  14366. var x, y;
  14367. var lam = p.x;
  14368. var phi = p.y;
  14369. lam = adjust_lon(lam - this.long0);
  14370. if (this.sphere) {
  14371. x = this.a * Math.asin(Math.cos(phi) * Math.sin(lam));
  14372. y = this.a * (Math.atan2(Math.tan(phi), Math.cos(lam)) - this.lat0);
  14373. } else {
  14374. //ellipsoid
  14375. var sinphi = Math.sin(phi);
  14376. var cosphi = Math.cos(phi);
  14377. var nl = gN(this.a, this.e, sinphi);
  14378. var tl = Math.tan(phi) * Math.tan(phi);
  14379. var al = lam * Math.cos(phi);
  14380. var asq = al * al;
  14381. var cl = this.es * cosphi * cosphi / (1 - this.es);
  14382. var ml = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, phi);
  14383. x = nl * al * (1 - asq * tl * (1 / 6 - (8 - tl + 8 * cl) * asq / 120));
  14384. y = ml - this.ml0 + nl * sinphi / cosphi * asq * (0.5 + (5 - tl + 6 * cl) * asq / 24);
  14385. }
  14386. p.x = x + this.x0;
  14387. p.y = y + this.y0;
  14388. return p;
  14389. }
  14390. /* Inverse equations
  14391. -----------------*/
  14392. function inverse$11(p) {
  14393. p.x -= this.x0;
  14394. p.y -= this.y0;
  14395. var x = p.x / this.a;
  14396. var y = p.y / this.a;
  14397. var phi, lam;
  14398. if (this.sphere) {
  14399. var dd = y + this.lat0;
  14400. phi = Math.asin(Math.sin(dd) * Math.cos(x));
  14401. lam = Math.atan2(Math.tan(x), Math.cos(dd));
  14402. } else {
  14403. /* ellipsoid */
  14404. var ml1 = this.ml0 / this.a + y;
  14405. var phi1 = imlfn(ml1, this.e0, this.e1, this.e2, this.e3);
  14406. if (Math.abs(Math.abs(phi1) - HALF_PI) <= EPSLN) {
  14407. p.x = this.long0;
  14408. p.y = HALF_PI;
  14409. if (y < 0) {
  14410. p.y *= -1;
  14411. }
  14412. return p;
  14413. }
  14414. var nl1 = gN(this.a, this.e, Math.sin(phi1));
  14415. var rl1 = nl1 * nl1 * nl1 / this.a / this.a * (1 - this.es);
  14416. var tl1 = Math.pow(Math.tan(phi1), 2);
  14417. var dl = x * this.a / nl1;
  14418. var dsq = dl * dl;
  14419. phi = phi1 - nl1 * Math.tan(phi1) / rl1 * dl * dl * (0.5 - (1 + 3 * tl1) * dl * dl / 24);
  14420. lam = dl * (1 - dsq * (tl1 / 3 + (1 + 3 * tl1) * tl1 * dsq / 15)) / Math.cos(phi1);
  14421. }
  14422. p.x = adjust_lon(lam + this.long0);
  14423. p.y = adjust_lat(phi);
  14424. return p;
  14425. }
  14426. var names$13 = ["Cassini", "Cassini_Soldner", "cass"];
  14427. var cass = {
  14428. init: init$12,
  14429. forward: forward$11,
  14430. inverse: inverse$11,
  14431. names: names$13
  14432. };
  14433. var qsfnz = function qsfnz(eccent, sinphi) {
  14434. var con;
  14435. if (eccent > 1.0e-7) {
  14436. con = eccent * sinphi;
  14437. return (1 - eccent * eccent) * (sinphi / (1 - con * con) - 0.5 / eccent * Math.log((1 - con) / (1 + con)));
  14438. } else {
  14439. return 2 * sinphi;
  14440. }
  14441. };
  14442. /*
  14443. reference
  14444. "New Equal-Area Map Projections for Noncircular Regions", John P. Snyder,
  14445. The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355.
  14446. */
  14447. var S_POLE = 1;
  14448. var N_POLE = 2;
  14449. var EQUIT = 3;
  14450. var OBLIQ = 4;
  14451. /* Initialize the Lambert Azimuthal Equal Area projection
  14452. ------------------------------------------------------*/
  14453. function init$13() {
  14454. var t = Math.abs(this.lat0);
  14455. if (Math.abs(t - HALF_PI) < EPSLN) {
  14456. this.mode = this.lat0 < 0 ? this.S_POLE : this.N_POLE;
  14457. } else if (Math.abs(t) < EPSLN) {
  14458. this.mode = this.EQUIT;
  14459. } else {
  14460. this.mode = this.OBLIQ;
  14461. }
  14462. if (this.es > 0) {
  14463. var sinphi;
  14464. this.qp = qsfnz(this.e, 1);
  14465. this.mmf = 0.5 / (1 - this.es);
  14466. this.apa = authset(this.es);
  14467. switch (this.mode) {
  14468. case this.N_POLE:
  14469. this.dd = 1;
  14470. break;
  14471. case this.S_POLE:
  14472. this.dd = 1;
  14473. break;
  14474. case this.EQUIT:
  14475. this.rq = Math.sqrt(0.5 * this.qp);
  14476. this.dd = 1 / this.rq;
  14477. this.xmf = 1;
  14478. this.ymf = 0.5 * this.qp;
  14479. break;
  14480. case this.OBLIQ:
  14481. this.rq = Math.sqrt(0.5 * this.qp);
  14482. sinphi = Math.sin(this.lat0);
  14483. this.sinb1 = qsfnz(this.e, sinphi) / this.qp;
  14484. this.cosb1 = Math.sqrt(1 - this.sinb1 * this.sinb1);
  14485. this.dd = Math.cos(this.lat0) / (Math.sqrt(1 - this.es * sinphi * sinphi) * this.rq * this.cosb1);
  14486. this.ymf = (this.xmf = this.rq) / this.dd;
  14487. this.xmf *= this.dd;
  14488. break;
  14489. }
  14490. } else {
  14491. if (this.mode === this.OBLIQ) {
  14492. this.sinph0 = Math.sin(this.lat0);
  14493. this.cosph0 = Math.cos(this.lat0);
  14494. }
  14495. }
  14496. }
  14497. /* Lambert Azimuthal Equal Area forward equations--mapping lat,long to x,y
  14498. -----------------------------------------------------------------------*/
  14499. function forward$12(p) {
  14500. /* Forward equations
  14501. -----------------*/
  14502. var x, y, coslam, sinlam, sinphi, q, sinb, cosb, b, cosphi;
  14503. var lam = p.x;
  14504. var phi = p.y;
  14505. lam = adjust_lon(lam - this.long0);
  14506. if (this.sphere) {
  14507. sinphi = Math.sin(phi);
  14508. cosphi = Math.cos(phi);
  14509. coslam = Math.cos(lam);
  14510. if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {
  14511. y = this.mode === this.EQUIT ? 1 + cosphi * coslam : 1 + this.sinph0 * sinphi + this.cosph0 * cosphi * coslam;
  14512. if (y <= EPSLN) {
  14513. return null;
  14514. }
  14515. y = Math.sqrt(2 / y);
  14516. x = y * cosphi * Math.sin(lam);
  14517. y *= this.mode === this.EQUIT ? sinphi : this.cosph0 * sinphi - this.sinph0 * cosphi * coslam;
  14518. } else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {
  14519. if (this.mode === this.N_POLE) {
  14520. coslam = -coslam;
  14521. }
  14522. if (Math.abs(phi + this.lat0) < EPSLN) {
  14523. return null;
  14524. }
  14525. y = FORTPI - phi * 0.5;
  14526. y = 2 * (this.mode === this.S_POLE ? Math.cos(y) : Math.sin(y));
  14527. x = y * Math.sin(lam);
  14528. y *= coslam;
  14529. }
  14530. } else {
  14531. sinb = 0;
  14532. cosb = 0;
  14533. b = 0;
  14534. coslam = Math.cos(lam);
  14535. sinlam = Math.sin(lam);
  14536. sinphi = Math.sin(phi);
  14537. q = qsfnz(this.e, sinphi);
  14538. if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {
  14539. sinb = q / this.qp;
  14540. cosb = Math.sqrt(1 - sinb * sinb);
  14541. }
  14542. switch (this.mode) {
  14543. case this.OBLIQ:
  14544. b = 1 + this.sinb1 * sinb + this.cosb1 * cosb * coslam;
  14545. break;
  14546. case this.EQUIT:
  14547. b = 1 + cosb * coslam;
  14548. break;
  14549. case this.N_POLE:
  14550. b = HALF_PI + phi;
  14551. q = this.qp - q;
  14552. break;
  14553. case this.S_POLE:
  14554. b = phi - HALF_PI;
  14555. q = this.qp + q;
  14556. break;
  14557. }
  14558. if (Math.abs(b) < EPSLN) {
  14559. return null;
  14560. }
  14561. switch (this.mode) {
  14562. case this.OBLIQ:
  14563. case this.EQUIT:
  14564. b = Math.sqrt(2 / b);
  14565. if (this.mode === this.OBLIQ) {
  14566. y = this.ymf * b * (this.cosb1 * sinb - this.sinb1 * cosb * coslam);
  14567. } else {
  14568. y = (b = Math.sqrt(2 / (1 + cosb * coslam))) * sinb * this.ymf;
  14569. }
  14570. x = this.xmf * b * cosb * sinlam;
  14571. break;
  14572. case this.N_POLE:
  14573. case this.S_POLE:
  14574. if (q >= 0) {
  14575. x = (b = Math.sqrt(q)) * sinlam;
  14576. y = coslam * (this.mode === this.S_POLE ? b : -b);
  14577. } else {
  14578. x = y = 0;
  14579. }
  14580. break;
  14581. }
  14582. }
  14583. p.x = this.a * x + this.x0;
  14584. p.y = this.a * y + this.y0;
  14585. return p;
  14586. }
  14587. /* Inverse equations
  14588. -----------------*/
  14589. function inverse$12(p) {
  14590. p.x -= this.x0;
  14591. p.y -= this.y0;
  14592. var x = p.x / this.a;
  14593. var y = p.y / this.a;
  14594. var lam, phi, cCe, sCe, q, rho, ab;
  14595. if (this.sphere) {
  14596. var cosz = 0,
  14597. rh,
  14598. sinz = 0;
  14599. rh = Math.sqrt(x * x + y * y);
  14600. phi = rh * 0.5;
  14601. if (phi > 1) {
  14602. return null;
  14603. }
  14604. phi = 2 * Math.asin(phi);
  14605. if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {
  14606. sinz = Math.sin(phi);
  14607. cosz = Math.cos(phi);
  14608. }
  14609. switch (this.mode) {
  14610. case this.EQUIT:
  14611. phi = Math.abs(rh) <= EPSLN ? 0 : Math.asin(y * sinz / rh);
  14612. x *= sinz;
  14613. y = cosz * rh;
  14614. break;
  14615. case this.OBLIQ:
  14616. phi = Math.abs(rh) <= EPSLN ? this.lat0 : Math.asin(cosz * this.sinph0 + y * sinz * this.cosph0 / rh);
  14617. x *= sinz * this.cosph0;
  14618. y = (cosz - Math.sin(phi) * this.sinph0) * rh;
  14619. break;
  14620. case this.N_POLE:
  14621. y = -y;
  14622. phi = HALF_PI - phi;
  14623. break;
  14624. case this.S_POLE:
  14625. phi -= HALF_PI;
  14626. break;
  14627. }
  14628. lam = y === 0 && (this.mode === this.EQUIT || this.mode === this.OBLIQ) ? 0 : Math.atan2(x, y);
  14629. } else {
  14630. ab = 0;
  14631. if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {
  14632. x /= this.dd;
  14633. y *= this.dd;
  14634. rho = Math.sqrt(x * x + y * y);
  14635. if (rho < EPSLN) {
  14636. p.x = this.long0;
  14637. p.y = this.lat0;
  14638. return p;
  14639. }
  14640. sCe = 2 * Math.asin(0.5 * rho / this.rq);
  14641. cCe = Math.cos(sCe);
  14642. x *= sCe = Math.sin(sCe);
  14643. if (this.mode === this.OBLIQ) {
  14644. ab = cCe * this.sinb1 + y * sCe * this.cosb1 / rho;
  14645. q = this.qp * ab;
  14646. y = rho * this.cosb1 * cCe - y * this.sinb1 * sCe;
  14647. } else {
  14648. ab = y * sCe / rho;
  14649. q = this.qp * ab;
  14650. y = rho * cCe;
  14651. }
  14652. } else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {
  14653. if (this.mode === this.N_POLE) {
  14654. y = -y;
  14655. }
  14656. q = x * x + y * y;
  14657. if (!q) {
  14658. p.x = this.long0;
  14659. p.y = this.lat0;
  14660. return p;
  14661. }
  14662. ab = 1 - q / this.qp;
  14663. if (this.mode === this.S_POLE) {
  14664. ab = -ab;
  14665. }
  14666. }
  14667. lam = Math.atan2(x, y);
  14668. phi = authlat(Math.asin(ab), this.apa);
  14669. }
  14670. p.x = adjust_lon(this.long0 + lam);
  14671. p.y = phi;
  14672. return p;
  14673. }
  14674. /* determine latitude from authalic latitude */
  14675. var P00 = 0.33333333333333333333;
  14676. var P01 = 0.17222222222222222222;
  14677. var P02 = 0.10257936507936507936;
  14678. var P10 = 0.06388888888888888888;
  14679. var P11 = 0.06640211640211640211;
  14680. var P20 = 0.01641501294219154443;
  14681. function authset(es) {
  14682. var t;
  14683. var APA = [];
  14684. APA[0] = es * P00;
  14685. t = es * es;
  14686. APA[0] += t * P01;
  14687. APA[1] = t * P10;
  14688. t *= es;
  14689. APA[0] += t * P02;
  14690. APA[1] += t * P11;
  14691. APA[2] = t * P20;
  14692. return APA;
  14693. }
  14694. function authlat(beta, APA) {
  14695. var t = beta + beta;
  14696. return beta + APA[0] * Math.sin(t) + APA[1] * Math.sin(t + t) + APA[2] * Math.sin(t + t + t);
  14697. }
  14698. var names$14 = ["Lambert Azimuthal Equal Area", "Lambert_Azimuthal_Equal_Area", "laea"];
  14699. var laea = {
  14700. init: init$13,
  14701. forward: forward$12,
  14702. inverse: inverse$12,
  14703. names: names$14,
  14704. S_POLE: S_POLE,
  14705. N_POLE: N_POLE,
  14706. EQUIT: EQUIT,
  14707. OBLIQ: OBLIQ
  14708. };
  14709. var asinz = function asinz(x) {
  14710. if (Math.abs(x) > 1) {
  14711. x = x > 1 ? 1 : -1;
  14712. }
  14713. return Math.asin(x);
  14714. };
  14715. function init$14() {
  14716. if (Math.abs(this.lat1 + this.lat2) < EPSLN) {
  14717. return;
  14718. }
  14719. this.temp = this.b / this.a;
  14720. this.es = 1 - Math.pow(this.temp, 2);
  14721. this.e3 = Math.sqrt(this.es);
  14722. this.sin_po = Math.sin(this.lat1);
  14723. this.cos_po = Math.cos(this.lat1);
  14724. this.t1 = this.sin_po;
  14725. this.con = this.sin_po;
  14726. this.ms1 = msfnz(this.e3, this.sin_po, this.cos_po);
  14727. this.qs1 = qsfnz(this.e3, this.sin_po);
  14728. this.sin_po = Math.sin(this.lat2);
  14729. this.cos_po = Math.cos(this.lat2);
  14730. this.t2 = this.sin_po;
  14731. this.ms2 = msfnz(this.e3, this.sin_po, this.cos_po);
  14732. this.qs2 = qsfnz(this.e3, this.sin_po);
  14733. this.sin_po = Math.sin(this.lat0);
  14734. this.cos_po = Math.cos(this.lat0);
  14735. this.t3 = this.sin_po;
  14736. this.qs0 = qsfnz(this.e3, this.sin_po);
  14737. if (Math.abs(this.lat1 - this.lat2) > EPSLN) {
  14738. this.ns0 = (this.ms1 * this.ms1 - this.ms2 * this.ms2) / (this.qs2 - this.qs1);
  14739. } else {
  14740. this.ns0 = this.con;
  14741. }
  14742. this.c = this.ms1 * this.ms1 + this.ns0 * this.qs1;
  14743. this.rh = this.a * Math.sqrt(this.c - this.ns0 * this.qs0) / this.ns0;
  14744. }
  14745. /* Albers Conical Equal Area forward equations--mapping lat,long to x,y
  14746. -------------------------------------------------------------------*/
  14747. function forward$13(p) {
  14748. var lon = p.x;
  14749. var lat = p.y;
  14750. this.sin_phi = Math.sin(lat);
  14751. this.cos_phi = Math.cos(lat);
  14752. var qs = qsfnz(this.e3, this.sin_phi);
  14753. var rh1 = this.a * Math.sqrt(this.c - this.ns0 * qs) / this.ns0;
  14754. var theta = this.ns0 * adjust_lon(lon - this.long0);
  14755. var x = rh1 * Math.sin(theta) + this.x0;
  14756. var y = this.rh - rh1 * Math.cos(theta) + this.y0;
  14757. p.x = x;
  14758. p.y = y;
  14759. return p;
  14760. }
  14761. function inverse$13(p) {
  14762. var rh1, qs, con, theta, lon, lat;
  14763. p.x -= this.x0;
  14764. p.y = this.rh - p.y + this.y0;
  14765. if (this.ns0 >= 0) {
  14766. rh1 = Math.sqrt(p.x * p.x + p.y * p.y);
  14767. con = 1;
  14768. } else {
  14769. rh1 = -Math.sqrt(p.x * p.x + p.y * p.y);
  14770. con = -1;
  14771. }
  14772. theta = 0;
  14773. if (rh1 !== 0) {
  14774. theta = Math.atan2(con * p.x, con * p.y);
  14775. }
  14776. con = rh1 * this.ns0 / this.a;
  14777. if (this.sphere) {
  14778. lat = Math.asin((this.c - con * con) / (2 * this.ns0));
  14779. } else {
  14780. qs = (this.c - con * con) / this.ns0;
  14781. lat = this.phi1z(this.e3, qs);
  14782. }
  14783. lon = adjust_lon(theta / this.ns0 + this.long0);
  14784. p.x = lon;
  14785. p.y = lat;
  14786. return p;
  14787. }
  14788. /* Function to compute phi1, the latitude for the inverse of the
  14789. Albers Conical Equal-Area projection.
  14790. -------------------------------------------*/
  14791. function phi1z(eccent, qs) {
  14792. var sinphi, cosphi, con, com, dphi;
  14793. var phi = asinz(0.5 * qs);
  14794. if (eccent < EPSLN) {
  14795. return phi;
  14796. }
  14797. var eccnts = eccent * eccent;
  14798. for (var i = 1; i <= 25; i++) {
  14799. sinphi = Math.sin(phi);
  14800. cosphi = Math.cos(phi);
  14801. con = eccent * sinphi;
  14802. com = 1 - con * con;
  14803. dphi = 0.5 * com * com / cosphi * (qs / (1 - eccnts) - sinphi / com + 0.5 / eccent * Math.log((1 - con) / (1 + con)));
  14804. phi = phi + dphi;
  14805. if (Math.abs(dphi) <= 1e-7) {
  14806. return phi;
  14807. }
  14808. }
  14809. return null;
  14810. }
  14811. var names$15 = ["Albers_Conic_Equal_Area", "Albers", "aea"];
  14812. var aea = {
  14813. init: init$14,
  14814. forward: forward$13,
  14815. inverse: inverse$13,
  14816. names: names$15,
  14817. phi1z: phi1z
  14818. };
  14819. /*
  14820. reference:
  14821. Wolfram Mathworld "Gnomonic Projection"
  14822. http://mathworld.wolfram.com/GnomonicProjection.html
  14823. Accessed: 12th November 2009
  14824. */
  14825. function init$15() {
  14826. /* Place parameters in static storage for common use
  14827. -------------------------------------------------*/
  14828. this.sin_p14 = Math.sin(this.lat0);
  14829. this.cos_p14 = Math.cos(this.lat0);
  14830. // Approximation for projecting points to the horizon (infinity)
  14831. this.infinity_dist = 1000 * this.a;
  14832. this.rc = 1;
  14833. }
  14834. /* Gnomonic forward equations--mapping lat,long to x,y
  14835. ---------------------------------------------------*/
  14836. function forward$14(p) {
  14837. var sinphi, cosphi; /* sin and cos value */
  14838. var dlon; /* delta longitude value */
  14839. var coslon; /* cos of longitude */
  14840. var ksp; /* scale factor */
  14841. var g;
  14842. var x, y;
  14843. var lon = p.x;
  14844. var lat = p.y;
  14845. /* Forward equations
  14846. -----------------*/
  14847. dlon = adjust_lon(lon - this.long0);
  14848. sinphi = Math.sin(lat);
  14849. cosphi = Math.cos(lat);
  14850. coslon = Math.cos(dlon);
  14851. g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon;
  14852. ksp = 1;
  14853. if (g > 0 || Math.abs(g) <= EPSLN) {
  14854. x = this.x0 + this.a * ksp * cosphi * Math.sin(dlon) / g;
  14855. y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon) / g;
  14856. } else {
  14857. // Point is in the opposing hemisphere and is unprojectable
  14858. // We still need to return a reasonable point, so we project
  14859. // to infinity, on a bearing
  14860. // equivalent to the northern hemisphere equivalent
  14861. // This is a reasonable approximation for short shapes and lines that
  14862. // straddle the horizon.
  14863. x = this.x0 + this.infinity_dist * cosphi * Math.sin(dlon);
  14864. y = this.y0 + this.infinity_dist * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);
  14865. }
  14866. p.x = x;
  14867. p.y = y;
  14868. return p;
  14869. }
  14870. function inverse$14(p) {
  14871. var rh; /* Rho */
  14872. var sinc, cosc;
  14873. var c;
  14874. var lon, lat;
  14875. /* Inverse equations
  14876. -----------------*/
  14877. p.x = (p.x - this.x0) / this.a;
  14878. p.y = (p.y - this.y0) / this.a;
  14879. p.x /= this.k0;
  14880. p.y /= this.k0;
  14881. if (rh = Math.sqrt(p.x * p.x + p.y * p.y)) {
  14882. c = Math.atan2(rh, this.rc);
  14883. sinc = Math.sin(c);
  14884. cosc = Math.cos(c);
  14885. lat = asinz(cosc * this.sin_p14 + p.y * sinc * this.cos_p14 / rh);
  14886. lon = Math.atan2(p.x * sinc, rh * this.cos_p14 * cosc - p.y * this.sin_p14 * sinc);
  14887. lon = adjust_lon(this.long0 + lon);
  14888. } else {
  14889. lat = this.phic0;
  14890. lon = 0;
  14891. }
  14892. p.x = lon;
  14893. p.y = lat;
  14894. return p;
  14895. }
  14896. var names$16 = ["gnom"];
  14897. var gnom = {
  14898. init: init$15,
  14899. forward: forward$14,
  14900. inverse: inverse$14,
  14901. names: names$16
  14902. };
  14903. var iqsfnz = function iqsfnz(eccent, q) {
  14904. var temp = 1 - (1 - eccent * eccent) / (2 * eccent) * Math.log((1 - eccent) / (1 + eccent));
  14905. if (Math.abs(Math.abs(q) - temp) < 1.0E-6) {
  14906. if (q < 0) {
  14907. return -1 * HALF_PI;
  14908. } else {
  14909. return HALF_PI;
  14910. }
  14911. }
  14912. //var phi = 0.5* q/(1-eccent*eccent);
  14913. var phi = Math.asin(0.5 * q);
  14914. var dphi;
  14915. var sin_phi;
  14916. var cos_phi;
  14917. var con;
  14918. for (var i = 0; i < 30; i++) {
  14919. sin_phi = Math.sin(phi);
  14920. cos_phi = Math.cos(phi);
  14921. con = eccent * sin_phi;
  14922. dphi = Math.pow(1 - con * con, 2) / (2 * cos_phi) * (q / (1 - eccent * eccent) - sin_phi / (1 - con * con) + 0.5 / eccent * Math.log((1 - con) / (1 + con)));
  14923. phi += dphi;
  14924. if (Math.abs(dphi) <= 0.0000000001) {
  14925. return phi;
  14926. }
  14927. }
  14928. //console.log("IQSFN-CONV:Latitude failed to converge after 30 iterations");
  14929. return NaN;
  14930. };
  14931. /*
  14932. reference:
  14933. "Cartographic Projection Procedures for the UNIX Environment-
  14934. A User's Manual" by Gerald I. Evenden,
  14935. USGS Open File Report 90-284and Release 4 Interim Reports (2003)
  14936. */
  14937. function init$16() {
  14938. //no-op
  14939. if (!this.sphere) {
  14940. this.k0 = msfnz(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));
  14941. }
  14942. }
  14943. /* Cylindrical Equal Area forward equations--mapping lat,long to x,y
  14944. ------------------------------------------------------------*/
  14945. function forward$15(p) {
  14946. var lon = p.x;
  14947. var lat = p.y;
  14948. var x, y;
  14949. /* Forward equations
  14950. -----------------*/
  14951. var dlon = adjust_lon(lon - this.long0);
  14952. if (this.sphere) {
  14953. x = this.x0 + this.a * dlon * Math.cos(this.lat_ts);
  14954. y = this.y0 + this.a * Math.sin(lat) / Math.cos(this.lat_ts);
  14955. } else {
  14956. var qs = qsfnz(this.e, Math.sin(lat));
  14957. x = this.x0 + this.a * this.k0 * dlon;
  14958. y = this.y0 + this.a * qs * 0.5 / this.k0;
  14959. }
  14960. p.x = x;
  14961. p.y = y;
  14962. return p;
  14963. }
  14964. /* Cylindrical Equal Area inverse equations--mapping x,y to lat/long
  14965. ------------------------------------------------------------*/
  14966. function inverse$15(p) {
  14967. p.x -= this.x0;
  14968. p.y -= this.y0;
  14969. var lon, lat;
  14970. if (this.sphere) {
  14971. lon = adjust_lon(this.long0 + p.x / this.a / Math.cos(this.lat_ts));
  14972. lat = Math.asin(p.y / this.a * Math.cos(this.lat_ts));
  14973. } else {
  14974. lat = iqsfnz(this.e, 2 * p.y * this.k0 / this.a);
  14975. lon = adjust_lon(this.long0 + p.x / (this.a * this.k0));
  14976. }
  14977. p.x = lon;
  14978. p.y = lat;
  14979. return p;
  14980. }
  14981. var names$17 = ["cea"];
  14982. var cea = {
  14983. init: init$16,
  14984. forward: forward$15,
  14985. inverse: inverse$15,
  14986. names: names$17
  14987. };
  14988. function init$17() {
  14989. this.x0 = this.x0 || 0;
  14990. this.y0 = this.y0 || 0;
  14991. this.lat0 = this.lat0 || 0;
  14992. this.long0 = this.long0 || 0;
  14993. this.lat_ts = this.lat_ts || 0;
  14994. this.title = this.title || "Equidistant Cylindrical (Plate Carre)";
  14995. this.rc = Math.cos(this.lat_ts);
  14996. }
  14997. // forward equations--mapping lat,long to x,y
  14998. // -----------------------------------------------------------------
  14999. function forward$16(p) {
  15000. var lon = p.x;
  15001. var lat = p.y;
  15002. var dlon = adjust_lon(lon - this.long0);
  15003. var dlat = adjust_lat(lat - this.lat0);
  15004. p.x = this.x0 + this.a * dlon * this.rc;
  15005. p.y = this.y0 + this.a * dlat;
  15006. return p;
  15007. }
  15008. // inverse equations--mapping x,y to lat/long
  15009. // -----------------------------------------------------------------
  15010. function inverse$16(p) {
  15011. var x = p.x;
  15012. var y = p.y;
  15013. p.x = adjust_lon(this.long0 + (x - this.x0) / (this.a * this.rc));
  15014. p.y = adjust_lat(this.lat0 + (y - this.y0) / this.a);
  15015. return p;
  15016. }
  15017. var names$18 = ["Equirectangular", "Equidistant_Cylindrical", "eqc"];
  15018. var eqc = {
  15019. init: init$17,
  15020. forward: forward$16,
  15021. inverse: inverse$16,
  15022. names: names$18
  15023. };
  15024. var MAX_ITER$2 = 20;
  15025. function init$18() {
  15026. /* Place parameters in static storage for common use
  15027. -------------------------------------------------*/
  15028. this.temp = this.b / this.a;
  15029. this.es = 1 - Math.pow(this.temp, 2); // devait etre dans tmerc.js mais n y est pas donc je commente sinon retour de valeurs nulles
  15030. this.e = Math.sqrt(this.es);
  15031. this.e0 = e0fn(this.es);
  15032. this.e1 = e1fn(this.es);
  15033. this.e2 = e2fn(this.es);
  15034. this.e3 = e3fn(this.es);
  15035. this.ml0 = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, this.lat0); //si que des zeros le calcul ne se fait pas
  15036. }
  15037. /* Polyconic forward equations--mapping lat,long to x,y
  15038. ---------------------------------------------------*/
  15039. function forward$17(p) {
  15040. var lon = p.x;
  15041. var lat = p.y;
  15042. var x, y, el;
  15043. var dlon = adjust_lon(lon - this.long0);
  15044. el = dlon * Math.sin(lat);
  15045. if (this.sphere) {
  15046. if (Math.abs(lat) <= EPSLN) {
  15047. x = this.a * dlon;
  15048. y = -1 * this.a * this.lat0;
  15049. } else {
  15050. x = this.a * Math.sin(el) / Math.tan(lat);
  15051. y = this.a * (adjust_lat(lat - this.lat0) + (1 - Math.cos(el)) / Math.tan(lat));
  15052. }
  15053. } else {
  15054. if (Math.abs(lat) <= EPSLN) {
  15055. x = this.a * dlon;
  15056. y = -1 * this.ml0;
  15057. } else {
  15058. var nl = gN(this.a, this.e, Math.sin(lat)) / Math.tan(lat);
  15059. x = nl * Math.sin(el);
  15060. y = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, lat) - this.ml0 + nl * (1 - Math.cos(el));
  15061. }
  15062. }
  15063. p.x = x + this.x0;
  15064. p.y = y + this.y0;
  15065. return p;
  15066. }
  15067. /* Inverse equations
  15068. -----------------*/
  15069. function inverse$17(p) {
  15070. var lon, lat, x, y, i;
  15071. var al, bl;
  15072. var phi, dphi;
  15073. x = p.x - this.x0;
  15074. y = p.y - this.y0;
  15075. if (this.sphere) {
  15076. if (Math.abs(y + this.a * this.lat0) <= EPSLN) {
  15077. lon = adjust_lon(x / this.a + this.long0);
  15078. lat = 0;
  15079. } else {
  15080. al = this.lat0 + y / this.a;
  15081. bl = x * x / this.a / this.a + al * al;
  15082. phi = al;
  15083. var tanphi;
  15084. for (i = MAX_ITER$2; i; --i) {
  15085. tanphi = Math.tan(phi);
  15086. dphi = -1 * (al * (phi * tanphi + 1) - phi - 0.5 * (phi * phi + bl) * tanphi) / ((phi - al) / tanphi - 1);
  15087. phi += dphi;
  15088. if (Math.abs(dphi) <= EPSLN) {
  15089. lat = phi;
  15090. break;
  15091. }
  15092. }
  15093. lon = adjust_lon(this.long0 + Math.asin(x * Math.tan(phi) / this.a) / Math.sin(lat));
  15094. }
  15095. } else {
  15096. if (Math.abs(y + this.ml0) <= EPSLN) {
  15097. lat = 0;
  15098. lon = adjust_lon(this.long0 + x / this.a);
  15099. } else {
  15100. al = (this.ml0 + y) / this.a;
  15101. bl = x * x / this.a / this.a + al * al;
  15102. phi = al;
  15103. var cl, mln, mlnp, ma;
  15104. var con;
  15105. for (i = MAX_ITER$2; i; --i) {
  15106. con = this.e * Math.sin(phi);
  15107. cl = Math.sqrt(1 - con * con) * Math.tan(phi);
  15108. mln = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, phi);
  15109. mlnp = this.e0 - 2 * this.e1 * Math.cos(2 * phi) + 4 * this.e2 * Math.cos(4 * phi) - 6 * this.e3 * Math.cos(6 * phi);
  15110. ma = mln / this.a;
  15111. dphi = (al * (cl * ma + 1) - ma - 0.5 * cl * (ma * ma + bl)) / (this.es * Math.sin(2 * phi) * (ma * ma + bl - 2 * al * ma) / (4 * cl) + (al - ma) * (cl * mlnp - 2 / Math.sin(2 * phi)) - mlnp);
  15112. phi -= dphi;
  15113. if (Math.abs(dphi) <= EPSLN) {
  15114. lat = phi;
  15115. break;
  15116. }
  15117. }
  15118. //lat=phi4z(this.e,this.e0,this.e1,this.e2,this.e3,al,bl,0,0);
  15119. cl = Math.sqrt(1 - this.es * Math.pow(Math.sin(lat), 2)) * Math.tan(lat);
  15120. lon = adjust_lon(this.long0 + Math.asin(x * cl / this.a) / Math.sin(lat));
  15121. }
  15122. }
  15123. p.x = lon;
  15124. p.y = lat;
  15125. return p;
  15126. }
  15127. var names$19 = ["Polyconic", "poly"];
  15128. var poly = {
  15129. init: init$18,
  15130. forward: forward$17,
  15131. inverse: inverse$17,
  15132. names: names$19
  15133. };
  15134. /*
  15135. reference
  15136. Department of Land and Survey Technical Circular 1973/32
  15137. http://www.linz.govt.nz/docs/miscellaneous/nz-map-definition.pdf
  15138. OSG Technical Report 4.1
  15139. http://www.linz.govt.nz/docs/miscellaneous/nzmg.pdf
  15140. */
  15141. /**
  15142. * iterations: Number of iterations to refine inverse transform.
  15143. * 0 -> km accuracy
  15144. * 1 -> m accuracy -- suitable for most mapping applications
  15145. * 2 -> mm accuracy
  15146. */
  15147. function init$19() {
  15148. this.A = [];
  15149. this.A[1] = 0.6399175073;
  15150. this.A[2] = -0.1358797613;
  15151. this.A[3] = 0.063294409;
  15152. this.A[4] = -0.02526853;
  15153. this.A[5] = 0.0117879;
  15154. this.A[6] = -0.0055161;
  15155. this.A[7] = 0.0026906;
  15156. this.A[8] = -0.001333;
  15157. this.A[9] = 0.00067;
  15158. this.A[10] = -0.00034;
  15159. this.B_re = [];
  15160. this.B_im = [];
  15161. this.B_re[1] = 0.7557853228;
  15162. this.B_im[1] = 0;
  15163. this.B_re[2] = 0.249204646;
  15164. this.B_im[2] = 0.003371507;
  15165. this.B_re[3] = -0.001541739;
  15166. this.B_im[3] = 0.041058560;
  15167. this.B_re[4] = -0.10162907;
  15168. this.B_im[4] = 0.01727609;
  15169. this.B_re[5] = -0.26623489;
  15170. this.B_im[5] = -0.36249218;
  15171. this.B_re[6] = -0.6870983;
  15172. this.B_im[6] = -1.1651967;
  15173. this.C_re = [];
  15174. this.C_im = [];
  15175. this.C_re[1] = 1.3231270439;
  15176. this.C_im[1] = 0;
  15177. this.C_re[2] = -0.577245789;
  15178. this.C_im[2] = -0.007809598;
  15179. this.C_re[3] = 0.508307513;
  15180. this.C_im[3] = -0.112208952;
  15181. this.C_re[4] = -0.15094762;
  15182. this.C_im[4] = 0.18200602;
  15183. this.C_re[5] = 1.01418179;
  15184. this.C_im[5] = 1.64497696;
  15185. this.C_re[6] = 1.9660549;
  15186. this.C_im[6] = 2.5127645;
  15187. this.D = [];
  15188. this.D[1] = 1.5627014243;
  15189. this.D[2] = 0.5185406398;
  15190. this.D[3] = -0.03333098;
  15191. this.D[4] = -0.1052906;
  15192. this.D[5] = -0.0368594;
  15193. this.D[6] = 0.007317;
  15194. this.D[7] = 0.01220;
  15195. this.D[8] = 0.00394;
  15196. this.D[9] = -0.0013;
  15197. }
  15198. /**
  15199. New Zealand Map Grid Forward - long/lat to x/y
  15200. long/lat in radians
  15201. */
  15202. function forward$18(p) {
  15203. var n;
  15204. var lon = p.x;
  15205. var lat = p.y;
  15206. var delta_lat = lat - this.lat0;
  15207. var delta_lon = lon - this.long0;
  15208. // 1. Calculate d_phi and d_psi ... // and d_lambda
  15209. // For this algorithm, delta_latitude is in seconds of arc x 10-5, so we need to scale to those units. Longitude is radians.
  15210. var d_phi = delta_lat / SEC_TO_RAD * 1E-5;
  15211. var d_lambda = delta_lon;
  15212. var d_phi_n = 1; // d_phi^0
  15213. var d_psi = 0;
  15214. for (n = 1; n <= 10; n++) {
  15215. d_phi_n = d_phi_n * d_phi;
  15216. d_psi = d_psi + this.A[n] * d_phi_n;
  15217. }
  15218. // 2. Calculate theta
  15219. var th_re = d_psi;
  15220. var th_im = d_lambda;
  15221. // 3. Calculate z
  15222. var th_n_re = 1;
  15223. var th_n_im = 0; // theta^0
  15224. var th_n_re1;
  15225. var th_n_im1;
  15226. var z_re = 0;
  15227. var z_im = 0;
  15228. for (n = 1; n <= 6; n++) {
  15229. th_n_re1 = th_n_re * th_re - th_n_im * th_im;
  15230. th_n_im1 = th_n_im * th_re + th_n_re * th_im;
  15231. th_n_re = th_n_re1;
  15232. th_n_im = th_n_im1;
  15233. z_re = z_re + this.B_re[n] * th_n_re - this.B_im[n] * th_n_im;
  15234. z_im = z_im + this.B_im[n] * th_n_re + this.B_re[n] * th_n_im;
  15235. }
  15236. // 4. Calculate easting and northing
  15237. p.x = z_im * this.a + this.x0;
  15238. p.y = z_re * this.a + this.y0;
  15239. return p;
  15240. }
  15241. /**
  15242. New Zealand Map Grid Inverse - x/y to long/lat
  15243. */
  15244. function inverse$18(p) {
  15245. var n;
  15246. var x = p.x;
  15247. var y = p.y;
  15248. var delta_x = x - this.x0;
  15249. var delta_y = y - this.y0;
  15250. // 1. Calculate z
  15251. var z_re = delta_y / this.a;
  15252. var z_im = delta_x / this.a;
  15253. // 2a. Calculate theta - first approximation gives km accuracy
  15254. var z_n_re = 1;
  15255. var z_n_im = 0; // z^0
  15256. var z_n_re1;
  15257. var z_n_im1;
  15258. var th_re = 0;
  15259. var th_im = 0;
  15260. for (n = 1; n <= 6; n++) {
  15261. z_n_re1 = z_n_re * z_re - z_n_im * z_im;
  15262. z_n_im1 = z_n_im * z_re + z_n_re * z_im;
  15263. z_n_re = z_n_re1;
  15264. z_n_im = z_n_im1;
  15265. th_re = th_re + this.C_re[n] * z_n_re - this.C_im[n] * z_n_im;
  15266. th_im = th_im + this.C_im[n] * z_n_re + this.C_re[n] * z_n_im;
  15267. }
  15268. // 2b. Iterate to refine the accuracy of the calculation
  15269. // 0 iterations gives km accuracy
  15270. // 1 iteration gives m accuracy -- good enough for most mapping applications
  15271. // 2 iterations bives mm accuracy
  15272. for (var i = 0; i < this.iterations; i++) {
  15273. var th_n_re = th_re;
  15274. var th_n_im = th_im;
  15275. var th_n_re1;
  15276. var th_n_im1;
  15277. var num_re = z_re;
  15278. var num_im = z_im;
  15279. for (n = 2; n <= 6; n++) {
  15280. th_n_re1 = th_n_re * th_re - th_n_im * th_im;
  15281. th_n_im1 = th_n_im * th_re + th_n_re * th_im;
  15282. th_n_re = th_n_re1;
  15283. th_n_im = th_n_im1;
  15284. num_re = num_re + (n - 1) * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);
  15285. num_im = num_im + (n - 1) * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);
  15286. }
  15287. th_n_re = 1;
  15288. th_n_im = 0;
  15289. var den_re = this.B_re[1];
  15290. var den_im = this.B_im[1];
  15291. for (n = 2; n <= 6; n++) {
  15292. th_n_re1 = th_n_re * th_re - th_n_im * th_im;
  15293. th_n_im1 = th_n_im * th_re + th_n_re * th_im;
  15294. th_n_re = th_n_re1;
  15295. th_n_im = th_n_im1;
  15296. den_re = den_re + n * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);
  15297. den_im = den_im + n * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);
  15298. }
  15299. // Complex division
  15300. var den2 = den_re * den_re + den_im * den_im;
  15301. th_re = (num_re * den_re + num_im * den_im) / den2;
  15302. th_im = (num_im * den_re - num_re * den_im) / den2;
  15303. }
  15304. // 3. Calculate d_phi ... // and d_lambda
  15305. var d_psi = th_re;
  15306. var d_lambda = th_im;
  15307. var d_psi_n = 1; // d_psi^0
  15308. var d_phi = 0;
  15309. for (n = 1; n <= 9; n++) {
  15310. d_psi_n = d_psi_n * d_psi;
  15311. d_phi = d_phi + this.D[n] * d_psi_n;
  15312. }
  15313. // 4. Calculate latitude and longitude
  15314. // d_phi is calcuated in second of arc * 10^-5, so we need to scale back to radians. d_lambda is in radians.
  15315. var lat = this.lat0 + d_phi * SEC_TO_RAD * 1E5;
  15316. var lon = this.long0 + d_lambda;
  15317. p.x = lon;
  15318. p.y = lat;
  15319. return p;
  15320. }
  15321. var names$20 = ["New_Zealand_Map_Grid", "nzmg"];
  15322. var nzmg = {
  15323. init: init$19,
  15324. forward: forward$18,
  15325. inverse: inverse$18,
  15326. names: names$20
  15327. };
  15328. /*
  15329. reference
  15330. "New Equal-Area Map Projections for Noncircular Regions", John P. Snyder,
  15331. The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355.
  15332. */
  15333. /* Initialize the Miller Cylindrical projection
  15334. -------------------------------------------*/
  15335. function init$20() {
  15336. //no-op
  15337. }
  15338. /* Miller Cylindrical forward equations--mapping lat,long to x,y
  15339. ------------------------------------------------------------*/
  15340. function forward$19(p) {
  15341. var lon = p.x;
  15342. var lat = p.y;
  15343. /* Forward equations
  15344. -----------------*/
  15345. var dlon = adjust_lon(lon - this.long0);
  15346. var x = this.x0 + this.a * dlon;
  15347. var y = this.y0 + this.a * Math.log(Math.tan(Math.PI / 4 + lat / 2.5)) * 1.25;
  15348. p.x = x;
  15349. p.y = y;
  15350. return p;
  15351. }
  15352. /* Miller Cylindrical inverse equations--mapping x,y to lat/long
  15353. ------------------------------------------------------------*/
  15354. function inverse$19(p) {
  15355. p.x -= this.x0;
  15356. p.y -= this.y0;
  15357. var lon = adjust_lon(this.long0 + p.x / this.a);
  15358. var lat = 2.5 * (Math.atan(Math.exp(0.8 * p.y / this.a)) - Math.PI / 4);
  15359. p.x = lon;
  15360. p.y = lat;
  15361. return p;
  15362. }
  15363. var names$21 = ["Miller_Cylindrical", "mill"];
  15364. var mill = {
  15365. init: init$20,
  15366. forward: forward$19,
  15367. inverse: inverse$19,
  15368. names: names$21
  15369. };
  15370. var MAX_ITER$3 = 20;
  15371. function init$21() {
  15372. /* Place parameters in static storage for common use
  15373. -------------------------------------------------*/
  15374. if (!this.sphere) {
  15375. this.en = pj_enfn(this.es);
  15376. } else {
  15377. this.n = 1;
  15378. this.m = 0;
  15379. this.es = 0;
  15380. this.C_y = Math.sqrt((this.m + 1) / this.n);
  15381. this.C_x = this.C_y / (this.m + 1);
  15382. }
  15383. }
  15384. /* Sinusoidal forward equations--mapping lat,long to x,y
  15385. -----------------------------------------------------*/
  15386. function forward$20(p) {
  15387. var x, y;
  15388. var lon = p.x;
  15389. var lat = p.y;
  15390. /* Forward equations
  15391. -----------------*/
  15392. lon = adjust_lon(lon - this.long0);
  15393. if (this.sphere) {
  15394. if (!this.m) {
  15395. lat = this.n !== 1 ? Math.asin(this.n * Math.sin(lat)) : lat;
  15396. } else {
  15397. var k = this.n * Math.sin(lat);
  15398. for (var i = MAX_ITER$3; i; --i) {
  15399. var V = (this.m * lat + Math.sin(lat) - k) / (this.m + Math.cos(lat));
  15400. lat -= V;
  15401. if (Math.abs(V) < EPSLN) {
  15402. break;
  15403. }
  15404. }
  15405. }
  15406. x = this.a * this.C_x * lon * (this.m + Math.cos(lat));
  15407. y = this.a * this.C_y * lat;
  15408. } else {
  15409. var s = Math.sin(lat);
  15410. var c = Math.cos(lat);
  15411. y = this.a * pj_mlfn(lat, s, c, this.en);
  15412. x = this.a * lon * c / Math.sqrt(1 - this.es * s * s);
  15413. }
  15414. p.x = x;
  15415. p.y = y;
  15416. return p;
  15417. }
  15418. function inverse$20(p) {
  15419. var lat, temp, lon, s;
  15420. p.x -= this.x0;
  15421. lon = p.x / this.a;
  15422. p.y -= this.y0;
  15423. lat = p.y / this.a;
  15424. if (this.sphere) {
  15425. lat /= this.C_y;
  15426. lon = lon / (this.C_x * (this.m + Math.cos(lat)));
  15427. if (this.m) {
  15428. lat = asinz((this.m * lat + Math.sin(lat)) / this.n);
  15429. } else if (this.n !== 1) {
  15430. lat = asinz(Math.sin(lat) / this.n);
  15431. }
  15432. lon = adjust_lon(lon + this.long0);
  15433. lat = adjust_lat(lat);
  15434. } else {
  15435. lat = pj_inv_mlfn(p.y / this.a, this.es, this.en);
  15436. s = Math.abs(lat);
  15437. if (s < HALF_PI) {
  15438. s = Math.sin(lat);
  15439. temp = this.long0 + p.x * Math.sqrt(1 - this.es * s * s) / (this.a * Math.cos(lat));
  15440. //temp = this.long0 + p.x / (this.a * Math.cos(lat));
  15441. lon = adjust_lon(temp);
  15442. } else if (s - EPSLN < HALF_PI) {
  15443. lon = this.long0;
  15444. }
  15445. }
  15446. p.x = lon;
  15447. p.y = lat;
  15448. return p;
  15449. }
  15450. var names$22 = ["Sinusoidal", "sinu"];
  15451. var sinu = {
  15452. init: init$21,
  15453. forward: forward$20,
  15454. inverse: inverse$20,
  15455. names: names$22
  15456. };
  15457. function init$22() {}
  15458. /* Mollweide forward equations--mapping lat,long to x,y
  15459. ----------------------------------------------------*/
  15460. function forward$21(p) {
  15461. /* Forward equations
  15462. -----------------*/
  15463. var lon = p.x;
  15464. var lat = p.y;
  15465. var delta_lon = adjust_lon(lon - this.long0);
  15466. var theta = lat;
  15467. var con = Math.PI * Math.sin(lat);
  15468. /* Iterate using the Newton-Raphson method to find theta
  15469. -----------------------------------------------------*/
  15470. while (true) {
  15471. var delta_theta = -(theta + Math.sin(theta) - con) / (1 + Math.cos(theta));
  15472. theta += delta_theta;
  15473. if (Math.abs(delta_theta) < EPSLN) {
  15474. break;
  15475. }
  15476. }
  15477. theta /= 2;
  15478. /* If the latitude is 90 deg, force the x coordinate to be "0 + false easting"
  15479. this is done here because of precision problems with "cos(theta)"
  15480. --------------------------------------------------------------------------*/
  15481. if (Math.PI / 2 - Math.abs(lat) < EPSLN) {
  15482. delta_lon = 0;
  15483. }
  15484. var x = 0.900316316158 * this.a * delta_lon * Math.cos(theta) + this.x0;
  15485. var y = 1.4142135623731 * this.a * Math.sin(theta) + this.y0;
  15486. p.x = x;
  15487. p.y = y;
  15488. return p;
  15489. }
  15490. function inverse$21(p) {
  15491. var theta;
  15492. var arg;
  15493. /* Inverse equations
  15494. -----------------*/
  15495. p.x -= this.x0;
  15496. p.y -= this.y0;
  15497. arg = p.y / (1.4142135623731 * this.a);
  15498. /* Because of division by zero problems, 'arg' can not be 1. Therefore
  15499. a number very close to one is used instead.
  15500. -------------------------------------------------------------------*/
  15501. if (Math.abs(arg) > 0.999999999999) {
  15502. arg = 0.999999999999;
  15503. }
  15504. theta = Math.asin(arg);
  15505. var lon = adjust_lon(this.long0 + p.x / (0.900316316158 * this.a * Math.cos(theta)));
  15506. if (lon < -Math.PI) {
  15507. lon = -Math.PI;
  15508. }
  15509. if (lon > Math.PI) {
  15510. lon = Math.PI;
  15511. }
  15512. arg = (2 * theta + Math.sin(2 * theta)) / Math.PI;
  15513. if (Math.abs(arg) > 1) {
  15514. arg = 1;
  15515. }
  15516. var lat = Math.asin(arg);
  15517. p.x = lon;
  15518. p.y = lat;
  15519. return p;
  15520. }
  15521. var names$23 = ["Mollweide", "moll"];
  15522. var moll = {
  15523. init: init$22,
  15524. forward: forward$21,
  15525. inverse: inverse$21,
  15526. names: names$23
  15527. };
  15528. function init$23() {
  15529. /* Place parameters in static storage for common use
  15530. -------------------------------------------------*/
  15531. // Standard Parallels cannot be equal and on opposite sides of the equator
  15532. if (Math.abs(this.lat1 + this.lat2) < EPSLN) {
  15533. return;
  15534. }
  15535. this.lat2 = this.lat2 || this.lat1;
  15536. this.temp = this.b / this.a;
  15537. this.es = 1 - Math.pow(this.temp, 2);
  15538. this.e = Math.sqrt(this.es);
  15539. this.e0 = e0fn(this.es);
  15540. this.e1 = e1fn(this.es);
  15541. this.e2 = e2fn(this.es);
  15542. this.e3 = e3fn(this.es);
  15543. this.sinphi = Math.sin(this.lat1);
  15544. this.cosphi = Math.cos(this.lat1);
  15545. this.ms1 = msfnz(this.e, this.sinphi, this.cosphi);
  15546. this.ml1 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat1);
  15547. if (Math.abs(this.lat1 - this.lat2) < EPSLN) {
  15548. this.ns = this.sinphi;
  15549. } else {
  15550. this.sinphi = Math.sin(this.lat2);
  15551. this.cosphi = Math.cos(this.lat2);
  15552. this.ms2 = msfnz(this.e, this.sinphi, this.cosphi);
  15553. this.ml2 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat2);
  15554. this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1);
  15555. }
  15556. this.g = this.ml1 + this.ms1 / this.ns;
  15557. this.ml0 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat0);
  15558. this.rh = this.a * (this.g - this.ml0);
  15559. }
  15560. /* Equidistant Conic forward equations--mapping lat,long to x,y
  15561. -----------------------------------------------------------*/
  15562. function forward$22(p) {
  15563. var lon = p.x;
  15564. var lat = p.y;
  15565. var rh1;
  15566. /* Forward equations
  15567. -----------------*/
  15568. if (this.sphere) {
  15569. rh1 = this.a * (this.g - lat);
  15570. } else {
  15571. var ml = mlfn(this.e0, this.e1, this.e2, this.e3, lat);
  15572. rh1 = this.a * (this.g - ml);
  15573. }
  15574. var theta = this.ns * adjust_lon(lon - this.long0);
  15575. var x = this.x0 + rh1 * Math.sin(theta);
  15576. var y = this.y0 + this.rh - rh1 * Math.cos(theta);
  15577. p.x = x;
  15578. p.y = y;
  15579. return p;
  15580. }
  15581. /* Inverse equations
  15582. -----------------*/
  15583. function inverse$22(p) {
  15584. p.x -= this.x0;
  15585. p.y = this.rh - p.y + this.y0;
  15586. var con, rh1, lat, lon;
  15587. if (this.ns >= 0) {
  15588. rh1 = Math.sqrt(p.x * p.x + p.y * p.y);
  15589. con = 1;
  15590. } else {
  15591. rh1 = -Math.sqrt(p.x * p.x + p.y * p.y);
  15592. con = -1;
  15593. }
  15594. var theta = 0;
  15595. if (rh1 !== 0) {
  15596. theta = Math.atan2(con * p.x, con * p.y);
  15597. }
  15598. if (this.sphere) {
  15599. lon = adjust_lon(this.long0 + theta / this.ns);
  15600. lat = adjust_lat(this.g - rh1 / this.a);
  15601. p.x = lon;
  15602. p.y = lat;
  15603. return p;
  15604. } else {
  15605. var ml = this.g - rh1 / this.a;
  15606. lat = imlfn(ml, this.e0, this.e1, this.e2, this.e3);
  15607. lon = adjust_lon(this.long0 + theta / this.ns);
  15608. p.x = lon;
  15609. p.y = lat;
  15610. return p;
  15611. }
  15612. }
  15613. var names$24 = ["Equidistant_Conic", "eqdc"];
  15614. var eqdc = {
  15615. init: init$23,
  15616. forward: forward$22,
  15617. inverse: inverse$22,
  15618. names: names$24
  15619. };
  15620. /* Initialize the Van Der Grinten projection
  15621. ----------------------------------------*/
  15622. function init$24() {
  15623. //this.R = 6370997; //Radius of earth
  15624. this.R = this.a;
  15625. }
  15626. function forward$23(p) {
  15627. var lon = p.x;
  15628. var lat = p.y;
  15629. /* Forward equations
  15630. -----------------*/
  15631. var dlon = adjust_lon(lon - this.long0);
  15632. var x, y;
  15633. if (Math.abs(lat) <= EPSLN) {
  15634. x = this.x0 + this.R * dlon;
  15635. y = this.y0;
  15636. }
  15637. var theta = asinz(2 * Math.abs(lat / Math.PI));
  15638. if (Math.abs(dlon) <= EPSLN || Math.abs(Math.abs(lat) - HALF_PI) <= EPSLN) {
  15639. x = this.x0;
  15640. if (lat >= 0) {
  15641. y = this.y0 + Math.PI * this.R * Math.tan(0.5 * theta);
  15642. } else {
  15643. y = this.y0 + Math.PI * this.R * -Math.tan(0.5 * theta);
  15644. }
  15645. // return(OK);
  15646. }
  15647. var al = 0.5 * Math.abs(Math.PI / dlon - dlon / Math.PI);
  15648. var asq = al * al;
  15649. var sinth = Math.sin(theta);
  15650. var costh = Math.cos(theta);
  15651. var g = costh / (sinth + costh - 1);
  15652. var gsq = g * g;
  15653. var m = g * (2 / sinth - 1);
  15654. var msq = m * m;
  15655. var con = Math.PI * this.R * (al * (g - msq) + Math.sqrt(asq * (g - msq) * (g - msq) - (msq + asq) * (gsq - msq))) / (msq + asq);
  15656. if (dlon < 0) {
  15657. con = -con;
  15658. }
  15659. x = this.x0 + con;
  15660. //con = Math.abs(con / (Math.PI * this.R));
  15661. var q = asq + g;
  15662. con = Math.PI * this.R * (m * q - al * Math.sqrt((msq + asq) * (asq + 1) - q * q)) / (msq + asq);
  15663. if (lat >= 0) {
  15664. //y = this.y0 + Math.PI * this.R * Math.sqrt(1 - con * con - 2 * al * con);
  15665. y = this.y0 + con;
  15666. } else {
  15667. //y = this.y0 - Math.PI * this.R * Math.sqrt(1 - con * con - 2 * al * con);
  15668. y = this.y0 - con;
  15669. }
  15670. p.x = x;
  15671. p.y = y;
  15672. return p;
  15673. }
  15674. /* Van Der Grinten inverse equations--mapping x,y to lat/long
  15675. ---------------------------------------------------------*/
  15676. function inverse$23(p) {
  15677. var lon, lat;
  15678. var xx, yy, xys, c1, c2, c3;
  15679. var a1;
  15680. var m1;
  15681. var con;
  15682. var th1;
  15683. var d;
  15684. /* inverse equations
  15685. -----------------*/
  15686. p.x -= this.x0;
  15687. p.y -= this.y0;
  15688. con = Math.PI * this.R;
  15689. xx = p.x / con;
  15690. yy = p.y / con;
  15691. xys = xx * xx + yy * yy;
  15692. c1 = -Math.abs(yy) * (1 + xys);
  15693. c2 = c1 - 2 * yy * yy + xx * xx;
  15694. c3 = -2 * c1 + 1 + 2 * yy * yy + xys * xys;
  15695. d = yy * yy / c3 + (2 * c2 * c2 * c2 / c3 / c3 / c3 - 9 * c1 * c2 / c3 / c3) / 27;
  15696. a1 = (c1 - c2 * c2 / 3 / c3) / c3;
  15697. m1 = 2 * Math.sqrt(-a1 / 3);
  15698. con = 3 * d / a1 / m1;
  15699. if (Math.abs(con) > 1) {
  15700. if (con >= 0) {
  15701. con = 1;
  15702. } else {
  15703. con = -1;
  15704. }
  15705. }
  15706. th1 = Math.acos(con) / 3;
  15707. if (p.y >= 0) {
  15708. lat = (-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;
  15709. } else {
  15710. lat = -(-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;
  15711. }
  15712. if (Math.abs(xx) < EPSLN) {
  15713. lon = this.long0;
  15714. } else {
  15715. lon = adjust_lon(this.long0 + Math.PI * (xys - 1 + Math.sqrt(1 + 2 * (xx * xx - yy * yy) + xys * xys)) / 2 / xx);
  15716. }
  15717. p.x = lon;
  15718. p.y = lat;
  15719. return p;
  15720. }
  15721. var names$25 = ["Van_der_Grinten_I", "VanDerGrinten", "vandg"];
  15722. var vandg = {
  15723. init: init$24,
  15724. forward: forward$23,
  15725. inverse: inverse$23,
  15726. names: names$25
  15727. };
  15728. function init$25() {
  15729. this.sin_p12 = Math.sin(this.lat0);
  15730. this.cos_p12 = Math.cos(this.lat0);
  15731. }
  15732. function forward$24(p) {
  15733. var lon = p.x;
  15734. var lat = p.y;
  15735. var sinphi = Math.sin(p.y);
  15736. var cosphi = Math.cos(p.y);
  15737. var dlon = adjust_lon(lon - this.long0);
  15738. var e0, e1, e2, e3, Mlp, Ml, tanphi, Nl1, Nl, psi, Az, G, H, GH, Hs, c, kp, cos_c, s, s2, s3, s4, s5;
  15739. if (this.sphere) {
  15740. if (Math.abs(this.sin_p12 - 1) <= EPSLN) {
  15741. //North Pole case
  15742. p.x = this.x0 + this.a * (HALF_PI - lat) * Math.sin(dlon);
  15743. p.y = this.y0 - this.a * (HALF_PI - lat) * Math.cos(dlon);
  15744. return p;
  15745. } else if (Math.abs(this.sin_p12 + 1) <= EPSLN) {
  15746. //South Pole case
  15747. p.x = this.x0 + this.a * (HALF_PI + lat) * Math.sin(dlon);
  15748. p.y = this.y0 + this.a * (HALF_PI + lat) * Math.cos(dlon);
  15749. return p;
  15750. } else {
  15751. //default case
  15752. cos_c = this.sin_p12 * sinphi + this.cos_p12 * cosphi * Math.cos(dlon);
  15753. c = Math.acos(cos_c);
  15754. kp = c ? c / Math.sin(c) : 1;
  15755. p.x = this.x0 + this.a * kp * cosphi * Math.sin(dlon);
  15756. p.y = this.y0 + this.a * kp * (this.cos_p12 * sinphi - this.sin_p12 * cosphi * Math.cos(dlon));
  15757. return p;
  15758. }
  15759. } else {
  15760. e0 = e0fn(this.es);
  15761. e1 = e1fn(this.es);
  15762. e2 = e2fn(this.es);
  15763. e3 = e3fn(this.es);
  15764. if (Math.abs(this.sin_p12 - 1) <= EPSLN) {
  15765. //North Pole case
  15766. Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);
  15767. Ml = this.a * mlfn(e0, e1, e2, e3, lat);
  15768. p.x = this.x0 + (Mlp - Ml) * Math.sin(dlon);
  15769. p.y = this.y0 - (Mlp - Ml) * Math.cos(dlon);
  15770. return p;
  15771. } else if (Math.abs(this.sin_p12 + 1) <= EPSLN) {
  15772. //South Pole case
  15773. Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);
  15774. Ml = this.a * mlfn(e0, e1, e2, e3, lat);
  15775. p.x = this.x0 + (Mlp + Ml) * Math.sin(dlon);
  15776. p.y = this.y0 + (Mlp + Ml) * Math.cos(dlon);
  15777. return p;
  15778. } else {
  15779. //Default case
  15780. tanphi = sinphi / cosphi;
  15781. Nl1 = gN(this.a, this.e, this.sin_p12);
  15782. Nl = gN(this.a, this.e, sinphi);
  15783. psi = Math.atan((1 - this.es) * tanphi + this.es * Nl1 * this.sin_p12 / (Nl * cosphi));
  15784. Az = Math.atan2(Math.sin(dlon), this.cos_p12 * Math.tan(psi) - this.sin_p12 * Math.cos(dlon));
  15785. if (Az === 0) {
  15786. s = Math.asin(this.cos_p12 * Math.sin(psi) - this.sin_p12 * Math.cos(psi));
  15787. } else if (Math.abs(Math.abs(Az) - Math.PI) <= EPSLN) {
  15788. s = -Math.asin(this.cos_p12 * Math.sin(psi) - this.sin_p12 * Math.cos(psi));
  15789. } else {
  15790. s = Math.asin(Math.sin(dlon) * Math.cos(psi) / Math.sin(Az));
  15791. }
  15792. G = this.e * this.sin_p12 / Math.sqrt(1 - this.es);
  15793. H = this.e * this.cos_p12 * Math.cos(Az) / Math.sqrt(1 - this.es);
  15794. GH = G * H;
  15795. Hs = H * H;
  15796. s2 = s * s;
  15797. s3 = s2 * s;
  15798. s4 = s3 * s;
  15799. s5 = s4 * s;
  15800. c = Nl1 * s * (1 - s2 * Hs * (1 - Hs) / 6 + s3 / 8 * GH * (1 - 2 * Hs) + s4 / 120 * (Hs * (4 - 7 * Hs) - 3 * G * G * (1 - 7 * Hs)) - s5 / 48 * GH);
  15801. p.x = this.x0 + c * Math.sin(Az);
  15802. p.y = this.y0 + c * Math.cos(Az);
  15803. return p;
  15804. }
  15805. }
  15806. }
  15807. function inverse$24(p) {
  15808. p.x -= this.x0;
  15809. p.y -= this.y0;
  15810. var rh, z, sinz, cosz, lon, lat, con, e0, e1, e2, e3, Mlp, M, N1, psi, Az, cosAz, tmp, A, B, D, Ee, F, sinpsi;
  15811. if (this.sphere) {
  15812. rh = Math.sqrt(p.x * p.x + p.y * p.y);
  15813. if (rh > 2 * HALF_PI * this.a) {
  15814. return;
  15815. }
  15816. z = rh / this.a;
  15817. sinz = Math.sin(z);
  15818. cosz = Math.cos(z);
  15819. lon = this.long0;
  15820. if (Math.abs(rh) <= EPSLN) {
  15821. lat = this.lat0;
  15822. } else {
  15823. lat = asinz(cosz * this.sin_p12 + p.y * sinz * this.cos_p12 / rh);
  15824. con = Math.abs(this.lat0) - HALF_PI;
  15825. if (Math.abs(con) <= EPSLN) {
  15826. if (this.lat0 >= 0) {
  15827. lon = adjust_lon(this.long0 + Math.atan2(p.x, -p.y));
  15828. } else {
  15829. lon = adjust_lon(this.long0 - Math.atan2(-p.x, p.y));
  15830. }
  15831. } else {
  15832. /*con = cosz - this.sin_p12 * Math.sin(lat);
  15833. if ((Math.abs(con) < EPSLN) && (Math.abs(p.x) < EPSLN)) {
  15834. //no-op, just keep the lon value as is
  15835. } else {
  15836. var temp = Math.atan2((p.x * sinz * this.cos_p12), (con * rh));
  15837. lon = adjust_lon(this.long0 + Math.atan2((p.x * sinz * this.cos_p12), (con * rh)));
  15838. }*/
  15839. lon = adjust_lon(this.long0 + Math.atan2(p.x * sinz, rh * this.cos_p12 * cosz - p.y * this.sin_p12 * sinz));
  15840. }
  15841. }
  15842. p.x = lon;
  15843. p.y = lat;
  15844. return p;
  15845. } else {
  15846. e0 = e0fn(this.es);
  15847. e1 = e1fn(this.es);
  15848. e2 = e2fn(this.es);
  15849. e3 = e3fn(this.es);
  15850. if (Math.abs(this.sin_p12 - 1) <= EPSLN) {
  15851. //North pole case
  15852. Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);
  15853. rh = Math.sqrt(p.x * p.x + p.y * p.y);
  15854. M = Mlp - rh;
  15855. lat = imlfn(M / this.a, e0, e1, e2, e3);
  15856. lon = adjust_lon(this.long0 + Math.atan2(p.x, -1 * p.y));
  15857. p.x = lon;
  15858. p.y = lat;
  15859. return p;
  15860. } else if (Math.abs(this.sin_p12 + 1) <= EPSLN) {
  15861. //South pole case
  15862. Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);
  15863. rh = Math.sqrt(p.x * p.x + p.y * p.y);
  15864. M = rh - Mlp;
  15865. lat = imlfn(M / this.a, e0, e1, e2, e3);
  15866. lon = adjust_lon(this.long0 + Math.atan2(p.x, p.y));
  15867. p.x = lon;
  15868. p.y = lat;
  15869. return p;
  15870. } else {
  15871. //default case
  15872. rh = Math.sqrt(p.x * p.x + p.y * p.y);
  15873. Az = Math.atan2(p.x, p.y);
  15874. N1 = gN(this.a, this.e, this.sin_p12);
  15875. cosAz = Math.cos(Az);
  15876. tmp = this.e * this.cos_p12 * cosAz;
  15877. A = -tmp * tmp / (1 - this.es);
  15878. B = 3 * this.es * (1 - A) * this.sin_p12 * this.cos_p12 * cosAz / (1 - this.es);
  15879. D = rh / N1;
  15880. Ee = D - A * (1 + A) * Math.pow(D, 3) / 6 - B * (1 + 3 * A) * Math.pow(D, 4) / 24;
  15881. F = 1 - A * Ee * Ee / 2 - D * Ee * Ee * Ee / 6;
  15882. psi = Math.asin(this.sin_p12 * Math.cos(Ee) + this.cos_p12 * Math.sin(Ee) * cosAz);
  15883. lon = adjust_lon(this.long0 + Math.asin(Math.sin(Az) * Math.sin(Ee) / Math.cos(psi)));
  15884. sinpsi = Math.sin(psi);
  15885. lat = Math.atan2((sinpsi - this.es * F * this.sin_p12) * Math.tan(psi), sinpsi * (1 - this.es));
  15886. p.x = lon;
  15887. p.y = lat;
  15888. return p;
  15889. }
  15890. }
  15891. }
  15892. var names$26 = ["Azimuthal_Equidistant", "aeqd"];
  15893. var aeqd = {
  15894. init: init$25,
  15895. forward: forward$24,
  15896. inverse: inverse$24,
  15897. names: names$26
  15898. };
  15899. function init$26() {
  15900. //double temp; /* temporary variable */
  15901. /* Place parameters in static storage for common use
  15902. -------------------------------------------------*/
  15903. this.sin_p14 = Math.sin(this.lat0);
  15904. this.cos_p14 = Math.cos(this.lat0);
  15905. }
  15906. /* Orthographic forward equations--mapping lat,long to x,y
  15907. ---------------------------------------------------*/
  15908. function forward$25(p) {
  15909. var sinphi, cosphi; /* sin and cos value */
  15910. var dlon; /* delta longitude value */
  15911. var coslon; /* cos of longitude */
  15912. var ksp; /* scale factor */
  15913. var g, x, y;
  15914. var lon = p.x;
  15915. var lat = p.y;
  15916. /* Forward equations
  15917. -----------------*/
  15918. dlon = adjust_lon(lon - this.long0);
  15919. sinphi = Math.sin(lat);
  15920. cosphi = Math.cos(lat);
  15921. coslon = Math.cos(dlon);
  15922. g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon;
  15923. ksp = 1;
  15924. if (g > 0 || Math.abs(g) <= EPSLN) {
  15925. x = this.a * ksp * cosphi * Math.sin(dlon);
  15926. y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);
  15927. }
  15928. p.x = x;
  15929. p.y = y;
  15930. return p;
  15931. }
  15932. function inverse$25(p) {
  15933. var rh; /* height above ellipsoid */
  15934. var z; /* angle */
  15935. var sinz, cosz; /* sin of z and cos of z */
  15936. var con;
  15937. var lon, lat;
  15938. /* Inverse equations
  15939. -----------------*/
  15940. p.x -= this.x0;
  15941. p.y -= this.y0;
  15942. rh = Math.sqrt(p.x * p.x + p.y * p.y);
  15943. z = asinz(rh / this.a);
  15944. sinz = Math.sin(z);
  15945. cosz = Math.cos(z);
  15946. lon = this.long0;
  15947. if (Math.abs(rh) <= EPSLN) {
  15948. lat = this.lat0;
  15949. p.x = lon;
  15950. p.y = lat;
  15951. return p;
  15952. }
  15953. lat = asinz(cosz * this.sin_p14 + p.y * sinz * this.cos_p14 / rh);
  15954. con = Math.abs(this.lat0) - HALF_PI;
  15955. if (Math.abs(con) <= EPSLN) {
  15956. if (this.lat0 >= 0) {
  15957. lon = adjust_lon(this.long0 + Math.atan2(p.x, -p.y));
  15958. } else {
  15959. lon = adjust_lon(this.long0 - Math.atan2(-p.x, p.y));
  15960. }
  15961. p.x = lon;
  15962. p.y = lat;
  15963. return p;
  15964. }
  15965. lon = adjust_lon(this.long0 + Math.atan2(p.x * sinz, rh * this.cos_p14 * cosz - p.y * this.sin_p14 * sinz));
  15966. p.x = lon;
  15967. p.y = lat;
  15968. return p;
  15969. }
  15970. var names$27 = ["ortho"];
  15971. var ortho = {
  15972. init: init$26,
  15973. forward: forward$25,
  15974. inverse: inverse$25,
  15975. names: names$27
  15976. };
  15977. // QSC projection rewritten from the original PROJ4
  15978. // https://github.com/OSGeo/proj.4/blob/master/src/PJ_qsc.c
  15979. /* constants */
  15980. var FACE_ENUM = {
  15981. FRONT: 1,
  15982. RIGHT: 2,
  15983. BACK: 3,
  15984. LEFT: 4,
  15985. TOP: 5,
  15986. BOTTOM: 6
  15987. };
  15988. var AREA_ENUM = {
  15989. AREA_0: 1,
  15990. AREA_1: 2,
  15991. AREA_2: 3,
  15992. AREA_3: 4
  15993. };
  15994. function init$27() {
  15995. this.x0 = this.x0 || 0;
  15996. this.y0 = this.y0 || 0;
  15997. this.lat0 = this.lat0 || 0;
  15998. this.long0 = this.long0 || 0;
  15999. this.lat_ts = this.lat_ts || 0;
  16000. this.title = this.title || "Quadrilateralized Spherical Cube";
  16001. /* Determine the cube face from the center of projection. */
  16002. if (this.lat0 >= HALF_PI - FORTPI / 2.0) {
  16003. this.face = FACE_ENUM.TOP;
  16004. } else if (this.lat0 <= -(HALF_PI - FORTPI / 2.0)) {
  16005. this.face = FACE_ENUM.BOTTOM;
  16006. } else if (Math.abs(this.long0) <= FORTPI) {
  16007. this.face = FACE_ENUM.FRONT;
  16008. } else if (Math.abs(this.long0) <= HALF_PI + FORTPI) {
  16009. this.face = this.long0 > 0.0 ? FACE_ENUM.RIGHT : FACE_ENUM.LEFT;
  16010. } else {
  16011. this.face = FACE_ENUM.BACK;
  16012. }
  16013. /* Fill in useful values for the ellipsoid <-> sphere shift
  16014. * described in [LK12]. */
  16015. if (this.es !== 0) {
  16016. this.one_minus_f = 1 - (this.a - this.b) / this.a;
  16017. this.one_minus_f_squared = this.one_minus_f * this.one_minus_f;
  16018. }
  16019. }
  16020. // QSC forward equations--mapping lat,long to x,y
  16021. // -----------------------------------------------------------------
  16022. function forward$26(p) {
  16023. var xy = {
  16024. x: 0,
  16025. y: 0
  16026. };
  16027. var lat, lon;
  16028. var theta, phi;
  16029. var t, mu;
  16030. /* nu; */
  16031. var area = {
  16032. value: 0
  16033. };
  16034. // move lon according to projection's lon
  16035. p.x -= this.long0;
  16036. /* Convert the geodetic latitude to a geocentric latitude.
  16037. * This corresponds to the shift from the ellipsoid to the sphere
  16038. * described in [LK12]. */
  16039. if (this.es !== 0) {
  16040. //if (P->es != 0) {
  16041. lat = Math.atan(this.one_minus_f_squared * Math.tan(p.y));
  16042. } else {
  16043. lat = p.y;
  16044. }
  16045. /* Convert the input lat, lon into theta, phi as used by QSC.
  16046. * This depends on the cube face and the area on it.
  16047. * For the top and bottom face, we can compute theta and phi
  16048. * directly from phi, lam. For the other faces, we must use
  16049. * unit sphere cartesian coordinates as an intermediate step. */
  16050. lon = p.x; //lon = lp.lam;
  16051. if (this.face === FACE_ENUM.TOP) {
  16052. phi = HALF_PI - lat;
  16053. if (lon >= FORTPI && lon <= HALF_PI + FORTPI) {
  16054. area.value = AREA_ENUM.AREA_0;
  16055. theta = lon - HALF_PI;
  16056. } else if (lon > HALF_PI + FORTPI || lon <= -(HALF_PI + FORTPI)) {
  16057. area.value = AREA_ENUM.AREA_1;
  16058. theta = lon > 0.0 ? lon - SPI : lon + SPI;
  16059. } else if (lon > -(HALF_PI + FORTPI) && lon <= -FORTPI) {
  16060. area.value = AREA_ENUM.AREA_2;
  16061. theta = lon + HALF_PI;
  16062. } else {
  16063. area.value = AREA_ENUM.AREA_3;
  16064. theta = lon;
  16065. }
  16066. } else if (this.face === FACE_ENUM.BOTTOM) {
  16067. phi = HALF_PI + lat;
  16068. if (lon >= FORTPI && lon <= HALF_PI + FORTPI) {
  16069. area.value = AREA_ENUM.AREA_0;
  16070. theta = -lon + HALF_PI;
  16071. } else if (lon < FORTPI && lon >= -FORTPI) {
  16072. area.value = AREA_ENUM.AREA_1;
  16073. theta = -lon;
  16074. } else if (lon < -FORTPI && lon >= -(HALF_PI + FORTPI)) {
  16075. area.value = AREA_ENUM.AREA_2;
  16076. theta = -lon - HALF_PI;
  16077. } else {
  16078. area.value = AREA_ENUM.AREA_3;
  16079. theta = lon > 0.0 ? -lon + SPI : -lon - SPI;
  16080. }
  16081. } else {
  16082. var q, r, s;
  16083. var sinlat, coslat;
  16084. var sinlon, coslon;
  16085. if (this.face === FACE_ENUM.RIGHT) {
  16086. lon = qsc_shift_lon_origin(lon, +HALF_PI);
  16087. } else if (this.face === FACE_ENUM.BACK) {
  16088. lon = qsc_shift_lon_origin(lon, +SPI);
  16089. } else if (this.face === FACE_ENUM.LEFT) {
  16090. lon = qsc_shift_lon_origin(lon, -HALF_PI);
  16091. }
  16092. sinlat = Math.sin(lat);
  16093. coslat = Math.cos(lat);
  16094. sinlon = Math.sin(lon);
  16095. coslon = Math.cos(lon);
  16096. q = coslat * coslon;
  16097. r = coslat * sinlon;
  16098. s = sinlat;
  16099. if (this.face === FACE_ENUM.FRONT) {
  16100. phi = Math.acos(q);
  16101. theta = qsc_fwd_equat_face_theta(phi, s, r, area);
  16102. } else if (this.face === FACE_ENUM.RIGHT) {
  16103. phi = Math.acos(r);
  16104. theta = qsc_fwd_equat_face_theta(phi, s, -q, area);
  16105. } else if (this.face === FACE_ENUM.BACK) {
  16106. phi = Math.acos(-q);
  16107. theta = qsc_fwd_equat_face_theta(phi, s, -r, area);
  16108. } else if (this.face === FACE_ENUM.LEFT) {
  16109. phi = Math.acos(-r);
  16110. theta = qsc_fwd_equat_face_theta(phi, s, q, area);
  16111. } else {
  16112. /* Impossible */
  16113. phi = theta = 0;
  16114. area.value = AREA_ENUM.AREA_0;
  16115. }
  16116. }
  16117. /* Compute mu and nu for the area of definition.
  16118. * For mu, see Eq. (3-21) in [OL76], but note the typos:
  16119. * compare with Eq. (3-14). For nu, see Eq. (3-38). */
  16120. mu = Math.atan(12 / SPI * (theta + Math.acos(Math.sin(theta) * Math.cos(FORTPI)) - HALF_PI));
  16121. t = Math.sqrt((1 - Math.cos(phi)) / (Math.cos(mu) * Math.cos(mu)) / (1 - Math.cos(Math.atan(1 / Math.cos(theta)))));
  16122. /* Apply the result to the real area. */
  16123. if (area.value === AREA_ENUM.AREA_1) {
  16124. mu += HALF_PI;
  16125. } else if (area.value === AREA_ENUM.AREA_2) {
  16126. mu += SPI;
  16127. } else if (area.value === AREA_ENUM.AREA_3) {
  16128. mu += 1.5 * SPI;
  16129. }
  16130. /* Now compute x, y from mu and nu */
  16131. xy.x = t * Math.cos(mu);
  16132. xy.y = t * Math.sin(mu);
  16133. xy.x = xy.x * this.a + this.x0;
  16134. xy.y = xy.y * this.a + this.y0;
  16135. p.x = xy.x;
  16136. p.y = xy.y;
  16137. return p;
  16138. }
  16139. // QSC inverse equations--mapping x,y to lat/long
  16140. // -----------------------------------------------------------------
  16141. function inverse$26(p) {
  16142. var lp = {
  16143. lam: 0,
  16144. phi: 0
  16145. };
  16146. var mu, nu, cosmu, tannu;
  16147. var tantheta, theta, cosphi, phi;
  16148. var t;
  16149. var area = {
  16150. value: 0
  16151. };
  16152. /* de-offset */
  16153. p.x = (p.x - this.x0) / this.a;
  16154. p.y = (p.y - this.y0) / this.a;
  16155. /* Convert the input x, y to the mu and nu angles as used by QSC.
  16156. * This depends on the area of the cube face. */
  16157. nu = Math.atan(Math.sqrt(p.x * p.x + p.y * p.y));
  16158. mu = Math.atan2(p.y, p.x);
  16159. if (p.x >= 0.0 && p.x >= Math.abs(p.y)) {
  16160. area.value = AREA_ENUM.AREA_0;
  16161. } else if (p.y >= 0.0 && p.y >= Math.abs(p.x)) {
  16162. area.value = AREA_ENUM.AREA_1;
  16163. mu -= HALF_PI;
  16164. } else if (p.x < 0.0 && -p.x >= Math.abs(p.y)) {
  16165. area.value = AREA_ENUM.AREA_2;
  16166. mu = mu < 0.0 ? mu + SPI : mu - SPI;
  16167. } else {
  16168. area.value = AREA_ENUM.AREA_3;
  16169. mu += HALF_PI;
  16170. }
  16171. /* Compute phi and theta for the area of definition.
  16172. * The inverse projection is not described in the original paper, but some
  16173. * good hints can be found here (as of 2011-12-14):
  16174. * http://fits.gsfc.nasa.gov/fitsbits/saf.93/saf.9302
  16175. * (search for "Message-Id: <9302181759.AA25477 at fits.cv.nrao.edu>") */
  16176. t = SPI / 12 * Math.tan(mu);
  16177. tantheta = Math.sin(t) / (Math.cos(t) - 1 / Math.sqrt(2));
  16178. theta = Math.atan(tantheta);
  16179. cosmu = Math.cos(mu);
  16180. tannu = Math.tan(nu);
  16181. cosphi = 1 - cosmu * cosmu * tannu * tannu * (1 - Math.cos(Math.atan(1 / Math.cos(theta))));
  16182. if (cosphi < -1) {
  16183. cosphi = -1;
  16184. } else if (cosphi > +1) {
  16185. cosphi = +1;
  16186. }
  16187. /* Apply the result to the real area on the cube face.
  16188. * For the top and bottom face, we can compute phi and lam directly.
  16189. * For the other faces, we must use unit sphere cartesian coordinates
  16190. * as an intermediate step. */
  16191. if (this.face === FACE_ENUM.TOP) {
  16192. phi = Math.acos(cosphi);
  16193. lp.phi = HALF_PI - phi;
  16194. if (area.value === AREA_ENUM.AREA_0) {
  16195. lp.lam = theta + HALF_PI;
  16196. } else if (area.value === AREA_ENUM.AREA_1) {
  16197. lp.lam = theta < 0.0 ? theta + SPI : theta - SPI;
  16198. } else if (area.value === AREA_ENUM.AREA_2) {
  16199. lp.lam = theta - HALF_PI;
  16200. } else /* area.value == AREA_ENUM.AREA_3 */{
  16201. lp.lam = theta;
  16202. }
  16203. } else if (this.face === FACE_ENUM.BOTTOM) {
  16204. phi = Math.acos(cosphi);
  16205. lp.phi = phi - HALF_PI;
  16206. if (area.value === AREA_ENUM.AREA_0) {
  16207. lp.lam = -theta + HALF_PI;
  16208. } else if (area.value === AREA_ENUM.AREA_1) {
  16209. lp.lam = -theta;
  16210. } else if (area.value === AREA_ENUM.AREA_2) {
  16211. lp.lam = -theta - HALF_PI;
  16212. } else /* area.value == AREA_ENUM.AREA_3 */{
  16213. lp.lam = theta < 0.0 ? -theta - SPI : -theta + SPI;
  16214. }
  16215. } else {
  16216. /* Compute phi and lam via cartesian unit sphere coordinates. */
  16217. var q, r, s;
  16218. q = cosphi;
  16219. t = q * q;
  16220. if (t >= 1) {
  16221. s = 0;
  16222. } else {
  16223. s = Math.sqrt(1 - t) * Math.sin(theta);
  16224. }
  16225. t += s * s;
  16226. if (t >= 1) {
  16227. r = 0;
  16228. } else {
  16229. r = Math.sqrt(1 - t);
  16230. }
  16231. /* Rotate q,r,s into the correct area. */
  16232. if (area.value === AREA_ENUM.AREA_1) {
  16233. t = r;
  16234. r = -s;
  16235. s = t;
  16236. } else if (area.value === AREA_ENUM.AREA_2) {
  16237. r = -r;
  16238. s = -s;
  16239. } else if (area.value === AREA_ENUM.AREA_3) {
  16240. t = r;
  16241. r = s;
  16242. s = -t;
  16243. }
  16244. /* Rotate q,r,s into the correct cube face. */
  16245. if (this.face === FACE_ENUM.RIGHT) {
  16246. t = q;
  16247. q = -r;
  16248. r = t;
  16249. } else if (this.face === FACE_ENUM.BACK) {
  16250. q = -q;
  16251. r = -r;
  16252. } else if (this.face === FACE_ENUM.LEFT) {
  16253. t = q;
  16254. q = r;
  16255. r = -t;
  16256. }
  16257. /* Now compute phi and lam from the unit sphere coordinates. */
  16258. lp.phi = Math.acos(-s) - HALF_PI;
  16259. lp.lam = Math.atan2(r, q);
  16260. if (this.face === FACE_ENUM.RIGHT) {
  16261. lp.lam = qsc_shift_lon_origin(lp.lam, -HALF_PI);
  16262. } else if (this.face === FACE_ENUM.BACK) {
  16263. lp.lam = qsc_shift_lon_origin(lp.lam, -SPI);
  16264. } else if (this.face === FACE_ENUM.LEFT) {
  16265. lp.lam = qsc_shift_lon_origin(lp.lam, +HALF_PI);
  16266. }
  16267. }
  16268. /* Apply the shift from the sphere to the ellipsoid as described
  16269. * in [LK12]. */
  16270. if (this.es !== 0) {
  16271. var invert_sign;
  16272. var tanphi, xa;
  16273. invert_sign = lp.phi < 0 ? 1 : 0;
  16274. tanphi = Math.tan(lp.phi);
  16275. xa = this.b / Math.sqrt(tanphi * tanphi + this.one_minus_f_squared);
  16276. lp.phi = Math.atan(Math.sqrt(this.a * this.a - xa * xa) / (this.one_minus_f * xa));
  16277. if (invert_sign) {
  16278. lp.phi = -lp.phi;
  16279. }
  16280. }
  16281. lp.lam += this.long0;
  16282. p.x = lp.lam;
  16283. p.y = lp.phi;
  16284. return p;
  16285. }
  16286. /* Helper function for forward projection: compute the theta angle
  16287. * and determine the area number. */
  16288. function qsc_fwd_equat_face_theta(phi, y, x, area) {
  16289. var theta;
  16290. if (phi < EPSLN) {
  16291. area.value = AREA_ENUM.AREA_0;
  16292. theta = 0.0;
  16293. } else {
  16294. theta = Math.atan2(y, x);
  16295. if (Math.abs(theta) <= FORTPI) {
  16296. area.value = AREA_ENUM.AREA_0;
  16297. } else if (theta > FORTPI && theta <= HALF_PI + FORTPI) {
  16298. area.value = AREA_ENUM.AREA_1;
  16299. theta -= HALF_PI;
  16300. } else if (theta > HALF_PI + FORTPI || theta <= -(HALF_PI + FORTPI)) {
  16301. area.value = AREA_ENUM.AREA_2;
  16302. theta = theta >= 0.0 ? theta - SPI : theta + SPI;
  16303. } else {
  16304. area.value = AREA_ENUM.AREA_3;
  16305. theta += HALF_PI;
  16306. }
  16307. }
  16308. return theta;
  16309. }
  16310. /* Helper function: shift the longitude. */
  16311. function qsc_shift_lon_origin(lon, offset) {
  16312. var slon = lon + offset;
  16313. if (slon < -SPI) {
  16314. slon += TWO_PI;
  16315. } else if (slon > +SPI) {
  16316. slon -= TWO_PI;
  16317. }
  16318. return slon;
  16319. }
  16320. var names$28 = ["Quadrilateralized Spherical Cube", "Quadrilateralized_Spherical_Cube", "qsc"];
  16321. var qsc = {
  16322. init: init$27,
  16323. forward: forward$26,
  16324. inverse: inverse$26,
  16325. names: names$28
  16326. };
  16327. // Robinson projection
  16328. // Based on https://github.com/OSGeo/proj.4/blob/master/src/PJ_robin.c
  16329. // Polynomial coeficients from http://article.gmane.org/gmane.comp.gis.proj-4.devel/6039
  16330. var COEFS_X = [[1.0000, 2.2199e-17, -7.15515e-05, 3.1103e-06], [0.9986, -0.000482243, -2.4897e-05, -1.3309e-06], [0.9954, -0.00083103, -4.48605e-05, -9.86701e-07], [0.9900, -0.00135364, -5.9661e-05, 3.6777e-06], [0.9822, -0.00167442, -4.49547e-06, -5.72411e-06], [0.9730, -0.00214868, -9.03571e-05, 1.8736e-08], [0.9600, -0.00305085, -9.00761e-05, 1.64917e-06], [0.9427, -0.00382792, -6.53386e-05, -2.6154e-06], [0.9216, -0.00467746, -0.00010457, 4.81243e-06], [0.8962, -0.00536223, -3.23831e-05, -5.43432e-06], [0.8679, -0.00609363, -0.000113898, 3.32484e-06], [0.8350, -0.00698325, -6.40253e-05, 9.34959e-07], [0.7986, -0.00755338, -5.00009e-05, 9.35324e-07], [0.7597, -0.00798324, -3.5971e-05, -2.27626e-06], [0.7186, -0.00851367, -7.01149e-05, -8.6303e-06], [0.6732, -0.00986209, -0.000199569, 1.91974e-05], [0.6213, -0.010418, 8.83923e-05, 6.24051e-06], [0.5722, -0.00906601, 0.000182, 6.24051e-06], [0.5322, -0.00677797, 0.000275608, 6.24051e-06]];
  16331. var COEFS_Y = [[-5.20417e-18, 0.0124, 1.21431e-18, -8.45284e-11], [0.0620, 0.0124, -1.26793e-09, 4.22642e-10], [0.1240, 0.0124, 5.07171e-09, -1.60604e-09], [0.1860, 0.0123999, -1.90189e-08, 6.00152e-09], [0.2480, 0.0124002, 7.10039e-08, -2.24e-08], [0.3100, 0.0123992, -2.64997e-07, 8.35986e-08], [0.3720, 0.0124029, 9.88983e-07, -3.11994e-07], [0.4340, 0.0123893, -3.69093e-06, -4.35621e-07], [0.4958, 0.0123198, -1.02252e-05, -3.45523e-07], [0.5571, 0.0121916, -1.54081e-05, -5.82288e-07], [0.6176, 0.0119938, -2.41424e-05, -5.25327e-07], [0.6769, 0.011713, -3.20223e-05, -5.16405e-07], [0.7346, 0.0113541, -3.97684e-05, -6.09052e-07], [0.7903, 0.0109107, -4.89042e-05, -1.04739e-06], [0.8435, 0.0103431, -6.4615e-05, -1.40374e-09], [0.8936, 0.00969686, -6.4636e-05, -8.547e-06], [0.9394, 0.00840947, -0.000192841, -4.2106e-06], [0.9761, 0.00616527, -0.000256, -4.2106e-06], [1.0000, 0.00328947, -0.000319159, -4.2106e-06]];
  16332. var FXC = 0.8487;
  16333. var FYC = 1.3523;
  16334. var C1 = R2D / 5; // rad to 5-degree interval
  16335. var RC1 = 1 / C1;
  16336. var NODES = 18;
  16337. var poly3_val = function poly3_val(coefs, x) {
  16338. return coefs[0] + x * (coefs[1] + x * (coefs[2] + x * coefs[3]));
  16339. };
  16340. var poly3_der = function poly3_der(coefs, x) {
  16341. return coefs[1] + x * (2 * coefs[2] + x * 3 * coefs[3]);
  16342. };
  16343. function newton_rapshon(f_df, start, max_err, iters) {
  16344. var x = start;
  16345. for (; iters; --iters) {
  16346. var upd = f_df(x);
  16347. x -= upd;
  16348. if (Math.abs(upd) < max_err) {
  16349. break;
  16350. }
  16351. }
  16352. return x;
  16353. }
  16354. function init$28() {
  16355. this.x0 = this.x0 || 0;
  16356. this.y0 = this.y0 || 0;
  16357. this.long0 = this.long0 || 0;
  16358. this.es = 0;
  16359. this.title = this.title || "Robinson";
  16360. }
  16361. function forward$27(ll) {
  16362. var lon = adjust_lon(ll.x - this.long0);
  16363. var dphi = Math.abs(ll.y);
  16364. var i = Math.floor(dphi * C1);
  16365. if (i < 0) {
  16366. i = 0;
  16367. } else if (i >= NODES) {
  16368. i = NODES - 1;
  16369. }
  16370. dphi = R2D * (dphi - RC1 * i);
  16371. var xy = {
  16372. x: poly3_val(COEFS_X[i], dphi) * lon,
  16373. y: poly3_val(COEFS_Y[i], dphi)
  16374. };
  16375. if (ll.y < 0) {
  16376. xy.y = -xy.y;
  16377. }
  16378. xy.x = xy.x * this.a * FXC + this.x0;
  16379. xy.y = xy.y * this.a * FYC + this.y0;
  16380. return xy;
  16381. }
  16382. function inverse$27(xy) {
  16383. var ll = {
  16384. x: (xy.x - this.x0) / (this.a * FXC),
  16385. y: Math.abs(xy.y - this.y0) / (this.a * FYC)
  16386. };
  16387. if (ll.y >= 1) {
  16388. // pathologic case
  16389. ll.x /= COEFS_X[NODES][0];
  16390. ll.y = xy.y < 0 ? -HALF_PI : HALF_PI;
  16391. } else {
  16392. // find table interval
  16393. var i = Math.floor(ll.y * NODES);
  16394. if (i < 0) {
  16395. i = 0;
  16396. } else if (i >= NODES) {
  16397. i = NODES - 1;
  16398. }
  16399. for (;;) {
  16400. if (COEFS_Y[i][0] > ll.y) {
  16401. --i;
  16402. } else if (COEFS_Y[i + 1][0] <= ll.y) {
  16403. ++i;
  16404. } else {
  16405. break;
  16406. }
  16407. }
  16408. // linear interpolation in 5 degree interval
  16409. var coefs = COEFS_Y[i];
  16410. var t = 5 * (ll.y - coefs[0]) / (COEFS_Y[i + 1][0] - coefs[0]);
  16411. // find t so that poly3_val(coefs, t) = ll.y
  16412. t = newton_rapshon(function (x) {
  16413. return (poly3_val(coefs, x) - ll.y) / poly3_der(coefs, x);
  16414. }, t, EPSLN, 100);
  16415. ll.x /= poly3_val(COEFS_X[i], t);
  16416. ll.y = (5 * i + t) * D2R;
  16417. if (xy.y < 0) {
  16418. ll.y = -ll.y;
  16419. }
  16420. }
  16421. ll.x = adjust_lon(ll.x + this.long0);
  16422. return ll;
  16423. }
  16424. var names$29 = ["Robinson", "robin"];
  16425. var robin = {
  16426. init: init$28,
  16427. forward: forward$27,
  16428. inverse: inverse$27,
  16429. names: names$29
  16430. };
  16431. function init$29() {
  16432. this.name = 'geocent';
  16433. }
  16434. function forward$28(p) {
  16435. var point = geodeticToGeocentric(p, this.es, this.a);
  16436. return point;
  16437. }
  16438. function inverse$28(p) {
  16439. var point = geocentricToGeodetic(p, this.es, this.a, this.b);
  16440. return point;
  16441. }
  16442. var names$30 = ["Geocentric", 'geocentric', "geocent", "Geocent"];
  16443. var geocent = {
  16444. init: init$29,
  16445. forward: forward$28,
  16446. inverse: inverse$28,
  16447. names: names$30
  16448. };
  16449. var mode = {
  16450. N_POLE: 0,
  16451. S_POLE: 1,
  16452. EQUIT: 2,
  16453. OBLIQ: 3
  16454. };
  16455. var params = {
  16456. h: {
  16457. def: 100000,
  16458. num: true
  16459. },
  16460. // default is Karman line, no default in PROJ.7
  16461. azi: {
  16462. def: 0,
  16463. num: true,
  16464. degrees: true
  16465. },
  16466. // default is North
  16467. tilt: {
  16468. def: 0,
  16469. num: true,
  16470. degrees: true
  16471. },
  16472. // default is Nadir
  16473. long0: {
  16474. def: 0,
  16475. num: true
  16476. },
  16477. // default is Greenwich, conversion to rad is automatic
  16478. lat0: {
  16479. def: 0,
  16480. num: true
  16481. } // default is Equator, conversion to rad is automatic
  16482. };
  16483. function init$30() {
  16484. Object.keys(params).forEach(function (p) {
  16485. if (typeof this[p] === "undefined") {
  16486. this[p] = params[p].def;
  16487. } else if (params[p].num && isNaN(this[p])) {
  16488. throw new Error("Invalid parameter value, must be numeric " + p + " = " + this[p]);
  16489. } else if (params[p].num) {
  16490. this[p] = parseFloat(this[p]);
  16491. }
  16492. if (params[p].degrees) {
  16493. this[p] = this[p] * D2R;
  16494. }
  16495. }.bind(this));
  16496. if (Math.abs(Math.abs(this.lat0) - HALF_PI) < EPSLN) {
  16497. this.mode = this.lat0 < 0 ? mode.S_POLE : mode.N_POLE;
  16498. } else if (Math.abs(this.lat0) < EPSLN) {
  16499. this.mode = mode.EQUIT;
  16500. } else {
  16501. this.mode = mode.OBLIQ;
  16502. this.sinph0 = Math.sin(this.lat0);
  16503. this.cosph0 = Math.cos(this.lat0);
  16504. }
  16505. this.pn1 = this.h / this.a; // Normalize relative to the Earth's radius
  16506. if (this.pn1 <= 0 || this.pn1 > 1e10) {
  16507. throw new Error("Invalid height");
  16508. }
  16509. this.p = 1 + this.pn1;
  16510. this.rp = 1 / this.p;
  16511. this.h1 = 1 / this.pn1;
  16512. this.pfact = (this.p + 1) * this.h1;
  16513. this.es = 0;
  16514. var omega = this.tilt;
  16515. var gamma = this.azi;
  16516. this.cg = Math.cos(gamma);
  16517. this.sg = Math.sin(gamma);
  16518. this.cw = Math.cos(omega);
  16519. this.sw = Math.sin(omega);
  16520. }
  16521. function forward$29(p) {
  16522. p.x -= this.long0;
  16523. var sinphi = Math.sin(p.y);
  16524. var cosphi = Math.cos(p.y);
  16525. var coslam = Math.cos(p.x);
  16526. var x, y;
  16527. switch (this.mode) {
  16528. case mode.OBLIQ:
  16529. y = this.sinph0 * sinphi + this.cosph0 * cosphi * coslam;
  16530. break;
  16531. case mode.EQUIT:
  16532. y = cosphi * coslam;
  16533. break;
  16534. case mode.S_POLE:
  16535. y = -sinphi;
  16536. break;
  16537. case mode.N_POLE:
  16538. y = sinphi;
  16539. break;
  16540. }
  16541. y = this.pn1 / (this.p - y);
  16542. x = y * cosphi * Math.sin(p.x);
  16543. switch (this.mode) {
  16544. case mode.OBLIQ:
  16545. y *= this.cosph0 * sinphi - this.sinph0 * cosphi * coslam;
  16546. break;
  16547. case mode.EQUIT:
  16548. y *= sinphi;
  16549. break;
  16550. case mode.N_POLE:
  16551. y *= -(cosphi * coslam);
  16552. break;
  16553. case mode.S_POLE:
  16554. y *= cosphi * coslam;
  16555. break;
  16556. }
  16557. // Tilt
  16558. var yt, ba;
  16559. yt = y * this.cg + x * this.sg;
  16560. ba = 1 / (yt * this.sw * this.h1 + this.cw);
  16561. x = (x * this.cg - y * this.sg) * this.cw * ba;
  16562. y = yt * ba;
  16563. p.x = x * this.a;
  16564. p.y = y * this.a;
  16565. return p;
  16566. }
  16567. function inverse$29(p) {
  16568. p.x /= this.a;
  16569. p.y /= this.a;
  16570. var r = {
  16571. x: p.x,
  16572. y: p.y
  16573. };
  16574. // Un-Tilt
  16575. var bm, bq, yt;
  16576. yt = 1 / (this.pn1 - p.y * this.sw);
  16577. bm = this.pn1 * p.x * yt;
  16578. bq = this.pn1 * p.y * this.cw * yt;
  16579. p.x = bm * this.cg + bq * this.sg;
  16580. p.y = bq * this.cg - bm * this.sg;
  16581. var rh = hypot(p.x, p.y);
  16582. if (Math.abs(rh) < EPSLN) {
  16583. r.x = 0;
  16584. r.y = p.y;
  16585. } else {
  16586. var cosz, sinz;
  16587. sinz = 1 - rh * rh * this.pfact;
  16588. sinz = (this.p - Math.sqrt(sinz)) / (this.pn1 / rh + rh / this.pn1);
  16589. cosz = Math.sqrt(1 - sinz * sinz);
  16590. switch (this.mode) {
  16591. case mode.OBLIQ:
  16592. r.y = Math.asin(cosz * this.sinph0 + p.y * sinz * this.cosph0 / rh);
  16593. p.y = (cosz - this.sinph0 * Math.sin(r.y)) * rh;
  16594. p.x *= sinz * this.cosph0;
  16595. break;
  16596. case mode.EQUIT:
  16597. r.y = Math.asin(p.y * sinz / rh);
  16598. p.y = cosz * rh;
  16599. p.x *= sinz;
  16600. break;
  16601. case mode.N_POLE:
  16602. r.y = Math.asin(cosz);
  16603. p.y = -p.y;
  16604. break;
  16605. case mode.S_POLE:
  16606. r.y = -Math.asin(cosz);
  16607. break;
  16608. }
  16609. r.x = Math.atan2(p.x, p.y);
  16610. }
  16611. p.x = r.x + this.long0;
  16612. p.y = r.y;
  16613. return p;
  16614. }
  16615. var names$31 = ["Tilted_Perspective", "tpers"];
  16616. var tpers = {
  16617. init: init$30,
  16618. forward: forward$29,
  16619. inverse: inverse$29,
  16620. names: names$31
  16621. };
  16622. function init$31() {
  16623. this.flip_axis = this.sweep === 'x' ? 1 : 0;
  16624. this.h = Number(this.h);
  16625. this.radius_g_1 = this.h / this.a;
  16626. if (this.radius_g_1 <= 0 || this.radius_g_1 > 1e10) {
  16627. throw new Error();
  16628. }
  16629. this.radius_g = 1.0 + this.radius_g_1;
  16630. this.C = this.radius_g * this.radius_g - 1.0;
  16631. if (this.es !== 0.0) {
  16632. var one_es = 1.0 - this.es;
  16633. var rone_es = 1 / one_es;
  16634. this.radius_p = Math.sqrt(one_es);
  16635. this.radius_p2 = one_es;
  16636. this.radius_p_inv2 = rone_es;
  16637. this.shape = 'ellipse'; // Use as a condition in the forward and inverse functions.
  16638. } else {
  16639. this.radius_p = 1.0;
  16640. this.radius_p2 = 1.0;
  16641. this.radius_p_inv2 = 1.0;
  16642. this.shape = 'sphere'; // Use as a condition in the forward and inverse functions.
  16643. }
  16644. if (!this.title) {
  16645. this.title = "Geostationary Satellite View";
  16646. }
  16647. }
  16648. function forward$30(p) {
  16649. var lon = p.x;
  16650. var lat = p.y;
  16651. var tmp, v_x, v_y, v_z;
  16652. lon = lon - this.long0;
  16653. if (this.shape === 'ellipse') {
  16654. lat = Math.atan(this.radius_p2 * Math.tan(lat));
  16655. var r = this.radius_p / hypot(this.radius_p * Math.cos(lat), Math.sin(lat));
  16656. v_x = r * Math.cos(lon) * Math.cos(lat);
  16657. v_y = r * Math.sin(lon) * Math.cos(lat);
  16658. v_z = r * Math.sin(lat);
  16659. if ((this.radius_g - v_x) * v_x - v_y * v_y - v_z * v_z * this.radius_p_inv2 < 0.0) {
  16660. p.x = Number.NaN;
  16661. p.y = Number.NaN;
  16662. return p;
  16663. }
  16664. tmp = this.radius_g - v_x;
  16665. if (this.flip_axis) {
  16666. p.x = this.radius_g_1 * Math.atan(v_y / hypot(v_z, tmp));
  16667. p.y = this.radius_g_1 * Math.atan(v_z / tmp);
  16668. } else {
  16669. p.x = this.radius_g_1 * Math.atan(v_y / tmp);
  16670. p.y = this.radius_g_1 * Math.atan(v_z / hypot(v_y, tmp));
  16671. }
  16672. } else if (this.shape === 'sphere') {
  16673. tmp = Math.cos(lat);
  16674. v_x = Math.cos(lon) * tmp;
  16675. v_y = Math.sin(lon) * tmp;
  16676. v_z = Math.sin(lat);
  16677. tmp = this.radius_g - v_x;
  16678. if (this.flip_axis) {
  16679. p.x = this.radius_g_1 * Math.atan(v_y / hypot(v_z, tmp));
  16680. p.y = this.radius_g_1 * Math.atan(v_z / tmp);
  16681. } else {
  16682. p.x = this.radius_g_1 * Math.atan(v_y / tmp);
  16683. p.y = this.radius_g_1 * Math.atan(v_z / hypot(v_y, tmp));
  16684. }
  16685. }
  16686. p.x = p.x * this.a;
  16687. p.y = p.y * this.a;
  16688. return p;
  16689. }
  16690. function inverse$30(p) {
  16691. var v_x = -1.0;
  16692. var v_y = 0.0;
  16693. var v_z = 0.0;
  16694. var a, b, det, k;
  16695. p.x = p.x / this.a;
  16696. p.y = p.y / this.a;
  16697. if (this.shape === 'ellipse') {
  16698. if (this.flip_axis) {
  16699. v_z = Math.tan(p.y / this.radius_g_1);
  16700. v_y = Math.tan(p.x / this.radius_g_1) * hypot(1.0, v_z);
  16701. } else {
  16702. v_y = Math.tan(p.x / this.radius_g_1);
  16703. v_z = Math.tan(p.y / this.radius_g_1) * hypot(1.0, v_y);
  16704. }
  16705. var v_zp = v_z / this.radius_p;
  16706. a = v_y * v_y + v_zp * v_zp + v_x * v_x;
  16707. b = 2 * this.radius_g * v_x;
  16708. det = b * b - 4 * a * this.C;
  16709. if (det < 0.0) {
  16710. p.x = Number.NaN;
  16711. p.y = Number.NaN;
  16712. return p;
  16713. }
  16714. k = (-b - Math.sqrt(det)) / (2.0 * a);
  16715. v_x = this.radius_g + k * v_x;
  16716. v_y *= k;
  16717. v_z *= k;
  16718. p.x = Math.atan2(v_y, v_x);
  16719. p.y = Math.atan(v_z * Math.cos(p.x) / v_x);
  16720. p.y = Math.atan(this.radius_p_inv2 * Math.tan(p.y));
  16721. } else if (this.shape === 'sphere') {
  16722. if (this.flip_axis) {
  16723. v_z = Math.tan(p.y / this.radius_g_1);
  16724. v_y = Math.tan(p.x / this.radius_g_1) * Math.sqrt(1.0 + v_z * v_z);
  16725. } else {
  16726. v_y = Math.tan(p.x / this.radius_g_1);
  16727. v_z = Math.tan(p.y / this.radius_g_1) * Math.sqrt(1.0 + v_y * v_y);
  16728. }
  16729. a = v_y * v_y + v_z * v_z + v_x * v_x;
  16730. b = 2 * this.radius_g * v_x;
  16731. det = b * b - 4 * a * this.C;
  16732. if (det < 0.0) {
  16733. p.x = Number.NaN;
  16734. p.y = Number.NaN;
  16735. return p;
  16736. }
  16737. k = (-b - Math.sqrt(det)) / (2.0 * a);
  16738. v_x = this.radius_g + k * v_x;
  16739. v_y *= k;
  16740. v_z *= k;
  16741. p.x = Math.atan2(v_y, v_x);
  16742. p.y = Math.atan(v_z * Math.cos(p.x) / v_x);
  16743. }
  16744. p.x = p.x + this.long0;
  16745. return p;
  16746. }
  16747. var names$32 = ["Geostationary Satellite View", "Geostationary_Satellite", "geos"];
  16748. var geos = {
  16749. init: init$31,
  16750. forward: forward$30,
  16751. inverse: inverse$30,
  16752. names: names$32
  16753. };
  16754. var includedProjections = function includedProjections(proj4) {
  16755. proj4.Proj.projections.add(tmerc);
  16756. proj4.Proj.projections.add(etmerc);
  16757. proj4.Proj.projections.add(utm);
  16758. proj4.Proj.projections.add(sterea);
  16759. proj4.Proj.projections.add(stere);
  16760. proj4.Proj.projections.add(somerc);
  16761. proj4.Proj.projections.add(omerc);
  16762. proj4.Proj.projections.add(lcc);
  16763. proj4.Proj.projections.add(krovak);
  16764. proj4.Proj.projections.add(cass);
  16765. proj4.Proj.projections.add(laea);
  16766. proj4.Proj.projections.add(aea);
  16767. proj4.Proj.projections.add(gnom);
  16768. proj4.Proj.projections.add(cea);
  16769. proj4.Proj.projections.add(eqc);
  16770. proj4.Proj.projections.add(poly);
  16771. proj4.Proj.projections.add(nzmg);
  16772. proj4.Proj.projections.add(mill);
  16773. proj4.Proj.projections.add(sinu);
  16774. proj4.Proj.projections.add(moll);
  16775. proj4.Proj.projections.add(eqdc);
  16776. proj4.Proj.projections.add(vandg);
  16777. proj4.Proj.projections.add(aeqd);
  16778. proj4.Proj.projections.add(ortho);
  16779. proj4.Proj.projections.add(qsc);
  16780. proj4.Proj.projections.add(robin);
  16781. proj4.Proj.projections.add(geocent);
  16782. proj4.Proj.projections.add(tpers);
  16783. proj4.Proj.projections.add(geos);
  16784. };
  16785. proj4$1.defaultDatum = 'WGS84'; //default datum
  16786. proj4$1.Proj = Projection;
  16787. proj4$1.WGS84 = new proj4$1.Proj('WGS84');
  16788. proj4$1.Point = Point;
  16789. proj4$1.toPoint = toPoint;
  16790. proj4$1.defs = defs;
  16791. proj4$1.nadgrid = nadgrid;
  16792. proj4$1.transform = transform;
  16793. proj4$1.mgrs = mgrs;
  16794. proj4$1.version = '2.9.0';
  16795. includedProjections(proj4$1);
  16796. return proj4$1;
  16797. });
  16798. /***/ }),
  16799. /***/ 9957:
  16800. /***/ (function(module, exports, __webpack_require__) {
  16801. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  16802. (function (global, factory) {
  16803. ( false ? 0 : _typeof(exports)) === 'object' && "object" !== 'undefined' ? factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  16804. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  16805. (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
  16806. __WEBPACK_AMD_DEFINE_FACTORY__),
  16807. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0;
  16808. })(this, function () {
  16809. 'use strict';
  16810. /**
  16811. * @this {Promise}
  16812. */
  16813. function finallyConstructor(callback) {
  16814. var constructor = this.constructor;
  16815. return this.then(function (value) {
  16816. // @ts-ignore
  16817. return constructor.resolve(callback()).then(function () {
  16818. return value;
  16819. });
  16820. }, function (reason) {
  16821. // @ts-ignore
  16822. return constructor.resolve(callback()).then(function () {
  16823. // @ts-ignore
  16824. return constructor.reject(reason);
  16825. });
  16826. });
  16827. }
  16828. function allSettled(arr) {
  16829. var P = this;
  16830. return new P(function (resolve, reject) {
  16831. if (!(arr && typeof arr.length !== 'undefined')) {
  16832. return reject(new TypeError(_typeof(arr) + ' ' + arr + ' is not iterable(cannot read property Symbol(Symbol.iterator))'));
  16833. }
  16834. var args = Array.prototype.slice.call(arr);
  16835. if (args.length === 0) return resolve([]);
  16836. var remaining = args.length;
  16837. function res(i, val) {
  16838. if (val && (_typeof(val) === 'object' || typeof val === 'function')) {
  16839. var then = val.then;
  16840. if (typeof then === 'function') {
  16841. then.call(val, function (val) {
  16842. res(i, val);
  16843. }, function (e) {
  16844. args[i] = {
  16845. status: 'rejected',
  16846. reason: e
  16847. };
  16848. if (--remaining === 0) {
  16849. resolve(args);
  16850. }
  16851. });
  16852. return;
  16853. }
  16854. }
  16855. args[i] = {
  16856. status: 'fulfilled',
  16857. value: val
  16858. };
  16859. if (--remaining === 0) {
  16860. resolve(args);
  16861. }
  16862. }
  16863. for (var i = 0; i < args.length; i++) {
  16864. res(i, args[i]);
  16865. }
  16866. });
  16867. }
  16868. // Store setTimeout reference so promise-polyfill will be unaffected by
  16869. // other code modifying setTimeout (like sinon.useFakeTimers())
  16870. var setTimeoutFunc = setTimeout;
  16871. function isArray(x) {
  16872. return Boolean(x && typeof x.length !== 'undefined');
  16873. }
  16874. function noop() {}
  16875. // Polyfill for Function.prototype.bind
  16876. function bind(fn, thisArg) {
  16877. return function () {
  16878. fn.apply(thisArg, arguments);
  16879. };
  16880. }
  16881. /**
  16882. * @constructor
  16883. * @param {Function} fn
  16884. */
  16885. function Promise(fn) {
  16886. if (!(this instanceof Promise)) throw new TypeError('Promises must be constructed via new');
  16887. if (typeof fn !== 'function') throw new TypeError('not a function');
  16888. /** @type {!number} */
  16889. this._state = 0;
  16890. /** @type {!boolean} */
  16891. this._handled = false;
  16892. /** @type {Promise|undefined} */
  16893. this._value = undefined;
  16894. /** @type {!Array<!Function>} */
  16895. this._deferreds = [];
  16896. doResolve(fn, this);
  16897. }
  16898. function handle(self, deferred) {
  16899. while (self._state === 3) {
  16900. self = self._value;
  16901. }
  16902. if (self._state === 0) {
  16903. self._deferreds.push(deferred);
  16904. return;
  16905. }
  16906. self._handled = true;
  16907. Promise._immediateFn(function () {
  16908. var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
  16909. if (cb === null) {
  16910. (self._state === 1 ? resolve : reject)(deferred.promise, self._value);
  16911. return;
  16912. }
  16913. var ret;
  16914. try {
  16915. ret = cb(self._value);
  16916. } catch (e) {
  16917. reject(deferred.promise, e);
  16918. return;
  16919. }
  16920. resolve(deferred.promise, ret);
  16921. });
  16922. }
  16923. function resolve(self, newValue) {
  16924. try {
  16925. // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
  16926. if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.');
  16927. if (newValue && (_typeof(newValue) === 'object' || typeof newValue === 'function')) {
  16928. var then = newValue.then;
  16929. if (newValue instanceof Promise) {
  16930. self._state = 3;
  16931. self._value = newValue;
  16932. finale(self);
  16933. return;
  16934. } else if (typeof then === 'function') {
  16935. doResolve(bind(then, newValue), self);
  16936. return;
  16937. }
  16938. }
  16939. self._state = 1;
  16940. self._value = newValue;
  16941. finale(self);
  16942. } catch (e) {
  16943. reject(self, e);
  16944. }
  16945. }
  16946. function reject(self, newValue) {
  16947. self._state = 2;
  16948. self._value = newValue;
  16949. finale(self);
  16950. }
  16951. function finale(self) {
  16952. if (self._state === 2 && self._deferreds.length === 0) {
  16953. Promise._immediateFn(function () {
  16954. if (!self._handled) {
  16955. Promise._unhandledRejectionFn(self._value);
  16956. }
  16957. });
  16958. }
  16959. for (var i = 0, len = self._deferreds.length; i < len; i++) {
  16960. handle(self, self._deferreds[i]);
  16961. }
  16962. self._deferreds = null;
  16963. }
  16964. /**
  16965. * @constructor
  16966. */
  16967. function Handler(onFulfilled, onRejected, promise) {
  16968. this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
  16969. this.onRejected = typeof onRejected === 'function' ? onRejected : null;
  16970. this.promise = promise;
  16971. }
  16972. /**
  16973. * Take a potentially misbehaving resolver function and make sure
  16974. * onFulfilled and onRejected are only called once.
  16975. *
  16976. * Makes no guarantees about asynchrony.
  16977. */
  16978. function doResolve(fn, self) {
  16979. var done = false;
  16980. try {
  16981. fn(function (value) {
  16982. if (done) return;
  16983. done = true;
  16984. resolve(self, value);
  16985. }, function (reason) {
  16986. if (done) return;
  16987. done = true;
  16988. reject(self, reason);
  16989. });
  16990. } catch (ex) {
  16991. if (done) return;
  16992. done = true;
  16993. reject(self, ex);
  16994. }
  16995. }
  16996. Promise.prototype['catch'] = function (onRejected) {
  16997. return this.then(null, onRejected);
  16998. };
  16999. Promise.prototype.then = function (onFulfilled, onRejected) {
  17000. // @ts-ignore
  17001. var prom = new this.constructor(noop);
  17002. handle(this, new Handler(onFulfilled, onRejected, prom));
  17003. return prom;
  17004. };
  17005. Promise.prototype['finally'] = finallyConstructor;
  17006. Promise.all = function (arr) {
  17007. return new Promise(function (resolve, reject) {
  17008. if (!isArray(arr)) {
  17009. return reject(new TypeError('Promise.all accepts an array'));
  17010. }
  17011. var args = Array.prototype.slice.call(arr);
  17012. if (args.length === 0) return resolve([]);
  17013. var remaining = args.length;
  17014. function res(i, val) {
  17015. try {
  17016. if (val && (_typeof(val) === 'object' || typeof val === 'function')) {
  17017. var then = val.then;
  17018. if (typeof then === 'function') {
  17019. then.call(val, function (val) {
  17020. res(i, val);
  17021. }, reject);
  17022. return;
  17023. }
  17024. }
  17025. args[i] = val;
  17026. if (--remaining === 0) {
  17027. resolve(args);
  17028. }
  17029. } catch (ex) {
  17030. reject(ex);
  17031. }
  17032. }
  17033. for (var i = 0; i < args.length; i++) {
  17034. res(i, args[i]);
  17035. }
  17036. });
  17037. };
  17038. Promise.allSettled = allSettled;
  17039. Promise.resolve = function (value) {
  17040. if (value && _typeof(value) === 'object' && value.constructor === Promise) {
  17041. return value;
  17042. }
  17043. return new Promise(function (resolve) {
  17044. resolve(value);
  17045. });
  17046. };
  17047. Promise.reject = function (value) {
  17048. return new Promise(function (resolve, reject) {
  17049. reject(value);
  17050. });
  17051. };
  17052. Promise.race = function (arr) {
  17053. return new Promise(function (resolve, reject) {
  17054. if (!isArray(arr)) {
  17055. return reject(new TypeError('Promise.race accepts an array'));
  17056. }
  17057. for (var i = 0, len = arr.length; i < len; i++) {
  17058. Promise.resolve(arr[i]).then(resolve, reject);
  17059. }
  17060. });
  17061. };
  17062. // Use polyfill for setImmediate for performance gains
  17063. Promise._immediateFn =
  17064. // @ts-ignore
  17065. typeof setImmediate === 'function' && function (fn) {
  17066. // @ts-ignore
  17067. setImmediate(fn);
  17068. } || function (fn) {
  17069. setTimeoutFunc(fn, 0);
  17070. };
  17071. Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
  17072. if (typeof console !== 'undefined' && console) {
  17073. console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
  17074. }
  17075. };
  17076. /** @suppress {undefinedVars} */
  17077. var globalNS = function () {
  17078. // the only reliable means to get the global object is
  17079. // `Function('return this')()`
  17080. // However, this causes CSP violations in Chrome apps.
  17081. if (typeof self !== 'undefined') {
  17082. return self;
  17083. }
  17084. if (typeof window !== 'undefined') {
  17085. return window;
  17086. }
  17087. if (typeof __webpack_require__.g !== 'undefined') {
  17088. return __webpack_require__.g;
  17089. }
  17090. throw new Error('unable to locate global object');
  17091. }();
  17092. // Expose the polyfill if Promise is undefined or set to a
  17093. // non-function value. The latter can be due to a named HTMLElement
  17094. // being exposed by browsers for legacy reasons.
  17095. // https://github.com/taylorhakes/promise-polyfill/issues/114
  17096. if (typeof globalNS['Promise'] !== 'function') {
  17097. globalNS['Promise'] = Promise;
  17098. } else {
  17099. if (!globalNS.Promise.prototype['finally']) {
  17100. globalNS.Promise.prototype['finally'] = finallyConstructor;
  17101. }
  17102. if (!globalNS.Promise.allSettled) {
  17103. globalNS.Promise.allSettled = allSettled;
  17104. }
  17105. }
  17106. });
  17107. /***/ }),
  17108. /***/ 3425:
  17109. /***/ (function(module, exports, __webpack_require__) {
  17110. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  17111. // https://github.com/mbostock/slice-source Version 0.4.1. Copyright 2016 Mike Bostock.
  17112. (function (global, factory) {
  17113. ( false ? 0 : _typeof(exports)) === 'object' && "object" !== 'undefined' ? module.exports = factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  17114. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  17115. (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
  17116. __WEBPACK_AMD_DEFINE_FACTORY__),
  17117. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : (0);
  17118. })(this, function () {
  17119. 'use strict';
  17120. var empty = new Uint8Array(0);
  17121. function slice_cancel() {
  17122. return this._source.cancel();
  17123. }
  17124. function concat(a, b) {
  17125. if (!a.length) return b;
  17126. if (!b.length) return a;
  17127. var c = new Uint8Array(a.length + b.length);
  17128. c.set(a);
  17129. c.set(b, a.length);
  17130. return c;
  17131. }
  17132. function slice_read() {
  17133. var that = this,
  17134. array = that._array.subarray(that._index);
  17135. return that._source.read().then(function (result) {
  17136. that._array = empty;
  17137. that._index = 0;
  17138. return result.done ? array.length > 0 ? {
  17139. done: false,
  17140. value: array
  17141. } : {
  17142. done: true,
  17143. value: undefined
  17144. } : {
  17145. done: false,
  17146. value: concat(array, result.value)
  17147. };
  17148. });
  17149. }
  17150. function slice_slice(length) {
  17151. if ((length |= 0) < 0) throw new Error("invalid length");
  17152. var that = this,
  17153. index = this._array.length - this._index;
  17154. // If the request fits within the remaining buffer, resolve it immediately.
  17155. if (this._index + length <= this._array.length) {
  17156. return Promise.resolve(this._array.subarray(this._index, this._index += length));
  17157. }
  17158. // Otherwise, read chunks repeatedly until the request is fulfilled.
  17159. var array = new Uint8Array(length);
  17160. array.set(this._array.subarray(this._index));
  17161. return function read() {
  17162. return that._source.read().then(function (result) {
  17163. // When done, it’s possible the request wasn’t fully fullfilled!
  17164. // If so, the pre-allocated array is too big and needs slicing.
  17165. if (result.done) {
  17166. that._array = empty;
  17167. that._index = 0;
  17168. return index > 0 ? array.subarray(0, index) : null;
  17169. }
  17170. // If this chunk fulfills the request, return the resulting array.
  17171. if (index + result.value.length >= length) {
  17172. that._array = result.value;
  17173. that._index = length - index;
  17174. array.set(result.value.subarray(0, length - index), index);
  17175. return array;
  17176. }
  17177. // Otherwise copy this chunk into the array, then read the next chunk.
  17178. array.set(result.value, index);
  17179. index += result.value.length;
  17180. return read();
  17181. });
  17182. }();
  17183. }
  17184. function slice(source) {
  17185. return typeof source.slice === "function" ? source : new SliceSource(typeof source.read === "function" ? source : source.getReader());
  17186. }
  17187. function SliceSource(source) {
  17188. this._source = source;
  17189. this._array = empty;
  17190. this._index = 0;
  17191. }
  17192. SliceSource.prototype.read = slice_read;
  17193. SliceSource.prototype.slice = slice_slice;
  17194. SliceSource.prototype.cancel = slice_cancel;
  17195. return slice;
  17196. });
  17197. /***/ }),
  17198. /***/ 3884:
  17199. /***/ (function() {
  17200. "use strict";
  17201. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  17202. * This program are made available under the terms of the Apache License, Version 2.0
  17203. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17204. /***/ }),
  17205. /***/ 4853:
  17206. /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
  17207. "use strict";
  17208. // UNUSED EXPORTS: AddressMatchService, AggregationParameter, AggregationTypes, AlongLineDirection, AnalystAreaUnit, AnalystSizeUnit, AreaSolarRadiationParameters, ArrayStatistic, AttributesPopContainer, BaiduMap, Bounds, Browser, BucketAggParameter, BucketAggType, BufferAnalystParameters, BufferDistance, BufferEndType, BufferRadiusUnit, BufferSetting, BuffersAnalystJobsParameter, BurstPipelineAnalystParameters, CartoCSS, ChangeTileVersion, ChartQueryFilterParameter, ChartQueryParameters, ChartService, ChartType, ChartView, ChartViewModel, CityTabsPage, ClientType, ClipAnalystMode, ClipParameter, CloverShape, ColorDictionary, ColorGradientType, ColorSpaceType, ColorsPickerUtil, CommonContainer, CommonServiceBase, CommonTheme, CommonUtil, ComponentsUtil, ComputeWeightMatrixParameters, CreateDatasetParameters, Credential, DataFlow, DataFlowService, DataFormat, DataItemOrderBy, DataItemType, DataReturnMode, DataReturnOption, DatasetBufferAnalystParameters, DatasetInfo, DatasetOverlayAnalystParameters, DatasetService, DatasetSurfaceAnalystParameters, DatasetThiessenAnalystParameters, DatasourceConnectionInfo, DatasourceService, DeafultCanvasStyle, DensityKernelAnalystParameters, DirectionType, DropDownBox, EditFeaturesParameters, EditType, ElasticSearch, EngineType, EntityType, Event, Events, Exponent, FGB, FacilityAnalyst3DParameters, FacilityAnalystSinks3DParameters, FacilityAnalystSources3DParameters, FacilityAnalystStreamParameters, FacilityAnalystTracedown3DParameters, FacilityAnalystTraceup3DParameters, FacilityAnalystUpstream3DParameters, Feature, FeatureService, FeatureShapeFactory, FeatureTheme, FeatureThemeGraph, FeatureThemeRankSymbol, FeatureThemeVector, FeatureVector, FetchRequest, FieldParameters, FieldService, FieldStatisticsParameters, FieldsFilter, FileReaderUtil, FillGradientMode, FilterField, FilterParameter, FindClosestFacilitiesParameters, FindLocationParameters, FindMTSPPathsParameters, FindPathParameters, FindServiceAreasParameters, FindTSPPathsParameters, Format, GenerateSpatialDataParameters, GeoCodingParameter, GeoDecodingParameter, GeoFeature, GeoHashGridAggParameter, GeoJSONFormat, GeoRelationAnalystParameters, Geometry, GeometryBufferAnalystParameters, GeometryCollection, GeometryCurve, GeometryGeoText, GeometryLineString, GeometryLinearRing, GeometryMultiLineString, GeometryMultiPoint, GeometryMultiPolygon, GeometryOverlayAnalystParameters, GeometryPoint, GeometryPolygon, GeometryRectangle, GeometrySurfaceAnalystParameters, GeometryThiessenAnalystParameters, GeometryType, GeoprocessingService, GetFeatureMode, GetFeaturesByBoundsParameters, GetFeaturesByBufferParameters, GetFeaturesByGeometryParameters, GetFeaturesByIDsParameters, GetFeaturesBySQLParameters, GetFeaturesParametersBase, GetFeaturesServiceBase, GetGridCellInfosParameters, GraduatedMode, Graph, GraphAxesTextDisplayMode, GraphMap, Graphic, GraphicCanvasRenderer, GraphicWebGLRenderer, Grid, GridCellInfosService, GridType, HeatMap, HillshadeParameter, HitCloverShape, IManager, IManagerCreateNodeParam, IManagerServiceBase, IPortal, IPortalAddDataParam, IPortalAddResourceParam, IPortalDataConnectionInfoParam, IPortalDataMetaInfoParam, IPortalDataStoreInfoParam, IPortalQueryParam, IPortalQueryResult, IPortalRegisterServiceParam, IPortalResource, IPortalServiceBase, IPortalShareEntity, IPortalShareParam, IPortalUser, ImageCollectionService, ImageGFAspect, ImageGFHillShade, ImageGFOrtho, ImageGFSlope, ImageRenderingRule, ImageSearchParameter, ImageService, ImageStretchOption, ImageSuperMapRest, ImageTileSuperMapRest, IndexTabsPageContainer, InterpolationAlgorithmType, InterpolationAnalystParameters, InterpolationDensityAnalystParameters, InterpolationIDWAnalystParameters, InterpolationKrigingAnalystParameters, InterpolationRBFAnalystParameters, JSONFormat, JoinItem, JoinType, KernelDensityJobParameter, KeyServiceParameter, KnowledgeGraph, KnowledgeGraphService, Label, LabelBackShape, LabelImageCell, LabelMatrixCell, LabelMixedTextStyle, LabelOverLengthMode, LabelSymbolCell, LabelThemeCell, Lang, LayerInfoService, LayerStatus, LayerType, LinkItem, Logo, LonLat, MapExtend, MapService, MapboxStyles, MappingParameters, Mapv, MapvCanvasLayer, MapvLayer, MathExpressionAnalysisParameters, MeasureMode, MeasureParameters, MeasureService, MessageBox, MetricsAggParameter, MetricsAggType, NDVIParameter, NavTabsPage, NetworkAnalyst3DService, NetworkAnalystService, NetworkAnalystServiceBase, Online, OnlineData, OnlineQueryDatasParameter, OnlineServiceBase, OrderBy, OrderType, OutputSetting, OutputType, OverlapDisplayedOptions, OverlayAnalystParameters, OverlayGeoJobParameter, OverlayGraphic, OverlayOperationType, PaginationContainer, PermissionType, Pixel, PixelFormat, PointWithMeasure, PopContainer, ProcessingService, ProcessingServiceBase, QueryByBoundsParameters, QueryByDistanceParameters, QueryByGeometryParameters, QueryBySQLParameters, QueryOption, QueryParameters, QueryService, Range, RangeMode, RankSymbol, RasterFunctionParameter, RasterFunctionType, ResourceType, Route, RouteCalculateMeasureParameters, RouteLocatorParameters, ScaleLine, SearchMode, SearchType, SecurityManager, Select, ServerColor, ServerFeature, ServerGeometry, ServerInfo, ServerStyle, ServerTextStyle, ServerTheme, ServerType, ServiceBase, ServiceStatus, SetDatasourceParameters, SetLayerInfoParameters, SetLayerStatusParameters, SetLayersInfoParameters, ShapeParameters, ShapeParametersCircle, ShapeParametersImage, ShapeParametersLabel, ShapeParametersLine, ShapeParametersPoint, ShapeParametersPolygon, ShapeParametersRectangle, ShapeParametersSector, SideType, SingleObjectQueryJobsParameter, Size, SmoothMethod, Sortby, SpatialAnalystBase, SpatialAnalystService, SpatialQueryMode, SpatialRelationType, StatisticAnalystMode, StatisticMode, StopQueryParameters, StyleMap, StyleUtils, SummaryAttributesJobsParameter, SummaryMeshJobParameter, SummaryRegionJobParameter, SummaryType, SuperMap, SuperMapCloud, SupplyCenter, SupplyCenterType, SurfaceAnalystMethod, SurfaceAnalystParameters, SurfaceAnalystParametersSetting, TemplateBase, TerrainCurvatureCalculationParameters, TextAlignment, Theme, ThemeDotDensity, ThemeFeature, ThemeGraduatedSymbol, ThemeGraduatedSymbolStyle, ThemeGraph, ThemeGraphAxes, ThemeGraphItem, ThemeGraphSize, ThemeGraphText, ThemeGraphTextFormat, ThemeGraphType, ThemeGridRange, ThemeGridRangeItem, ThemeGridUnique, ThemeGridUniqueItem, ThemeLabel, ThemeLabelAlongLine, ThemeLabelBackground, ThemeLabelItem, ThemeLabelText, ThemeLabelUniqueItem, ThemeMemoryData, ThemeOffset, ThemeParameters, ThemeRange, ThemeRangeItem, ThemeService, ThemeStyle, ThemeType, ThemeUnique, ThemeUniqueItem, ThiessenAnalystParameters, Tianditu, TileSuperMapRest, TimeControlBase, TimeFlowControl, TokenServiceParameter, TopologyValidatorJobsParameter, TopologyValidatorRule, TrafficTransferAnalystService, TransferLine, TransferPathParameters, TransferPreference, TransferSolutionParameters, TransferTactic, Transform, TransportationAnalystParameter, TransportationAnalystResultSetting, Turf, TurnType, UGCLayer, UGCLayerType, UGCMapLayer, UGCSubLayer, Unique, Unit, UpdateDatasetParameters, UpdateEdgeWeightParameters, UpdateTurnNodeWeightParameters, Util, VariogramMode, Vector, VectorClipJobsParameter, VectorTileStyles, VectorTileSuperMapRest, WKTFormat, WebExportFormatType, WebMap, WebPrintingJobContent, WebPrintingJobCustomItems, WebPrintingJobExportOptions, WebPrintingJobImage, WebPrintingJobLayers, WebPrintingJobLayoutOptions, WebPrintingJobLegendOptions, WebPrintingJobLittleMapOptions, WebPrintingJobNorthArrowOptions, WebPrintingJobParameters, WebPrintingJobScaleBarOptions, WebPrintingJobService, WebScaleOrientationType, WebScaleType, WebScaleUnit, conversionDegree, getMeterPerMapUnit, getWrapNum, initMap, isCORS, lineMap, lineStyle, pointMap, pointStyle, polygonMap, polygonStyle, setCORS, viewOptionsFromMapJSON
  17209. ;// CONCATENATED MODULE: ./src/common/SuperMap.js
  17210. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  17211. * This program are made available under the terms of the Apache License, Version 2.0
  17212. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17213. var SuperMap = window.SuperMap = window.SuperMap || {};
  17214. SuperMap.Components = window.SuperMap.Components || {};
  17215. ;// CONCATENATED MODULE: ./src/common/REST.js
  17216. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  17217. * This program are made available under the terms of the Apache License, Version 2.0
  17218. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17219. /**
  17220. * @enum DataFormat
  17221. * @description 服务请求返回结果数据类型
  17222. * @category BaseTypes Constant
  17223. * @type {string}
  17224. * @usage
  17225. * ```
  17226. * // 浏览器
  17227. * <script type="text/javascript" src="{cdn}"></script>
  17228. * <script>
  17229. * const result = {namespace}.DataFormat.GEOJSON;
  17230. *
  17231. * </script>
  17232. * // ES6 Import
  17233. * import { DataFormat } from '{npm}';
  17234. *
  17235. * const result = DataFormat.GEOJSON;
  17236. * ```
  17237. */
  17238. var DataFormat = {
  17239. /** GEOJSON */
  17240. GEOJSON: "GEOJSON",
  17241. /** ISERVER */
  17242. ISERVER: "ISERVER",
  17243. /** FGB */
  17244. FGB: "FGB"
  17245. };
  17246. /**
  17247. * @enum ServerType
  17248. * @description 服务器类型
  17249. * @category BaseTypes Constant
  17250. * @type {string}
  17251. * @usage
  17252. * ```
  17253. * // 浏览器
  17254. * <script type="text/javascript" src="{cdn}"></script>
  17255. * <script>
  17256. * const result = {namespace}.ServerType.ISERVER;
  17257. *
  17258. * </script>
  17259. * // ES6 Import
  17260. * import { ServerType } from '{npm}';
  17261. *
  17262. * const result = ServerType.ISERVER;
  17263. * ```
  17264. */
  17265. var ServerType = {
  17266. /** ISERVER */
  17267. ISERVER: "ISERVER",
  17268. /** IPORTAL */
  17269. IPORTAL: "IPORTAL",
  17270. /** ONLINE */
  17271. ONLINE: "ONLINE"
  17272. };
  17273. /**
  17274. * @enum GeometryType
  17275. * @description 几何对象枚举,定义了一系列几何对象类型。
  17276. * @category BaseTypes Constant
  17277. * @type {string}
  17278. * @usage
  17279. * ```
  17280. * // 浏览器
  17281. * <script type="text/javascript" src="{cdn}"></script>
  17282. * <script>
  17283. * const result = {namespace}.GeometryType.LINE;
  17284. *
  17285. * </script>
  17286. * // ES6 Import
  17287. * import { GeometryType } from '{npm}';
  17288. *
  17289. * const result = GeometryType.LINE;
  17290. * ```
  17291. */
  17292. var REST_GeometryType = {
  17293. /** 线几何对象类型。 */
  17294. LINE: "LINE",
  17295. /** 路由对象。 */
  17296. LINEM: "LINEM",
  17297. /** 点几何对象类型。 */
  17298. POINT: "POINT",
  17299. /** 面几何对象类型。 */
  17300. REGION: "REGION",
  17301. /** EPS点几何对象。 */
  17302. POINTEPS: "POINTEPS",
  17303. /** EPS线几何对象。 */
  17304. LINEEPS: "LINEEPS",
  17305. /** EPS面几何对象。 */
  17306. REGIONEPS: "REGIONEPS",
  17307. /** 椭圆。 */
  17308. ELLIPSE: "ELLIPSE",
  17309. /** 圆。 */
  17310. CIRCLE: "CIRCLE",
  17311. /** 文本几何对象类型。 */
  17312. TEXT: "TEXT",
  17313. /** 矩形。 */
  17314. RECTANGLE: "RECTANGLE",
  17315. /** 未定义。 */
  17316. UNKNOWN: "UNKNOWN",
  17317. /** 复合几何对象类型。 */
  17318. GEOCOMPOUND: "GEOCOMPOUND"
  17319. };
  17320. /**
  17321. * @enum QueryOption
  17322. * @description 查询结果类型枚举,描述查询结果返回类型,包括只返回属性、只返回几何实体以及返回属性和几何实体。
  17323. * @category BaseTypes Constant
  17324. * @type {string}
  17325. * @usage
  17326. * ```
  17327. * // 浏览器
  17328. * <script type="text/javascript" src="{cdn}"></script>
  17329. * <script>
  17330. * const result = {namespace}.QueryOption.ATTRIBUTE;
  17331. *
  17332. * </script>
  17333. * // ES6 Import
  17334. * import { QueryOption } from '{npm}';
  17335. *
  17336. * const result = QueryOption.ATTRIBUTE;
  17337. * ```
  17338. */
  17339. var QueryOption = {
  17340. /** 属性。 */
  17341. ATTRIBUTE: "ATTRIBUTE",
  17342. /** 属性和几何对象。 */
  17343. ATTRIBUTEANDGEOMETRY: "ATTRIBUTEANDGEOMETRY",
  17344. /** 几何对象。 */
  17345. GEOMETRY: "GEOMETRY"
  17346. };
  17347. /**
  17348. * @enum JoinType
  17349. * @description 关联查询时的关联类型常量。
  17350. * 该类定义了两个表之间的连接类型常量,决定了对两个表之间进行连接查询时,查询结果中得到的记录的情况。
  17351. * @category BaseTypes Constant
  17352. * @type {string}
  17353. * @usage
  17354. * ```
  17355. * // 浏览器
  17356. * <script type="text/javascript" src="{cdn}"></script>
  17357. * <script>
  17358. * const result = {namespace}.JoinType.INNERJOIN;
  17359. *
  17360. * </script>
  17361. * // ES6 Import
  17362. * import { JoinType } from '{npm}';
  17363. *
  17364. * const result = JoinType.INNERJOIN;
  17365. * ```
  17366. */
  17367. var JoinType = {
  17368. /** 内连接。 */
  17369. INNERJOIN: "INNERJOIN",
  17370. /** 左连接。 */
  17371. LEFTJOIN: "LEFTJOIN"
  17372. };
  17373. /**
  17374. * @enum SpatialQueryMode
  17375. * @description 空间查询模式枚举。该类定义了空间查询操作模式常量。
  17376. * @category BaseTypes Constant
  17377. * @type {string}
  17378. * @usage
  17379. * ```
  17380. * // 浏览器
  17381. * <script type="text/javascript" src="{cdn}"></script>
  17382. * <script>
  17383. * const result = {namespace}.SpatialQueryMode.CONTAIN;
  17384. *
  17385. * </script>
  17386. * // ES6 Import
  17387. * import { SpatialQueryMode } from '{npm}';
  17388. *
  17389. * const result = SpatialQueryMode.CONTAIN;
  17390. * ```
  17391. */
  17392. var SpatialQueryMode = {
  17393. /** 包含空间查询模式。 */
  17394. CONTAIN: "CONTAIN",
  17395. /** 交叉空间查询模式。 */
  17396. CROSS: "CROSS",
  17397. /** 分离空间查询模式。 */
  17398. DISJOINT: "DISJOINT",
  17399. /** 重合空间查询模式。 */
  17400. IDENTITY: "IDENTITY",
  17401. /** 相交空间查询模式。 */
  17402. INTERSECT: "INTERSECT",
  17403. /** 无空间查询。 */
  17404. NONE: "NONE",
  17405. /** 叠加空间查询模式。 */
  17406. OVERLAP: "OVERLAP",
  17407. /** 邻接空间查询模式。 */
  17408. TOUCH: "TOUCH",
  17409. /** 被包含空间查询模式。 */
  17410. WITHIN: "WITHIN"
  17411. };
  17412. /**
  17413. * @enum SpatialRelationType
  17414. * @description 数据集对象间的空间关系枚举。
  17415. * 该类定义了数据集对象间的空间关系类型常量。
  17416. * @category BaseTypes Constant
  17417. * @type {string}
  17418. * @usage
  17419. * ```
  17420. * // 浏览器
  17421. * <script type="text/javascript" src="{cdn}"></script>
  17422. * <script>
  17423. * const result = {namespace}.SpatialRelationType.CONTAIN;
  17424. *
  17425. * </script>
  17426. * // ES6 Import
  17427. * import { SpatialRelationType } from '{npm}';
  17428. *
  17429. * const result = {namespace}.SpatialRelationType.CONTAIN;
  17430. * ```
  17431. */
  17432. var SpatialRelationType = {
  17433. /** 包含关系。 */
  17434. CONTAIN: "CONTAIN",
  17435. /** 相交关系。 */
  17436. INTERSECT: "INTERSECT",
  17437. /** 被包含关系。 */
  17438. WITHIN: "WITHIN"
  17439. };
  17440. /**
  17441. * @enum MeasureMode
  17442. * @type {string}
  17443. * @description 量算模式枚举。
  17444. * @category BaseTypes Constant
  17445. * 该类定义了两种测量模式:距离测量和面积测量。
  17446. * @usage
  17447. * ```
  17448. * // 浏览器
  17449. * <script type="text/javascript" src="{cdn}"></script>
  17450. * <script>
  17451. * const result = {namespace}.MeasureMode.DISTANCE;
  17452. *
  17453. * </script>
  17454. * // ES6 Import
  17455. * import { MeasureMode } from '{npm}';
  17456. *
  17457. * const result = MeasureMode.DISTANCE;
  17458. * ```
  17459. */
  17460. var MeasureMode = {
  17461. /** 距离测量。 */
  17462. DISTANCE: "DISTANCE",
  17463. /** 面积测量。 */
  17464. AREA: "AREA"
  17465. };
  17466. /**
  17467. * @enum Unit
  17468. * @description 距离单位枚举。
  17469. * 该类定义了一系列距离单位类型。
  17470. * @category BaseTypes Constant
  17471. * @type {string}
  17472. * @usage
  17473. * ```
  17474. * // 浏览器
  17475. * <script type="text/javascript" src="{cdn}"></script>
  17476. * <script>
  17477. * const result = {namespace}.Unit.METER;
  17478. *
  17479. * </script>
  17480. * // ES6 Import
  17481. * import { Unit } from '{npm}';
  17482. *
  17483. * const result = Unit.METER;
  17484. * ```
  17485. */
  17486. var Unit = {
  17487. /** 米。 */
  17488. METER: "METER",
  17489. /** 千米。 */
  17490. KILOMETER: "KILOMETER",
  17491. /** 英里。 */
  17492. MILE: "MILE",
  17493. /** 码。 */
  17494. YARD: "YARD",
  17495. /** 度。 */
  17496. DEGREE: "DEGREE",
  17497. /** 毫米。 */
  17498. MILLIMETER: "MILLIMETER",
  17499. /** 厘米。 */
  17500. CENTIMETER: "CENTIMETER",
  17501. /** 英寸。 */
  17502. INCH: "INCH",
  17503. /** 分米。 */
  17504. DECIMETER: "DECIMETER",
  17505. /** 英尺。 */
  17506. FOOT: "FOOT",
  17507. /** 秒。 */
  17508. SECOND: "SECOND",
  17509. /** 分。 */
  17510. MINUTE: "MINUTE",
  17511. /** 弧度。 */
  17512. RADIAN: "RADIAN"
  17513. };
  17514. /**
  17515. * @enum BufferRadiusUnit
  17516. * @description 缓冲区距离单位枚举。该类定义了一系列缓冲距离单位类型。
  17517. * @category BaseTypes Constant
  17518. * @type {string}
  17519. * @usage
  17520. * ```
  17521. * // 浏览器
  17522. * <script type="text/javascript" src="{cdn}"></script>
  17523. * <script>
  17524. * const result = {namespace}.BufferRadiusUnit.CENTIMETER;
  17525. *
  17526. * </script>
  17527. * // ES6 Import
  17528. * import { BufferRadiusUnit } from '{npm}';
  17529. *
  17530. * const result = BufferRadiusUnit.CENTIMETER;
  17531. * ```
  17532. */
  17533. var BufferRadiusUnit = {
  17534. /** 厘米。 */
  17535. CENTIMETER: "CENTIMETER",
  17536. /** 分米。 */
  17537. DECIMETER: "DECIMETER",
  17538. /** 英尺。 */
  17539. FOOT: "FOOT",
  17540. /** 英寸。 */
  17541. INCH: "INCH",
  17542. /** 千米。 */
  17543. KILOMETER: "KILOMETER",
  17544. /** 米。 */
  17545. METER: "METER",
  17546. /** 英里。 */
  17547. MILE: "MILE",
  17548. /** 毫米。 */
  17549. MILLIMETER: "MILLIMETER",
  17550. /** 码。 */
  17551. YARD: "YARD"
  17552. };
  17553. /**
  17554. * @enum EngineType
  17555. * @description 数据源引擎类型枚举。
  17556. * @category BaseTypes Constant
  17557. * @type {string}
  17558. * @usage
  17559. * ```
  17560. * // 浏览器
  17561. * <script type="text/javascript" src="{cdn}"></script>
  17562. * <script>
  17563. * const result = {namespace}.EngineType.IMAGEPLUGINS;
  17564. *
  17565. * </script>
  17566. * // ES6 Import
  17567. * import { EngineType } from '{npm}';
  17568. *
  17569. * const result = EngineType.IMAGEPLUGINS;
  17570. * ```
  17571. */
  17572. var EngineType = {
  17573. /** 影像只读引擎类型,文件引擎,针对通用影像格式如 BMP,JPG,TIFF 以及超图自定义影像格式 SIT 等。 */
  17574. IMAGEPLUGINS: "IMAGEPLUGINS",
  17575. /** OGC 引擎类型,针对于 Web 数据源,Web 引擎,目前支持的类型有 WMS,WFS,WCS。 */
  17576. OGC: "OGC",
  17577. /** Oracle 引擎类型,针对 Oracle 数据源,数据库引擎。 */
  17578. ORACLEPLUS: "ORACLEPLUS",
  17579. /** SDB 引擎类型,文件引擎,即 SDB 数据源。 */
  17580. SDBPLUS: "SDBPLUS",
  17581. /** SQL Server 引擎类型,针对 SQL Server 数据源,数据库引擎。 */
  17582. SQLPLUS: "SQLPLUS",
  17583. /** UDB 引擎类型,文件引擎。 */
  17584. UDB: "UDB"
  17585. };
  17586. /**
  17587. * @enum ThemeGraphTextFormat
  17588. * @description 统计专题图文本显示格式枚举。
  17589. * @category BaseTypes Constant
  17590. * @type {string}
  17591. * @usage
  17592. * ```
  17593. * // 浏览器
  17594. * <script type="text/javascript" src="{cdn}"></script>
  17595. * <script>
  17596. * const result = {namespace}.ThemeGraphTextFormat.CAPTION;
  17597. *
  17598. * </script>
  17599. * // ES6 Import
  17600. * import { ThemeGraphTextFormat } from '{npm}';
  17601. *
  17602. * const result = ThemeGraphTextFormat.CAPTION;
  17603. * ```
  17604. */
  17605. var ThemeGraphTextFormat = {
  17606. /** 标题。以各子项的标题来进行标注。 */
  17607. CAPTION: "CAPTION",
  17608. /** 标题 + 百分数。以各子项的标题和所占的百分比来进行标注。 */
  17609. CAPTION_PERCENT: "CAPTION_PERCENT",
  17610. /** 标题 + 实际数值。以各子项的标题和真实数值来进行标注。 */
  17611. CAPTION_VALUE: "CAPTION_VALUE",
  17612. /** 百分数。以各子项所占的百分比来进行标注。 */
  17613. PERCENT: "PERCENT",
  17614. /** 实际数值。以各子项的真实数值来进行标注。 */
  17615. VALUE: "VALUE"
  17616. };
  17617. /**
  17618. * @enum ThemeGraphType
  17619. * @description 统计专题图类型枚举。
  17620. * @category BaseTypes Constant
  17621. * @type {string}
  17622. * @usage
  17623. * ```
  17624. * // 浏览器
  17625. * <script type="text/javascript" src="{cdn}"></script>
  17626. * <script>
  17627. * const result = {namespace}.ThemeGraphType.AREA;
  17628. *
  17629. * </script>
  17630. * // ES6 Import
  17631. * import { ThemeGraphType } from '{npm}';
  17632. *
  17633. * const result = ThemeGraphType.AREA;
  17634. * ```
  17635. */
  17636. var ThemeGraphType = {
  17637. /** 面积图。 */
  17638. AREA: "AREA",
  17639. /** 柱状图。 */
  17640. BAR: "BAR",
  17641. /** 三维柱状图。 */
  17642. BAR3D: "BAR3D",
  17643. /** 折线图。 */
  17644. LINE: "LINE",
  17645. /** 饼图。 */
  17646. PIE: "PIE",
  17647. /** 三维饼图。 */
  17648. PIE3D: "PIE3D",
  17649. /** 点状图。 */
  17650. POINT: "POINT",
  17651. /** 环状图。 */
  17652. RING: "RING",
  17653. /** 玫瑰图。 */
  17654. ROSE: "ROSE",
  17655. /** 三维玫瑰图。 */
  17656. ROSE3D: "ROSE3D",
  17657. /** 堆叠柱状图。 */
  17658. STACK_BAR: "STACK_BAR",
  17659. /** 三维堆叠柱状图。 */
  17660. STACK_BAR3D: "STACK_BAR3D",
  17661. /** 阶梯图。 */
  17662. STEP: "STEP"
  17663. };
  17664. /**
  17665. * @enum GraphAxesTextDisplayMode
  17666. * @description 统计专题图坐标轴文本显示模式。
  17667. * @category BaseTypes Constant
  17668. * @type {string}
  17669. * @usage
  17670. * ```
  17671. * // 浏览器
  17672. * <script type="text/javascript" src="{cdn}"></script>
  17673. * <script>
  17674. * const result = {namespace}.GraphAxesTextDisplayMode.ALL;
  17675. *
  17676. * </script>
  17677. * // ES6 Import
  17678. * import { GraphAxesTextDisplayMode } from '{npm}';
  17679. *
  17680. * const result = GraphAxesTextDisplayMode.ALL;
  17681. * ```
  17682. */
  17683. var GraphAxesTextDisplayMode = {
  17684. /** 显示全部文本。 */
  17685. ALL: "ALL",
  17686. /** 不显示。 */
  17687. NONE: "NONE",
  17688. /** 显示Y轴的文本。 */
  17689. YAXES: "YAXES"
  17690. };
  17691. /**
  17692. * @enum GraduatedMode
  17693. * @description 专题图分级模式枚举。
  17694. * @category BaseTypes Constant
  17695. * @type {string}
  17696. * @usage
  17697. * ```
  17698. * // 浏览器
  17699. * <script type="text/javascript" src="{cdn}"></script>
  17700. * <script>
  17701. * const result = {namespace}.GraduatedMode.CONSTANT;
  17702. *
  17703. * </script>
  17704. * // ES6 Import
  17705. * import { GraduatedMode } from '{npm}';
  17706. *
  17707. * const result = GraduatedMode.CONSTANT;
  17708. * ```
  17709. */
  17710. var GraduatedMode = {
  17711. /** 常量分级模式。 */
  17712. CONSTANT: "CONSTANT",
  17713. /** 对数分级模式。 */
  17714. LOGARITHM: "LOGARITHM",
  17715. /** 平方根分级模式。 */
  17716. SQUAREROOT: "SQUAREROOT"
  17717. };
  17718. /**
  17719. * @enum RangeMode
  17720. * @description 范围分段专题图分段方式枚举。
  17721. * @category BaseTypes Constant
  17722. * @type {string}
  17723. * @usage
  17724. * ```
  17725. * // 浏览器
  17726. * <script type="text/javascript" src="{cdn}"></script>
  17727. * <script>
  17728. * const result = {namespace}.RangeMode.CUSTOMINTERVAL;
  17729. *
  17730. * </script>
  17731. * // ES6 Import
  17732. * import { RangeMode } from '{npm}';
  17733. *
  17734. * const result = RangeMode.CUSTOMINTERVAL;
  17735. * ```
  17736. */
  17737. var RangeMode = {
  17738. /** 自定义分段法。 */
  17739. CUSTOMINTERVAL: "CUSTOMINTERVAL",
  17740. /** 等距离分段法。 */
  17741. EQUALINTERVAL: "EQUALINTERVAL",
  17742. /** 对数分段法。 */
  17743. LOGARITHM: "LOGARITHM",
  17744. /** 等计数分段法。 */
  17745. QUANTILE: "QUANTILE",
  17746. /** 平方根分段法。 */
  17747. SQUAREROOT: "SQUAREROOT",
  17748. /** 标准差分段法。 */
  17749. STDDEVIATION: "STDDEVIATION"
  17750. };
  17751. /**
  17752. * @enum ThemeType
  17753. * @description 专题图类型枚举。
  17754. * @category BaseTypes Constant
  17755. * @type {string}
  17756. * @usage
  17757. * ```
  17758. * // 浏览器
  17759. * <script type="text/javascript" src="{cdn}"></script>
  17760. * <script>
  17761. * const result = {namespace}.ThemeType.DOTDENSITY;
  17762. *
  17763. * </script>
  17764. * // ES6 Import
  17765. * import { ThemeType } from '{npm}';
  17766. *
  17767. * const result = ThemeType.DOTDENSITY;
  17768. * ```
  17769. */
  17770. var ThemeType = {
  17771. /** 点密度专题图。 */
  17772. DOTDENSITY: "DOTDENSITY",
  17773. /** 等级符号专题图。 */
  17774. GRADUATEDSYMBOL: "GRADUATEDSYMBOL",
  17775. /** 统计专题图。 */
  17776. GRAPH: "GRAPH",
  17777. /** 标签专题图。 */
  17778. LABEL: "LABEL",
  17779. /** 分段专题图。 */
  17780. RANGE: "RANGE",
  17781. /** 単值专题图。 */
  17782. UNIQUE: "UNIQUE"
  17783. };
  17784. /**
  17785. * @enum ColorGradientType
  17786. * @description 渐变颜色枚举。
  17787. * @category BaseTypes Constant
  17788. * @type {string}
  17789. * @usage
  17790. * ```
  17791. * // 浏览器
  17792. * <script type="text/javascript" src="{cdn}"></script>
  17793. * <script>
  17794. * const result = {namespace}.ColorGradientType.BLACK_WHITE;
  17795. *
  17796. * </script>
  17797. * // ES6 Import
  17798. * import { ColorGradientType } from '{npm}';
  17799. *
  17800. * const result = ColorGradientType.BLACK_WHITE;
  17801. * ```
  17802. */
  17803. var ColorGradientType = {
  17804. /** 黑白渐变色。 */
  17805. BLACK_WHITE: "BLACKWHITE",
  17806. /** 蓝黑渐变色。 */
  17807. BLUE_BLACK: "BLUEBLACK",
  17808. /** 蓝红渐变色。 */
  17809. BLUE_RED: "BLUERED",
  17810. /** 蓝白渐变色。 */
  17811. BLUE_WHITE: "BLUEWHITE",
  17812. /** 青黑渐变色。 */
  17813. CYAN_BLACK: "CYANBLACK",
  17814. /** 青蓝渐变色。 */
  17815. CYAN_BLUE: "CYANBLUE",
  17816. /** 青绿渐变色。 */
  17817. CYAN_GREEN: "CYANGREEN",
  17818. /** 青白渐变色。 */
  17819. CYAN_WHITE: "CYANWHITE",
  17820. /** 绿黑渐变色。 */
  17821. GREEN_BLACK: "GREENBLACK",
  17822. /** 绿蓝渐变色。 */
  17823. GREEN_BLUE: "GREENBLUE",
  17824. /** 绿橙紫渐变色。 */
  17825. GREEN_ORANGE_VIOLET: "GREENORANGEVIOLET",
  17826. /** 绿红渐变色。 */
  17827. GREEN_RED: "GREENRED",
  17828. /** 蓝红渐变色。 */
  17829. GREEN_WHITE: "GREENWHITE",
  17830. /** 粉黑渐变色。 */
  17831. PINK_BLACK: "PINKBLACK",
  17832. /** 粉蓝渐变色。 */
  17833. PINK_BLUE: "PINKBLUE",
  17834. /** 粉红渐变色。 */
  17835. PINK_RED: "PINKRED",
  17836. /** 粉白渐变色。 */
  17837. PINK_WHITE: "PINKWHITE",
  17838. /** 彩虹色。 */
  17839. RAIN_BOW: "RAINBOW",
  17840. /** 红黑渐变色。 */
  17841. RED_BLACK: "REDBLACK",
  17842. /** 红白渐变色。 */
  17843. RED_WHITE: "REDWHITE",
  17844. /** 光谱渐变。 */
  17845. SPECTRUM: "SPECTRUM",
  17846. /** 地形渐变,用于三维显示效果较好。 */
  17847. TERRAIN: "TERRAIN",
  17848. /** 黄黑渐变色。 */
  17849. YELLOW_BLACK: "YELLOWBLACK",
  17850. /** 黄蓝渐变色。 */
  17851. YELLOW_BLUE: "YELLOWBLUE",
  17852. /** 黄绿渐变色。 */
  17853. YELLOW_GREEN: "YELLOWGREEN",
  17854. /** 黄红渐变色。 */
  17855. YELLOW_RED: "YELLOWRED",
  17856. /** 黄白渐变色。 */
  17857. YELLOW_WHITE: "YELLOWWHITE"
  17858. };
  17859. /**
  17860. * @enum TextAlignment
  17861. * @description 文本对齐枚举。
  17862. * @category BaseTypes Constant
  17863. * @type {string}
  17864. * @usage
  17865. * ```
  17866. * // 浏览器
  17867. * <script type="text/javascript" src="{cdn}"></script>
  17868. * <script>
  17869. * const result = {namespace}.TextAlignment.TOPLEFT;
  17870. *
  17871. * </script>
  17872. * // ES6 Import
  17873. * import { TextAlignment } from '{npm}';
  17874. *
  17875. * const result = TextAlignment.TOPLEFT;
  17876. * ```
  17877. */
  17878. var TextAlignment = {
  17879. /** 左上角对齐。 */
  17880. TOPLEFT: "TOPLEFT",
  17881. /** 顶部居中对齐。 */
  17882. TOPCENTER: "TOPCENTER",
  17883. /** 右上角对齐。 */
  17884. TOPRIGHT: "TOPRIGHT",
  17885. /** 基准线左对齐。 */
  17886. BASELINELEFT: "BASELINELEFT",
  17887. /** 基准线居中对齐。 */
  17888. BASELINECENTER: "BASELINECENTER",
  17889. /** 基准线右对齐。 */
  17890. BASELINERIGHT: "BASELINERIGHT",
  17891. /** 左下角对齐。 */
  17892. BOTTOMLEFT: "BOTTOMLEFT",
  17893. /** 底部居中对齐。 */
  17894. BOTTOMCENTER: "BOTTOMCENTER",
  17895. /** 右下角对齐。 */
  17896. BOTTOMRIGHT: "BOTTOMRIGHT",
  17897. /** 左中对齐。 */
  17898. MIDDLELEFT: "MIDDLELEFT",
  17899. /** 中心对齐。 */
  17900. MIDDLECENTER: "MIDDLECENTER",
  17901. /** 右中对齐。 */
  17902. MIDDLERIGHT: "MIDDLERIGHT"
  17903. };
  17904. /**
  17905. * @enum FillGradientMode
  17906. * @description 渐变填充风格的渐变类型枚举。
  17907. * @category BaseTypes Constant
  17908. * @type {string}
  17909. * @usage
  17910. * ```
  17911. * // 浏览器
  17912. * <script type="text/javascript" src="{cdn}"></script>
  17913. * <script>
  17914. * const result = {namespace}.FillGradientMode.NONE;
  17915. *
  17916. * </script>
  17917. * // ES6 Import
  17918. * import { FillGradientMode } from '{npm}';
  17919. *
  17920. * const result = FillGradientMode.NONE;
  17921. * ```
  17922. */
  17923. var FillGradientMode = {
  17924. /** 无渐变。 */
  17925. NONE: "NONE",
  17926. /** 线性渐变填充。 */
  17927. LINEAR: "LINEAR",
  17928. /** 辐射渐变填充。 */
  17929. RADIAL: "RADIAL",
  17930. /** 圆锥渐变填充。 */
  17931. CONICAL: "CONICAL",
  17932. /** 四角渐变填充。 */
  17933. SQUARE: "SQUARE"
  17934. };
  17935. /**
  17936. * @enum AlongLineDirection
  17937. * @description 标签沿线标注方向枚举。
  17938. * @category BaseTypes Constant
  17939. * @type {string}
  17940. * @usage
  17941. * ```
  17942. * // 浏览器
  17943. * <script type="text/javascript" src="{cdn}"></script>
  17944. * <script>
  17945. * const result = {namespace}.AlongLineDirection.NORMAL;
  17946. *
  17947. * </script>
  17948. * // ES6 Import
  17949. * import { AlongLineDirection } from '{npm}';
  17950. *
  17951. * const result = AlongLineDirection.NORMAL;
  17952. * ```
  17953. */
  17954. var AlongLineDirection = {
  17955. /** 沿线的法线方向放置标签。 */
  17956. NORMAL: "ALONG_LINE_NORMAL",
  17957. /** 从下到上,从左到右放置。 */
  17958. LB_TO_RT: "LEFT_BOTTOM_TO_RIGHT_TOP",
  17959. /** 从上到下,从左到右放置。 */
  17960. LT_TO_RB: "LEFT_TOP_TO_RIGHT_BOTTOM",
  17961. /** 从下到上,从右到左放置。 */
  17962. RB_TO_LT: "RIGHT_BOTTOM_TO_LEFT_TOP",
  17963. /** 从上到下,从右到左放置。 */
  17964. RT_TO_LB: "RIGHT_TOP_TO_LEFT_BOTTOM"
  17965. };
  17966. /**
  17967. * @enum LabelBackShape
  17968. * @description 标签专题图中标签背景的形状枚举。
  17969. * @category BaseTypes Constant
  17970. * @type {string}
  17971. * @usage
  17972. * ```
  17973. * // 浏览器
  17974. * <script type="text/javascript" src="{cdn}"></script>
  17975. * <script>
  17976. * const result = {namespace}.LabelBackShape.DIAMOND;
  17977. *
  17978. * </script>
  17979. * // ES6 Import
  17980. * import { LabelBackShape } from '{npm}';
  17981. *
  17982. * const result = LabelBackShape.DIAMOND;
  17983. * ```
  17984. */
  17985. var LabelBackShape = {
  17986. /** 菱形背景,即标签背景的形状为菱形。 */
  17987. DIAMOND: "DIAMOND",
  17988. /** 椭圆形背景,即标签背景的行状为椭圆形。 */
  17989. ELLIPSE: "ELLIPSE",
  17990. /** 符号背景,即标签背景的形状为设定的符号。 */
  17991. MARKER: "MARKER",
  17992. /** 空背景,即不使用任何形状作为标签的背景。 */
  17993. NONE: "NONE",
  17994. /** 矩形背景,即标签背景的形状为矩形。 */
  17995. RECT: "RECT",
  17996. /** 圆角矩形背景,即标签背景的形状为圆角矩形。 */
  17997. ROUNDRECT: "ROUNDRECT",
  17998. /** 三角形背景,即标签背景的形状为三角形。 */
  17999. TRIANGLE: "TRIANGLE"
  18000. };
  18001. /**
  18002. * @enum LabelOverLengthMode
  18003. * @description 标签专题图中超长标签的处理模式枚举。
  18004. * @category BaseTypes Constant
  18005. * @type {string}
  18006. * @usage
  18007. * ```
  18008. * // 浏览器
  18009. * <script type="text/javascript" src="{cdn}"></script>
  18010. * <script>
  18011. * const result = {namespace}.LabelOverLengthMode.NEWLINE;
  18012. *
  18013. * </script>
  18014. * // ES6 Import
  18015. * import { LabelOverLengthMode } from '{npm}';
  18016. *
  18017. * const result = LabelOverLengthMode.NEWLINE;
  18018. * ```
  18019. */
  18020. var LabelOverLengthMode = {
  18021. /** 换行显示。 */
  18022. NEWLINE: "NEWLINE",
  18023. /** 对超长标签不进行处理。 */
  18024. NONE: "NONE",
  18025. /** 省略超出部分。 */
  18026. OMIT: "OMIT"
  18027. };
  18028. /**
  18029. * @enum DirectionType
  18030. * @description 网络分析中方向枚举。
  18031. * 在行驶引导子项中使用。
  18032. * @category BaseTypes Constant
  18033. * @type {string}
  18034. * @usage
  18035. * ```
  18036. * // 浏览器
  18037. * <script type="text/javascript" src="{cdn}"></script>
  18038. * <script>
  18039. * const result = {namespace}.DirectionType.EAST;
  18040. *
  18041. * </script>
  18042. * // ES6 Import
  18043. * import { DirectionType } from '{npm}';
  18044. *
  18045. * const result = DirectionType.EAST;
  18046. * ```
  18047. */
  18048. var DirectionType = {
  18049. /** 东。 */
  18050. EAST: "EAST",
  18051. /** 无方向。 */
  18052. NONE: "NONE",
  18053. /** 北。 */
  18054. NORTH: "NORTH",
  18055. /** 南。 */
  18056. SOURTH: "SOURTH",
  18057. /** 西。 */
  18058. WEST: "WEST"
  18059. };
  18060. /**
  18061. * @enum SideType
  18062. * @description 行驶位置枚举。
  18063. * 表示在行驶在路的左边、右边或者路上的枚举,该类用在行驶导引子项类中。
  18064. * @category BaseTypes Constant
  18065. * @type {string}
  18066. * @usage
  18067. * ```
  18068. * // 浏览器
  18069. * <script type="text/javascript" src="{cdn}"></script>
  18070. * <script>
  18071. * const result = {namespace}.SideType.LEFT;
  18072. *
  18073. * </script>
  18074. * // ES6 Import
  18075. * import { SideType } from '{npm}';
  18076. *
  18077. * const result = SideType.LEFT;
  18078. * ```
  18079. */
  18080. var SideType = {
  18081. /** 路的左侧。 */
  18082. LEFT: "LEFT",
  18083. /** 在路上(即路的中间)。 */
  18084. MIDDLE: "MIDDLE",
  18085. /** 无效值。 */
  18086. NONE: "NONE",
  18087. /** 路的右侧。 */
  18088. RIGHT: "RIGHT"
  18089. };
  18090. /**
  18091. * @enum SupplyCenterType
  18092. * @description 资源供给中心类型枚举。
  18093. * 该枚举定义了网络分析中资源中心点的类型,主要用于资源分配和选址分区。
  18094. * 资源供给中心点的类型包括非中心,固定中心和可选中心。固定中心用于资源分配分析;固定中心和可选中心用于选址分析;非中心在两种网络分析时都不予考虑。
  18095. * @category BaseTypes Constant
  18096. * @type {string}
  18097. * @usage
  18098. * ```
  18099. * // 浏览器
  18100. * <script type="text/javascript" src="{cdn}"></script>
  18101. * <script>
  18102. * const result = {namespace}.SupplyCenterType.FIXEDCENTER;
  18103. *
  18104. * </script>
  18105. * // ES6 Import
  18106. * import { SupplyCenterType } from '{npm}';
  18107. *
  18108. * const result = SupplyCenterType.FIXEDCENTER;
  18109. * ```
  18110. */
  18111. var SupplyCenterType = {
  18112. /** 固定中心点。 */
  18113. FIXEDCENTER: "FIXEDCENTER",
  18114. /** 非中心点。 */
  18115. NULL: "NULL",
  18116. /** 可选中心点。 */
  18117. OPTIONALCENTER: "OPTIONALCENTER"
  18118. };
  18119. /**
  18120. * @enum TurnType
  18121. * @description 转弯方向枚举。
  18122. * 用在行驶引导子项类中,表示转弯的方向。
  18123. * @category BaseTypes Constant
  18124. * @type {string}
  18125. * @usage
  18126. * ```
  18127. * // 浏览器
  18128. * <script type="text/javascript" src="{cdn}"></script>
  18129. * <script>
  18130. * const result = {namespace}.TurnType.AHEAD;
  18131. *
  18132. * </script>
  18133. * // ES6 Import
  18134. * import { TurnType } from '{npm}';
  18135. *
  18136. * const result = TurnType.AHEAD;
  18137. * ```
  18138. */
  18139. var TurnType = {
  18140. /** 向前直行。 */
  18141. AHEAD: "AHEAD",
  18142. /** 掉头。 */
  18143. BACK: "BACK",
  18144. /** 终点,不拐弯。 */
  18145. END: "END",
  18146. /** 左转弯。 */
  18147. LEFT: "LEFT",
  18148. /** 无效值。 */
  18149. NONE: "NONE",
  18150. /** 右转弯。 */
  18151. RIGHT: "RIGHT"
  18152. };
  18153. /**
  18154. * @enum BufferEndType
  18155. * @description 缓冲区分析BufferEnd类型。
  18156. * @category BaseTypes Constant
  18157. * @type {string}
  18158. * @usage
  18159. * ```
  18160. * // 浏览器
  18161. * <script type="text/javascript" src="{cdn}"></script>
  18162. * <script>
  18163. * const result = {namespace}.BufferEndType.FLAT;
  18164. *
  18165. * </script>
  18166. * // ES6 Import
  18167. * import { BufferEndType } from '{npm}';
  18168. *
  18169. * const result = BufferEndType.FLAT;
  18170. * ```
  18171. */
  18172. var BufferEndType = {
  18173. /** 平头缓冲。 */
  18174. FLAT: "FLAT",
  18175. /** 圆头缓冲。 */
  18176. ROUND: "ROUND"
  18177. };
  18178. /**
  18179. * @enum OverlayOperationType
  18180. * @description 叠加分析类型枚举。
  18181. * @category BaseTypes Constant
  18182. * @type {string}
  18183. * @usage
  18184. * ```
  18185. * // 浏览器
  18186. * <script type="text/javascript" src="{cdn}"></script>
  18187. * <script>
  18188. * const result = {namespace}.OverlayOperationType.CLIP;
  18189. *
  18190. * </script>
  18191. * // ES6 Import
  18192. * import { OverlayOperationType } from '{npm}';
  18193. *
  18194. * const result = OverlayOperationType.CLIP;
  18195. * ```
  18196. */
  18197. var OverlayOperationType = {
  18198. /** 操作数据集(几何对象)裁剪被操作数据集(几何对象)。 */
  18199. CLIP: "CLIP",
  18200. /** 在被操作数据集(几何对象)上擦除掉与操作数据集(几何对象)相重合的部分。 */
  18201. ERASE: "ERASE",
  18202. /**对被操作数据集(几何对象)进行同一操作,即操作执行后,被操作数据集(几何对象)包含来自操作数据集(几何对象)的几何形状。 */
  18203. IDENTITY: "IDENTITY",
  18204. /** 对两个数据集(几何对象)求交,返回两个数据集(几何对象)的交集。 */
  18205. INTERSECT: "INTERSECT",
  18206. /** 对两个面数据集(几何对象)进行合并操作。 */
  18207. UNION: "UNION",
  18208. /** 对两个面数据集(几何对象)进行更新操作。 */
  18209. UPDATE: "UPDATE",
  18210. /** 对两个面数据集(几何对象)进行对称差操作。 */
  18211. XOR: "XOR"
  18212. };
  18213. /**
  18214. * @enum OutputType
  18215. * @description 分布式分析输出类型枚举。
  18216. * @category BaseTypes Constant
  18217. * @type {string}
  18218. * @usage
  18219. * ```
  18220. * // 浏览器
  18221. * <script type="text/javascript" src="{cdn}"></script>
  18222. * <script>
  18223. * const result = {namespace}.OutputType.INDEXEDHDFS;
  18224. *
  18225. * </script>
  18226. * // ES6 Import
  18227. * import { OutputType } from '{npm}';
  18228. *
  18229. * const result = OutputType.INDEXEDHDFS;
  18230. * ```
  18231. */
  18232. var OutputType = {
  18233. /** INDEXEDHDFS */
  18234. INDEXEDHDFS: "INDEXEDHDFS",
  18235. /** UDB */
  18236. UDB: "UDB",
  18237. /** MONGODB */
  18238. MONGODB: "MONGODB",
  18239. /** PG */
  18240. PG: "PG"
  18241. };
  18242. /**
  18243. * @enum SmoothMethod
  18244. * @description 光滑方法枚举。
  18245. * 用于从Grid 或DEM数据生成等值线或等值面时对等值线或者等值面的边界线进行平滑处理的方法。
  18246. * @category BaseTypes Constant
  18247. * @type {string}
  18248. * @usage
  18249. * ```
  18250. * // 浏览器
  18251. * <script type="text/javascript" src="{cdn}"></script>
  18252. * <script>
  18253. * const result = {namespace}.SmoothMethod.BSPLINE;
  18254. *
  18255. * </script>
  18256. * // ES6 Import
  18257. * import { SmoothMethod } from '{npm}';
  18258. *
  18259. * const result = SmoothMethod.BSPLINE;
  18260. * ```
  18261. */
  18262. var SmoothMethod = {
  18263. /** B 样条法。 */
  18264. BSPLINE: "BSPLINE",
  18265. /** 磨角法。 */
  18266. POLISH: "POLISH"
  18267. };
  18268. /**
  18269. * @enum SurfaceAnalystMethod
  18270. * @description 表面分析方法枚举。
  18271. * 通过对数据进行表面分析,能够挖掘原始数据所包含的信息,使某些细节明显化,易于分析。
  18272. * @category BaseTypes Constant
  18273. * @type {string}
  18274. * @usage
  18275. * ```
  18276. * // 浏览器
  18277. * <script type="text/javascript" src="{cdn}"></script>
  18278. * <script>
  18279. * const result = {namespace}.SurfaceAnalystMethod.ISOLINE;
  18280. *
  18281. * </script>
  18282. * // ES6 Import
  18283. * import { SurfaceAnalystMethod } from '{npm}';
  18284. *
  18285. * const result = SurfaceAnalystMethod.ISOLINE;
  18286. * ```
  18287. */
  18288. var SurfaceAnalystMethod = {
  18289. /** 等值线提取。 */
  18290. ISOLINE: "ISOLINE",
  18291. /** 等值面提取。 */
  18292. ISOREGION: "ISOREGION"
  18293. };
  18294. /**
  18295. * @enum DataReturnMode
  18296. * @description 数据返回模式枚举。
  18297. * 该枚举用于指定空间分析返回结果模式,包含返回数据集标识和记录集、只返回数据集标识(数据集名称@数据源名称)及只返回记录集三种模式。
  18298. * @category BaseTypes Constant
  18299. * @type {string}
  18300. * @usage
  18301. * ```
  18302. * // 浏览器
  18303. * <script type="text/javascript" src="{cdn}"></script>
  18304. * <script>
  18305. * const result = {namespace}.DataReturnMode.DATASET_AND_RECORDSET;
  18306. *
  18307. * </script>
  18308. * // ES6 Import
  18309. * import { DataReturnMode } from '{npm}';
  18310. *
  18311. * const result = DataReturnMode.DATASET_AND_RECORDSET;
  18312. * ```
  18313. */
  18314. var DataReturnMode = {
  18315. /** 返回结果数据集标识(数据集名称@数据源名称)和记录集(RecordSet)。 */
  18316. DATASET_AND_RECORDSET: "DATASET_AND_RECORDSET",
  18317. /** 只返回数据集标识(数据集名称@数据源名称)。 */
  18318. DATASET_ONLY: "DATASET_ONLY",
  18319. /** 只返回记录集(RecordSet)。 */
  18320. RECORDSET_ONLY: "RECORDSET_ONLY"
  18321. };
  18322. /**
  18323. * @enum EditType
  18324. * @description 要素集更新模式枚举。
  18325. * 该枚举用于指定数据服务中要素集更新模式,包含添加要素集、更新要素集和删除要素集。
  18326. * @category BaseTypes Constant
  18327. * @type {string}
  18328. * @usage
  18329. * ```
  18330. * // 浏览器
  18331. * <script type="text/javascript" src="{cdn}"></script>
  18332. * <script>
  18333. * const result = {namespace}.EditType.ADD;
  18334. *
  18335. * </script>
  18336. * // ES6 Import
  18337. * import { EditType } from '{npm}';
  18338. *
  18339. * const result = {namespace}.EditType.ADD;
  18340. * ```
  18341. */
  18342. var EditType = {
  18343. /** 增加操作。 */
  18344. ADD: "add",
  18345. /** 修改操作。 */
  18346. UPDATE: "update",
  18347. /** 删除操作。 */
  18348. DELETE: "delete"
  18349. };
  18350. /**
  18351. * @enum TransferTactic
  18352. * @description 公交换乘策略枚举。
  18353. * 该枚举用于指定公交服务中要素集更新模式,包含添加要素集、更新要素集和删除要素集。
  18354. * @category BaseTypes Constant
  18355. * @type {string}
  18356. * @usage
  18357. * ```
  18358. * // 浏览器
  18359. * <script type="text/javascript" src="{cdn}"></script>
  18360. * <script>
  18361. * const result = {namespace}.TransferTactic.LESS_TIME;
  18362. *
  18363. * </script>
  18364. * // ES6 Import
  18365. * import { TransferTactic } from '{npm}';
  18366. *
  18367. * const result = TransferTactic.LESS_TIME;
  18368. * ```
  18369. */
  18370. var TransferTactic = {
  18371. /** 时间短。 */
  18372. LESS_TIME: "LESS_TIME",
  18373. /** 少换乘。 */
  18374. LESS_TRANSFER: "LESS_TRANSFER",
  18375. /** 少步行。 */
  18376. LESS_WALK: "LESS_WALK",
  18377. /** 距离最短。 */
  18378. MIN_DISTANCE: "MIN_DISTANCE"
  18379. };
  18380. /**
  18381. * @enum TransferPreference
  18382. * @description 公交换乘策略枚举。
  18383. * 该枚举用于指定交通换乘服务中设置地铁优先、公交优先、不乘地铁、无偏好等偏好设置。
  18384. * @category BaseTypes Constant
  18385. * @type {string}
  18386. * @usage
  18387. * ```
  18388. * // 浏览器
  18389. * <script type="text/javascript" src="{cdn}"></script>
  18390. * <script>
  18391. * const result = {namespace}.TransferPreference.BUS;
  18392. *
  18393. * </script>
  18394. * // ES6 Import
  18395. * import { TransferPreference } from '{npm}';
  18396. *
  18397. * const result = TransferPreference.BUS;
  18398. * ```
  18399. */
  18400. var TransferPreference = {
  18401. /** 公交汽车优先。 */
  18402. BUS: "BUS",
  18403. /** 地铁优先。 */
  18404. SUBWAY: "SUBWAY",
  18405. /** 不乘坐地铁。 */
  18406. NO_SUBWAY: "NO_SUBWAY",
  18407. /** 无乘车偏好。 */
  18408. NONE: "NONE"
  18409. };
  18410. /**
  18411. * @enum GridType
  18412. * @description 地图背景格网类型枚举。
  18413. * @category BaseTypes Constant
  18414. * @type {string}
  18415. * @usage
  18416. * ```
  18417. * // 浏览器
  18418. * <script type="text/javascript" src="{cdn}"></script>
  18419. * <script>
  18420. * const result = {namespace}.GridType.CROSS;
  18421. *
  18422. * </script>
  18423. * // ES6 Import
  18424. * import { GridType } from '{npm}';
  18425. *
  18426. * const result = GridType.CROSS;
  18427. * ```
  18428. */
  18429. var GridType = {
  18430. /** 十字叉丝。 */
  18431. CROSS: "CROSS",
  18432. /** 网格线。 */
  18433. GRID: "GRID",
  18434. /** 点。 */
  18435. POINT: "POINT"
  18436. };
  18437. /**
  18438. * @enum ColorSpaceType
  18439. * @description 色彩空间枚举。
  18440. * 由于成色原理的不同,决定了显示器、投影仪这类靠色光直接合成颜色的颜色设备和打印机、
  18441. * 印刷机这类靠使用颜料的印刷设备在生成颜色方式上的区别。
  18442. * 针对上述不同成色方式,SuperMap 提供两种色彩空间,
  18443. * 分别为 RGB 和 CMYK。RGB 主要用于显示系统中,CMYK 主要用于印刷系统中。
  18444. * @category BaseTypes Constant
  18445. * @type {string}
  18446. * @usage
  18447. * ```
  18448. * // 浏览器
  18449. * <script type="text/javascript" src="{cdn}"></script>
  18450. * <script>
  18451. * const result = {namespace}.ColorSpaceType.CMYK;
  18452. *
  18453. * </script>
  18454. * // ES6 Import
  18455. * import { ColorSpaceType } from '{npm}';
  18456. *
  18457. * const result = ColorSpaceType.CMYK;
  18458. * ```
  18459. */
  18460. var ColorSpaceType = {
  18461. /** 该类型主要在印刷系统使用。 */
  18462. CMYK: "CMYK",
  18463. /** 该类型主要在显示系统中使用。 */
  18464. RGB: "RGB"
  18465. };
  18466. /**
  18467. * @enum LayerType
  18468. * @description 图层类型。
  18469. * @category BaseTypes Constant
  18470. * @type {string}
  18471. * @usage
  18472. * ```
  18473. * // 浏览器
  18474. * <script type="text/javascript" src="{cdn}"></script>
  18475. * <script>
  18476. * const result = {namespace}.LayerType.UGC;
  18477. *
  18478. * </script>
  18479. * // ES6 Import
  18480. * import { LayerType } from '{npm}';
  18481. *
  18482. * const result = LayerType.UGC;
  18483. * ```
  18484. */
  18485. var LayerType = {
  18486. /** SuperMap UGC 类型图层。如矢量图层、栅格(Grid)图层、影像图层。 */
  18487. UGC: "UGC",
  18488. /** WMS 图层。 */
  18489. WMS: "WMS",
  18490. /** WFS 图层。 */
  18491. WFS: "WFS",
  18492. /** 自定义图层。 */
  18493. CUSTOM: "CUSTOM"
  18494. };
  18495. /**
  18496. * @enum UGCLayerType
  18497. * @description SuperMap 图层类型。
  18498. * @category BaseTypes Constant
  18499. * @type {string}
  18500. * @usage
  18501. * ```
  18502. * // 浏览器
  18503. * <script type="text/javascript" src="{cdn}"></script>
  18504. * <script>
  18505. * const result = {namespace}.UGCLayerType.THEME;
  18506. *
  18507. * </script>
  18508. * // ES6 Import
  18509. * import { UGCLayerType } from '{npm}';
  18510. *
  18511. * const result = UGCLayerType.THEME;
  18512. * ```
  18513. */
  18514. var UGCLayerType = {
  18515. /** 专题图层。 */
  18516. THEME: "THEME",
  18517. /** 矢量图层。 */
  18518. VECTOR: "VECTOR",
  18519. /** 栅格图层。 */
  18520. GRID: "GRID",
  18521. /** 影像图层。 */
  18522. IMAGE: "IMAGE"
  18523. };
  18524. /**
  18525. * @enum StatisticMode
  18526. * @description 字段统计方法类型。
  18527. * @category BaseTypes Constant
  18528. * @type {string}
  18529. * @usage
  18530. * ```
  18531. * // 浏览器
  18532. * <script type="text/javascript" src="{cdn}"></script>
  18533. * <script>
  18534. * const result = {namespace}.StatisticMode.AVERAGE;
  18535. *
  18536. * </script>
  18537. * // ES6 Import
  18538. * import { StatisticMode } from '{npm}';
  18539. *
  18540. * const result = StatisticMode.AVERAGE;
  18541. * ```
  18542. */
  18543. var StatisticMode = {
  18544. /** 统计所选字段的平均值。 */
  18545. AVERAGE: "AVERAGE",
  18546. /** 统计所选字段的最大值。 */
  18547. MAX: "MAX",
  18548. /** 统计所选字段的最小值。 */
  18549. MIN: "MIN",
  18550. /** 统计所选字段的标准差 */
  18551. STDDEVIATION: "STDDEVIATION",
  18552. /** 统计所选字段的总和。 */
  18553. SUM: "SUM",
  18554. /** 统计所选字段的方差。 */
  18555. VARIANCE: "VARIANCE"
  18556. };
  18557. /**
  18558. * @enum PixelFormat
  18559. * @description 栅格与影像数据存储的像素格式枚举。
  18560. * @category BaseTypes Constant
  18561. * @type {string}
  18562. * @usage
  18563. * ```
  18564. * // 浏览器
  18565. * <script type="text/javascript" src="{cdn}"></script>
  18566. * <script>
  18567. * const result = {namespace}.PixelFormat.BIT16;
  18568. *
  18569. * </script>
  18570. * // ES6 Import
  18571. * import { PixelFormat } from '{npm}';
  18572. *
  18573. * const result = PixelFormat.BIT16;
  18574. * ```
  18575. */
  18576. var PixelFormat = {
  18577. /** 每个像元用16个比特(即2个字节)表示。 */
  18578. BIT16: "BIT16",
  18579. /** 每个像元用32个比特(即4个字节)表示。 */
  18580. BIT32: "BIT32",
  18581. /** 每个像元用64个比特(即8个字节)表示,只提供给栅格数据集使用。 */
  18582. BIT64: "BIT64",
  18583. /** 每个像元用4个字节来表示,只提供给栅格数据集使用。 */
  18584. SINGLE: "SINGLE",
  18585. /** 每个像元用8个字节来表示,只提供给栅格数据集使用。 */
  18586. DOUBLE: "DOUBLE",
  18587. /** 每个像元用1个比特表示。 */
  18588. UBIT1: "UBIT1",
  18589. /** 每个像元用4个比特来表示。 */
  18590. UBIT4: "UBIT4",
  18591. /** 每个像元用8个比特(即1个字节)来表示。 */
  18592. UBIT8: "UBIT8",
  18593. /** 每个像元用24个比特(即3个字节)来表示。 */
  18594. UBIT24: "UBIT24",
  18595. /** 每个像元用32个比特(即4个字节)来表示。 */
  18596. UBIT32: "UBIT32"
  18597. };
  18598. /**
  18599. * @enum SearchMode
  18600. * @description 内插时使用的样本点的查找方式枚举。
  18601. * @category BaseTypes Constant
  18602. * @type {string}
  18603. * @usage
  18604. * ```
  18605. * // 浏览器
  18606. * <script type="text/javascript" src="{cdn}"></script>
  18607. * <script>
  18608. * const result = {namespace}.SearchMode.KDTREE_FIXED_COUNT;
  18609. *
  18610. * </script>
  18611. * // ES6 Import
  18612. * import { SearchMode } from '{npm}';
  18613. *
  18614. * const result = SearchMode.KDTREE_FIXED_COUNT;
  18615. * ```
  18616. */
  18617. var SearchMode = {
  18618. /** 使用 KDTREE 的固定点数方式查找参与内插分析的点。 */
  18619. KDTREE_FIXED_COUNT: "KDTREE_FIXED_COUNT",
  18620. /** 使用 KDTREE 的定长方式查找参与内插分析的点。 */
  18621. KDTREE_FIXED_RADIUS: "KDTREE_FIXED_RADIUS",
  18622. /** 不进行查找,使用所有的输入点进行内插分析。 */
  18623. NONE: "NONE",
  18624. /** 使用 QUADTREE 方式查找参与内插分析的点,仅对样条(RBF)插值和普通克吕金(Kriging)有用。 */
  18625. QUADTREE: "QUADTREE"
  18626. };
  18627. /**
  18628. * @enum InterpolationAlgorithmType
  18629. * @description 插值分析的算法的类型。
  18630. * @category BaseTypes Constant
  18631. * @type {string}
  18632. * @usage
  18633. * ```
  18634. * // 浏览器
  18635. * <script type="text/javascript" src="{cdn}"></script>
  18636. * <script>
  18637. * const result = {namespace}.InterpolationAlgorithmType.KRIGING;
  18638. *
  18639. * </script>
  18640. * // ES6 Import
  18641. * import { InterpolationAlgorithmType } from '{npm}';
  18642. *
  18643. * const result = InterpolationAlgorithmType.KRIGING;
  18644. * ```
  18645. */
  18646. var InterpolationAlgorithmType = {
  18647. /** 普通克吕金插值法。 */
  18648. KRIGING: "KRIGING",
  18649. /** 简单克吕金插值法。 */
  18650. SimpleKriging: "SimpleKriging",
  18651. /** 泛克吕金插值法。 */
  18652. UniversalKriging: "UniversalKriging"
  18653. };
  18654. /**
  18655. * @enum VariogramMode
  18656. * @description 克吕金(Kriging)插值时的半变函数类型枚举。
  18657. * @category BaseTypes Constant
  18658. * @type {string}
  18659. * @usage
  18660. * ```
  18661. * // 浏览器
  18662. * <script type="text/javascript" src="{cdn}"></script>
  18663. * <script>
  18664. * const result = {namespace}.VariogramMode.EXPONENTIAL;
  18665. *
  18666. * </script>
  18667. * // ES6 Import
  18668. * import { VariogramMode } from '{npm}';
  18669. *
  18670. * const result = VariogramMode.EXPONENTIAL;
  18671. * ```
  18672. */
  18673. var VariogramMode = {
  18674. /** 指数函数。 */
  18675. EXPONENTIAL: "EXPONENTIAL",
  18676. /** 高斯函数。 */
  18677. GAUSSIAN: "GAUSSIAN",
  18678. /** 球型函数。 */
  18679. SPHERICAL: "SPHERICAL"
  18680. };
  18681. /**
  18682. * @enum Exponent
  18683. * @description 定义了泛克吕金(UniversalKriging)插值时样点数据中趋势面方程的阶数。
  18684. * @category BaseTypes Constant
  18685. * @type {string}
  18686. * @usage
  18687. * ```
  18688. * // 浏览器
  18689. * <script type="text/javascript" src="{cdn}"></script>
  18690. * <script>
  18691. * const result = {namespace}.Exponent.EXP1;
  18692. *
  18693. * </script>
  18694. * // ES6 Import
  18695. * import { Exponent } from '{npm}';
  18696. *
  18697. * const result = Exponent.EXP1;
  18698. * ```
  18699. */
  18700. var Exponent = {
  18701. /** 阶数为1。 */
  18702. EXP1: "EXP1",
  18703. /** 阶数为2。 */
  18704. EXP2: "EXP2"
  18705. };
  18706. /**
  18707. * @enum ClientType
  18708. * @description token申请的客户端标识类型。
  18709. * @category BaseTypes Constant
  18710. * @type {string}
  18711. * @usage
  18712. * ```
  18713. * // 浏览器
  18714. * <script type="text/javascript" src="{cdn}"></script>
  18715. * <script>
  18716. * const result = {namespace}.ClientType.IP;
  18717. *
  18718. * </script>
  18719. * // ES6 Import
  18720. * import { ClientType } from '{npm}';
  18721. *
  18722. * const result = ClientType.IP;
  18723. * ```
  18724. */
  18725. var ClientType = {
  18726. /** 指定的 IP 地址。 */
  18727. IP: "IP",
  18728. /** 指定的 URL。 */
  18729. REFERER: "Referer",
  18730. /** 发送申请令牌请求的客户端 IP。 */
  18731. REQUESTIP: "RequestIP",
  18732. /** 不做任何验证。 */
  18733. NONE: "NONE",
  18734. /** SERVER。 */
  18735. SERVER: "SERVER",
  18736. /** WEB。 */
  18737. WEB: "WEB"
  18738. };
  18739. /**
  18740. * @enum ChartType
  18741. * @description 客户端专题图图表类型。
  18742. * @category BaseTypes Constant
  18743. * @type {string}
  18744. * @usage
  18745. * ```
  18746. * // 浏览器
  18747. * <script type="text/javascript" src="{cdn}"></script>
  18748. * <script>
  18749. * const result = {namespace}.ChartType.BAR;
  18750. *
  18751. * </script>
  18752. * // ES6 Import
  18753. * import { ChartType } from '{npm}';
  18754. *
  18755. * const result = ChartType.BAR;
  18756. * ```
  18757. */
  18758. var ChartType = {
  18759. /** 柱状图。 */
  18760. BAR: "Bar",
  18761. /** 三维柱状图。 */
  18762. BAR3D: "Bar3D",
  18763. /** 圆形图。 */
  18764. CIRCLE: "Circle",
  18765. /** 饼图。 */
  18766. PIE: "Pie",
  18767. /** 散点图。 */
  18768. POINT: "Point",
  18769. /** 折线图。 */
  18770. LINE: "Line",
  18771. /** 环状图。 */
  18772. RING: "Ring"
  18773. };
  18774. /**
  18775. * @enum ClipAnalystMode
  18776. * @description 裁剪分析模式
  18777. * @category BaseTypes Constant
  18778. * @type {string}
  18779. * @usage
  18780. * ```
  18781. * // 浏览器
  18782. * <script type="text/javascript" src="{cdn}"></script>
  18783. * <script>
  18784. * const result = {namespace}.ClipAnalystMode.CLIP;
  18785. *
  18786. * </script>
  18787. * // ES6 Import
  18788. * import { ClipAnalystMode } from '{npm}';
  18789. *
  18790. * const result = ClipAnalystMode.CLIP;
  18791. * ```
  18792. */
  18793. var ClipAnalystMode = {
  18794. /** CLIP。 */
  18795. CLIP: "clip",
  18796. /** INTERSECT。 */
  18797. INTERSECT: "intersect"
  18798. };
  18799. /**
  18800. * @enum AnalystAreaUnit
  18801. * @description 分布式分析面积单位。
  18802. * @category BaseTypes Constant
  18803. * @type {string}
  18804. * @usage
  18805. * ```
  18806. * // 浏览器
  18807. * <script type="text/javascript" src="{cdn}"></script>
  18808. * <script>
  18809. * const result = {namespace}.AnalystAreaUnit.SQUAREMETER;
  18810. *
  18811. * </script>
  18812. * // ES6 Import
  18813. * import { AnalystAreaUnit } from '{npm}';
  18814. *
  18815. * const result = AnalystAreaUnit.SQUAREMETER;
  18816. * ```
  18817. */
  18818. var AnalystAreaUnit = {
  18819. /** 平方米。 */
  18820. "SQUAREMETER": "SquareMeter",
  18821. /** 平方千米。 */
  18822. "SQUAREKILOMETER": "SquareKiloMeter",
  18823. /** 公顷。 */
  18824. "HECTARE": "Hectare",
  18825. /** 公亩。 */
  18826. "ARE": "Are",
  18827. /** 英亩。 */
  18828. "ACRE": "Acre",
  18829. /** 平方英尺。 */
  18830. "SQUAREFOOT": "SquareFoot",
  18831. /** 平方码。 */
  18832. "SQUAREYARD": "SquareYard",
  18833. /** 平方英里。 */
  18834. "SQUAREMILE": "SquareMile"
  18835. };
  18836. /**
  18837. * @enum AnalystSizeUnit
  18838. * @description 分布式分析单位。
  18839. * @category BaseTypes Constant
  18840. * @type {string}
  18841. * @usage
  18842. * ```
  18843. * // 浏览器
  18844. * <script type="text/javascript" src="{cdn}"></script>
  18845. * <script>
  18846. * const result = {namespace}.AnalystSizeUnit.METER;
  18847. *
  18848. * </script>
  18849. * // ES6 Import
  18850. * import { AnalystSizeUnit } from '{npm}';
  18851. *
  18852. * const result = AnalystSizeUnit.METER;
  18853. * ```
  18854. */
  18855. var AnalystSizeUnit = {
  18856. /** 米。 */
  18857. "METER": "Meter",
  18858. /** 千米。 */
  18859. "KILOMETER": "Kilometer",
  18860. /** 码。 */
  18861. "YARD": "Yard",
  18862. /** 英尺。 */
  18863. "FOOT": "Foot",
  18864. /** 英里。 */
  18865. "MILE": "Mile"
  18866. };
  18867. /**
  18868. * @enum StatisticAnalystMode
  18869. * @description 分布式分析统计模式。
  18870. * @category BaseTypes Constant
  18871. * @type {string}
  18872. * @usage
  18873. * ```
  18874. * // 浏览器
  18875. * <script type="text/javascript" src="{cdn}"></script>
  18876. * <script>
  18877. * const result = {namespace}.StatisticAnalystMode.MAX;
  18878. *
  18879. * </script>
  18880. * // ES6 Import
  18881. * import { StatisticAnalystMode } from '{npm}';
  18882. *
  18883. * const result = StatisticAnalystMode.MAX;
  18884. * ```
  18885. */
  18886. var StatisticAnalystMode = {
  18887. /** 统计所选字段的最大值。 */
  18888. "MAX": "max",
  18889. /** 统计所选字段的最小值。 */
  18890. "MIN": "min",
  18891. /** 统计所选字段的平均值。 */
  18892. "AVERAGE": "average",
  18893. /** 统计所选字段的总和。 */
  18894. "SUM": "sum",
  18895. /** 统计所选字段的方差。 */
  18896. "VARIANCE": "variance",
  18897. /** 统计所选字段的标准差。 */
  18898. "STDDEVIATION": "stdDeviation"
  18899. };
  18900. /**
  18901. * @enum SummaryType
  18902. * @description 分布式分析聚合类型。
  18903. * @category BaseTypes Constant
  18904. * @type {string}
  18905. * @usage
  18906. * ```
  18907. * // 浏览器
  18908. * <script type="text/javascript" src="{cdn}"></script>
  18909. * <script>
  18910. * const result = {namespace}.SummaryType.SUMMARYMESH;
  18911. *
  18912. * </script>
  18913. * // ES6 Import
  18914. * import { SummaryType } from '{npm}';
  18915. *
  18916. * const result = SummaryType.SUMMARYMESH;
  18917. * ```
  18918. */
  18919. var SummaryType = {
  18920. /** 格网聚合。 */
  18921. "SUMMARYMESH": "SUMMARYMESH",
  18922. /** 多边形聚合。 */
  18923. "SUMMARYREGION": "SUMMARYREGION"
  18924. };
  18925. /**
  18926. * @enum TopologyValidatorRule
  18927. * @description 拓扑检查模式枚举。该类定义了拓扑检查操作模式常量。
  18928. * @category BaseTypes Constant
  18929. * @type {string}
  18930. * @usage
  18931. * ```
  18932. * // 浏览器
  18933. * <script type="text/javascript" src="{cdn}"></script>
  18934. * <script>
  18935. * const result = {namespace}.TopologyValidatorRule.REGIONNOOVERLAP;
  18936. *
  18937. * </script>
  18938. * // ES6 Import
  18939. * import { TopologyValidatorRule } from '{npm}';
  18940. *
  18941. * const result = TopologyValidatorRule.REGIONNOOVERLAP;
  18942. * ```
  18943. */
  18944. var TopologyValidatorRule = {
  18945. /** 面内无重叠,用于对面数据进行拓扑检查。 */
  18946. REGIONNOOVERLAP: "REGIONNOOVERLAP",
  18947. /** 面与面无重叠,用于对面数据进行拓扑检查。 */
  18948. REGIONNOOVERLAPWITH: "REGIONNOOVERLAPWITH",
  18949. /** 面被面包含,用于对面数据进行拓扑检查。 */
  18950. REGIONCONTAINEDBYREGION: "REGIONCONTAINEDBYREGION",
  18951. /** 面被面覆盖,用于对面数据进行拓扑检查。 */
  18952. REGIONCOVEREDBYREGION: "REGIONCOVEREDBYREGION",
  18953. /** 线与线无重叠,用于对线数据进行拓扑检查。 */
  18954. LINENOOVERLAP: "LINENOOVERLAP",
  18955. /** 线内无重叠,用于对线数据进行拓扑检查。 */
  18956. LINENOOVERLAPWITH: "LINENOOVERLAPWITH",
  18957. /** 点不相同,用于对点数据进行拓扑检查。 */
  18958. POINTNOIDENTICAL: "POINTNOIDENTICAL"
  18959. };
  18960. /**
  18961. * @enum BucketAggType
  18962. * @description 格网聚合查询枚举类,该类定义了Elasticsearch数据服务中聚合查询模式常量
  18963. * @category BaseTypes Constant
  18964. * @type {string}
  18965. * @usage
  18966. * ```
  18967. * // 浏览器
  18968. * <script type="text/javascript" src="{cdn}"></script>
  18969. * <script>
  18970. * const result = {namespace}.BucketAggType.GEOHASH_GRID;
  18971. *
  18972. * </script>
  18973. * // ES6 Import
  18974. * import { BucketAggType } from '{npm}';
  18975. *
  18976. * const result = BucketAggType.GEOHASH_GRID;
  18977. * ```
  18978. */
  18979. var BucketAggType = {
  18980. /** 格网聚合类型。 */
  18981. GEOHASH_GRID: "geohash_grid"
  18982. };
  18983. /**
  18984. * @enum MetricsAggType
  18985. * @description 指标聚合类型枚举类,该类定义了Elasticsearch数据服务中聚合查询模式常量。
  18986. * @category BaseTypes Constant
  18987. * @type {string}
  18988. * @usage
  18989. * ```
  18990. * // 浏览器
  18991. * <script type="text/javascript" src="{cdn}"></script>
  18992. * <script>
  18993. * const result = {namespace}.MetricsAggType.AVG;
  18994. *
  18995. * </script>
  18996. * // ES6 Import
  18997. * import { MetricsAggType } from '{npm}';
  18998. *
  18999. * const result = MetricsAggType.AVG;
  19000. * ```
  19001. */
  19002. var MetricsAggType = {
  19003. /** 平均值聚合类型。 */
  19004. AVG: 'avg',
  19005. /** 最大值聚合类型。 */
  19006. MAX: 'max',
  19007. /** 最小值聚合类型。 */
  19008. MIN: 'min',
  19009. /** 求和聚合类型。 */
  19010. SUM: 'sum'
  19011. };
  19012. /**
  19013. * @enum GetFeatureMode
  19014. * @description feature 查询方式。
  19015. * @category BaseTypes Constant
  19016. * @type {string}
  19017. * @usage
  19018. * ```
  19019. * // 浏览器
  19020. * <script type="text/javascript" src="{cdn}"></script>
  19021. * <script>
  19022. * const result = {namespace}.GetFeatureMode.BOUNDS;
  19023. *
  19024. * </script>
  19025. * // ES6 Import
  19026. * import { GetFeatureMode } from '{npm}';
  19027. *
  19028. * const result = GetFeatureMode.BOUNDS;
  19029. * ```
  19030. */
  19031. var GetFeatureMode = {
  19032. /** 通过范围查询来获取要素。 */
  19033. BOUNDS: "BOUNDS",
  19034. /** 通过几何对象的缓冲区来获取要素。 */
  19035. BUFFER: "BUFFER",
  19036. /** 通过 ID 来获取要素。 */
  19037. ID: "ID",
  19038. /** 通过空间查询模式来获取要素。 */
  19039. SPATIAL: "SPATIAL",
  19040. /** 通过 SQL 查询来获取要素。 */
  19041. SQL: 'SQL'
  19042. };
  19043. /**
  19044. * @enum RasterFunctionType
  19045. * @description 栅格分析方法。
  19046. * @category BaseTypes Constant
  19047. * @type {string}
  19048. * @usage
  19049. * ```
  19050. * // 浏览器
  19051. * <script type="text/javascript" src="{cdn}"></script>
  19052. * <script>
  19053. * const result = {namespace}.GetFeatureMode.NDVI;
  19054. *
  19055. * </script>
  19056. * // ES6 Import
  19057. * import { GetFeatureMode } from '{npm}';
  19058. *
  19059. * const result = GetFeatureMode.NDVI;
  19060. * ```
  19061. */
  19062. var RasterFunctionType = {
  19063. /** 归一化植被指数。 */
  19064. NDVI: "NDVI",
  19065. /** 阴影面分析。 */
  19066. HILLSHADE: "HILLSHADE"
  19067. };
  19068. /**
  19069. * @enum ResourceType
  19070. * @description iportal资源类型。
  19071. * @category BaseTypes Constant
  19072. * @version 10.0.1
  19073. * @type {string}
  19074. * @usage
  19075. * ```
  19076. * // 浏览器
  19077. * <script type="text/javascript" src="{cdn}"></script>
  19078. * <script>
  19079. * const result = {namespace}.GetFeatureMode.MAP;
  19080. *
  19081. * </script>
  19082. * // ES6 Import
  19083. * import { GetFeatureMode } from '{npm}';
  19084. *
  19085. * const result = GetFeatureMode.MAP;
  19086. * ```
  19087. */
  19088. var ResourceType = {
  19089. /** 地图。 */
  19090. MAP: "MAP",
  19091. /** 服务。 */
  19092. SERVICE: "SERVICE",
  19093. /** 场景。 */
  19094. SCENE: "SCENE",
  19095. /** 数据。 */
  19096. DATA: "DATA",
  19097. /** 洞察。 */
  19098. INSIGHTS_WORKSPACE: "INSIGHTS_WORKSPACE",
  19099. /** 大屏。 */
  19100. MAP_DASHBOARD: "MAP_DASHBOARD"
  19101. };
  19102. /**
  19103. * @enum OrderBy
  19104. * @description iportal资源排序字段。
  19105. * @category BaseTypes Constant
  19106. * @version 10.0.1
  19107. * @type {string}
  19108. * @usage
  19109. * ```
  19110. * // 浏览器
  19111. * <script type="text/javascript" src="{cdn}"></script>
  19112. * <script>
  19113. * const result = {namespace}.OrderBy.UPDATETIME;
  19114. *
  19115. * </script>
  19116. * // ES6 Import
  19117. * import { OrderBy } from '{npm}';
  19118. *
  19119. * const result = OrderBy.UPDATETIME;
  19120. * ```
  19121. */
  19122. var OrderBy = {
  19123. /** 按更新时间排序。 */
  19124. UPDATETIME: "UPDATETIME",
  19125. /** 按热度(可能是访问量、下载量)排序。 */
  19126. HEATLEVEL: "HEATLEVEL",
  19127. /** 按相关性排序。 */
  19128. RELEVANCE: "RELEVANCE"
  19129. };
  19130. /**
  19131. * @enum OrderType
  19132. * @description iportal资源升序还是降序过滤。
  19133. * @category BaseTypes Constant
  19134. * @version 10.0.1
  19135. * @type {string}
  19136. * @usage
  19137. * ```
  19138. * // 浏览器
  19139. * <script type="text/javascript" src="{cdn}"></script>
  19140. * <script>
  19141. * const result = {namespace}.OrderType.ASC;
  19142. *
  19143. * </script>
  19144. * // ES6 Import
  19145. * import { OrderType } from '{npm}';
  19146. *
  19147. * const result = OrderType.ASC;
  19148. * ```
  19149. */
  19150. var OrderType = {
  19151. /** 升序。 */
  19152. ASC: "ASC",
  19153. /** 降序。 */
  19154. DESC: "DESC"
  19155. };
  19156. /**
  19157. * @enum SearchType
  19158. * @description iportal资源查询的范围进行过滤。
  19159. * @category BaseTypes Constant
  19160. * @version 10.0.1
  19161. * @type {string}
  19162. * @usage
  19163. * ```
  19164. * // 浏览器
  19165. * <script type="text/javascript" src="{cdn}"></script>
  19166. * <script>
  19167. * const result = {namespace}.SearchType.PUBLIC;
  19168. *
  19169. * </script>
  19170. * // ES6 Import
  19171. * import { SearchType } from '{npm}';
  19172. *
  19173. * const result = SearchType.PUBLIC;
  19174. * ```
  19175. */
  19176. var SearchType = {
  19177. /** 公开资源。 */
  19178. PUBLIC: "PUBLIC",
  19179. /** 我的资源。 */
  19180. MY_RES: "MY_RES",
  19181. /** 我的群组资源。 */
  19182. MYGROUP_RES: "MYGROUP_RES",
  19183. /** 我的部门资源。 */
  19184. MYDEPARTMENT_RES: "MYDEPARTMENT_RES",
  19185. /** 分享给我的资源。 */
  19186. SHARETOME_RES: "SHARETOME_RES"
  19187. };
  19188. /**
  19189. * @enum AggregationTypes
  19190. * @description iportal资源聚合查询的类型。
  19191. * @category BaseTypes Constant
  19192. * @version 10.0.1
  19193. * @type {string}
  19194. * @usage
  19195. * ```
  19196. * // 浏览器
  19197. * <script type="text/javascript" src="{cdn}"></script>
  19198. * <script>
  19199. * const result = {namespace}.AggregationTypes.TAG;
  19200. *
  19201. * </script>
  19202. * // ES6 Import
  19203. * import { AggregationTypes } from '{npm}';
  19204. *
  19205. * const result = AggregationTypes.TAG;
  19206. * ```
  19207. */
  19208. var AggregationTypes = {
  19209. /** 标签。 */
  19210. TAG: "TAG",
  19211. /** 资源类型。 */
  19212. TYPE: "TYPE"
  19213. };
  19214. /**
  19215. * @enum PermissionType
  19216. * @description iportal资源权限类型。
  19217. * @category BaseTypes Constant
  19218. * @version 10.0.1
  19219. * @type {string}
  19220. * @usage
  19221. * ```
  19222. * // 浏览器
  19223. * <script type="text/javascript" src="{cdn}"></script>
  19224. * <script>
  19225. * const result = {namespace}.PermissionType.SEARCH;
  19226. *
  19227. * </script>
  19228. * // ES6 Import
  19229. * import { PermissionType } from '{npm}';
  19230. *
  19231. * const result = PermissionType.SEARCH;
  19232. * ```
  19233. */
  19234. var PermissionType = {
  19235. /** 可检索。 */
  19236. SEARCH: "SEARCH",
  19237. /** 可查看。 */
  19238. READ: "READ",
  19239. /** 可编辑。 */
  19240. READWRITE: "READWRITE",
  19241. /** 可删除。 */
  19242. DELETE: "DELETE",
  19243. /** 可下载,包括可读、可检索。 */
  19244. DOWNLOAD: "DOWNLOAD"
  19245. };
  19246. /**
  19247. * @enum EntityType
  19248. * @description iportal资源实体类型。
  19249. * @category BaseTypes Constant
  19250. * @version 10.0.1
  19251. * @type {string}
  19252. * @usage
  19253. * ```
  19254. * // 浏览器
  19255. * <script type="text/javascript" src="{cdn}"></script>
  19256. * <script>
  19257. * const result = {namespace}.EntityType.DEPARTMENT;
  19258. *
  19259. * </script>
  19260. * // ES6 Import
  19261. * import { EntityType } from '{npm}';
  19262. *
  19263. * const result = EntityType.DEPARTMENT;
  19264. * ```
  19265. */
  19266. var EntityType = {
  19267. /** 部门。 */
  19268. DEPARTMENT: "DEPARTMENT",
  19269. /** 用户组。 */
  19270. GROUP: "GROUP",
  19271. /** 群组。 */
  19272. IPORTALGROUP: "IPORTALGROUP",
  19273. /** 角色。 */
  19274. ROLE: "ROLE",
  19275. /** 用户。 */
  19276. USER: "USER"
  19277. };
  19278. /**
  19279. * @enum DataItemType
  19280. * @description iportal数据类型。
  19281. * @category BaseTypes Constant
  19282. * @version 10.0.1
  19283. * @type {string}
  19284. * @usage
  19285. * ```
  19286. * // 浏览器
  19287. * <script type="text/javascript" src="{cdn}"></script>
  19288. * <script>
  19289. * const result = {namespace}.DataItemType.GEOJSON;
  19290. *
  19291. * </script>
  19292. * // ES6 Import
  19293. * import { DataItemType } from '{npm}';
  19294. *
  19295. * const result = DataItemType.GEOJSON;
  19296. * ```
  19297. */
  19298. var DataItemType = {
  19299. /** geojson 数据。 */
  19300. GEOJSON: "GEOJSON",
  19301. /** UGCV5_MVT。 */
  19302. UGCV5_MVT: "UGCV5_MVT",
  19303. /** json数据。 */
  19304. JSON: "JSON",
  19305. /** 音频文件。 */
  19306. AUDIO: "AUDIO",
  19307. /** Color 颜色。 */
  19308. COLOR: "COLOR",
  19309. /** ColorScheme 颜色方案。 */
  19310. COLORSCHEME: "COLORSCHEME",
  19311. /** CSV 数据。 */
  19312. CSV: "CSV",
  19313. /** EXCEL 数据。 */
  19314. EXCEL: "EXCEL",
  19315. /** FillSymbol 填充符号库。 */
  19316. FILLSYMBOL: "FILLSYMBOL",
  19317. /** 图片类型。 */
  19318. IMAGE: "IMAGE",
  19319. /** LayerTemplate 图层模板。 */
  19320. LAYERTEMPLATE: "LAYERTEMPLATE",
  19321. /** LayoutTemplate 布局模板。 */
  19322. LAYOUTTEMPLATE: "LAYOUTTEMPLATE",
  19323. /** LineSymbol 线符号库。 */
  19324. LINESYMBOL: "LINESYMBOL",
  19325. /** MapTemplate 地图模板。 */
  19326. MAPTEMPLATE: "MAPTEMPLATE",
  19327. /** MarkerSymbol 点符号库。 */
  19328. MARKERSYMBOL: "MARKERSYMBOL",
  19329. /** MBTILES。 */
  19330. MBTILES: "MBTILES",
  19331. /** 照片。 */
  19332. PHOTOS: "PHOTOS",
  19333. /** SHP 空间数据。 */
  19334. SHP: "SHP",
  19335. /** SMTILES。 */
  19336. SMTILES: "SMTILES",
  19337. /** SVTILES。 */
  19338. SVTILES: "SVTILES",
  19339. /** ThemeTemplate 专题图模板。 */
  19340. THEMETEMPLATE: "THEMETEMPLATE",
  19341. /** TPK。 */
  19342. TPK: "TPK",
  19343. /** UDB 数据源。 */
  19344. UDB: "UDB",
  19345. /** UGCV5。 */
  19346. UGCV5: "UGCV5",
  19347. /** 其他类型(普通文件)。 */
  19348. UNKNOWN: "UNKNOWN",
  19349. /** 视频文件。 */
  19350. VIDEO: "VIDEO",
  19351. /** WorkEnviroment 工作环境。 */
  19352. WORKENVIRONMENT: "WORKENVIRONMENT",
  19353. /** 工作空间。 */
  19354. WORKSPACE: "WORKSPACE"
  19355. };
  19356. /**
  19357. * @enum WebExportFormatType
  19358. * @description Web 打印输出的格式。
  19359. * @category BaseTypes Constant
  19360. * @version 10.0.1
  19361. * @type {string}
  19362. * @usage
  19363. * ```
  19364. * // 浏览器
  19365. * <script type="text/javascript" src="{cdn}"></script>
  19366. * <script>
  19367. * const result = {namespace}.WebExportFormatType.PNG;
  19368. *
  19369. * </script>
  19370. * // ES6 Import
  19371. * import { WebExportFormatType } from '{npm}';
  19372. *
  19373. * const result = WebExportFormatType.PNG;
  19374. * ```
  19375. */
  19376. var WebExportFormatType = {
  19377. /** PNG */
  19378. PNG: "PNG",
  19379. /** PDF */
  19380. PDF: "PDF"
  19381. };
  19382. /**
  19383. * @enum WebScaleOrientationType
  19384. * @description Web 比例尺的方位样式。
  19385. * @category BaseTypes Constant
  19386. * @version 10.0.1
  19387. * @type {string}
  19388. * @usage
  19389. * ```
  19390. * // 浏览器
  19391. * <script type="text/javascript" src="{cdn}"></script>
  19392. * <script>
  19393. * const result = {namespace}.WebScaleOrientationType.HORIZONTALLABELSBELOW;
  19394. *
  19395. * </script>
  19396. * // ES6 Import
  19397. * import { WebScaleOrientationType } from '{npm}';
  19398. *
  19399. * const result = WebScaleOrientationType.HORIZONTALLABELSBELOW;
  19400. * ```
  19401. */
  19402. var WebScaleOrientationType = {
  19403. /** horizontal labels below. */
  19404. HORIZONTALLABELSBELOW: "HORIZONTALLABELSBELOW",
  19405. /** horizontal labels above. */
  19406. HORIZONTALLABELSABOVE: "HORIZONTALLABELSABOVE",
  19407. /** vertical labels left. */
  19408. VERTICALLABELSLEFT: "VERTICALLABELSLEFT",
  19409. /** vertical labels right. */
  19410. VERTICALLABELSRIGHT: "VERTICALLABELSRIGHT"
  19411. };
  19412. /**
  19413. * @enum WebScaleType
  19414. * @description Web 比例尺的样式。
  19415. * @category BaseTypes Constant
  19416. * @version 10.0.1
  19417. * @type {string}
  19418. * @usage
  19419. * ```
  19420. * // 浏览器
  19421. * <script type="text/javascript" src="{cdn}"></script>
  19422. * <script>
  19423. * const result = {namespace}.WebScaleType.LINE;
  19424. *
  19425. * </script>
  19426. * // ES6 Import
  19427. * import { WebScaleType } from '{npm}';
  19428. *
  19429. * const result = WebScaleType.LINE;
  19430. * ```
  19431. */
  19432. var WebScaleType = {
  19433. /** line. */
  19434. LINE: "LINE",
  19435. /** bar. */
  19436. BAR: "BAR",
  19437. /** bar sub. */
  19438. BAR_SUB: "BAR_SUB"
  19439. };
  19440. /**
  19441. * @enum WebScaleUnit
  19442. * @description Web 比例尺的单位制。
  19443. * @category BaseTypes Constant
  19444. * @version 10.0.1
  19445. * @type {string}
  19446. * @usage
  19447. * ```
  19448. * // 浏览器
  19449. * <script type="text/javascript" src="{cdn}"></script>
  19450. * <script>
  19451. * const result = {namespace}.WebScaleUnit.METER;
  19452. *
  19453. * </script>
  19454. * // ES6 Import
  19455. * import { WebScaleUnit } from '{npm}';
  19456. *
  19457. * const result = WebScaleUnit.METER;
  19458. * ```
  19459. */
  19460. var WebScaleUnit = {
  19461. /** 米。 */
  19462. METER: "METER",
  19463. /** 英尺。 */
  19464. FOOT: "FOOT",
  19465. /** 度。 */
  19466. DEGREES: "DEGREES"
  19467. };
  19468. ;// CONCATENATED MODULE: ./src/common/commontypes/Size.js
  19469. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19470. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  19471. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  19472. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  19473. * This program are made available under the terms of the Apache License, Version 2.0
  19474. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19475. /**
  19476. * @class Size
  19477. * @deprecatedclass SuperMap.Size
  19478. * @category BaseTypes Style
  19479. * @classdesc 此类描绘一对高宽值的实例。
  19480. * @param {number} [w=0.0] - 宽度。
  19481. * @param {number} [h=0.0] - 高度。
  19482. *
  19483. * @example
  19484. * var size = new Size(31,46);
  19485. * @usage
  19486. */
  19487. var Size = /*#__PURE__*/function () {
  19488. function Size(w, h) {
  19489. _classCallCheck(this, Size);
  19490. /**
  19491. * @member {number} [Size.prototype.w=0.0]
  19492. * @description 宽度。
  19493. */
  19494. this.w = w ? parseFloat(w) : 0.0;
  19495. /**
  19496. * @member {number} [Size.prototype.h=0.0]
  19497. * @description 高度。
  19498. */
  19499. this.h = w ? parseFloat(h) : 0.0;
  19500. this.CLASS_NAME = "SuperMap.Size";
  19501. }
  19502. /**
  19503. * @function Size.prototype.toString
  19504. * @description 返回字符串形式。
  19505. * @example
  19506. * var size = new Size(10,5);
  19507. * var str = size.toString();
  19508. * @returns {string} 例如:"w=10,h=5"。
  19509. */
  19510. _createClass(Size, [{
  19511. key: "toString",
  19512. value: function toString() {
  19513. return "w=" + this.w + ",h=" + this.h;
  19514. }
  19515. /**
  19516. * @function Size.prototype.clone
  19517. * @description 克隆当前size对象。
  19518. * @example
  19519. * var size = new Size(31,46);
  19520. * var size2 = size.clone();
  19521. * @returns {Size} 新的与当前 size 对象有相同宽、高的 Size 对象。
  19522. */
  19523. }, {
  19524. key: "clone",
  19525. value: function clone() {
  19526. return new Size(this.w, this.h);
  19527. }
  19528. /**
  19529. *
  19530. * @function Size.prototype.equals
  19531. * @description 比较两个 size 对象是否相等。
  19532. * @example
  19533. * var size = new Size(31,46);
  19534. * var size2 = new Size(31,46);
  19535. * var isEquals = size.equals(size2);
  19536. *
  19537. * @param {Size} sz - 用于比较相等的 Size 对象。
  19538. * @returns {boolean} 传入的 size 和当前 size 高宽相等,注意:如果传入的 size 为空则返回 false。
  19539. *
  19540. */
  19541. }, {
  19542. key: "equals",
  19543. value: function equals(sz) {
  19544. var equals = false;
  19545. if (sz != null) {
  19546. equals = this.w === sz.w && this.h === sz.h || isNaN(this.w) && isNaN(this.h) && isNaN(sz.w) && isNaN(sz.h);
  19547. }
  19548. return equals;
  19549. }
  19550. /**
  19551. *
  19552. * @function Size.prototype.destroy
  19553. * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
  19554. * @example
  19555. * var size = new Size(31,46);
  19556. * size.destroy();
  19557. */
  19558. }, {
  19559. key: "destroy",
  19560. value: function destroy() {
  19561. this.w = null;
  19562. this.h = null;
  19563. }
  19564. }]);
  19565. return Size;
  19566. }();
  19567. ;// CONCATENATED MODULE: ./src/common/commontypes/Pixel.js
  19568. function Pixel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19569. function Pixel_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  19570. function Pixel_createClass(Constructor, protoProps, staticProps) { if (protoProps) Pixel_defineProperties(Constructor.prototype, protoProps); if (staticProps) Pixel_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  19571. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  19572. * This program are made available under the terms of the Apache License, Version 2.0
  19573. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19574. /**
  19575. * @class Pixel
  19576. * @deprecatedclass SuperMap.Pixel
  19577. * @category BaseTypes Geometry
  19578. * @classdesc 用 x,y 坐标描绘屏幕坐标(像素点)。
  19579. * @param {number} [x=0.0] - x 坐标。
  19580. * @param {number} [y=0.0] - y 坐标。
  19581. * @param {Pixel.Mode} [mode=Pixel.Mode.LeftTop] - 坐标模式。
  19582. *
  19583. * @example
  19584. * //单独创建一个对象
  19585. * var pixcel = new Pixel(100,50);
  19586. *
  19587. * //依据 size 创建
  19588. * var size = new Size(21,25);
  19589. * var offset = new Pixel(-(size.w/2), -size.h);
  19590. * @usage
  19591. */
  19592. var Pixel = /*#__PURE__*/function () {
  19593. function Pixel(x, y, mode) {
  19594. Pixel_classCallCheck(this, Pixel);
  19595. /**
  19596. * @member {number} [Pixel.prototype.x=0.0]
  19597. * @description x 坐标。
  19598. */
  19599. this.x = x ? parseFloat(x) : 0.0;
  19600. /**
  19601. * @member {number} [Pixel.prototype.y=0.0]
  19602. * @description y 坐标。
  19603. */
  19604. this.y = y ? parseFloat(y) : 0.0;
  19605. /**
  19606. * @member {Pixel.Mode} [Pixel.prototype.mode=Pixel.Mode.LeftTop]
  19607. * @description 坐标模式,有左上、右上、右下、左下这几种模式,分别表示相对于左上角、右上角、右下角、左下角的坐标。
  19608. */
  19609. this.mode = mode;
  19610. this.CLASS_NAME = 'SuperMap.Pixel';
  19611. }
  19612. /**
  19613. * @function Pixel.prototype.toString
  19614. * @description 返回此对象的字符串形式。
  19615. * @example
  19616. *
  19617. * var pixcel = new Pixel(100,50);
  19618. * var str = pixcel.toString();
  19619. *
  19620. * @returns {string} 例如: "x=200.4,y=242.2"
  19621. */
  19622. Pixel_createClass(Pixel, [{
  19623. key: "toString",
  19624. value: function toString() {
  19625. return 'x=' + this.x + ',y=' + this.y;
  19626. }
  19627. /**
  19628. * @function Pixel.prototype.clone
  19629. * @description 克隆当前的 pixel 对象。
  19630. * @example
  19631. * var pixcel = new Pixel(100,50);
  19632. * var pixcel2 = pixcel.clone();
  19633. * @returns {Pixel} 新的与当前 pixel 对象有相同 x、y 坐标的 pixel 对象。
  19634. */
  19635. }, {
  19636. key: "clone",
  19637. value: function clone() {
  19638. return new Pixel(this.x, this.y, this.mode);
  19639. }
  19640. /**
  19641. * @function Pixel.prototype.equals
  19642. * @description 比较两 pixel 是否相等。
  19643. * @example
  19644. * var pixcel = new Pixel(100,50);
  19645. * var pixcel2 = new Pixel(100,50);
  19646. * var isEquals = pixcel.equals(pixcel2);
  19647. *
  19648. * @param {Pixel} px - 用于比较相等的 pixel 对象。
  19649. * @returns {boolean} 如果传入的像素点和当前像素点相同返回 true,如果不同或传入参数为 NULL 则返回 false。
  19650. */
  19651. }, {
  19652. key: "equals",
  19653. value: function equals(px) {
  19654. var equals = false;
  19655. if (px != null) {
  19656. equals = this.x == px.x && this.y == px.y || isNaN(this.x) && isNaN(this.y) && isNaN(px.x) && isNaN(px.y);
  19657. }
  19658. return equals;
  19659. }
  19660. /**
  19661. * @function Pixel.prototype.distanceTo
  19662. * @description 返回两个 pixel 的距离。
  19663. * @example
  19664. * var pixcel = new Pixel(100,50);
  19665. * var pixcel2 = new Pixel(110,30);
  19666. * var distance = pixcel.distanceTo(pixcel2);
  19667. *
  19668. * @param {Pixel} px - 需要计算的 pixel。
  19669. * @returns {number} 作为参数传入的像素与当前像素点的距离。
  19670. */
  19671. }, {
  19672. key: "distanceTo",
  19673. value: function distanceTo(px) {
  19674. return Math.sqrt(Math.pow(this.x - px.x, 2) + Math.pow(this.y - px.y, 2));
  19675. }
  19676. /**
  19677. * @function Pixel.prototype.add
  19678. * @description 在原来像素坐标基础上,x 值加上传入的 x 参数,y 值加上传入的 y 参数。
  19679. * @example
  19680. * var pixcel = new Pixel(100,50);
  19681. * //pixcel2是新的对象
  19682. * var pixcel2 = pixcel.add(20,30);
  19683. *
  19684. * @param {number} x - 传入的 x 值。
  19685. * @param {number} y - 传入的 y 值。
  19686. * @returns {Pixel} 新的 pixel 对象,该 pixel 是由当前的 pixel 与传入的 x,y 相加得到。
  19687. */
  19688. }, {
  19689. key: "add",
  19690. value: function add(x, y) {
  19691. if (x == null || y == null) {
  19692. throw new TypeError('Pixel.add cannot receive null values');
  19693. }
  19694. return new Pixel(this.x + x, this.y + y);
  19695. }
  19696. /**
  19697. * @function Pixel.prototype.offset
  19698. * @description 通过传入的 {@link Pixel} 参数对原屏幕坐标进行偏移。
  19699. * @example
  19700. * var pixcel = new Pixel(100,50);
  19701. * var pixcel2 = new Pixel(130,20);
  19702. * //pixcel3 是新的对象
  19703. * var pixcel3 = pixcel.offset(pixcel2);
  19704. *
  19705. * @param {Pixel} px - 传入的 {@link Pixel} 对象。
  19706. * @returns {Pixel} 新的 pixel,该 pixel 是由当前的 pixel 对象的 x,y 值与传入的 Pixel 对象的 x,y 值相加得到。
  19707. */
  19708. }, {
  19709. key: "offset",
  19710. value: function offset(px) {
  19711. var newPx = this.clone();
  19712. if (px) {
  19713. newPx = this.add(px.x, px.y);
  19714. }
  19715. return newPx;
  19716. }
  19717. /**
  19718. *
  19719. * @function Pixel.prototype.destroy
  19720. * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
  19721. * @example
  19722. * var pixcel = new Pixel(100,50);
  19723. * pixcel.destroy();
  19724. */
  19725. }, {
  19726. key: "destroy",
  19727. value: function destroy() {
  19728. this.x = null;
  19729. this.y = null;
  19730. this.mode = null;
  19731. }
  19732. }]);
  19733. return Pixel;
  19734. }();
  19735. /**
  19736. * @enum Mode
  19737. * @memberOf Pixel
  19738. * @readonly
  19739. * @description 模式。
  19740. * @type {string}
  19741. */
  19742. Pixel.Mode = {
  19743. /** 左上模式。*/
  19744. LeftTop: 'lefttop',
  19745. /** 右上模式。 */
  19746. RightTop: 'righttop',
  19747. /** 右下模式。 */
  19748. RightBottom: 'rightbottom',
  19749. /** 左下模式。 */
  19750. LeftBottom: 'leftbottom'
  19751. };
  19752. ;// CONCATENATED MODULE: ./src/common/commontypes/BaseTypes.js
  19753. function BaseTypes_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  19754. function BaseTypes_createClass(Constructor, protoProps, staticProps) { if (protoProps) BaseTypes_defineProperties(Constructor.prototype, protoProps); if (staticProps) BaseTypes_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  19755. function BaseTypes_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19756. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  19757. * This program are made available under the terms of the Apache License, Version 2.0
  19758. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19759. /**
  19760. * @function inherit
  19761. * @description 除了 C 和 P 两个必要参数外,可以传递任意数量的对象,这些对象都将继承C。
  19762. * @param {Object} C - 继承的类。
  19763. * @param {Object} P - 被继承的父类。
  19764. * @private
  19765. */
  19766. var inheritExt = function inheritExt(C, P) {
  19767. var F = function F() {};
  19768. F.prototype = P.prototype;
  19769. C.prototype = new F();
  19770. var i, l, o;
  19771. for (i = 2, l = arguments.length; i < l; i++) {
  19772. o = arguments[i];
  19773. if (typeof o === "function") {
  19774. o = o.prototype;
  19775. }
  19776. Util_Util.extend(C.prototype, o);
  19777. }
  19778. };
  19779. /**
  19780. * @function mixinExt
  19781. * @description 实现多重继承。
  19782. * @param {Class|Object} ...mixins - 继承的类。
  19783. * @private
  19784. */
  19785. var mixinExt = function mixinExt() {
  19786. for (var _len = arguments.length, mixins = new Array(_len), _key = 0; _key < _len; _key++) {
  19787. mixins[_key] = arguments[_key];
  19788. }
  19789. var Mix = /*#__PURE__*/BaseTypes_createClass(function Mix(options) {
  19790. BaseTypes_classCallCheck(this, Mix);
  19791. for (var index = 0; index < mixins.length; index++) {
  19792. copyProperties(this, new mixins[index](options));
  19793. }
  19794. });
  19795. for (var index = 0; index < mixins.length; index++) {
  19796. var mixin = mixins[index];
  19797. copyProperties(Mix, mixin);
  19798. copyProperties(Mix.prototype, mixin.prototype);
  19799. copyProperties(Mix.prototype, new mixin());
  19800. }
  19801. return Mix;
  19802. function copyProperties(target, source) {
  19803. var ownKeys = Object.getOwnPropertyNames(source);
  19804. if (Object.getOwnPropertySymbols) {
  19805. ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source));
  19806. }
  19807. for (var index = 0; index < ownKeys.length; index++) {
  19808. var key = ownKeys[index];
  19809. if (key !== "constructor" && key !== "prototype" && key !== "name" && key !== "length") {
  19810. var desc = Object.getOwnPropertyDescriptor(source, key);
  19811. if (window["ActiveXObject"]) {
  19812. Object.defineProperty(target, key, desc || {});
  19813. } else {
  19814. Object.defineProperty(target, key, desc);
  19815. }
  19816. }
  19817. }
  19818. }
  19819. };
  19820. /**
  19821. * @name String
  19822. * @namespace
  19823. * @category BaseTypes Util
  19824. * @description 字符串操作的一系列常用扩展函数。
  19825. * @private
  19826. */
  19827. var StringExt = {
  19828. /**
  19829. * @function StringExt.startsWith
  19830. * @description 判断目标字符串是否以指定的子字符串开头。
  19831. * @param {string} str - 目标字符串。
  19832. * @param {string} sub - 查找的子字符串。
  19833. * @returns {boolean} 目标字符串以指定的子字符串开头,则返回 true;否则返回 false。
  19834. */
  19835. startsWith: function startsWith(str, sub) {
  19836. return str.indexOf(sub) == 0;
  19837. },
  19838. /**
  19839. * @function StringExt.contains
  19840. * @description 判断目标字符串是否包含指定的子字符串。
  19841. * @param {string} str - 目标字符串。
  19842. * @param {string} sub - 查找的子字符串。
  19843. * @returns {boolean} 目标字符串中包含指定的子字符串,则返回 true;否则返回 false。
  19844. */
  19845. contains: function contains(str, sub) {
  19846. return str.indexOf(sub) != -1;
  19847. },
  19848. /**
  19849. * @function StringExt.trim
  19850. * @description 删除一个字符串的开头和结尾处的所有空白字符。
  19851. * @param {string} str - (可能)存在空白字符填塞的字符串。
  19852. * @returns {string} 删除开头和结尾处空白字符后的字符串。
  19853. */
  19854. trim: function trim(str) {
  19855. return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
  19856. },
  19857. /**
  19858. * @function StringExt.camelize
  19859. * @description 骆驼式("-")连字符的字符串处理。
  19860. * 例如:"chicken-head" becomes "chickenHead",
  19861. * "-chicken-head" becomes "ChickenHead"。
  19862. * @param {string} str - 要处理的字符串,原始内容不应被修改。
  19863. * @returns {string}
  19864. */
  19865. camelize: function camelize(str) {
  19866. var oStringList = str.split('-');
  19867. var camelizedString = oStringList[0];
  19868. for (var i = 1, len = oStringList.length; i < len; i++) {
  19869. var s = oStringList[i];
  19870. camelizedString += s.charAt(0).toUpperCase() + s.substring(1);
  19871. }
  19872. return camelizedString;
  19873. },
  19874. /**
  19875. * @function StringExt.format
  19876. * @description 提供带 ${token} 标记的字符串, 返回 context 对象属性中指定标记的属性值。
  19877. * @example
  19878. * 示例:
  19879. * (code)
  19880. * 1、template = "${value,getValue}";
  19881. * context = {value: {getValue:function(){return Math.max.apply(null,argument);}}};
  19882. * args = [2,23,12,36,21];
  19883. * 返回值:36
  19884. * (end)
  19885. * 示例:
  19886. * (code)
  19887. * 2、template = "$${{value,getValue}}";
  19888. * context = {value: {getValue:function(){return Math.max.apply(null,argument);}}};
  19889. * args = [2,23,12,36,21];
  19890. * 返回值:"${36}"
  19891. * (end)
  19892. * 示例:
  19893. * (code)
  19894. * 3、template = "${a,b}";
  19895. * context = {a: {b:"format"}};
  19896. * args = null;
  19897. * 返回值:"format"
  19898. * (end)
  19899. * 示例:
  19900. * (code)
  19901. * 3、template = "${a,b}";
  19902. * context = null;
  19903. * args = null;
  19904. * 返回值:"${a.b}"
  19905. * (end)
  19906. * @param {string} template - 带标记的字符串将要被替换。参数 template 格式为"${token}",此处的 token 标记会替换为 context["token"] 属性的值。
  19907. * @param {Object} [context=window] - 带有属性的可选对象的属性用于匹配格式化字符串中的标记。如果该参数为空,将使用 window 对象。
  19908. * @param {Array.<number>} [args] - 可选参数传递给在 context 对象上找到的函数。
  19909. * @returns {string} 从 context 对象属性中替换字符串标记位的字符串。
  19910. */
  19911. format: function format(template, context, args) {
  19912. if (!context) {
  19913. context = window;
  19914. }
  19915. // Example matching:
  19916. // str = ${foo.bar}
  19917. // match = foo.bar
  19918. var replacer = function replacer(str, match) {
  19919. var replacement;
  19920. // Loop through all subs. Example: ${a.b.c}
  19921. // 0 -> replacement = context[a];
  19922. // 1 -> replacement = context[a][b];
  19923. // 2 -> replacement = context[a][b][c];
  19924. var subs = match.split(/\.+/);
  19925. for (var i = 0; i < subs.length; i++) {
  19926. if (i == 0) {
  19927. replacement = context;
  19928. }
  19929. replacement = replacement[subs[i]];
  19930. }
  19931. if (typeof replacement === "function") {
  19932. replacement = args ? replacement.apply(null, args) : replacement();
  19933. }
  19934. // If replacement is undefined, return the string 'undefined'.
  19935. // This is a workaround for a bugs in browsers not properly
  19936. // dealing with non-participating groups in regular expressions:
  19937. // http://blog.stevenlevithan.com/archives/npcg-javascript
  19938. if (typeof replacement == 'undefined') {
  19939. return 'undefined';
  19940. } else {
  19941. return replacement;
  19942. }
  19943. };
  19944. return template.replace(StringExt.tokenRegEx, replacer);
  19945. },
  19946. /**
  19947. * @member {RegExp} [StringExt.tokenRegEx]
  19948. * @description 寻找带 token 的字符串,默认为 tokenRegEx=/\$\{([\w.]+?)\}/g。
  19949. * @example
  19950. * Examples: ${a}, ${a.b.c}, ${a-b}, ${5}
  19951. */
  19952. tokenRegEx: /\$\{([\w.]+?)\}/g,
  19953. /**
  19954. * @member {RegExp} [StringExt.numberRegEx]
  19955. * @description 判断一个字符串是否只包含一个数值,默认为 numberRegEx=/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/。
  19956. */
  19957. numberRegEx: /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,
  19958. /**
  19959. * @function StringExt.isNumeric
  19960. * @description 判断一个字符串是否只包含一个数值。
  19961. * @example
  19962. * (code)
  19963. * StringExt.isNumeric("6.02e23") // true
  19964. * StringExt.isNumeric("12 dozen") // false
  19965. * StringExt.isNumeric("4") // true
  19966. * StringExt.isNumeric(" 4 ") // false
  19967. * (end)
  19968. * @returns {boolean} 字符串包含唯一的数值,返回 true;否则返回 false。
  19969. */
  19970. isNumeric: function isNumeric(value) {
  19971. return StringExt.numberRegEx.test(value);
  19972. },
  19973. /**
  19974. * @function StringExt.numericIf
  19975. * @description 把一个看似数值型的字符串转化为一个数值。
  19976. * @returns {(number|string)} 如果能转换为数值则返回数值,否则返回字符串本身。
  19977. */
  19978. numericIf: function numericIf(value) {
  19979. return StringExt.isNumeric(value) ? parseFloat(value) : value;
  19980. }
  19981. };
  19982. /**
  19983. * @name Number
  19984. * @namespace
  19985. * @category BaseTypes Util
  19986. * @description 数值操作的一系列常用扩展函数。
  19987. * @private
  19988. */
  19989. var NumberExt = {
  19990. /**
  19991. * @member {string} [NumberExt.decimalSeparator='.']
  19992. * @description 格式化数字时默认的小数点分隔符。
  19993. * @constant
  19994. */
  19995. decimalSeparator: ".",
  19996. /**
  19997. * @member {string} [NumberExt.thousandsSeparator=',']
  19998. * @description 格式化数字时默认的千位分隔符。
  19999. * @constant
  20000. */
  20001. thousandsSeparator: ",",
  20002. /**
  20003. * @function NumberExt.limitSigDigs
  20004. * @description 限制浮点数的有效数字位数。
  20005. * @param {number} num - 浮点数。
  20006. * @param {number} sig - 有效位数。
  20007. * @returns {number} 将数字四舍五入到指定数量的有效位数。
  20008. */
  20009. limitSigDigs: function limitSigDigs(num, sig) {
  20010. var fig = 0;
  20011. if (sig > 0) {
  20012. fig = parseFloat(num.toPrecision(sig));
  20013. }
  20014. return fig;
  20015. },
  20016. /**
  20017. * @function NumberExt.format
  20018. * @description 数字格式化输出。
  20019. * @param {number} num - 数字。
  20020. * @param {number} [dec=0] - 数字的小数部分四舍五入到指定的位数。设置为 null 值时小数部分不变。
  20021. * @param {string} [tsep=','] - 千位分隔符。
  20022. * @param {string} [dsep='.'] - 小数点分隔符。
  20023. * @returns {string} 数字格式化后的字符串。
  20024. */
  20025. format: function format(num, dec, tsep, dsep) {
  20026. dec = typeof dec != "undefined" ? dec : 0;
  20027. tsep = typeof tsep != "undefined" ? tsep : NumberExt.thousandsSeparator;
  20028. dsep = typeof dsep != "undefined" ? dsep : NumberExt.decimalSeparator;
  20029. if (dec != null) {
  20030. num = parseFloat(num.toFixed(dec));
  20031. }
  20032. var parts = num.toString().split(".");
  20033. if (parts.length === 1 && dec == null) {
  20034. // integer where we do not want to touch the decimals
  20035. dec = 0;
  20036. }
  20037. var integer = parts[0];
  20038. if (tsep) {
  20039. var thousands = /(-?[0-9]+)([0-9]{3})/;
  20040. while (thousands.test(integer)) {
  20041. integer = integer.replace(thousands, "$1" + tsep + "$2");
  20042. }
  20043. }
  20044. var str;
  20045. if (dec == 0) {
  20046. str = integer;
  20047. } else {
  20048. var rem = parts.length > 1 ? parts[1] : "0";
  20049. if (dec != null) {
  20050. rem = rem + new Array(dec - rem.length + 1).join("0");
  20051. }
  20052. str = integer + dsep + rem;
  20053. }
  20054. return str;
  20055. }
  20056. };
  20057. if (!Number.prototype.limitSigDigs) {
  20058. /**
  20059. * APIMethod: Number.limitSigDigs
  20060. * 限制浮点数的有效数字位数.
  20061. * @param {number} sig -有效位数。
  20062. * @returns {number} 将数字四舍五入到指定数量的有效位数。
  20063. * 如果传入值 为 null、0、或者是负数, 返回值 0。
  20064. */
  20065. Number.prototype.limitSigDigs = function (sig) {
  20066. return NumberExt.limitSigDigs(this, sig);
  20067. };
  20068. }
  20069. /**
  20070. * @name Function
  20071. * @namespace
  20072. * @category BaseTypes Util
  20073. * @description 函数操作的一系列常用扩展函数。
  20074. * @private
  20075. */
  20076. var FunctionExt = {
  20077. /**
  20078. * @function FunctionExt.bind
  20079. * @description 绑定函数到对象。方便创建 this 的作用域。
  20080. * @param {function} func - 输入函数。
  20081. * @param {Object} object - 对象绑定到输入函数(作为输入函数的 this 对象)。
  20082. * @returns {function} object 参数作为 func 函数的 this 对象。
  20083. */
  20084. bind: function bind(func, object) {
  20085. // create a reference to all arguments past the second one
  20086. var args = Array.prototype.slice.apply(arguments, [2]);
  20087. return function () {
  20088. // Push on any additional arguments from the actual function call.
  20089. // These will come after those sent to the bind call.
  20090. var newArgs = args.concat(Array.prototype.slice.apply(arguments, [0]));
  20091. return func.apply(object, newArgs);
  20092. };
  20093. },
  20094. /**
  20095. * @function FunctionExt.bindAsEventListener
  20096. * @description 绑定函数到对象,在调用该函数时配置并使用事件对象作为第一个参数。
  20097. * @param {function} func - 用于监听事件的函数。
  20098. * @param {Object} object - this 对象的引用。
  20099. * @returns {function}
  20100. */
  20101. bindAsEventListener: function bindAsEventListener(func, object) {
  20102. return function (event) {
  20103. return func.call(object, event || window.event);
  20104. };
  20105. },
  20106. /**
  20107. * @function FunctionExt.False
  20108. * @description 该函数仅仅返回 false。该函数主要是避免在 IE8 以下浏览中 DOM 事件句柄的匿名函数问题。
  20109. * @example
  20110. * document.onclick = FunctionExt.False;
  20111. * @returns {boolean}
  20112. */
  20113. False: function False() {
  20114. return false;
  20115. },
  20116. /**
  20117. * @function FunctionExt.True
  20118. * @description 该函数仅仅返回 true。该函数主要是避免在 IE8 以下浏览中 DOM 事件句柄的匿名函数问题。
  20119. * @example
  20120. * document.onclick = FunctionExt.True;
  20121. * @returns {boolean}
  20122. */
  20123. True: function True() {
  20124. return true;
  20125. },
  20126. /**
  20127. * @function FunctionExt.Void
  20128. * @description 可重用函数,仅仅返回 "undefined"。
  20129. * @returns {undefined}
  20130. */
  20131. Void: function Void() {}
  20132. };
  20133. /**
  20134. * @name Array
  20135. * @namespace
  20136. * @category BaseTypes Util
  20137. * @description 数组操作的一系列常用扩展函数。
  20138. * @private
  20139. */
  20140. var ArrayExt = {
  20141. /**
  20142. * @function ArrayExt.filter
  20143. * @description 过滤数组,提供了 ECMA-262 标准中 Array.prototype.filter 函数的扩展。详见:{@link http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/filter}
  20144. * @param {Array} array - 要过滤的数组。
  20145. * @param {function} callback - 数组中的每一个元素调用该函数。</br>
  20146. * 如果函数的返回值为 true,该元素将包含在返回的数组中。该函数有三个参数: 数组中的元素,元素的索引,数组自身。</br>
  20147. * 如果设置了可选参数 caller,在调用 callback 时,使用可选参数 caller 设置为 callback 的参数。</br>
  20148. * @param {Object} [caller] - 在调用 callback 时,使用参数 caller 设置为 callback 的参数。
  20149. * @returns {Array} callback 函数返回 true 时的元素将作为返回数组中的元素。
  20150. */
  20151. filter: function filter(array, callback, caller) {
  20152. var selected = [];
  20153. if (Array.prototype.filter) {
  20154. selected = array.filter(callback, caller);
  20155. } else {
  20156. var len = array.length;
  20157. if (typeof callback != "function") {
  20158. throw new TypeError();
  20159. }
  20160. for (var i = 0; i < len; i++) {
  20161. if (i in array) {
  20162. var val = array[i];
  20163. if (callback.call(caller, val, i, array)) {
  20164. selected.push(val);
  20165. }
  20166. }
  20167. }
  20168. }
  20169. return selected;
  20170. }
  20171. };
  20172. ;// CONCATENATED MODULE: ./src/common/commontypes/Geometry.js
  20173. function Geometry_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20174. function Geometry_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  20175. function Geometry_createClass(Constructor, protoProps, staticProps) { if (protoProps) Geometry_defineProperties(Constructor.prototype, protoProps); if (staticProps) Geometry_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  20176. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  20177. * This program are made available under the terms of the Apache License, Version 2.0
  20178. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20179. // import {WKT} from '../format/WKT';
  20180. // import {Vector} from './Vector';
  20181. /**
  20182. * @class Geometry
  20183. * @deprecatedclass SuperMap.Geometry
  20184. * @category BaseTypes Geometry
  20185. * @classdesc 几何对象类,描述地理对象的几何图形。
  20186. * @usage
  20187. */
  20188. var Geometry_Geometry = /*#__PURE__*/function () {
  20189. function Geometry() {
  20190. Geometry_classCallCheck(this, Geometry);
  20191. this.CLASS_NAME = "SuperMap.Geometry";
  20192. /**
  20193. * @member {string} Geometry.prototype.id
  20194. * @description 几何对象的唯一标识符。
  20195. *
  20196. */
  20197. this.id = Util_Util.createUniqueID(this.CLASS_NAME + "_");
  20198. /**
  20199. * @member {Geometry} Geometry.prototype.parent
  20200. * @description 父类几何对象。
  20201. */
  20202. this.parent = null;
  20203. /**
  20204. * @member {Bounds} Geometry.prototype.bounds
  20205. * @description 几何对象的范围。
  20206. *
  20207. */
  20208. this.bounds = null;
  20209. /**
  20210. * @member {number} Geometry.prototype.SRID
  20211. * @description 投影坐标参数。通过该参数,服务器判断 Geometry 对象的坐标参考系是否与数据集相同,如果不同,则在数据入库前进行投影变换。
  20212. * @example
  20213. * var geometry= new Geometry();
  20214. * geometry. SRID=4326;
  20215. *
  20216. */
  20217. this.SRID = null;
  20218. }
  20219. /**
  20220. * @function Geometry.prototype.destroy
  20221. * @description 解构 Geometry 类,释放资源。
  20222. */
  20223. Geometry_createClass(Geometry, [{
  20224. key: "destroy",
  20225. value: function destroy() {
  20226. this.id = null;
  20227. this.bounds = null;
  20228. this.SRID = null;
  20229. }
  20230. /**
  20231. * @function Geometry.prototype.clone
  20232. * @description 克隆几何图形。克隆的几何图形不设置非标准的属性。
  20233. * @returns {Geometry} 克隆的几何图形。
  20234. */
  20235. }, {
  20236. key: "clone",
  20237. value: function clone() {
  20238. return new Geometry();
  20239. }
  20240. /**
  20241. * @function Geometry.prototype.setBounds
  20242. * @description 设置几何对象的 bounds。
  20243. * @param {Bounds} bounds - 范围。
  20244. */
  20245. }, {
  20246. key: "setBounds",
  20247. value: function setBounds(bounds) {
  20248. if (bounds) {
  20249. this.bounds = bounds.clone();
  20250. }
  20251. }
  20252. /**
  20253. * @function Geometry.prototype.clearBounds
  20254. * @description 清除几何对象的 bounds。
  20255. * 如果该对象有父类,也会清除父类几何对象的 bounds。
  20256. */
  20257. }, {
  20258. key: "clearBounds",
  20259. value: function clearBounds() {
  20260. this.bounds = null;
  20261. if (this.parent) {
  20262. this.parent.clearBounds();
  20263. }
  20264. }
  20265. /**
  20266. * @function Geometry.prototype.extendBounds
  20267. * @description 扩展现有边界以包含新边界。如果尚未设置几何边界,则设置新边界。
  20268. * @param {Bounds} newBounds - 几何对象的 bounds。
  20269. */
  20270. }, {
  20271. key: "extendBounds",
  20272. value: function extendBounds(newBounds) {
  20273. var bounds = this.getBounds();
  20274. if (!bounds) {
  20275. this.setBounds(newBounds);
  20276. } else {
  20277. this.bounds.extend(newBounds);
  20278. }
  20279. }
  20280. /**
  20281. * @function Geometry.prototype.getBounds
  20282. * @description 获得几何图形的边界。如果没有设置边界,可通过计算获得。
  20283. * @returns {Bounds} 几何对象的边界。
  20284. */
  20285. }, {
  20286. key: "getBounds",
  20287. value: function getBounds() {
  20288. if (this.bounds == null) {
  20289. this.calculateBounds();
  20290. }
  20291. return this.bounds;
  20292. }
  20293. /**
  20294. * @function Geometry.prototype.calculateBounds
  20295. * @description 重新计算几何图形的边界(需要在子类中实现此方法)。
  20296. */
  20297. }, {
  20298. key: "calculateBounds",
  20299. value: function calculateBounds() {
  20300. //
  20301. // This should be overridden by subclasses.
  20302. //
  20303. }
  20304. /**
  20305. * @function Geometry.prototype.getVertices
  20306. * @description 返回几何图形的所有顶点的列表(需要在子类中实现此方法)。
  20307. * @param {boolean} [nodes] - 如果是 true,线则只返回线的末端点,如果 false,仅仅返回顶点,如果没有设置,则返回顶点。
  20308. * @returns {Array} 几何图形的顶点列表。
  20309. */
  20310. }, {
  20311. key: "getVertices",
  20312. value: function getVertices(nodes) {// eslint-disable-line no-unused-vars
  20313. }
  20314. /**
  20315. * @function Geometry.prototype.getArea
  20316. * @description 计算几何对象的面积 ,此方法需要在子类中定义。
  20317. * @returns {number} 计算后的对象面积。
  20318. */
  20319. }, {
  20320. key: "getArea",
  20321. value: function getArea() {
  20322. //to be overridden by geometries that actually have an area
  20323. //
  20324. return 0.0;
  20325. }
  20326. // /**
  20327. // * @function Geometry.prototype.toString
  20328. // * @description 返回geometry对象的字符串表述,需要引入{@link WKTFormat}。此方法只能在子类实现,在父类使用会报错。
  20329. // * @returns {string} geometry对象的字符串表述(Well-Known Text)
  20330. // */
  20331. // toString() {
  20332. // var string;
  20333. // if (WKT) {
  20334. // var wkt = new WKT();
  20335. // string = wkt.write(new Vector(this));
  20336. // } else {
  20337. // string = Object.prototype.toString.call(this);
  20338. // }
  20339. // return string;
  20340. // }
  20341. }]);
  20342. return Geometry;
  20343. }();
  20344. ;// CONCATENATED MODULE: ./src/common/commontypes/Util.js
  20345. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  20346. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  20347. * This program are made available under the terms of the Apache License, Version 2.0
  20348. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20349. /**
  20350. * @description 浏览器名称,依赖于 userAgent 属性,BROWSER_NAME 可以是空,或者以下浏览器:
  20351. * * "opera" -- Opera
  20352. * * "msie" -- Internet Explorer
  20353. * * "safari" -- Safari
  20354. * * "firefox" -- Firefox
  20355. * * "mozilla" -- Mozilla
  20356. * @category BaseTypes Constant
  20357. * @constant {Object}
  20358. * @usage
  20359. * ```
  20360. * // 浏览器
  20361. * <script type="text/javascript" src="{cdn}"></script>
  20362. * <script>
  20363. * const result = {namespace}.Browser.name;
  20364. *
  20365. * </script>
  20366. * // ES6 Import
  20367. * import { Browser } from '{npm}';
  20368. *
  20369. * const result = Browser.name;
  20370. * ```
  20371. */
  20372. var Browser = function () {
  20373. var name = '',
  20374. version = '',
  20375. device = 'pc',
  20376. uaMatch;
  20377. //以下进行测试
  20378. var ua = navigator.userAgent.toLowerCase();
  20379. if (ua.indexOf('msie') > -1 || ua.indexOf('trident') > -1 && ua.indexOf('rv') > -1) {
  20380. name = 'msie';
  20381. uaMatch = ua.match(/msie ([\d.]+)/) || ua.match(/rv:([\d.]+)/);
  20382. } else if (ua.indexOf('chrome') > -1) {
  20383. name = 'chrome';
  20384. uaMatch = ua.match(/chrome\/([\d.]+)/);
  20385. } else if (ua.indexOf('firefox') > -1) {
  20386. name = 'firefox';
  20387. uaMatch = ua.match(/firefox\/([\d.]+)/);
  20388. } else if (ua.indexOf('opera') > -1) {
  20389. name = 'opera';
  20390. uaMatch = ua.match(/version\/([\d.]+)/);
  20391. } else if (ua.indexOf('safari') > -1) {
  20392. name = 'safari';
  20393. uaMatch = ua.match(/version\/([\d.]+)/);
  20394. }
  20395. version = uaMatch ? uaMatch[1] : '';
  20396. if (ua.indexOf('ipad') > -1 || ua.indexOf('ipod') > -1 || ua.indexOf('iphone') > -1) {
  20397. device = 'apple';
  20398. } else if (ua.indexOf('android') > -1) {
  20399. uaMatch = ua.match(/version\/([\d.]+)/);
  20400. version = uaMatch ? uaMatch[1] : '';
  20401. device = 'android';
  20402. }
  20403. return {
  20404. name: name,
  20405. version: version,
  20406. device: device
  20407. };
  20408. }();
  20409. var isSupportCanvas = function () {
  20410. var checkRes = true,
  20411. broz = Browser;
  20412. if (document.createElement('canvas').getContext) {
  20413. if (broz.name === 'firefox' && parseFloat(broz.version) < 5) {
  20414. checkRes = false;
  20415. }
  20416. if (broz.name === 'safari' && parseFloat(broz.version) < 4) {
  20417. checkRes = false;
  20418. }
  20419. if (broz.name === 'opera' && parseFloat(broz.version) < 10) {
  20420. checkRes = false;
  20421. }
  20422. if (broz.name === 'msie' && parseFloat(broz.version) < 9) {
  20423. checkRes = false;
  20424. }
  20425. } else {
  20426. checkRes = false;
  20427. }
  20428. return checkRes;
  20429. }();
  20430. /**
  20431. * @description 如果 userAgent 捕获到浏览器使用的是 Gecko 引擎则返回 true。
  20432. * @constant {number}
  20433. * @private
  20434. */
  20435. var IS_GECKO = function () {
  20436. var ua = navigator.userAgent.toLowerCase();
  20437. return ua.indexOf('webkit') === -1 && ua.indexOf('gecko') !== -1;
  20438. }();
  20439. /**
  20440. * @constant {number}
  20441. * @default
  20442. * @description 分辨率与比例尺之间转换的常量。
  20443. * @private
  20444. */
  20445. var DOTS_PER_INCH = 96;
  20446. /**
  20447. * @name CommonUtil
  20448. * @namespace
  20449. * @category BaseTypes Util
  20450. * @description common 工具类。
  20451. * @usage
  20452. * ```
  20453. * // 浏览器
  20454. * <script type="text/javascript" src="{cdn}"></script>
  20455. * <script>
  20456. * const result = {namespace}.CommonUtil.getElement();
  20457. *
  20458. * // 弃用的写法
  20459. * const result = SuperMap.Util.getElement();
  20460. *
  20461. * </script>
  20462. *
  20463. * // ES6 Import
  20464. * import { CommonUtil } from '{npm}';
  20465. *
  20466. * const result = CommonUtil.getElement();
  20467. * ```
  20468. */
  20469. var Util_Util = {
  20470. /**
  20471. * @function Util.extend
  20472. * @description 对象拷贝赋值。
  20473. * @param {Object} dest - 目标对象。
  20474. * @param {Object} arguments - 待拷贝的对象。
  20475. * @returns {Object} 赋值后的目标对象。
  20476. */
  20477. assign: function assign(dest) {
  20478. for (var index = 0; index < Object.getOwnPropertyNames(arguments).length; index++) {
  20479. var arg = Object.getOwnPropertyNames(arguments)[index];
  20480. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  20481. continue;
  20482. }
  20483. var obj = arguments[arg];
  20484. if (obj) {
  20485. for (var j = 0; j < Object.getOwnPropertyNames(obj).length; j++) {
  20486. var key = Object.getOwnPropertyNames(obj)[j];
  20487. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  20488. continue;
  20489. }
  20490. dest[key] = obj[key];
  20491. }
  20492. }
  20493. }
  20494. return dest;
  20495. },
  20496. /**
  20497. * @memberOf CommonUtil
  20498. * @description 复制源对象的所有属性到目标对象上,源对象上的没有定义的属性在目标对象上也不会被设置。
  20499. * @example
  20500. * 要复制 Size 对象的所有属性到自定义对象上,使用方法如下:
  20501. * var size = new Size(100, 100);
  20502. * var obj = {};
  20503. * CommonUtil.extend(obj, size);
  20504. * @param {Object} [destination] - 目标对象。
  20505. * @param {Object} source - 源对象,其属性将被设置到目标对象上。
  20506. * @returns {Object} 目标对象。
  20507. */
  20508. extend: function extend(destination, source) {
  20509. destination = destination || {};
  20510. if (source) {
  20511. for (var property in source) {
  20512. var value = source[property];
  20513. if (value !== undefined) {
  20514. destination[property] = value;
  20515. }
  20516. }
  20517. /**
  20518. * IE doesn't include the toString property when iterating over an object's
  20519. * properties with the for(property in object) syntax. Explicitly check if
  20520. * the source has its own toString property.
  20521. */
  20522. /*
  20523. * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative
  20524. * prototype object" when calling hawOwnProperty if the source object
  20525. * is an instance of window.Event.
  20526. */
  20527. var sourceIsEvt = typeof window.Event === 'function' && source instanceof window.Event;
  20528. if (!sourceIsEvt && source.hasOwnProperty && source.hasOwnProperty('toString')) {
  20529. destination.toString = source.toString;
  20530. }
  20531. }
  20532. return destination;
  20533. },
  20534. /**
  20535. * @memberOf CommonUtil
  20536. * @description 对象拷贝。
  20537. * @param {Object} [des] - 目标对象。
  20538. * @param {Object} soc - 源对象。
  20539. */
  20540. copy: function copy(des, soc) {
  20541. des = des || {};
  20542. var v;
  20543. if (soc) {
  20544. for (var p in des) {
  20545. v = soc[p];
  20546. if (typeof v !== 'undefined') {
  20547. des[p] = v;
  20548. }
  20549. }
  20550. }
  20551. },
  20552. /**
  20553. * @memberOf CommonUtil
  20554. * @description 销毁对象,将其属性置空。
  20555. * @param {Object} [obj] - 目标对象。
  20556. */
  20557. reset: function reset(obj) {
  20558. obj = obj || {};
  20559. for (var p in obj) {
  20560. if (obj.hasOwnProperty(p)) {
  20561. if (_typeof(obj[p]) === 'object' && obj[p] instanceof Array) {
  20562. for (var i in obj[p]) {
  20563. if (obj[p][i].destroy) {
  20564. obj[p][i].destroy();
  20565. }
  20566. }
  20567. obj[p].length = 0;
  20568. } else if (_typeof(obj[p]) === 'object' && obj[p] instanceof Object) {
  20569. if (obj[p].destroy) {
  20570. obj[p].destroy();
  20571. }
  20572. }
  20573. obj[p] = null;
  20574. }
  20575. }
  20576. },
  20577. /**
  20578. * @memberOf CommonUtil
  20579. * @description 获取 HTML 元素数组。
  20580. * @returns {Array.<HTMLElement>} HTML 元素数组。
  20581. */
  20582. getElement: function getElement() {
  20583. var elements = [];
  20584. for (var i = 0, len = arguments.length; i < len; i++) {
  20585. var element = arguments[i];
  20586. if (typeof element === 'string') {
  20587. element = document.getElementById(element);
  20588. }
  20589. if (arguments.length === 1) {
  20590. return element;
  20591. }
  20592. elements.push(element);
  20593. }
  20594. return elements;
  20595. },
  20596. /**
  20597. * @memberOf CommonUtil
  20598. * @description instance of 的跨浏览器实现。
  20599. * @param {Object} o - 对象。
  20600. * @returns {boolean} 是否是页面元素。
  20601. */
  20602. isElement: function isElement(o) {
  20603. return !!(o && o.nodeType === 1);
  20604. },
  20605. /**
  20606. * @memberOf CommonUtil
  20607. * @description 判断一个对象是否是数组。
  20608. * @param {Object} a - 对象。
  20609. * @returns {boolean} 是否是数组。
  20610. */
  20611. isArray: function isArray(a) {
  20612. return Object.prototype.toString.call(a) === '[object Array]';
  20613. },
  20614. /**
  20615. * @memberOf CommonUtil
  20616. * @description 从数组中删除某一项。
  20617. * @param {Array} array - 数组。
  20618. * @param {Object} item - 数组中要删除的一项。
  20619. * @returns {Array} 执行删除操作后的数组。
  20620. */
  20621. removeItem: function removeItem(array, item) {
  20622. for (var i = array.length - 1; i >= 0; i--) {
  20623. if (array[i] === item) {
  20624. array.splice(i, 1);
  20625. //break;more than once??
  20626. }
  20627. }
  20628. return array;
  20629. },
  20630. /**
  20631. * @memberOf CommonUtil
  20632. * @description 获取某对象在数组中的索引值。
  20633. * @param {Array.<Object>} array - 数组。
  20634. * @param {Object} obj - 对象。
  20635. * @returns {number} 某对象在数组中的索引值。
  20636. */
  20637. indexOf: function indexOf(array, obj) {
  20638. if (array == null) {
  20639. return -1;
  20640. } else {
  20641. // use the build-in function if available.
  20642. if (typeof array.indexOf === 'function') {
  20643. return array.indexOf(obj);
  20644. } else {
  20645. for (var i = 0, len = array.length; i < len; i++) {
  20646. if (array[i] === obj) {
  20647. return i;
  20648. }
  20649. }
  20650. return -1;
  20651. }
  20652. }
  20653. },
  20654. /**
  20655. * @memberOf CommonUtil
  20656. * @description 修改某 DOM 元素的许多属性。
  20657. * @param {HTMLElement} element - 待修改的 DOM 元素。
  20658. * @param {string} [id] - DOM 元素的 ID。
  20659. * @param {Pixel} [px] - DOM 元素的 style 属性的 left 和 top 属性。
  20660. * @param {Size} [sz] - DOM 元素的 width 和 height 属性。
  20661. * @param {string} [position] - DOM 元素的 position 属性。
  20662. * @param {string} [border] - DOM 元素的 style 属性的 border 属性。
  20663. * @param {string} [overflow] - DOM 元素的 style 属性的 overflow 属性。
  20664. * @param {number} [opacity] - 不透明度值。取值范围为(0.0 - 1.0)。
  20665. */
  20666. modifyDOMElement: function modifyDOMElement(element, id, px, sz, position, border, overflow, opacity) {
  20667. if (id) {
  20668. element.id = id;
  20669. }
  20670. if (px) {
  20671. element.style.left = px.x + 'px';
  20672. element.style.top = px.y + 'px';
  20673. }
  20674. if (sz) {
  20675. element.style.width = sz.w + 'px';
  20676. element.style.height = sz.h + 'px';
  20677. }
  20678. if (position) {
  20679. element.style.position = position;
  20680. }
  20681. if (border) {
  20682. element.style.border = border;
  20683. }
  20684. if (overflow) {
  20685. element.style.overflow = overflow;
  20686. }
  20687. if (parseFloat(opacity) >= 0.0 && parseFloat(opacity) < 1.0) {
  20688. element.style.filter = 'alpha(opacity=' + opacity * 100 + ')';
  20689. element.style.opacity = opacity;
  20690. } else if (parseFloat(opacity) === 1.0) {
  20691. element.style.filter = '';
  20692. element.style.opacity = '';
  20693. }
  20694. },
  20695. /**
  20696. * @memberOf CommonUtil
  20697. * @description 比较两个对象并合并。
  20698. * @param {Object} [to] - 目标对象。
  20699. * @param {Object} from - 源对象。
  20700. * @returns {Object} 返回合并后的对象。
  20701. */
  20702. applyDefaults: function applyDefaults(to, from) {
  20703. to = to || {};
  20704. /*
  20705. * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative
  20706. * prototype object" when calling hawOwnProperty if the source object is an
  20707. * instance of window.Event.
  20708. */
  20709. var fromIsEvt = typeof window.Event === 'function' && from instanceof window.Event;
  20710. for (var key in from) {
  20711. if (to[key] === undefined || !fromIsEvt && from.hasOwnProperty && from.hasOwnProperty(key) && !to.hasOwnProperty(key)) {
  20712. to[key] = from[key];
  20713. }
  20714. }
  20715. /**
  20716. * IE doesn't include the toString property when iterating over an object's
  20717. * properties with the for(property in object) syntax. Explicitly check if
  20718. * the source has its own toString property.
  20719. */
  20720. if (!fromIsEvt && from && from.hasOwnProperty && from.hasOwnProperty('toString') && !to.hasOwnProperty('toString')) {
  20721. to.toString = from.toString;
  20722. }
  20723. return to;
  20724. },
  20725. /**
  20726. * @memberOf CommonUtil
  20727. * @description 将参数对象转换为 HTTP 的 GET 请求中的参数字符串。例如:"key1=value1&key2=value2&key3=value3"。
  20728. * @param {Object} params - 参数对象。
  20729. * @returns {string} HTTP 的 GET 请求中的参数字符串。
  20730. */
  20731. getParameterString: function getParameterString(params) {
  20732. var paramsArray = [];
  20733. for (var key in params) {
  20734. var value = params[key];
  20735. if (value != null && typeof value !== 'function') {
  20736. var encodedValue;
  20737. if (Array.isArray(value) || value.toString() === '[object Object]') {
  20738. encodedValue = encodeURIComponent(JSON.stringify(value));
  20739. } else {
  20740. /* value is a string; simply encode */
  20741. encodedValue = encodeURIComponent(value);
  20742. }
  20743. paramsArray.push(encodeURIComponent(key) + '=' + encodedValue);
  20744. }
  20745. }
  20746. return paramsArray.join('&');
  20747. },
  20748. /**
  20749. * @memberOf CommonUtil
  20750. * @description 给 URL 追加查询参数。
  20751. * @param {string} url - 待追加参数的 URL 字符串。
  20752. * @param {string} paramStr - 待追加的查询参数。
  20753. * @returns {string} 新的 URL。
  20754. */
  20755. urlAppend: function urlAppend(url, paramStr) {
  20756. var newUrl = url;
  20757. if (paramStr) {
  20758. if (paramStr.indexOf('?') === 0) {
  20759. paramStr = paramStr.substring(1);
  20760. }
  20761. var parts = (url + ' ').split(/[?&]/);
  20762. newUrl += parts.pop() === ' ' ? paramStr : parts.length ? '&' + paramStr : '?' + paramStr;
  20763. }
  20764. return newUrl;
  20765. },
  20766. /**
  20767. * @memberOf CommonUtil
  20768. * @description 给 URL 追加 path 参数。
  20769. * @param {string} url - 待追加参数的 URL 字符串。
  20770. * @param {string} paramStr - 待追加的path参数。
  20771. * @returns {string} 新的 URL。
  20772. */
  20773. urlPathAppend: function urlPathAppend(url, pathStr) {
  20774. var newUrl = url;
  20775. if (!pathStr) {
  20776. return newUrl;
  20777. }
  20778. if (pathStr.indexOf('/') === 0) {
  20779. pathStr = pathStr.substring(1);
  20780. }
  20781. var parts = url.split('?');
  20782. if (parts[0].indexOf('/', parts[0].length - 1) < 0) {
  20783. parts[0] += '/';
  20784. }
  20785. newUrl = "".concat(parts[0]).concat(pathStr).concat(parts.length > 1 ? "?".concat(parts[1]) : '');
  20786. return newUrl;
  20787. },
  20788. /**
  20789. * @memberOf CommonUtil
  20790. * @description 为了避免浮点精度错误而保留的有效位数。
  20791. * @type {number}
  20792. * @default 14
  20793. */
  20794. DEFAULT_PRECISION: 14,
  20795. /**
  20796. * @memberOf CommonUtil
  20797. * @description 将字符串以接近的精度转换为数字。
  20798. * @param {string} number - 字符串。
  20799. * @param {number} [precision=14] - 精度。
  20800. * @returns {number} 转化后的数字。
  20801. */
  20802. toFloat: function toFloat(number, precision) {
  20803. if (precision == null) {
  20804. precision = Util_Util.DEFAULT_PRECISION;
  20805. }
  20806. if (typeof number !== 'number') {
  20807. number = parseFloat(number);
  20808. }
  20809. return precision === 0 ? number : parseFloat(number.toPrecision(precision));
  20810. },
  20811. /**
  20812. * @memberOf CommonUtil
  20813. * @description 角度转弧度。
  20814. * @param {number} x - 角度。
  20815. * @returns {number} 转化后的弧度。
  20816. */
  20817. rad: function rad(x) {
  20818. return x * Math.PI / 180;
  20819. },
  20820. /**
  20821. * @memberOf CommonUtil
  20822. * @description 从 URL 字符串中解析出参数对象。
  20823. * @param {string} url - URL。
  20824. * @returns {Object} 解析出的参数对象。
  20825. */
  20826. getParameters: function getParameters(url) {
  20827. // if no url specified, take it from the location bar
  20828. url = url === null || url === undefined ? window.location.href : url;
  20829. //parse out parameters portion of url string
  20830. var paramsString = '';
  20831. if (StringExt.contains(url, '?')) {
  20832. var start = url.indexOf('?') + 1;
  20833. var end = StringExt.contains(url, '#') ? url.indexOf('#') : url.length;
  20834. paramsString = url.substring(start, end);
  20835. }
  20836. var parameters = {};
  20837. var pairs = paramsString.split(/[&;]/);
  20838. for (var i = 0, len = pairs.length; i < len; ++i) {
  20839. var keyValue = pairs[i].split('=');
  20840. if (keyValue[0]) {
  20841. var key = keyValue[0];
  20842. try {
  20843. key = decodeURIComponent(key);
  20844. } catch (err) {
  20845. key = unescape(key);
  20846. }
  20847. // being liberal by replacing "+" with " "
  20848. var value = (keyValue[1] || '').replace(/\+/g, ' ');
  20849. try {
  20850. value = decodeURIComponent(value);
  20851. } catch (err) {
  20852. value = unescape(value);
  20853. }
  20854. // follow OGC convention of comma delimited values
  20855. value = value.split(',');
  20856. //if there's only one value, do not return as array
  20857. if (value.length == 1) {
  20858. value = value[0];
  20859. }
  20860. parameters[key] = value;
  20861. }
  20862. }
  20863. return parameters;
  20864. },
  20865. /**
  20866. * @memberOf CommonUtil
  20867. * @description 不断递增计数变量,用于生成唯一 ID。
  20868. * @type {number}
  20869. * @default 0
  20870. */
  20871. lastSeqID: 0,
  20872. /**
  20873. * @memberOf CommonUtil
  20874. * @description 创建唯一 ID 值。
  20875. * @param {string} [prefix] - 前缀。
  20876. * @returns {string} 唯一的 ID 值。
  20877. */
  20878. createUniqueID: function createUniqueID(prefix) {
  20879. if (prefix == null) {
  20880. prefix = 'id_';
  20881. }
  20882. Util_Util.lastSeqID += 1;
  20883. return prefix + Util_Util.lastSeqID;
  20884. },
  20885. /**
  20886. * @memberOf CommonUtil
  20887. * @description 判断并转化比例尺。
  20888. * @param {number} scale - 比例尺。
  20889. * @returns {number} 正常的 scale 值。
  20890. */
  20891. normalizeScale: function normalizeScale(scale) {
  20892. var normScale = scale > 1.0 ? 1.0 / scale : scale;
  20893. return normScale;
  20894. },
  20895. /**
  20896. * @memberOf CommonUtil
  20897. * @description 比例尺转分辨率。
  20898. * @param {number} scale - 比例尺。
  20899. * @param {string} [units='degrees'] - 比例尺单位。
  20900. * @returns {number} 转化后的分辨率。
  20901. */
  20902. getResolutionFromScale: function getResolutionFromScale(scale, units) {
  20903. var resolution;
  20904. if (scale) {
  20905. if (units == null) {
  20906. units = 'degrees';
  20907. }
  20908. var normScale = Util_Util.normalizeScale(scale);
  20909. resolution = 1 / (normScale * INCHES_PER_UNIT[units] * DOTS_PER_INCH);
  20910. }
  20911. return resolution;
  20912. },
  20913. /**
  20914. * @memberOf CommonUtil
  20915. * @description 分辨率转比例尺。
  20916. * @param {number} resolution - 分辨率。
  20917. * @param {string} [units='degrees'] - 分辨率单位。
  20918. * @returns {number} 转化后的比例尺。
  20919. */
  20920. getScaleFromResolution: function getScaleFromResolution(resolution, units) {
  20921. if (units == null) {
  20922. units = 'degrees';
  20923. }
  20924. var scale = resolution * INCHES_PER_UNIT[units] * DOTS_PER_INCH;
  20925. return scale;
  20926. },
  20927. /**
  20928. * @memberOf CommonUtil
  20929. * @description 获取浏览器相关信息。支持的浏览器包括:Opera,Internet Explorer,Safari,Firefox。
  20930. * @returns {Object} 浏览器名称、版本、设备名称。对应的属性分别为 name, version, device。
  20931. */
  20932. getBrowser: function getBrowser() {
  20933. return Browser;
  20934. },
  20935. /**
  20936. * @memberOf CommonUtil
  20937. * @description 浏览器是否支持 Canvas。
  20938. * @returns {boolean} 当前浏览器是否支持 HTML5 Canvas。
  20939. */
  20940. isSupportCanvas: isSupportCanvas,
  20941. /**
  20942. * @memberOf CommonUtil
  20943. * @description 判断浏览器是否支持 Canvas。
  20944. * @returns {boolean} 当前浏览器是否支持 HTML5 Canvas 。
  20945. */
  20946. supportCanvas: function supportCanvas() {
  20947. return Util_Util.isSupportCanvas;
  20948. },
  20949. /**
  20950. * @memberOf CommonUtil
  20951. * @description 判断一个 URL 请求是否在当前域中。
  20952. * @param {string} url - URL 请求字符串。
  20953. * @returns {boolean} URL 请求是否在当前域中。
  20954. */
  20955. isInTheSameDomain: function isInTheSameDomain(url) {
  20956. if (!url) {
  20957. return true;
  20958. }
  20959. var index = url.indexOf('//');
  20960. var documentUrl = document.location.toString();
  20961. var documentIndex = documentUrl.indexOf('//');
  20962. if (index === -1) {
  20963. return true;
  20964. } else {
  20965. var protocol;
  20966. var substring = protocol = url.substring(0, index);
  20967. var documentSubString = documentUrl.substring(documentIndex + 2);
  20968. documentIndex = documentSubString.indexOf('/');
  20969. var documentPortIndex = documentSubString.indexOf(':');
  20970. var documentDomainWithPort = documentSubString.substring(0, documentIndex);
  20971. //var documentPort;
  20972. var documentprotocol = document.location.protocol;
  20973. if (documentPortIndex !== -1) {
  20974. // documentPort = +documentSubString.substring(documentPortIndex, documentIndex);
  20975. } else {
  20976. documentDomainWithPort += ':' + (documentprotocol.toLowerCase() === 'http:' ? 80 : 443);
  20977. }
  20978. if (documentprotocol.toLowerCase() !== substring.toLowerCase()) {
  20979. return false;
  20980. }
  20981. substring = url.substring(index + 2);
  20982. var portIndex = substring.indexOf(':');
  20983. index = substring.indexOf('/');
  20984. var domainWithPort = substring.substring(0, index);
  20985. var domain;
  20986. if (portIndex !== -1) {
  20987. domain = substring.substring(0, portIndex);
  20988. } else {
  20989. domain = substring.substring(0, index);
  20990. domainWithPort += ':' + (protocol.toLowerCase() === 'http:' ? 80 : 443);
  20991. }
  20992. var documentDomain = document.domain;
  20993. if (domain === documentDomain && domainWithPort === documentDomainWithPort) {
  20994. return true;
  20995. }
  20996. }
  20997. return false;
  20998. },
  20999. /**
  21000. * @memberOf CommonUtil
  21001. * @description 计算 iServer 服务的 REST 图层的显示分辨率,需要从 iServer 的 REST 图层表述中获取 viewBounds、viewer、scale、coordUnit、datumAxis 五个参数,来进行计算。
  21002. * @param {Bounds} viewBounds - 地图的参照可视范围,即地图初始化时默认的地图显示范围。
  21003. * @param {Size} viewer - 地图初始化时默认的地图图片的尺寸。
  21004. * @param {number} scale - 地图初始化时默认的显示比例尺。
  21005. * @param {string} [coordUnit='degrees'] - 投影坐标系统的地图单位。
  21006. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则系统默认为 WGS84 参考系的椭球体长半轴 6378137。
  21007. * @returns {number} 图层显示分辨率。
  21008. */
  21009. calculateDpi: function calculateDpi(viewBounds, viewer, scale, coordUnit, datumAxis) {
  21010. //10000 是 0.1毫米与米的转换。DPI的计算公式:Viewer / DPI * 0.0254 * 10000 = ViewBounds * scale ,公式中的10000是为了提高计算结果的精度,以下出现的ratio皆为如此。
  21011. if (!viewBounds || !viewer || !scale) {
  21012. return;
  21013. }
  21014. var ratio = 10000,
  21015. rvbWidth = viewBounds.getWidth(),
  21016. rvbHeight = viewBounds.getHeight(),
  21017. rvWidth = viewer.w,
  21018. rvHeight = viewer.h;
  21019. //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  21020. datumAxis = datumAxis || 6378137;
  21021. coordUnit = coordUnit || 'degrees';
  21022. var dpi;
  21023. if (coordUnit.toLowerCase() === 'degree' || coordUnit.toLowerCase() === 'degrees' || coordUnit.toLowerCase() === 'dd') {
  21024. var num1 = rvbWidth / rvWidth,
  21025. num2 = rvbHeight / rvHeight,
  21026. resolution = num1 > num2 ? num1 : num2;
  21027. dpi = 0.0254 * ratio / resolution / scale / (Math.PI * 2 * datumAxis / 360) / ratio;
  21028. } else {
  21029. var _resolution = rvbWidth / rvWidth;
  21030. dpi = 0.0254 * ratio / _resolution / scale / ratio;
  21031. }
  21032. return dpi;
  21033. },
  21034. /**
  21035. * @memberOf CommonUtil
  21036. * @description 将对象转换成 JSON 字符串。
  21037. * @param {Object} obj - 要转换成 JSON 的 Object 对象。
  21038. * @returns {string} 转换后的 JSON 对象。
  21039. */
  21040. toJSON: function toJSON(obj) {
  21041. var objInn = obj;
  21042. if (objInn == null) {
  21043. return null;
  21044. }
  21045. switch (objInn.constructor) {
  21046. case String:
  21047. //s = "'" + str.replace(/(["\\])/g, "\\$1") + "'"; string含有单引号出错
  21048. objInn = '"' + objInn.replace(/(["\\])/g, '\\$1') + '"';
  21049. objInn = objInn.replace(/\n/g, '\\n');
  21050. objInn = objInn.replace(/\r/g, '\\r');
  21051. objInn = objInn.replace('<', '&lt;');
  21052. objInn = objInn.replace('>', '&gt;');
  21053. objInn = objInn.replace(/%/g, '%25');
  21054. objInn = objInn.replace(/&/g, '%26');
  21055. return objInn;
  21056. case Array:
  21057. var arr = '';
  21058. for (var i = 0, len = objInn.length; i < len; i++) {
  21059. arr += Util_Util.toJSON(objInn[i]);
  21060. if (i !== objInn.length - 1) {
  21061. arr += ',';
  21062. }
  21063. }
  21064. return "[" + arr + "]";
  21065. case Number:
  21066. return isFinite(objInn) ? String(objInn) : null;
  21067. case Boolean:
  21068. return String(objInn);
  21069. case Date:
  21070. var dateStr = '{' + '\'__type\':"System.DateTime",' + "'Year':" + objInn.getFullYear() + ',' + "'Month':" + (objInn.getMonth() + 1) + ',' + "'Day':" + objInn.getDate() + ',' + "'Hour':" + objInn.getHours() + ',' + "'Minute':" + objInn.getMinutes() + ',' + "'Second':" + objInn.getSeconds() + ',' + "'Millisecond':" + objInn.getMilliseconds() + ',' + "'TimezoneOffset':" + objInn.getTimezoneOffset() + '}';
  21071. return dateStr;
  21072. default:
  21073. if (objInn['toJSON'] != null && typeof objInn['toJSON'] === 'function') {
  21074. return objInn.toJSON();
  21075. }
  21076. if (_typeof(objInn) === 'object') {
  21077. if (objInn.length) {
  21078. var _arr = [];
  21079. for (var _i2 = 0, _len2 = objInn.length; _i2 < _len2; _i2++) {
  21080. _arr.push(Util_Util.toJSON(objInn[_i2]));
  21081. }
  21082. return '[' + _arr.join(',') + ']';
  21083. }
  21084. var _arr2 = [];
  21085. for (var attr in objInn) {
  21086. //为解决Geometry类型头json时堆栈溢出的问题,attr == "parent"时不进行json转换
  21087. if (typeof objInn[attr] !== 'function' && attr !== 'CLASS_NAME' && attr !== 'parent') {
  21088. _arr2.push("'" + attr + "':" + Util_Util.toJSON(objInn[attr]));
  21089. }
  21090. }
  21091. if (_arr2.length > 0) {
  21092. return '{' + _arr2.join(',') + '}';
  21093. } else {
  21094. return '{}';
  21095. }
  21096. }
  21097. return objInn.toString();
  21098. }
  21099. },
  21100. /**
  21101. * @memberOf CommonUtil
  21102. * @description 根据比例尺和 DPI 计算屏幕分辨率。
  21103. * @category BaseTypes Util
  21104. * @param {number} scale - 比例尺。
  21105. * @param {number} dpi - 图像分辨率,表示每英寸内的像素个数。
  21106. * @param {string} [coordUnit] - 投影坐标系统的地图单位。
  21107. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则 DPI 默认按照 WGS84 参考系的椭球体长半轴 6378137 来计算。
  21108. * @returns {number} 当前比例尺下的屏幕分辨率。
  21109. */
  21110. getResolutionFromScaleDpi: function getResolutionFromScaleDpi(scale, dpi, coordUnit, datumAxis) {
  21111. var resolution = null,
  21112. ratio = 10000;
  21113. //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  21114. datumAxis = datumAxis || 6378137;
  21115. coordUnit = coordUnit || '';
  21116. if (scale > 0 && dpi > 0) {
  21117. scale = Util_Util.normalizeScale(scale);
  21118. if (coordUnit.toLowerCase() === 'degree' || coordUnit.toLowerCase() === 'degrees' || coordUnit.toLowerCase() === 'dd') {
  21119. //scale = Util.normalizeScale(scale);
  21120. resolution = 0.0254 * ratio / dpi / scale / (Math.PI * 2 * datumAxis / 360) / ratio;
  21121. return resolution;
  21122. } else {
  21123. resolution = 0.0254 * ratio / dpi / scale / ratio;
  21124. return resolution;
  21125. }
  21126. }
  21127. return -1;
  21128. },
  21129. /**
  21130. * @memberOf CommonUtil
  21131. * @description 根据 resolution、dpi、coordUnit 和 datumAxis 计算比例尺。
  21132. * @param {number} resolution - 用于计算比例尺的地图分辨率。
  21133. * @param {number} dpi - 图像分辨率,表示每英寸内的像素个数。
  21134. * @param {string} [coordUnit] - 投影坐标系统的地图单位。
  21135. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则 DPI 默认按照 WGS84 参考系的椭球体长半轴 6378137 来计算。
  21136. * @returns {number} 当前屏幕分辨率下的比例尺。
  21137. */
  21138. getScaleFromResolutionDpi: function getScaleFromResolutionDpi(resolution, dpi, coordUnit, datumAxis) {
  21139. var scale = null,
  21140. ratio = 10000;
  21141. //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  21142. datumAxis = datumAxis || 6378137;
  21143. coordUnit = coordUnit || '';
  21144. if (resolution > 0 && dpi > 0) {
  21145. if (coordUnit.toLowerCase() === 'degree' || coordUnit.toLowerCase() === 'degrees' || coordUnit.toLowerCase() === 'dd') {
  21146. scale = 0.0254 * ratio / dpi / resolution / (Math.PI * 2 * datumAxis / 360) / ratio;
  21147. return scale;
  21148. } else {
  21149. scale = 0.0254 * ratio / dpi / resolution / ratio;
  21150. return scale;
  21151. }
  21152. }
  21153. return -1;
  21154. },
  21155. /**
  21156. * @memberOf CommonUtil
  21157. * @description 转换查询结果。
  21158. * @param {Object} result - 查询结果。
  21159. * @returns {Object} 转换后的查询结果。
  21160. */
  21161. transformResult: function transformResult(result) {
  21162. if (result.responseText && typeof result.responseText === 'string') {
  21163. result = JSON.parse(result.responseText);
  21164. }
  21165. return result;
  21166. },
  21167. /**
  21168. * @memberOf CommonUtil
  21169. * @description 属性拷贝,不拷贝方法类名(CLASS_NAME)等。
  21170. * @param {Object} [destination] - 拷贝目标。
  21171. * @param {Object} source - 源对象。
  21172. *
  21173. */
  21174. copyAttributes: function copyAttributes(destination, source) {
  21175. destination = destination || {};
  21176. if (source) {
  21177. for (var property in source) {
  21178. var value = source[property];
  21179. if (value !== undefined && property !== 'CLASS_NAME' && typeof value !== 'function') {
  21180. destination[property] = value;
  21181. }
  21182. }
  21183. }
  21184. return destination;
  21185. },
  21186. /**
  21187. * @memberOf CommonUtil
  21188. * @description 将源对象上的属性拷贝到目标对象上。(不拷贝 CLASS_NAME 和方法)
  21189. * @param {Object} [destination] - 目标对象。
  21190. * @param {Object} source - 源对象。
  21191. * @param {Array.<string>} clip - 源对象中禁止拷贝到目标对象的属性,目的是防止目标对象上不可修改的属性被篡改。
  21192. *
  21193. */
  21194. copyAttributesWithClip: function copyAttributesWithClip(destination, source, clip) {
  21195. destination = destination || {};
  21196. if (source) {
  21197. for (var property in source) {
  21198. //去掉禁止拷贝的属性
  21199. var isInClip = false;
  21200. if (clip && clip.length) {
  21201. for (var i = 0, len = clip.length; i < len; i++) {
  21202. if (property === clip[i]) {
  21203. isInClip = true;
  21204. break;
  21205. }
  21206. }
  21207. }
  21208. if (isInClip === true) {
  21209. continue;
  21210. }
  21211. var value = source[property];
  21212. if (value !== undefined && property !== 'CLASS_NAME' && typeof value !== 'function') {
  21213. destination[property] = value;
  21214. }
  21215. }
  21216. }
  21217. return destination;
  21218. },
  21219. /**
  21220. * @memberOf CommonUtil
  21221. * @description 克隆一个 Object 对象。
  21222. * @param {Object} obj - 需要克隆的对象。
  21223. * @returns {Object} 对象的拷贝对象,注意是新的对象,不是指向。
  21224. */
  21225. cloneObject: function cloneObject(obj) {
  21226. // Handle the 3 simple types, and null or undefined
  21227. if (null === obj || 'object' !== _typeof(obj)) {
  21228. return obj;
  21229. }
  21230. // Handle Date
  21231. if (obj instanceof Date) {
  21232. var copy = new Date();
  21233. copy.setTime(obj.getTime());
  21234. return copy;
  21235. }
  21236. // Handle Array
  21237. if (obj instanceof Array) {
  21238. var _copy = obj.slice(0);
  21239. return _copy;
  21240. }
  21241. // Handle Object
  21242. if (obj instanceof Object) {
  21243. var _copy2 = {};
  21244. for (var attr in obj) {
  21245. if (obj.hasOwnProperty(attr)) {
  21246. _copy2[attr] = Util_Util.cloneObject(obj[attr]);
  21247. }
  21248. }
  21249. return _copy2;
  21250. }
  21251. throw new Error("Unable to copy obj! Its type isn't supported.");
  21252. },
  21253. /**
  21254. * @memberOf CommonUtil
  21255. * @description 判断两条线段是不是有交点。
  21256. * @param {GeometryPoint} a1 - 第一条线段的起始节点。
  21257. * @param {GeometryPoint} a2 - 第一条线段的结束节点。
  21258. * @param {GeometryPoint} b1 - 第二条线段的起始节点。
  21259. * @param {GeometryPoint} b2 - 第二条线段的结束节点。
  21260. * @returns {Object} 如果相交返回交点,如果不相交返回两条线段的位置关系。
  21261. */
  21262. lineIntersection: function lineIntersection(a1, a2, b1, b2) {
  21263. var intersectValue = null;
  21264. var k1;
  21265. var k2;
  21266. var b = (b2.x - b1.x) * (a1.y - b1.y) - (b2.y - b1.y) * (a1.x - b1.x);
  21267. var a = (a2.x - a1.x) * (a1.y - b1.y) - (a2.y - a1.y) * (a1.x - b1.x);
  21268. var ab = (b2.y - b1.y) * (a2.x - a1.x) - (b2.x - b1.x) * (a2.y - a1.y);
  21269. //ab==0代表两条线断的斜率一样
  21270. if (ab != 0) {
  21271. k1 = b / ab;
  21272. k2 = a / ab;
  21273. if (k1 >= 0 && k2 <= 1 && k1 <= 1 && k2 >= 0) {
  21274. intersectValue = new Geometry_Geometry.Point(a1.x + k1 * (a2.x - a1.x), a1.y + k1 * (a2.y - a1.y));
  21275. } else {
  21276. intersectValue = 'No Intersection';
  21277. }
  21278. } else {
  21279. if (b == 0 && a == 0) {
  21280. var maxy = Math.max(a1.y, a2.y);
  21281. var miny = Math.min(a1.y, a2.y);
  21282. var maxx = Math.max(a1.x, a2.x);
  21283. var minx = Math.min(a1.x, a2.x);
  21284. if ((b1.y >= miny && b1.y <= maxy || b2.y >= miny && b2.y <= maxy) && b1.x >= minx && b1.x <= maxx || b2.x >= minx && b2.x <= maxx) {
  21285. intersectValue = 'Coincident'; //重合
  21286. } else {
  21287. intersectValue = 'Parallel'; //平行
  21288. }
  21289. } else {
  21290. intersectValue = 'Parallel'; //平行
  21291. }
  21292. }
  21293. return intersectValue;
  21294. },
  21295. /**
  21296. * @memberOf CommonUtil
  21297. * @description 获取文本外接矩形宽度与高度。
  21298. * @param {ThemeStyle} style - 文本样式。
  21299. * @param {string} text - 文本内容。
  21300. * @param {Object} element - DOM 元素。
  21301. * @returns {Object} 裁剪后的宽度,高度信息。
  21302. */
  21303. getTextBounds: function getTextBounds(style, text, element) {
  21304. document.body.appendChild(element);
  21305. element.style.width = 'auto';
  21306. element.style.height = 'auto';
  21307. if (style.fontSize) {
  21308. element.style.fontSize = style.fontSize;
  21309. }
  21310. if (style.fontFamily) {
  21311. element.style.fontFamily = style.fontFamily;
  21312. }
  21313. if (style.fontWeight) {
  21314. element.style.fontWeight = style.fontWeight;
  21315. }
  21316. element.style.position = 'relative';
  21317. element.style.visibility = 'hidden';
  21318. //fix 在某些情况下,element内的文本变成竖起排列,导致宽度计算不正确的bug
  21319. element.style.display = 'inline-block';
  21320. element.innerHTML = text;
  21321. var textWidth = element.clientWidth;
  21322. var textHeight = element.clientHeight;
  21323. document.body.removeChild(element);
  21324. return {
  21325. textWidth: textWidth,
  21326. textHeight: textHeight
  21327. };
  21328. },
  21329. /**
  21330. * @memberOf CommonUtil
  21331. * @description 获取转换后的path路径。
  21332. * @param {string} path - 待转换的path,包含`{param}`。
  21333. * @param {Object} pathParams - path中待替换的参数。
  21334. * @returns {string} 转换后的path路径。
  21335. */
  21336. convertPath: function convertPath(path, pathParams) {
  21337. if (!pathParams) {
  21338. return path;
  21339. }
  21340. return path.replace(/\{([\w-\.]+)\}/g, function (fullMatch, key) {
  21341. var value;
  21342. if (pathParams.hasOwnProperty(key)) {
  21343. value = paramToString(pathParams[key]);
  21344. } else {
  21345. value = fullMatch;
  21346. }
  21347. return encodeURIComponent(value);
  21348. });
  21349. }
  21350. };
  21351. /**
  21352. * @enum INCHES_PER_UNIT
  21353. * @description 每单位的英尺数。
  21354. * @type {number}
  21355. * @private
  21356. */
  21357. var INCHES_PER_UNIT = {
  21358. inches: 1.0,
  21359. ft: 12.0,
  21360. mi: 63360.0,
  21361. m: 39.3701,
  21362. km: 39370.1,
  21363. dd: 4374754,
  21364. yd: 36
  21365. };
  21366. INCHES_PER_UNIT['in'] = INCHES_PER_UNIT.inches;
  21367. INCHES_PER_UNIT['degrees'] = INCHES_PER_UNIT.dd;
  21368. INCHES_PER_UNIT['nmi'] = 1852 * INCHES_PER_UNIT.m;
  21369. // Units from CS-Map
  21370. var METERS_PER_INCH = 0.0254000508001016002;
  21371. Util_Util.extend(INCHES_PER_UNIT, {
  21372. Inch: INCHES_PER_UNIT.inches,
  21373. Meter: 1.0 / METERS_PER_INCH,
  21374. //EPSG:9001
  21375. Foot: 0.30480060960121920243 / METERS_PER_INCH,
  21376. //EPSG:9003
  21377. IFoot: 0.3048 / METERS_PER_INCH,
  21378. //EPSG:9002
  21379. ClarkeFoot: 0.3047972651151 / METERS_PER_INCH,
  21380. //EPSG:9005
  21381. SearsFoot: 0.30479947153867624624 / METERS_PER_INCH,
  21382. //EPSG:9041
  21383. GoldCoastFoot: 0.30479971018150881758 / METERS_PER_INCH,
  21384. //EPSG:9094
  21385. IInch: 0.0254 / METERS_PER_INCH,
  21386. MicroInch: 0.0000254 / METERS_PER_INCH,
  21387. Mil: 0.0000000254 / METERS_PER_INCH,
  21388. Centimeter: 0.01 / METERS_PER_INCH,
  21389. Kilometer: 1000.0 / METERS_PER_INCH,
  21390. //EPSG:9036
  21391. Yard: 0.91440182880365760731 / METERS_PER_INCH,
  21392. SearsYard: 0.914398414616029 / METERS_PER_INCH,
  21393. //EPSG:9040
  21394. IndianYard: 0.91439853074444079983 / METERS_PER_INCH,
  21395. //EPSG:9084
  21396. IndianYd37: 0.91439523 / METERS_PER_INCH,
  21397. //EPSG:9085
  21398. IndianYd62: 0.9143988 / METERS_PER_INCH,
  21399. //EPSG:9086
  21400. IndianYd75: 0.9143985 / METERS_PER_INCH,
  21401. //EPSG:9087
  21402. IndianFoot: 0.30479951 / METERS_PER_INCH,
  21403. //EPSG:9080
  21404. IndianFt37: 0.30479841 / METERS_PER_INCH,
  21405. //EPSG:9081
  21406. IndianFt62: 0.3047996 / METERS_PER_INCH,
  21407. //EPSG:9082
  21408. IndianFt75: 0.3047995 / METERS_PER_INCH,
  21409. //EPSG:9083
  21410. Mile: 1609.34721869443738887477 / METERS_PER_INCH,
  21411. IYard: 0.9144 / METERS_PER_INCH,
  21412. //EPSG:9096
  21413. IMile: 1609.344 / METERS_PER_INCH,
  21414. //EPSG:9093
  21415. NautM: 1852.0 / METERS_PER_INCH,
  21416. //EPSG:9030
  21417. 'Lat-66': 110943.316488932731 / METERS_PER_INCH,
  21418. 'Lat-83': 110946.25736872234125 / METERS_PER_INCH,
  21419. Decimeter: 0.1 / METERS_PER_INCH,
  21420. Millimeter: 0.001 / METERS_PER_INCH,
  21421. Dekameter: 10.0 / METERS_PER_INCH,
  21422. Decameter: 10.0 / METERS_PER_INCH,
  21423. Hectometer: 100.0 / METERS_PER_INCH,
  21424. GermanMeter: 1.0000135965 / METERS_PER_INCH,
  21425. //EPSG:9031
  21426. CaGrid: 0.999738 / METERS_PER_INCH,
  21427. ClarkeChain: 20.1166194976 / METERS_PER_INCH,
  21428. //EPSG:9038
  21429. GunterChain: 20.11684023368047 / METERS_PER_INCH,
  21430. //EPSG:9033
  21431. BenoitChain: 20.116782494375872 / METERS_PER_INCH,
  21432. //EPSG:9062
  21433. SearsChain: 20.11676512155 / METERS_PER_INCH,
  21434. //EPSG:9042
  21435. ClarkeLink: 0.201166194976 / METERS_PER_INCH,
  21436. //EPSG:9039
  21437. GunterLink: 0.2011684023368047 / METERS_PER_INCH,
  21438. //EPSG:9034
  21439. BenoitLink: 0.20116782494375872 / METERS_PER_INCH,
  21440. //EPSG:9063
  21441. SearsLink: 0.2011676512155 / METERS_PER_INCH,
  21442. //EPSG:9043
  21443. Rod: 5.02921005842012 / METERS_PER_INCH,
  21444. IntnlChain: 20.1168 / METERS_PER_INCH,
  21445. //EPSG:9097
  21446. IntnlLink: 0.201168 / METERS_PER_INCH,
  21447. //EPSG:9098
  21448. Perch: 5.02921005842012 / METERS_PER_INCH,
  21449. Pole: 5.02921005842012 / METERS_PER_INCH,
  21450. Furlong: 201.1684023368046 / METERS_PER_INCH,
  21451. Rood: 3.778266898 / METERS_PER_INCH,
  21452. CapeFoot: 0.3047972615 / METERS_PER_INCH,
  21453. Brealey: 375.0 / METERS_PER_INCH,
  21454. ModAmFt: 0.304812252984505969011938 / METERS_PER_INCH,
  21455. Fathom: 1.8288 / METERS_PER_INCH,
  21456. 'NautM-UK': 1853.184 / METERS_PER_INCH,
  21457. '50kilometers': 50000.0 / METERS_PER_INCH,
  21458. '150kilometers': 150000.0 / METERS_PER_INCH
  21459. });
  21460. //unit abbreviations supported by PROJ.4
  21461. Util_Util.extend(INCHES_PER_UNIT, {
  21462. mm: INCHES_PER_UNIT['Meter'] / 1000.0,
  21463. cm: INCHES_PER_UNIT['Meter'] / 100.0,
  21464. dm: INCHES_PER_UNIT['Meter'] * 100.0,
  21465. km: INCHES_PER_UNIT['Meter'] * 1000.0,
  21466. kmi: INCHES_PER_UNIT['nmi'],
  21467. //International Nautical Mile
  21468. fath: INCHES_PER_UNIT['Fathom'],
  21469. //International Fathom
  21470. ch: INCHES_PER_UNIT['IntnlChain'],
  21471. //International Chain
  21472. link: INCHES_PER_UNIT['IntnlLink'],
  21473. //International Link
  21474. 'us-in': INCHES_PER_UNIT['inches'],
  21475. //U.S. Surveyor's Inch
  21476. 'us-ft': INCHES_PER_UNIT['Foot'],
  21477. //U.S. Surveyor's Foot
  21478. 'us-yd': INCHES_PER_UNIT['Yard'],
  21479. //U.S. Surveyor's Yard
  21480. 'us-ch': INCHES_PER_UNIT['GunterChain'],
  21481. //U.S. Surveyor's Chain
  21482. 'us-mi': INCHES_PER_UNIT['Mile'],
  21483. //U.S. Surveyor's Statute Mile
  21484. 'ind-yd': INCHES_PER_UNIT['IndianYd37'],
  21485. //Indian Yard
  21486. 'ind-ft': INCHES_PER_UNIT['IndianFt37'],
  21487. //Indian Foot
  21488. 'ind-ch': 20.11669506 / METERS_PER_INCH //Indian Chain
  21489. });
  21490. //将服务端的地图单位转成SuperMap的地图单位
  21491. INCHES_PER_UNIT['degree'] = INCHES_PER_UNIT.dd;
  21492. INCHES_PER_UNIT['meter'] = INCHES_PER_UNIT.m;
  21493. INCHES_PER_UNIT['foot'] = INCHES_PER_UNIT.ft;
  21494. INCHES_PER_UNIT['inch'] = INCHES_PER_UNIT.inches;
  21495. INCHES_PER_UNIT['mile'] = INCHES_PER_UNIT.mi;
  21496. INCHES_PER_UNIT['kilometer'] = INCHES_PER_UNIT.km;
  21497. INCHES_PER_UNIT['yard'] = INCHES_PER_UNIT.yd;
  21498. function paramToString(param) {
  21499. if (param == undefined || param == null) {
  21500. return '';
  21501. }
  21502. if (param instanceof Date) {
  21503. return param.toJSON();
  21504. }
  21505. if (canBeJsonified(param)) {
  21506. return JSON.stringify(param);
  21507. }
  21508. return param.toString();
  21509. }
  21510. function canBeJsonified(str) {
  21511. if (typeof str !== 'string' && _typeof(str) !== 'object') {
  21512. return false;
  21513. }
  21514. try {
  21515. var type = str.toString();
  21516. return type === '[object Object]' || type === '[object Array]';
  21517. } catch (err) {
  21518. return false;
  21519. }
  21520. }
  21521. ;// CONCATENATED MODULE: ./src/common/commontypes/LonLat.js
  21522. function LonLat_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21523. function LonLat_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  21524. function LonLat_createClass(Constructor, protoProps, staticProps) { if (protoProps) LonLat_defineProperties(Constructor.prototype, protoProps); if (staticProps) LonLat_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  21525. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  21526. * This program are made available under the terms of the Apache License, Version 2.0
  21527. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21528. /**
  21529. * @class LonLat
  21530. * @category BaseTypes Geometry
  21531. * @classdesc 这个类用来表示经度和纬度对。
  21532. * @param {number|Array.<number>} [lon=0.0] - 地图单位上的 X 轴坐标或者横纵坐标组成的数组;如果地图是地理投影,则此值是经度,否则,此值是地图地理位置的 x 坐标。
  21533. * @param {number} [lat=0.0] - 地图单位上的 Y 轴坐标,如果地图是地理投影,则此值是纬度,否则,此值是地图地理位置的 y 坐标。
  21534. * @example
  21535. * var lonLat = new LonLat(30,45);
  21536. * @usage
  21537. */
  21538. var LonLat = /*#__PURE__*/function () {
  21539. function LonLat(lon, lat) {
  21540. LonLat_classCallCheck(this, LonLat);
  21541. if (Util_Util.isArray(lon)) {
  21542. lat = lon[1];
  21543. lon = lon[0];
  21544. }
  21545. /**
  21546. * @member {number} [LonLat.prototype.lon=0.0]
  21547. * @description 地图的单位的 X 轴(横轴)坐标。
  21548. */
  21549. this.lon = lon ? Util_Util.toFloat(lon) : 0.0;
  21550. /**
  21551. * @member {number} [LonLat.prototype.lat=0.0]
  21552. * @description 地图的单位的 Y 轴(纵轴)坐标。
  21553. */
  21554. this.lat = lat ? Util_Util.toFloat(lat) : 0.0;
  21555. this.CLASS_NAME = "SuperMap.LonLat";
  21556. }
  21557. /**
  21558. * @function LonLat.prototype.toString
  21559. * @description 返回此对象的字符串形式。
  21560. * @example
  21561. * var lonLat = new LonLat(100,50);
  21562. * var str = lonLat.toString();
  21563. * @returns {string} 例如: "lon=100,lat=50"。
  21564. */
  21565. LonLat_createClass(LonLat, [{
  21566. key: "toString",
  21567. value: function toString() {
  21568. return "lon=" + this.lon + ",lat=" + this.lat;
  21569. }
  21570. /**
  21571. * @function LonLat.prototype.toShortString
  21572. * @description 将经度纬度转换成简单字符串。
  21573. * @example
  21574. * var lonLat = new LonLat(100,50);
  21575. * var str = lonLat.toShortString();
  21576. * @returns {string} 处理后的经纬度字符串。例如:"100,50"。
  21577. */
  21578. }, {
  21579. key: "toShortString",
  21580. value: function toShortString() {
  21581. return this.lon + "," + this.lat;
  21582. }
  21583. /**
  21584. * @function LonLat.prototype.clone
  21585. * @description 复制坐标对象,并返回复制后的新对象。
  21586. * @example
  21587. * var lonLat1 = new LonLat(100,50);
  21588. * var lonLat2 = lonLat1.clone();
  21589. * @returns {LonLat} 相同坐标值的新的坐标对象。
  21590. */
  21591. }, {
  21592. key: "clone",
  21593. value: function clone() {
  21594. return new LonLat(this.lon, this.lat);
  21595. }
  21596. /**
  21597. * @function LonLat.prototype.add
  21598. * @description 在已有坐标对象的经纬度基础上加上新的坐标经纬度,并返回新的坐标对象。
  21599. * @example
  21600. * var lonLat1 = new LonLat(100,50);
  21601. * //lonLat2 是新的对象
  21602. * var lonLat2 = lonLat1.add(100,50);
  21603. * @param {number} lon - 经度参数。
  21604. * @param {number} lat - 纬度参数。
  21605. * @returns {LonLat} 新的 LonLat 对象,此对象的经纬度是由传入的经纬度与当前的经纬度相加所得。
  21606. */
  21607. }, {
  21608. key: "add",
  21609. value: function add(lon, lat) {
  21610. if (lon == null || lat == null) {
  21611. throw new TypeError('LonLat.add cannot receive null values');
  21612. }
  21613. return new LonLat(this.lon + Util_Util.toFloat(lon), this.lat + Util_Util.toFloat(lat));
  21614. }
  21615. /**
  21616. * @function LonLat.prototype.equals
  21617. * @description 判断两个坐标对象是否相等。
  21618. * @example
  21619. * var lonLat1 = new LonLat(100,50);
  21620. * var lonLat2 = new LonLat(100,50);
  21621. * var isEquals = lonLat1.equals(lonLat2);
  21622. * @param {LonLat} ll - 需要进行比较的坐标对象。
  21623. * @returns {boolean} 如果LonLat对象的经纬度和传入的经纬度一致则返回true,不一
  21624. * 致或传入的ll参数为NULL则返回false。
  21625. */
  21626. }, {
  21627. key: "equals",
  21628. value: function equals(ll) {
  21629. var equals = false;
  21630. if (ll != null) {
  21631. equals = this.lon === ll.lon && this.lat === ll.lat || isNaN(this.lon) && isNaN(this.lat) && isNaN(ll.lon) && isNaN(ll.lat);
  21632. }
  21633. return equals;
  21634. }
  21635. /**
  21636. * @function LonLat.prototype.wrapDateLine
  21637. * @description 通过传入的范围对象对坐标对象转换到该范围内。
  21638. * 如果经度小于给定范围最小精度,则在原经度基础上加上范围宽度,直到精度在范围内为止,如果经度大于给定范围则在原经度基础上减去范围宽度。
  21639. * 即指将不在经度范围内的坐标转换到范围以内(只会转换 lon,不会转换 lat,主要用于转移到日界线以内)。
  21640. * @example
  21641. * var lonLat1 = new LonLat(420,50);
  21642. * var lonLat2 = lonLat1.wrapDateLine(
  21643. * new Bounds(-180,-90,180,90)
  21644. * );
  21645. * @param {Bounds} maxExtent - 最大边界的范围。
  21646. * @returns {LonLat} 将坐标转换到范围对象以内,并返回新的坐标。
  21647. */
  21648. }, {
  21649. key: "wrapDateLine",
  21650. value: function wrapDateLine(maxExtent) {
  21651. var newLonLat = this.clone();
  21652. if (maxExtent) {
  21653. //shift right?
  21654. while (newLonLat.lon < maxExtent.left) {
  21655. newLonLat.lon += maxExtent.getWidth();
  21656. }
  21657. //shift left?
  21658. while (newLonLat.lon > maxExtent.right) {
  21659. newLonLat.lon -= maxExtent.getWidth();
  21660. }
  21661. }
  21662. return newLonLat;
  21663. }
  21664. /**
  21665. *
  21666. * @function LonLat.prototype.destroy
  21667. * @description 销毁此对象。
  21668. * 销毁后此对象的所有属性为 null,而不是初始值。
  21669. * @example
  21670. * var lonLat = new LonLat(100,50);
  21671. * lonLat.destroy();
  21672. */
  21673. }, {
  21674. key: "destroy",
  21675. value: function destroy() {
  21676. this.lon = null;
  21677. this.lat = null;
  21678. }
  21679. /**
  21680. * @function LonLat.fromString
  21681. * @description 通过字符串生成一个 {@link LonLat} 对象。
  21682. * @example
  21683. * var str = "100,50";
  21684. * var lonLat = LonLat.fromString(str);
  21685. * @param {string} str - 字符串的格式:Lon+","+Lat。如:"100,50"。
  21686. * @returns {LonLat} {@link LonLat} 对象。
  21687. */
  21688. }], [{
  21689. key: "fromString",
  21690. value: function fromString(str) {
  21691. var pair = str.split(",");
  21692. return new LonLat(pair[0], pair[1]);
  21693. }
  21694. /**
  21695. * @function LonLat.fromArray
  21696. * @description 通过数组生成一个 {@link LonLat} 对象。
  21697. * @param {Array.<number>} arr - 数组的格式,长度只能为2,:[Lon,Lat]。如:[5,-42]。
  21698. * @returns {LonLat} {@link LonLat} 对象。
  21699. */
  21700. }, {
  21701. key: "fromArray",
  21702. value: function fromArray(arr) {
  21703. var gotArr = Util_Util.isArray(arr),
  21704. lon = gotArr && arr[0],
  21705. lat = gotArr && arr[1];
  21706. return new LonLat(lon, lat);
  21707. }
  21708. }]);
  21709. return LonLat;
  21710. }();
  21711. ;// CONCATENATED MODULE: ./src/common/commontypes/Bounds.js
  21712. function Bounds_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21713. function Bounds_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  21714. function Bounds_createClass(Constructor, protoProps, staticProps) { if (protoProps) Bounds_defineProperties(Constructor.prototype, protoProps); if (staticProps) Bounds_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  21715. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  21716. * This program are made available under the terms of the Apache License, Version 2.0
  21717. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21718. /**
  21719. * @class Bounds
  21720. * @deprecatedclass SuperMap.Bounds
  21721. * @category BaseTypes Geometry
  21722. * @classdesc 表示边界类实例。使用 bounds 之前需要设置 left,bottom,right,top 四个属性,这些属性的初始值为 null。
  21723. * @param {number|Array.<number>} [left] - 如果是number,则表示左边界,注意考虑宽度,理论上小于 right 值。如果是数组,则表示 [left, bottom, right, top] 左下右上组成的数组。
  21724. * @param {number} [bottom] - 下边界。考虑高度,理论上小于 top 值。
  21725. * @param {number} [right] - 右边界。
  21726. * @param {number} [top] - 上边界。
  21727. * @example
  21728. * var bounds = new Bounds();
  21729. * bounds.extend(new LonLat(4,5));
  21730. * bounds.extend(new LonLat(5,6));
  21731. * bounds.toBBOX(); // returns 4,5,5,6
  21732. * @usage
  21733. */
  21734. var Bounds = /*#__PURE__*/function () {
  21735. function Bounds(left, bottom, right, top) {
  21736. Bounds_classCallCheck(this, Bounds);
  21737. if (Util_Util.isArray(left)) {
  21738. top = left[3];
  21739. right = left[2];
  21740. bottom = left[1];
  21741. left = left[0];
  21742. }
  21743. /**
  21744. * @member {number} Bounds.prototype.left
  21745. * @description 最小的水平坐标系。
  21746. */
  21747. this.left = left != null ? Util_Util.toFloat(left) : this.left;
  21748. /**
  21749. * @member {number} Bounds.prototype.bottom
  21750. * @description 最小的垂直坐标系。
  21751. */
  21752. this.bottom = bottom != null ? Util_Util.toFloat(bottom) : this.bottom;
  21753. /**
  21754. * @member {number} Bounds.prototype.right
  21755. * @description 最大的水平坐标系。
  21756. */
  21757. this.right = right != null ? Util_Util.toFloat(right) : this.right;
  21758. /**
  21759. * @member {number} Bounds.prototype.top
  21760. * @description 最大的垂直坐标系。
  21761. */
  21762. this.top = top != null ? Util_Util.toFloat(top) : this.top;
  21763. /**
  21764. * @member {LonLat} Bounds.prototype.centerLonLat
  21765. * @description bounds 的地图空间的中心点。用 getCenterLonLat() 获得。
  21766. */
  21767. this.centerLonLat = null;
  21768. this.CLASS_NAME = "SuperMap.Bounds";
  21769. }
  21770. /**
  21771. * @function Bounds.prototype.clone
  21772. * @description 复制当前 bounds 对象。
  21773. * @example
  21774. * var bounds1 = new Bounds(-180,-90,180,90);
  21775. * var bounds2 = bounds1.clone();
  21776. * @returns {Bounds} 克隆后的 bounds。
  21777. */
  21778. Bounds_createClass(Bounds, [{
  21779. key: "clone",
  21780. value: function clone() {
  21781. return new Bounds(this.left, this.bottom, this.right, this.top);
  21782. }
  21783. /**
  21784. * @function Bounds.prototype.equals
  21785. * @description 判断两个 bounds 对象是否相等。
  21786. * @example
  21787. * var bounds1 = new Bounds(-180,-90,180,90);
  21788. * var bounds2 = new Bounds(-180,-90,180,90);
  21789. * var isEquals = bounds1.equals(bounds2);
  21790. * @param {Bounds} bounds - 需要进行计较的 bounds。
  21791. * @returns {boolean} 如果 bounds 对象的边和传入的 bounds 一致则返回 true,不一致或传入的 bounds 参数为 NULL 则返回 false。
  21792. */
  21793. }, {
  21794. key: "equals",
  21795. value: function equals(bounds) {
  21796. var equals = false;
  21797. if (bounds != null) {
  21798. equals = this.left === bounds.left && this.right === bounds.right && this.top === bounds.top && this.bottom === bounds.bottom;
  21799. }
  21800. return equals;
  21801. }
  21802. /**
  21803. * @function Bounds.prototype.toString
  21804. * @description 返回此对象的字符串形式。
  21805. * @example
  21806. * var bounds = new Bounds(-180,-90,180,90);
  21807. * var str = bounds.toString();
  21808. * @returns {string} 边界对象的字符串表示形式(left,bottom,right,top),例如: "-180,-90,180,90"。
  21809. */
  21810. }, {
  21811. key: "toString",
  21812. value: function toString() {
  21813. return [this.left, this.bottom, this.right, this.top].join(",");
  21814. }
  21815. /**
  21816. * @function Bounds.prototype.toArray
  21817. * @description 边界对象的数组表示形式。
  21818. * @example
  21819. * var bounds = new Bounds(-180,-90,100,80);
  21820. * //array1 = [-180,-90,100,80];
  21821. * var array1 = bounds.toArray();
  21822. * //array1 = [-90,-180,80,100];
  21823. * var array2 = bounds.toArray(true);
  21824. * @param {boolean} [reverseAxisOrder=false] - 是否反转轴顺序。
  21825. * 如果设为 true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  21826. * @returns {Array.<number>} left, bottom, right, top 数组。
  21827. */
  21828. }, {
  21829. key: "toArray",
  21830. value: function toArray(reverseAxisOrder) {
  21831. if (reverseAxisOrder === true) {
  21832. return [this.bottom, this.left, this.top, this.right];
  21833. } else {
  21834. return [this.left, this.bottom, this.right, this.top];
  21835. }
  21836. }
  21837. /**
  21838. * @function Bounds.prototype.toBBOX
  21839. * @description 取小数点后 decimal 位数字进行四舍五入再转换为 BBOX 字符串。
  21840. * @example
  21841. * var bounds = new Bounds(-1.1234567,-1.7654321,1.4444444,1.5555555);
  21842. * //str1 = "-1.123457,-1.765432,1.444444,1.555556";
  21843. * var str1 = bounds.toBBOX();
  21844. * //str2 = "-1.1,-1.8,1.4,1.6";
  21845. * var str2 = bounds.toBBOX(1);
  21846. * //str2 = "-1.8,-1.1,1.6,1.4";
  21847. * var str2 = bounds.toBBOX(1,true);
  21848. * @param {number} [decimal=6] - 边界方位坐标的有效数字个数。
  21849. * @param {boolean} [reverseAxisOrder=false] - 是否是反转轴顺序。
  21850. * 如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  21851. * @returns {string} 边界对象的字符串表示形式,如:"5,42,10,45"。
  21852. */
  21853. }, {
  21854. key: "toBBOX",
  21855. value: function toBBOX(decimal, reverseAxisOrder) {
  21856. if (decimal == null) {
  21857. decimal = 6;
  21858. }
  21859. var mult = Math.pow(10, decimal);
  21860. var xmin = Math.round(this.left * mult) / mult;
  21861. var ymin = Math.round(this.bottom * mult) / mult;
  21862. var xmax = Math.round(this.right * mult) / mult;
  21863. var ymax = Math.round(this.top * mult) / mult;
  21864. if (reverseAxisOrder === true) {
  21865. return ymin + "," + xmin + "," + ymax + "," + xmax;
  21866. } else {
  21867. return xmin + "," + ymin + "," + xmax + "," + ymax;
  21868. }
  21869. }
  21870. ///**
  21871. // * @function Bounds.prototype.toGeometry
  21872. // * @description 基于当前边界范围创建一个新的多边形对象。
  21873. // * @example
  21874. // * var bounds = new Bounds(-180,-90,100,80);
  21875. // * // Polygon对象
  21876. // * var geo = bounds.toGeometry();
  21877. // * @returns {GeometryPolygon} 基于当前 bounds 坐标创建的新的多边形。
  21878. // */
  21879. // toGeometry() {
  21880. // return new Polygon([
  21881. // new LinearRing([
  21882. // new Point(this.left, this.bottom),
  21883. // new Point(this.right, this.bottom),
  21884. // new Point(this.right, this.top),
  21885. // new Point(this.left, this.top)
  21886. // ])
  21887. // ]);
  21888. // }
  21889. /**
  21890. * @function Bounds.prototype.getWidth
  21891. * @description 获取 bounds 的宽度。
  21892. * @example
  21893. * var bounds = new Bounds(-180,-90,100,80);
  21894. * //width = 280;
  21895. * var width = bounds.getWidth();
  21896. * @returns {number} 获取当前 bounds 的宽度(right 减去 left)。
  21897. */
  21898. }, {
  21899. key: "getWidth",
  21900. value: function getWidth() {
  21901. return this.right - this.left;
  21902. }
  21903. /**
  21904. * @function Bounds.prototype.getHeight
  21905. * @description 获取 bounds 的高度。
  21906. * @example
  21907. * var bounds = new Bounds(-180,-90,100,80);
  21908. * //height = 170;
  21909. * var height = bounds.getHeight();
  21910. * @returns {number} 边界高度(top 减去 bottom)。
  21911. */
  21912. }, {
  21913. key: "getHeight",
  21914. value: function getHeight() {
  21915. return this.top - this.bottom;
  21916. }
  21917. /**
  21918. * @function Bounds.prototype.getSize
  21919. * @description 获取边框大小。
  21920. * @example
  21921. * var bounds = new Bounds(-180,-90,100,80);
  21922. * var size = bounds.getSize();
  21923. * @returns {Size} 边框大小。
  21924. */
  21925. }, {
  21926. key: "getSize",
  21927. value: function getSize() {
  21928. return new Size(this.getWidth(), this.getHeight());
  21929. }
  21930. /**
  21931. * @function Bounds.prototype.getCenterPixel
  21932. * @description 获取像素格式的范围中心点。
  21933. * @example
  21934. * var bounds = new Bounds(-180,-90,100,80);
  21935. * var pixel = bounds.getCenterPixel();
  21936. * @returns {Pixel} 像素格式的当前范围的中心点。
  21937. */
  21938. }, {
  21939. key: "getCenterPixel",
  21940. value: function getCenterPixel() {
  21941. return new Pixel((this.left + this.right) / 2, (this.bottom + this.top) / 2);
  21942. }
  21943. /**
  21944. * @function Bounds.prototype.getCenterLonLat
  21945. * @description 获取地理格式的范围中心点。
  21946. * @example
  21947. * var bounds = new Bounds(-180,-90,100,80);
  21948. * var lonlat = bounds.getCenterLonLat();
  21949. * @returns {LonLat} 当前地理范围的中心点。
  21950. */
  21951. }, {
  21952. key: "getCenterLonLat",
  21953. value: function getCenterLonLat() {
  21954. if (!this.centerLonLat) {
  21955. this.centerLonLat = new LonLat((this.left + this.right) / 2, (this.bottom + this.top) / 2);
  21956. }
  21957. return this.centerLonLat;
  21958. }
  21959. /**
  21960. * @function Bounds.prototype.scale
  21961. * @description 按照比例扩大/缩小出一个新的 bounds。
  21962. * @example
  21963. * var bounds = new Bounds(-50,-50,40,40);
  21964. * var bounds2 = bounds.scale(2);
  21965. * @param {number} [ratio=1] - 需要扩大的比例。
  21966. * @param {(Pixel|LonLat)} [origin] - 扩大时的基准点,默认为当前 bounds 的中心点。
  21967. * @returns {Bounds} 通过 ratio、origin 计算得到的新的边界范围。
  21968. */
  21969. }, {
  21970. key: "scale",
  21971. value: function scale(ratio, origin) {
  21972. ratio = ratio ? ratio : 1;
  21973. if (origin == null) {
  21974. origin = this.getCenterLonLat();
  21975. }
  21976. var origx, origy;
  21977. // get origin coordinates
  21978. if (origin.CLASS_NAME === "SuperMap.LonLat") {
  21979. origx = origin.lon;
  21980. origy = origin.lat;
  21981. } else {
  21982. origx = origin.x;
  21983. origy = origin.y;
  21984. }
  21985. var left = (this.left - origx) * ratio + origx;
  21986. var bottom = (this.bottom - origy) * ratio + origy;
  21987. var right = (this.right - origx) * ratio + origx;
  21988. var top = (this.top - origy) * ratio + origy;
  21989. return new Bounds(left, bottom, right, top);
  21990. }
  21991. /**
  21992. * @function Bounds.prototype.add
  21993. * @description 在当前的 Bounds 上按照传入的坐标点进行平移,返回新的范围。
  21994. * @example
  21995. * var bounds1 = new Bounds(-50,-50,40,40);
  21996. * //bounds2 是新的 bounds
  21997. * var bounds2 = bounds.add(20,10);
  21998. * @param {number} x - 坐标点的 x 坐标。
  21999. * @param {number} y - 坐标点的 y 坐标。
  22000. * @returns {Bounds} 新的 bounds,此 bounds 的坐标是由传入的 x,y 参数与当前 bounds 坐标计算所得。
  22001. */
  22002. }, {
  22003. key: "add",
  22004. value: function add(x, y) {
  22005. if (x == null || y == null) {
  22006. throw new TypeError('Bounds.add cannot receive null values');
  22007. }
  22008. return new Bounds(this.left + x, this.bottom + y, this.right + x, this.top + y);
  22009. }
  22010. /**
  22011. * @function Bounds.prototype.extend
  22012. * @description 在当前 bounds 上扩展 bounds,支持 point,lonlat 和 bounds。扩展后的 bounds 的范围是两者的结合。
  22013. * @example
  22014. * var bounds1 = new Bounds(-50,-50,40,40);
  22015. * //bounds 改变
  22016. * bounds.extend(new LonLat(50,60));
  22017. * @param {GeometryPoint|LonLat|Bounds} object - 可以是 point、lonlat 和 bounds。
  22018. */
  22019. }, {
  22020. key: "extend",
  22021. value: function extend(object) {
  22022. var bounds = null;
  22023. if (object) {
  22024. // clear cached center location
  22025. switch (object.CLASS_NAME) {
  22026. case "SuperMap.LonLat":
  22027. bounds = new Bounds(object.lon, object.lat, object.lon, object.lat);
  22028. break;
  22029. case "SuperMap.Geometry.Point":
  22030. bounds = new Bounds(object.x, object.y, object.x, object.y);
  22031. break;
  22032. case "SuperMap.Bounds":
  22033. bounds = object;
  22034. break;
  22035. }
  22036. if (bounds) {
  22037. this.centerLonLat = null;
  22038. if (this.left == null || bounds.left < this.left) {
  22039. this.left = bounds.left;
  22040. }
  22041. if (this.bottom == null || bounds.bottom < this.bottom) {
  22042. this.bottom = bounds.bottom;
  22043. }
  22044. if (this.right == null || bounds.right > this.right) {
  22045. this.right = bounds.right;
  22046. }
  22047. if (this.top == null || bounds.top > this.top) {
  22048. this.top = bounds.top;
  22049. }
  22050. }
  22051. }
  22052. }
  22053. /**
  22054. * @function Bounds.prototype.containsLonLat
  22055. * @description 判断传入的坐标是否在范围内。
  22056. * @example
  22057. * var bounds1 = new Bounds(-50,-50,40,40);
  22058. * //isContains1 = true
  22059. * //这里的第二个参数可以直接为 boolean 类型,也就是inclusive
  22060. * var isContains1 = bounds.containsLonLat(new LonLat(40,40),true);
  22061. *
  22062. * //(40,40)在范围内,同样(40+360,40)也在范围内
  22063. * var bounds2 = new Bounds(-50,-50,40,40);
  22064. * //isContains2 = true;
  22065. * var isContains2 = bounds2.containsLonLat(
  22066. * new LonLat(400,40),
  22067. * {
  22068. * inclusive:true,
  22069. * //全球的范围
  22070. * worldBounds: new Bounds(-180,-90,180,90)
  22071. * }
  22072. * );
  22073. * @param {(LonLat|Object)} ll - <LonLat> 对象或者是一个包含 'lon' 与 'lat' 属性的对象。
  22074. * @param {Object} options - 可选参数。
  22075. * @param {boolean} [options.inclusive=true] - 是否包含边界。
  22076. * @param {Bounds} [options.worldBounds] - 如果提供 worldBounds 参数, 如果 ll 参数提供的坐标超出了世界边界(worldBounds),
  22077. * 但是通过日界线的转化可以被包含, 它将被认为是包含在该范围内的。
  22078. * @returns {boolean} 传入坐标是否包含在范围内。
  22079. */
  22080. }, {
  22081. key: "containsLonLat",
  22082. value: function containsLonLat(ll, options) {
  22083. if (typeof options === "boolean") {
  22084. options = {
  22085. inclusive: options
  22086. };
  22087. }
  22088. options = options || {};
  22089. var contains = this.contains(ll.lon, ll.lat, options.inclusive),
  22090. worldBounds = options.worldBounds;
  22091. //日界线以外的也有可能算包含,
  22092. if (worldBounds && !contains) {
  22093. var worldWidth = worldBounds.getWidth();
  22094. var worldCenterX = (worldBounds.left + worldBounds.right) / 2;
  22095. //这一步很关键
  22096. var worldsAway = Math.round((ll.lon - worldCenterX) / worldWidth);
  22097. contains = this.containsLonLat({
  22098. lon: ll.lon - worldsAway * worldWidth,
  22099. lat: ll.lat
  22100. }, {
  22101. inclusive: options.inclusive
  22102. });
  22103. }
  22104. return contains;
  22105. }
  22106. /**
  22107. * @function Bounds.prototype.containsPixel
  22108. * @description 判断传入的像素是否在范围内。直接匹配大小,不涉及像素和地理转换。
  22109. * @example
  22110. * var bounds = new Bounds(-50,-50,40,40);
  22111. * //isContains = true
  22112. * var isContains = bounds.containsPixel(new Pixel(40,40),true);
  22113. * @param {Pixel} px - 提供的像素参数。
  22114. * @param {boolean} [inclusive=true] - 是否包含边界。
  22115. * @returns {boolean} 传入的 pixel 在当前边界范围之内。
  22116. */
  22117. }, {
  22118. key: "containsPixel",
  22119. value: function containsPixel(px, inclusive) {
  22120. return this.contains(px.x, px.y, inclusive);
  22121. }
  22122. /**
  22123. * @function Bounds.prototype.contains
  22124. * @description 判断传入的 x,y 坐标值是否在范围内。
  22125. * @example
  22126. * var bounds = new Bounds(-50,-50,40,40);
  22127. * //isContains = true
  22128. * var isContains = bounds.contains(40,40,true);
  22129. * @param {number} x - x 坐标值。
  22130. * @param {number} y - y 坐标值。
  22131. * @param {boolean} [inclusive=true] - 是否包含边界。
  22132. * @returns {boolean} 传入的 x,y 坐标是否在当前范围内。
  22133. */
  22134. }, {
  22135. key: "contains",
  22136. value: function contains(x, y, inclusive) {
  22137. //set default
  22138. if (inclusive == null) {
  22139. inclusive = true;
  22140. }
  22141. if (x == null || y == null) {
  22142. return false;
  22143. }
  22144. //x = Util.toFloat(x);
  22145. //y = Util.toFloat(y);
  22146. var contains = false;
  22147. if (inclusive) {
  22148. contains = x >= this.left && x <= this.right && y >= this.bottom && y <= this.top;
  22149. } else {
  22150. contains = x > this.left && x < this.right && y > this.bottom && y < this.top;
  22151. }
  22152. return contains;
  22153. }
  22154. /**
  22155. * @function Bounds.prototype.intersectsBounds
  22156. * @description 判断目标边界范围是否与当前边界范围相交。如果两个边界范围中的任意边缘相交或者一个边界包含了另外一个就认为这两个边界相交。
  22157. * @example
  22158. * var bounds = new Bounds(-180,-90,100,80);
  22159. * var isIntersects = bounds.intersectsBounds(
  22160. * new Bounds(-170,-90,120,80)
  22161. * );
  22162. * @param {Bounds} bounds - 目标边界。
  22163. * @param {Object} options - 参数。
  22164. * @param {boolean} [options.inclusive=true] - 边缘重合也看成相交。如果是false,两个边界范围没有重叠部分仅仅是在边缘相接(重合),这种情况被认为没有相交。
  22165. * @param {Bounds} [options.worldBounds] - 提供了 worldBounds 参数,如果他们相交时是在全球范围内,两个边界将被视为相交。这仅适用于交叉或完全不在世界范围的边界。
  22166. * @returns {boolean} 传入的 bounds 对象与当前 bounds 相交。
  22167. */
  22168. }, {
  22169. key: "intersectsBounds",
  22170. value: function intersectsBounds(bounds, options) {
  22171. if (typeof options === "boolean") {
  22172. options = {
  22173. inclusive: options
  22174. };
  22175. }
  22176. options = options || {};
  22177. if (options.worldBounds) {
  22178. var self = this.wrapDateLine(options.worldBounds);
  22179. bounds = bounds.wrapDateLine(options.worldBounds);
  22180. } else {
  22181. self = this;
  22182. }
  22183. if (options.inclusive == null) {
  22184. options.inclusive = true;
  22185. }
  22186. var intersects = false;
  22187. var mightTouch = self.left === bounds.right || self.right === bounds.left || self.top === bounds.bottom || self.bottom === bounds.top;
  22188. // if the two bounds only touch at an edge, and inclusive is false,
  22189. // then the bounds don't *really* intersect.
  22190. if (options.inclusive || !mightTouch) {
  22191. // otherwise, if one of the boundaries even partially contains another,
  22192. // inclusive of the edges, then they do intersect.
  22193. var inBottom = bounds.bottom >= self.bottom && bounds.bottom <= self.top || self.bottom >= bounds.bottom && self.bottom <= bounds.top;
  22194. var inTop = bounds.top >= self.bottom && bounds.top <= self.top || self.top > bounds.bottom && self.top < bounds.top;
  22195. var inLeft = bounds.left >= self.left && bounds.left <= self.right || self.left >= bounds.left && self.left <= bounds.right;
  22196. var inRight = bounds.right >= self.left && bounds.right <= self.right || self.right >= bounds.left && self.right <= bounds.right;
  22197. intersects = (inBottom || inTop) && (inLeft || inRight);
  22198. }
  22199. // document me
  22200. if (options.worldBounds && !intersects) {
  22201. var world = options.worldBounds;
  22202. var width = world.getWidth();
  22203. var selfCrosses = !world.containsBounds(self);
  22204. var boundsCrosses = !world.containsBounds(bounds);
  22205. if (selfCrosses && !boundsCrosses) {
  22206. bounds = bounds.add(-width, 0);
  22207. intersects = self.intersectsBounds(bounds, {
  22208. inclusive: options.inclusive
  22209. });
  22210. } else if (boundsCrosses && !selfCrosses) {
  22211. self = self.add(-width, 0);
  22212. intersects = bounds.intersectsBounds(self, {
  22213. inclusive: options.inclusive
  22214. });
  22215. }
  22216. }
  22217. return intersects;
  22218. }
  22219. /**
  22220. * @function Bounds.prototype.containsBounds
  22221. * @description 判断目标边界是否被当前边界包含在内。
  22222. * @example
  22223. * var bounds = new Bounds(-180,-90,100,80);
  22224. * var isContains = bounds.containsBounds(
  22225. * new Bounds(-170,-90,100,80),true,true
  22226. * );
  22227. * @param {Bounds} bounds - 目标边界。
  22228. * @param {boolean} [partial=false] - 目标边界的任意部分都包含在当前边界中则被认为是包含关系。
  22229. * 如果设为 false,整个目标边界全部被包含在当前边界范围内。
  22230. * @param {boolean} [inclusive=true] - 边缘共享是否被视为包含。
  22231. * @returns {boolean} 传入的边界是否被当前边界包含。
  22232. */
  22233. }, {
  22234. key: "containsBounds",
  22235. value: function containsBounds(bounds, partial, inclusive) {
  22236. if (partial == null) {
  22237. partial = false;
  22238. }
  22239. if (inclusive == null) {
  22240. inclusive = true;
  22241. }
  22242. var bottomLeft = this.contains(bounds.left, bounds.bottom, inclusive);
  22243. var bottomRight = this.contains(bounds.right, bounds.bottom, inclusive);
  22244. var topLeft = this.contains(bounds.left, bounds.top, inclusive);
  22245. var topRight = this.contains(bounds.right, bounds.top, inclusive);
  22246. return partial ? bottomLeft || bottomRight || topLeft || topRight : bottomLeft && bottomRight && topLeft && topRight;
  22247. }
  22248. /**
  22249. * @function Bounds.prototype.determineQuadrant
  22250. * @description 判断传入坐标是否在 bounds 范围内的象限。以 bounds 中心点为坐标原点。
  22251. * @example
  22252. * var bounds = new Bounds(-180,-90,100,80);
  22253. * //str = "tr";
  22254. * var str = bounds.determineQuadrant(
  22255. * new LonLat(20,20)
  22256. * );
  22257. * @param {LonLat} lonlat - 传入的坐标对象。
  22258. * @returns {string} 传入坐标所在的象限("br" "tr" "tl" "bl" 分别对应"右下","右上","左上" "左下")。
  22259. */
  22260. }, {
  22261. key: "determineQuadrant",
  22262. value: function determineQuadrant(lonlat) {
  22263. var quadrant = "";
  22264. var center = this.getCenterLonLat();
  22265. quadrant += lonlat.lat < center.lat ? "b" : "t";
  22266. quadrant += lonlat.lon < center.lon ? "l" : "r";
  22267. return quadrant;
  22268. }
  22269. /**
  22270. * @function Bounds.prototype.wrapDateLine
  22271. * @description 将当前 bounds 移动到最大边界范围内部(所谓的内部是相交或者内部)。
  22272. * @example
  22273. * var bounds = new Bounds(380,-40,400,-20);
  22274. * var maxExtent = new Bounds(-180,-90,100,80);
  22275. * //新的bounds
  22276. * var newBounds = bounds.wrapDateLine(maxExtent);
  22277. * @param {Bounds} maxExtent - 最大的边界范围(一般是全球范围)。
  22278. * @param {Object} options - 可选选项参数。
  22279. * @param {number} [options.leftTolerance=0] - left 允许的误差。
  22280. * @param {number} [options.rightTolerance=0] - right 允许的误差。
  22281. * @returns {Bounds} 克隆当前边界。如果当前边界完全在最大范围之外此函数则返回一个不同值的边界,
  22282. * 若落在最大边界的左边,则给当前的bounds值加上最大范围的宽度,即向右移动,
  22283. * 若落在右边,则向左移动,即给当前的bounds值加上负的最大范围的宽度。
  22284. */
  22285. }, {
  22286. key: "wrapDateLine",
  22287. value: function wrapDateLine(maxExtent, options) {
  22288. options = options || {};
  22289. var leftTolerance = options.leftTolerance || 0;
  22290. var rightTolerance = options.rightTolerance || 0;
  22291. var newBounds = this.clone();
  22292. if (maxExtent) {
  22293. var width = maxExtent.getWidth();
  22294. //如果 newBounds 在 maxExtent 的左边,那么一直向右移动,直到相交或者包含为止,每次移动width
  22295. //shift right?
  22296. while (newBounds.left < maxExtent.left && newBounds.right - rightTolerance <= maxExtent.left) {
  22297. newBounds = newBounds.add(width, 0);
  22298. }
  22299. //如果 newBounds 在 maxExtent 的右边,那么一直向左移动,直到相交或者包含为止,每次移动width
  22300. //shift left?
  22301. while (newBounds.left + leftTolerance >= maxExtent.right && newBounds.right > maxExtent.right) {
  22302. newBounds = newBounds.add(-width, 0);
  22303. }
  22304. //如果和右边相交,左边又在内部,那么再次向左边移动一次
  22305. // crosses right only? force left
  22306. var newLeft = newBounds.left + leftTolerance;
  22307. if (newLeft < maxExtent.right && newLeft > maxExtent.left && newBounds.right - rightTolerance > maxExtent.right) {
  22308. newBounds = newBounds.add(-width, 0);
  22309. }
  22310. }
  22311. return newBounds;
  22312. }
  22313. /**
  22314. * @function Bounds.prototype.toServerJSONObject
  22315. * @description 转换成对应的 JSON 格式对象。
  22316. * @example
  22317. * var bounds = new Bounds(-180,-90,100,80);
  22318. * var obj = bounds.toServerJSONObject();
  22319. * @returns {Object} JSON 格式的 Object 对象。
  22320. */
  22321. }, {
  22322. key: "toServerJSONObject",
  22323. value: function toServerJSONObject() {
  22324. var jsonObject = {
  22325. rightTop: {
  22326. x: this.right,
  22327. y: this.top
  22328. },
  22329. leftBottom: {
  22330. x: this.left,
  22331. y: this.bottom
  22332. },
  22333. left: this.left,
  22334. right: this.right,
  22335. top: this.top,
  22336. bottom: this.bottom
  22337. };
  22338. return jsonObject;
  22339. }
  22340. /**
  22341. *
  22342. * @function Bounds.prototype.destroy
  22343. * @description 销毁此对象。
  22344. * 销毁后此对象的所有属性为 null,而不是初始值。
  22345. * @example
  22346. * var bounds = new Bounds(-180,-90,100,80);
  22347. * bounds.destroy();
  22348. */
  22349. }, {
  22350. key: "destroy",
  22351. value: function destroy() {
  22352. this.left = null;
  22353. this.right = null;
  22354. this.top = null;
  22355. this.bottom = null;
  22356. this.centerLonLat = null;
  22357. }
  22358. /**
  22359. * @function Bounds.fromString
  22360. * @description 通过字符串参数创建新的 bounds 的构造函数。
  22361. * @example
  22362. * var bounds = Bounds.fromString("-180,-90,100,80");
  22363. * @param {string} str - 边界字符串,用逗号隔开(e.g. <i>"5,42,10,45"</i>)。
  22364. * @param {boolean} [reverseAxisOrder=false] - 是否反转轴顺序。
  22365. * 如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  22366. * @returns {Bounds} 给定的字符串创建的新的边界对象。
  22367. */
  22368. }], [{
  22369. key: "fromString",
  22370. value: function fromString(str, reverseAxisOrder) {
  22371. var bounds = str.split(",");
  22372. return Bounds.fromArray(bounds, reverseAxisOrder);
  22373. }
  22374. /**
  22375. * @function Bounds.fromArray
  22376. * @description 通过边界框数组创建 Bounds。
  22377. * @example
  22378. * var bounds = Bounds.fromArray([-180,-90,100,80]);
  22379. * @param {Array.<number>} bbox - 边界值数组。(e.g. <i>[5,42,10,45]</i>)。
  22380. * @param {boolean} [reverseAxisOrder=false] - 是否是反转轴顺序。如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  22381. * @returns {Bounds} 根据传入的数组创建的新的边界对象。
  22382. */
  22383. }, {
  22384. key: "fromArray",
  22385. value: function fromArray(bbox, reverseAxisOrder) {
  22386. return reverseAxisOrder === true ? new Bounds(bbox[1], bbox[0], bbox[3], bbox[2]) : new Bounds(bbox[0], bbox[1], bbox[2], bbox[3]);
  22387. }
  22388. /**
  22389. * @function Bounds.fromSize
  22390. * @description 通过传入的边界大小来创建新的边界。
  22391. * @example
  22392. * var bounds = Bounds.fromSize(new Size(20,10));
  22393. * @param {Size} size - 边界大小。
  22394. * @returns {Bounds} 根据传入的边界大小的创建新的边界。
  22395. */
  22396. }, {
  22397. key: "fromSize",
  22398. value: function fromSize(size) {
  22399. return new Bounds(0, size.h, size.w, 0);
  22400. }
  22401. /**
  22402. * @function Bounds.oppositeQuadrant
  22403. * @description 反转象限。"t"和"b" 交换,"r"和"l"交换, 如:"tl"变为"br"。
  22404. * @param {string} quadrant - 代表象限的字符串,如:"tl"。
  22405. * @returns {string} 反转后的象限。
  22406. */
  22407. }, {
  22408. key: "oppositeQuadrant",
  22409. value: function oppositeQuadrant(quadrant) {
  22410. var opp = "";
  22411. opp += quadrant.charAt(0) === 't' ? 'b' : 't';
  22412. opp += quadrant.charAt(1) === 'l' ? 'r' : 'l';
  22413. return opp;
  22414. }
  22415. }]);
  22416. return Bounds;
  22417. }();
  22418. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Collection.js
  22419. function Collection_typeof(obj) { "@babel/helpers - typeof"; return Collection_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Collection_typeof(obj); }
  22420. function Collection_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22421. function Collection_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  22422. function Collection_createClass(Constructor, protoProps, staticProps) { if (protoProps) Collection_defineProperties(Constructor.prototype, protoProps); if (staticProps) Collection_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  22423. function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
  22424. function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
  22425. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
  22426. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  22427. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  22428. function _possibleConstructorReturn(self, call) { if (call && (Collection_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
  22429. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22430. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  22431. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  22432. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  22433. * This program are made available under the terms of the Apache License, Version 2.0
  22434. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22435. /**
  22436. * @class GeometryCollection
  22437. * @aliasclass Geometry.Collection
  22438. * @deprecatedclass SuperMap.Geometry.Collection
  22439. * @classdesc 几何对象集合类,存储在本地的 components 属性中(可作为参数传递给构造函数)。<br>
  22440. * 随着新的几何图形添加到集合中,将不能被克隆,当移动几何图形时,需要指定参照物。<br>
  22441. * getArea 和 getLength 函数只能通过遍历存储几何对象的 components 数组,总计所有几何图形的面积和长度。
  22442. * @category BaseTypes Geometry
  22443. * @extends {Geometry}
  22444. * @param {Array.<Geometry>} components - 几何对象数组。
  22445. * @example
  22446. * var point1 = new GeometryPoint(10,20);
  22447. * var point2 = new GeometryPoint(30,40);
  22448. * var col = new GeometryCollection([point1,point2]);
  22449. * @usage
  22450. */
  22451. var Collection = /*#__PURE__*/function (_Geometry) {
  22452. _inherits(Collection, _Geometry);
  22453. var _super = _createSuper(Collection);
  22454. function Collection(components) {
  22455. var _this;
  22456. Collection_classCallCheck(this, Collection);
  22457. _this = _super.call(this);
  22458. /**
  22459. * @description 存储几何对象的数组。
  22460. * @member {Array.<Geometry>} GeometryCollection.prototype.components
  22461. */
  22462. _this.components = [];
  22463. /**
  22464. * @member {Array.<string>} GeometryCollection.prototype.componentTypes
  22465. * @description components 存储的几何对象所支持的几何类型数组,为空表示类型不受限制。
  22466. */
  22467. _this.componentTypes = null;
  22468. if (components != null) {
  22469. _this.addComponents(components);
  22470. }
  22471. _this.CLASS_NAME = "SuperMap.Geometry.Collection";
  22472. _this.geometryType = "Collection";
  22473. return _this;
  22474. }
  22475. /**
  22476. * @function GeometryCollection.prototype.destroy
  22477. * @description 销毁几何图形。
  22478. */
  22479. Collection_createClass(Collection, [{
  22480. key: "destroy",
  22481. value: function destroy() {
  22482. this.components.length = 0;
  22483. this.components = null;
  22484. _get(_getPrototypeOf(Collection.prototype), "destroy", this).call(this);
  22485. }
  22486. /**
  22487. * @function GeometryCollection.prototype.clone
  22488. * @description 克隆当前几何对象。
  22489. * @returns {GeometryCollection} 克隆的几何对象集合。
  22490. */
  22491. }, {
  22492. key: "clone",
  22493. value: function clone() {
  22494. var geometry = new Collection();
  22495. for (var i = 0, len = this.components.length; i < len; i++) {
  22496. geometry.addComponent(this.components[i].clone());
  22497. }
  22498. // catch any randomly tagged-on properties
  22499. Util_Util.applyDefaults(geometry, this);
  22500. return geometry;
  22501. }
  22502. /**
  22503. * @function GeometryCollection.prototype.getComponentsString
  22504. * @description 获取 components 字符串。
  22505. * @returns {string} components 字符串。
  22506. */
  22507. }, {
  22508. key: "getComponentsString",
  22509. value: function getComponentsString() {
  22510. var strings = [];
  22511. for (var i = 0, len = this.components.length; i < len; i++) {
  22512. strings.push(this.components[i].toShortString());
  22513. }
  22514. return strings.join(",");
  22515. }
  22516. /**
  22517. * @function GeometryCollection.prototype.calculateBounds
  22518. * @description 通过遍历数组重新计算边界,在遍历每一子项中时调用 extend 方法。
  22519. */
  22520. }, {
  22521. key: "calculateBounds",
  22522. value: function calculateBounds() {
  22523. this.bounds = null;
  22524. var bounds = new Bounds();
  22525. var components = this.components;
  22526. if (components) {
  22527. for (var i = 0, len = components.length; i < len; i++) {
  22528. bounds.extend(components[i].getBounds());
  22529. }
  22530. }
  22531. // to preserve old behavior, we only set bounds if non-null
  22532. // in the future, we could add bounds.isEmpty()
  22533. if (bounds.left != null && bounds.bottom != null && bounds.right != null && bounds.top != null) {
  22534. this.setBounds(bounds);
  22535. }
  22536. }
  22537. /**
  22538. * @function GeometryCollection.prototype.addComponents
  22539. * @description 给几何图形对象添加元素。
  22540. * @param {Array.<Geometry>} components - 几何对象组件。
  22541. * @example
  22542. * var geometryCollection = new GeometryCollection();
  22543. * geometryCollection.addComponents(new SuerpMap.Geometry.Point(10,10));
  22544. */
  22545. }, {
  22546. key: "addComponents",
  22547. value: function addComponents(components) {
  22548. if (!Util_Util.isArray(components)) {
  22549. components = [components];
  22550. }
  22551. for (var i = 0, len = components.length; i < len; i++) {
  22552. this.addComponent(components[i]);
  22553. }
  22554. }
  22555. /**
  22556. * @function GeometryCollection.prototype.addComponent
  22557. * @description 添加几何对象到集合中。如果设置了 componentTypes 类型,则添加的几何对象必须是 componentTypes 中的类型。
  22558. * @param {Geometry} component - 待添加的几何对象。
  22559. * @param {number} [index] - 几何对象插入的位置。
  22560. * @returns {boolean} 是否添加成功。
  22561. */
  22562. }, {
  22563. key: "addComponent",
  22564. value: function addComponent(component, index) {
  22565. var added = false;
  22566. if (component) {
  22567. if (this.componentTypes == null || Util_Util.indexOf(this.componentTypes, component.CLASS_NAME) > -1) {
  22568. if (index != null && index < this.components.length) {
  22569. var components1 = this.components.slice(0, index);
  22570. var components2 = this.components.slice(index, this.components.length);
  22571. components1.push(component);
  22572. this.components = components1.concat(components2);
  22573. } else {
  22574. this.components.push(component);
  22575. }
  22576. component.parent = this;
  22577. this.clearBounds();
  22578. added = true;
  22579. }
  22580. }
  22581. return added;
  22582. }
  22583. /**
  22584. * @function GeometryCollection.prototype.removeComponents
  22585. * @description 清除几何对象。
  22586. * @param {Array.<Geometry>} components - 需要清除的几何对象。
  22587. * @returns {boolean} 元素是否被删除。
  22588. */
  22589. }, {
  22590. key: "removeComponents",
  22591. value: function removeComponents(components) {
  22592. var removed = false;
  22593. if (!Util_Util.isArray(components)) {
  22594. components = [components];
  22595. }
  22596. for (var i = components.length - 1; i >= 0; --i) {
  22597. removed = this.removeComponent(components[i]) || removed;
  22598. }
  22599. return removed;
  22600. }
  22601. /**
  22602. * @function GeometryCollection.prototype.removeComponent
  22603. * @description 从集合中移除几何对象。
  22604. * @param {Geometry} component - 要移除的几何对象。
  22605. * @returns {boolean} 几何对象是否移除成功。
  22606. */
  22607. }, {
  22608. key: "removeComponent",
  22609. value: function removeComponent(component) {
  22610. Util_Util.removeItem(this.components, component);
  22611. // clearBounds() so that it gets recalculated on the next call
  22612. // to this.getBounds();
  22613. this.clearBounds();
  22614. return true;
  22615. }
  22616. /**
  22617. * @function GeometryCollection.prototype.getArea
  22618. * @description 计算几何对象的面积。注意,这个方法在 {@link GeometryPolygon} 类中需要重写。
  22619. * @returns {number} 几何图形的面积,是几何对象中所有组成部分的面积之和。
  22620. */
  22621. }, {
  22622. key: "getArea",
  22623. value: function getArea() {
  22624. var area = 0.0;
  22625. for (var i = 0, len = this.components.length; i < len; i++) {
  22626. area += this.components[i].getArea();
  22627. }
  22628. return area;
  22629. }
  22630. /**
  22631. * @function GeometryCollection.prototype.equals
  22632. * @description 判断两个几何图形是否相等。如果所有的 components 具有相同的坐标,则认为是相等的。
  22633. * @param {Geometry} geometry - 需要判断的几何图形。
  22634. * @returns {boolean} 输入的几何图形与当前几何图形是否相等。
  22635. */
  22636. }, {
  22637. key: "equals",
  22638. value: function equals(geometry) {
  22639. var equivalent = true;
  22640. if (!geometry || !geometry.CLASS_NAME || this.CLASS_NAME !== geometry.CLASS_NAME) {
  22641. equivalent = false;
  22642. } else if (!Util_Util.isArray(geometry.components) || geometry.components.length !== this.components.length) {
  22643. equivalent = false;
  22644. } else {
  22645. for (var i = 0, len = this.components.length; i < len; ++i) {
  22646. if (!this.components[i].equals(geometry.components[i])) {
  22647. equivalent = false;
  22648. break;
  22649. }
  22650. }
  22651. }
  22652. return equivalent;
  22653. }
  22654. /**
  22655. * @function GeometryCollection.prototype.getVertices
  22656. * @description 返回几何对象的所有结点的列表。
  22657. * @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false,则返回非端点的顶点,如果没有设置此参数,则返回所有顶点。
  22658. * @returns {Array} 几何对象的顶点列表。
  22659. */
  22660. }, {
  22661. key: "getVertices",
  22662. value: function getVertices(nodes) {
  22663. var vertices = [];
  22664. for (var i = 0, len = this.components.length; i < len; ++i) {
  22665. Array.prototype.push.apply(vertices, this.components[i].getVertices(nodes));
  22666. }
  22667. return vertices;
  22668. }
  22669. }]);
  22670. return Collection;
  22671. }(Geometry_Geometry);
  22672. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiPoint.js
  22673. function MultiPoint_typeof(obj) { "@babel/helpers - typeof"; return MultiPoint_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, MultiPoint_typeof(obj); }
  22674. function MultiPoint_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22675. function MultiPoint_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  22676. function MultiPoint_createClass(Constructor, protoProps, staticProps) { if (protoProps) MultiPoint_defineProperties(Constructor.prototype, protoProps); if (staticProps) MultiPoint_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  22677. function MultiPoint_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) MultiPoint_setPrototypeOf(subClass, superClass); }
  22678. function MultiPoint_setPrototypeOf(o, p) { MultiPoint_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MultiPoint_setPrototypeOf(o, p); }
  22679. function MultiPoint_createSuper(Derived) { var hasNativeReflectConstruct = MultiPoint_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MultiPoint_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MultiPoint_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MultiPoint_possibleConstructorReturn(this, result); }; }
  22680. function MultiPoint_possibleConstructorReturn(self, call) { if (call && (MultiPoint_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return MultiPoint_assertThisInitialized(self); }
  22681. function MultiPoint_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22682. function MultiPoint_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  22683. function MultiPoint_getPrototypeOf(o) { MultiPoint_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiPoint_getPrototypeOf(o); }
  22684. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  22685. * This program are made available under the terms of the Apache License, Version 2.0
  22686. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22687. /**
  22688. * @class GeometryMultiPoint
  22689. * @aliasclass Geometry.MultiPoint
  22690. * @deprecatedclass SuperMap.Geometry.MultiPoint
  22691. * @classdesc 几何对象多点类。
  22692. * @category BaseTypes Geometry
  22693. * @extends GeometryCollection
  22694. * @param {Array.<GeometryPoint>} components - 点对象数组。
  22695. * @example
  22696. * var point1 = new GeometryPoint(5,6);
  22697. * var poine2 = new GeometryMultiPoint(7,8);
  22698. * var multiPoint = new MultiPoint([point1,point2]);
  22699. * @usage
  22700. */
  22701. var MultiPoint = /*#__PURE__*/function (_Collection) {
  22702. MultiPoint_inherits(MultiPoint, _Collection);
  22703. var _super = MultiPoint_createSuper(MultiPoint);
  22704. function MultiPoint(components) {
  22705. var _this;
  22706. MultiPoint_classCallCheck(this, MultiPoint);
  22707. _this = _super.call(this, components);
  22708. /**
  22709. * @member {Array.<string>} [GeometryMultiPoint.prototype.componentTypes=["SuperMap.Geometry.Point"]]
  22710. * @description components 存储的几何对象所支持的几何类型数组。
  22711. * @readonly
  22712. */
  22713. _this.componentTypes = ["SuperMap.Geometry.Point"];
  22714. _this.CLASS_NAME = "SuperMap.Geometry.MultiPoint";
  22715. _this.geometryType = "MultiPoint";
  22716. return _this;
  22717. }
  22718. /**
  22719. * @function GeometryMultiPoint.prototype.addPoint
  22720. * @description 添加点,封装了 {@link GeometryCollection|GeometryCollection.addComponent} 方法。
  22721. * @param {GeometryPoint} point - 添加的点。
  22722. * @param {number} [index] - 下标。
  22723. */
  22724. MultiPoint_createClass(MultiPoint, [{
  22725. key: "addPoint",
  22726. value: function addPoint(point, index) {
  22727. this.addComponent(point, index);
  22728. }
  22729. /**
  22730. * @function GeometryMultiPoint.prototype.removePoint
  22731. * @description 移除点,封装了 {@link GeometryCollection|GeometryCollection.removeComponent} 方法。
  22732. * @param {GeometryPoint} point - 移除的点对象。
  22733. */
  22734. }, {
  22735. key: "removePoint",
  22736. value: function removePoint(point) {
  22737. this.removeComponent(point);
  22738. }
  22739. }]);
  22740. return MultiPoint;
  22741. }(Collection);
  22742. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Curve.js
  22743. function Curve_typeof(obj) { "@babel/helpers - typeof"; return Curve_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Curve_typeof(obj); }
  22744. function Curve_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  22745. function Curve_createClass(Constructor, protoProps, staticProps) { if (protoProps) Curve_defineProperties(Constructor.prototype, protoProps); if (staticProps) Curve_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  22746. function Curve_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22747. function Curve_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Curve_setPrototypeOf(subClass, superClass); }
  22748. function Curve_setPrototypeOf(o, p) { Curve_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Curve_setPrototypeOf(o, p); }
  22749. function Curve_createSuper(Derived) { var hasNativeReflectConstruct = Curve_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Curve_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Curve_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Curve_possibleConstructorReturn(this, result); }; }
  22750. function Curve_possibleConstructorReturn(self, call) { if (call && (Curve_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Curve_assertThisInitialized(self); }
  22751. function Curve_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22752. function Curve_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  22753. function Curve_getPrototypeOf(o) { Curve_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Curve_getPrototypeOf(o); }
  22754. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  22755. * This program are made available under the terms of the Apache License, Version 2.0
  22756. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22757. /**
  22758. * @class GeometryCurve
  22759. * @aliasclass Geometry.Curve
  22760. * @deprecatedclass SuperMap.Geometry.Curve
  22761. * @classdesc 几何对象曲线类。
  22762. * @category BaseTypes Geometry
  22763. * @extends GeometryMultiPoint
  22764. * @param {Array.<GeometryPoint>} components - 几何对象数组。
  22765. * @example
  22766. * var point1 = new GeometryPoint(10,20);
  22767. * var point2 = new GeometryPoint(30,40);
  22768. * var curve = new Curve([point1,point2]);
  22769. * @usage
  22770. */
  22771. var Curve = /*#__PURE__*/function (_MultiPoint) {
  22772. Curve_inherits(Curve, _MultiPoint);
  22773. var _super = Curve_createSuper(Curve);
  22774. function Curve(components) {
  22775. var _this;
  22776. Curve_classCallCheck(this, Curve);
  22777. _this = _super.call(this, components);
  22778. /**
  22779. * @member {Array.<string>} [GeometryCurve.prototype.componentTypes=["SuperMap.Geometry.Point", "SuperMap.PointWithMeasure"]]
  22780. * @description components 存储的几何对象所支持的几何类型数组。
  22781. * @readonly
  22782. */
  22783. _this.componentTypes = ["SuperMap.Geometry.Point", "SuperMap.PointWithMeasure"];
  22784. _this.CLASS_NAME = "SuperMap.Geometry.Curve";
  22785. _this.geometryType = "Curve";
  22786. return _this;
  22787. }
  22788. return Curve_createClass(Curve);
  22789. }(MultiPoint);
  22790. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Point.js
  22791. function Point_typeof(obj) { "@babel/helpers - typeof"; return Point_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Point_typeof(obj); }
  22792. function Point_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22793. function Point_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  22794. function Point_createClass(Constructor, protoProps, staticProps) { if (protoProps) Point_defineProperties(Constructor.prototype, protoProps); if (staticProps) Point_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  22795. function Point_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Point_get = Reflect.get.bind(); } else { Point_get = function _get(target, property, receiver) { var base = Point_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Point_get.apply(this, arguments); }
  22796. function Point_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Point_getPrototypeOf(object); if (object === null) break; } return object; }
  22797. function Point_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Point_setPrototypeOf(subClass, superClass); }
  22798. function Point_setPrototypeOf(o, p) { Point_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Point_setPrototypeOf(o, p); }
  22799. function Point_createSuper(Derived) { var hasNativeReflectConstruct = Point_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Point_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Point_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Point_possibleConstructorReturn(this, result); }; }
  22800. function Point_possibleConstructorReturn(self, call) { if (call && (Point_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Point_assertThisInitialized(self); }
  22801. function Point_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22802. function Point_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  22803. function Point_getPrototypeOf(o) { Point_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Point_getPrototypeOf(o); }
  22804. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  22805. * This program are made available under the terms of the Apache License, Version 2.0
  22806. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22807. /**
  22808. * @class GeometryPoint
  22809. * @aliasclass Geometry.Point
  22810. * @deprecatedclass SuperMap.Geometry.Point
  22811. * @classdesc 点几何对象类。
  22812. * @category BaseTypes Geometry
  22813. * @extends {Geometry}
  22814. * @param {number} x - x 坐标。
  22815. * @param {number} y - y 坐标。
  22816. * @param {string} [type = 'Point'] - 点的类型。
  22817. * @param {number} [tag] - 额外的属性,比如插值分析中的 Z 值。
  22818. * @example
  22819. * var point = new GeometryPoint(-111.04, 45.68);
  22820. * @usage
  22821. */
  22822. var Point = /*#__PURE__*/function (_Geometry) {
  22823. Point_inherits(Point, _Geometry);
  22824. var _super = Point_createSuper(Point);
  22825. function Point(x, y, type, tag) {
  22826. var _this;
  22827. Point_classCallCheck(this, Point);
  22828. _this = _super.call(this, x, y, type, tag);
  22829. /**
  22830. * @member {number} GeometryPoint.prototype.x
  22831. * @description 横坐标。
  22832. */
  22833. _this.x = parseFloat(x);
  22834. /**
  22835. * @member {number} GeometryPoint.prototype.y
  22836. * @description 纵坐标。
  22837. */
  22838. _this.y = parseFloat(y);
  22839. /**
  22840. * @member {string} GeometryPoint.prototype.tag
  22841. * @description 用来存储额外的属性,比如插值分析中的 Z 值。
  22842. */
  22843. _this.tag = tag || tag == 0 ? parseFloat(tag) : null;
  22844. /**
  22845. * @member {string} GeometryPoint.prototype.type
  22846. * @description 用来存储点的类型。
  22847. */
  22848. _this.type = type || "Point";
  22849. _this.CLASS_NAME = "SuperMap.Geometry.Point";
  22850. _this.geometryType = "Point";
  22851. return _this;
  22852. }
  22853. /**
  22854. * @function GeometryPoint.prototype.clone
  22855. * @description 克隆点对象。
  22856. * @returns {GeometryPoint} 克隆后的点对象。
  22857. */
  22858. Point_createClass(Point, [{
  22859. key: "clone",
  22860. value: function clone(obj) {
  22861. if (obj == null) {
  22862. obj = new Point(this.x, this.y);
  22863. }
  22864. // catch any randomly tagged-on properties
  22865. Util_Util.applyDefaults(obj, this);
  22866. return obj;
  22867. }
  22868. /**
  22869. * @function GeometryPoint.prototype.calculateBounds
  22870. * @description 计算点对象的范围。
  22871. */
  22872. }, {
  22873. key: "calculateBounds",
  22874. value: function calculateBounds() {
  22875. this.bounds = new Bounds(this.x, this.y, this.x, this.y);
  22876. }
  22877. /**
  22878. * @function GeometryPoint.prototype.equals
  22879. * @description 判断两个点对象是否相等。如果两个点对象具有相同的坐标,则认为是相等的。
  22880. * @example
  22881. * var point= new GeometryPoint(0,0);
  22882. * var point1={x:0,y:0};
  22883. * var result= point.equals(point1);
  22884. * @param {GeometryPoint} geom - 需要判断的点对象。
  22885. * @returns {boolean} 两个点对象是否相等(true 为相等,false 为不等)。
  22886. */
  22887. }, {
  22888. key: "equals",
  22889. value: function equals(geom) {
  22890. var equals = false;
  22891. if (geom != null) {
  22892. equals = this.x === geom.x && this.y === geom.y || isNaN(this.x) && isNaN(this.y) && isNaN(geom.x) && isNaN(geom.y);
  22893. }
  22894. return equals;
  22895. }
  22896. /**
  22897. * @function GeometryPoint.prototype.move
  22898. * @description 沿着 x、y 轴的正方向上按照给定的位移移动点对象,move 不仅改变了几何对象的位置并且清理了边界缓存。
  22899. * @param {number} x - x 轴正方向上的偏移量。
  22900. * @param {number} y - y 轴正方向上偏移量。
  22901. */
  22902. }, {
  22903. key: "move",
  22904. value: function move(x, y) {
  22905. this.x = this.x + x;
  22906. this.y = this.y + y;
  22907. this.clearBounds();
  22908. }
  22909. /**
  22910. * @function GeometryPoint.prototype.toShortString
  22911. * @description 将 x/y 坐标转换成简单字符串。
  22912. * @returns {string} 字符串代表点对象。(ex. <i>"5, 42"</i>)
  22913. */
  22914. }, {
  22915. key: "toShortString",
  22916. value: function toShortString() {
  22917. return this.x + ", " + this.y;
  22918. }
  22919. /**
  22920. * @function GeometryPoint.prototype.destroy
  22921. * @description 释放点对象的资源。
  22922. */
  22923. }, {
  22924. key: "destroy",
  22925. value: function destroy() {
  22926. this.x = null;
  22927. this.y = null;
  22928. this.tag = null;
  22929. Point_get(Point_getPrototypeOf(Point.prototype), "destroy", this).call(this);
  22930. }
  22931. /**
  22932. * @function GeometryPoint.prototype.getVertices
  22933. * @description 获取几何图形所有顶点的列表。
  22934. * @returns {Array} 几何图形的顶点列表。
  22935. */
  22936. }, {
  22937. key: "getVertices",
  22938. value: function getVertices() {
  22939. return [this];
  22940. }
  22941. }]);
  22942. return Point;
  22943. }(Geometry_Geometry);
  22944. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/LineString.js
  22945. function LineString_typeof(obj) { "@babel/helpers - typeof"; return LineString_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, LineString_typeof(obj); }
  22946. function LineString_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22947. function LineString_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  22948. function LineString_createClass(Constructor, protoProps, staticProps) { if (protoProps) LineString_defineProperties(Constructor.prototype, protoProps); if (staticProps) LineString_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  22949. function LineString_get() { if (typeof Reflect !== "undefined" && Reflect.get) { LineString_get = Reflect.get.bind(); } else { LineString_get = function _get(target, property, receiver) { var base = LineString_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return LineString_get.apply(this, arguments); }
  22950. function LineString_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = LineString_getPrototypeOf(object); if (object === null) break; } return object; }
  22951. function LineString_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) LineString_setPrototypeOf(subClass, superClass); }
  22952. function LineString_setPrototypeOf(o, p) { LineString_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LineString_setPrototypeOf(o, p); }
  22953. function LineString_createSuper(Derived) { var hasNativeReflectConstruct = LineString_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = LineString_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = LineString_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return LineString_possibleConstructorReturn(this, result); }; }
  22954. function LineString_possibleConstructorReturn(self, call) { if (call && (LineString_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return LineString_assertThisInitialized(self); }
  22955. function LineString_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22956. function LineString_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  22957. function LineString_getPrototypeOf(o) { LineString_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LineString_getPrototypeOf(o); }
  22958. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  22959. * This program are made available under the terms of the Apache License, Version 2.0
  22960. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22961. /**
  22962. * @class GeometryLineString
  22963. * @aliasclass Geometry.LineString
  22964. * @deprecatedclass SuperMap.Geometry.LineString
  22965. * @classdesc 几何对象线串类。
  22966. * @category BaseTypes Geometry
  22967. * @param {Array.<GeometryPoint>} points - 用来生成线串的点数组。
  22968. * @extends GeometryCurve
  22969. * @example
  22970. * var points = [new GeometryPoint(4933.319287022352, -3337.3849141502124),
  22971. * new GeometryPoint(4960.9674060199022, -3349.3316322355736),
  22972. * new GeometryPoint(5006.0235999418364, -3358.8890067038628),
  22973. * new GeometryPoint(5075.3145648369318, -3378.0037556404409),
  22974. * new GeometryPoint(5305.19551436013, -3376.9669111768926)],
  22975. * var roadLine = new GeometryLineString(points);
  22976. * @usage
  22977. */
  22978. var LineString = /*#__PURE__*/function (_Curve) {
  22979. LineString_inherits(LineString, _Curve);
  22980. var _super = LineString_createSuper(LineString);
  22981. function LineString(points) {
  22982. var _this;
  22983. LineString_classCallCheck(this, LineString);
  22984. _this = _super.call(this, points);
  22985. _this.CLASS_NAME = "SuperMap.Geometry.LineString";
  22986. _this.geometryType = "LineString";
  22987. return _this;
  22988. }
  22989. /**
  22990. * @function GeometryLineString.prototype.removeComponent
  22991. * @description 只有在线串上有三个或更多的点的时候,才会允许移除点(否则结果将会是单一的点)。
  22992. * @param {GeometryPoint} point - 将被删除的点。
  22993. * @returns {boolean} 删除的点。
  22994. */
  22995. LineString_createClass(LineString, [{
  22996. key: "removeComponent",
  22997. value: function removeComponent(point) {
  22998. // eslint-disable-line no-unused-vars
  22999. var removed = this.components && this.components.length > 2;
  23000. if (removed) {
  23001. LineString_get(LineString_getPrototypeOf(LineString.prototype), "removeComponent", this).apply(this, arguments);
  23002. }
  23003. return removed;
  23004. }
  23005. /**
  23006. * @function GeometryLineString.prototype.getSortedSegments
  23007. * @description 获取升序排列的点坐标对象数组。
  23008. * @returns {Array} 升序排列的点坐标对象数组。
  23009. */
  23010. }, {
  23011. key: "getSortedSegments",
  23012. value: function getSortedSegments() {
  23013. var numSeg = this.components.length - 1;
  23014. var segments = new Array(numSeg),
  23015. point1,
  23016. point2;
  23017. for (var i = 0; i < numSeg; ++i) {
  23018. point1 = this.components[i];
  23019. point2 = this.components[i + 1];
  23020. if (point1.x < point2.x) {
  23021. segments[i] = {
  23022. x1: point1.x,
  23023. y1: point1.y,
  23024. x2: point2.x,
  23025. y2: point2.y
  23026. };
  23027. } else {
  23028. segments[i] = {
  23029. x1: point2.x,
  23030. y1: point2.y,
  23031. x2: point1.x,
  23032. y2: point1.y
  23033. };
  23034. }
  23035. }
  23036. // more efficient to define this somewhere static
  23037. function byX1(seg1, seg2) {
  23038. return seg1.x1 - seg2.x1;
  23039. }
  23040. return segments.sort(byX1);
  23041. }
  23042. /**
  23043. * @function GeometryLineString.prototype.getVertices
  23044. * @description 返回几何图形的所有顶点的列表。
  23045. * @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false,则返回非端点的顶点,如果没有设置此参数,则返回所有顶点。
  23046. * @returns {Array} 几何图形的顶点列表。
  23047. */
  23048. }, {
  23049. key: "getVertices",
  23050. value: function getVertices(nodes) {
  23051. var vertices;
  23052. if (nodes === true) {
  23053. vertices = [this.components[0], this.components[this.components.length - 1]];
  23054. } else if (nodes === false) {
  23055. vertices = this.components.slice(1, this.components.length - 1);
  23056. } else {
  23057. vertices = this.components.slice();
  23058. }
  23059. return vertices;
  23060. }
  23061. /**
  23062. * @function GeometryLineString.calculateCircle
  23063. * @description 三点画圆弧。
  23064. * @param {Array.<GeometryPoint>} points - 传入的待计算的初始点串。
  23065. * @returns {Array.<GeometryPoint>} 计算出相应的圆弧控制点。
  23066. * @example
  23067. * var points = [];
  23068. * points.push(new GeometryPoint(-50,30));
  23069. * points.push(new GeometryPoint(-30,50));
  23070. * points.push(new GeometryPoint(2,60));
  23071. * var circle = GeometryLineString.calculateCircle(points);
  23072. */
  23073. }], [{
  23074. key: "calculateCircle",
  23075. value: function calculateCircle(points) {
  23076. if (points.length < 3) {
  23077. return points;
  23078. }
  23079. var centerPoint = {},
  23080. p1 = points[0],
  23081. p2 = points[1],
  23082. p3 = points[2];
  23083. var R = 0,
  23084. dStep = 0,
  23085. direc = true,
  23086. dRotation = 0,
  23087. dRotationBegin = 0,
  23088. dRotationAngle = 0,
  23089. nSegmentCount = 72,
  23090. circlePoints = [];
  23091. var KTan13 = (p3.y - p1.y) / (p3.x - p1.x);
  23092. var B13 = p3.y - KTan13 * p3.x;
  23093. if (p3.x != p1.x && p3.y != p1.y && p2.y == KTan13 * p2.x + B13 || p3.x == p1.x && p2.x == p1.x || p3.y == p1.y && p2.y == p1.y || p3.x == p1.x && p3.y == p1.y || p3.x == p2.x && p3.y == p2.y || p1.x == p2.x && p1.y == p2.y) {
  23094. circlePoints.push(p1);
  23095. circlePoints.push(p2);
  23096. circlePoints.push(p3);
  23097. } else {
  23098. var D = (p2.x * p2.x + p2.y * p2.y - (p1.x * p1.x + p1.y * p1.y)) * (2 * (p3.y - p1.y)) - (p3.x * p3.x + p3.y * p3.y - (p1.x * p1.x + p1.y * p1.y)) * (2 * (p2.y - p1.y));
  23099. var E = 2 * (p2.x - p1.x) * (p3.x * p3.x + p3.y * p3.y - (p1.x * p1.x + p1.y * p1.y)) - 2 * (p3.x - p1.x) * (p2.x * p2.x + p2.y * p2.y - (p1.x * p1.x + p1.y * p1.y));
  23100. var F = 4 * ((p2.x - p1.x) * (p3.y - p1.y) - (p3.x - p1.x) * (p2.y - p1.y));
  23101. centerPoint.x = D / F;
  23102. centerPoint.y = E / F;
  23103. R = Math.sqrt((p1.x - centerPoint.x) * (p1.x - centerPoint.x) + (p1.y - centerPoint.y) * (p1.y - centerPoint.y));
  23104. var dis = (p1.x - p3.x) * (p1.x - p3.x) + (p1.y - p3.y) * (p1.y - p3.y);
  23105. var cons = (2 * R * R - dis) / (2 * R * R);
  23106. cons = cons >= 1 ? 1 : cons;
  23107. cons = cons <= -1 ? -1 : cons;
  23108. dRotationAngle = Math.acos(cons) * 180 / Math.PI;
  23109. if (p3.x == p1.x) {
  23110. dRotationAngle = centerPoint.x > p1.x && p2.x > p1.x || centerPoint.x < p1.x && p2.x < p1.x ? 360 - dRotationAngle : dRotationAngle;
  23111. } else {
  23112. dRotationAngle = centerPoint.y > KTan13 * centerPoint.x + B13 && p2.y > KTan13 * p2.x + B13 || centerPoint.y < KTan13 * centerPoint.x + B13 && p2.y < KTan13 * p2.x + B13 ? 360 - dRotationAngle : dRotationAngle;
  23113. }
  23114. dStep = dRotationAngle / 72;
  23115. if (p3.y != p1.y) {
  23116. if (p3.x == p1.x) {
  23117. if (p3.y > p1.y) {
  23118. if (p2.x < p1.x) {
  23119. direc = false;
  23120. }
  23121. } else {
  23122. if (p2.x > p1.x) {
  23123. direc = false;
  23124. }
  23125. }
  23126. } else if (p3.x < p1.x) {
  23127. if (p2.y < KTan13 * p2.x + B13) {
  23128. direc = false;
  23129. }
  23130. } else {
  23131. if (p2.y > KTan13 * p2.x + B13) {
  23132. direc = false;
  23133. }
  23134. }
  23135. } else {
  23136. if (p3.x > p1.x) {
  23137. if (p2.y > p1.y) {
  23138. direc = false;
  23139. }
  23140. } else {
  23141. if (p2.y < p1.y) {
  23142. direc = false;
  23143. }
  23144. }
  23145. }
  23146. var K10 = (p1.y - centerPoint.y) / (p1.x - centerPoint.x);
  23147. var atan10 = K10 >= 0 ? Math.atan(K10) * 180 / Math.PI : Math.abs(Math.atan(K10) * 180 / Math.PI) + 90;
  23148. var CY = Math.abs(centerPoint.y);
  23149. if (p1.y == CY && CY == p3.y) {
  23150. if (p1.x < p3.x) {
  23151. atan10 = atan10 + 180;
  23152. }
  23153. }
  23154. var newPY = p1.y - centerPoint.y;
  23155. circlePoints.push(p1);
  23156. for (var i = 1; i < nSegmentCount; i++) {
  23157. dRotation = dStep * i;
  23158. dRotationBegin = atan10;
  23159. if (direc) {
  23160. if (newPY >= 0) {
  23161. if (K10 >= 0) {
  23162. dRotationBegin = dRotationBegin + dRotation;
  23163. } else {
  23164. dRotationBegin = 180 - (dRotationBegin - 90) + dRotation;
  23165. }
  23166. } else {
  23167. if (K10 > 0) {
  23168. dRotationBegin = dRotationBegin - 180 + dRotation;
  23169. } else {
  23170. dRotationBegin = 90 - dRotationBegin + dRotation;
  23171. }
  23172. }
  23173. } else {
  23174. if (newPY >= 0) {
  23175. if (K10 >= 0) {
  23176. dRotationBegin = dRotationBegin - dRotation;
  23177. } else {
  23178. dRotationBegin = 180 - (dRotationBegin - 90) - dRotation;
  23179. }
  23180. } else {
  23181. if (K10 >= 0) {
  23182. dRotationBegin = dRotationBegin - 180 - dRotation;
  23183. } else {
  23184. dRotationBegin = 90 - dRotationBegin - dRotation;
  23185. }
  23186. }
  23187. }
  23188. dRotationBegin = dRotationBegin * Math.PI / 180;
  23189. var x = centerPoint.x + R * Math.cos(dRotationBegin);
  23190. var y = centerPoint.y + R * Math.sin(dRotationBegin);
  23191. circlePoints.push(new Point(x, y));
  23192. }
  23193. circlePoints.push(p3);
  23194. }
  23195. return circlePoints;
  23196. }
  23197. /**
  23198. * @function GeometryLineString.createLineEPS
  23199. * @description 根据点的类型画出不同类型的曲线。
  23200. * 点的类型有三种:LTypeArc,LTypeCurve,NONE。
  23201. * @param {Array.<GeometryPoint>} points - 传入的待计算的初始点串。
  23202. * @returns {Array.<GeometryPoint>} 计算出相应的 lineEPS 控制点。
  23203. * @example
  23204. * var points = [];
  23205. * points.push(new GeometryPoint(-50,30));
  23206. * points.push(new GeometryPoint(-30,50,"LTypeArc"));
  23207. * points.push(new GeometryPoint(2,60));
  23208. * points.push(new GeometryPoint(8,20));
  23209. * var lineEPS = GeometryLineString.createLineEPS(points);
  23210. */
  23211. }, {
  23212. key: "createLineEPS",
  23213. value: function createLineEPS(points) {
  23214. var list = [],
  23215. len = points.length;
  23216. if (len < 2) {
  23217. return points;
  23218. }
  23219. for (var i = 0; i < len;) {
  23220. var type = points[i].type;
  23221. if (type == 'LTypeArc') {
  23222. var listObj = LineString.createLineArc(list, i, len, points);
  23223. list = listObj[0];
  23224. i = listObj[1];
  23225. } else {
  23226. list.push(points[i]);
  23227. i++;
  23228. }
  23229. }
  23230. return list;
  23231. }
  23232. }, {
  23233. key: "createLineArc",
  23234. value: function createLineArc(list, i, len, points) {
  23235. if (i == 0) {
  23236. var bezierPtsObj = LineString.addPointEPS(points, i, len, 'LTypeArc');
  23237. Array.prototype.push.apply(list, bezierPtsObj[0]);
  23238. i = bezierPtsObj[1] + 1;
  23239. } else if (i == len - 1) {
  23240. var bezierP = [points[i - 1], points[i]],
  23241. bezierPts = LineString.calculateCircle(bezierP);
  23242. Array.prototype.push.apply(list, bezierPts);
  23243. i++;
  23244. } else {
  23245. var _bezierPtsObj = LineString.addPointEPS(points, i, len, 'LTypeArc');
  23246. list.pop();
  23247. Array.prototype.push.apply(list, _bezierPtsObj[0]);
  23248. i = _bezierPtsObj[1] + 1;
  23249. }
  23250. return [list, i];
  23251. }
  23252. }, {
  23253. key: "addPointEPS",
  23254. value: function addPointEPS(points, i, len, type) {
  23255. var bezierP = [],
  23256. j = i + 1;
  23257. if (i == 0) {
  23258. Array.prototype.push.apply(bezierP, [points[i], points[i + 1]]);
  23259. } else if (i == len - 1) {
  23260. Array.prototype.push.apply(bezierP, [points[i - 1], points[i]]);
  23261. } else {
  23262. Array.prototype.push.apply(bezierP, [points[i - 1], points[i], points[i + 1]]);
  23263. }
  23264. var bezierPts;
  23265. if (type == 'LTypeCurve') {
  23266. bezierPts = LineString.calculatePointsFBZN(bezierP);
  23267. } else if (type == 'LTypeArc') {
  23268. bezierPts = LineString.calculateCircle(bezierP);
  23269. }
  23270. return [bezierPts, j];
  23271. }
  23272. }]);
  23273. return LineString;
  23274. }(Curve);
  23275. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/GeoText.js
  23276. function GeoText_typeof(obj) { "@babel/helpers - typeof"; return GeoText_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GeoText_typeof(obj); }
  23277. function GeoText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23278. function GeoText_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  23279. function GeoText_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoText_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoText_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  23280. function GeoText_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GeoText_get = Reflect.get.bind(); } else { GeoText_get = function _get(target, property, receiver) { var base = GeoText_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GeoText_get.apply(this, arguments); }
  23281. function GeoText_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoText_getPrototypeOf(object); if (object === null) break; } return object; }
  23282. function GeoText_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GeoText_setPrototypeOf(subClass, superClass); }
  23283. function GeoText_setPrototypeOf(o, p) { GeoText_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoText_setPrototypeOf(o, p); }
  23284. function GeoText_createSuper(Derived) { var hasNativeReflectConstruct = GeoText_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeoText_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeoText_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeoText_possibleConstructorReturn(this, result); }; }
  23285. function GeoText_possibleConstructorReturn(self, call) { if (call && (GeoText_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GeoText_assertThisInitialized(self); }
  23286. function GeoText_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23287. function GeoText_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  23288. function GeoText_getPrototypeOf(o) { GeoText_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoText_getPrototypeOf(o); }
  23289. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  23290. * This program are made available under the terms of the Apache License, Version 2.0
  23291. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23292. /**
  23293. * @class GeometryGeoText
  23294. * @aliasclass Geometry.GeoText
  23295. * @deprecatedclass SuperMap.Geometry.GeoText
  23296. * @classdesc 文本标签类。
  23297. * @category BaseTypes Geometry
  23298. * @extends {Geometry}
  23299. * @param {number} x - x 坐标。
  23300. * @param {number} y - y 坐标。
  23301. * @param {string} text - 标签中的文本内容。
  23302. * @usage
  23303. */
  23304. var GeoText = /*#__PURE__*/function (_Geometry) {
  23305. GeoText_inherits(GeoText, _Geometry);
  23306. var _super = GeoText_createSuper(GeoText);
  23307. function GeoText(x, y, text) {
  23308. var _this;
  23309. GeoText_classCallCheck(this, GeoText);
  23310. _this = _super.call(this, x, y, text);
  23311. /**
  23312. * @member {number} GeometryGeoText.prototype.x
  23313. * @description 横坐标。
  23314. */
  23315. _this.x = parseFloat(x);
  23316. /**
  23317. * @member {number} GeometryGeoText.prototype.y
  23318. * @description 纵坐标。
  23319. */
  23320. _this.y = parseFloat(y);
  23321. /**
  23322. * @member {string} GeometryGeoText.prototype.text
  23323. * @description 标签中的文本内容。
  23324. */
  23325. _this.text = text.toString();
  23326. /**
  23327. * @member {Object} GeometryGeoText.prototype.bsInfo
  23328. * @description 标签范围的基础信息。
  23329. * @property {number} w - bounds 的宽度。
  23330. * @property {number} h - bounds 的高度。
  23331. */
  23332. _this.bsInfo = {
  23333. "h": null,
  23334. "w": null
  23335. };
  23336. _this.element = document.createElement('span');
  23337. _this.CLASS_NAME = "SuperMap.Geometry.GeoText";
  23338. _this.geometryType = "GeoText";
  23339. return _this;
  23340. }
  23341. /**
  23342. * @function GeometryGeoText.prototype.destroy
  23343. * @description 销毁文本标签类。
  23344. */
  23345. GeoText_createClass(GeoText, [{
  23346. key: "destroy",
  23347. value: function destroy() {
  23348. GeoText_get(GeoText_getPrototypeOf(GeoText.prototype), "destroy", this).call(this);
  23349. this.x = null;
  23350. this.y = null;
  23351. this.text = null;
  23352. }
  23353. /**
  23354. * @function GeometryGeoText.prototype.getCentroid
  23355. * @description 获取标签对象的质心。
  23356. * @returns {GeometryPoint} 标签对象的质心。
  23357. */
  23358. }, {
  23359. key: "getCentroid",
  23360. value: function getCentroid() {
  23361. return new Point(this.x, this.y);
  23362. }
  23363. /**
  23364. * @function GeometryGeoText.prototype.clone
  23365. * @description 克隆标签对象。
  23366. * @returns {GeometryGeoText} 克隆后的标签对象。
  23367. */
  23368. }, {
  23369. key: "clone",
  23370. value: function clone(obj) {
  23371. if (obj == null) {
  23372. obj = new GeoText(this.x, this.y, this.text);
  23373. }
  23374. Util_Util.applyDefaults(obj, this);
  23375. return obj;
  23376. }
  23377. /**
  23378. * @function GeometryGeoText.prototype.calculateBounds
  23379. * @description 计算标签对象的范围。
  23380. */
  23381. }, {
  23382. key: "calculateBounds",
  23383. value: function calculateBounds() {
  23384. this.bounds = new Bounds(this.x, this.y, this.x, this.y);
  23385. }
  23386. /**
  23387. * @function GeometryGeoText.prototype.getLabelPxBoundsByLabel
  23388. * @description 根据绘制好的标签获取文字标签的像素范围,参数的单位是像素;此方法相对于 getLabelPxBoundsByText 效率较低,但支持所有格式的文本。
  23389. * @param {Object} locationPixel - 标签的位置点,该对象含有属性 x(横坐标),属性 y(纵坐标)。
  23390. * @param {string} labelWidth - 标签的宽度,如:“90px”。
  23391. * @param {string} labelHeight - 标签的高度。
  23392. * @param {Object} style - 标签的 style。
  23393. * @returns {Bounds} 标签的像素范围。
  23394. */
  23395. }, {
  23396. key: "getLabelPxBoundsByLabel",
  23397. value: function getLabelPxBoundsByLabel(locationPixel, labelWidth, labelHeight, style) {
  23398. var labelPxBounds, left, bottom, top, right;
  23399. var locationPx = Util_Util.cloneObject(locationPixel);
  23400. //计算文本行数
  23401. var theText = style.label || this.text;
  23402. var textRows = theText.split('\n');
  23403. var laberRows = textRows.length;
  23404. //处理文字对齐
  23405. labelWidth = parseFloat(labelWidth);
  23406. labelHeight = parseFloat(labelHeight);
  23407. if (laberRows > 1) {
  23408. labelHeight = parseFloat(labelHeight) * laberRows;
  23409. }
  23410. if (style.labelAlign && style.labelAlign !== "cm") {
  23411. switch (style.labelAlign) {
  23412. case "lt":
  23413. locationPx.x += labelWidth / 2;
  23414. locationPx.y += labelHeight / 2;
  23415. break;
  23416. case "lm":
  23417. locationPx.x += labelWidth / 2;
  23418. break;
  23419. case "lb":
  23420. locationPx.x += labelWidth / 2;
  23421. locationPx.y -= labelHeight / 2;
  23422. break;
  23423. case "ct":
  23424. locationPx.y += labelHeight / 2;
  23425. break;
  23426. case "cb":
  23427. locationPx.y -= labelHeight / 2;
  23428. break;
  23429. case "rt":
  23430. locationPx.x -= labelWidth / 2;
  23431. locationPx.y += labelHeight / 2;
  23432. break;
  23433. case "rm":
  23434. locationPx.x -= labelWidth / 2;
  23435. break;
  23436. case "rb":
  23437. locationPx.x -= labelWidth / 2;
  23438. locationPx.y -= labelHeight / 2;
  23439. break;
  23440. default:
  23441. break;
  23442. }
  23443. }
  23444. this.bsInfo.h = labelHeight;
  23445. this.bsInfo.w = labelWidth;
  23446. //bounds的四边
  23447. left = locationPx.x - parseFloat(labelWidth) / 2;
  23448. bottom = locationPx.y + parseFloat(labelHeight) / 2;
  23449. right = locationPx.x + parseFloat(labelWidth) / 2;
  23450. top = locationPx.y - parseFloat(labelHeight) / 2;
  23451. labelPxBounds = new Bounds(left, bottom, right, top);
  23452. return labelPxBounds;
  23453. }
  23454. /**
  23455. * @function GeometryGeoText.prototype.getLabelPxBoundsByText
  23456. * @description 根据文本内容获取文字标签的像素范围。
  23457. * @param {Object} locationPixel - 标签的位置点,该对象含有属性 x(横坐标),属性 y(纵坐标)。
  23458. * @param {Object} style - 标签的样式。
  23459. * @returns {Bounds} 标签的像素范围。
  23460. */
  23461. }, {
  23462. key: "getLabelPxBoundsByText",
  23463. value: function getLabelPxBoundsByText(locationPixel, style) {
  23464. var labelPxBounds, left, bottom, top, right;
  23465. var labelSize = this.getLabelPxSize(style);
  23466. var locationPx = Util_Util.cloneObject(locationPixel);
  23467. //处理文字对齐
  23468. if (style.labelAlign && style.labelAlign !== "cm") {
  23469. switch (style.labelAlign) {
  23470. case "lt":
  23471. locationPx.x += labelSize.w / 2;
  23472. locationPx.y += labelSize.h / 2;
  23473. break;
  23474. case "lm":
  23475. locationPx.x += labelSize.w / 2;
  23476. break;
  23477. case "lb":
  23478. locationPx.x += labelSize.w / 2;
  23479. locationPx.y -= labelSize.h / 2;
  23480. break;
  23481. case "ct":
  23482. locationPx.y += labelSize.h / 2;
  23483. break;
  23484. case "cb":
  23485. locationPx.y -= labelSize.h / 2;
  23486. break;
  23487. case "rt":
  23488. locationPx.x -= labelSize.w / 2;
  23489. locationPx.y += labelSize.h / 2;
  23490. break;
  23491. case "rm":
  23492. locationPx.x -= labelSize.w / 2;
  23493. break;
  23494. case "rb":
  23495. locationPx.x -= labelSize.w / 2;
  23496. locationPx.y -= labelSize.h / 2;
  23497. break;
  23498. default:
  23499. break;
  23500. }
  23501. }
  23502. this.bsInfo.h = labelSize.h;
  23503. this.bsInfo.w = labelSize.w;
  23504. left = locationPx.x - labelSize.w / 2;
  23505. bottom = locationPx.y + labelSize.h / 2;
  23506. //处理斜体字
  23507. if (style.fontStyle && style.fontStyle === "italic") {
  23508. right = locationPx.x + labelSize.w / 2 + parseInt(parseFloat(style.fontSize) / 2);
  23509. } else {
  23510. right = locationPx.x + labelSize.w / 2;
  23511. }
  23512. top = locationPx.y - labelSize.h / 2;
  23513. labelPxBounds = new Bounds(left, bottom, right, top);
  23514. return labelPxBounds;
  23515. }
  23516. /**
  23517. * @function GeometryGeoText.prototype.getLabelPxSize
  23518. * @description 获取 label 的像素大小。
  23519. * @param {Object} style - 标签样式。
  23520. * @returns {Object} 标签大小对象,属性 w 表示标签的宽度,属性 h 表示标签的高度。
  23521. */
  23522. }, {
  23523. key: "getLabelPxSize",
  23524. value: function getLabelPxSize(style) {
  23525. var text,
  23526. //文本内容
  23527. fontSize,
  23528. //字体大小
  23529. spacing = 1,
  23530. //两个字符间的间距(单位:px)
  23531. lineSpacing = 0.2,
  23532. bgstrokeWidth = parseFloat(style.strokeWidth); //标签背景框边框的宽度
  23533. text = style.label || this.text;
  23534. if (style.fontSize) {
  23535. fontSize = parseFloat(style.fontSize);
  23536. } else {
  23537. fontSize = parseFloat("12px");
  23538. }
  23539. //标签宽高
  23540. var labelW, labelH;
  23541. var textRows = text.split('\n');
  23542. var numRows = textRows.length;
  23543. if (numRows > 1) {
  23544. labelH = fontSize * numRows + numRows + bgstrokeWidth + lineSpacing * fontSize;
  23545. } else {
  23546. labelH = fontSize + bgstrokeWidth + lineSpacing * fontSize + 1;
  23547. }
  23548. //取最大宽度
  23549. labelW = 0;
  23550. if (this.labelWTmp && labelW < this.labelWTmp) {
  23551. labelW = this.labelWTmp;
  23552. }
  23553. for (var i = 0; i < numRows; i++) {
  23554. var textCharC = this.getTextCount(textRows[i]);
  23555. var labelWTmp = this.labelWTmp = Util_Util.getTextBounds(style, textRows[i], this.element).textWidth + textCharC.textC * spacing + bgstrokeWidth;
  23556. if (labelW < labelWTmp) {
  23557. labelW = labelWTmp;
  23558. }
  23559. }
  23560. var labelSize = new Object(); //标签大小
  23561. labelSize.h = labelH;
  23562. labelSize.w = labelW;
  23563. return labelSize;
  23564. }
  23565. /**
  23566. * @function GeometryGeoText.prototype.getTextCount
  23567. * @description 获取 text 中的字符个数。
  23568. * @param {string} text - 字符串。
  23569. * @returns {Object} 字符个数统计结果,属性 cnC 表示中文字符个数,属性 enC 表示英文字符个数,属性 textC 表示字符总个数。
  23570. */
  23571. }, {
  23572. key: "getTextCount",
  23573. value: function getTextCount(text) {
  23574. var textCharCount = {};
  23575. var cnCount = 0;
  23576. var enCount = 0;
  23577. for (var i = 0; i < text.length; i++) {
  23578. if (text.charCodeAt(i) > 255) {
  23579. //遍历判断字符串中每个字符的Unicode码,大于255则为中文
  23580. cnCount++;
  23581. } else {
  23582. enCount++;
  23583. }
  23584. }
  23585. //中午字符个数
  23586. textCharCount.cnC = cnCount;
  23587. //英文字符个数
  23588. textCharCount.enC = enCount;
  23589. //字符总个数
  23590. textCharCount.textC = text.length;
  23591. return textCharCount;
  23592. }
  23593. }]);
  23594. return GeoText;
  23595. }(Geometry_Geometry);
  23596. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/LinearRing.js
  23597. function LinearRing_typeof(obj) { "@babel/helpers - typeof"; return LinearRing_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, LinearRing_typeof(obj); }
  23598. function LinearRing_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23599. function LinearRing_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  23600. function LinearRing_createClass(Constructor, protoProps, staticProps) { if (protoProps) LinearRing_defineProperties(Constructor.prototype, protoProps); if (staticProps) LinearRing_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  23601. function LinearRing_get() { if (typeof Reflect !== "undefined" && Reflect.get) { LinearRing_get = Reflect.get.bind(); } else { LinearRing_get = function _get(target, property, receiver) { var base = LinearRing_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return LinearRing_get.apply(this, arguments); }
  23602. function LinearRing_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = LinearRing_getPrototypeOf(object); if (object === null) break; } return object; }
  23603. function LinearRing_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) LinearRing_setPrototypeOf(subClass, superClass); }
  23604. function LinearRing_setPrototypeOf(o, p) { LinearRing_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LinearRing_setPrototypeOf(o, p); }
  23605. function LinearRing_createSuper(Derived) { var hasNativeReflectConstruct = LinearRing_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = LinearRing_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = LinearRing_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return LinearRing_possibleConstructorReturn(this, result); }; }
  23606. function LinearRing_possibleConstructorReturn(self, call) { if (call && (LinearRing_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return LinearRing_assertThisInitialized(self); }
  23607. function LinearRing_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23608. function LinearRing_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  23609. function LinearRing_getPrototypeOf(o) { LinearRing_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LinearRing_getPrototypeOf(o); }
  23610. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  23611. * This program are made available under the terms of the Apache License, Version 2.0
  23612. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23613. /**
  23614. * @class GeometryLinearRing
  23615. * @aliasclass Geometry.LinearRing
  23616. * @deprecatedclass SuperMap.Geometry.LinearRing
  23617. * @classdesc 几何对象线环类,是一个特殊的封闭的线串,在每次 addPoint/removePoint 之后会通过添加一个点(此点是复制的第一个点得到的)
  23618. * 作为最后的一个点来自动关闭线环。
  23619. * @category BaseTypes Geometry
  23620. * @extends GeometryLineString
  23621. * @param {Array.<GeometryPoint>} points - 组成线性环的点。
  23622. * @example
  23623. * var points = [new GeometryPoint(4933.319287022352, -3337.3849141502124),
  23624. * new GeometryPoint(4960.9674060199022, -3349.3316322355736),
  23625. * new GeometryPoint(5006.0235999418364, -3358.8890067038628),
  23626. * new GeometryPoint(5075.3145648369318, -3378.0037556404409),
  23627. * new GeometryPoint(5305.19551436013, -3376.9669111768926)],
  23628. * var linearRing = new GeometryLinearRing(points);
  23629. * @usage
  23630. */
  23631. var LinearRing_LinearRing = /*#__PURE__*/function (_LineString) {
  23632. LinearRing_inherits(LinearRing, _LineString);
  23633. var _super = LinearRing_createSuper(LinearRing);
  23634. function LinearRing(points) {
  23635. var _this;
  23636. LinearRing_classCallCheck(this, LinearRing);
  23637. _this = _super.call(this, points);
  23638. /**
  23639. * @member {Array.<string>} [GeometryLinearRing.prototype.componentTypes=["SuperMap.Geometry.Point"]]
  23640. * @description components 存储的几何对象所支持的几何类型数组,为空表示类型不受限制。
  23641. * @readonly
  23642. */
  23643. _this.componentTypes = ["SuperMap.Geometry.Point"];
  23644. _this.CLASS_NAME = "SuperMap.Geometry.LinearRing";
  23645. _this.geometryType = "LinearRing";
  23646. return _this;
  23647. }
  23648. /**
  23649. * @function GeometryLinearRing.prototype.addComponent
  23650. * @description 添加一个点到几何图形数组中,如果这个点将要被添加到组件数组的末端,并且与数组中已经存在的最后一个点相同,
  23651. * 重复的点是不能被添加的。这将影响未关闭环的关闭。
  23652. * 这个方法可以通过将非空索引(组件数组的下标)作为第二个参数重写。
  23653. * @param {GeometryPoint} point - 点对象。
  23654. * @param {number} [index] - 插入组件数组的下标。
  23655. * @returns {boolean} 点对象是否添加成功。
  23656. */
  23657. LinearRing_createClass(LinearRing, [{
  23658. key: "addComponent",
  23659. value: function addComponent(point, index) {
  23660. var added = false;
  23661. //remove last point
  23662. var lastPoint = this.components.pop();
  23663. // given an index, add the point
  23664. // without an index only add non-duplicate points
  23665. if (index != null || !point.equals(lastPoint)) {
  23666. added = LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, arguments);
  23667. }
  23668. //append copy of first point
  23669. var firstPoint = this.components[0];
  23670. LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, [firstPoint]);
  23671. return added;
  23672. }
  23673. /**
  23674. * @function GeometryLinearRing.prototype.removeComponent
  23675. * @description 从几何组件中删除一个点。
  23676. * @param {GeometryPoint} point - 点对象。
  23677. * @returns {boolean} 点对象是否删除。
  23678. */
  23679. }, {
  23680. key: "removeComponent",
  23681. value: function removeComponent(point) {
  23682. // eslint-disable-line no-unused-vars
  23683. var removed = this.components && this.components.length > 3;
  23684. if (removed) {
  23685. //remove last point
  23686. this.components.pop();
  23687. //remove our point
  23688. LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "removeComponent", this).apply(this, arguments);
  23689. //append copy of first point
  23690. var firstPoint = this.components[0];
  23691. LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, [firstPoint]);
  23692. }
  23693. return removed;
  23694. }
  23695. /**
  23696. * @function GeometryLinearRing.prototype.getArea
  23697. * @description 获得当前几何对象区域大小,如果是沿顺时针方向的环则是正值,否则为负值。
  23698. * @returns {number} 环的面积。
  23699. */
  23700. }, {
  23701. key: "getArea",
  23702. value: function getArea() {
  23703. var area = 0.0;
  23704. if (this.components && this.components.length > 2) {
  23705. var sum = 0.0;
  23706. for (var i = 0, len = this.components.length; i < len - 1; i++) {
  23707. var b = this.components[i];
  23708. var c = this.components[i + 1];
  23709. sum += (b.x + c.x) * (c.y - b.y);
  23710. }
  23711. area = -sum / 2.0;
  23712. }
  23713. return area;
  23714. }
  23715. /**
  23716. * @function GeometryLinearRing.prototype.getVertices
  23717. * @description 返回几何图形的所有点的列表。
  23718. * @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false ,则返回非端点的顶点,如果没有设置此参数,则返回所有顶点。
  23719. * @returns {Array} 几何对象所有点的列表。
  23720. */
  23721. }, {
  23722. key: "getVertices",
  23723. value: function getVertices(nodes) {
  23724. return nodes === true ? [] : this.components.slice(0, this.components.length - 1);
  23725. }
  23726. }]);
  23727. return LinearRing;
  23728. }(LineString);
  23729. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiLineString.js
  23730. function MultiLineString_typeof(obj) { "@babel/helpers - typeof"; return MultiLineString_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, MultiLineString_typeof(obj); }
  23731. function MultiLineString_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  23732. function MultiLineString_createClass(Constructor, protoProps, staticProps) { if (protoProps) MultiLineString_defineProperties(Constructor.prototype, protoProps); if (staticProps) MultiLineString_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  23733. function MultiLineString_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23734. function MultiLineString_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) MultiLineString_setPrototypeOf(subClass, superClass); }
  23735. function MultiLineString_setPrototypeOf(o, p) { MultiLineString_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MultiLineString_setPrototypeOf(o, p); }
  23736. function MultiLineString_createSuper(Derived) { var hasNativeReflectConstruct = MultiLineString_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MultiLineString_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MultiLineString_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MultiLineString_possibleConstructorReturn(this, result); }; }
  23737. function MultiLineString_possibleConstructorReturn(self, call) { if (call && (MultiLineString_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return MultiLineString_assertThisInitialized(self); }
  23738. function MultiLineString_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23739. function MultiLineString_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  23740. function MultiLineString_getPrototypeOf(o) { MultiLineString_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiLineString_getPrototypeOf(o); }
  23741. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  23742. * This program are made available under the terms of the Apache License, Version 2.0
  23743. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23744. /**
  23745. * @class GeometryMultiLineString
  23746. * @aliasclass Geometry.MultiLineString
  23747. * @deprecatedclass SuperMap.Geometry.MultiLineString
  23748. * @classdesc 几何对象多线类。
  23749. * @category BaseTypes Geometry
  23750. * @extends GeometryCollection
  23751. * @param {Array.<GeometryLineString>} components - GeometryLineString 数组。
  23752. * @example
  23753. * var multi = new GeometryMultiLineString([
  23754. * new GeometryLineString([
  23755. * new GeometryPoint(1, 0),
  23756. * new GeometryPoint(0, 1)
  23757. * ])
  23758. * ]);
  23759. * @usage
  23760. */
  23761. var MultiLineString = /*#__PURE__*/function (_Collection) {
  23762. MultiLineString_inherits(MultiLineString, _Collection);
  23763. var _super = MultiLineString_createSuper(MultiLineString);
  23764. function MultiLineString(components) {
  23765. var _this;
  23766. MultiLineString_classCallCheck(this, MultiLineString);
  23767. _this = _super.call(this, components);
  23768. /**
  23769. * @member {Array.<string>} [GeometryMultiLineString.prototype.componentTypes=["SuperMap.Geometry.LineString"]]
  23770. * @description components 存储的几何对象所支持的几何类型数组。
  23771. * @readonly
  23772. */
  23773. _this.componentTypes = ["SuperMap.Geometry.LineString"];
  23774. _this.CLASS_NAME = "SuperMap.Geometry.MultiLineString";
  23775. _this.geometryType = "MultiLineString";
  23776. return _this;
  23777. }
  23778. return MultiLineString_createClass(MultiLineString);
  23779. }(Collection);
  23780. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiPolygon.js
  23781. function MultiPolygon_typeof(obj) { "@babel/helpers - typeof"; return MultiPolygon_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, MultiPolygon_typeof(obj); }
  23782. function MultiPolygon_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  23783. function MultiPolygon_createClass(Constructor, protoProps, staticProps) { if (protoProps) MultiPolygon_defineProperties(Constructor.prototype, protoProps); if (staticProps) MultiPolygon_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  23784. function MultiPolygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23785. function MultiPolygon_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) MultiPolygon_setPrototypeOf(subClass, superClass); }
  23786. function MultiPolygon_setPrototypeOf(o, p) { MultiPolygon_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MultiPolygon_setPrototypeOf(o, p); }
  23787. function MultiPolygon_createSuper(Derived) { var hasNativeReflectConstruct = MultiPolygon_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MultiPolygon_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MultiPolygon_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MultiPolygon_possibleConstructorReturn(this, result); }; }
  23788. function MultiPolygon_possibleConstructorReturn(self, call) { if (call && (MultiPolygon_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return MultiPolygon_assertThisInitialized(self); }
  23789. function MultiPolygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23790. function MultiPolygon_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  23791. function MultiPolygon_getPrototypeOf(o) { MultiPolygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiPolygon_getPrototypeOf(o); }
  23792. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  23793. * This program are made available under the terms of the Apache License, Version 2.0
  23794. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23795. /**
  23796. * @class GeometryMultiPolygon
  23797. * @aliasclass Geometry.MultiPolygon
  23798. * @deprecatedclass SuperMap.Geometry.MultiPolygon
  23799. * @classdesc 几何对象多多边形类。
  23800. * @category BaseTypes Geometry
  23801. * @extends GeometryCollection
  23802. * @param {Array.<GeometryPolygon>} components - 形成 GeometryMultiPolygon 的多边形数组。
  23803. * @example
  23804. * var points1 = [new GeometryPoint(10,10),new GeometryPoint(0,0)];
  23805. * var points2 = [new GeometryPoint(10,10),new GeometryPoint(0,0),new GeometryPoint(3,3),new GeometryPoint(10,10)];
  23806. *
  23807. * var linearRing1 = new GeometryLinearRing(points1);
  23808. * var linearRing2 = new GeometryLinearRing(points2);
  23809. *
  23810. * var polygon1 = new GeometryPolygon([linearRing1]);
  23811. * var polygon2 = new GeometryPolygon([linearRing2]);
  23812. *
  23813. * var multiPolygon1 = new GeometryMultiPolygon([polygon1,polygon2]);
  23814. * @usage
  23815. */
  23816. var MultiPolygon = /*#__PURE__*/function (_Collection) {
  23817. MultiPolygon_inherits(MultiPolygon, _Collection);
  23818. var _super = MultiPolygon_createSuper(MultiPolygon);
  23819. function MultiPolygon(components) {
  23820. var _this;
  23821. MultiPolygon_classCallCheck(this, MultiPolygon);
  23822. _this = _super.call(this, components);
  23823. /**
  23824. * @member {Array.<string>} [GeometryMultiPolygon.prototype.componentTypes=["SuperMap.Geometry.Polygon"]]
  23825. * @description components 存储的几何对象所支持的几何类型数组。
  23826. * @readonly
  23827. */
  23828. _this.componentTypes = ["SuperMap.Geometry.Polygon"];
  23829. _this.CLASS_NAME = "SuperMap.Geometry.MultiPolygon";
  23830. _this.geometryType = "MultiPolygon";
  23831. return _this;
  23832. }
  23833. return MultiPolygon_createClass(MultiPolygon);
  23834. }(Collection);
  23835. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Polygon.js
  23836. function Polygon_typeof(obj) { "@babel/helpers - typeof"; return Polygon_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Polygon_typeof(obj); }
  23837. function Polygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23838. function Polygon_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  23839. function Polygon_createClass(Constructor, protoProps, staticProps) { if (protoProps) Polygon_defineProperties(Constructor.prototype, protoProps); if (staticProps) Polygon_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  23840. function Polygon_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Polygon_setPrototypeOf(subClass, superClass); }
  23841. function Polygon_setPrototypeOf(o, p) { Polygon_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Polygon_setPrototypeOf(o, p); }
  23842. function Polygon_createSuper(Derived) { var hasNativeReflectConstruct = Polygon_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Polygon_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Polygon_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Polygon_possibleConstructorReturn(this, result); }; }
  23843. function Polygon_possibleConstructorReturn(self, call) { if (call && (Polygon_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Polygon_assertThisInitialized(self); }
  23844. function Polygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23845. function Polygon_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  23846. function Polygon_getPrototypeOf(o) { Polygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Polygon_getPrototypeOf(o); }
  23847. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  23848. * This program are made available under the terms of the Apache License, Version 2.0
  23849. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23850. /**
  23851. * @class GeometryPolygon
  23852. * @aliasclass Geometry.Polygon
  23853. * @deprecatedclass SuperMap.Geometry.Polygon
  23854. * @classdesc 多边形几何对象类。
  23855. * @category BaseTypes Geometry
  23856. * @extends GeometryCollection
  23857. * @param {Array.<GeometryLinearRing>} components - 多边形的线环数组。
  23858. * @example
  23859. * var points =[new GeometryPoint(0,4010338),
  23860. * new GeometryPoint(1063524,4010338),
  23861. * new GeometryPoint(1063524,3150322),
  23862. * new GeometryPoint(0,3150322)
  23863. * ],
  23864. * var linearRings = new GeometryLinearRing(points),
  23865. * var region = new GeometryPolygon([linearRings]);
  23866. * @usage
  23867. */
  23868. var Polygon_Polygon = /*#__PURE__*/function (_Collection) {
  23869. Polygon_inherits(Polygon, _Collection);
  23870. var _super = Polygon_createSuper(Polygon);
  23871. function Polygon(components) {
  23872. var _this;
  23873. Polygon_classCallCheck(this, Polygon);
  23874. _this = _super.call(this, components);
  23875. /**
  23876. * @member {Array.<string>} [GeometryPolygon.prototype.componentTypes=["SuperMap.Geometry.LinearRing"]]
  23877. * @description components 存储的几何对象所支持的几何类型数组。
  23878. * @readonly
  23879. */
  23880. _this.componentTypes = ["SuperMap.Geometry.LinearRing"];
  23881. _this.CLASS_NAME = "SuperMap.Geometry.Polygon";
  23882. _this.geometryType = "Polygon";
  23883. return _this;
  23884. }
  23885. /**
  23886. * @function GeometryMultiPoint.prototype.getArea
  23887. * @description 获得区域面积,从区域的外部口径减去计此区域内部口径算所得的面积。
  23888. * @returns {number} 几何对象的面积。
  23889. */
  23890. Polygon_createClass(Polygon, [{
  23891. key: "getArea",
  23892. value: function getArea() {
  23893. var area = 0.0;
  23894. if (this.components && this.components.length > 0) {
  23895. area += Math.abs(this.components[0].getArea());
  23896. for (var i = 1, len = this.components.length; i < len; i++) {
  23897. area -= Math.abs(this.components[i].getArea());
  23898. }
  23899. }
  23900. return area;
  23901. }
  23902. }]);
  23903. return Polygon;
  23904. }(Collection);
  23905. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Rectangle.js
  23906. function Rectangle_typeof(obj) { "@babel/helpers - typeof"; return Rectangle_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Rectangle_typeof(obj); }
  23907. function Rectangle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23908. function Rectangle_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  23909. function Rectangle_createClass(Constructor, protoProps, staticProps) { if (protoProps) Rectangle_defineProperties(Constructor.prototype, protoProps); if (staticProps) Rectangle_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  23910. function Rectangle_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Rectangle_setPrototypeOf(subClass, superClass); }
  23911. function Rectangle_setPrototypeOf(o, p) { Rectangle_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Rectangle_setPrototypeOf(o, p); }
  23912. function Rectangle_createSuper(Derived) { var hasNativeReflectConstruct = Rectangle_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Rectangle_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Rectangle_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Rectangle_possibleConstructorReturn(this, result); }; }
  23913. function Rectangle_possibleConstructorReturn(self, call) { if (call && (Rectangle_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Rectangle_assertThisInitialized(self); }
  23914. function Rectangle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23915. function Rectangle_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  23916. function Rectangle_getPrototypeOf(o) { Rectangle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Rectangle_getPrototypeOf(o); }
  23917. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  23918. * This program are made available under the terms of the Apache License, Version 2.0
  23919. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23920. /**
  23921. * @class GeometryRectangle
  23922. * @aliasclass Geometry.Rectangle
  23923. * @deprecatedclass SuperMap.Geometry.Rectangle
  23924. * @classdesc 矩形几何对象类。
  23925. * @category BaseTypes Geometry
  23926. * @param {number} x - 矩形左下角点的横坐标。
  23927. * @param {number} y - 矩形左下角点的纵坐标。
  23928. * @param {number} width - 矩形的宽度。
  23929. * @param {number} height - 矩形的高度。
  23930. * @extends {Geometry}
  23931. * @example
  23932. * //x 为矩形左下角点的横坐标;y 为矩形左下角点的纵坐标;w 为矩形的宽度;h 为矩形的高度
  23933. * var x = 1;
  23934. * var y = 2;
  23935. * var w = 10;
  23936. * var h = 20;
  23937. * var recttangle = new GeometryRectangle(x, y, w, h);
  23938. * @usage
  23939. */
  23940. var Rectangle = /*#__PURE__*/function (_Geometry) {
  23941. Rectangle_inherits(Rectangle, _Geometry);
  23942. var _super = Rectangle_createSuper(Rectangle);
  23943. function Rectangle(x, y, width, height) {
  23944. var _this;
  23945. Rectangle_classCallCheck(this, Rectangle);
  23946. _this = _super.call(this, x, y, width, height);
  23947. /**
  23948. * @member {number} GeometryRectangle.prototype.x
  23949. * @description 矩形左下角点的横坐标。
  23950. */
  23951. _this.x = x;
  23952. /**
  23953. * @member {number} GeometryRectangle.prototype.y
  23954. * @description 矩形左下角点的纵坐标。
  23955. */
  23956. _this.y = y;
  23957. /**
  23958. * @member {number} GeometryRectangle.prototype.width
  23959. * @description 矩形的宽度。
  23960. */
  23961. _this.width = width;
  23962. /**
  23963. * @member {number} GeometryRectangle.prototype.height
  23964. * @description 矩形的高度。
  23965. */
  23966. _this.height = height;
  23967. _this.CLASS_NAME = "SuperMap.Geometry.Rectangle";
  23968. _this.geometryType = "Rectangle";
  23969. return _this;
  23970. }
  23971. /**
  23972. * @function GeometryRectangle.prototype.calculateBounds
  23973. * @description 计算出此矩形对象的 bounds。
  23974. */
  23975. Rectangle_createClass(Rectangle, [{
  23976. key: "calculateBounds",
  23977. value: function calculateBounds() {
  23978. this.bounds = new Bounds(this.x, this.y, this.x + this.width, this.y + this.height);
  23979. }
  23980. /**
  23981. * @function GeometryRectangle.prototype.getArea
  23982. * @description 获取矩形对象的面积。
  23983. * @returns {number} 矩形对象面积。
  23984. */
  23985. }, {
  23986. key: "getArea",
  23987. value: function getArea() {
  23988. var area = this.width * this.height;
  23989. return area;
  23990. }
  23991. }]);
  23992. return Rectangle;
  23993. }(Geometry_Geometry);
  23994. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/index.js
  23995. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  23996. * This program are made available under the terms of the Apache License, Version 2.0
  23997. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23998. ;// CONCATENATED MODULE: ./src/common/commontypes/Credential.js
  23999. function Credential_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24000. function Credential_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  24001. function Credential_createClass(Constructor, protoProps, staticProps) { if (protoProps) Credential_defineProperties(Constructor.prototype, protoProps); if (staticProps) Credential_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  24002. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  24003. * This program are made available under the terms of the Apache License, Version 2.0
  24004. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24005. /**
  24006. * @class Credential
  24007. * @deprecatedclass SuperMap.Credential
  24008. * @category Security
  24009. * @classdesc SuperMap 的安全证书类,其中包括 token 等安全验证信息。</br>
  24010. * 需要使用用户名和密码在:"http://localhost:8090/iserver/services/security/tokens" 下申请 value。</br>
  24011. * 获得形如:"2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ.." 的 value。</br>
  24012. * 目前支持的功能包括:地图服务、专题图、量算、查询、公交换乘、空间分析、网络分析,不支持轮询功能。</br>
  24013. * @param {string} value - 访问受安全限制的服务时用于通过安全认证的验证信息。
  24014. * @param {string} [name='token'] - 验证信息前缀,name=value 部分的 name 部分。
  24015. * @example
  24016. * var pixcel = new Credential("valueString","token");
  24017. * pixcel.destroy();
  24018. * @usage
  24019. */
  24020. var Credential = /*#__PURE__*/function () {
  24021. function Credential(value, name) {
  24022. Credential_classCallCheck(this, Credential);
  24023. /**
  24024. * @member {string} Credential.prototype.value
  24025. * @description 访问受安全限制的服务时用于通过安全认证的验证信息。
  24026. */
  24027. this.value = value ? value : "";
  24028. /**
  24029. * @member {string} [Credential.prototype.name='token']
  24030. * @description 验证信息前缀,name=value 部分的 name 部分。
  24031. */
  24032. this.name = name ? name : "token";
  24033. this.CLASS_NAME = "SuperMap.Credential";
  24034. }
  24035. /**
  24036. * @function Credential.prototype.getUrlParameters
  24037. * @description 获取 name=value 的表达式。
  24038. * @example
  24039. * var credential = new Credential("valueString","token");
  24040. * //这里 str = "token=valueString";
  24041. * var str = credential.getUrlParameters();
  24042. * @returns {string} 安全信息组成的 url 片段。
  24043. */
  24044. Credential_createClass(Credential, [{
  24045. key: "getUrlParameters",
  24046. value: function getUrlParameters() {
  24047. //当需要其他安全信息的时候,则需要return this.name + "=" + this.value + "&" + "...";的形式添加。
  24048. return this.name + "=" + this.value;
  24049. }
  24050. /**
  24051. * @function Credential.prototype.getValue
  24052. * @description 获取 value。
  24053. * @example
  24054. * var credential = new Credential("2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ..","token");
  24055. * //这里 str = "2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ..";
  24056. * var str = credential.getValue();
  24057. * @returns {string} value 字符串,在 iServer 服务下该 value 值即为 token 值。
  24058. */
  24059. }, {
  24060. key: "getValue",
  24061. value: function getValue() {
  24062. return this.value;
  24063. }
  24064. /**
  24065. *
  24066. * @function Credential.prototype.destroy
  24067. * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
  24068. * @example
  24069. * var credential = new Credential("valueString","token");
  24070. * credential.destroy();
  24071. */
  24072. }, {
  24073. key: "destroy",
  24074. value: function destroy() {
  24075. this.value = null;
  24076. this.name = null;
  24077. }
  24078. }]);
  24079. return Credential;
  24080. }();
  24081. /**
  24082. * @member {Credential} Credential.CREDENTIAL
  24083. * @description 这个对象保存一个安全类的实例,在服务端需要安全验证的时候必须进行设置。
  24084. * @example
  24085. * 代码实例:
  24086. * // 当iServer启用服务安全的时候,下边的代码是必须的。安全证书类能够接收一个value和一个name参数。
  24087. * var value = "(以iServer为例,这里是申请的token值)";
  24088. * var name = "token";
  24089. * // 默认name参数为token,所以当使用iServer服务的时候可以不进行设置。
  24090. * Credential.CREDENTIAL = new Credential(value, name);
  24091. *
  24092. */
  24093. Credential.CREDENTIAL = null;
  24094. ;// CONCATENATED MODULE: ./src/common/commontypes/Date.js
  24095. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  24096. * This program are made available under the terms of the Apache License, Version 2.0
  24097. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24098. /**
  24099. * @name Date
  24100. * @namespace
  24101. * @category BaseTypes Util
  24102. * @description 包含 parse、toISOString 方法的实现,两个方法用来解析 RFC 3339 日期,遵循 ECMAScript 5 规范。
  24103. * @private
  24104. */
  24105. var DateExt = {
  24106. /**
  24107. * @description 生成代表一个具体的日期字符串,该日期遵循 ISO 8601 标准(详情查看{@link http://tools.ietf.org/html/rfc3339})。
  24108. * @example
  24109. * var dateString = DateExt.toISOString(new Date());
  24110. * @param {Date} date - 日期对象。
  24111. * @returns {string} 一个代表日期的字符串。(例如 "2010-08-07T16:58:23.123Z")。
  24112. */
  24113. toISOString: function () {
  24114. //标准的Date会存在toISOString方法,可以直接调用
  24115. if ("toISOString" in Date.prototype) {
  24116. return function (date) {
  24117. return date.toISOString();
  24118. };
  24119. } else {
  24120. // 部分浏览器没有,就得自己组合,组合后的字符串规则不变
  24121. var pad = function pad(num, len) {
  24122. var str = num + "";
  24123. while (str.length < len) {
  24124. str = "0" + str;
  24125. }
  24126. return str;
  24127. };
  24128. return function (date) {
  24129. var str;
  24130. if (isNaN(date.getTime())) {
  24131. // ECMA-262 says throw RangeError, Firefox returns
  24132. // "Invalid Date"
  24133. str = "Invalid Date";
  24134. } else {
  24135. str = date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1, 2) + "-" + pad(date.getUTCDate(), 2) + "T" + pad(date.getUTCHours(), 2) + ":" + pad(date.getUTCMinutes(), 2) + ":" + pad(date.getUTCSeconds(), 2) + "." + pad(date.getUTCMilliseconds(), 3) + "Z";
  24136. }
  24137. return str;
  24138. };
  24139. }
  24140. }(),
  24141. /**
  24142. * @description 从一个字符串生成一个日期对象。
  24143. * @example
  24144. * var date = DateExt.parse("2010-08-07");
  24145. * @param {string} str - 日期的字符串。(例如: "2010", "2010-08", "2010-08-07", "2010-08-07T16:58:23.123Z","2010-08-07T11:58:23.123-06")。
  24146. * @returns {Date} 日期对象,如果字符串无法被解析,则返回一个无效的日期。(例如 isNaN(date.getTime()))。
  24147. */
  24148. parse: function parse(str) {
  24149. var date;
  24150. var match = str.match(/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:(?:T(\d{1,2}):(\d{2}):(\d{2}(?:\.\d+)?)(Z|(?:[+-]\d{1,2}(?::(\d{2}))?)))|Z)?$/);
  24151. if (match && (match[1] || match[7])) {
  24152. // must have at least year or time
  24153. var year = parseInt(match[1], 10) || 0;
  24154. var month = parseInt(match[2], 10) - 1 || 0;
  24155. var day = parseInt(match[3], 10) || 1;
  24156. date = new Date(Date.UTC(year, month, day));
  24157. // optional time
  24158. var type = match[7];
  24159. if (type) {
  24160. var hours = parseInt(match[4], 10);
  24161. var minutes = parseInt(match[5], 10);
  24162. var secFrac = parseFloat(match[6]);
  24163. var seconds = secFrac | 0;
  24164. var milliseconds = Math.round(1000 * (secFrac - seconds));
  24165. date.setUTCHours(hours, minutes, seconds, milliseconds);
  24166. // check offset
  24167. if (type !== "Z") {
  24168. var hoursOffset = parseInt(type, 10);
  24169. var minutesOffset = parseInt(match[8], 10) || 0;
  24170. var offset = -1000 * (60 * (hoursOffset * 60) + minutesOffset * 60);
  24171. date = new Date(date.getTime() + offset);
  24172. }
  24173. }
  24174. } else {
  24175. date = new Date("invalid");
  24176. }
  24177. return date;
  24178. }
  24179. };
  24180. ;// CONCATENATED MODULE: ./src/common/commontypes/Event.js
  24181. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  24182. * This program are made available under the terms of the Apache License, Version 2.0
  24183. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24184. /**
  24185. * @name Event
  24186. * @namespace
  24187. * @category BaseTypes Events
  24188. * @description 事件处理函数.
  24189. * @usage
  24190. * ```
  24191. * // 浏览器
  24192. * <script type="text/javascript" src="{cdn}"></script>
  24193. * <script>
  24194. * const element = {namespace}.Event.element();
  24195. *
  24196. * // 弃用的写法
  24197. * const result = SuperMap.Event.element();
  24198. *
  24199. * </script>
  24200. *
  24201. * // ES6 Import
  24202. * import { Event } from '{npm}';
  24203. *
  24204. * const result = Event.element();
  24205. * ```
  24206. */
  24207. var Event = {
  24208. /**
  24209. * @description 事件观察者列表。
  24210. * @type {Object}
  24211. * @default false
  24212. */
  24213. observers: false,
  24214. /**
  24215. * @description KEY_SPACE
  24216. * @type {number}
  24217. * @default 32
  24218. */
  24219. KEY_SPACE: 32,
  24220. /**
  24221. * @description KEY_BACKSPACE
  24222. * @type {number}
  24223. * @default 8
  24224. */
  24225. KEY_BACKSPACE: 8,
  24226. /**
  24227. * @description KEY_TAB
  24228. * @type {number}
  24229. * @default 9
  24230. */
  24231. KEY_TAB: 9,
  24232. /**
  24233. * @description KEY_RETURN
  24234. * @type {number}
  24235. * @default 13
  24236. */
  24237. KEY_RETURN: 13,
  24238. /**
  24239. * @description KEY_ESC
  24240. * @type {number}
  24241. * @default 27
  24242. */
  24243. KEY_ESC: 27,
  24244. /**
  24245. * @description KEY_LEFT
  24246. * @type {number}
  24247. * @default 37
  24248. */
  24249. KEY_LEFT: 37,
  24250. /**
  24251. * @description KEY_UP
  24252. * @type {number}
  24253. * @default 38
  24254. */
  24255. KEY_UP: 38,
  24256. /**
  24257. * @description KEY_RIGHT
  24258. * @type {number}
  24259. * @default 39
  24260. */
  24261. KEY_RIGHT: 39,
  24262. /**
  24263. * @description KEY_DOWN
  24264. * @type {number}
  24265. * @default 40
  24266. */
  24267. KEY_DOWN: 40,
  24268. /**
  24269. * @description KEY_DELETE
  24270. * @type {number}
  24271. * @default 46
  24272. */
  24273. KEY_DELETE: 46,
  24274. /**
  24275. * @description 监听浏览器 DOM 事件。
  24276. * @param {Event} event - Event 对象。
  24277. * @returns {HTMLElement} 触发事件的 DOM 元素。
  24278. */
  24279. element: function element(event) {
  24280. return event.target || event.srcElement;
  24281. },
  24282. /**
  24283. * @description 判断事件是否由单次触摸引起。
  24284. * @param {Event} event - Event 对象。
  24285. * @returns {boolean} 是否有且只有一个当前在与触摸表面接触的 Touch 对象。
  24286. */
  24287. isSingleTouch: function isSingleTouch(event) {
  24288. return event.touches && event.touches.length === 1;
  24289. },
  24290. /**
  24291. * @description 判断事件是否由多点触控引起。
  24292. * @param {Event} event - Event 对象。
  24293. * @returns {boolean} 是否存在多个当前在与触摸表面接触的 Touch 对象。
  24294. */
  24295. isMultiTouch: function isMultiTouch(event) {
  24296. return event.touches && event.touches.length > 1;
  24297. },
  24298. /**
  24299. * @description 确定事件是否由左键单击引起。
  24300. * @param {Event} event - Event 对象。
  24301. * @returns {boolean} 是否点击鼠标左键。
  24302. */
  24303. isLeftClick: function isLeftClick(event) {
  24304. return event.which && event.which === 1 || event.button && event.button === 1;
  24305. },
  24306. /**
  24307. * @description 确定事件是否由鼠标右键单击引起。
  24308. * @param {Event} event - Event 对象。
  24309. * @returns {boolean} 是否点击鼠标右键。
  24310. */
  24311. isRightClick: function isRightClick(event) {
  24312. return event.which && event.which === 3 || event.button && event.button === 2;
  24313. },
  24314. /**
  24315. * @description 阻止事件冒泡。
  24316. * @param {Event} event - Event 对象。
  24317. * @param {boolean} allowDefault - 默认为 false,表示阻止事件的默认行为。
  24318. */
  24319. stop: function stop(event, allowDefault) {
  24320. if (!allowDefault) {
  24321. if (event.preventDefault) {
  24322. event.preventDefault();
  24323. } else {
  24324. event.returnValue = false;
  24325. }
  24326. }
  24327. if (event.stopPropagation) {
  24328. event.stopPropagation();
  24329. } else {
  24330. event.cancelBubble = true;
  24331. }
  24332. },
  24333. /**
  24334. * @description 查询触发指定事件的 DOM 元素。
  24335. * @param {Event} event - Event 对象。
  24336. * @param {string} tagName - html 标签名。
  24337. * @returns {HTMLElement} DOM 元素。
  24338. */
  24339. findElement: function findElement(event, tagName) {
  24340. var element = Event.element(event);
  24341. while (element.parentNode && (!element.tagName || element.tagName.toUpperCase() != tagName.toUpperCase())) {
  24342. element = element.parentNode;
  24343. }
  24344. return element;
  24345. },
  24346. /**
  24347. * @description 监听事件,注册事件处理方法。
  24348. * @param {(HTMLElement|string)} elementParam - 待监听的 DOM 对象或者其 ID 标识。
  24349. * @param {string} name - 监听事件的类别名称。
  24350. * @param {function} observer - 注册的事件处理方法。
  24351. * @param {boolean} [useCapture=false] - 是否捕获。
  24352. */
  24353. observe: function observe(elementParam, name, observer, useCapture) {
  24354. var element = Util_Util.getElement(elementParam);
  24355. useCapture = useCapture || false;
  24356. if (name === 'keypress' && (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.attachEvent)) {
  24357. name = 'keydown';
  24358. }
  24359. //if observers cache has not yet been created, create it
  24360. if (!this.observers) {
  24361. this.observers = {};
  24362. }
  24363. //if not already assigned, make a new unique cache ID
  24364. if (!element._eventCacheID) {
  24365. var idPrefix = "eventCacheID_";
  24366. if (element.id) {
  24367. idPrefix = element.id + "_" + idPrefix;
  24368. }
  24369. element._eventCacheID = Util_Util.createUniqueID(idPrefix);
  24370. }
  24371. var cacheID = element._eventCacheID;
  24372. //if there is not yet a hash entry for this element, add one
  24373. if (!this.observers[cacheID]) {
  24374. this.observers[cacheID] = [];
  24375. }
  24376. //add a new observer to this element's list
  24377. this.observers[cacheID].push({
  24378. 'element': element,
  24379. 'name': name,
  24380. 'observer': observer,
  24381. 'useCapture': useCapture
  24382. });
  24383. //add the actual browser event listener
  24384. if (element.addEventListener) {
  24385. if (name === 'mousewheel') {
  24386. // https://www.chromestatus.com/features/6662647093133312
  24387. element.addEventListener(name, observer, {
  24388. useCapture: useCapture,
  24389. passive: false
  24390. });
  24391. } else {
  24392. element.addEventListener(name, observer, useCapture);
  24393. }
  24394. } else if (element.attachEvent) {
  24395. element.attachEvent('on' + name, observer);
  24396. }
  24397. },
  24398. /**
  24399. * @description 移除给定 DOM 元素的监听事件。
  24400. * @param {(HTMLElement|string)} elementParam - 待监听的 DOM 对象或者其 ID 标识。
  24401. */
  24402. stopObservingElement: function stopObservingElement(elementParam) {
  24403. var element = Util_Util.getElement(elementParam);
  24404. var cacheID = element._eventCacheID;
  24405. this._removeElementObservers(Event.observers[cacheID]);
  24406. },
  24407. _removeElementObservers: function _removeElementObservers(elementObservers) {
  24408. if (elementObservers) {
  24409. for (var i = elementObservers.length - 1; i >= 0; i--) {
  24410. var entry = elementObservers[i];
  24411. var args = new Array(entry.element, entry.name, entry.observer, entry.useCapture);
  24412. Event.stopObserving.apply(this, args);
  24413. }
  24414. }
  24415. },
  24416. /**
  24417. * @description 移除事件监听和注册的事件处理方法。注意:事件的移除和监听相对应,移除时的各属性信息必须监听时保持一致才能确保事件移除成功。
  24418. * @param {(HTMLElement|string)} elementParam - 被监听的 DOM 元素或者其 ID。
  24419. * @param {string} name - 需要移除的被监听事件名称。
  24420. * @param {function} observer - 需要移除的事件处理方法。
  24421. * @param {boolean} [useCapture=false] - 是否捕获。
  24422. * @returns {boolean} 监听事件是否被移除。
  24423. */
  24424. stopObserving: function stopObserving(elementParam, name, observer, useCapture) {
  24425. useCapture = useCapture || false;
  24426. var element = Util_Util.getElement(elementParam);
  24427. var cacheID = element._eventCacheID;
  24428. if (name === 'keypress') {
  24429. if (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.detachEvent) {
  24430. name = 'keydown';
  24431. }
  24432. }
  24433. // find element's entry in this.observers cache and remove it
  24434. var foundEntry = false;
  24435. var elementObservers = Event.observers[cacheID];
  24436. if (elementObservers) {
  24437. // find the specific event type in the element's list
  24438. var i = 0;
  24439. while (!foundEntry && i < elementObservers.length) {
  24440. var cacheEntry = elementObservers[i];
  24441. if (cacheEntry.name === name && cacheEntry.observer === observer && cacheEntry.useCapture === useCapture) {
  24442. elementObservers.splice(i, 1);
  24443. if (elementObservers.length == 0) {
  24444. delete Event.observers[cacheID];
  24445. }
  24446. foundEntry = true;
  24447. break;
  24448. }
  24449. i++;
  24450. }
  24451. }
  24452. //actually remove the event listener from browser
  24453. if (foundEntry) {
  24454. if (element.removeEventListener) {
  24455. element.removeEventListener(name, observer, useCapture);
  24456. } else if (element && element.detachEvent) {
  24457. element.detachEvent('on' + name, observer);
  24458. }
  24459. }
  24460. return foundEntry;
  24461. },
  24462. /**
  24463. * @description 移除缓存中的监听事件。
  24464. */
  24465. unloadCache: function unloadCache() {
  24466. // check for Event before checking for observers, because
  24467. // Event may be undefined in IE if no map instance was
  24468. // created
  24469. if (Event && Event.observers) {
  24470. for (var cacheID in Event.observers) {
  24471. var elementObservers = Event.observers[cacheID];
  24472. Event._removeElementObservers.apply(this, [elementObservers]);
  24473. }
  24474. Event.observers = false;
  24475. }
  24476. },
  24477. CLASS_NAME: "SuperMap.Event"
  24478. };
  24479. /* prevent memory leaks in IE */
  24480. Event.observe(window, 'resize', Event.unloadCache, false);
  24481. ;// CONCATENATED MODULE: ./src/common/commontypes/Events.js
  24482. function Events_typeof(obj) { "@babel/helpers - typeof"; return Events_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Events_typeof(obj); }
  24483. function Events_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24484. function Events_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  24485. function Events_createClass(Constructor, protoProps, staticProps) { if (protoProps) Events_defineProperties(Constructor.prototype, protoProps); if (staticProps) Events_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  24486. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  24487. * This program are made available under the terms of the Apache License, Version 2.0
  24488. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24489. /**
  24490. * @class Events
  24491. * @deprecatedclass SuperMap.Events
  24492. * @classdesc 事件类。
  24493. * @category BaseTypes Events
  24494. * @param {Object} object - 当前事件对象被添加到的 JS 对象。
  24495. * @param {HTMLElement} element - 响应浏览器事件的 DOM 元素。
  24496. * @param {Array.<string>} eventTypes - 自定义应用事件的数组。
  24497. * @param {boolean} [fallThrough=false] - 是否允许事件处理之后向上传递(冒泡),为 false 的时候阻止事件冒泡。
  24498. * @param {Object} options - 事件对象选项。
  24499. * @usage
  24500. */
  24501. var Events = /*#__PURE__*/function () {
  24502. function Events(object, element, eventTypes, fallThrough, options) {
  24503. Events_classCallCheck(this, Events);
  24504. /**
  24505. * @member {Array.<string>} Events.prototype.BROWSER_EVENTS
  24506. * @description 支持的事件。
  24507. * @constant
  24508. * @default [
  24509. "mouseover", "mouseout","mousedown", "mouseup", "mousemove",
  24510. "click", "dblclick", "rightclick", "dblrightclick","resize",
  24511. "focus", "blur","touchstart", "touchmove", "touchend","keydown",
  24512. "MSPointerDown", "MSPointerUp", "pointerdown", "pointerup",
  24513. "MSGestureStart", "MSGestureChange", "MSGestureEnd","contextmenu"
  24514. ]
  24515. */
  24516. this.BROWSER_EVENTS = ["mouseover", "mouseout", "mousedown", "mouseup", "mousemove", "click", "dblclick", "rightclick", "dblrightclick", "resize", "focus", "blur", "touchstart", "touchmove", "touchend", "keydown", "MSPointerDown", "MSPointerUp", "pointerdown", "pointerup", "MSGestureStart", "MSGestureChange", "MSGestureEnd", "contextmenu"];
  24517. /**
  24518. * @member {Object} Events.prototype.listeners
  24519. * @description 事件监听器函数。
  24520. */
  24521. this.listeners = {};
  24522. /**
  24523. * @member {Object} Events.prototype.object
  24524. * @description 发布应用程序事件的对象。
  24525. */
  24526. this.object = object;
  24527. /**
  24528. * @member {HTMLElement} Events.prototype.element
  24529. * @description 接受浏览器事件的 DOM 节点。
  24530. */
  24531. this.element = null;
  24532. /**
  24533. * @member {Array.<string>} Events.prototype.eventTypes
  24534. * @description 支持的事件类型列表。
  24535. */
  24536. this.eventTypes = [];
  24537. /**
  24538. * @member {function} Events.prototype.eventHandler
  24539. * @description 绑定在元素上的事件处理器对象。
  24540. */
  24541. this.eventHandler = null;
  24542. /**
  24543. * @member {boolean} [Events.prototype.fallThrough=false]
  24544. * @description 是否允许事件处理之后向上传递(冒泡),为 false 的时候阻止事件冒泡。
  24545. */
  24546. this.fallThrough = fallThrough;
  24547. /**
  24548. * @member {boolean} [Events.prototype.includeXY=false]
  24549. * @description 判断是否让 xy 属性自动创建到浏览器上的鼠标事件,一般设置为 false,如果设置为 true,鼠标事件将会在事件传递过程中自动产生 xy 属性。可根据事件对象的 'evt.object' 属性在相关的事件句柄上调用 getMousePosition 函数。这个选项习惯默认为 false 的原因在于,当创建一个事件对象,其主要目的是管理。在一个 div 的相对定位的鼠标事件,将其设为 true 也是有意义的。这个选项也可以用来控制是否抵消缓存。如果设为 false 不抵消,如果设为 true,用 this.clearMouseCache() 清除缓存偏移(边界元素偏移,元素在页面的位置偏移)。
  24550. * @example
  24551. * function named(evt) {
  24552. * this.xy = this.object.events.getMousePosition(evt);
  24553. * }
  24554. */
  24555. this.includeXY = false;
  24556. /**
  24557. * @member {Object} Events.prototype.extensions
  24558. * @description 事件扩展。Keys 代表事件类型,values 代表事件对象。
  24559. */
  24560. this.extensions = {};
  24561. /**
  24562. * @member {Object} Events.prototype.extensionCount
  24563. * @description 事件扩展数量。
  24564. */
  24565. this.extensionCount = {};
  24566. /**
  24567. * @member {Object} Events.prototype.clearMouseListener
  24568. * @description 待移除的鼠标监听事件。
  24569. */
  24570. this.clearMouseListener = null;
  24571. Util_Util.extend(this, options);
  24572. if (eventTypes != null) {
  24573. for (var i = 0, len = eventTypes.length; i < len; i++) {
  24574. this.addEventType(eventTypes[i]);
  24575. }
  24576. }
  24577. if (element != null) {
  24578. this.attachToElement(element);
  24579. }
  24580. this.CLASS_NAME = "SuperMap.Events";
  24581. }
  24582. /**
  24583. * @function Events.prototype.destroy
  24584. * @description 移除当前要素 element 上的所有事件监听和处理。
  24585. */
  24586. Events_createClass(Events, [{
  24587. key: "destroy",
  24588. value: function destroy() {
  24589. for (var e in this.extensions) {
  24590. if (typeof this.extensions[e] !== "boolean") {
  24591. this.extensions[e].destroy();
  24592. }
  24593. }
  24594. this.extensions = null;
  24595. if (this.element) {
  24596. Event.stopObservingElement(this.element);
  24597. if (this.element.hasScrollEvent) {
  24598. Event.stopObserving(window, "scroll", this.clearMouseListener);
  24599. }
  24600. }
  24601. this.element = null;
  24602. this.listeners = null;
  24603. this.object = null;
  24604. this.eventTypes = null;
  24605. this.fallThrough = null;
  24606. this.eventHandler = null;
  24607. }
  24608. /**
  24609. * @function Events.prototype.addEventType
  24610. * @description 在此事件对象中添加新的事件类型,如果这个事件类型已经添加过了,则不做任何事情。
  24611. * @param {string} eventName - 事件名。
  24612. */
  24613. }, {
  24614. key: "addEventType",
  24615. value: function addEventType(eventName) {
  24616. if (!this.listeners[eventName]) {
  24617. this.eventTypes.push(eventName);
  24618. this.listeners[eventName] = [];
  24619. }
  24620. }
  24621. /**
  24622. * @function Events.prototype.attachToElement
  24623. * @description 给 DOM 元素绑定浏览器事件。
  24624. * @param {HTMLElement} element - 绑定浏览器事件的 DOM 元素。
  24625. */
  24626. }, {
  24627. key: "attachToElement",
  24628. value: function attachToElement(element) {
  24629. if (this.element) {
  24630. Event.stopObservingElement(this.element);
  24631. } else {
  24632. // keep a bound copy of handleBrowserEvent() so that we can
  24633. // pass the same function to both Event.observe() and .stopObserving()
  24634. this.eventHandler = FunctionExt.bindAsEventListener(this.handleBrowserEvent, this);
  24635. // to be used with observe and stopObserving
  24636. this.clearMouseListener = FunctionExt.bind(this.clearMouseCache, this);
  24637. }
  24638. this.element = element;
  24639. for (var i = 0, len = this.BROWSER_EVENTS.length; i < len; i++) {
  24640. var eventType = this.BROWSER_EVENTS[i];
  24641. // every browser event has a corresponding application event
  24642. // (whether it's listened for or not).
  24643. this.addEventType(eventType);
  24644. // use Prototype to register the event cross-browser
  24645. Event.observe(element, eventType, this.eventHandler);
  24646. }
  24647. // disable dragstart in IE so that mousedown/move/up works normally
  24648. Event.observe(element, "dragstart", Event.stop);
  24649. }
  24650. /**
  24651. * @function Events.prototype.on
  24652. * @description 在一个相同的范围内注册监听器的方法,此方法调用 register 函数。
  24653. * @example
  24654. * // 注册一个 "loadstart" 监听事件
  24655. * events.on({"loadstart": loadStartListener});
  24656. *
  24657. * // 同样注册一个 "loadstart" 监听事件
  24658. * events.register("loadstart", undefined, loadStartListener);
  24659. *
  24660. * // 同时为对象注册多个监听事件
  24661. * events.on({
  24662. * "loadstart": loadStartListener,
  24663. * "loadend": loadEndListener,
  24664. * scope: object
  24665. * });
  24666. *
  24667. * // 同时为对象注册多个监听事件,多次调用 register 方法
  24668. * events.register("loadstart", object, loadStartListener);
  24669. * events.register("loadend", object, loadEndListener);
  24670. *
  24671. *
  24672. * @param {Object} object - 添加监听的对象。
  24673. */
  24674. }, {
  24675. key: "on",
  24676. value: function on(object) {
  24677. for (var type in object) {
  24678. if (type !== "scope" && object.hasOwnProperty(type)) {
  24679. this.register(type, object.scope, object[type]);
  24680. }
  24681. }
  24682. }
  24683. /**
  24684. * @function Events.prototype.register
  24685. * @description 在事件对象上注册一个事件。当事件被触发时,'func' 函数被调用,假设我们触发一个事件,
  24686. * 指定 Bounds 作为 "obj",当事件被触发时,回调函数的上下文作为 Bounds 对象。
  24687. * @param {string} type - 事件注册者的名字。
  24688. * @param {Object} [obj=this.object] - 对象绑定的回调。
  24689. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  24690. * @param {(boolean|Object)} [priority] - 当为 true 时将新的监听加在事件队列的前面。
  24691. */
  24692. }, {
  24693. key: "register",
  24694. value: function register(type, obj, func, priority) {
  24695. if (type in Events && !this.extensions[type]) {
  24696. this.extensions[type] = new Events[type](this);
  24697. }
  24698. if (func != null && Util_Util.indexOf(this.eventTypes, type) !== -1) {
  24699. if (obj == null) {
  24700. obj = this.object;
  24701. }
  24702. var listeners = this.listeners[type];
  24703. if (!listeners) {
  24704. listeners = [];
  24705. this.listeners[type] = listeners;
  24706. this.extensionCount[type] = 0;
  24707. }
  24708. var listener = {
  24709. obj: obj,
  24710. func: func
  24711. };
  24712. if (priority) {
  24713. listeners.splice(this.extensionCount[type], 0, listener);
  24714. if (Events_typeof(priority) === "object" && priority.extension) {
  24715. this.extensionCount[type]++;
  24716. }
  24717. } else {
  24718. listeners.push(listener);
  24719. }
  24720. }
  24721. }
  24722. /**
  24723. * @function Events.prototype.registerPriority
  24724. * @description 相同的注册方法,但是在前面增加新的监听者事件查询而代替到方法的结束。
  24725. * @param {string} type - 事件注册者的名字。
  24726. * @param {Object} [obj=this.object] - 对象绑定的回调。
  24727. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  24728. */
  24729. }, {
  24730. key: "registerPriority",
  24731. value: function registerPriority(type, obj, func) {
  24732. this.register(type, obj, func, true);
  24733. }
  24734. /**
  24735. * @function Events.prototype.un
  24736. * @description 在一个相同的范围内取消注册监听器的方法,此方法调用 unregister 函数。
  24737. * @example
  24738. * // 移除 "loadstart" 事件监听
  24739. * events.un({"loadstart": loadStartListener});
  24740. *
  24741. * // 使用 "unregister" 方法移除 "loadstart" 事件监听
  24742. * events.unregister("loadstart", undefined, loadStartListener);
  24743. *
  24744. * // 取消对象多个事件监听
  24745. * events.un({
  24746. * "loadstart": loadStartListener,
  24747. * "loadend": loadEndListener,
  24748. * scope: object
  24749. * });
  24750. *
  24751. * // 取消对象多个事件监听,多次调用unregister方法。
  24752. * events.unregister("loadstart", object, loadStartListener);
  24753. * events.unregister("loadend", object, loadEndListener);
  24754. *
  24755. * @param {Object} object - 移除监听的对象。
  24756. */
  24757. }, {
  24758. key: "un",
  24759. value: function un(object) {
  24760. for (var type in object) {
  24761. if (type !== "scope" && object.hasOwnProperty(type)) {
  24762. this.unregister(type, object.scope, object[type]);
  24763. }
  24764. }
  24765. }
  24766. /**
  24767. * @function Events.prototype.unregister
  24768. * @description 取消注册。
  24769. * @param {string} type - 事件类型。
  24770. * @param {Object} [obj=this.object] - 对象绑定的回调。
  24771. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  24772. */
  24773. }, {
  24774. key: "unregister",
  24775. value: function unregister(type, obj, func) {
  24776. if (obj == null) {
  24777. obj = this.object;
  24778. }
  24779. var listeners = this.listeners[type];
  24780. if (listeners != null) {
  24781. for (var i = 0, len = listeners.length; i < len; i++) {
  24782. if (listeners[i].obj === obj && listeners[i].func === func) {
  24783. listeners.splice(i, 1);
  24784. break;
  24785. }
  24786. }
  24787. }
  24788. }
  24789. /**
  24790. * @function Events.prototype.remove
  24791. * @description 删除某个事件类型的所有监听,如果该事件类型没有注册,则不做任何操作。
  24792. * @param {string} type - 事件类型。
  24793. */
  24794. }, {
  24795. key: "remove",
  24796. value: function remove(type) {
  24797. if (this.listeners[type] != null) {
  24798. this.listeners[type] = [];
  24799. }
  24800. }
  24801. /**
  24802. * @function Events.prototype.triggerEvent
  24803. * @description 触发一个特定的注册事件。
  24804. * @param {string} type - 触发事件类型。
  24805. * @param {Event} evt - 事件对象。
  24806. * @returns {Event|boolean} 监听对象,如果返回是 false,则停止监听。
  24807. */
  24808. }, {
  24809. key: "triggerEvent",
  24810. value: function triggerEvent(type, evt) {
  24811. var listeners = this.listeners[type];
  24812. // fast path
  24813. if (!listeners || listeners.length == 0) {
  24814. return undefined;
  24815. }
  24816. // prep evt object with object & div references
  24817. if (evt == null) {
  24818. evt = {};
  24819. }
  24820. evt.object = this.object;
  24821. evt.element = this.element;
  24822. if (!evt.type) {
  24823. evt.type = type;
  24824. }
  24825. // execute all callbacks registered for specified type
  24826. // get a clone of the listeners array to
  24827. // allow for splicing during callbacks
  24828. listeners = listeners.slice();
  24829. var continueChain;
  24830. for (var i = 0, len = listeners.length; i < len; i++) {
  24831. var callback = listeners[i];
  24832. // bind the context to callback.obj
  24833. continueChain = callback.func.apply(callback.obj, [evt]);
  24834. if (continueChain != undefined && continueChain === false) {
  24835. // if callback returns false, execute no more callbacks.
  24836. break;
  24837. }
  24838. }
  24839. // don't fall through to other DOM elements
  24840. if (!this.fallThrough) {
  24841. Event.stop(evt, true);
  24842. }
  24843. return continueChain;
  24844. }
  24845. /**
  24846. * @function Events.prototype.handleBrowserEvent
  24847. * @description 对 triggerEvent 函数的包装,给事件对象设置了 xy 属性(即当前鼠标点的 xy 坐标)。
  24848. * @param {Event} evt - 事件对象。
  24849. */
  24850. }, {
  24851. key: "handleBrowserEvent",
  24852. value: function handleBrowserEvent(evt) {
  24853. var type = evt.type,
  24854. listeners = this.listeners[type];
  24855. if (!listeners || listeners.length == 0) {
  24856. // noone's listening, bail out
  24857. return;
  24858. }
  24859. // add clientX & clientY to all events - corresponds to average x, y
  24860. var touches = evt.touches;
  24861. if (touches && touches[0]) {
  24862. var x = 0;
  24863. var y = 0;
  24864. var num = touches.length;
  24865. var touch;
  24866. for (var i = 0; i < num; ++i) {
  24867. touch = touches[i];
  24868. x += touch.clientX;
  24869. y += touch.clientY;
  24870. }
  24871. evt.clientX = x / num;
  24872. evt.clientY = y / num;
  24873. }
  24874. if (this.includeXY) {
  24875. evt.xy = this.getMousePosition(evt);
  24876. }
  24877. this.triggerEvent(type, evt);
  24878. }
  24879. /**
  24880. * @function Events.prototype.clearMouseCache
  24881. * @description 清除鼠标缓存。
  24882. */
  24883. }, {
  24884. key: "clearMouseCache",
  24885. value: function clearMouseCache() {
  24886. this.element.scrolls = null;
  24887. this.element.lefttop = null;
  24888. var body = document.body;
  24889. if (body && !((body.scrollTop != 0 || body.scrollLeft != 0) && navigator.userAgent.match(/iPhone/i))) {
  24890. this.element.offsets = null;
  24891. }
  24892. }
  24893. /**
  24894. * @function Events.prototype.getMousePosition
  24895. * @description 获取当前鼠标的位置。
  24896. * @param {Event} evt - 事件对象。
  24897. * @returns {Pixel} 当前的鼠标的 xy 坐标点。
  24898. */
  24899. }, {
  24900. key: "getMousePosition",
  24901. value: function getMousePosition(evt) {
  24902. if (!this.includeXY) {
  24903. this.clearMouseCache();
  24904. } else if (!this.element.hasScrollEvent) {
  24905. Event.observe(window, "scroll", this.clearMouseListener);
  24906. this.element.hasScrollEvent = true;
  24907. }
  24908. if (!this.element.scrolls) {
  24909. var viewportElement = Util_Util.getViewportElement();
  24910. this.element.scrolls = [viewportElement.scrollLeft, viewportElement.scrollTop];
  24911. }
  24912. if (!this.element.lefttop) {
  24913. this.element.lefttop = [document.documentElement.clientLeft || 0, document.documentElement.clientTop || 0];
  24914. }
  24915. if (!this.element.offsets) {
  24916. this.element.offsets = Util_Util.pagePosition(this.element);
  24917. }
  24918. return new Pixel(evt.clientX + this.element.scrolls[0] - this.element.offsets[0] - this.element.lefttop[0], evt.clientY + this.element.scrolls[1] - this.element.offsets[1] - this.element.lefttop[1]);
  24919. }
  24920. }]);
  24921. return Events;
  24922. }();
  24923. Events.prototype.BROWSER_EVENTS = ["mouseover", "mouseout", "mousedown", "mouseup", "mousemove", "click", "dblclick", "rightclick", "dblrightclick", "resize", "focus", "blur", "touchstart", "touchmove", "touchend", "keydown", "MSPointerDown", "MSPointerUp", "pointerdown", "pointerup", "MSGestureStart", "MSGestureChange", "MSGestureEnd", "contextmenu"];
  24924. ;// CONCATENATED MODULE: ./src/common/commontypes/Feature.js
  24925. function Feature_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24926. function Feature_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  24927. function Feature_createClass(Constructor, protoProps, staticProps) { if (protoProps) Feature_defineProperties(Constructor.prototype, protoProps); if (staticProps) Feature_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  24928. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  24929. * This program are made available under the terms of the Apache License, Version 2.0
  24930. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24931. /**
  24932. * @class Feature
  24933. * @deprecatedclass SuperMap.Feature
  24934. * @category BaseTypes Geometry
  24935. * @classdesc 要素类组合了地理和属性,Feature 类同时具有 marker 和 lonlat 属性。
  24936. * @param {SuperMap.Layer} layer - 图层。
  24937. * @param {LonLat} lonlat - 经纬度。
  24938. * @param {Object} data - 数据对象。
  24939. * @usage
  24940. */
  24941. var Feature_Feature = /*#__PURE__*/function () {
  24942. function Feature(layer, lonlat, data) {
  24943. Feature_classCallCheck(this, Feature);
  24944. this.CLASS_NAME = "SuperMap.Feature";
  24945. /**
  24946. * @deprecated
  24947. * @member {SuperMap.Layer} Feature.prototype.layer
  24948. * @description 图层。
  24949. */
  24950. this.layer = layer;
  24951. /**
  24952. * @member {string} Feature.prototype.id
  24953. * @description 要素 ID。
  24954. */
  24955. this.id = Util_Util.createUniqueID(this.CLASS_NAME + "_");
  24956. /**
  24957. * @member {LonLat} Feature.prototype.lonlat
  24958. * @description 经纬度。
  24959. *
  24960. */
  24961. this.lonlat = lonlat;
  24962. /**
  24963. * @member {Object} Feature.prototype.data
  24964. * @description 数据对象。
  24965. */
  24966. this.data = data != null ? data : {};
  24967. }
  24968. /**
  24969. * @function Feature.prototype.destroy
  24970. * @description 释放相关资源。
  24971. */
  24972. Feature_createClass(Feature, [{
  24973. key: "destroy",
  24974. value: function destroy() {
  24975. this.id = null;
  24976. this.lonlat = null;
  24977. this.data = null;
  24978. }
  24979. }]);
  24980. return Feature;
  24981. }();
  24982. ;// CONCATENATED MODULE: ./src/common/commontypes/Vector.js
  24983. function Vector_typeof(obj) { "@babel/helpers - typeof"; return Vector_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Vector_typeof(obj); }
  24984. function Vector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24985. function Vector_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  24986. function Vector_createClass(Constructor, protoProps, staticProps) { if (protoProps) Vector_defineProperties(Constructor.prototype, protoProps); if (staticProps) Vector_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  24987. function Vector_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Vector_get = Reflect.get.bind(); } else { Vector_get = function _get(target, property, receiver) { var base = Vector_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Vector_get.apply(this, arguments); }
  24988. function Vector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Vector_getPrototypeOf(object); if (object === null) break; } return object; }
  24989. function Vector_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Vector_setPrototypeOf(subClass, superClass); }
  24990. function Vector_setPrototypeOf(o, p) { Vector_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Vector_setPrototypeOf(o, p); }
  24991. function Vector_createSuper(Derived) { var hasNativeReflectConstruct = Vector_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Vector_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Vector_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Vector_possibleConstructorReturn(this, result); }; }
  24992. function Vector_possibleConstructorReturn(self, call) { if (call && (Vector_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Vector_assertThisInitialized(self); }
  24993. function Vector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24994. function Vector_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  24995. function Vector_getPrototypeOf(o) { Vector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Vector_getPrototypeOf(o); }
  24996. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  24997. * This program are made available under the terms of the Apache License, Version 2.0
  24998. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24999. /**
  25000. * @class FeatureVector
  25001. * @aliasclass Feature.Vector
  25002. * @deprecatedclass SuperMap.Feature.Vector
  25003. * @category BaseTypes Geometry
  25004. * @classdesc 矢量要素类。该类具有 Geometry 属性存放几何信息,
  25005. * attributes 属性存放非几何信息,另外还包含了 style 属性,用来定义矢量要素的样式,
  25006. * 其中,默认的样式在 {@link FeatureVector.style} 类中定义,如果没有特别的指定将使用默认的样式。
  25007. * @extends {Feature}
  25008. * @param {Geometry} geometry - 要素的几何信息。
  25009. * @param {Object} [attributes] - 描述要素的任意的可序列化属性,将要映射到 attributes 属性中的对象。
  25010. * @param {Object} [style] - 样式对象。
  25011. * @example
  25012. * var geometry = new GeometryPoint(-115,10);
  25013. * var style = {
  25014. * strokeColor:"#339933",
  25015. * strokeOpacity:1,
  25016. * strokeWidth:3,
  25017. * pointRadius:6
  25018. * }
  25019. * var pointFeature = new FeatureVector(geometry,null,style);
  25020. * vectorLayer.addFeatures(pointFeature);
  25021. * @usage
  25022. */
  25023. // TRASH THIS
  25024. var State = {
  25025. /** states */
  25026. UNKNOWN: 'Unknown',
  25027. INSERT: 'Insert',
  25028. UPDATE: 'Update',
  25029. DELETE: 'Delete'
  25030. };
  25031. var Vector = /*#__PURE__*/function (_Feature) {
  25032. Vector_inherits(Vector, _Feature);
  25033. var _super = Vector_createSuper(Vector);
  25034. function Vector(geometry, attributes, style) {
  25035. var _this;
  25036. Vector_classCallCheck(this, Vector);
  25037. _this = _super.call(this, null, null, attributes);
  25038. /**
  25039. * @member {string} FeatureVector.prototype.fid
  25040. * @description fid。
  25041. */
  25042. _this.fid = null;
  25043. /**
  25044. * @member {Geometry} FeatureVector.prototype.geometry
  25045. * @description 存放几何信息。
  25046. */
  25047. _this.geometry = geometry ? geometry : null;
  25048. /**
  25049. * @member {Object} FeatureVector.prototype.attributes
  25050. * @description 描述要素的任意的可序列化属性。
  25051. */
  25052. _this.attributes = {};
  25053. if (attributes) {
  25054. _this.attributes = Util_Util.extend(_this.attributes, attributes);
  25055. }
  25056. /**
  25057. * @member {Bounds} FeatureVector.prototype.bounds
  25058. * @description 限制要素几何的边界。
  25059. */
  25060. _this.bounds = null;
  25061. /**
  25062. * @member {string} FeatureVector.prototype.state
  25063. * @description state。
  25064. */
  25065. _this.state = null;
  25066. /**
  25067. * @member {Object} FeatureVector.prototype.style
  25068. * @description 要素的样式属性,地图查询返回的 feature 的 style,8C 变为null。
  25069. */
  25070. _this.style = style ? style : null;
  25071. /**
  25072. * @member {string} FeatureVector.prototype.url
  25073. * @description 如果设置了这个属性,在更新或者删除要素时需要考虑 {@link HTTP} 。
  25074. */
  25075. _this.url = null;
  25076. _this.lonlat = null;
  25077. _this.CLASS_NAME = "SuperMap.Feature.Vector";
  25078. Vector.style = {
  25079. 'default': {
  25080. fillColor: "#ee9900",
  25081. fillOpacity: 0.4,
  25082. hoverFillColor: "white",
  25083. hoverFillOpacity: 0.8,
  25084. strokeColor: "#ee9900",
  25085. strokeOpacity: 1,
  25086. strokeWidth: 1,
  25087. strokeLinecap: "round",
  25088. strokeDashstyle: "solid",
  25089. hoverStrokeColor: "red",
  25090. hoverStrokeOpacity: 1,
  25091. hoverStrokeWidth: 0.2,
  25092. pointRadius: 6,
  25093. hoverPointRadius: 1,
  25094. hoverPointUnit: "%",
  25095. pointerEvents: "visiblePainted",
  25096. cursor: "inherit",
  25097. fontColor: "#000000",
  25098. labelAlign: "cm",
  25099. labelOutlineColor: "white",
  25100. labelOutlineWidth: 3
  25101. },
  25102. 'select': {
  25103. fillColor: "blue",
  25104. fillOpacity: 0.4,
  25105. hoverFillColor: "white",
  25106. hoverFillOpacity: 0.8,
  25107. strokeColor: "blue",
  25108. strokeOpacity: 1,
  25109. strokeWidth: 2,
  25110. strokeLinecap: "round",
  25111. strokeDashstyle: "solid",
  25112. hoverStrokeColor: "red",
  25113. hoverStrokeOpacity: 1,
  25114. hoverStrokeWidth: 0.2,
  25115. pointRadius: 6,
  25116. hoverPointRadius: 1,
  25117. hoverPointUnit: "%",
  25118. pointerEvents: "visiblePainted",
  25119. cursor: "pointer",
  25120. fontColor: "#000000",
  25121. labelAlign: "cm",
  25122. labelOutlineColor: "white",
  25123. labelOutlineWidth: 3
  25124. },
  25125. 'temporary': {
  25126. fillColor: "#66cccc",
  25127. fillOpacity: 0.2,
  25128. hoverFillColor: "white",
  25129. hoverFillOpacity: 0.8,
  25130. strokeColor: "#66cccc",
  25131. strokeOpacity: 1,
  25132. strokeLinecap: "round",
  25133. strokeWidth: 2,
  25134. strokeDashstyle: "solid",
  25135. hoverStrokeColor: "red",
  25136. hoverStrokeOpacity: 1,
  25137. hoverStrokeWidth: 0.2,
  25138. pointRadius: 6,
  25139. hoverPointRadius: 1,
  25140. hoverPointUnit: "%",
  25141. pointerEvents: "visiblePainted",
  25142. //cursor:"inherit",
  25143. cursor: "default",
  25144. fontColor: "#000000",
  25145. labelAlign: "cm",
  25146. labelOutlineColor: "white",
  25147. labelOutlineWidth: 3
  25148. },
  25149. 'delete': {
  25150. display: "none"
  25151. }
  25152. };
  25153. return _this;
  25154. }
  25155. /**
  25156. * @function FeatureVector.prototype.destroy
  25157. * @description 释放资源,将引用资源的属性置空。
  25158. */
  25159. Vector_createClass(Vector, [{
  25160. key: "destroy",
  25161. value: function destroy() {
  25162. if (this.layer) {
  25163. this.layer.removeFeatures(this);
  25164. this.layer = null;
  25165. }
  25166. this.geometry = null;
  25167. Vector_get(Vector_getPrototypeOf(Vector.prototype), "destroy", this).call(this);
  25168. }
  25169. /**
  25170. * @function FeatureVector.prototype.clone
  25171. * @description 复制矢量要素,并返回复制后的新对象。
  25172. * @returns {FeatureVector} 相同要素的新的矢量要素。
  25173. */
  25174. }, {
  25175. key: "clone",
  25176. value: function clone() {
  25177. return new Vector(this.geometry ? this.geometry.clone() : null, this.attributes, this.style);
  25178. }
  25179. /**
  25180. * @function FeatureVector.prototype.toState
  25181. * @description 设置新状态。
  25182. * @param {string} state - 状态。
  25183. */
  25184. }, {
  25185. key: "toState",
  25186. value: function toState(state) {
  25187. if (state === State.UPDATE) {
  25188. switch (this.state) {
  25189. case State.UNKNOWN:
  25190. case State.DELETE:
  25191. this.state = state;
  25192. break;
  25193. case State.UPDATE:
  25194. case State.INSERT:
  25195. break;
  25196. }
  25197. } else if (state === State.INSERT) {
  25198. switch (this.state) {
  25199. case State.UNKNOWN:
  25200. break;
  25201. default:
  25202. this.state = state;
  25203. break;
  25204. }
  25205. } else if (state === State.DELETE) {
  25206. switch (this.state) {
  25207. case State.INSERT:
  25208. // the feature should be destroyed
  25209. break;
  25210. case State.DELETE:
  25211. break;
  25212. case State.UNKNOWN:
  25213. case State.UPDATE:
  25214. this.state = state;
  25215. break;
  25216. }
  25217. } else if (state === State.UNKNOWN) {
  25218. this.state = state;
  25219. }
  25220. }
  25221. }]);
  25222. return Vector;
  25223. }(Feature_Feature);
  25224. /**
  25225. *
  25226. * @typedef {Object} FeatureVector.style
  25227. * @description Feature 有大量的样式属性,如果没有特别的指定将使用默认的样式,
  25228. * 大部分样式通过 SVG 标准定义属性。
  25229. * - fill properties 资料介绍:{@link http://www.w3.org/TR/SVG/painting.html#FillProperties}
  25230. * - stroke properties 资料介绍:{@link http://www.w3.org/TR/SVG/painting.html#StrokeProperties}
  25231. * @property {boolean} [fill] - 不需要填充则设置为 false。
  25232. * @property {string} [fillColor='#ee9900'] - 十六进制填充颜色。
  25233. * @property {number} [fillOpacity=0.4] - 填充不透明度。
  25234. * @property {boolean} [stroke] - 不需要描边则设为 false。
  25235. * @property {string} [strokeColor='#ee9900'] - 十六进制描边颜色。
  25236. * @property {number} [strokeOpacity=0.4] - 描边的不透明度(0-1)。
  25237. * @property {number} [strokeWidth=1] - 像素描边宽度。
  25238. * @property {string} [strokeLinecap='round'] - strokeLinecap 有三种类型 butt,round,square。
  25239. * @property {string} [strokeDashstyle='solid'] - 有 dot,dash,dashdot,longdash,longdashdot,solid 几种样式。
  25240. * @property {boolean} [graphic] - 不需要则设置为 false。
  25241. * @property {number} [pointRadius=6] - 像素点半径。
  25242. * @property {string} [pointerEvents='visiblePainted'] - pointerEvents。
  25243. * @property {string} [cursor] - cursor。
  25244. * @property {boolean} [allowRotate='false'] - 是否允许图标随着运行方向旋转。用于时空数据图层。
  25245. * @property {string} [externalGraphic] - 连接到用来渲染点的外部的图形。
  25246. * @property {number} [graphicWidth] - 外部图表的像素宽度。
  25247. * @property {number} [graphicHeight] - 外部图表的像素高度。
  25248. * @property {number} [graphicOpacity] - 外部图表的不透明度(0-1)。
  25249. * @property {number} [graphicXOffset] - 外部图表沿着x方向的偏移量。
  25250. * @property {number} [graphicYOffset] - 外部图表沿着y方向的偏移量。
  25251. * @property {number} [rotation] - 一个图表沿着其中心点(或者偏移中心指定点)在顺时针方向旋转。
  25252. * @property {number} [graphicZIndex] - 渲染时使用的索引值。
  25253. * @property {string} [graphicName='circle'] - 渲染点时图标使用的名字。支持"circle" , "square", "star", "x", "cross", "triangle"。
  25254. * @property {string} [graphicTitle] - 外部图表的提示框。
  25255. * @property {string} [backgroundGraphic] - 外部图表的背景。
  25256. * @property {number} [backgroundGraphicZIndex] - 背景图渲染时使用的索引值。
  25257. * @property {number} [backgroundXOffset] - 背景图在 x 轴的偏移量。
  25258. * @property {number} [backgroundYOffset] - 背景图在 y 轴的偏移量。
  25259. * @property {number} [backgroundHeight] - 背景图的高度。如果没有设置,将用 graphicHeight。
  25260. * @property {number} [backgroundWidth] - 背景图的宽度。如果没有设置,将用 graphicWidth。
  25261. * @property {boolean} [isUnicode=false] - 这个属性要配合 label 属性来用,当为 true时,label 就可以使用 unicode 编码,
  25262. * 比如 "a" 的 unicode 十六进制编码为 61,则 label 属性可以为 "&#x61;",其中 "&#" 为前缀,标志这个为 unicode 编码,
  25263. * "x" 是指 16 进制,这时页面显示的是 "a";当此值为 false 的时候,label 的内容会被直接输出,
  25264. * 比如,label 为 "&#x61;",这时页面显示的也是 "&#x61;"。
  25265. * @property {string} [label] - 可选的标签文本。
  25266. * @property {string} [labelAlign='cm'] - 标签对齐,是由两个字符组成的字符串,如:"lt", "cm", "rb",
  25267. * 其中第一个字符代表水平方向上的对齐,"l"=left, "c"=center, "r"=right;
  25268. * 第二个字符代表垂直方向上的对齐,"t"=top, "m"=middle, "b"=bottom。
  25269. * @property {number} [labelXOffset] - 标签在 x 轴方向的偏移量。
  25270. * @property {number} [labelYOffset] - 标签在 y 轴方向的偏移量。
  25271. * @property {boolean} [labelSelect=false] - 如果设为 true,标签可以选用 SelectFeature 或者 similar 控件。
  25272. * @property {string} [fontColor='#000000'] - 标签字体颜色。
  25273. * @property {number} [fontOpacity] - 标签透明度 (0-1)。
  25274. * @property {string} [fontFamily] - 标签的字体类型。
  25275. * @property {string} [fontSize] - 标签的字体大小。
  25276. * @property {string} [fontStyle] - 标签的字体样式。
  25277. * @property {string} [fontWeight] - 标签的字体粗细。
  25278. * @property {string} [display] - 如果 display 属性设置为 “none”,符号将没有任何效果。
  25279. * @example
  25280. * // label的用法如下:
  25281. * function addGeoTest(){
  25282. * var geometry = new GeometryPoint(105, 35);
  25283. * var pointFeature = new FeatureVector(geometry);
  25284. * var styleTest = {
  25285. * label:"supermap",
  25286. * fontColor:"#0000ff",
  25287. * fontOpacity:"0.5",
  25288. * fontFamily:"隶书",
  25289. * fontSize:"8em",
  25290. * fontWeight:"bold",
  25291. * fontStyle:"italic",
  25292. * labelSelect:"true",
  25293. * }
  25294. * pointFeature.style = styleTest;
  25295. * vectorLayer.addFeatures([pointFeature]);
  25296. * }
  25297. */
  25298. ;// CONCATENATED MODULE: ./src/common/commontypes/index.js
  25299. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  25300. * This program are made available under the terms of the Apache License, Version 2.0
  25301. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25302. ;// CONCATENATED MODULE: ./src/common/format/Format.js
  25303. function Format_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25304. function Format_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  25305. function Format_createClass(Constructor, protoProps, staticProps) { if (protoProps) Format_defineProperties(Constructor.prototype, protoProps); if (staticProps) Format_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  25306. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  25307. * This program are made available under the terms of the Apache License, Version 2.0
  25308. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25309. /**
  25310. * @class Format
  25311. * @deprecatedclass SuperMap.Format
  25312. * @classdesc 读写各种格式的格式类基类。其子类应该包含并实现 read 和 write 方法。
  25313. * @category BaseTypes Format
  25314. * @param {Object} options - 可选参数。
  25315. * @param {boolean} [options.keepData=false] - 如果设置为 true, data 属性会指向被解析的对象(例如 JSON 或 xml 数据对象)。
  25316. * @param {Object} [options.data] - 当 keepData 属性设置为 true,这是传递给 read 操作的要被解析的字符串。
  25317. * @usage
  25318. */
  25319. var Format = /*#__PURE__*/function () {
  25320. function Format(options) {
  25321. Format_classCallCheck(this, Format);
  25322. /**
  25323. * @member {Object} Format.prototype.data
  25324. * @description 当 keepData 属性设置为 true,这是传递给 read 操作的要被解析的字符串。
  25325. */
  25326. this.data = null;
  25327. /**
  25328. * @member {Object} [Format.prototype.keepData=false]
  25329. * @description 保持最近读到的数据的引用(通过 data 属性)。
  25330. */
  25331. this.keepData = false;
  25332. Util_Util.extend(this, options);
  25333. this.options = options;
  25334. this.CLASS_NAME = "SuperMap.Format";
  25335. }
  25336. /**
  25337. * @function Format.prototype.destroy
  25338. * @description 销毁该格式类,释放相关资源。
  25339. */
  25340. Format_createClass(Format, [{
  25341. key: "destroy",
  25342. value: function destroy() {
  25343. //用来销毁该格式类,释放相关资源
  25344. }
  25345. /**
  25346. * @function Format.prototype.read
  25347. * @description 来从字符串中读取数据。
  25348. * @param {string} data - 读取的数据。
  25349. */
  25350. }, {
  25351. key: "read",
  25352. value: function read(data) {// eslint-disable-line no-unused-vars
  25353. //用来从字符串中读取数据
  25354. }
  25355. /**
  25356. * @function Format.prototype.write
  25357. * @description 将对象写成字符串。
  25358. * @param {Object} object - 可序列化的对象。
  25359. * @returns {string} 对象转化后的字符串。
  25360. */
  25361. }, {
  25362. key: "write",
  25363. value: function write(object) {// eslint-disable-line no-unused-vars
  25364. //用来写字符串
  25365. }
  25366. }]);
  25367. return Format;
  25368. }();
  25369. ;// CONCATENATED MODULE: ./src/common/format/JSON.js
  25370. function JSON_typeof(obj) { "@babel/helpers - typeof"; return JSON_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, JSON_typeof(obj); }
  25371. function JSON_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25372. function JSON_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  25373. function JSON_createClass(Constructor, protoProps, staticProps) { if (protoProps) JSON_defineProperties(Constructor.prototype, protoProps); if (staticProps) JSON_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  25374. function JSON_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) JSON_setPrototypeOf(subClass, superClass); }
  25375. function JSON_setPrototypeOf(o, p) { JSON_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return JSON_setPrototypeOf(o, p); }
  25376. function JSON_createSuper(Derived) { var hasNativeReflectConstruct = JSON_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = JSON_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = JSON_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return JSON_possibleConstructorReturn(this, result); }; }
  25377. function JSON_possibleConstructorReturn(self, call) { if (call && (JSON_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return JSON_assertThisInitialized(self); }
  25378. function JSON_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  25379. function JSON_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  25380. function JSON_getPrototypeOf(o) { JSON_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return JSON_getPrototypeOf(o); }
  25381. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  25382. * This program are made available under the terms of the Apache License, Version 2.0
  25383. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25384. /**
  25385. * @class JSONFormat
  25386. * @aliasclass Format.JSON
  25387. * @deprecatedclass SuperMap.Format.JSON
  25388. * @classdesc 安全的读写 JSON 的解析类。使用 {@link JSONFormat} 构造函数创建新实例。
  25389. * @category BaseTypes Format
  25390. * @param {Object} [options] - 可选参数。
  25391. * @param {string} [options.indent=" "] - 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
  25392. * @param {string} [options.space=" "] - 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
  25393. * @param {string} [options.newline="\n"] - 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
  25394. * @param {number} [options.level=0] - 用于格式化输出, 表示的是缩进级别。
  25395. * @param {boolean} [options.pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  25396. * @param {boolean} [options.nativeJSON] - 需要被注册的监听器对象。
  25397. * @extends {Format}
  25398. * @usage
  25399. */
  25400. var JSONFormat = /*#__PURE__*/function (_Format) {
  25401. JSON_inherits(JSONFormat, _Format);
  25402. var _super = JSON_createSuper(JSONFormat);
  25403. function JSONFormat(options) {
  25404. var _this;
  25405. JSON_classCallCheck(this, JSONFormat);
  25406. _this = _super.call(this, options);
  25407. /**
  25408. * @member {string} [JSONFormat.prototype.indent=" "]
  25409. * @description 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
  25410. */
  25411. _this.indent = " ";
  25412. /**
  25413. * @member {string} [JSONFormat.prototype.space=" "]
  25414. * @description 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
  25415. */
  25416. _this.space = " ";
  25417. /**
  25418. * @member {string} [JSONFormat.prototype.newline="\n"]
  25419. * @description 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
  25420. */
  25421. _this.newline = "\n";
  25422. /**
  25423. * @member {number} [JSONFormat.prototype.level=0]
  25424. * @description 用于格式化输出, 表示的是缩进级别。
  25425. */
  25426. _this.level = 0;
  25427. /**
  25428. * @member {boolean} [JSONFormat.prototype.pretty=false]
  25429. * @description 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  25430. */
  25431. _this.pretty = false;
  25432. /**
  25433. * @member {boolean} JSONFormat.prototype.nativeJSON
  25434. * @description 判断浏览器是否原生支持 JSON 格式数据。
  25435. */
  25436. _this.nativeJSON = function () {
  25437. return !!(window.JSON && typeof JSON.parse === "function" && typeof JSON.stringify === "function");
  25438. }();
  25439. _this.CLASS_NAME = "SuperMap.Format.JSON";
  25440. /**
  25441. * @member JSONFormat.prototype.serialize
  25442. * @description 提供一些类型对象转 JSON 字符串的方法。
  25443. */
  25444. _this.serialize = {
  25445. /**
  25446. * @function JSONFormat.serialize.object
  25447. * @description 把对象转换为 JSON 字符串。
  25448. * @param {Object} object - 可序列化的对象。
  25449. * @returns {string} JSON 字符串。
  25450. */
  25451. 'object': function object(_object) {
  25452. // three special objects that we want to treat differently
  25453. if (_object == null) {
  25454. return "null";
  25455. }
  25456. if (_object.constructor === Date) {
  25457. return this.serialize.date.apply(this, [_object]);
  25458. }
  25459. if (_object.constructor === Array) {
  25460. return this.serialize.array.apply(this, [_object]);
  25461. }
  25462. var pieces = ['{'];
  25463. this.level += 1;
  25464. var key, keyJSON, valueJSON;
  25465. var addComma = false;
  25466. for (key in _object) {
  25467. if (_object.hasOwnProperty(key)) {
  25468. // recursive calls need to allow for sub-classing
  25469. keyJSON = this.write.apply(this, [key, this.pretty]);
  25470. valueJSON = this.write.apply(this, [_object[key], this.pretty]);
  25471. if (keyJSON != null && valueJSON != null) {
  25472. if (addComma) {
  25473. pieces.push(',');
  25474. }
  25475. pieces.push(this.writeNewline(), this.writeIndent(), keyJSON, ':', this.writeSpace(), valueJSON);
  25476. addComma = true;
  25477. }
  25478. }
  25479. }
  25480. this.level -= 1;
  25481. pieces.push(this.writeNewline(), this.writeIndent(), '}');
  25482. return pieces.join('');
  25483. },
  25484. /**
  25485. * @function JSONFormat.serialize.array
  25486. * @description 把数组转换成 JSON 字符串。
  25487. * @param {Array} array - 可序列化的数组。
  25488. * @returns {string} JSON 字符串。
  25489. */
  25490. 'array': function array(_array) {
  25491. var json;
  25492. var pieces = ['['];
  25493. this.level += 1;
  25494. for (var i = 0, len = _array.length; i < len; ++i) {
  25495. // recursive calls need to allow for sub-classing
  25496. json = this.write.apply(this, [_array[i], this.pretty]);
  25497. if (json != null) {
  25498. if (i > 0) {
  25499. pieces.push(',');
  25500. }
  25501. pieces.push(this.writeNewline(), this.writeIndent(), json);
  25502. }
  25503. }
  25504. this.level -= 1;
  25505. pieces.push(this.writeNewline(), this.writeIndent(), ']');
  25506. return pieces.join('');
  25507. },
  25508. /**
  25509. * @function JSONFormat.serialize.string
  25510. * @description 把字符串转换成 JSON 字符串。
  25511. * @param {string} string - 可序列化的字符串。
  25512. * @returns {string} JSON 字符串。
  25513. */
  25514. 'string': function string(_string) {
  25515. // If the string contains no control characters, no quote characters, and no
  25516. // backslash characters, then we can simply slap some quotes around it.
  25517. // Otherwise we must also replace the offending characters with safe
  25518. // sequences.
  25519. var m = {
  25520. '\b': '\\b',
  25521. '\t': '\\t',
  25522. '\n': '\\n',
  25523. '\f': '\\f',
  25524. '\r': '\\r',
  25525. '"': '\\"',
  25526. '\\': '\\\\'
  25527. };
  25528. /*eslint-disable no-control-regex*/
  25529. if (/["\\\x00-\x1f]/.test(_string)) {
  25530. return '"' + _string.replace(/([\x00-\x1f\\"])/g, function (a, b) {
  25531. var c = m[b];
  25532. if (c) {
  25533. return c;
  25534. }
  25535. c = b.charCodeAt();
  25536. return "\\u00" + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
  25537. }) + '"';
  25538. }
  25539. return '"' + _string + '"';
  25540. },
  25541. /**
  25542. * @function JSONFormat.serialize.number
  25543. * @description 把数字转换成 JSON 字符串。
  25544. * @param {number} number - 可序列化的数字。
  25545. * @returns {string} JSON 字符串。
  25546. */
  25547. 'number': function number(_number) {
  25548. return isFinite(_number) ? String(_number) : "null";
  25549. },
  25550. /**
  25551. * @function JSONFormat.serialize.boolean
  25552. * @description Transform a boolean into a JSON string.
  25553. * @param {boolean} bool - The boolean to be serialized.
  25554. * @returns {string} A JSON string representing the boolean.
  25555. */
  25556. 'boolean': function boolean(bool) {
  25557. return String(bool);
  25558. },
  25559. /**
  25560. * @function JSONFormat.serialize.object
  25561. * @description 将日期对象转换成 JSON 字符串。
  25562. * @param {Date} date - 可序列化的日期对象。
  25563. * @returns {string} JSON 字符串。
  25564. */
  25565. 'date': function date(_date) {
  25566. function format(number) {
  25567. // Format integers to have at least two digits.
  25568. return number < 10 ? '0' + number : number;
  25569. }
  25570. return '"' + _date.getFullYear() + '-' + format(_date.getMonth() + 1) + '-' + format(_date.getDate()) + 'T' + format(_date.getHours()) + ':' + format(_date.getMinutes()) + ':' + format(_date.getSeconds()) + '"';
  25571. }
  25572. };
  25573. return _this;
  25574. }
  25575. /**
  25576. * @function JSONFormat.prototype.read
  25577. * @description 将一个符合 JSON 结构的字符串进行解析。
  25578. * @param {string} json - 符合 JSON 结构的字符串。
  25579. * @param {function} filter - 过滤方法,最终结果的每一个键值对都会调用该过滤方法,并在对应的值的位置替换成该方法返回的值。
  25580. * @returns {(Object|string|Array|number|boolean)} 对象,数组,字符串或数字。
  25581. */
  25582. JSON_createClass(JSONFormat, [{
  25583. key: "read",
  25584. value: function read(json, filter) {
  25585. var object;
  25586. if (this.nativeJSON) {
  25587. try {
  25588. object = JSON.parse(json, filter);
  25589. } catch (e) {
  25590. // Fall through if the regexp test fails.
  25591. return {
  25592. data: json
  25593. };
  25594. }
  25595. }
  25596. if (this.keepData) {
  25597. this.data = object;
  25598. }
  25599. return object;
  25600. }
  25601. /**
  25602. * @function JSONFormat.prototype.write
  25603. * @description 序列化一个对象到一个符合 JSON 格式的字符串。
  25604. * @param {Object|string|Array|number|boolean} value - 需要被序列化的对象,数组,字符串,数字,布尔值。
  25605. * @param {boolean} [pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  25606. * @returns {string} 符合 JSON 格式的字符串。
  25607. *
  25608. */
  25609. }, {
  25610. key: "write",
  25611. value: function write(value, pretty) {
  25612. this.pretty = !!pretty;
  25613. var json = null;
  25614. var type = JSON_typeof(value);
  25615. if (this.serialize[type]) {
  25616. try {
  25617. json = !this.pretty && this.nativeJSON ? JSON.stringify(value) : this.serialize[type].apply(this, [value]);
  25618. } catch (err) {
  25619. //console.error("Trouble serializing: " + err);
  25620. }
  25621. }
  25622. return json;
  25623. }
  25624. /**
  25625. * @function JSONFormat.prototype.writeIndent
  25626. * @description 根据缩进级别输出一个缩进字符串。
  25627. * @private
  25628. * @returns {string} 一个适当的缩进字符串。
  25629. */
  25630. }, {
  25631. key: "writeIndent",
  25632. value: function writeIndent() {
  25633. var pieces = [];
  25634. if (this.pretty) {
  25635. for (var i = 0; i < this.level; ++i) {
  25636. pieces.push(this.indent);
  25637. }
  25638. }
  25639. return pieces.join('');
  25640. }
  25641. /**
  25642. * @function JSONFormat.prototype.writeNewline
  25643. * @description 在格式化输出模式情况下输出代表新一行的字符串。
  25644. * @private
  25645. * @returns {string} 代表新的一行的字符串。
  25646. */
  25647. }, {
  25648. key: "writeNewline",
  25649. value: function writeNewline() {
  25650. return this.pretty ? this.newline : '';
  25651. }
  25652. /**
  25653. * @function JSONFormat.prototype.writeSpace
  25654. * @private
  25655. * @description 在格式化输出模式情况下输出一个代表空格的字符串。
  25656. * @returns {string} 空格字符串。
  25657. */
  25658. }, {
  25659. key: "writeSpace",
  25660. value: function writeSpace() {
  25661. return this.pretty ? this.space : '';
  25662. }
  25663. }]);
  25664. return JSONFormat;
  25665. }(Format);
  25666. ;// CONCATENATED MODULE: ./src/common/iServer/ServerColor.js
  25667. function ServerColor_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25668. function ServerColor_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  25669. function ServerColor_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerColor_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerColor_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  25670. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  25671. * This program are made available under the terms of the Apache License, Version 2.0
  25672. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25673. /**
  25674. * @class ServerColor
  25675. * @deprecatedclass SuperMap.ServerColor
  25676. * @category iServer Map Theme
  25677. * @classdesc 颜色类。该类使用三原色( RGB )来表达颜色。
  25678. * @param {Object} options - 可选参数。
  25679. * @param {number} [options.red=255] - 获取或设置红色值。
  25680. * @param {number} [options.green=0] - 获取或设置绿色值。
  25681. * @param {number} [options.blue=0] - 获取或设置蓝色值。
  25682. * @usage
  25683. */
  25684. var ServerColor = /*#__PURE__*/function () {
  25685. function ServerColor(red, green, blue) {
  25686. ServerColor_classCallCheck(this, ServerColor);
  25687. /**
  25688. * @member {number} [ServerColor.prototype.red=255]
  25689. * @description 获取或设置红色值。
  25690. */
  25691. this.red = !red && red != 0 ? 255 : red;
  25692. /**
  25693. * @member {number} [ServerColor.prototype.green=0]
  25694. * @description 获取或设置绿色值。
  25695. */
  25696. this.green = green || 0;
  25697. /**
  25698. * @member {number} [ServerColor.prototype.blue=0]
  25699. * @description 获取或设置蓝色值。
  25700. */
  25701. this.blue = blue || 0;
  25702. this.CLASS_NAME = "SuperMap.ServerColor";
  25703. }
  25704. /**
  25705. * @function ServerColor.prototype.destroy
  25706. * @description 释放资源,将引用资源的属性置空。
  25707. */
  25708. ServerColor_createClass(ServerColor, [{
  25709. key: "destroy",
  25710. value: function destroy() {
  25711. var me = this;
  25712. me.red = null;
  25713. me.green = null;
  25714. me.blue = null;
  25715. }
  25716. /**
  25717. * @function ServerColor.formJson
  25718. * @description 将 JSON 对象转化为 ServerColor 对象。
  25719. * @param {Object} jsonObject - 要转换的 JSON 对象。
  25720. * @returns {ServerColor} 转化后的 ServerColor 对象。
  25721. */
  25722. }], [{
  25723. key: "fromJson",
  25724. value: function fromJson(jsonObject) {
  25725. if (!jsonObject) {
  25726. return;
  25727. }
  25728. var color = new ServerColor();
  25729. var red = 255;
  25730. if (jsonObject.red !== null) {
  25731. red = Number(jsonObject.red);
  25732. }
  25733. color.red = red;
  25734. var green = 0;
  25735. if (jsonObject.green !== null) {
  25736. green = Number(jsonObject.green);
  25737. }
  25738. color.green = green;
  25739. var blue = 0;
  25740. if (jsonObject.blue !== null) {
  25741. blue = Number(jsonObject.blue);
  25742. }
  25743. color.blue = blue;
  25744. return color;
  25745. }
  25746. }]);
  25747. return ServerColor;
  25748. }();
  25749. ;// CONCATENATED MODULE: ./src/common/iServer/ServerStyle.js
  25750. function ServerStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25751. function ServerStyle_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  25752. function ServerStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerStyle_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  25753. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  25754. * This program are made available under the terms of the Apache License, Version 2.0
  25755. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25756. /**
  25757. * @class ServerStyle
  25758. * @deprecatedclass SuperMap.ServerStyle
  25759. * @category iServer Map Theme
  25760. * @classdesc 服务端矢量要素风格类。该类用于定义点状符号、线状符号、填充符号风格及其相关属性。
  25761. * @param {Object} options - 参数。
  25762. * @param {FillGradientMode} options.fillGradientMode - 渐变填充风格的渐变类型。
  25763. * @param {ServerColor} [options.fillBackColor=[255,255,255]] - 填充背景颜色。
  25764. * @param {boolean} [options.fillBackOpaque=false] - 背景是否不透明。
  25765. * @param {ServerColor} [options.fillForeColor=[255,0,0]] - 填充颜色。
  25766. * @param {number} [options.fillGradientAngle=0] - 渐变填充的旋转角度。
  25767. * @param {number} [options.fillGradientOffsetRatioX=0] - 渐变填充中心点相对于填充区域范围中心点的水平偏移百分比。
  25768. * @param {number} [options.fillGradientOffsetRatioY=0] - 填充中心点相对于填充区域范围中心点的垂直偏移百分比。
  25769. * @param {number} [options.fillOpaqueRate=100] - 填充不透明度。
  25770. * @param {number} [options.fillSymbolID=0] - 填充符号的编码。
  25771. * @param {ServerColor} [options.lineColor] - 矢量要素的边线颜色。默认 lineColor = new ServerColor(0, 0, 0)。
  25772. * @param {number} [options.lineSymbolID=0] - 线状符号的编码。
  25773. * @param {number} [options.lineWidth=1] - 边线的宽度。
  25774. * @param {number} [options.markerAngle=0] - 点状符号的旋转角度。
  25775. * @param {number} [options.markerSize=1] - 点状符号的大小。
  25776. * @param {number} [options.markerSymbolID=-1] - 点状符号的编码。
  25777. * @usage
  25778. */
  25779. var ServerStyle = /*#__PURE__*/function () {
  25780. function ServerStyle(options) {
  25781. ServerStyle_classCallCheck(this, ServerStyle);
  25782. /**
  25783. * @member {ServerColor} ServerStyle.prototype.fillBackColor
  25784. * @description 填充背景颜色。当填充模式为渐变填充时,该颜色为填充终止色。
  25785. */
  25786. this.fillBackColor = new ServerColor(255, 255, 255);
  25787. /**
  25788. * @member {boolean} [ServerStyle.prototype.fillBackOpaque=false]
  25789. * @description 背景是否不透明。false 表示透明。
  25790. */
  25791. this.fillBackOpaque = false;
  25792. /**
  25793. * @member {ServerColor} ServerStyle.prototype.fillForeColor
  25794. * @description 填充颜色。当填充模式为渐变填充时,该颜色为填充起始颜色。
  25795. */
  25796. this.fillForeColor = new ServerColor(255, 0, 0);
  25797. /**
  25798. * @member {FillGradientMode} ServerStyle.prototype.fillGradientMode
  25799. * @description 渐变填充风格的渐变类型。
  25800. */
  25801. this.fillGradientMode = null;
  25802. /**
  25803. * @member {number} ServerStyle.prototype.fillGradientAngle -
  25804. * @description 渐变填充的旋转角度。单位为度,精确到 0.1 度,逆时针方向为正方向。
  25805. */
  25806. this.fillGradientAngle = 0;
  25807. /**
  25808. * @member {number} ServerStyle.prototype.fillGradientOffsetRatioX
  25809. * @description 渐变填充中心点相对于填充区域范围中心点的水平偏移百分比。它们的关系如下:设填充区域范围中心点的坐标为(x0, y0),
  25810. * 填充中心点的坐标为(x, y),填充区域范围的宽度为 a,水平偏移百分比为 dx,则 x=x0 + a*dx/100。
  25811. */
  25812. this.fillGradientOffsetRatioX = 0;
  25813. /**
  25814. * @member {number} ServerStyle.prototype.fillGradientOffsetRatioY
  25815. * @description 填充中心点相对于填充区域范围中心点的垂直偏移百分比。它们的关系如下:<br>
  25816. * 设填充区域范围中心点的坐标为(x0, y0),填充中心点的坐标为(x, y),填充区域范围的高度为 b,垂直偏移百分比为 dy,则 y=y0 + b*dx/100。
  25817. */
  25818. this.fillGradientOffsetRatioY = 0;
  25819. /**
  25820. * @member {number} [ServerStyle.prototype.fillOpaqueRate=100]
  25821. * @description 填充不透明度。合法值为 0 - 100 的数值。其中为 0 表示完全透明;
  25822. * 100 表示完全不透明。赋值小于 0 时按照 0 处理,大于 100 时按照 100 处理。
  25823. */
  25824. this.fillOpaqueRate = 100;
  25825. /**
  25826. * @member {number} ServerStyle.prototype.fillSymbolID
  25827. * @description 填充符号的编码。此编码用于唯一标识各普通填充风格的填充符号。
  25828. * 关于填充符号的样式与对应的 ID 号请在 SuperMap 桌面软件中查找。
  25829. */
  25830. this.fillSymbolID = 0;
  25831. /**
  25832. * @member {ServerColor} ServerStyle.prototype.lineColor
  25833. * @description 矢量要素的边线颜色。如果等级符号是点符号,点符号的颜色由 lineColor 控制。
  25834. */
  25835. this.lineColor = new ServerColor(0, 0, 0);
  25836. /**
  25837. * @member {number} [ServerStyle.prototype.lineSymbolID=0]
  25838. * @description 线状符号的编码。此编码用于唯一标识各普通填充风格的填充符号。
  25839. * 关于线状符号的样式与对应的 ID 号请在 SuperMap 桌面软件中查找。
  25840. */
  25841. this.lineSymbolID = 0;
  25842. /**
  25843. * @member {number} [ServerStyle.prototype.lineWidth=1.0]
  25844. * @description 边线的宽度。单位为毫米,精度到 0.1。
  25845. */
  25846. this.lineWidth = 1;
  25847. /**
  25848. * @member {number} [ServerStyle.prototype.markerAngle=0]
  25849. * @description 点状符号的旋转角度。以度为单位,精确到 0.1 度,逆时针方向为正方向。
  25850. */
  25851. this.markerAngle = 0;
  25852. /**
  25853. * @member {number} [ServerStyle.prototype.markerSize=1.0]
  25854. * @description 点状符号的大小。单位为毫米,精度为 0.1。当该属性设置为0时,采用符号默认大小 1.0 显示。
  25855. * 当该属性设置为非法值时,交由服务器默认处理。
  25856. */
  25857. this.markerSize = 1;
  25858. /**
  25859. * @member {number} [ServerStyle.prototype.markerSymbolID=-1]
  25860. * @description 点状符号的编码。此编码用于唯一标识各点状符号。
  25861. * 关于线状符号的样式与对应的 ID 号请在 SuperMap 桌面软件中查找。
  25862. */
  25863. this.markerSymbolID = -1;
  25864. if (options) {
  25865. Util_Util.extend(this, options);
  25866. }
  25867. this.CLASS_NAME = "SuperMap.ServerStyle";
  25868. }
  25869. /**
  25870. * @function ServerStyle.prototype.destroy
  25871. * @description 释放资源,将引用资源的属性置空。
  25872. */
  25873. ServerStyle_createClass(ServerStyle, [{
  25874. key: "destroy",
  25875. value: function destroy() {
  25876. var me = this;
  25877. if (me.fillBackColor) {
  25878. me.fillBackColor.destroy();
  25879. me.fillBackColor = null;
  25880. }
  25881. me.fillBackOpaque = null;
  25882. if (me.fillForeColor) {
  25883. me.fillForeColor.destroy();
  25884. me.fillForeColor = null;
  25885. }
  25886. me.fillGradientMode = null;
  25887. me.fillGradientAngle = null;
  25888. me.fillGradientOffsetRatioX = null;
  25889. me.fillGradientOffsetRatioY = null;
  25890. me.fillOpaqueRate = null;
  25891. me.fillSymbolID = null;
  25892. if (me.lineColor) {
  25893. me.lineColor.destroy();
  25894. me.lineColor = null;
  25895. }
  25896. me.lineSymbolID = null;
  25897. me.lineWidth = null;
  25898. me.markerAngle = null;
  25899. me.markerSize = null;
  25900. me.markerSymbolID = null;
  25901. }
  25902. /**
  25903. * @function ServerStyle.prototype.toServerJSONObject
  25904. * @description 转换成对应的 JSON 格式对象。
  25905. * @returns {Object} 对应的 JSON 格式对象.
  25906. */
  25907. }, {
  25908. key: "toServerJSONObject",
  25909. value: function toServerJSONObject() {
  25910. var styleObj = {};
  25911. styleObj = Util_Util.copyAttributes(styleObj, this);
  25912. //暂时先忽略serverColor往Json的转换
  25913. return styleObj;
  25914. }
  25915. /**
  25916. * @function ServerStyle.fromJson
  25917. * @description 将JSON对象转换为 ServerStyle 对象。
  25918. * @param {Object} jsonObject - 要转换的 JSON 对象。
  25919. * @returns {ServerStyle} 转化后的 ServerStyle 对象。
  25920. */
  25921. }], [{
  25922. key: "fromJson",
  25923. value: function fromJson(jsonObject) {
  25924. if (!jsonObject) {
  25925. return;
  25926. }
  25927. return new ServerStyle({
  25928. fillBackColor: ServerColor.fromJson(jsonObject.fillBackColor),
  25929. fillBackOpaque: jsonObject.fillBackOpaque,
  25930. fillForeColor: ServerColor.fromJson(jsonObject.fillForeColor),
  25931. fillGradientMode: jsonObject.fillGradientMode,
  25932. fillGradientAngle: jsonObject.fillGradientAngle,
  25933. fillGradientOffsetRatioX: jsonObject.fillGradientOffsetRatioX,
  25934. fillGradientOffsetRatioY: jsonObject.fillGradientOffsetRatioY,
  25935. fillOpaqueRate: jsonObject.fillOpaqueRate,
  25936. fillSymbolID: jsonObject.fillSymbolID,
  25937. lineColor: ServerColor.fromJson(jsonObject.lineColor),
  25938. lineSymbolID: jsonObject.lineSymbolID,
  25939. lineWidth: jsonObject.lineWidth,
  25940. markerAngle: jsonObject.markerAngle,
  25941. markerSize: jsonObject.markerSize,
  25942. markerSymbolID: jsonObject.markerSymbolID
  25943. });
  25944. }
  25945. }]);
  25946. return ServerStyle;
  25947. }();
  25948. ;// CONCATENATED MODULE: ./src/common/iServer/PointWithMeasure.js
  25949. function PointWithMeasure_typeof(obj) { "@babel/helpers - typeof"; return PointWithMeasure_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, PointWithMeasure_typeof(obj); }
  25950. function PointWithMeasure_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25951. function PointWithMeasure_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  25952. function PointWithMeasure_createClass(Constructor, protoProps, staticProps) { if (protoProps) PointWithMeasure_defineProperties(Constructor.prototype, protoProps); if (staticProps) PointWithMeasure_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  25953. function PointWithMeasure_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) PointWithMeasure_setPrototypeOf(subClass, superClass); }
  25954. function PointWithMeasure_setPrototypeOf(o, p) { PointWithMeasure_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return PointWithMeasure_setPrototypeOf(o, p); }
  25955. function PointWithMeasure_createSuper(Derived) { var hasNativeReflectConstruct = PointWithMeasure_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = PointWithMeasure_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = PointWithMeasure_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return PointWithMeasure_possibleConstructorReturn(this, result); }; }
  25956. function PointWithMeasure_possibleConstructorReturn(self, call) { if (call && (PointWithMeasure_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return PointWithMeasure_assertThisInitialized(self); }
  25957. function PointWithMeasure_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  25958. function PointWithMeasure_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  25959. function PointWithMeasure_getPrototypeOf(o) { PointWithMeasure_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return PointWithMeasure_getPrototypeOf(o); }
  25960. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  25961. * This program are made available under the terms of the Apache License, Version 2.0
  25962. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25963. /**
  25964. * @class PointWithMeasure
  25965. * @deprecatedclass SuperMap.PointWithMeasure
  25966. * @category iServer SpatialAnalyst RouteLocator
  25967. * @classdesc 路由点类。路由点是指具有线性度量值 (Measure) 的二维地理坐标点。
  25968. * @param {Object} options - 参数。
  25969. * @param {number} options.measure - 度量值,即路由对象属性值 M。
  25970. * @param {number} options.x - 地理坐标系下的 X 坐标值。
  25971. * @param {number} options.y - 地理坐标系下的 Y 坐标值。
  25972. * @extends {GeometryPoint}
  25973. * @usage
  25974. */
  25975. var PointWithMeasure = /*#__PURE__*/function (_Point) {
  25976. PointWithMeasure_inherits(PointWithMeasure, _Point);
  25977. var _super = PointWithMeasure_createSuper(PointWithMeasure);
  25978. function PointWithMeasure(options) {
  25979. var _this;
  25980. PointWithMeasure_classCallCheck(this, PointWithMeasure);
  25981. _this = _super.call(this, options);
  25982. /**
  25983. * @member {number} PointWithMeasure.prototype.measure
  25984. * @description 度量值,即路由对象属性值 M。
  25985. */
  25986. _this.measure = null;
  25987. if (options) {
  25988. Util_Util.extend(PointWithMeasure_assertThisInitialized(_this), options);
  25989. }
  25990. _this.CLASS_NAME = "SuperMap.PointWithMeasure";
  25991. return _this;
  25992. }
  25993. /**
  25994. * @function PointWithMeasure.prototype.equals
  25995. * @description 判断两个路由点对象是否相等。如果两个路由点对象具有相同的坐标以及度量值,则认为是相等的。
  25996. * @param {PointWithMeasure} geom - 需要判断的路由点对象。
  25997. * @returns {boolean} 两个路由点对象是否相等(true 为相等,false 为不等)。
  25998. */
  25999. PointWithMeasure_createClass(PointWithMeasure, [{
  26000. key: "equals",
  26001. value: function equals(geom) {
  26002. var equals = false;
  26003. if (geom != null) {
  26004. var isValueEquals = this.x === geom.x && this.y === geom.y && this.measure === geom.measure;
  26005. var isNaNValue = isNaN(this.x) && isNaN(this.y) && isNaN(this.measure);
  26006. var isNaNGeometry = isNaN(geom.x) && isNaN(geom.y) && isNaN(geom.measure);
  26007. equals = isValueEquals || isNaNValue && isNaNGeometry;
  26008. }
  26009. return equals;
  26010. }
  26011. /**
  26012. * @function PointWithMeasure.prototype.toJson
  26013. * @description 转换为 JSON 对象。
  26014. * */
  26015. }, {
  26016. key: "toJson",
  26017. value: function toJson() {
  26018. var result = "{";
  26019. if (this.measure != null && this.measure != undefined) {
  26020. result += "\"measure\":" + this.measure + ",";
  26021. }
  26022. result += "\"x\":" + this.x + ",";
  26023. result += "\"y\":" + this.y;
  26024. result += "}";
  26025. return result;
  26026. }
  26027. /**
  26028. * @function PointWithMeasure.prototype.destroy
  26029. * @description 释放资源,将引用资源的属性置空。
  26030. */
  26031. }, {
  26032. key: "destroy",
  26033. value: function destroy() {
  26034. var me = this;
  26035. me.measure = null;
  26036. me.x = null;
  26037. me.y = null;
  26038. }
  26039. /**
  26040. * @function PointWithMeasure.fromJson
  26041. * @description 将 JSON 对象转换为{@link PointWithMeasure} 对象。
  26042. * @param {Object} jsonObject - JSON 对象表示的路由点。
  26043. * @returns {PointWithMeasure} 转化后的 PointWithMeasure 对象。
  26044. */
  26045. }], [{
  26046. key: "fromJson",
  26047. value: function fromJson(jsonObject) {
  26048. if (!jsonObject) {
  26049. return;
  26050. }
  26051. return new PointWithMeasure({
  26052. x: jsonObject.x,
  26053. y: jsonObject.y,
  26054. measure: jsonObject.measure
  26055. });
  26056. }
  26057. }]);
  26058. return PointWithMeasure;
  26059. }(Point);
  26060. ;// CONCATENATED MODULE: ./src/common/iServer/Route.js
  26061. function Route_typeof(obj) { "@babel/helpers - typeof"; return Route_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Route_typeof(obj); }
  26062. function Route_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26063. function Route_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  26064. function Route_createClass(Constructor, protoProps, staticProps) { if (protoProps) Route_defineProperties(Constructor.prototype, protoProps); if (staticProps) Route_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  26065. function Route_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Route_setPrototypeOf(subClass, superClass); }
  26066. function Route_setPrototypeOf(o, p) { Route_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Route_setPrototypeOf(o, p); }
  26067. function Route_createSuper(Derived) { var hasNativeReflectConstruct = Route_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Route_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Route_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Route_possibleConstructorReturn(this, result); }; }
  26068. function Route_possibleConstructorReturn(self, call) { if (call && (Route_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Route_assertThisInitialized(self); }
  26069. function Route_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  26070. function Route_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  26071. function Route_getPrototypeOf(o) { Route_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Route_getPrototypeOf(o); }
  26072. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  26073. * This program are made available under the terms of the Apache License, Version 2.0
  26074. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26075. /**
  26076. * @class Route
  26077. * @deprecatedclass SuperMap.Route
  26078. * @category iServer SpatialAnalyst RouteCalculateMeasure
  26079. * @classdesc 路由对象类。路由对象为一系列有序的带有属性值 M 的 x,y 坐标对,其中 M 值为该结点的距离属性(到已知点的距离)。
  26080. * @param {Array.<Geometry>} points - 形成路由对象的线数组。
  26081. * @param {Object} options - 参数。
  26082. * @param {number} options.id - 路由对象在数据库中的 ID。
  26083. * @param {number} options.length - 路由对象的长度。单位与数据集的单位相同。
  26084. * @param {number} [options.maxM] - 最大线性度量值,即所有结点到起始点的量算距离中最大值。
  26085. * @param {number} [options.minM] - 最小线性度量值,即所有结点到起始点的量算距离中最小值。
  26086. * @param {string} [options.type] - 数据类型,如:"LINEM"。
  26087. * @extends GeometryCollection
  26088. * @usage
  26089. */
  26090. var Route = /*#__PURE__*/function (_Collection) {
  26091. Route_inherits(Route, _Collection);
  26092. var _super = Route_createSuper(Route);
  26093. function Route(points, options) {
  26094. var _this;
  26095. Route_classCallCheck(this, Route);
  26096. _this = _super.call(this, points, options);
  26097. /**
  26098. * @member {number} Route.prototype.id
  26099. * @description 路由对象在数据库中的 ID。
  26100. */
  26101. _this.id = null;
  26102. /**
  26103. * @member {number} Route.prototype.center
  26104. * @description 路由对象的中心点。
  26105. */
  26106. _this.center = null;
  26107. /**
  26108. * @member {string} Route.prototype.style
  26109. * @description 路由对象的样式。
  26110. */
  26111. _this.style = null;
  26112. /**
  26113. * @member {number} Route.prototype.length
  26114. * @description 路由对象的长度。单位与数据集的单位相同。
  26115. */
  26116. _this.length = null;
  26117. /**
  26118. * @member {number} Route.prototype.maxM
  26119. * @description 最大线性度量值,即所有结点到起始点的量算距离中最大值。
  26120. */
  26121. _this.maxM = null;
  26122. /**
  26123. * @member {number} Route.prototype.minM
  26124. * @description 最小线性度量值,即所有结点到起始点的量算距离中最小值。
  26125. */
  26126. _this.minM = null;
  26127. /**
  26128. * @member {Array.<number>} Route.prototype.parts
  26129. * @description 服务端几何对象中各个子对象所包含的节点个数。
  26130. */
  26131. _this.parts = null;
  26132. /**
  26133. * @member {Array.<Object>} Route.prototype.points
  26134. * @description 路由对象的所有路由点。
  26135. * @example
  26136. * (start code)
  26137. * [
  26138. * {
  26139. * "measure": 0,
  26140. * "y": -4377.027184298267,
  26141. * "x": 4020.0045221720466
  26142. * },
  26143. * {
  26144. * "measure": 37.33288381391519,
  26145. * "y": -4381.569363260499,
  26146. * "x": 4057.0600591960642
  26147. * }
  26148. * ]
  26149. * (end)
  26150. */
  26151. _this.points = null;
  26152. /**
  26153. * @member {string} Route.prototype.type
  26154. * @description 服务端几何对象类型。
  26155. */
  26156. _this.type = null;
  26157. /**
  26158. * @member {Array.<string>} [Route.prototype.componentTypes=LineString]
  26159. * @description components 存储的几何对象所支持的几何类型数组。
  26160. */
  26161. _this.componentTypes = ["SuperMap.Geometry.LinearRing", "SuperMap.Geometry.LineString"];
  26162. if (options) {
  26163. Util_Util.extend(Route_assertThisInitialized(_this), options);
  26164. }
  26165. _this.CLASS_NAME = "SuperMap.Route";
  26166. _this.geometryType = "LINEM";
  26167. return _this;
  26168. }
  26169. /**
  26170. *
  26171. * @function Route.prototype.toJson
  26172. * @description 转换为 JSON 对象。
  26173. * @returns {Object} JSON 对象。
  26174. */
  26175. Route_createClass(Route, [{
  26176. key: "toJson",
  26177. value: function toJson() {
  26178. var result = "{";
  26179. if (this.id != null && this.id != undefined) {
  26180. result += "\"id\":" + this.id + ",";
  26181. }
  26182. if (this.center != null && this.center != undefined) {
  26183. result += "\"center\":" + this.center + ",";
  26184. }
  26185. if (this.style != null && this.style != undefined) {
  26186. result += "\"style\":" + this.style + ",";
  26187. }
  26188. if (this.length != null && this.length != undefined) {
  26189. result += "\"length\":" + this.length + ",";
  26190. }
  26191. if (this.maxM != null && this.maxM != undefined) {
  26192. result += "\"maxM\":" + this.maxM + ",";
  26193. }
  26194. if (this.minM != null && this.minM != undefined) {
  26195. result += "\"minM\":" + this.minM + ",";
  26196. }
  26197. if (this.type != null && this.type != undefined) {
  26198. result += "\"type\":\"" + this.type + "\",";
  26199. }
  26200. if (this.parts != null && this.parts != undefined) {
  26201. result += "\"parts\":[" + this.parts[0];
  26202. for (var i = 1; i < this.parts.length; i++) {
  26203. result += "," + this.parts[i];
  26204. }
  26205. result += "],";
  26206. }
  26207. if (this.components != null && this.components.length > 0) {
  26208. result += "\"points\":[";
  26209. for (var j = 0, len = this.components.length; j < len; j++) {
  26210. for (var k = 0, len2 = this.components[j].components.length; k < len2; k++) {
  26211. result += this.components[j].components[k].toJson() + ",";
  26212. }
  26213. }
  26214. result = result.replace(/,$/g, '');
  26215. result += "]";
  26216. }
  26217. result = result.replace(/,$/g, '');
  26218. result += "}";
  26219. return result;
  26220. }
  26221. /**
  26222. * @function Route.prototype.destroy
  26223. * @override
  26224. */
  26225. }, {
  26226. key: "destroy",
  26227. value: function destroy() {
  26228. var me = this;
  26229. me.id = null;
  26230. me.center = null;
  26231. me.style = null;
  26232. me.length = null;
  26233. me.maxM = null;
  26234. me.minM = null;
  26235. me.type = null;
  26236. me.parts = null;
  26237. me.components.length = 0;
  26238. me.components = null;
  26239. me.componentTypes = null;
  26240. }
  26241. /**
  26242. * @function Route.fromJson
  26243. * @description 将 JSON 对象转换为 Route 对象。
  26244. * @param {Object} [jsonObject] - JSON 对象表示的路由对象。
  26245. * @returns {Route} 转化后的 Route 对象。
  26246. */
  26247. }], [{
  26248. key: "fromJson",
  26249. value: function fromJson(jsonObject) {
  26250. if (!jsonObject) {
  26251. return;
  26252. }
  26253. var geoParts = jsonObject.parts || [],
  26254. geoPoints = jsonObject.points || [],
  26255. len = geoParts.length,
  26256. lineList = [];
  26257. if (len > 0) {
  26258. for (var i = 0, pointIndex = 0, pointList = []; i < len; i++) {
  26259. for (var j = 0; j < geoParts[i]; j++) {
  26260. pointList.push(PointWithMeasure.fromJson(geoPoints[pointIndex + j]));
  26261. }
  26262. pointIndex += geoParts[i];
  26263. //判断线是否闭合,如果闭合,则返回LinearRing,否则返回LineString
  26264. if (pointList[0].equals(pointList[geoParts[i] - 1])) {
  26265. lineList.push(new LinearRing_LinearRing(pointList));
  26266. } else {
  26267. lineList.push(new LineString(pointList));
  26268. }
  26269. pointList = [];
  26270. }
  26271. } else {
  26272. return null;
  26273. }
  26274. return new Route(lineList, {
  26275. id: jsonObject.id,
  26276. center: jsonObject.center,
  26277. style: jsonObject.style,
  26278. length: jsonObject.length,
  26279. maxM: jsonObject.maxM,
  26280. minM: jsonObject.minM,
  26281. type: jsonObject.type,
  26282. parts: jsonObject.parts
  26283. });
  26284. }
  26285. }]);
  26286. return Route;
  26287. }(Collection);
  26288. ;// CONCATENATED MODULE: ./src/common/iServer/ServerGeometry.js
  26289. function ServerGeometry_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26290. function ServerGeometry_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  26291. function ServerGeometry_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerGeometry_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerGeometry_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  26292. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  26293. * This program are made available under the terms of the Apache License, Version 2.0
  26294. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26295. /**
  26296. * @class ServerGeometry
  26297. * @deprecatedclass SuperMap.ServerGeometry
  26298. * @category iServer Data Feature
  26299. * @classdesc 服务端几何对象类。该类描述几何对象(矢量)的特征数据(坐标点对、几何对象的类型等)。基于服务端的空间分析、空间关系运算、查询等 GIS 服务功能使用服务端几何对象。
  26300. * @param {Object} options - 参数。
  26301. * @param {string} options.id - 服务端几何对象唯一标识符。
  26302. * @param {Array.<number>} options.parts - 服务端几何对象中各个子对象所包含的节点个数。
  26303. * @param {Array.<GeometryPoint>} options.points - 组成几何对象的节点的坐标对数组。
  26304. * @param {GeometryType} options.type - 几何对象的类型。
  26305. * @param {ServerStyle} [options.style] - 服务端几何对象的风格。
  26306. * @usage
  26307. */
  26308. var ServerGeometry = /*#__PURE__*/function () {
  26309. function ServerGeometry(options) {
  26310. ServerGeometry_classCallCheck(this, ServerGeometry);
  26311. /**
  26312. * @member {string} ServerGeometry.prototype.id
  26313. * @description 服务端几何对象唯一标识符。
  26314. */
  26315. this.id = 0;
  26316. /**
  26317. * @member {ServerStyle} [ServerGeometry.prototype.style]
  26318. * @description 服务端几何对象的风格(ServerStyle)。
  26319. */
  26320. this.style = null;
  26321. /**
  26322. * @member {Array.<number>} ServerGeometry.prototype.parts
  26323. * @description 服务端几何对象中各个子对象所包含的节点个数。<br>
  26324. * 1.几何对象从结构上可以分为简单几何对象和复杂几何对象。
  26325. * 简单几何对象与复杂几何对象的区别:简单的几何对象一般为单一对象,
  26326. * 而复杂的几何对象由多个简单对象组成或经过一定的空间运算之后产生,
  26327. * 如:矩形为简单的区域对象,而中空的矩形为复杂的区域对象。<br>
  26328. * 2.通常情况,一个简单几何对象的子对象就是它本身,
  26329. * 因此对于简单对象来说的该字段为长度为1的整型数组,
  26330. * 该字段的值就是这个简单对象节点的个数。
  26331. * 如果一个几何对象是由几个简单对象组合而成的,
  26332. * 例如,一个岛状几何对象由 3 个简单的多边形组成而成,
  26333. * 那么这个岛状的几何对象的 Parts 字段值就是一个长度为 3 的整型数组,
  26334. * 数组中每个成员的值分别代表这三个多边形所包含的节点个数。
  26335. */
  26336. this.parts = null;
  26337. /**
  26338. * @member {Array.<GeometryPoint>} ServerGeometry.prototype.points
  26339. * @description 组成几何对象的节点的坐标对数组。<br>
  26340. * 1.所有几何对象(点、线、面)都是由一些简单的点坐标组成的,
  26341. * 该字段存放了组成几何对象的点坐标的数组。
  26342. * 对于简单的面对象,他的起点和终点的坐标点相同。<br>
  26343. * 2.对于复杂的几何对象,根据 Parts 属性来确定每一个组成复杂几何对象的简单对象所对应的节点的个数,
  26344. * 从而确定 Points 字段中坐标对的分配归属问题。
  26345. */
  26346. this.points = null;
  26347. /**
  26348. * @member {GeometryType} ServerGeometry.prototype.type
  26349. * @description 几何对象的类型(GeometryType)。
  26350. */
  26351. this.type = null;
  26352. /**
  26353. * @member {Object} ServerGeometry.prototype.prjCoordSys
  26354. * @description 投影坐标参数,现仅在缓冲区分析中有效。
  26355. */
  26356. this.prjCoordSys = null;
  26357. if (options) {
  26358. Util_Util.extend(this, options);
  26359. }
  26360. this.CLASS_NAME = 'SuperMap.ServerGeometry';
  26361. }
  26362. /**
  26363. * @function ServerGeometry.prototype.destroy
  26364. * @description 释放资源,将引用资源的属性置空。
  26365. */
  26366. ServerGeometry_createClass(ServerGeometry, [{
  26367. key: "destroy",
  26368. value: function destroy() {
  26369. var me = this;
  26370. me.id = null;
  26371. me.style = null;
  26372. me.parts = null;
  26373. me.partTopo = null;
  26374. me.points = null;
  26375. me.type = null;
  26376. me.prjCoordSys = null;
  26377. }
  26378. /**
  26379. * @function ServerGeometry.prototype.toGeometry
  26380. * @description 将服务端几何对象 ServerGeometry 转换为客户端几何对象 Geometry。
  26381. * @returns {Geometry} 转换后的客户端几何对象。
  26382. */
  26383. }, {
  26384. key: "toGeometry",
  26385. value: function toGeometry() {
  26386. var me = this,
  26387. geoType = me.type;
  26388. switch (geoType.toUpperCase()) {
  26389. case REST_GeometryType.POINT:
  26390. return me.toGeoPoint();
  26391. case REST_GeometryType.LINE:
  26392. return me.toGeoLine();
  26393. case REST_GeometryType.LINEM:
  26394. return me.toGeoLinem();
  26395. case REST_GeometryType.REGION:
  26396. return me.toGeoRegion();
  26397. case REST_GeometryType.POINTEPS:
  26398. return me.toGeoPoint();
  26399. case REST_GeometryType.LINEEPS:
  26400. return me.toGeoLineEPS();
  26401. case REST_GeometryType.REGIONEPS:
  26402. return me.toGeoRegionEPS();
  26403. case REST_GeometryType.GEOCOMPOUND:
  26404. return me.transformGeoCompound();
  26405. }
  26406. }
  26407. /**
  26408. * @function ServerGeometry.prototype.toGeoPoint
  26409. * @description 将服务端的点几何对象转换为客户端几何对象。包括 Point、MultiPoint。
  26410. * @returns {Geometry} 转换后的客户端几何对象。
  26411. */
  26412. }, {
  26413. key: "toGeoPoint",
  26414. value: function toGeoPoint() {
  26415. var me = this,
  26416. geoParts = me.parts || [],
  26417. geoPoints = me.points || [],
  26418. len = geoParts.length;
  26419. if (len > 0) {
  26420. if (len === 1) {
  26421. return new Point(geoPoints[0].x, geoPoints[0].y);
  26422. } else {
  26423. var pointList = [];
  26424. for (var i = 0; i < len; i++) {
  26425. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
  26426. }
  26427. return new MultiPoint(pointList);
  26428. }
  26429. } else {
  26430. return null;
  26431. }
  26432. }
  26433. /**
  26434. * @function ServerGeometry.prototype.toGeoLine
  26435. * @description 将服务端的线几何对象转换为客户端几何对象。包括 GeometryLinearRing、GeometryLineString、GeometryMultiLineString。
  26436. * @returns {Geometry} 转换后的客户端几何对象。
  26437. */
  26438. }, {
  26439. key: "toGeoLine",
  26440. value: function toGeoLine() {
  26441. var me = this,
  26442. geoParts = me.parts || [],
  26443. geoPoints = me.points || [],
  26444. len = geoParts.length;
  26445. if (len > 0) {
  26446. if (len === 1) {
  26447. var pointList = [];
  26448. for (var i = 0; i < geoParts[0]; i++) {
  26449. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
  26450. }
  26451. //判断线是否闭合,如果闭合,则返回LinearRing,否则返回LineString
  26452. if (pointList[0].equals(pointList[geoParts[0] - 1])) {
  26453. return new LinearRing_LinearRing(pointList);
  26454. } else {
  26455. return new LineString(pointList);
  26456. }
  26457. } else {
  26458. var lineList = [];
  26459. for (var _i2 = 0; _i2 < len; _i2++) {
  26460. var _pointList = [];
  26461. for (var j = 0; j < geoParts[_i2]; j++) {
  26462. _pointList.push(new Point(geoPoints[j].x, geoPoints[j].y));
  26463. }
  26464. lineList.push(new LineString(_pointList));
  26465. geoPoints.splice(0, geoParts[_i2]);
  26466. }
  26467. return new MultiLineString(lineList);
  26468. }
  26469. } else {
  26470. return null;
  26471. }
  26472. }
  26473. /**
  26474. * @function ServerGeometry.prototype.toGeoLineEPS
  26475. * @description 将服务端的线几何对象转换为客户端几何对象。包括 GeometryLinearRing、GeometryLineString、GeometryMultiLineString。
  26476. * @returns {Geometry} 转换后的客户端几何对象。
  26477. */
  26478. }, {
  26479. key: "toGeoLineEPS",
  26480. value: function toGeoLineEPS() {
  26481. var me = this,
  26482. geoParts = me.parts || [],
  26483. geoPoints = me.points || [],
  26484. i,
  26485. j,
  26486. pointList,
  26487. lineList,
  26488. lineEPS,
  26489. len = geoParts.length;
  26490. if (len > 0) {
  26491. if (len === 1) {
  26492. for (i = 0, pointList = []; i < geoParts[0]; i++) {
  26493. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y, geoPoints[i].type));
  26494. }
  26495. //判断线是否闭合,如果闭合,则返回LinearRing,否则返回LineString
  26496. if (pointList[0].equals(pointList[geoParts[0] - 1])) {
  26497. lineEPS = LineString.createLineEPS(pointList);
  26498. return new LinearRing_LinearRing(lineEPS);
  26499. } else {
  26500. lineEPS = LineString.createLineEPS(pointList);
  26501. return new LineString(lineEPS);
  26502. }
  26503. } else {
  26504. for (i = 0, lineList = []; i < len; i++) {
  26505. for (j = 0, pointList = []; j < geoParts[i]; j++) {
  26506. pointList.push(new Point(geoPoints[j].x, geoPoints[j].y));
  26507. }
  26508. lineEPS = LineString.createLineEPS(pointList);
  26509. lineList.push(new LineString(lineEPS));
  26510. geoPoints.splice(0, geoParts[i]);
  26511. }
  26512. return new MultiLineString(lineList);
  26513. }
  26514. } else {
  26515. return null;
  26516. }
  26517. }
  26518. /**
  26519. * @function ServerGeometry.prototype.toGeoLinem
  26520. * @description 将服务端的路由线几何对象转换为客户端几何对象。包括 LinearRing、LineString、MultiLineString。
  26521. * @returns {Geometry} 转换后的客户端几何对象。
  26522. */
  26523. }, {
  26524. key: "toGeoLinem",
  26525. value: function toGeoLinem() {
  26526. var me = this;
  26527. return Route.fromJson(me);
  26528. }
  26529. /**
  26530. * @function ServerGeometry.prototype.toGeoRegion
  26531. * @description 将服务端的面几何对象转换为客户端几何对象。类型为 GeometryPolygon。
  26532. * @returns {Geometry} 转换后的客户端几何对象。
  26533. */
  26534. }, {
  26535. key: "toGeoRegion",
  26536. value: function toGeoRegion() {
  26537. var me = this,
  26538. geoParts = me.parts || [],
  26539. geoTopo = me.partTopo || [],
  26540. geoPoints = me.points || [],
  26541. len = geoParts.length;
  26542. if (len <= 0) {
  26543. return null;
  26544. }
  26545. var polygonArray = [];
  26546. var pointList = [];
  26547. if (len == 1) {
  26548. for (var i = 0; i < geoPoints.length; i++) {
  26549. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
  26550. }
  26551. polygonArray.push(new Polygon_Polygon([new LinearRing_LinearRing(pointList)]));
  26552. return new MultiPolygon(polygonArray);
  26553. }
  26554. //处理复杂面
  26555. var CCWArray = [];
  26556. var areaArray = [];
  26557. var polygonArrayTemp = [];
  26558. var polygonBounds = [];
  26559. //polyon岛洞标识数组,初始都是岛。
  26560. var CCWIdent = [];
  26561. for (var _i4 = 0, pointIndex = 0; _i4 < len; _i4++) {
  26562. for (var j = 0; j < geoParts[_i4]; j++) {
  26563. pointList.push(new Point(geoPoints[pointIndex + j].x, geoPoints[pointIndex + j].y));
  26564. }
  26565. pointIndex += geoParts[_i4];
  26566. var polygon = new Polygon_Polygon([new LinearRing_LinearRing(pointList)]);
  26567. pointList = [];
  26568. polygonArrayTemp.push(polygon);
  26569. if (geoTopo.length === 0) {
  26570. polygonBounds.push(polygon.getBounds());
  26571. }
  26572. CCWIdent.push(1);
  26573. areaArray.push(polygon.getArea());
  26574. }
  26575. //iServer 9D新增字段
  26576. if (geoTopo.length === 0) {
  26577. //根据面积排序
  26578. ServerGeometry.bubbleSort(areaArray, polygonArrayTemp, geoTopo, polygonBounds);
  26579. //岛洞底层判断原则:将所有的子对象按照面积排序,面积最大的直接判定为岛(1),从面积次大的开始处理,
  26580. // 如果发现该对象在某个面积大于它的对象之中(即被包含),则根据包含它的对象的标识(1 or -1),指定其标识(-1 or 1),
  26581. // 依次处理完所有对象,就得到了一个标识数组,1表示岛,-1表示洞
  26582. //目标polygon索引列表 -1标示没有被任何polygon包含,
  26583. var targetArray = [];
  26584. for (var _i6 = 1; _i6 < polygonArrayTemp.length; _i6++) {
  26585. for (var _j2 = _i6 - 1; _j2 >= 0; _j2--) {
  26586. targetArray[_i6] = -1;
  26587. if (polygonBounds[_j2].containsBounds(polygonBounds[_i6])) {
  26588. CCWIdent[_i6] = CCWIdent[_j2] * -1;
  26589. if (CCWIdent[_i6] < 0) {
  26590. targetArray[_i6] = _j2;
  26591. }
  26592. break;
  26593. }
  26594. }
  26595. }
  26596. for (var _i8 = 0; _i8 < polygonArrayTemp.length; _i8++) {
  26597. if (CCWIdent[_i8] > 0) {
  26598. polygonArray.push(polygonArrayTemp[_i8]);
  26599. } else {
  26600. polygonArray[targetArray[_i8]].components = polygonArray[targetArray[_i8]].components.concat(polygonArrayTemp[_i8].components);
  26601. //占位
  26602. polygonArray.push('');
  26603. }
  26604. }
  26605. } else {
  26606. polygonArray = new Array();
  26607. for (var _i10 = 0; _i10 < polygonArrayTemp.length; _i10++) {
  26608. if (geoTopo[_i10] && geoTopo[_i10] == -1) {
  26609. CCWArray = CCWArray.concat(polygonArrayTemp[_i10].components);
  26610. } else {
  26611. if (CCWArray.length > 0 && polygonArray.length > 0) {
  26612. polygonArray[polygonArray.length - 1].components = polygonArray[polygonArray.length - 1].components.concat(CCWArray);
  26613. CCWArray = [];
  26614. }
  26615. polygonArray.push(polygonArrayTemp[_i10]);
  26616. }
  26617. if (_i10 == len - 1) {
  26618. var polyLength = polygonArray.length;
  26619. if (polyLength) {
  26620. polygonArray[polyLength - 1].components = polygonArray[polyLength - 1].components.concat(CCWArray);
  26621. } else {
  26622. for (var k = 0, length = CCWArray.length; k < length; k++) {
  26623. polygonArray.push(new Polygon_Polygon(CCWArray));
  26624. }
  26625. }
  26626. }
  26627. }
  26628. }
  26629. return new MultiPolygon(polygonArray);
  26630. }
  26631. /**
  26632. * @function ServerGeometry.prototype.toGeoRegionEPS
  26633. * @description 将服务端的面几何对象转换为客户端几何对象。类型为 Polygon。
  26634. * @returns {Geometry} 转换后的客户端几何对象。
  26635. */
  26636. }, {
  26637. key: "toGeoRegionEPS",
  26638. value: function toGeoRegionEPS() {
  26639. var me = this,
  26640. geoParts = me.parts || [],
  26641. geoTopo = me.partTopo || [],
  26642. geoPoints = me.points || [],
  26643. len = geoParts.length;
  26644. if (len <= 0) {
  26645. return null;
  26646. }
  26647. var polygonArray = [];
  26648. var pointList = [];
  26649. var lineEPS;
  26650. if (len == 1) {
  26651. for (var i = 0; i < geoPoints.length; i++) {
  26652. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
  26653. }
  26654. lineEPS = LineString.createLineEPS(pointList);
  26655. polygonArray.push(new Polygon_Polygon([new LinearRing_LinearRing(lineEPS)]));
  26656. return new MultiPolygon(polygonArray);
  26657. }
  26658. //处理复杂面
  26659. var CCWArray = [];
  26660. var areaArray = [];
  26661. var polygonArrayTemp = [];
  26662. var polygonBounds = [];
  26663. //polyon岛洞标识数组,初始都是岛。
  26664. var CCWIdent = [];
  26665. for (var _i12 = 0, pointIndex = 0; _i12 < len; _i12++) {
  26666. for (var j = 0; j < geoParts[_i12]; j++) {
  26667. pointList.push(new Point(geoPoints[pointIndex + j].x, geoPoints[pointIndex + j].y));
  26668. }
  26669. pointIndex += geoParts[_i12];
  26670. lineEPS = LineString.createLineEPS(pointList);
  26671. var polygon = new Polygon_Polygon([new LinearRing_LinearRing(lineEPS)]);
  26672. pointList = [];
  26673. polygonArrayTemp.push(polygon);
  26674. if (geoTopo.length === 0) {
  26675. polygonBounds.push(polygon.getBounds());
  26676. }
  26677. CCWIdent.push(1);
  26678. areaArray.push(polygon.getArea());
  26679. }
  26680. //iServer 9D新增字段
  26681. if (geoTopo.length === 0) {
  26682. //根据面积排序
  26683. ServerGeometry.bubbleSort(areaArray, polygonArrayTemp, geoTopo, polygonBounds);
  26684. //岛洞底层判断原则:将所有的子对象按照面积排序,面积最大的直接判定为岛(1),从面积次大的开始处理,
  26685. // 如果发现该对象在某个面积大于它的对象之中(即被包含),则根据包含它的对象的标识(1 or -1),指定其标识(-1 or 1),
  26686. // 依次处理完所有对象,就得到了一个标识数组,1表示岛,-1表示洞
  26687. //目标polygon索引列表 -1标示没有被任何polygon包含,
  26688. var targetArray = [];
  26689. for (var _i14 = 1; _i14 < polygonArrayTemp.length; _i14++) {
  26690. for (var _j4 = _i14 - 1; _j4 >= 0; _j4--) {
  26691. targetArray[_i14] = -1;
  26692. if (polygonBounds[_j4].containsBounds(polygonBounds[_i14])) {
  26693. CCWIdent[_i14] = CCWIdent[_j4] * -1;
  26694. if (CCWIdent[_i14] < 0) {
  26695. targetArray[_i14] = _j4;
  26696. }
  26697. break;
  26698. }
  26699. }
  26700. }
  26701. for (var _i16 = 0; _i16 < polygonArrayTemp.length; _i16++) {
  26702. if (CCWIdent[_i16] > 0) {
  26703. polygonArray.push(polygonArrayTemp[_i16]);
  26704. } else {
  26705. polygonArray[targetArray[_i16]].components = polygonArray[targetArray[_i16]].components.concat(polygonArrayTemp[_i16].components);
  26706. //占位
  26707. polygonArray.push('');
  26708. }
  26709. }
  26710. } else {
  26711. polygonArray = new Array();
  26712. for (var _i18 = 0; _i18 < polygonArrayTemp.length; _i18++) {
  26713. if (geoTopo[_i18] && geoTopo[_i18] == -1) {
  26714. CCWArray = CCWArray.concat(polygonArrayTemp[_i18].components);
  26715. } else {
  26716. if (CCWArray.length > 0 && polygonArray.length > 0) {
  26717. polygonArray[polygonArray.length - 1].components = polygonArray[polygonArray.length - 1].components.concat(CCWArray);
  26718. CCWArray = [];
  26719. }
  26720. polygonArray.push(polygonArrayTemp[_i18]);
  26721. }
  26722. if (_i18 == len - 1) {
  26723. var polyLength = polygonArray.length;
  26724. if (polyLength) {
  26725. polygonArray[polyLength - 1].components = polygonArray[polyLength - 1].components.concat(CCWArray);
  26726. } else {
  26727. for (var k = 0, length = CCWArray.length; k < length; k++) {
  26728. polygonArray.push(new Polygon_Polygon(CCWArray));
  26729. }
  26730. }
  26731. }
  26732. }
  26733. }
  26734. return new MultiPolygon(polygonArray);
  26735. }
  26736. }, {
  26737. key: "transformGeoCompound",
  26738. value: function transformGeoCompound() {
  26739. var me = this,
  26740. geoParts = me.geoParts || [],
  26741. len = geoParts.length;
  26742. if (len <= 0) {
  26743. return null;
  26744. }
  26745. var geometryList = [];
  26746. for (var index = 0; index < len; index++) {
  26747. var geometry = geoParts[index];
  26748. geometryList.push(new ServerGeometry(geometry).toGeometry());
  26749. }
  26750. return new Collection(geometryList);
  26751. }
  26752. /**
  26753. * @function ServerGeometry.prototype.fromJson
  26754. * @description 将 JSON 对象表示服务端几何对象转换为 ServerGeometry。
  26755. * @param {Object} jsonObject - 要转换的 JSON 对象。
  26756. * @returns {ServerGeometry} 转换后的 ServerGeometry 对象。
  26757. */
  26758. }], [{
  26759. key: "fromJson",
  26760. value: function fromJson(jsonObject) {
  26761. if (!jsonObject) {
  26762. return;
  26763. }
  26764. return new ServerGeometry({
  26765. id: jsonObject.id,
  26766. style: ServerStyle.fromJson(jsonObject.style),
  26767. parts: jsonObject.parts,
  26768. partTopo: jsonObject.partTopo,
  26769. points: jsonObject.points,
  26770. center: jsonObject.center,
  26771. length: jsonObject.length,
  26772. maxM: jsonObject.maxM,
  26773. minM: jsonObject.minM,
  26774. type: jsonObject.type
  26775. });
  26776. }
  26777. /**
  26778. * @function ServerGeometry.prototype.fromGeometry
  26779. * @description 将客户端 Geometry 转换成服务端 ServerGeometry。
  26780. * @param {Geometry} geometry - 要转换的客户端 Geometry 对象。
  26781. * @returns {ServerGeometry} 转换后的 ServerGeometry 对象。
  26782. */
  26783. }, {
  26784. key: "fromGeometry",
  26785. value: function fromGeometry(geometry) {
  26786. if (!geometry) {
  26787. return;
  26788. }
  26789. var id = 0,
  26790. parts = [],
  26791. points = [],
  26792. type = null,
  26793. icomponents = geometry.components,
  26794. className = geometry.CLASS_NAME,
  26795. prjCoordSys = {
  26796. epsgCode: geometry.SRID
  26797. };
  26798. if (!isNaN(geometry.id)) {
  26799. id = geometry.id;
  26800. }
  26801. //坑爹的改法,没法,为了支持态势标绘,有时间就得全改
  26802. if (className != 'SuperMap.Geometry.LinearRing' && className != 'SuperMap.Geometry.LineString' && (geometry instanceof MultiPoint || geometry instanceof MultiLineString)) {
  26803. var ilen = icomponents.length;
  26804. for (var i = 0; i < ilen; i++) {
  26805. var vertices = icomponents[i].getVertices();
  26806. var partPointsCount = vertices.length;
  26807. parts.push(partPointsCount);
  26808. for (var j = 0; j < partPointsCount; j++) {
  26809. points.push(new Point(vertices[j].x, vertices[j].y));
  26810. }
  26811. }
  26812. //这里className不是多点就全部是算线
  26813. type = className == 'SuperMap.Geometry.MultiPoint' ? REST_GeometryType.POINT : REST_GeometryType.LINE;
  26814. } else if (geometry instanceof MultiPolygon) {
  26815. var _ilen = icomponents.length;
  26816. for (var _i20 = 0; _i20 < _ilen; _i20++) {
  26817. var polygon = icomponents[_i20],
  26818. linearRingOfPolygon = polygon.components,
  26819. linearRingOfPolygonLen = linearRingOfPolygon.length;
  26820. for (var _j6 = 0; _j6 < linearRingOfPolygonLen; _j6++) {
  26821. var _vertices = linearRingOfPolygon[_j6].getVertices();
  26822. var _partPointsCount = _vertices.length + 1;
  26823. parts.push(_partPointsCount);
  26824. for (var k = 0; k < _partPointsCount - 1; k++) {
  26825. points.push(new Point(_vertices[k].x, _vertices[k].y));
  26826. }
  26827. points.push(new Point(_vertices[0].x, _vertices[0].y));
  26828. }
  26829. }
  26830. type = REST_GeometryType.REGION;
  26831. } else if (geometry instanceof Polygon_Polygon) {
  26832. var _ilen2 = icomponents.length;
  26833. for (var _i22 = 0; _i22 < _ilen2; _i22++) {
  26834. var _vertices2 = icomponents[_i22].getVertices();
  26835. var _partPointsCount2 = _vertices2.length + 1;
  26836. parts.push(_partPointsCount2);
  26837. for (var _j8 = 0; _j8 < _partPointsCount2 - 1; _j8++) {
  26838. points.push(new Point(_vertices2[_j8].x, _vertices2[_j8].y));
  26839. }
  26840. points.push(new Point(_vertices2[0].x, _vertices2[0].y));
  26841. }
  26842. type = REST_GeometryType.REGION;
  26843. } else {
  26844. var _vertices3 = geometry.getVertices();
  26845. var geometryVerticesCount = _vertices3.length;
  26846. for (var _j10 = 0; _j10 < geometryVerticesCount; _j10++) {
  26847. points.push(new Point(_vertices3[_j10].x, _vertices3[_j10].y));
  26848. }
  26849. if (geometry instanceof LinearRing_LinearRing) {
  26850. points.push(new Point(_vertices3[0].x, _vertices3[0].y));
  26851. geometryVerticesCount++;
  26852. }
  26853. parts.push(geometryVerticesCount);
  26854. type = geometry instanceof Point ? REST_GeometryType.POINT : REST_GeometryType.LINE;
  26855. }
  26856. return new ServerGeometry({
  26857. id: id,
  26858. style: null,
  26859. parts: parts,
  26860. points: points,
  26861. type: type,
  26862. prjCoordSys: prjCoordSys
  26863. });
  26864. }
  26865. /**
  26866. * @function ServerGeometry.prototype.IsClockWise
  26867. * @description 判断 linearRing 中的点的顺序。返回值大于 0,逆时针;小于 0,顺时针。
  26868. * @param {Geometry} geometry - 要转换的客户端 Geometry 对象。
  26869. * @returns {number} 返回值大于 0,逆时针;小于 0,顺时针。
  26870. */
  26871. }, {
  26872. key: "IsClockWise",
  26873. value: function IsClockWise(points) {
  26874. var length = points.length;
  26875. if (length < 3) {
  26876. return 0.0;
  26877. }
  26878. var s = points[0].y * (points[length - 1].x - points[1].x);
  26879. points.push(points[0]);
  26880. for (var i = 1; i < length; i++) {
  26881. s += points[i].y * (points[i - 1].x - points[i + 1].x);
  26882. }
  26883. return s * 0.5;
  26884. }
  26885. }, {
  26886. key: "bubbleSort",
  26887. value: function bubbleSort(areaArray, pointList, geoTopo, polygonBounds) {
  26888. for (var i = 0; i < areaArray.length; i++) {
  26889. for (var j = 0; j < areaArray.length; j++) {
  26890. if (areaArray[i] > areaArray[j]) {
  26891. var d = areaArray[j];
  26892. areaArray[j] = areaArray[i];
  26893. areaArray[i] = d;
  26894. var b = pointList[j];
  26895. pointList[j] = pointList[i];
  26896. pointList[i] = b;
  26897. if (geoTopo && geoTopo.length > 0) {
  26898. var c = geoTopo[j];
  26899. geoTopo[j] = geoTopo[i];
  26900. geoTopo[i] = c;
  26901. }
  26902. if (polygonBounds && polygonBounds.length > 0) {
  26903. var f = polygonBounds[j];
  26904. polygonBounds[j] = polygonBounds[i];
  26905. polygonBounds[i] = f;
  26906. }
  26907. }
  26908. }
  26909. }
  26910. }
  26911. }]);
  26912. return ServerGeometry;
  26913. }();
  26914. ;// CONCATENATED MODULE: ./src/common/format/GeoJSON.js
  26915. function GeoJSON_typeof(obj) { "@babel/helpers - typeof"; return GeoJSON_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GeoJSON_typeof(obj); }
  26916. function GeoJSON_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26917. function GeoJSON_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  26918. function GeoJSON_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoJSON_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoJSON_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  26919. function GeoJSON_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GeoJSON_get = Reflect.get.bind(); } else { GeoJSON_get = function _get(target, property, receiver) { var base = GeoJSON_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GeoJSON_get.apply(this, arguments); }
  26920. function GeoJSON_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoJSON_getPrototypeOf(object); if (object === null) break; } return object; }
  26921. function GeoJSON_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GeoJSON_setPrototypeOf(subClass, superClass); }
  26922. function GeoJSON_setPrototypeOf(o, p) { GeoJSON_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoJSON_setPrototypeOf(o, p); }
  26923. function GeoJSON_createSuper(Derived) { var hasNativeReflectConstruct = GeoJSON_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeoJSON_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeoJSON_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeoJSON_possibleConstructorReturn(this, result); }; }
  26924. function GeoJSON_possibleConstructorReturn(self, call) { if (call && (GeoJSON_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GeoJSON_assertThisInitialized(self); }
  26925. function GeoJSON_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  26926. function GeoJSON_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  26927. function GeoJSON_getPrototypeOf(o) { GeoJSON_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoJSON_getPrototypeOf(o); }
  26928. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  26929. * This program are made available under the terms of the Apache License, Version 2.0
  26930. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26931. /**
  26932. * @class GeoJSONFormat
  26933. * @aliasclass Format.GeoJSON
  26934. * @deprecatedclass SuperMap.Format.GeoJSON
  26935. * @classdesc GeoJSON 的读和写。使用 {@link GeoJSONObject} 构造器创建一个 GeoJSON 解析器。
  26936. * @category BaseTypes Format
  26937. * @param {Object} [options] - 可选参数。
  26938. * @param {string} [options.indent=" "] - 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
  26939. * @param {string} [options.space=" "] - 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
  26940. * @param {string} [options.newline="\n"] - 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
  26941. * @param {number} [options.level=0] - 用于格式化输出, 表示的是缩进级别。
  26942. * @param {boolean} [options.pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  26943. * @param {boolean} [options.nativeJSON] - 需要被注册的监听器对象。
  26944. * @param {boolean} [options.ignoreExtraDims=true] - 忽略维度超过 2 的几何要素。
  26945. * @extends {JSONFormat}
  26946. * @usage
  26947. */
  26948. var GeoJSON = /*#__PURE__*/function (_JSONFormat) {
  26949. GeoJSON_inherits(GeoJSON, _JSONFormat);
  26950. var _super = GeoJSON_createSuper(GeoJSON);
  26951. function GeoJSON(options) {
  26952. var _this;
  26953. GeoJSON_classCallCheck(this, GeoJSON);
  26954. _this = _super.call(this, options);
  26955. /**
  26956. * @member {boolean} [GeoJSONFormat.prototype.ignoreExtraDims=true]
  26957. * @description 忽略维度超过 2 的几何要素。
  26958. */
  26959. _this.ignoreExtraDims = true;
  26960. _this.CLASS_NAME = "SuperMap.Format.GeoJSON";
  26961. /**
  26962. * @member {Object} GeoJSONFormat.prototype.parseCoords
  26963. * @private
  26964. * @description 一个属性名对应着 GeoJSON 对象的几何类型的对象。每个属性其实都是一个实际上做解析用的方法。
  26965. */
  26966. _this.parseCoords = {
  26967. /**
  26968. * @function GeoJSONFormat.parseCoords.point
  26969. * @description 将一组坐标转成一个 {@link Geometry} 对象。
  26970. * @param {Object} array - GeoJSON 片段中的一组坐标。
  26971. * @returns {Geometry} 一个几何对象。
  26972. */
  26973. "point": function point(array) {
  26974. if (this.ignoreExtraDims === false && array.length != 2) {
  26975. throw "Only 2D points are supported: " + array;
  26976. }
  26977. return new Point(array[0], array[1]);
  26978. },
  26979. /**
  26980. * @function GeoJSONFormat.parseCoords.multipoint
  26981. * @description 将坐标组数组转化成为一个 {@link Geometry} 对象。
  26982. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  26983. * @returns {Geometry} 一个几何对象。
  26984. */
  26985. "multipoint": function multipoint(array) {
  26986. var points = [];
  26987. var p = null;
  26988. for (var i = 0, len = array.length; i < len; ++i) {
  26989. try {
  26990. p = this.parseCoords["point"].apply(this, [array[i]]);
  26991. } catch (err) {
  26992. throw err;
  26993. }
  26994. points.push(p);
  26995. }
  26996. return new MultiPoint(points);
  26997. },
  26998. /**
  26999. * @function GeoJSONFormat.parseCoords.linestring
  27000. * @description 将坐标组数组转化成为一个 {@link Geometry} 对象。
  27001. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  27002. * @returns {Geometry} 一个几何对象。
  27003. */
  27004. "linestring": function linestring(array) {
  27005. var points = [];
  27006. var p = null;
  27007. for (var i = 0, len = array.length; i < len; ++i) {
  27008. try {
  27009. p = this.parseCoords["point"].apply(this, [array[i]]);
  27010. } catch (err) {
  27011. throw err;
  27012. }
  27013. points.push(p);
  27014. }
  27015. return new LineString(points);
  27016. },
  27017. /**
  27018. * @function GeoJSONFormat.parseCoords.multilinestring
  27019. * @description 将坐标组数组转化成为一个 {@link Geometry} 对象。
  27020. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  27021. * @returns {Geometry} 一个几何对象。
  27022. */
  27023. "multilinestring": function multilinestring(array) {
  27024. var lines = [];
  27025. var l = null;
  27026. for (var i = 0, len = array.length; i < len; ++i) {
  27027. try {
  27028. l = this.parseCoords["linestring"].apply(this, [array[i]]);
  27029. } catch (err) {
  27030. throw err;
  27031. }
  27032. lines.push(l);
  27033. }
  27034. return new MultiLineString(lines);
  27035. },
  27036. /**
  27037. * @function GeoJSONFormat.parseCoords.polygon
  27038. * @description 将坐标组数组转化成为一个 {@link Geometry} 对象。
  27039. * @returns {Geometry} 一个几何对象。
  27040. */
  27041. "polygon": function polygon(array) {
  27042. var rings = [];
  27043. var r, l;
  27044. for (var i = 0, len = array.length; i < len; ++i) {
  27045. try {
  27046. l = this.parseCoords["linestring"].apply(this, [array[i]]);
  27047. } catch (err) {
  27048. throw err;
  27049. }
  27050. r = new LinearRing_LinearRing(l.components);
  27051. rings.push(r);
  27052. }
  27053. return new Polygon_Polygon(rings);
  27054. },
  27055. /**
  27056. * @function GeoJSONFormat.parseCoords.multipolygon
  27057. * @description 将坐标组数组转化成为一个 {@link Geometry} 对象。
  27058. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  27059. * @returns {Geometry} 一个几何对象。
  27060. */
  27061. "multipolygon": function multipolygon(array) {
  27062. var polys = [];
  27063. var p = null;
  27064. for (var i = 0, len = array.length; i < len; ++i) {
  27065. try {
  27066. p = this.parseCoords["polygon"].apply(this, [array[i]]);
  27067. } catch (err) {
  27068. throw err;
  27069. }
  27070. polys.push(p);
  27071. }
  27072. return new MultiPolygon(polys);
  27073. },
  27074. /**
  27075. * @function GeoJSONFormat.parseCoords.box
  27076. * @description 将坐标组数组转化成为一个 {@link Geometry} 对象。
  27077. * @param {Array} array - GeoJSON 片段中的坐标组数组。
  27078. * @returns {Geometry} 一个几何对象。
  27079. */
  27080. "box": function box(array) {
  27081. if (array.length != 2) {
  27082. throw "GeoJSON box coordinates must have 2 elements";
  27083. }
  27084. return new Polygon_Polygon([new LinearRing_LinearRing([new Point(array[0][0], array[0][1]), new Point(array[1][0], array[0][1]), new Point(array[1][0], array[1][1]), new Point(array[0][0], array[1][1]), new Point(array[0][0], array[0][1])])]);
  27085. }
  27086. };
  27087. /**
  27088. * @member {Object} GeoJSONFormat.prototype.extract
  27089. * @private
  27090. * @description 一个属性名对应着GeoJSON类型的对象。其值为相应的实际的解析方法。
  27091. */
  27092. _this.extract = {
  27093. /**
  27094. * @function GeoJSONFormat.extract.feature
  27095. * @description 返回一个表示单个要素对象的 GeoJSON 的一部分。
  27096. * @param {SuperMap.ServerFeature} feature - iServer 要素对象。
  27097. * @returns {Object} 一个表示点的对象。
  27098. */
  27099. 'feature': function feature(_feature) {
  27100. var geom = this.extract.geometry.apply(this, [_feature.geometry]);
  27101. var json = {
  27102. "type": "Feature",
  27103. "properties": this.createAttributes(_feature),
  27104. "geometry": geom
  27105. };
  27106. if (_feature.geometry && _feature.geometry.type === 'TEXT') {
  27107. json.properties.texts = _feature.geometry.texts;
  27108. json.properties.textStyle = _feature.geometry.textStyle;
  27109. }
  27110. if (_feature.fid) {
  27111. json.id = _feature.fid;
  27112. }
  27113. if (_feature.ID) {
  27114. json.id = _feature.ID;
  27115. }
  27116. return json;
  27117. },
  27118. /**
  27119. * @function GeoJSONFormat.extract.geometry
  27120. * @description 返回一个表示单个几何对象的 GeoJSON 的一部分。
  27121. * @param {Object} geometry - iServer 几何对象。
  27122. * @returns {Object} 一个表示几何体的对象。
  27123. */
  27124. 'geometry': function geometry(_geometry) {
  27125. if (_geometry == null) {
  27126. return null;
  27127. }
  27128. if (!_geometry.parts && _geometry.points) {
  27129. _geometry.parts = [_geometry.points.length];
  27130. }
  27131. var geo = _geometry.hasOwnProperty('geometryType') ? _geometry : new ServerGeometry(_geometry).toGeometry() || _geometry;
  27132. var geometryType = geo.geometryType || geo.type;
  27133. var data;
  27134. if (geometryType === "LinearRing") {
  27135. geometryType = "LineString";
  27136. }
  27137. if (geometryType === "LINEM") {
  27138. geometryType = "MultiLineString";
  27139. }
  27140. data = this.extract[geometryType.toLowerCase()].apply(this, [geo]);
  27141. geometryType = geometryType === 'TEXT' ? 'Point' : geometryType;
  27142. var json;
  27143. if (geometryType === "Collection") {
  27144. json = {
  27145. "type": "GeometryCollection",
  27146. "geometries": data
  27147. };
  27148. } else {
  27149. json = {
  27150. "type": geometryType,
  27151. "coordinates": data
  27152. };
  27153. }
  27154. return json;
  27155. },
  27156. /**
  27157. * @function GeoJSONFormat.extract.point
  27158. * @description 从一个点对象中返回一个坐标组。
  27159. * @param {GeometryPoint} point - 一个点对象。
  27160. * @returns {Array} 一个表示一个点的坐标组。
  27161. */
  27162. 'point': function point(_point) {
  27163. var p = [_point.x, _point.y];
  27164. for (var name in _point) {
  27165. if (name !== "x" && name !== "y" && _point[name] !== null && !isNaN(_point[name])) {
  27166. p.push(_point[name]);
  27167. }
  27168. }
  27169. return p;
  27170. },
  27171. /**
  27172. * @function GeoJSONFormat.extract.point
  27173. * @description 从一个文本对象中返回一个坐标组。
  27174. * @param {Object} geo - 一个文本对象。
  27175. * @returns {Array} 一个表示一个点的坐标组。
  27176. */
  27177. 'text': function text(geo) {
  27178. return [geo.points[0].x, geo.points[0].y];
  27179. },
  27180. /**
  27181. * @function GeoJSONFormat.extract.multipoint
  27182. * @description 从一个多点对象中返一个坐标组数组。
  27183. * @param {GeometryMultiPoint} multipoint - 多点对象。
  27184. * @returns {Array} 一个表示多点的坐标组数组。
  27185. */
  27186. 'multipoint': function multipoint(_multipoint) {
  27187. var array = [];
  27188. for (var i = 0, len = _multipoint.components.length; i < len; ++i) {
  27189. array.push(this.extract.point.apply(this, [_multipoint.components[i]]));
  27190. }
  27191. return array;
  27192. },
  27193. /**
  27194. * @function GeoJSONFormat.extract.linestring
  27195. * @description 从一个线对象中返回一个坐标组数组。
  27196. * @param {Linestring} linestring - 线对象。
  27197. * @returns {Array} 一个表示线对象的坐标组数组。
  27198. */
  27199. 'linestring': function linestring(_linestring) {
  27200. var array = [];
  27201. for (var i = 0, len = _linestring.components.length; i < len; ++i) {
  27202. array.push(this.extract.point.apply(this, [_linestring.components[i]]));
  27203. }
  27204. return array;
  27205. },
  27206. /**
  27207. * @function GeoJSONFormat.extract.multilinestring
  27208. * @description 从一个多线对象中返回一个线数组。
  27209. * @param {GeometryMultiLineString} multilinestring - 多线对象。
  27210. *
  27211. * @returns {Array} 一个表示多线的线数组。
  27212. */
  27213. 'multilinestring': function multilinestring(_multilinestring) {
  27214. var array = [];
  27215. for (var i = 0, len = _multilinestring.components.length; i < len; ++i) {
  27216. array.push(this.extract.linestring.apply(this, [_multilinestring.components[i]]));
  27217. }
  27218. return array;
  27219. },
  27220. /**
  27221. * @function GeoJSONFormat.extract.polygon
  27222. * @description 从一个面对象中返回一组线环。
  27223. * @param {GeometryPolygon} polygon - 面对象。
  27224. * @returns {Array} 一组表示面的线环。
  27225. */
  27226. 'polygon': function polygon(_polygon) {
  27227. var array = [];
  27228. for (var i = 0, len = _polygon.components.length; i < len; ++i) {
  27229. array.push(this.extract.linestring.apply(this, [_polygon.components[i]]));
  27230. }
  27231. return array;
  27232. },
  27233. /**
  27234. * @function GeoJSONFormat.extract.multipolygon
  27235. * @description 从一个多面对象中返回一组面。
  27236. * @param {GeometryMultiPolygon} multipolygon - 多面对象。
  27237. * @returns {Array} 一组表示多面的面。
  27238. */
  27239. 'multipolygon': function multipolygon(_multipolygon) {
  27240. var array = [];
  27241. for (var i = 0, len = _multipolygon.components.length; i < len; ++i) {
  27242. array.push(this.extract.polygon.apply(this, [_multipolygon.components[i]]));
  27243. }
  27244. return array;
  27245. },
  27246. /**
  27247. * @function GeoJSONFormat.extract.collection
  27248. * @description 从一个几何要素集合中一组几何要素数组。
  27249. * @param {GeometryCollection} collection - 几何要素集合。
  27250. * @returns {Array} 一组表示几何要素集合的几何要素数组。
  27251. */
  27252. 'collection': function collection(_collection) {
  27253. var len = _collection.components.length;
  27254. var array = new Array(len);
  27255. for (var i = 0; i < len; ++i) {
  27256. array[i] = this.extract.geometry.apply(this, [_collection.components[i]]);
  27257. }
  27258. return array;
  27259. }
  27260. };
  27261. return _this;
  27262. }
  27263. /**
  27264. * @function GeoJSONFormat.prototype.read
  27265. * @description 将 GeoJSON 对象或者GeoJSON 对象字符串转换为 SuperMap Feature 对象。
  27266. * @param {GeoJSONObject} json - GeoJSON 对象。
  27267. * @param {string} [type='FeaureCollection'] - 可选的字符串,它决定了输出的格式。支持的值有:"Geometry","Feature",和 "FeatureCollection",如果此值为null。
  27268. * @param {function} filter - 对象中每个层次每个键值对都会调用此函数得出一个结果。每个值都会被 filter 函数的结果所替换掉。这个函数可被用来将某些对象转化成某个类相应的对象,或者将日期字符串转化成Date对象。
  27269. * @returns {Object} 返回值依赖于 type 参数的值。
  27270. * -如果 type 等于 "FeatureCollection",返回值将会是 {@link FeatureVector} 数组。
  27271. * -如果 type 为 "Geometry",输入的 JSON 对象必须表示一个唯一的几何体,然后返回值就会是 {@link Geometry}。
  27272. * -如果 type 为 "Feature",输入的 JSON 对象也必须表示的一个要素,这样返回值才会是 {@link FeatureVector}。
  27273. */
  27274. GeoJSON_createClass(GeoJSON, [{
  27275. key: "read",
  27276. value: function read(json, type, filter) {
  27277. type = type ? type : "FeatureCollection";
  27278. var results = null;
  27279. var obj = null;
  27280. if (typeof json == "string") {
  27281. obj = GeoJSON_get(GeoJSON_getPrototypeOf(GeoJSON.prototype), "read", this).call(this, json, filter);
  27282. } else {
  27283. obj = json;
  27284. }
  27285. if (!obj) {
  27286. //console.error("Bad JSON: " + json);
  27287. } else if (typeof obj.type != "string") {
  27288. //console.error("Bad GeoJSON - no type: " + json);
  27289. } else if (this.isValidType(obj, type)) {
  27290. switch (type) {
  27291. case "Geometry":
  27292. try {
  27293. results = this.parseGeometry(obj);
  27294. } catch (err) {
  27295. //console.error(err);
  27296. }
  27297. break;
  27298. case "Feature":
  27299. try {
  27300. results = this.parseFeature(obj);
  27301. results.type = "Feature";
  27302. } catch (err) {
  27303. //console.error(err);
  27304. }
  27305. break;
  27306. case "FeatureCollection":
  27307. // for type FeatureCollection, we allow input to be any type
  27308. results = [];
  27309. switch (obj.type) {
  27310. case "Feature":
  27311. try {
  27312. results.push(this.parseFeature(obj));
  27313. } catch (err) {
  27314. results = null;
  27315. //console.error(err);
  27316. }
  27317. break;
  27318. case "FeatureCollection":
  27319. for (var i = 0, len = obj.features.length; i < len; ++i) {
  27320. try {
  27321. results.push(this.parseFeature(obj.features[i]));
  27322. } catch (err) {
  27323. results = null;
  27324. // console.error(err);
  27325. }
  27326. }
  27327. break;
  27328. default:
  27329. try {
  27330. var geom = this.parseGeometry(obj);
  27331. results.push(new Vector(geom));
  27332. } catch (err) {
  27333. results = null;
  27334. //console.error(err);
  27335. }
  27336. }
  27337. break;
  27338. default:
  27339. break;
  27340. }
  27341. }
  27342. return results;
  27343. }
  27344. /**
  27345. * @function GeoJSONFormat.prototype.write
  27346. * @description iServer Geometry JSON 对象 转 GeoJSON对象字符串。
  27347. * @param {Object} obj - iServer Geometry JSON 对象。
  27348. * @param {boolean} [pretty=false] - 是否使用换行和缩进来控制输出。
  27349. * @returns {GeoJSONObject} 一个 GeoJSON 字符串,它表示了输入的几何对象,要素对象,或者要素对象数组。
  27350. */
  27351. }, {
  27352. key: "write",
  27353. value: function write(obj, pretty) {
  27354. return GeoJSON_get(GeoJSON_getPrototypeOf(GeoJSON.prototype), "write", this).call(this, this.toGeoJSON(obj), pretty);
  27355. }
  27356. /**
  27357. * @function GeoJSONFormat.prototype.fromGeoJSON
  27358. * @version 9.1.1
  27359. * @description 将 GeoJSON 对象或者GeoJSON 对象字符串转换为iServer Feature JSON。
  27360. * @param {GeoJSONObject} json - GeoJSON 对象。
  27361. * @param {string} [type='FeaureCollection'] - 可选的字符串,它决定了输出的格式。支持的值有:"Geometry","Feature",和 "FeatureCollection",如果此值为null。
  27362. * @param {function} filter - 对象中每个层次每个键值对都会调用此函数得出一个结果。每个值都会被 filter 函数的结果所替换掉。这个函数可被用来将某些对象转化成某个类相应的对象,或者将日期字符串转化成Date对象。
  27363. * @returns {Object} iServer Feature JSON。
  27364. */
  27365. }, {
  27366. key: "fromGeoJSON",
  27367. value: function fromGeoJSON(json, type, filter) {
  27368. var _this2 = this;
  27369. var feature = this.read(json, type, filter);
  27370. if (!Util_Util.isArray(feature)) {
  27371. return this._toiSevrerFeature(feature);
  27372. }
  27373. return feature.map(function (element) {
  27374. return _this2._toiSevrerFeature(element);
  27375. });
  27376. }
  27377. /**
  27378. * @function GeoJSONFormat.prototype.toGeoJSON
  27379. * @version 9.1.1
  27380. * @description 将 iServer Feature JSON 对象转换为 GeoJSON 对象。
  27381. * @param {Object} obj - iServer Feature JSON。
  27382. * @returns {GeoJSONObject} GeoJSON 对象。
  27383. */
  27384. }, {
  27385. key: "toGeoJSON",
  27386. value: function toGeoJSON(obj) {
  27387. var geojson = {
  27388. "type": null
  27389. };
  27390. if (Util_Util.isArray(obj)) {
  27391. geojson.type = "FeatureCollection";
  27392. var numFeatures = obj.length;
  27393. geojson.features = new Array(numFeatures);
  27394. for (var i = 0; i < numFeatures; ++i) {
  27395. var element = obj[i];
  27396. if (isGeometry(element)) {
  27397. var feature = {};
  27398. feature.geometry = element;
  27399. geojson.features[i] = this.extract.feature.apply(this, [feature]);
  27400. } else {
  27401. geojson.features[i] = this.extract.feature.apply(this, [element]);
  27402. }
  27403. }
  27404. } else if (isGeometry(obj)) {
  27405. var _feature2 = {};
  27406. _feature2.geometry = obj;
  27407. geojson = this.extract.feature.apply(this, [_feature2]);
  27408. } else {
  27409. geojson = this.extract.feature.apply(this, [obj]);
  27410. }
  27411. function isGeometry(input) {
  27412. return input.hasOwnProperty("parts") && input.hasOwnProperty("points") || input.hasOwnProperty("geoParts");
  27413. }
  27414. return geojson;
  27415. }
  27416. /**
  27417. * @function GeoJSONFormat.prototype.isValidType
  27418. * @description 检查一个 GeoJSON 对象是否和给定的类型相符的合法的对象。
  27419. * @returns {boolean} GeoJSON 是否是给定类型的合法对象。
  27420. * @private
  27421. */
  27422. }, {
  27423. key: "isValidType",
  27424. value: function isValidType(obj, type) {
  27425. var valid = false;
  27426. switch (type) {
  27427. case "Geometry":
  27428. if (Util_Util.indexOf(["Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection"], obj.type) == -1) {
  27429. // unsupported geometry type
  27430. //console.error("Unsupported geometry type: " +
  27431. // obj.type);
  27432. } else {
  27433. valid = true;
  27434. }
  27435. break;
  27436. case "FeatureCollection":
  27437. // allow for any type to be converted to a feature collection
  27438. valid = true;
  27439. break;
  27440. default:
  27441. // for Feature types must match
  27442. if (obj.type == type) {
  27443. valid = true;
  27444. } else {
  27445. //console.error("Cannot convert types from " +
  27446. //obj.type + " to " + type);
  27447. }
  27448. }
  27449. return valid;
  27450. }
  27451. /**
  27452. * @function GeoJSONFormat.prototype.parseFeature
  27453. * @description 将一个 GeoJSON 中的 feature 转化成 {@link FeatureVector}> 对象。
  27454. * @private
  27455. * @param {GeoJSONObject} obj - 从 GeoJSON 对象中创建一个对象。
  27456. * @returns {FeatureVector} 一个要素。
  27457. */
  27458. }, {
  27459. key: "parseFeature",
  27460. value: function parseFeature(obj) {
  27461. var feature, geometry, attributes, bbox;
  27462. attributes = obj.properties ? obj.properties : {};
  27463. bbox = obj.geometry && obj.geometry.bbox || obj.bbox;
  27464. try {
  27465. geometry = this.parseGeometry(obj.geometry);
  27466. } catch (err) {
  27467. // deal with bad geometries
  27468. throw err;
  27469. }
  27470. feature = new Vector(geometry, attributes);
  27471. if (bbox) {
  27472. feature.bounds = Bounds.fromArray(bbox);
  27473. }
  27474. if (obj.id) {
  27475. feature.geometry.id = obj.id;
  27476. feature.fid = obj.id;
  27477. }
  27478. return feature;
  27479. }
  27480. /**
  27481. * @function GeoJSONFormat.prototype.parseGeometry
  27482. * @description 将一个 GeoJSON 中的几何要素转化成 {@link Geometry} 对象。
  27483. * @param {GeoJSONObject} obj - 从 GeoJSON 对象中创建一个对象。
  27484. * @returns {Geometry} 一个几何要素。
  27485. * @private
  27486. */
  27487. }, {
  27488. key: "parseGeometry",
  27489. value: function parseGeometry(obj) {
  27490. if (obj == null) {
  27491. return null;
  27492. }
  27493. var geometry;
  27494. if (obj.type == "GeometryCollection") {
  27495. if (!Util_Util.isArray(obj.geometries)) {
  27496. throw "GeometryCollection must have geometries array: " + obj;
  27497. }
  27498. var numGeom = obj.geometries.length;
  27499. var components = new Array(numGeom);
  27500. for (var i = 0; i < numGeom; ++i) {
  27501. components[i] = this.parseGeometry.apply(this, [obj.geometries[i]]);
  27502. }
  27503. geometry = new Collection(components);
  27504. } else {
  27505. if (!Util_Util.isArray(obj.coordinates)) {
  27506. throw "Geometry must have coordinates array: " + obj;
  27507. }
  27508. if (!this.parseCoords[obj.type.toLowerCase()]) {
  27509. throw "Unsupported geometry type: " + obj.type;
  27510. }
  27511. try {
  27512. geometry = this.parseCoords[obj.type.toLowerCase()].apply(this, [obj.coordinates]);
  27513. } catch (err) {
  27514. // deal with bad coordinates
  27515. throw err;
  27516. }
  27517. }
  27518. return geometry;
  27519. }
  27520. /**
  27521. * @function GeoJSONFormat.prototype.createCRSObject
  27522. * @description 从一个要素对象中创建一个坐标参考系对象。
  27523. * @param {FeatureVector} object - 要素对象。
  27524. * @private
  27525. * @returns {GeoJSONObject} 一个可作为 GeoJSON 对象的 CRS 属性使用的对象。
  27526. */
  27527. }, {
  27528. key: "createCRSObject",
  27529. value: function createCRSObject(object) {
  27530. var proj = object.layer.projection.toString();
  27531. var crs = {};
  27532. if (proj.match(/epsg:/i)) {
  27533. var code = parseInt(proj.substring(proj.indexOf(":") + 1));
  27534. if (code == 4326) {
  27535. crs = {
  27536. "type": "name",
  27537. "properties": {
  27538. "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
  27539. }
  27540. };
  27541. } else {
  27542. crs = {
  27543. "type": "name",
  27544. "properties": {
  27545. "name": "EPSG:" + code
  27546. }
  27547. };
  27548. }
  27549. }
  27550. return crs;
  27551. }
  27552. }, {
  27553. key: "_toiSevrerFeature",
  27554. value: function _toiSevrerFeature(feature) {
  27555. var attributes = feature.attributes;
  27556. var attrNames = [];
  27557. var attrValues = [];
  27558. for (var attr in attributes) {
  27559. attrNames.push(attr);
  27560. attrValues.push(attributes[attr]);
  27561. }
  27562. var newFeature = {
  27563. fieldNames: attrNames,
  27564. fieldValues: attrValues,
  27565. geometry: ServerGeometry.fromGeometry(feature.geometry)
  27566. };
  27567. newFeature.geometry.id = feature.fid;
  27568. return newFeature;
  27569. }
  27570. }, {
  27571. key: "createAttributes",
  27572. value: function createAttributes(feature) {
  27573. if (!feature) {
  27574. return null;
  27575. }
  27576. var attr = {};
  27577. processFieldsAttributes(feature, attr);
  27578. var exceptKeys = ["fieldNames", "fieldValues", "geometry", "stringID", "ID"];
  27579. for (var key in feature) {
  27580. if (exceptKeys.indexOf(key) > -1) {
  27581. continue;
  27582. }
  27583. attr[key] = feature[key];
  27584. }
  27585. function processFieldsAttributes(feature, attributes) {
  27586. if (!(feature.hasOwnProperty("fieldNames") && feature.hasOwnProperty("fieldValues"))) {
  27587. return;
  27588. }
  27589. var names = feature.fieldNames,
  27590. values = feature.fieldValues;
  27591. for (var i in names) {
  27592. attributes[names[i]] = values[i];
  27593. }
  27594. }
  27595. return attr;
  27596. }
  27597. }]);
  27598. return GeoJSON;
  27599. }(JSONFormat);
  27600. ;// CONCATENATED MODULE: ./src/common/format/WKT.js
  27601. function WKT_typeof(obj) { "@babel/helpers - typeof"; return WKT_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, WKT_typeof(obj); }
  27602. function WKT_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27603. function WKT_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  27604. function WKT_createClass(Constructor, protoProps, staticProps) { if (protoProps) WKT_defineProperties(Constructor.prototype, protoProps); if (staticProps) WKT_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  27605. function WKT_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) WKT_setPrototypeOf(subClass, superClass); }
  27606. function WKT_setPrototypeOf(o, p) { WKT_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return WKT_setPrototypeOf(o, p); }
  27607. function WKT_createSuper(Derived) { var hasNativeReflectConstruct = WKT_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = WKT_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = WKT_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return WKT_possibleConstructorReturn(this, result); }; }
  27608. function WKT_possibleConstructorReturn(self, call) { if (call && (WKT_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return WKT_assertThisInitialized(self); }
  27609. function WKT_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  27610. function WKT_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  27611. function WKT_getPrototypeOf(o) { WKT_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WKT_getPrototypeOf(o); }
  27612. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  27613. * This program are made available under the terms of the Apache License, Version 2.0
  27614. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27615. /**
  27616. * @class WKTFormat
  27617. * @aliasclass Format.WKT
  27618. * @deprecatedclass SuperMap.Format.WKT
  27619. * @classdesc 用于读写常见文本的类。通过 {@link WKTFormat} 构造器来创建一个新的实例。
  27620. * @category BaseTypes Format
  27621. * @extends {Format}
  27622. * @param {Object} options - 可选的选项对象,其属性将被设置到实例。option 具体配置项继承自 {@link Format}。
  27623. * @usage
  27624. */
  27625. var WKT = /*#__PURE__*/function (_Format) {
  27626. WKT_inherits(WKT, _Format);
  27627. var _super = WKT_createSuper(WKT);
  27628. function WKT(options) {
  27629. var _this;
  27630. WKT_classCallCheck(this, WKT);
  27631. _this = _super.call(this, options);
  27632. _this.regExes = {
  27633. 'typeStr': /^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,
  27634. 'spaces': /\s+/,
  27635. 'parenComma': /\)\s*,\s*\(/,
  27636. 'doubleParenComma': /\)\s*\)\s*,\s*\(\s*\(/,
  27637. // can't use {2} here
  27638. 'trimParens': /^\s*\(?(.*?)\)?\s*$/
  27639. };
  27640. _this.CLASS_NAME = "SuperMap.Format.WKT"; /**
  27641. * @private
  27642. * @description Object with properties corresponding to the geometry types.
  27643. * Property values are functions that do the actual data extraction.
  27644. */
  27645. _this.extract = {
  27646. /**
  27647. * @description Return a space delimited string of point coordinates.
  27648. * @param {GeometryPoint} point
  27649. * @returns {string} A string of coordinates representing the point
  27650. */
  27651. 'point': function point(_point) {
  27652. return _point.x + ' ' + _point.y;
  27653. },
  27654. /**
  27655. * @description Return a comma delimited string of point coordinates from a multipoint.
  27656. * @param {GeometryMultiPoint} multipoint
  27657. * @returns {string} A string of point coordinate strings representing
  27658. * the multipoint
  27659. */
  27660. 'multipoint': function multipoint(_multipoint) {
  27661. var array = [];
  27662. for (var i = 0, len = _multipoint.components.length; i < len; ++i) {
  27663. array.push('(' + this.extract.point.apply(this, [_multipoint.components[i]]) + ')');
  27664. }
  27665. return array.join(',');
  27666. },
  27667. /**
  27668. * @description Return a comma delimited string of point coordinates from a line.
  27669. * @param {GeometryLineString} linestring
  27670. * @returns {string} A string of point coordinate strings representing
  27671. * the linestring
  27672. */
  27673. 'linestring': function linestring(_linestring) {
  27674. var array = [];
  27675. for (var i = 0, len = _linestring.components.length; i < len; ++i) {
  27676. array.push(this.extract.point.apply(this, [_linestring.components[i]]));
  27677. }
  27678. return array.join(',');
  27679. },
  27680. /**
  27681. * @description Return a comma delimited string of linestring strings from a multilinestring.
  27682. * @param {GeometryMultiLineString} multilinestring
  27683. * @returns {string} A string of of linestring strings representing
  27684. * the multilinestring
  27685. */
  27686. 'multilinestring': function multilinestring(_multilinestring) {
  27687. var array = [];
  27688. for (var i = 0, len = _multilinestring.components.length; i < len; ++i) {
  27689. array.push('(' + this.extract.linestring.apply(this, [_multilinestring.components[i]]) + ')');
  27690. }
  27691. return array.join(',');
  27692. },
  27693. /**
  27694. * @description Return a comma delimited string of linear ring arrays from a polygon.
  27695. * @param {GeometryPolygon} polygon
  27696. * @returns {string} An array of linear ring arrays representing the polygon
  27697. */
  27698. 'polygon': function polygon(_polygon) {
  27699. var array = [];
  27700. for (var i = 0, len = _polygon.components.length; i < len; ++i) {
  27701. array.push('(' + this.extract.linestring.apply(this, [_polygon.components[i]]) + ')');
  27702. }
  27703. return array.join(',');
  27704. },
  27705. /**
  27706. * @description Return an array of polygon arrays from a multipolygon.
  27707. * @param {GeometryMultiPolygon} multipolygon
  27708. * @returns {string} An array of polygon arrays representing
  27709. * the multipolygon
  27710. */
  27711. 'multipolygon': function multipolygon(_multipolygon) {
  27712. var array = [];
  27713. for (var i = 0, len = _multipolygon.components.length; i < len; ++i) {
  27714. array.push('(' + this.extract.polygon.apply(this, [_multipolygon.components[i]]) + ')');
  27715. }
  27716. return array.join(',');
  27717. },
  27718. /**
  27719. * @description Return the WKT portion between 'GEOMETRYCOLLECTION(' and ')' for an <GeometryCollection>
  27720. * @param {GeometryCollection} collection
  27721. * @returns {string} internal WKT representation of the collection
  27722. */
  27723. 'collection': function collection(_collection) {
  27724. var array = [];
  27725. for (var i = 0, len = _collection.components.length; i < len; ++i) {
  27726. array.push(this.extractGeometry.apply(this, [_collection.components[i]]));
  27727. }
  27728. return array.join(',');
  27729. }
  27730. };
  27731. /**
  27732. * @private
  27733. * @description Object with properties corresponding to the geometry types.
  27734. * Property values are functions that do the actual parsing.
  27735. */
  27736. _this.parse = {
  27737. /**
  27738. * @private
  27739. * @description Return point feature given a point WKT fragment.
  27740. * @param {string} str A WKT fragment representing the point
  27741. * @returns {FeatureVector} A point feature
  27742. *
  27743. */
  27744. 'point': function point(str) {
  27745. var coords = StringExt.trim(str).split(this.regExes.spaces);
  27746. return new Vector(new Point(coords[0], coords[1]));
  27747. },
  27748. /**
  27749. * @description Return a multipoint feature given a multipoint WKT fragment.
  27750. * @param {string} A WKT fragment representing the multipoint
  27751. * @returns {FeatureVector} A multipoint feature
  27752. * @private
  27753. */
  27754. 'multipoint': function multipoint(str) {
  27755. var point;
  27756. var points = StringExt.trim(str).split(',');
  27757. var components = [];
  27758. for (var i = 0, len = points.length; i < len; ++i) {
  27759. point = points[i].replace(this.regExes.trimParens, '$1');
  27760. components.push(this.parse.point.apply(this, [point]).geometry);
  27761. }
  27762. return new Vector(new MultiPoint(components));
  27763. },
  27764. /**
  27765. * @description Return a linestring feature given a linestring WKT fragment.
  27766. * @param {string} A WKT fragment representing the linestring
  27767. * @returns {FeatureVector} A linestring feature
  27768. * @private
  27769. */
  27770. 'linestring': function linestring(str) {
  27771. var points = StringExt.trim(str).split(',');
  27772. var components = [];
  27773. for (var i = 0, len = points.length; i < len; ++i) {
  27774. components.push(this.parse.point.apply(this, [points[i]]).geometry);
  27775. }
  27776. return new Vector(new LineString(components));
  27777. },
  27778. /**
  27779. * @description Return a multilinestring feature given a multilinestring WKT fragment.
  27780. * @param {string} A WKT fragment representing the multilinestring
  27781. * @returns {FeatureVector} A multilinestring feature
  27782. * @private
  27783. */
  27784. 'multilinestring': function multilinestring(str) {
  27785. var line;
  27786. var lines = StringExt.trim(str).split(this.regExes.parenComma);
  27787. var components = [];
  27788. for (var i = 0, len = lines.length; i < len; ++i) {
  27789. line = lines[i].replace(this.regExes.trimParens, '$1');
  27790. components.push(this.parse.linestring.apply(this, [line]).geometry);
  27791. }
  27792. return new Vector(new MultiLineString(components));
  27793. },
  27794. /**
  27795. * @description Return a polygon feature given a polygon WKT fragment.
  27796. * @param {string} A WKT fragment representing the polygon
  27797. * @returns {FeatureVector} A polygon feature
  27798. * @private
  27799. */
  27800. 'polygon': function polygon(str) {
  27801. var ring, linestring, linearring;
  27802. var rings = StringExt.trim(str).split(this.regExes.parenComma);
  27803. var components = [];
  27804. for (var i = 0, len = rings.length; i < len; ++i) {
  27805. ring = rings[i].replace(this.regExes.trimParens, '$1');
  27806. linestring = this.parse.linestring.apply(this, [ring]).geometry;
  27807. linearring = new LinearRing_LinearRing(linestring.components);
  27808. components.push(linearring);
  27809. }
  27810. return new Vector(new Polygon_Polygon(components));
  27811. },
  27812. /**
  27813. * @private
  27814. * @description Return a multipolygon feature given a multipolygon WKT fragment.
  27815. * @param {string} A WKT fragment representing the multipolygon
  27816. * @returns {FeatureVector} A multipolygon feature
  27817. *
  27818. */
  27819. 'multipolygon': function multipolygon(str) {
  27820. var polygon;
  27821. var polygons = StringExt.trim(str).split(this.regExes.doubleParenComma);
  27822. var components = [];
  27823. for (var i = 0, len = polygons.length; i < len; ++i) {
  27824. polygon = polygons[i].replace(this.regExes.trimParens, '$1');
  27825. components.push(this.parse.polygon.apply(this, [polygon]).geometry);
  27826. }
  27827. return new Vector(new MultiPolygon(components));
  27828. },
  27829. /**
  27830. * @description Return an array of features given a geometrycollection WKT fragment.
  27831. * @param {string} A WKT fragment representing the geometrycollection
  27832. * @returns {Array} An array of FeatureVector
  27833. * @private
  27834. */
  27835. 'geometrycollection': function geometrycollection(str) {
  27836. // separate components of the collection with |
  27837. str = str.replace(/,\s*([A-Za-z])/g, '|$1');
  27838. var wktArray = StringExt.trim(str).split('|');
  27839. var components = [];
  27840. for (var i = 0, len = wktArray.length; i < len; ++i) {
  27841. components.push(this.read(wktArray[i]));
  27842. }
  27843. return components;
  27844. }
  27845. };
  27846. return _this;
  27847. }
  27848. /**
  27849. * @function WKTFormat.prototype.read
  27850. * @description 反序列化 WKT 字符串并返回向量特征或向量特征数组。支持 POINT、MULTIPOINT、LINESTRING、MULTILINESTRING、POLYGON、MULTIPOLYGON 和 GEOMETRYCOLLECTION 的 WKT。
  27851. * @param {string} wkt - WKT 字符串。
  27852. * @returns {FeatureVector|Array} GEOMETRYCOLLECTION WKT 的矢量要素或者矢量要素数组。
  27853. */
  27854. WKT_createClass(WKT, [{
  27855. key: "read",
  27856. value: function read(wkt) {
  27857. var features, type, str;
  27858. wkt = wkt.replace(/[\n\r]/g, " ");
  27859. var matches = this.regExes.typeStr.exec(wkt);
  27860. if (matches) {
  27861. type = matches[1].toLowerCase();
  27862. str = matches[2];
  27863. if (this.parse[type]) {
  27864. features = this.parse[type].apply(this, [str]);
  27865. }
  27866. }
  27867. return features;
  27868. }
  27869. /**
  27870. * @function WKTFormat.prototype.write
  27871. * @description 将矢量要素或矢量要素数组序列化为 WKT 字符串。
  27872. * @param {(FeatureVector|Array)} features - 矢量要素或矢量要素数组。
  27873. * @returns {string} 表示几何的 WKT 字符串。
  27874. */
  27875. }, {
  27876. key: "write",
  27877. value: function write(features) {
  27878. var collection, geometry, isCollection;
  27879. if (features.constructor === Array) {
  27880. collection = features;
  27881. isCollection = true;
  27882. } else {
  27883. collection = [features];
  27884. isCollection = false;
  27885. }
  27886. var pieces = [];
  27887. if (isCollection) {
  27888. pieces.push('GEOMETRYCOLLECTION(');
  27889. }
  27890. for (var i = 0, len = collection.length; i < len; ++i) {
  27891. if (isCollection && i > 0) {
  27892. pieces.push(',');
  27893. }
  27894. geometry = collection[i].geometry;
  27895. pieces.push(this.extractGeometry(geometry));
  27896. }
  27897. if (isCollection) {
  27898. pieces.push(')');
  27899. }
  27900. return pieces.join('');
  27901. }
  27902. /**
  27903. * @function WKTFormat.prototype.extractGeometry
  27904. * @description 为单个 Geometry 对象构造 WKT 的入口点。
  27905. * @param {Geometry} geometry - Geometry 对象。
  27906. * @returns {string} 表示几何的 WKT 字符串。
  27907. */
  27908. }, {
  27909. key: "extractGeometry",
  27910. value: function extractGeometry(geometry) {
  27911. var type = geometry.CLASS_NAME.split('.')[2].toLowerCase();
  27912. if (!this.extract[type]) {
  27913. return null;
  27914. }
  27915. var wktType = type === 'collection' ? 'GEOMETRYCOLLECTION' : type.toUpperCase();
  27916. var data = wktType + '(' + this.extract[type].apply(this, [geometry]) + ')';
  27917. return data;
  27918. }
  27919. }]);
  27920. return WKT;
  27921. }(Format);
  27922. ;// CONCATENATED MODULE: ./src/common/format/index.js
  27923. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  27924. * This program are made available under the terms of the Apache License, Version 2.0
  27925. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27926. ;// CONCATENATED MODULE: ./src/common/control/TimeControlBase.js
  27927. function TimeControlBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27928. function TimeControlBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  27929. function TimeControlBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) TimeControlBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) TimeControlBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  27930. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  27931. * This program are made available under the terms of the Apache License, Version 2.0
  27932. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27933. /**
  27934. * @class TimeControlBase
  27935. * @deprecatedclass SuperMap.TimeControlBase
  27936. * @classdesc 时间控制基类。
  27937. * @modulecategory Control
  27938. * @category Control
  27939. * @param {Object} options - 可选参数。
  27940. * @param {number} [options.speed=1] - 速度。不能小于 0,(每帧渲染的数据之间的间隔为1),设置越大速度越快。
  27941. * @param {number} [options.frequency=1000] - 刷新频率(单位 ms),服务器刷新的时间间隔。
  27942. * @param {number} [options.startTime=0] - 起始时间,必须为数字,且小于等于 endTime。如果不设置,初始化时为 0,建议设置。
  27943. * @param {number} [options.endTime] - 结束时间,必须为数字,且大于等于 startTime。如果不设置,初始化时以当前时间进行设置,建议设置。
  27944. * @param {boolean} [options.repeat=true] - 是否重复循环。
  27945. * @param {boolean} [options.reverse=false] - 是否反向。
  27946. * @usage
  27947. */
  27948. var TimeControlBase = /*#__PURE__*/function () {
  27949. function TimeControlBase(options) {
  27950. TimeControlBase_classCallCheck(this, TimeControlBase);
  27951. //设置步长,刷新频率、开始结束时间、是否循环、是否反向
  27952. var me = this;
  27953. options = options || {};
  27954. /**
  27955. * @member {number} [TimeControlBase.prototype.speed=1]
  27956. * @description 步长,必须为非负数,默认为1(表示前后两次渲染的数据之间的间隔为1)。
  27957. */
  27958. this.speed = options.speed && options.speed >= 0 ? options.speed : 1;
  27959. /**
  27960. * @member {number} [TimeControlBase.prototype.frequency=1000]
  27961. * @description 刷新频率(单位ms),服务器刷新的时间间隔。
  27962. */
  27963. this.frequency = options.speed && options.frequency >= 0 ? options.frequency : 1000;
  27964. /**
  27965. * @member {number} [TimeControlBase.prototype.startTime=0]
  27966. * @description 记录的起始时间,必须为数字,
  27967. * 如果不设置,初始化时为0,建议设置。
  27968. */
  27969. this.startTime = options.startTime && options.startTime != null ? options.startTime : 0;
  27970. /**
  27971. * @member {number} TimeControlBase.prototype.endTime
  27972. * @description 记录的结束时间,必须为数字,
  27973. * 如果不设置,初始化时以当前时间进行设置,建议设置。
  27974. */
  27975. this.endTime = options.endTime && options.endTime != null && options.endTime >= me.startTime ? options.endTime : +new Date();
  27976. /**
  27977. * @member {boolean} [TimeControlBase.prototype.repeat=true]
  27978. * @description 是否重复循环。
  27979. */
  27980. this.repeat = options.repeat !== undefined ? options.repeat : true;
  27981. /**
  27982. * @member {boolean} [TimeControlBase.prototype.reverse=false]
  27983. * @description 是否反向。
  27984. */
  27985. this.reverse = options.reverse !== undefined ? options.reverse : false;
  27986. /**
  27987. * @member {number} TimeControlBase.prototype.currentTime
  27988. * @description 记录近期的时间,也就是当前帧运行到的时间。
  27989. */
  27990. this.currentTime = null;
  27991. /**
  27992. * @member {number} TimeControlBase.prototype.oldTime
  27993. * @description 记录上一帧的时间,也就是之前运行到的时间。
  27994. */
  27995. this.oldTime = null;
  27996. /**
  27997. * @member {boolean} [TimeControlBase.prototype.running=false]
  27998. * @description 记录当前是否处于运行中。
  27999. */
  28000. this.running = false;
  28001. /**
  28002. * @private
  28003. * @member {Array.<string>} TimeControlBase.prototype.EVENT_TYPES
  28004. * @description 此类支持的事件类型。
  28005. *
  28006. */
  28007. this.EVENT_TYPES = ["start", "pause", "stop"];
  28008. /**
  28009. * @private
  28010. * @member {Events} TimeControlBase.prototype.events
  28011. * @description 事件
  28012. */
  28013. me.events = new Events(this, null, this.EVENT_TYPES);
  28014. me.speed = Number(me.speed);
  28015. me.frequency = Number(me.frequency);
  28016. me.startTime = Number(me.startTime);
  28017. me.endTime = Number(me.endTime);
  28018. me.startTime = Date.parse(new Date(me.startTime));
  28019. me.endTime = Date.parse(new Date(me.endTime));
  28020. //初始化当前时间
  28021. me.currentTime = me.startTime;
  28022. this.CLASS_NAME = "SuperMap.TimeControlBase";
  28023. }
  28024. /**
  28025. * @function TimeControlBase.prototype.updateOptions
  28026. * @description 更新参数。
  28027. * @param {Object} options - 设置参数的可选参数。设置步长,刷新频率、开始结束时间、是否循环、是否反向。
  28028. */
  28029. TimeControlBase_createClass(TimeControlBase, [{
  28030. key: "updateOptions",
  28031. value: function updateOptions(options) {
  28032. //设置步长,刷新频率、开始结束时间、是否循环、是否反向
  28033. var me = this;
  28034. options = options || {};
  28035. if (options.speed && options.speed >= 0) {
  28036. me.speed = options.speed;
  28037. me.speed = Number(me.speed);
  28038. }
  28039. if (options.speed && options.frequency >= 0) {
  28040. me.frequency = options.frequency;
  28041. me.frequency = Number(me.frequency);
  28042. }
  28043. if (options.startTime && options.startTime != null) {
  28044. me.startTime = options.startTime;
  28045. me.startTime = Date.parse(new Date(me.startTime));
  28046. }
  28047. if (options.endTime && options.endTime != null && options.endTime >= me.startTime) {
  28048. me.endTime = options.endTime;
  28049. me.endTime = Date.parse(new Date(me.endTime));
  28050. }
  28051. if (options.repeat != null) {
  28052. me.repeat = options.repeat;
  28053. }
  28054. if (options.reverse != null) {
  28055. me.reverse = options.reverse;
  28056. }
  28057. }
  28058. /**
  28059. * @function TimeControlBase.prototype.start
  28060. * @description 开始。
  28061. */
  28062. }, {
  28063. key: "start",
  28064. value: function start() {
  28065. var me = this;
  28066. if (!me.running) {
  28067. me.running = true;
  28068. me.tick();
  28069. me.events.triggerEvent('start', me.currentTime);
  28070. }
  28071. }
  28072. /**
  28073. * @function TimeControlBase.prototype.pause
  28074. * @description 暂停。
  28075. */
  28076. }, {
  28077. key: "pause",
  28078. value: function pause() {
  28079. var me = this;
  28080. me.running = false;
  28081. me.events.triggerEvent('pause', me.currentTime);
  28082. }
  28083. /**
  28084. * @function TimeControlBase.prototype.stop
  28085. * @description 停止,停止后返回起始状态。
  28086. */
  28087. }, {
  28088. key: "stop",
  28089. value: function stop() {
  28090. var me = this;
  28091. //停止时 时间设置为开始时间
  28092. me.currentTime = me.startTime;
  28093. //如果正在运行,修改为初始时间即可绘制一帧
  28094. if (me.running) {
  28095. me.running = false;
  28096. }
  28097. me.events.triggerEvent('stop', me.currentTime);
  28098. }
  28099. /**
  28100. * @function TimeControlBase.prototype.toggle
  28101. * @description 开关切换,切换的是开始和暂停。
  28102. */
  28103. }, {
  28104. key: "toggle",
  28105. value: function toggle() {
  28106. var me = this;
  28107. if (me.running) {
  28108. me.pause();
  28109. } else {
  28110. me.start();
  28111. }
  28112. }
  28113. /**
  28114. * @function TimeControlBase.prototype.setSpeed
  28115. * @description 设置步长。
  28116. * @param {number} [speed=1] - 步长,必须为非负数。
  28117. * @returns {boolean} true 代表设置成功,false 设置失败(speed 小于 0 时失败)。
  28118. */
  28119. }, {
  28120. key: "setSpeed",
  28121. value: function setSpeed(speed) {
  28122. var me = this;
  28123. if (speed >= 0) {
  28124. me.speed = speed;
  28125. return true;
  28126. }
  28127. return false;
  28128. }
  28129. /**
  28130. * @function TimeControlBase.prototype.getSpeed
  28131. * @description 获取步长。
  28132. * @returns {number} 返回当前的步长。
  28133. */
  28134. }, {
  28135. key: "getSpeed",
  28136. value: function getSpeed() {
  28137. return this.speed;
  28138. }
  28139. /**
  28140. * @function TimeControlBase.prototype.setFrequency
  28141. * @description 设置刷新频率。
  28142. * @param {number} [frequency=1000] - 刷新频率,单位为 ms。
  28143. * @returns {boolean} true 代表设置成功,false 设置失败(frequency 小于 0 时失败)。
  28144. */
  28145. }, {
  28146. key: "setFrequency",
  28147. value: function setFrequency(frequency) {
  28148. var me = this;
  28149. if (frequency >= 0) {
  28150. me.frequency = frequency;
  28151. return true;
  28152. }
  28153. return false;
  28154. }
  28155. /**
  28156. * @function TimeControlBase.prototype.getFrequency
  28157. * @description 获取刷新频率。
  28158. * @returns {number} 返回当前的刷新频率。
  28159. */
  28160. }, {
  28161. key: "getFrequency",
  28162. value: function getFrequency() {
  28163. return this.frequency;
  28164. }
  28165. /**
  28166. * @function TimeControlBase.prototype.setStartTime
  28167. * @description 设置起始时间,设置完成后如果当前时间小于起始时间,则从起始时间开始。
  28168. * @param {number} startTime - 需要设置的起始时间。
  28169. * @returns {boolean} true 代表设置成功,false 设置失败(startTime 大于结束时间时失败)。
  28170. */
  28171. }, {
  28172. key: "setStartTime",
  28173. value: function setStartTime(startTime) {
  28174. var me = this;
  28175. startTime = Date.parse(new Date(startTime));
  28176. //起始时间不得大于结束时间
  28177. if (startTime > me.endTime) {
  28178. return false;
  28179. }
  28180. me.startTime = startTime;
  28181. //如果当前时间小于了起始时间,则从当前起始时间开始
  28182. if (me.currentTime < me.startTime) {
  28183. me.currentTime = me.startTime;
  28184. me.tick();
  28185. }
  28186. return true;
  28187. }
  28188. /**
  28189. * @function TimeControlBase.prototype.getStartTime
  28190. * @description 获取起始时间。
  28191. * @returns {number} 返回当前的起始时间。
  28192. */
  28193. }, {
  28194. key: "getStartTime",
  28195. value: function getStartTime() {
  28196. return this.startTime;
  28197. }
  28198. /**
  28199. * @function TimeControlBase.prototype.setEndTime
  28200. * @description 设置结束时间,设置完成后如果当前时间大于结束,则从起始时间开始。
  28201. * @param {number} endTime - 需要设置的结束时间。
  28202. * @returns {boolean} true 代表设置成功,false 设置失败(endTime 小于开始时间时失败)。
  28203. */
  28204. }, {
  28205. key: "setEndTime",
  28206. value: function setEndTime(endTime) {
  28207. var me = this;
  28208. me.endTime = Date.parse(new Date(me.endTime));
  28209. //结束时间不得小于开始时间
  28210. if (endTime < me.startTime) {
  28211. return false;
  28212. }
  28213. me.endTime = endTime;
  28214. //如果当前时间大于了结束时间,则从起始时间开始
  28215. if (me.currentTime >= me.endTime) {
  28216. me.currentTime = me.startTime;
  28217. me.tick();
  28218. }
  28219. return true;
  28220. }
  28221. /**
  28222. * @function TimeControlBase.prototype.getEndTime
  28223. * @description 获取结束时间。
  28224. * @returns {number} 返回当前的结束时间。
  28225. */
  28226. }, {
  28227. key: "getEndTime",
  28228. value: function getEndTime() {
  28229. return this.endTime;
  28230. }
  28231. /**
  28232. * @function TimeControlBase.prototype.setCurrentTime
  28233. * @description 设置当前时间。
  28234. * @param {number} currentTime - 需要设置的当前时间。
  28235. * @returns {boolean} true 代表设置成功,false 设置失败。
  28236. */
  28237. }, {
  28238. key: "setCurrentTime",
  28239. value: function setCurrentTime(currentTime) {
  28240. var me = this;
  28241. me.currentTime = Date.parse(new Date(me.currentTime));
  28242. //结束时间不得小于开始时间
  28243. if (currentTime >= me.startTime && currentTime <= me.endTime) {
  28244. me.currentTime = currentTime;
  28245. me.startTime = me.currentTime;
  28246. me.tick();
  28247. return true;
  28248. }
  28249. return false;
  28250. }
  28251. /**
  28252. * @function TimeControlBase.prototype.getCurrentTime
  28253. * @description 获取当前时间。
  28254. * @returns {number} 返回当前时间。
  28255. */
  28256. }, {
  28257. key: "getCurrentTime",
  28258. value: function getCurrentTime() {
  28259. return this.currentTime;
  28260. }
  28261. /**
  28262. * @function TimeControlBase.prototype.setRepeat
  28263. * @description 设置是否重复循环。
  28264. * @param {boolean} [repeat=true] - 是否重复循环。
  28265. */
  28266. }, {
  28267. key: "setRepeat",
  28268. value: function setRepeat(repeat) {
  28269. this.repeat = repeat;
  28270. }
  28271. /**
  28272. * @function TimeControlBase.prototype.getRepeat
  28273. * @description 获取是否重复循环,默认是 true。
  28274. * @returns {boolean} 返回是否重复循环。
  28275. */
  28276. }, {
  28277. key: "getRepeat",
  28278. value: function getRepeat() {
  28279. return this.repeat;
  28280. }
  28281. /**
  28282. * @function TimeControlBase.prototype.setReverse
  28283. * @description 设置是否反向。
  28284. * @param {boolean} [reverse=false] - 是否反向。
  28285. */
  28286. }, {
  28287. key: "setReverse",
  28288. value: function setReverse(reverse) {
  28289. this.reverse = reverse;
  28290. }
  28291. /**
  28292. * @function TimeControlBase.prototype.getReverse
  28293. * @description 获取是否反向,默认是false。
  28294. * @returns {boolean} 返回是否反向。
  28295. */
  28296. }, {
  28297. key: "getReverse",
  28298. value: function getReverse() {
  28299. return this.reverse;
  28300. }
  28301. /**
  28302. * @function TimeControlBase.prototype.getRunning
  28303. * @description 获取运行状态。
  28304. * @returns {boolean} true 代表正在运行,false 发表没有运行。
  28305. */
  28306. }, {
  28307. key: "getRunning",
  28308. value: function getRunning() {
  28309. return this.running;
  28310. }
  28311. /**
  28312. * @function TimeControlBase.prototype.destroy
  28313. * @description 销毁 Animator 对象,释放资源。
  28314. */
  28315. }, {
  28316. key: "destroy",
  28317. value: function destroy() {
  28318. var me = this;
  28319. me.speed = null;
  28320. me.frequency = null;
  28321. me.startTime = null;
  28322. me.endTime = null;
  28323. me.currentTime = null;
  28324. me.repeat = null;
  28325. me.running = false;
  28326. me.reverse = null;
  28327. }
  28328. }, {
  28329. key: "tick",
  28330. value: function tick() {
  28331. //TODO 每次刷新执行的操作。子类实现
  28332. }
  28333. }]);
  28334. return TimeControlBase;
  28335. }();
  28336. ;// CONCATENATED MODULE: ./src/common/control/TimeFlowControl.js
  28337. function TimeFlowControl_typeof(obj) { "@babel/helpers - typeof"; return TimeFlowControl_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, TimeFlowControl_typeof(obj); }
  28338. function TimeFlowControl_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28339. function TimeFlowControl_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  28340. function TimeFlowControl_createClass(Constructor, protoProps, staticProps) { if (protoProps) TimeFlowControl_defineProperties(Constructor.prototype, protoProps); if (staticProps) TimeFlowControl_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  28341. function TimeFlowControl_get() { if (typeof Reflect !== "undefined" && Reflect.get) { TimeFlowControl_get = Reflect.get.bind(); } else { TimeFlowControl_get = function _get(target, property, receiver) { var base = TimeFlowControl_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return TimeFlowControl_get.apply(this, arguments); }
  28342. function TimeFlowControl_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TimeFlowControl_getPrototypeOf(object); if (object === null) break; } return object; }
  28343. function TimeFlowControl_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) TimeFlowControl_setPrototypeOf(subClass, superClass); }
  28344. function TimeFlowControl_setPrototypeOf(o, p) { TimeFlowControl_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TimeFlowControl_setPrototypeOf(o, p); }
  28345. function TimeFlowControl_createSuper(Derived) { var hasNativeReflectConstruct = TimeFlowControl_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = TimeFlowControl_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = TimeFlowControl_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return TimeFlowControl_possibleConstructorReturn(this, result); }; }
  28346. function TimeFlowControl_possibleConstructorReturn(self, call) { if (call && (TimeFlowControl_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return TimeFlowControl_assertThisInitialized(self); }
  28347. function TimeFlowControl_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28348. function TimeFlowControl_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  28349. function TimeFlowControl_getPrototypeOf(o) { TimeFlowControl_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TimeFlowControl_getPrototypeOf(o); }
  28350. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  28351. * This program are made available under the terms of the Apache License, Version 2.0
  28352. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28353. /**
  28354. * @class TimeFlowControl
  28355. * @deprecatedclass SuperMap.TimeFlowControl
  28356. * @category Control
  28357. * @classdesc 时间管理类。此类只负责时间上的控制,具体执行的操作需要用户在初始化时的回调函数内部进行实现。
  28358. * 如设置起始时间为 1000,结束时间是 2000,步长设置为 1,
  28359. * 那么表示按照每次1年(可以通过 setSpeed 进行修改)的变化从公元 1000 年开始到公元 2000 年为止,默认每 1 秒会变化 1 次(通过 setFrequency 修改)
  28360. * @modulecategory Control
  28361. * @extends {TimeControlBase}
  28362. * @param {function} callback - 每次刷新回调函数。具体的效果需要用户在此回调函数里面实现。
  28363. * @param {Object} options - 可选参数。
  28364. * @param {number} [options.speed=1] - 步长(单位 ms)。不能小于 0,(每次刷新的数据之间的间隔为 1ms)。
  28365. * @param {number} [options.frequency=1000] - 刷新频率(单位 ms)。
  28366. * @param {number} [options.startTime=0] - 起始时间,必须为数字,且小于等于 endTime。如果不设置,初始化时为 0,建议设置。
  28367. * @param {number} [options.endTime] - 结束时间,必须为数字,且大于等于 startTime。如果不设置,初始化时使用 new Date() 以当前时间进行设置,建议设置。
  28368. * @param {boolean} [options.repeat=true] - 是否重复循环。
  28369. * @param {boolean} [options.reverse=false] - 是否反向。
  28370. * @usage
  28371. */
  28372. var TimeFlowControl = /*#__PURE__*/function (_TimeControlBase) {
  28373. TimeFlowControl_inherits(TimeFlowControl, _TimeControlBase);
  28374. var _super = TimeFlowControl_createSuper(TimeFlowControl);
  28375. function TimeFlowControl(callback, options) {
  28376. var _this;
  28377. TimeFlowControl_classCallCheck(this, TimeFlowControl);
  28378. _this = _super.call(this, options);
  28379. var me = TimeFlowControl_assertThisInitialized(_this);
  28380. /**
  28381. * @member TimeFlowControl.prototype.callback -{function}
  28382. * @description 每次刷新执行的回调函数。
  28383. */
  28384. me.callback = callback;
  28385. //先让IE下支持bind方法
  28386. if (!Function.prototype.bind) {
  28387. Function.prototype.bind = function (oThis) {
  28388. if (typeof this !== "function") {
  28389. throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
  28390. }
  28391. var aArgs = Array.prototype.slice.call(arguments, 1),
  28392. fToBind = this,
  28393. fNOP = function fNOP() {
  28394. //empty Function
  28395. },
  28396. fBound = function fBound() {
  28397. return fToBind.apply(this instanceof fNOP && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));
  28398. };
  28399. fNOP.prototype = this.prototype;
  28400. fBound.prototype = new fNOP();
  28401. return fBound;
  28402. };
  28403. }
  28404. //保证 this.tick 的上下文还是 TimeControl 这个对象
  28405. me.update = me.update.bind(me);
  28406. me.oldTime = me.currentTime;
  28407. me.CLASS_NAME = "SuperMap.TimeFlowControl";
  28408. return _this;
  28409. }
  28410. /**
  28411. * @function TimeFlowControl.prototype.updateOptions
  28412. * @override
  28413. */
  28414. TimeFlowControl_createClass(TimeFlowControl, [{
  28415. key: "updateOptions",
  28416. value: function updateOptions(options) {
  28417. options = options || {};
  28418. TimeFlowControl_get(TimeFlowControl_getPrototypeOf(TimeFlowControl.prototype), "updateOptions", this).call(this, options);
  28419. }
  28420. /**
  28421. * @function TimeFlowControl.prototype.start
  28422. * @override
  28423. */
  28424. }, {
  28425. key: "start",
  28426. value: function start() {
  28427. var me = this;
  28428. if (me.running) {
  28429. return;
  28430. }
  28431. me.running = true;
  28432. if (me.reverse) {
  28433. if (me.currentTime === me.startTime) {
  28434. me.oldTime = me.endTime;
  28435. me.currentTime = me.oldTime;
  28436. }
  28437. } else {
  28438. if (me.oldTime === me.endTime) {
  28439. me.currentTime = me.startTime;
  28440. me.oldTime = me.currentTime;
  28441. }
  28442. }
  28443. me.tick();
  28444. }
  28445. /**
  28446. * @function TimeFlowControl.prototype.stop
  28447. * @override
  28448. */
  28449. }, {
  28450. key: "stop",
  28451. value: function stop() {
  28452. TimeFlowControl_get(TimeFlowControl_getPrototypeOf(TimeFlowControl.prototype), "stop", this).call(this);
  28453. var me = this;
  28454. me.oldTime = me.currentTime;
  28455. if (me.running) {
  28456. me.running = false;
  28457. }
  28458. //清除定时tick
  28459. me.intervalId && window.clearTimeout(me.intervalId);
  28460. }
  28461. /**
  28462. * @function TimeFlowControl.prototype.destroy
  28463. * @override
  28464. */
  28465. }, {
  28466. key: "destroy",
  28467. value: function destroy() {
  28468. TimeFlowControl_get(TimeFlowControl_getPrototypeOf(TimeFlowControl.prototype), "destroy", this).call(this);
  28469. var me = this;
  28470. me.oldTime = null;
  28471. me.callback = null;
  28472. }
  28473. /**
  28474. * @function TimeFlowControl.prototype.tick
  28475. * @description 定时刷新。
  28476. */
  28477. }, {
  28478. key: "tick",
  28479. value: function tick() {
  28480. var me = this;
  28481. me.intervalId && window.clearInterval(me.intervalId);
  28482. me.intervalId = null;
  28483. me.update();
  28484. me.intervalId = window.setInterval(me.update, me.frequency);
  28485. }
  28486. /**
  28487. * @function TimeFlowControl.prototype.update
  28488. * @description 更新控件。
  28489. */
  28490. }, {
  28491. key: "update",
  28492. value: function update() {
  28493. var me = this;
  28494. //判定是否还需要继续
  28495. if (!me.running) {
  28496. return;
  28497. }
  28498. //调用回调函数
  28499. me.callback && me.callback(me.currentTime); //destroy之后callback就为空,所以需要判定一下
  28500. if (!me.reverse) {
  28501. //如果相等,则代表上一帧已经运行到了最后,下一帧运行初始化的状态
  28502. if (me.currentTime === me.endTime) {
  28503. //不循环时
  28504. if (!me.repeat) {
  28505. me.running = false;
  28506. me.stop();
  28507. return null;
  28508. }
  28509. me.stop();
  28510. me.currentTime = me.startTime;
  28511. me.oldTime = me.currentTime;
  28512. me.start();
  28513. } else {
  28514. //否则时间递增
  28515. me.oldTime = me.currentTime;
  28516. me.currentTime += me.speed;
  28517. }
  28518. if (me.currentTime >= me.endTime) {
  28519. me.currentTime = me.endTime;
  28520. }
  28521. } else {
  28522. //如果相等,则代表上一帧已经运行到了最前,下一帧运行结束的状态
  28523. if (me.currentTime === me.startTime) {
  28524. //不循环时
  28525. if (!me.repeat) {
  28526. me.running = false;
  28527. return null;
  28528. }
  28529. me.oldTime = me.endTime;
  28530. me.currentTime = me.oldTime;
  28531. } else {
  28532. //否则时间递减
  28533. me.currentTime = me.oldTime;
  28534. me.oldTime -= me.speed;
  28535. }
  28536. if (me.oldTime <= me.startTime) {
  28537. me.oldTime = me.startTime;
  28538. }
  28539. }
  28540. }
  28541. }]);
  28542. return TimeFlowControl;
  28543. }(TimeControlBase);
  28544. ;// CONCATENATED MODULE: ./src/common/control/index.js
  28545. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  28546. * This program are made available under the terms of the Apache License, Version 2.0
  28547. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28548. // EXTERNAL MODULE: ./node_modules/promise-polyfill/dist/polyfill.js
  28549. var polyfill = __webpack_require__(9957);
  28550. // EXTERNAL MODULE: ./node_modules/fetch-ie8/fetch.js
  28551. var fetch_ie8_fetch = __webpack_require__(5937);
  28552. // EXTERNAL MODULE: ./node_modules/fetch-jsonp/build/fetch-jsonp.js
  28553. var fetch_jsonp = __webpack_require__(4238);
  28554. var fetch_jsonp_default = /*#__PURE__*/__webpack_require__.n(fetch_jsonp);
  28555. ;// CONCATENATED MODULE: ./src/common/util/FetchRequest.js
  28556. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  28557. * This program are made available under the terms of the Apache License, Version 2.0
  28558. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28559. var FetchRequest_fetch = window.fetch;
  28560. var setFetch = function setFetch(newFetch) {
  28561. FetchRequest_fetch = newFetch;
  28562. };
  28563. var RequestJSONPPromise = {
  28564. limitLength: 1500,
  28565. queryKeys: [],
  28566. queryValues: [],
  28567. supermap_callbacks: {},
  28568. addQueryStrings: function addQueryStrings(values) {
  28569. var me = this;
  28570. for (var key in values) {
  28571. me.queryKeys.push(key);
  28572. if (typeof values[key] !== 'string') {
  28573. values[key] = Util_Util.toJSON(values[key]);
  28574. }
  28575. var tempValue = encodeURIComponent(values[key]);
  28576. me.queryValues.push(tempValue);
  28577. }
  28578. },
  28579. issue: function issue(config) {
  28580. var me = this,
  28581. uid = me.getUid(),
  28582. url = config.url,
  28583. splitQuestUrl = [];
  28584. // me.addQueryStrings({
  28585. // callback: "RequestJSONPPromise.supermap_callbacks[" + uid + "]"
  28586. // });
  28587. var sectionURL = url,
  28588. keysCount = 0; //此次sectionURL中有多少个key
  28589. var length = me.queryKeys ? me.queryKeys.length : 0;
  28590. for (var i = 0; i < length; i++) {
  28591. if (sectionURL.length + me.queryKeys[i].length + 2 >= me.limitLength) {
  28592. //+2 for ("&"or"?")and"="
  28593. if (keysCount == 0) {
  28594. return false;
  28595. }
  28596. splitQuestUrl.push(sectionURL);
  28597. sectionURL = url;
  28598. keysCount = 0;
  28599. i--;
  28600. } else {
  28601. if (sectionURL.length + me.queryKeys[i].length + 2 + me.queryValues[i].length > me.limitLength) {
  28602. var leftValue = me.queryValues[i];
  28603. while (leftValue.length > 0) {
  28604. var leftLength = me.limitLength - sectionURL.length - me.queryKeys[i].length - 2; //+2 for ("&"or"?")and"="
  28605. if (sectionURL.indexOf('?') > -1) {
  28606. sectionURL += '&';
  28607. } else {
  28608. sectionURL += '?';
  28609. }
  28610. var tempLeftValue = leftValue.substring(0, leftLength);
  28611. //避免 截断sectionURL时,将类似于%22这样的符号截成两半,从而导致服务端组装sectionURL时发生错误
  28612. if (tempLeftValue.substring(leftLength - 1, leftLength) === '%') {
  28613. leftLength -= 1;
  28614. tempLeftValue = leftValue.substring(0, leftLength);
  28615. } else if (tempLeftValue.substring(leftLength - 2, leftLength - 1) === '%') {
  28616. leftLength -= 2;
  28617. tempLeftValue = leftValue.substring(0, leftLength);
  28618. }
  28619. sectionURL += me.queryKeys[i] + '=' + tempLeftValue;
  28620. leftValue = leftValue.substring(leftLength);
  28621. if (tempLeftValue.length > 0) {
  28622. splitQuestUrl.push(sectionURL);
  28623. sectionURL = url;
  28624. keysCount = 0;
  28625. }
  28626. }
  28627. } else {
  28628. keysCount++;
  28629. if (sectionURL.indexOf('?') > -1) {
  28630. sectionURL += '&';
  28631. } else {
  28632. sectionURL += '?';
  28633. }
  28634. sectionURL += me.queryKeys[i] + '=' + me.queryValues[i];
  28635. }
  28636. }
  28637. }
  28638. splitQuestUrl.push(sectionURL);
  28639. return me.send(splitQuestUrl, 'SuperMapJSONPCallbacks_' + uid, config && config.proxy);
  28640. },
  28641. getUid: function getUid() {
  28642. var uid = new Date().getTime(),
  28643. random = Math.floor(Math.random() * 1e17);
  28644. return uid * 1000 + random;
  28645. },
  28646. send: function send(splitQuestUrl, callback, proxy) {
  28647. var len = splitQuestUrl.length;
  28648. if (len > 0) {
  28649. return new Promise(function (resolve) {
  28650. var jsonpUserID = new Date().getTime();
  28651. for (var i = 0; i < len; i++) {
  28652. var url = splitQuestUrl[i];
  28653. if (url.indexOf('?') > -1) {
  28654. url += '&';
  28655. } else {
  28656. url += '?';
  28657. }
  28658. url += 'sectionCount=' + len;
  28659. url += '&sectionIndex=' + i;
  28660. url += '&jsonpUserID=' + jsonpUserID;
  28661. if (proxy) {
  28662. url = decodeURIComponent(url);
  28663. url = proxy + encodeURIComponent(url);
  28664. }
  28665. fetch_jsonp_default()(url, {
  28666. jsonpCallbackFunction: callback,
  28667. timeout: 30000
  28668. }).then(function (result) {
  28669. resolve(result.json());
  28670. });
  28671. }
  28672. });
  28673. }
  28674. },
  28675. GET: function GET(config) {
  28676. var me = this;
  28677. me.queryKeys.length = 0;
  28678. me.queryValues.length = 0;
  28679. me.addQueryStrings(config.params);
  28680. return me.issue(config);
  28681. },
  28682. POST: function POST(config) {
  28683. var me = this;
  28684. me.queryKeys.length = 0;
  28685. me.queryValues.length = 0;
  28686. me.addQueryStrings({
  28687. requestEntity: config.data
  28688. });
  28689. return me.issue(config);
  28690. },
  28691. PUT: function PUT(config) {
  28692. var me = this;
  28693. me.queryKeys.length = 0;
  28694. me.queryValues.length = 0;
  28695. me.addQueryStrings({
  28696. requestEntity: config.data
  28697. });
  28698. return me.issue(config);
  28699. },
  28700. DELETE: function DELETE(config) {
  28701. var me = this;
  28702. me.queryKeys.length = 0;
  28703. me.queryValues.length = 0;
  28704. me.addQueryStrings({
  28705. requestEntity: config.data
  28706. });
  28707. return me.issue(config);
  28708. }
  28709. };
  28710. var CORS;
  28711. var RequestTimeout;
  28712. /**
  28713. * @function setCORS
  28714. * @description 设置是否允许跨域请求,全局配置,优先级低于 service 下的 crossOring 参数。
  28715. * @category BaseTypes Util
  28716. * @param {boolean} cors - 是否允许跨域请求。
  28717. * @usage
  28718. * ```
  28719. * // 浏览器
  28720. * <script type="text/javascript" src="{cdn}"></script>
  28721. * <script>
  28722. * {namespace}.setCORS(cors);
  28723. *
  28724. * // 弃用的写法
  28725. * SuperMap.setCORS(cors);
  28726. *
  28727. * </script>
  28728. *
  28729. * // ES6 Import
  28730. * import { setCORS } from '{npm}';
  28731. *
  28732. * setCORS(cors);
  28733. * ```
  28734. */
  28735. var setCORS = function setCORS(cors) {
  28736. CORS = cors;
  28737. };
  28738. /**
  28739. * @function isCORS
  28740. * @description 是是否允许跨域请求。
  28741. * @category BaseTypes Util
  28742. * @returns {boolean} 是否允许跨域请求。
  28743. * @usage
  28744. * ```
  28745. * // 浏览器
  28746. * <script type="text/javascript" src="{cdn}"></script>
  28747. * <script>
  28748. * const result = {namespace}.isCORS();
  28749. *
  28750. * // 弃用的写法
  28751. * const result = SuperMap.isCORS();
  28752. *
  28753. * </script>
  28754. *
  28755. * // ES6 Import
  28756. * import { isCORS } from '{npm}';
  28757. *
  28758. * const result = isCORS();
  28759. * ```
  28760. */
  28761. var isCORS = function isCORS() {
  28762. if (CORS != undefined) {
  28763. return CORS;
  28764. }
  28765. return window.XMLHttpRequest && 'withCredentials' in new window.XMLHttpRequest();
  28766. };
  28767. /**
  28768. * @function setRequestTimeout
  28769. * @category BaseTypes Util
  28770. * @description 设置请求超时时间。
  28771. * @param {number} [timeout=45] - 请求超时时间,单位秒。
  28772. * @usage
  28773. * ```
  28774. * // 浏览器
  28775. <script type="text/javascript" src="{cdn}"></script>
  28776. <script>
  28777. {namespace}.setRequestTimeout(timeout);
  28778. // 弃用的写法
  28779. SuperMap.setRequestTimeout(timeout);
  28780. </script>
  28781. // ES6 Import
  28782. import { setRequestTimeout } from '{npm}';
  28783. setRequestTimeout(timeout);
  28784. * ```
  28785. */
  28786. var setRequestTimeout = function setRequestTimeout(timeout) {
  28787. return RequestTimeout = timeout;
  28788. };
  28789. /**
  28790. * @function getRequestTimeout
  28791. * @category BaseTypes Util
  28792. * @description 获取请求超时时间。
  28793. * @returns {number} 请求超时时间。
  28794. * @usage
  28795. * ```
  28796. * // 浏览器
  28797. <script type="text/javascript" src="{cdn}"></script>
  28798. <script>
  28799. {namespace}.getRequestTimeout();
  28800. // 弃用的写法
  28801. SuperMap.getRequestTimeout();
  28802. </script>
  28803. // ES6 Import
  28804. import { getRequestTimeout } from '{npm}';
  28805. getRequestTimeout();
  28806. * ```
  28807. */
  28808. var getRequestTimeout = function getRequestTimeout() {
  28809. return RequestTimeout || 45000;
  28810. };
  28811. /**
  28812. * @name FetchRequest
  28813. * @namespace
  28814. * @category BaseTypes Util
  28815. * @description 获取请求。
  28816. * @usage
  28817. * ```
  28818. * // 浏览器
  28819. * <script type="text/javascript" src="{cdn}"></script>
  28820. * <script>
  28821. * const result = {namespace}.FetchRequest.commit(method, url, params, options);
  28822. *
  28823. * </script>
  28824. *
  28825. * // ES6 Import
  28826. * import { FetchRequest } from '{npm}';
  28827. *
  28828. * const result = FetchRequest.commit(method, url, params, options);
  28829. *
  28830. * ```
  28831. */
  28832. var FetchRequest = {
  28833. /**
  28834. * @function FetchRequest.commit
  28835. * @description commit 请求。
  28836. * @param {string} method - 请求方法。
  28837. * @param {string} url - 请求地址。
  28838. * @param {string} params - 请求参数。
  28839. * @param {Object} options - 请求的配置属性。
  28840. * @returns {Promise} Promise 对象。
  28841. */
  28842. commit: function commit(method, url, params, options) {
  28843. method = method ? method.toUpperCase() : method;
  28844. switch (method) {
  28845. case 'GET':
  28846. return this.get(url, params, options);
  28847. case 'POST':
  28848. return this.post(url, params, options);
  28849. case 'PUT':
  28850. return this.put(url, params, options);
  28851. case 'DELETE':
  28852. return this["delete"](url, params, options);
  28853. default:
  28854. return this.get(url, params, options);
  28855. }
  28856. },
  28857. /**
  28858. * @function FetchRequest.supportDirectRequest
  28859. * @description supportDirectRequest 请求。
  28860. * @param {string} url - 请求地址。
  28861. * @param {Object} options - 请求的配置属性。
  28862. * @returns {boolean} 是否允许跨域请求。
  28863. */
  28864. supportDirectRequest: function supportDirectRequest(url, options) {
  28865. if (Util_Util.isInTheSameDomain(url)) {
  28866. return true;
  28867. }
  28868. if (options.crossOrigin != undefined) {
  28869. return options.crossOrigin;
  28870. } else {
  28871. return isCORS() || options.proxy;
  28872. }
  28873. },
  28874. /**
  28875. * @function FetchRequest.get
  28876. * @description get 请求。
  28877. * @param {string} url - 请求地址。
  28878. * @param {string} params - 请求参数。
  28879. * @param {Object} options - 请求的配置属性。
  28880. * @returns {Promise} Promise 对象。
  28881. */
  28882. get: function get(url, params, options) {
  28883. options = options || {};
  28884. var type = 'GET';
  28885. url = Util_Util.urlAppend(url, this._getParameterString(params || {}));
  28886. url = this._processUrl(url, options);
  28887. if (!this.supportDirectRequest(url, options)) {
  28888. url = url.replace('.json', '.jsonp');
  28889. var config = {
  28890. url: url,
  28891. data: params
  28892. };
  28893. return RequestJSONPPromise.GET(config);
  28894. }
  28895. if (!this.urlIsLong(url)) {
  28896. return this._fetch(url, params, options, type);
  28897. } else {
  28898. return this._postSimulatie(type, url.substring(0, url.indexOf('?')), params, options);
  28899. }
  28900. },
  28901. /**
  28902. * @function FetchRequest.delete
  28903. * @description delete 请求。
  28904. * @param {string} url - 请求地址。
  28905. * @param {string} params - 请求参数。
  28906. * @param {Object} options -请求的配置属性。
  28907. * @returns {Promise} Promise 对象。
  28908. */
  28909. "delete": function _delete(url, params, options) {
  28910. options = options || {};
  28911. var type = 'DELETE';
  28912. url = Util_Util.urlAppend(url, this._getParameterString(params || {}));
  28913. url = this._processUrl(url, options);
  28914. if (!this.supportDirectRequest(url, options)) {
  28915. url = url.replace('.json', '.jsonp');
  28916. var config = {
  28917. url: url += "&_method=DELETE",
  28918. data: params
  28919. };
  28920. return RequestJSONPPromise.DELETE(config);
  28921. }
  28922. if (this.urlIsLong(url)) {
  28923. return this._postSimulatie(type, url.substring(0, url.indexOf('?')), params, options);
  28924. }
  28925. return this._fetch(url, params, options, type);
  28926. },
  28927. /**
  28928. * @function FetchRequest.post
  28929. * @description post 请求。
  28930. * @param {string} url - 请求地址。
  28931. * @param {string} params - 请求参数。
  28932. * @param {Object} options - 请求的配置属性。
  28933. * @returns {Promise} Promise 对象。
  28934. */
  28935. post: function post(url, params, options) {
  28936. options = options || {};
  28937. url = this._processUrl(url, options);
  28938. if (!this.supportDirectRequest(url, options)) {
  28939. url = url.replace('.json', '.jsonp');
  28940. var config = {
  28941. url: Util_Util.urlAppend(url, "_method=POST"),
  28942. data: params
  28943. };
  28944. return RequestJSONPPromise.POST(config);
  28945. }
  28946. return this._fetch(url, params, options, 'POST');
  28947. },
  28948. /**
  28949. * @function FetchRequest.put
  28950. * @description put 请求。
  28951. * @param {string} url - 请求地址。
  28952. * @param {string} params - 请求参数。
  28953. * @param {Object} options - 请求的配置属性。
  28954. * @returns {Promise} Promise 对象。
  28955. */
  28956. put: function put(url, params, options) {
  28957. options = options || {};
  28958. url = this._processUrl(url, options);
  28959. if (!this.supportDirectRequest(url, options)) {
  28960. url = url.replace('.json', '.jsonp');
  28961. var config = {
  28962. url: url += "&_method=PUT",
  28963. data: params
  28964. };
  28965. return RequestJSONPPromise.PUT(config);
  28966. }
  28967. return this._fetch(url, params, options, 'PUT');
  28968. },
  28969. /**
  28970. * @function FetchRequest.urlIsLong
  28971. * @description URL 的字节长度是否太长。
  28972. * @param {string} url - 请求地址。
  28973. * @returns {boolean} URL 的字节长度是否太长。
  28974. */
  28975. urlIsLong: function urlIsLong(url) {
  28976. //当前url的字节长度。
  28977. var totalLength = 0,
  28978. charCode = null;
  28979. for (var i = 0, len = url.length; i < len; i++) {
  28980. //转化为Unicode编码
  28981. charCode = url.charCodeAt(i);
  28982. if (charCode < 0x007f) {
  28983. totalLength++;
  28984. } else if (0x0080 <= charCode && charCode <= 0x07ff) {
  28985. totalLength += 2;
  28986. } else if (0x0800 <= charCode && charCode <= 0xffff) {
  28987. totalLength += 3;
  28988. }
  28989. }
  28990. return totalLength < 2000 ? false : true;
  28991. },
  28992. _postSimulatie: function _postSimulatie(type, url, params, options) {
  28993. var separator = url.indexOf('?') > -1 ? '&' : '?';
  28994. url += separator + '_method=' + type;
  28995. if (typeof params !== 'string') {
  28996. params = JSON.stringify(params);
  28997. }
  28998. return this.post(url, params, options);
  28999. },
  29000. _processUrl: function _processUrl(url, options) {
  29001. if (this._isMVTRequest(url)) {
  29002. return url;
  29003. }
  29004. if (url.indexOf('.json') === -1 && !options.withoutFormatSuffix) {
  29005. if (url.indexOf('?') < 0) {
  29006. url += '.json';
  29007. } else {
  29008. var urlArrays = url.split('?');
  29009. if (urlArrays.length === 2) {
  29010. url = urlArrays[0] + '.json?' + urlArrays[1];
  29011. }
  29012. }
  29013. }
  29014. if (options && options.proxy) {
  29015. if (typeof options.proxy === 'function') {
  29016. url = options.proxy(url);
  29017. } else {
  29018. url = decodeURIComponent(url);
  29019. url = options.proxy + encodeURIComponent(url);
  29020. }
  29021. }
  29022. return url;
  29023. },
  29024. _fetch: function _fetch(url, params, options, type) {
  29025. options = options || {};
  29026. options.headers = options.headers || {};
  29027. if (!options.headers['Content-Type'] && !FormData.prototype.isPrototypeOf(params)) {
  29028. options.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
  29029. }
  29030. if (options.timeout) {
  29031. return this._timeout(options.timeout, FetchRequest_fetch(url, {
  29032. method: type,
  29033. headers: options.headers,
  29034. body: type === 'PUT' || type === 'POST' ? params : undefined,
  29035. credentials: this._getWithCredentials(options),
  29036. mode: 'cors',
  29037. timeout: getRequestTimeout()
  29038. }).then(function (response) {
  29039. return response;
  29040. }));
  29041. }
  29042. return FetchRequest_fetch(url, {
  29043. method: type,
  29044. body: type === 'PUT' || type === 'POST' ? params : undefined,
  29045. headers: options.headers,
  29046. credentials: this._getWithCredentials(options),
  29047. mode: 'cors',
  29048. timeout: getRequestTimeout()
  29049. }).then(function (response) {
  29050. return response;
  29051. });
  29052. },
  29053. _getWithCredentials: function _getWithCredentials(options) {
  29054. if (options.withCredentials === true) {
  29055. return 'include';
  29056. }
  29057. if (options.withCredentials === false) {
  29058. return 'omit';
  29059. }
  29060. return 'same-origin';
  29061. },
  29062. _fetchJsonp: function _fetchJsonp(url, options) {
  29063. options = options || {};
  29064. return fetch_jsonp_default()(url, {
  29065. method: 'GET',
  29066. timeout: options.timeout
  29067. }).then(function (response) {
  29068. return response;
  29069. });
  29070. },
  29071. _timeout: function _timeout(seconds, promise) {
  29072. return new Promise(function (resolve, reject) {
  29073. setTimeout(function () {
  29074. reject(new Error('timeout'));
  29075. }, seconds);
  29076. promise.then(resolve, reject);
  29077. });
  29078. },
  29079. _getParameterString: function _getParameterString(params) {
  29080. var paramsArray = [];
  29081. for (var key in params) {
  29082. var value = params[key];
  29083. if (value != null && typeof value !== 'function') {
  29084. var encodedValue;
  29085. if (Array.isArray(value) || value.toString() === '[object Object]') {
  29086. encodedValue = encodeURIComponent(JSON.stringify(value));
  29087. } else {
  29088. encodedValue = encodeURIComponent(value);
  29089. }
  29090. paramsArray.push(encodeURIComponent(key) + '=' + encodedValue);
  29091. }
  29092. }
  29093. return paramsArray.join('&');
  29094. },
  29095. _isMVTRequest: function _isMVTRequest(url) {
  29096. return url.indexOf('.mvt') > -1 || url.indexOf('.pbf') > -1;
  29097. }
  29098. };
  29099. ;// CONCATENATED MODULE: ./src/common/security/SecurityManager.js
  29100. function SecurityManager_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29101. function SecurityManager_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  29102. function SecurityManager_createClass(Constructor, protoProps, staticProps) { if (protoProps) SecurityManager_defineProperties(Constructor.prototype, protoProps); if (staticProps) SecurityManager_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  29103. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29104. * This program are made available under the terms of the Apache License, Version 2.0
  29105. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29106. /**
  29107. * @class SecurityManager
  29108. * @deprecatedclass SuperMap.SecurityManager
  29109. * @category Security
  29110. * @classdesc 安全管理中心,提供 iServer,iPortal,Online 统一权限认证管理。
  29111. * > 使用说明:
  29112. * > 创建任何一个服务之前调用 {@link SecurityManager.registerToken}或
  29113. * > {@link SecurityManager.registerKey}注册凭据。
  29114. * > 发送请求时根据 URL 或者服务 ID 获取相应的 key 或者 token 并自动添加到服务地址中。
  29115. * @usage
  29116. */
  29117. var SecurityManager = /*#__PURE__*/function () {
  29118. function SecurityManager() {
  29119. SecurityManager_classCallCheck(this, SecurityManager);
  29120. }
  29121. SecurityManager_createClass(SecurityManager, null, [{
  29122. key: "generateToken",
  29123. value:
  29124. /**
  29125. * @description 从服务器获取一个token,在此之前要注册服务器信息。
  29126. * @function SecurityManager.generateToken
  29127. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  29128. * @param {TokenServiceParameter} tokenParam - token 申请参数。
  29129. * @returns {Promise} 包含 token 信息的 Promise 对象。
  29130. */
  29131. function generateToken(url, tokenParam) {
  29132. var serverInfo = this.servers[url];
  29133. if (!serverInfo) {
  29134. return;
  29135. }
  29136. return FetchRequest.post(serverInfo.tokenServiceUrl, JSON.stringify(tokenParam.toJSON())).then(function (response) {
  29137. return response.text();
  29138. });
  29139. }
  29140. /**
  29141. * @description 注册安全服务器相关信息。
  29142. * @function SecurityManager.registerServers
  29143. * @param {ServerInfo} serverInfos - 服务器信息。
  29144. */
  29145. }, {
  29146. key: "registerServers",
  29147. value: function registerServers(serverInfos) {
  29148. this.servers = this.servers || {};
  29149. if (!Util_Util.isArray(serverInfos)) {
  29150. serverInfos = [serverInfos];
  29151. }
  29152. for (var i = 0; i < serverInfos.length; i++) {
  29153. var serverInfo = serverInfos[i];
  29154. this.servers[serverInfo.server] = serverInfo;
  29155. }
  29156. }
  29157. /**
  29158. * @description 服务请求都会自动带上这个 token。
  29159. * @function SecurityManager.registerToken
  29160. * @param {string} url -服务器域名+端口:如http://localhost:8090。
  29161. * @param {string} token - token。
  29162. */
  29163. }, {
  29164. key: "registerToken",
  29165. value: function registerToken(url, token) {
  29166. this.tokens = this.tokens || {};
  29167. if (!url || !token) {
  29168. return;
  29169. }
  29170. var domain = this._getTokenStorageKey(url);
  29171. this.tokens[domain] = token;
  29172. }
  29173. /**
  29174. * @description 注册 key,ids 为数组(存在一个 key 对应多个服务)。
  29175. * @function SecurityManager.registerKey
  29176. * @param {Array} ids - 可以是服务 ID 数组或者 URL 地址数组或者 webAPI 类型数组。
  29177. * @param {string} key - key。
  29178. */
  29179. }, {
  29180. key: "registerKey",
  29181. value: function registerKey(ids, key) {
  29182. this.keys = this.keys || {};
  29183. if (!ids || ids.length < 1 || !key) {
  29184. return;
  29185. }
  29186. ids = Util_Util.isArray(ids) ? ids : [ids];
  29187. for (var i = 0; i < ids.length; i++) {
  29188. var id = this._getUrlRestString(ids[0]) || ids[0];
  29189. this.keys[id] = key;
  29190. }
  29191. }
  29192. /**
  29193. * @description 获取服务器信息。
  29194. * @function SecurityManager.getServerInfo
  29195. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  29196. * @returns {ServerInfo} 服务器信息。
  29197. */
  29198. }, {
  29199. key: "getServerInfo",
  29200. value: function getServerInfo(url) {
  29201. this.servers = this.servers || {};
  29202. return this.servers[url];
  29203. }
  29204. /**
  29205. * @description 根据 URL 获取token。
  29206. * @function SecurityManager.getToken
  29207. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  29208. * @returns {string} token。
  29209. */
  29210. }, {
  29211. key: "getToken",
  29212. value: function getToken(url) {
  29213. if (!url) {
  29214. return;
  29215. }
  29216. this.tokens = this.tokens || {};
  29217. var domain = this._getTokenStorageKey(url);
  29218. return this.tokens[domain];
  29219. }
  29220. /**
  29221. * @description 根据 URL 获取 key。
  29222. * @function SecurityManager.getKey
  29223. * @param {string} id - ID。
  29224. * @returns {string} key。
  29225. */
  29226. }, {
  29227. key: "getKey",
  29228. value: function getKey(id) {
  29229. this.keys = this.keys || {};
  29230. var key = this._getUrlRestString(id) || id;
  29231. return this.keys[key];
  29232. }
  29233. /**
  29234. * @description iServer 登录验证。
  29235. * @function SecurityManager.loginiServer
  29236. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  29237. * @param {string} username - 用户名。
  29238. * @param {string} password - 密码。
  29239. * @param {boolean} [rememberme=false] - 是否记住。
  29240. * @returns {Promise} 包含 iServer 登录请求结果的 Promise 对象。
  29241. */
  29242. }, {
  29243. key: "loginiServer",
  29244. value: function loginiServer(url, username, password, rememberme) {
  29245. url = Util_Util.urlPathAppend(url, 'services/security/login');
  29246. var loginInfo = {
  29247. username: username && username.toString(),
  29248. password: password && password.toString(),
  29249. rememberme: rememberme
  29250. };
  29251. loginInfo = JSON.stringify(loginInfo);
  29252. var requestOptions = {
  29253. headers: {
  29254. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  29255. }
  29256. };
  29257. return FetchRequest.post(url, loginInfo, requestOptions).then(function (response) {
  29258. return response.json();
  29259. });
  29260. }
  29261. /**
  29262. * @description iServer登出。
  29263. * @function SecurityManager.logoutiServer
  29264. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  29265. * @returns {Promise} 是否登出成功。
  29266. */
  29267. }, {
  29268. key: "logoutiServer",
  29269. value: function logoutiServer(url) {
  29270. url = Util_Util.urlPathAppend(url, 'services/security/logout');
  29271. var requestOptions = {
  29272. headers: {
  29273. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  29274. },
  29275. withoutFormatSuffix: true
  29276. };
  29277. return FetchRequest.get(url, '', requestOptions).then(function () {
  29278. return true;
  29279. })["catch"](function () {
  29280. return false;
  29281. });
  29282. }
  29283. /**
  29284. * @description Online 登录验证。
  29285. * @function SecurityManager.loginOnline
  29286. * @param {string} callbackLocation - 跳转位置。
  29287. * @param {boolean} [newTab=true] - 是否新窗口打开。
  29288. */
  29289. }, {
  29290. key: "loginOnline",
  29291. value: function loginOnline(callbackLocation, newTab) {
  29292. var loginUrl = SecurityManager.SSO + '/login?service=' + callbackLocation;
  29293. this._open(loginUrl, newTab);
  29294. }
  29295. /**
  29296. * @description iPortal登录验证。
  29297. * @function SecurityManager.loginiPortal
  29298. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal。
  29299. * @param {string} username - 用户名。
  29300. * @param {string} password - 密码。
  29301. * @returns {Promise} 包含 iPortal 登录请求结果的 Promise 对象。
  29302. */
  29303. }, {
  29304. key: "loginiPortal",
  29305. value: function loginiPortal(url, username, password) {
  29306. url = Util_Util.urlPathAppend(url, 'web/login');
  29307. var loginInfo = {
  29308. username: username && username.toString(),
  29309. password: password && password.toString()
  29310. };
  29311. loginInfo = JSON.stringify(loginInfo);
  29312. var requestOptions = {
  29313. headers: {
  29314. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  29315. },
  29316. withCredentials: true
  29317. };
  29318. return FetchRequest.post(url, loginInfo, requestOptions).then(function (response) {
  29319. return response.json();
  29320. });
  29321. }
  29322. /**
  29323. * @description iPortal 登出。
  29324. * @function SecurityManager.logoutiPortal
  29325. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal。
  29326. * @returns {Promise} 如果登出成功,返回 true;否则返回 false。
  29327. */
  29328. }, {
  29329. key: "logoutiPortal",
  29330. value: function logoutiPortal(url) {
  29331. url = Util_Util.urlPathAppend(url, 'services/security/logout');
  29332. var requestOptions = {
  29333. headers: {
  29334. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  29335. },
  29336. withCredentials: true,
  29337. withoutFormatSuffix: true
  29338. };
  29339. return FetchRequest.get(url, '', requestOptions).then(function () {
  29340. return true;
  29341. })["catch"](function () {
  29342. return false;
  29343. });
  29344. }
  29345. /**
  29346. * @description iManager 登录验证。
  29347. * @function SecurityManager.loginManager
  29348. * @param {string} url - iManager 地址。地址参数为 iManager 首页地址,如: http://localhost:8390/imanager。
  29349. * @param {Object} [loginInfoParams] - iManager 登录参数。
  29350. * @param {string} loginInfoParams.userName - 用户名。
  29351. * @param {string} loginInfoParams.password - 密码。
  29352. * @param {Object} options
  29353. * @param {boolean} [options.isNewTab=true] - 不同域时是否在新窗口打开登录页面。
  29354. * @returns {Promise} 包含 iManager 登录请求结果的 Promise 对象。
  29355. */
  29356. }, {
  29357. key: "loginManager",
  29358. value: function loginManager(url, loginInfoParams, options) {
  29359. if (!Util_Util.isInTheSameDomain(url)) {
  29360. var isNewTab = options ? options.isNewTab : true;
  29361. this._open(url, isNewTab);
  29362. return;
  29363. }
  29364. var requestUrl = Util_Util.urlPathAppend(url, 'icloud/security/tokens');
  29365. var params = loginInfoParams || {};
  29366. var loginInfo = {
  29367. username: params.userName && params.userName.toString(),
  29368. password: params.password && params.password.toString()
  29369. };
  29370. loginInfo = JSON.stringify(loginInfo);
  29371. var requestOptions = {
  29372. headers: {
  29373. Accept: '*/*',
  29374. 'Content-Type': 'application/json'
  29375. }
  29376. };
  29377. var me = this;
  29378. return FetchRequest.post(requestUrl, loginInfo, requestOptions).then(function (response) {
  29379. response.text().then(function (result) {
  29380. me.imanagerToken = result;
  29381. return result;
  29382. });
  29383. });
  29384. }
  29385. /**
  29386. * @description 清空全部验证信息。
  29387. * @function SecurityManager.destroyAllCredentials
  29388. */
  29389. }, {
  29390. key: "destroyAllCredentials",
  29391. value: function destroyAllCredentials() {
  29392. this.keys = null;
  29393. this.tokens = null;
  29394. this.servers = null;
  29395. }
  29396. /**
  29397. * @description 清空令牌信息。
  29398. * @function SecurityManager.destroyToken
  29399. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal。
  29400. */
  29401. }, {
  29402. key: "destroyToken",
  29403. value: function destroyToken(url) {
  29404. if (!url) {
  29405. return;
  29406. }
  29407. var domain = this._getTokenStorageKey(url);
  29408. this.tokens = this.tokens || {};
  29409. if (this.tokens[domain]) {
  29410. delete this.tokens[domain];
  29411. }
  29412. }
  29413. /**
  29414. * @description 清空服务授权码。
  29415. * @function SecurityManager.destroyKey
  29416. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  29417. */
  29418. }, {
  29419. key: "destroyKey",
  29420. value: function destroyKey(url) {
  29421. if (!url) {
  29422. return;
  29423. }
  29424. this.keys = this.keys || {};
  29425. var key = this._getUrlRestString(url) || url;
  29426. if (this.keys[key]) {
  29427. delete this.keys[key];
  29428. }
  29429. }
  29430. /**
  29431. * @description 服务URL追加授权信息,授权信息需先通过SecurityManager.registerKey或SecurityManager.registerToken注册。
  29432. * @version 10.1.2
  29433. * @function SecurityManager.appendCredential
  29434. * @param {string} url - 服务URL。
  29435. * @returns {string} 绑定了token或者key的服务URL。
  29436. */
  29437. }, {
  29438. key: "appendCredential",
  29439. value: function appendCredential(url) {
  29440. var newUrl = url;
  29441. var value = this.getToken(url);
  29442. var credential = value ? new Credential(value, 'token') : null;
  29443. if (!credential) {
  29444. value = this.getKey(url);
  29445. credential = value ? new Credential(value, 'key') : null;
  29446. }
  29447. if (credential) {
  29448. newUrl = Util_Util.urlAppend(newUrl, credential.getUrlParameters());
  29449. }
  29450. return newUrl;
  29451. }
  29452. }, {
  29453. key: "_open",
  29454. value: function _open(url, newTab) {
  29455. newTab = newTab != null ? newTab : true;
  29456. var offsetX = window.screen.availWidth / 2 - this.INNER_WINDOW_WIDTH / 2;
  29457. var offsetY = window.screen.availHeight / 2 - this.INNER_WINDOW_HEIGHT / 2;
  29458. var options = 'height=' + this.INNER_WINDOW_HEIGHT + ', width=' + this.INNER_WINDOW_WIDTH + ',top=' + offsetY + ', left=' + offsetX + ',toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no';
  29459. if (newTab) {
  29460. window.open(url, 'login');
  29461. } else {
  29462. window.open(url, 'login', options);
  29463. }
  29464. }
  29465. }, {
  29466. key: "_getTokenStorageKey",
  29467. value: function _getTokenStorageKey(url) {
  29468. var patten = /(.*?):\/\/([^\/]+)/i;
  29469. var result = url.match(patten);
  29470. if (!result) {
  29471. return url;
  29472. }
  29473. return result[0];
  29474. }
  29475. }, {
  29476. key: "_getUrlRestString",
  29477. value: function _getUrlRestString(url) {
  29478. if (!url) {
  29479. return url;
  29480. }
  29481. // var patten = /http:\/\/(.*\/rest)/i;
  29482. var patten = /(http|https):\/\/(.*\/rest)/i;
  29483. var result = url.match(patten);
  29484. if (!result) {
  29485. return url;
  29486. }
  29487. return result[0];
  29488. }
  29489. }]);
  29490. return SecurityManager;
  29491. }();
  29492. SecurityManager.INNER_WINDOW_WIDTH = 600;
  29493. SecurityManager.INNER_WINDOW_HEIGHT = 600;
  29494. SecurityManager.SSO = 'https://sso.supermap.com';
  29495. SecurityManager.ONLINE = 'https://www.supermapol.com';
  29496. ;// CONCATENATED MODULE: ./src/common/iManager/iManagerServiceBase.js
  29497. function iManagerServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29498. function iManagerServiceBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  29499. function iManagerServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) iManagerServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) iManagerServiceBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  29500. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29501. * This program are made available under the terms of the Apache License, Version 2.0
  29502. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29503. /**
  29504. * @class IManagerServiceBase
  29505. * @aliasclass iManagerServiceBase
  29506. * @deprecatedclass SuperMap.iManagerServiceBase
  29507. * @classdesc iManager 服务基类(有权限限制的类需要实现此类)。
  29508. * @category iManager
  29509. * @param {string} url - iManager 首页地址,如:http://localhost:8390/imanager。
  29510. * @param {Object} options - 可选参数。
  29511. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  29512. * @param {Object} [options.headers] - 请求头。
  29513. * @usage
  29514. */
  29515. var IManagerServiceBase = /*#__PURE__*/function () {
  29516. function IManagerServiceBase(url, options) {
  29517. iManagerServiceBase_classCallCheck(this, IManagerServiceBase);
  29518. if (url) {
  29519. var end = url.substr(url.length - 1, 1);
  29520. this.serviceUrl = end === "/" ? url.substr(0, url.length - 2) : url;
  29521. }
  29522. this.options = options || {};
  29523. this.CLASS_NAME = "SuperMap.iManagerServiceBase";
  29524. }
  29525. /**
  29526. * @function IManagerServiceBase.prototype.request
  29527. * @description 子类统一通过该方法发送请求。
  29528. * @param {string} url - 请求 URL。
  29529. * @param {string} [method='GET'] - 请求类型。
  29530. * @param {Object} [requestOptions] - 请求选项。
  29531. * @param {Object} param - 请求参数。
  29532. * @description 发送请求。
  29533. * @returns {Promise} Promise 对象。
  29534. */
  29535. iManagerServiceBase_createClass(IManagerServiceBase, [{
  29536. key: "request",
  29537. value: function request(method, url, param, requestOptions) {
  29538. requestOptions = requestOptions || {
  29539. headers: {
  29540. 'Accept': '*/*',
  29541. 'Content-Type': 'application/json'
  29542. }
  29543. };
  29544. if (!requestOptions.hasOwnProperty("withCredentials")) {
  29545. requestOptions['withCredentials'] = true;
  29546. }
  29547. requestOptions['crossOrigin'] = this.options.crossOrigin;
  29548. requestOptions['headers'] = this.options.headers;
  29549. var token = SecurityManager.imanagerToken;
  29550. if (token) {
  29551. if (!requestOptions.headers) {
  29552. requestOptions.headers = [];
  29553. }
  29554. requestOptions.headers['X-Auth-Token'] = token;
  29555. }
  29556. if (param) {
  29557. param = JSON.stringify(param);
  29558. }
  29559. return FetchRequest.commit(method, url, param, requestOptions).then(function (response) {
  29560. return response.json();
  29561. });
  29562. }
  29563. }]);
  29564. return IManagerServiceBase;
  29565. }();
  29566. ;// CONCATENATED MODULE: ./src/common/iManager/iManagerCreateNodeParam.js
  29567. function iManagerCreateNodeParam_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  29568. function iManagerCreateNodeParam_createClass(Constructor, protoProps, staticProps) { if (protoProps) iManagerCreateNodeParam_defineProperties(Constructor.prototype, protoProps); if (staticProps) iManagerCreateNodeParam_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  29569. function iManagerCreateNodeParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29570. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29571. * This program are made available under the terms of the Apache License, Version 2.0
  29572. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29573. /**
  29574. * @class IManagerCreateNodeParam
  29575. * @aliasclass iManagerCreateNodeParam
  29576. * @deprecatedclass SuperMap.iManagerCreateNodeParam
  29577. * @classdesc iManager 创建节点参数。
  29578. * @category iManager
  29579. * @param {Object} [params] - 节点参数。
  29580. * @usage
  29581. */
  29582. var IManagerCreateNodeParam = /*#__PURE__*/iManagerCreateNodeParam_createClass(function IManagerCreateNodeParam(params) {
  29583. iManagerCreateNodeParam_classCallCheck(this, IManagerCreateNodeParam);
  29584. params = params || {};
  29585. this.nodeSpec = 'SMALL'; //取值范围: ['SMALL','MEDIUM','LARGE'] 以及自定义的环境规格名称
  29586. this.nodeCount = 1; //要创建vm的个数
  29587. this.nodeName = ''; //vm名称
  29588. this.password = ''; //vm的密码,空表示随机分配
  29589. this.description = ''; //描述信息
  29590. this.physicalMachineName = ''; //vm所属的物理机名称.
  29591. this.ips = []; //vm的ip,空数组表示随机分配
  29592. this.userName = ''; //vm所属用户
  29593. Util_Util.extend(this, params);
  29594. });
  29595. ;// CONCATENATED MODULE: ./src/common/iManager/iManager.js
  29596. function iManager_typeof(obj) { "@babel/helpers - typeof"; return iManager_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, iManager_typeof(obj); }
  29597. function iManager_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29598. function iManager_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  29599. function iManager_createClass(Constructor, protoProps, staticProps) { if (protoProps) iManager_defineProperties(Constructor.prototype, protoProps); if (staticProps) iManager_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  29600. function iManager_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) iManager_setPrototypeOf(subClass, superClass); }
  29601. function iManager_setPrototypeOf(o, p) { iManager_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iManager_setPrototypeOf(o, p); }
  29602. function iManager_createSuper(Derived) { var hasNativeReflectConstruct = iManager_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = iManager_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = iManager_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return iManager_possibleConstructorReturn(this, result); }; }
  29603. function iManager_possibleConstructorReturn(self, call) { if (call && (iManager_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return iManager_assertThisInitialized(self); }
  29604. function iManager_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  29605. function iManager_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  29606. function iManager_getPrototypeOf(o) { iManager_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iManager_getPrototypeOf(o); }
  29607. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29608. * This program are made available under the terms of the Apache License, Version 2.0
  29609. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29610. /**
  29611. * @class IManager
  29612. * @aliasclass iManager
  29613. * @deprecatedclass SuperMap.iManager
  29614. * @classdesc iManager 服务类。
  29615. * @category iManager
  29616. * @modulecategory Services
  29617. * @param {string} serviceUrl - iManager 首页地址。
  29618. * @usage
  29619. */
  29620. var IManager = /*#__PURE__*/function (_IManagerServiceBase) {
  29621. iManager_inherits(IManager, _IManagerServiceBase);
  29622. var _super = iManager_createSuper(IManager);
  29623. function IManager(iManagerUrl) {
  29624. iManager_classCallCheck(this, IManager);
  29625. return _super.call(this, iManagerUrl);
  29626. }
  29627. /**
  29628. * @function IManager.prototype.load
  29629. * @description 获取所有服务接口,验证是否已登录授权。
  29630. * @returns {Promise} Promise 对象。
  29631. */
  29632. iManager_createClass(IManager, [{
  29633. key: "load",
  29634. value: function load() {
  29635. return this.request("GET", this.serviceUrl + '/web/api/service.json');
  29636. }
  29637. /**
  29638. * @function IManager.prototype.createIServer
  29639. * @param {IManagerCreateNodeParam} createParam - 创建参数。
  29640. * @description 创建 iServer。
  29641. * @returns {Promise} Promise 对象。
  29642. */
  29643. }, {
  29644. key: "createIServer",
  29645. value: function createIServer(createParam) {
  29646. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/server.json', new IManagerCreateNodeParam(createParam));
  29647. }
  29648. /**
  29649. * @function IManager.prototype.createIPortal
  29650. * @param {IManagerCreateNodeParam} createParam - 创建参数。
  29651. * @description 创建 iPortal。
  29652. * @returns {Promise} Promise 对象。
  29653. */
  29654. }, {
  29655. key: "createIPortal",
  29656. value: function createIPortal(createParam) {
  29657. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/portal.json', new IManagerCreateNodeParam(createParam));
  29658. }
  29659. /**
  29660. * @function IManager.prototype.iServerList
  29661. * @description 获取所有创建的 iServer。
  29662. * @returns {Promise} Promise 对象。
  29663. */
  29664. }, {
  29665. key: "iServerList",
  29666. value: function iServerList() {
  29667. return this.request("GET", this.serviceUrl + '/icloud/web/nodes/server.json');
  29668. }
  29669. /**
  29670. * @function IManager.prototype.iPortalList
  29671. * @description 获取所有创建的 iPortal。
  29672. * @returns {Promise} Promise 对象。
  29673. */
  29674. }, {
  29675. key: "iPortalList",
  29676. value: function iPortalList() {
  29677. return this.request("GET", this.serviceUrl + '/icloud/web/nodes/portal.json');
  29678. }
  29679. /**
  29680. * @function IManager.prototype.startNodes
  29681. * @param {Array.<string>} ids - 需要启动节点的 ID 数组。e.g:['1']。
  29682. * @description 启动节点。
  29683. * @returns {Promise} Promise 对象。
  29684. */
  29685. }, {
  29686. key: "startNodes",
  29687. value: function startNodes(ids) {
  29688. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/started.json', ids);
  29689. }
  29690. /**
  29691. * @function IManager.prototype.stopNodes
  29692. * @param {Array.<string>} ids - 需要停止节点的 ID 数组。e.g:['1']。
  29693. * @description 停止节点。
  29694. * @returns {Promise} Promise 对象。
  29695. */
  29696. }, {
  29697. key: "stopNodes",
  29698. value: function stopNodes(ids) {
  29699. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/stopped.json', ids);
  29700. }
  29701. }]);
  29702. return IManager;
  29703. }(IManagerServiceBase);
  29704. ;// CONCATENATED MODULE: ./src/common/iManager/index.js
  29705. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29706. * This program are made available under the terms of the Apache License, Version 2.0
  29707. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29708. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalServiceBase.js
  29709. function iPortalServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29710. function iPortalServiceBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  29711. function iPortalServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalServiceBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  29712. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29713. * This program are made available under the terms of the Apache License, Version 2.0
  29714. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29715. /**
  29716. * @class IPortalServiceBase
  29717. * @aliasclass iPortalServiceBase
  29718. * @deprecatedclass SuperMap.iPortalServiceBase
  29719. * @classdesc iPortal 服务基类(有权限限制的类需要实现此类)。
  29720. * @category iPortal/Online Core
  29721. * @param {string} url - 服务地址。
  29722. * @param {Object} options - 可选参数。
  29723. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  29724. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  29725. * @param {Object} [options.headers] - 请求头。
  29726. * @usage
  29727. */
  29728. var IPortalServiceBase = /*#__PURE__*/function () {
  29729. function IPortalServiceBase(url, options) {
  29730. iPortalServiceBase_classCallCheck(this, IPortalServiceBase);
  29731. options = options || {};
  29732. this.serviceUrl = url;
  29733. this.CLASS_NAME = "SuperMap.iPortalServiceBase";
  29734. this.withCredentials = options.withCredentials || false;
  29735. this.crossOrigin = options.crossOrigin;
  29736. this.headers = options.headers;
  29737. }
  29738. /**
  29739. * @function IPortalServiceBase.prototype.request
  29740. * @description 子类统一通过该方法发送请求。
  29741. * @param {string} [method='GET'] - 请求类型。
  29742. * @param {string} url - 服务地址。
  29743. * @param {Object} param - 请求参数。
  29744. * @param {Object} [requestOptions] - fetch 请求配置项。
  29745. * @returns {Promise} 返回包含请求结果的 Promise 对象。
  29746. */
  29747. iPortalServiceBase_createClass(IPortalServiceBase, [{
  29748. key: "request",
  29749. value: function request(method, url, param) {
  29750. var requestOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {
  29751. headers: this.headers,
  29752. crossOrigin: this.crossOrigin,
  29753. withCredentials: this.withCredentials
  29754. };
  29755. url = SecurityManager.appendCredential(url);
  29756. return FetchRequest.commit(method, url, param, requestOptions).then(function (response) {
  29757. return response.json();
  29758. });
  29759. }
  29760. }]);
  29761. return IPortalServiceBase;
  29762. }();
  29763. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalQueryParam.js
  29764. function iPortalQueryParam_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  29765. function iPortalQueryParam_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalQueryParam_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalQueryParam_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  29766. function iPortalQueryParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29767. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29768. * This program are made available under the terms of the Apache License, Version 2.0
  29769. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29770. /**
  29771. * @class IPortalQueryParam
  29772. * @aliasclass iPortalQueryParam
  29773. * @deprecatedclass SuperMap.iPortalQueryParam
  29774. * @classdesc iPortal 资源查询参数。
  29775. * @version 10.0.1
  29776. * @category iPortal/Online Resources ResourcesQuery
  29777. * @param {Object} params - 可选参数。
  29778. * @param {ResourceType} [params.resourceType] - 资源类型。
  29779. * @param {number} [params.pageSize] - 分页中每页大小。
  29780. * @param {number} [params.currentPage] - 分页页码。
  29781. * @param {OrderBy} [params.orderBy] - 排序字段。
  29782. * @param {OrderType} [params.orderType] - 根据升序还是降序过滤。
  29783. * @param {SearchType} [params.searchType] - 根据查询的范围进行过滤。
  29784. * @param {Array} [params.tags] - 标签。
  29785. * @param {Array} [params.dirIds] - 目录 ID。
  29786. * @param {Array} [params.resourceSubTypes] - 根据资源的子类型进行过滤。
  29787. * @param {AggregationTypes} [params.aggregationTypes] - 聚合查询的类型。
  29788. * @param {string} [params.text] - 搜索的关键词。
  29789. * @param {Array} [params.groupIds] - 根据群组进行过滤。
  29790. * @param {Array} [params.departmentIds] - 根据部门进行过滤。
  29791. * @usage
  29792. */
  29793. var IPortalQueryParam = /*#__PURE__*/iPortalQueryParam_createClass(function IPortalQueryParam(params) {
  29794. iPortalQueryParam_classCallCheck(this, IPortalQueryParam);
  29795. params = params || {};
  29796. this.resourceType = ""; // 空为全部 MAP SERVICE SCENE DATA INSIGHTS_WORKSPACE MAP_DASHBOARD
  29797. this.pageSize = 12; // 每页多少条
  29798. this.currentPage = 1; // 第几页
  29799. this.orderBy = "UPDATETIME"; // UPDATETIME HEATLEVEL
  29800. this.orderType = "DESC"; // DESC ASC
  29801. this.searchType = "PUBLIC"; // PUBLIC SHARETOME_RES MYDEPARTMENT_RES MYGROUP_RES MY_RES
  29802. this.tags = []; // 标签
  29803. this.dirIds = []; // 类别
  29804. this.resourceSubTypes = []; // 类型
  29805. this.aggregationTypes = []; // TAG TYPE SUBTYPE
  29806. this.text = ""; // 搜索字段
  29807. this.groupIds = []; // 群组Id过滤
  29808. this.departmentIds = []; // 部门Id过滤
  29809. Util_Util.extend(this, params);
  29810. });
  29811. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalQueryResult.js
  29812. function iPortalQueryResult_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  29813. function iPortalQueryResult_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalQueryResult_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalQueryResult_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  29814. function iPortalQueryResult_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29815. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29816. * This program are made available under the terms of the Apache License, Version 2.0
  29817. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29818. /**
  29819. * @class IPortalQueryResult
  29820. * @aliasclass iPortalQueryResult
  29821. * @deprecatedclass SuperMap.iPortalQueryResult
  29822. * @classdesc iPortal 资源结果集封装类。
  29823. * @version 10.0.1
  29824. * @category iPortal/Online Resources ResourcesQuery
  29825. * @param {Object} queryResult - 可选参数。
  29826. * @param {Array} [queryResult.content] - 页面内容。
  29827. * @param {number} [queryResult.total] - 总记录数。
  29828. * @param {number} [queryResult.currentPage] - 当前第几页。
  29829. * @param {number} [queryResult.pageSize] - 每页大小。
  29830. * @param {Object} [queryResult.aggregations] - 聚合查询的结果。
  29831. * @usage
  29832. */
  29833. var IPortalQueryResult = /*#__PURE__*/iPortalQueryResult_createClass(function IPortalQueryResult(queryResult) {
  29834. iPortalQueryResult_classCallCheck(this, IPortalQueryResult);
  29835. queryResult = queryResult || {};
  29836. this.content = [];
  29837. this.total = 0;
  29838. this.currentPage = 1;
  29839. this.pageSize = 12;
  29840. this.aggregations = null;
  29841. Util_Util.extend(this, queryResult);
  29842. });
  29843. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalResource.js
  29844. function iPortalResource_typeof(obj) { "@babel/helpers - typeof"; return iPortalResource_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, iPortalResource_typeof(obj); }
  29845. function iPortalResource_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29846. function iPortalResource_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  29847. function iPortalResource_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalResource_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalResource_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  29848. function iPortalResource_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) iPortalResource_setPrototypeOf(subClass, superClass); }
  29849. function iPortalResource_setPrototypeOf(o, p) { iPortalResource_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iPortalResource_setPrototypeOf(o, p); }
  29850. function iPortalResource_createSuper(Derived) { var hasNativeReflectConstruct = iPortalResource_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = iPortalResource_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = iPortalResource_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return iPortalResource_possibleConstructorReturn(this, result); }; }
  29851. function iPortalResource_possibleConstructorReturn(self, call) { if (call && (iPortalResource_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return iPortalResource_assertThisInitialized(self); }
  29852. function iPortalResource_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  29853. function iPortalResource_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  29854. function iPortalResource_getPrototypeOf(o) { iPortalResource_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iPortalResource_getPrototypeOf(o); }
  29855. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29856. * This program are made available under the terms of the Apache License, Version 2.0
  29857. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29858. /**
  29859. * @class IPortalResource
  29860. * @aliasclass iPortalResource
  29861. * @deprecatedclass SuperMap.iPortalResource
  29862. * @classdesc iPortal 资源详情类。
  29863. * @version 10.0.1
  29864. * @category iPortal/Online Resources
  29865. * @param {string} portalUrl - 服务地址。
  29866. * @param {Object} resourceInfo - 可选参数。
  29867. * @param {Array} [resourceInfo.authorizeSetting] - 资源的授权信息。
  29868. * @param {string} [resourceInfo.bounds] - 资源的坐标范围。
  29869. * @param {string} [resourceInfo.bounds4326] - 资源的坐标范围,转换为EPSG 4326坐标系统后的地理范围。
  29870. * @param {string} [resourceInfo.checkStatus] - 资源的审核状态,可以是:空,SUCCESSFUL,UNCHECKED,FAILED。
  29871. * @param {Date} [resourceInfo.createTime] - 资源的创建时间。
  29872. * @param {string} [resourceInfo.description] - 资源描述。
  29873. * @param {number} [resourceInfo.dirId] - 资源所在的门户目录的ID。
  29874. * @param {number} [resourceInfo.epsgCode] - 门户资源基于的坐标系的EPSG值。
  29875. * @param {number} [resourceInfo.heatLevel] - 记录资源的访问量或下载量。
  29876. * @param {string} [resourceInfo.id] - 资源存储到ElasticSearch中的文档ID。
  29877. * @param {string} [resourceInfo.name] - 资源名称。
  29878. * @param {number} [resourceInfo.personalDirId] - 资源所在的个人目录的ID。
  29879. * @param {number} [resourceInfo.resourceId] - 资源表(maps,services等)里的ID。
  29880. * @param {string} [resourceInfo.resourceSubType] - 某类资源的具体子类型。
  29881. * @param {ResourceType} [resourceInfo.resourceType] - 资源类型。
  29882. * @param {number} [resourceInfo.serviceRootUrlId] - 批量注册服务时,服务根地址的ID。
  29883. * @param {Array} [resourceInfo.tags] - 资源的标签。
  29884. * @param {string} [resourceInfo.thumbnail] - 资源的缩略图。
  29885. * @param {Date} [resourceInfo.updateTime] - 资源的更新时间。
  29886. * @param {string} [resourceInfo.userName] - 搜索的关键词。
  29887. * @param {Object} [resourceInfo.sourceJSON] - 提供了门户项目返回的所有信息。
  29888. * @extends {IPortalServiceBase}
  29889. * @usage
  29890. */
  29891. var IPortalResource = /*#__PURE__*/function (_IPortalServiceBase) {
  29892. iPortalResource_inherits(IPortalResource, _IPortalServiceBase);
  29893. var _super = iPortalResource_createSuper(IPortalResource);
  29894. function IPortalResource(portalUrl, resourceInfo) {
  29895. var _this;
  29896. iPortalResource_classCallCheck(this, IPortalResource);
  29897. _this = _super.call(this, portalUrl);
  29898. resourceInfo = resourceInfo || {};
  29899. _this.authorizeSetting = [];
  29900. _this.bounds = "";
  29901. _this.bounds4326 = "";
  29902. _this.checkStatus = "";
  29903. _this.createTime = 0;
  29904. _this.description = null;
  29905. _this.dirId = null;
  29906. _this.epsgCode = 0;
  29907. _this.heatLevel = 0;
  29908. _this.id = 0;
  29909. _this.name = "";
  29910. _this.personalDirId = null;
  29911. _this.resourceId = 0;
  29912. _this.resourceSubType = null;
  29913. _this.resourceType = null;
  29914. _this.serviceRootUrlId = null;
  29915. _this.tags = null;
  29916. _this.thumbnail = null;
  29917. _this.updateTime = 0;
  29918. _this.userName = "";
  29919. _this.sourceJSON = {}; //返回门户资源详细信息
  29920. Util_Util.extend(iPortalResource_assertThisInitialized(_this), resourceInfo); // INSIGHTS_WORKSPACE MAP_DASHBOARD
  29921. _this.resourceUrl = portalUrl + "/web/" + _this.resourceType.replace("_", "").toLowerCase() + "s/" + _this.resourceId;
  29922. if (_this.withCredentials) {
  29923. _this.resourceUrl = portalUrl + "/web/mycontent/" + _this.resourceType.replace("_", "").toLowerCase() + "s/" + _this.resourceId;
  29924. }
  29925. // if (this.id) {
  29926. // this.mapUrl = mapUrl + "/" + this.id;
  29927. // }
  29928. return _this;
  29929. }
  29930. /**
  29931. * @function IPortalResource.prototype.load
  29932. * @description 加载资源信息。
  29933. * @returns {Promise} 返回 Promise 对象。如果成功,Promise 没有返回值,请求返回结果自动填充到该类的属性中;如果失败,Promise 返回值包含错误信息。
  29934. */
  29935. iPortalResource_createClass(IPortalResource, [{
  29936. key: "load",
  29937. value: function load() {
  29938. var me = this;
  29939. return me.request("GET", me.resourceUrl + ".json").then(function (resourceInfo) {
  29940. if (resourceInfo.error) {
  29941. return resourceInfo;
  29942. }
  29943. me.sourceJSON = resourceInfo;
  29944. });
  29945. }
  29946. /**
  29947. * @function IPortalResource.prototype.update
  29948. * @description 更新资源属性信息。
  29949. * @returns {Promise} 返回包含更新操作状态的 Promise 对象。
  29950. */
  29951. }, {
  29952. key: "update",
  29953. value: function update() {
  29954. var resourceName = this.resourceType.replace("_", "").toLowerCase();
  29955. var options = {
  29956. headers: {
  29957. 'Content-Type': 'application/x-www-form-urlencoded'
  29958. }
  29959. };
  29960. if (resourceName === 'data') {
  29961. this.resourceUrl = this.resourceUrl + "/attributes.json";
  29962. }
  29963. var entity = JSON.stringify(this.sourceJSON);
  29964. //对服务资源进行编辑时,请求体内容只留关键字字段(目前如果是全部字段 更新返回成功 但其实没有真正的更新)
  29965. if (resourceName === 'service') {
  29966. var serviceInfo = {
  29967. authorizeSetting: this.sourceJSON.authorizeSetting,
  29968. metadata: this.sourceJSON.metadata,
  29969. tags: this.sourceJSON.tags,
  29970. thumbnail: this.sourceJSON.thumbnail,
  29971. tokenRefreshUrl: this.sourceJSON.tokenRefreshUrl
  29972. };
  29973. entity = JSON.stringify(serviceInfo);
  29974. }
  29975. return this.request("PUT", this.resourceUrl, entity, options);
  29976. }
  29977. }]);
  29978. return IPortalResource;
  29979. }(IPortalServiceBase);
  29980. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalShareParam.js
  29981. function iPortalShareParam_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  29982. function iPortalShareParam_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalShareParam_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalShareParam_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  29983. function iPortalShareParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29984. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29985. * This program are made available under the terms of the Apache License, Version 2.0
  29986. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29987. /**
  29988. * @class IPortalShareParam
  29989. * @aliasclass iPortalShareParam
  29990. * @deprecatedclass SuperMap.iPortalShareParam
  29991. * @classdesc iPortal 资源共享参数。
  29992. * @version 10.0.1
  29993. * @category iPortal/Online Resources ResourcesShare
  29994. * @param {Object} params - 可选参数。
  29995. * @param {ResourceType} [params.resourceType] - 资源类型。
  29996. * @param {Array} [params.ids] - 资源的ID数组。
  29997. * @param {IPortalShareEntity} [params.entities] - 资源的实体共享参数。
  29998. * @usage
  29999. */
  30000. var IPortalShareParam = /*#__PURE__*/iPortalShareParam_createClass(function IPortalShareParam(params) {
  30001. iPortalShareParam_classCallCheck(this, IPortalShareParam);
  30002. params = params || {};
  30003. this.ids = [];
  30004. this.entities = [];
  30005. this.resourceType = ""; // MAP SERVICE SCENE DATA INSIGHTS_WORKSPACE MAP_DASHBOARD
  30006. Util_Util.extend(this, params);
  30007. });
  30008. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortal.js
  30009. function iPortal_typeof(obj) { "@babel/helpers - typeof"; return iPortal_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, iPortal_typeof(obj); }
  30010. function iPortal_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30011. function iPortal_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  30012. function iPortal_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortal_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortal_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  30013. function iPortal_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) iPortal_setPrototypeOf(subClass, superClass); }
  30014. function iPortal_setPrototypeOf(o, p) { iPortal_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iPortal_setPrototypeOf(o, p); }
  30015. function iPortal_createSuper(Derived) { var hasNativeReflectConstruct = iPortal_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = iPortal_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = iPortal_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return iPortal_possibleConstructorReturn(this, result); }; }
  30016. function iPortal_possibleConstructorReturn(self, call) { if (call && (iPortal_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return iPortal_assertThisInitialized(self); }
  30017. function iPortal_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30018. function iPortal_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  30019. function iPortal_getPrototypeOf(o) { iPortal_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iPortal_getPrototypeOf(o); }
  30020. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30021. * This program are made available under the terms of the Apache License, Version 2.0
  30022. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30023. /**
  30024. * @class IPortal
  30025. * @aliasclass iPortal
  30026. * @deprecatedclass SuperMap.iPortal
  30027. * @classdesc 对接 SuperMap iPortal 基础服务。
  30028. * @category iPortal/Online Resources
  30029. * @modulecategory Services
  30030. * @extends {IPortalServiceBase}
  30031. * @param {string} iportalUrl - 服务地址。
  30032. * @param {Object} options - 可选参数。
  30033. * @param {boolean} [options.withCredentials] - 请求是否携带 cookie。
  30034. * @usage
  30035. */
  30036. var IPortal = /*#__PURE__*/function (_IPortalServiceBase) {
  30037. iPortal_inherits(IPortal, _IPortalServiceBase);
  30038. var _super = iPortal_createSuper(IPortal);
  30039. function IPortal(iportalUrl, options) {
  30040. var _this;
  30041. iPortal_classCallCheck(this, IPortal);
  30042. _this = _super.call(this, iportalUrl, options);
  30043. _this.iportalUrl = iportalUrl;
  30044. options = options || {};
  30045. _this.withCredentials = options.withCredentials || false;
  30046. return _this;
  30047. }
  30048. /**
  30049. * @function IPortal.prototype.load
  30050. * @description 加载页面。
  30051. * @returns {Promise} 包含 iportal web 资源信息的 Promise 对象。
  30052. */
  30053. iPortal_createClass(IPortal, [{
  30054. key: "load",
  30055. value: function load() {
  30056. return FetchRequest.get(this.iportalUrl + "/web");
  30057. }
  30058. /**
  30059. * @function IPortal.prototype.queryResources
  30060. * @description 查询资源。
  30061. * @version 10.0.1
  30062. * @param {IPortalQueryParam} queryParams - 查询参数。
  30063. * @returns {Promise} 包含所有资源结果的 Promise 对象。
  30064. */
  30065. }, {
  30066. key: "queryResources",
  30067. value: function queryResources(queryParams) {
  30068. if (!(queryParams instanceof IPortalQueryParam)) {
  30069. return new Promise(function (resolve) {
  30070. resolve("queryParams is not instanceof iPortalQueryParam !");
  30071. });
  30072. }
  30073. var me = this;
  30074. var resourceUrl = this.iportalUrl + "/gateway/catalog/resource/search.json";
  30075. queryParams.t = new Date().getTime();
  30076. return this.request("GET", resourceUrl, queryParams).then(function (result) {
  30077. var content = [];
  30078. (result.content || []).forEach(function (item) {
  30079. content.push(new IPortalResource(me.iportalUrl, item));
  30080. });
  30081. var queryResult = new IPortalQueryResult();
  30082. queryResult.content = content;
  30083. queryResult.total = result.total;
  30084. queryResult.currentPage = result.currentPage;
  30085. queryResult.pageSize = result.pageSize;
  30086. queryResult.aggregations = result.aggregations;
  30087. return queryResult;
  30088. });
  30089. }
  30090. /**
  30091. * @function IPortal.prototype.updateResourcesShareSetting
  30092. * @description 更新共享设置。
  30093. * @version 10.0.1
  30094. * @param {IPortalShareParam} shareParams - 共享的参数。
  30095. * @returns {Promise} 包含共享资源结果的 Promise 对象。
  30096. */
  30097. }, {
  30098. key: "updateResourcesShareSetting",
  30099. value: function updateResourcesShareSetting(shareParams) {
  30100. if (!(shareParams instanceof IPortalShareParam)) {
  30101. return new Promise(function (resolve) {
  30102. resolve("shareParams is not instanceof iPortalShareParam !");
  30103. });
  30104. }
  30105. var resourceUrlName = shareParams.resourceType.replace("_", "").toLowerCase() + "s";
  30106. if (resourceUrlName === "datas") {
  30107. resourceUrlName = "mycontent/" + resourceUrlName;
  30108. }
  30109. var cloneShareParams = {
  30110. ids: shareParams.ids,
  30111. entities: shareParams.entities
  30112. };
  30113. var shareUrl = this.iportalUrl + "/web/" + resourceUrlName + "/sharesetting.json";
  30114. return this.request("PUT", shareUrl, JSON.stringify(cloneShareParams)).then(function (result) {
  30115. return result;
  30116. });
  30117. }
  30118. }]);
  30119. return IPortal;
  30120. }(IPortalServiceBase);
  30121. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalShareEntity.js
  30122. function iPortalShareEntity_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  30123. function iPortalShareEntity_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalShareEntity_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalShareEntity_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  30124. function iPortalShareEntity_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30125. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30126. * This program are made available under the terms of the Apache License, Version 2.0
  30127. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30128. /**
  30129. * @class IPortalShareEntity
  30130. * @aliasclass iPortalShareEntity
  30131. * @deprecatedclass SuperMap.iPortalShareEntity
  30132. * @classdesc iPortal 资源共享实体参数。
  30133. * @version 10.0.1
  30134. * @category iPortal/Online Resources ResourcesShare
  30135. * @param {Object} shareEntity - 可选参数。
  30136. * @param {PermissionType} [shareEntity.permissionType] - 权限类型。
  30137. * @param {EntityType} [shareEntity.entityType] - 实体类型。
  30138. * @param {string} [shareEntity.entityName] - 实体 Name。对应的 USER(用户)、ROLE(角色)、GROUP(用户组)、IPORTALGROUP(群组)的名称。
  30139. * @param {number} [shareEntity.entityId] - 实体的 ID。用于群组的授权。
  30140. * @usage
  30141. */
  30142. var IPortalShareEntity = /*#__PURE__*/iPortalShareEntity_createClass(function IPortalShareEntity(shareEntity) {
  30143. iPortalShareEntity_classCallCheck(this, IPortalShareEntity);
  30144. shareEntity = shareEntity || {};
  30145. this.permissionType = ""; // SEARCH READ READWRITE DOWNLOAD
  30146. this.entityType = ""; // USER DEPARTMENT IPORTALGROUP
  30147. this.entityName = "GUEST"; // GUEST or 具体用户 name
  30148. this.entityId = null;
  30149. Util_Util.extend(this, shareEntity);
  30150. });
  30151. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalAddResourceParam.js
  30152. function iPortalAddResourceParam_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  30153. function iPortalAddResourceParam_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalAddResourceParam_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalAddResourceParam_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  30154. function iPortalAddResourceParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30155. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30156. * This program are made available under the terms of the Apache License, Version 2.0
  30157. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30158. /**
  30159. * @class IPortalAddResourceParam
  30160. * @aliasclass iPortalAddResourceParam
  30161. * @deprecatedclass SuperMap.iPortalAddResourceParam
  30162. * @classdesc iPortal 添加资源参数。
  30163. * @version 10.0.1
  30164. * @category iPortal/Online Resources ResourcesShare
  30165. * @param {Object} params - 可选参数。
  30166. * @param {string} [params.rootUrl] - 服务地址。
  30167. * @param {Array} [params.tags] - 标签。
  30168. * @param {IPortalShareEntity} [params.entities] - 资源的实体共享参数。
  30169. * @usage
  30170. */
  30171. var IPortalAddResourceParam = /*#__PURE__*/iPortalAddResourceParam_createClass(function IPortalAddResourceParam(params) {
  30172. iPortalAddResourceParam_classCallCheck(this, IPortalAddResourceParam);
  30173. params = params || {};
  30174. this.rootUrl = "";
  30175. this.tags = [];
  30176. this.entities = [];
  30177. Util_Util.extend(this, params);
  30178. });
  30179. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalRegisterServiceParam.js
  30180. function iPortalRegisterServiceParam_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  30181. function iPortalRegisterServiceParam_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalRegisterServiceParam_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalRegisterServiceParam_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  30182. function iPortalRegisterServiceParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30183. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30184. * This program are made available under the terms of the Apache License, Version 2.0
  30185. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30186. /**
  30187. * @class IPortalRegisterServiceParam
  30188. * @aliasclass iPortalRegisterServiceParam
  30189. * @deprecatedclass SuperMap.iPortalRegisterServiceParam
  30190. * @classdesc iPortal 注册服务参数。
  30191. * @version 10.0.1
  30192. * @category iPortal/Online Resources Data
  30193. * @param {Object} params - 可选参数。
  30194. * @param {string} [params.type] - 服务类型。
  30195. * @param {Array} [params.tags] - 服务标签。
  30196. * @param {IPortalShareEntity} [params.entities] - 资源的实体共享参数。
  30197. * @param {Object} [params.metadata] - 服务元信息。
  30198. * @param {Array} [params.addedMapNames] - 地图服务列表。
  30199. * @param {Array} [params.addedSceneNames] - 场景服务列表。
  30200. * @usage
  30201. */
  30202. var IPortalRegisterServiceParam = /*#__PURE__*/iPortalRegisterServiceParam_createClass(function IPortalRegisterServiceParam(params) {
  30203. iPortalRegisterServiceParam_classCallCheck(this, IPortalRegisterServiceParam);
  30204. params = params || {};
  30205. this.type = ""; // SUPERMAP_REST ARCGIS_REST WMS WFS WCS WPS WMTS OTHERS
  30206. this.tags = [];
  30207. this.entities = [];
  30208. this.metadata = {};
  30209. this.addedMapNames = [];
  30210. this.addedSceneNames = [];
  30211. Util_Util.extend(this, params);
  30212. });
  30213. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalAddDataParam.js
  30214. function iPortalAddDataParam_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  30215. function iPortalAddDataParam_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalAddDataParam_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalAddDataParam_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  30216. function iPortalAddDataParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30217. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30218. * This program are made available under the terms of the Apache License, Version 2.0
  30219. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30220. /**
  30221. * @class IPortalAddDataParam
  30222. * @aliasclass iPortalAddDataParam
  30223. * @deprecatedclass SuperMap.iPortalAddDataParam
  30224. * @classdesc iPortal 上传/注册数据所需的参数。
  30225. * @version 10.0.1
  30226. * @category iPortal/Online Resources Data
  30227. * @param {Object} params - 参数。
  30228. * @param {string} params.fileName - 文件名称。
  30229. * @param {DataItemType} params.type - 数据类型。
  30230. * @param {Array} [params.tags] - 数据的标签。
  30231. * @param {IPortalDataMetaInfoParam} [params.dataMetaInfo] - 数据元信息。
  30232. * @usage
  30233. */
  30234. var IPortalAddDataParam = /*#__PURE__*/iPortalAddDataParam_createClass(function IPortalAddDataParam(params) {
  30235. iPortalAddDataParam_classCallCheck(this, IPortalAddDataParam);
  30236. params = params || {};
  30237. this.fileName = "";
  30238. this.type = "";
  30239. this.tags = [];
  30240. this.dataMetaInfo = {};
  30241. Util_Util.extend(this, params);
  30242. });
  30243. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalDataMetaInfoParam.js
  30244. function iPortalDataMetaInfoParam_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  30245. function iPortalDataMetaInfoParam_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalDataMetaInfoParam_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalDataMetaInfoParam_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  30246. function iPortalDataMetaInfoParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30247. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30248. * This program are made available under the terms of the Apache License, Version 2.0
  30249. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30250. /**
  30251. * @class IPortalDataMetaInfoParam
  30252. * @aliasclass iPortalDataMetaInfoParam
  30253. * @deprecatedclass SuperMap.iPortalDataMetaInfoParam
  30254. * @classdesc iPortal 上传数据/注册数据元信息所需的参数。
  30255. * @version 10.0.1
  30256. * @category iPortal/Online Resources Data
  30257. * @param {Object} params - 参数。
  30258. * @param {string} params.xField - X 坐标字段。
  30259. * @param {string} params.yField - Y 坐标字段。
  30260. * @param {number} params.xIndex - x所在列(关系型存储下CSV或EXCEL数据时必填)。
  30261. * @param {number} params.yIndex - y所在列(关系型存储下CSV或EXCEL数据时必填)。
  30262. * @param {Array.<string>} [params.fieldTypes] - 设置字段类型(关系型存储下CSV或EXCEL数据时可选填)。默认类型为:WTEXT。该参数按照CSV文件字段顺序从左到右依次设置,其中默认字段类型可省略不设置。例如,CSV文件中有10个字段,如果只需设定第1,2,4个字段,可设置为['a','b',,'c']。
  30263. * @param {string} params.separator - 分隔符(关系型存储下CSV数据时必填)。
  30264. * @param {boolean} params.firstRowIsHead - 是否带表头(关系型存储下CSV数据时必填)。
  30265. * @param {boolean} params.url - HDFS注册目录地址。
  30266. * @param {IPortalDataStoreInfoParam} params.dataStoreInfo - 注册数据时的数据存储信息。
  30267. * @usage
  30268. */
  30269. var IPortalDataMetaInfoParam = /*#__PURE__*/iPortalDataMetaInfoParam_createClass(function IPortalDataMetaInfoParam(params) {
  30270. iPortalDataMetaInfoParam_classCallCheck(this, IPortalDataMetaInfoParam);
  30271. params = params || {};
  30272. this.xField = "";
  30273. this.yField = "";
  30274. this.fileEncoding = "UTF-8";
  30275. this.xIndex = 1;
  30276. this.yIndex = 1;
  30277. this.fieldTypes = [];
  30278. this.separator = "";
  30279. this.firstRowIsHead = true;
  30280. this.url = "";
  30281. this.dataStoreInfo = {};
  30282. Util_Util.extend(this, params);
  30283. });
  30284. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalDataStoreInfoParam.js
  30285. function iPortalDataStoreInfoParam_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  30286. function iPortalDataStoreInfoParam_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalDataStoreInfoParam_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalDataStoreInfoParam_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  30287. function iPortalDataStoreInfoParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30288. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30289. * This program are made available under the terms of the Apache License, Version 2.0
  30290. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30291. /**
  30292. * @class IPortalDataStoreInfoParam
  30293. * @aliasclass iPortalDataStoreInfoParam
  30294. * @deprecatedclass SuperMap.iPortalDataStoreInfoParam
  30295. * @classdesc iPortal 注册一个HBASE HDFS数据存储类。
  30296. * @version 10.0.1
  30297. * @category iPortal/Online Resources Data
  30298. * @param {Object} params - 参数。
  30299. * @param {string} params.type - 大数据文件共享类型和空间数据库类型,包括大数据文件共享HDFS 目录(HDFS)和空间数据库HBASE。
  30300. * @param {string} params.url - HDFS数据存储目录地址。
  30301. * @param {IPortalDataConnectionInfoParam} [params.connectionInfo] - HBASE空间数据库服务的连接信息。
  30302. * @usage
  30303. */
  30304. var IPortalDataStoreInfoParam = /*#__PURE__*/iPortalDataStoreInfoParam_createClass(function IPortalDataStoreInfoParam(params) {
  30305. iPortalDataStoreInfoParam_classCallCheck(this, IPortalDataStoreInfoParam);
  30306. params = params || {};
  30307. this.type = "";
  30308. this.url = "";
  30309. this.connectionInfo = {};
  30310. Util_Util.extend(this, params);
  30311. });
  30312. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalDataConnectionInfoParam.js
  30313. function iPortalDataConnectionInfoParam_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  30314. function iPortalDataConnectionInfoParam_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalDataConnectionInfoParam_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalDataConnectionInfoParam_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  30315. function iPortalDataConnectionInfoParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30316. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30317. * This program are made available under the terms of the Apache License, Version 2.0
  30318. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30319. /**
  30320. * @class IPortalDataConnectionInfoParam
  30321. * @aliasclass iPortalDataConnectionInfoParam
  30322. * @deprecatedclass SuperMap.iPortalDataConnectionInfoParam
  30323. * @classdesc iPortal HBASE数据源连接信息类。
  30324. * @version 10.0.1
  30325. * @category iPortal/Online Resources Data
  30326. * @param {Object} params - 参数。
  30327. * @param {string} params.dataBase - 数据源连接的数据库名。
  30328. * @param {string} params.server - 服务地址。
  30329. * @usage
  30330. */
  30331. var IPortalDataConnectionInfoParam = /*#__PURE__*/iPortalDataConnectionInfoParam_createClass(function IPortalDataConnectionInfoParam(params) {
  30332. iPortalDataConnectionInfoParam_classCallCheck(this, IPortalDataConnectionInfoParam);
  30333. params = params || {};
  30334. this.dataBase = "";
  30335. this.server = "";
  30336. Util_Util.extend(this, params);
  30337. });
  30338. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalUser.js
  30339. function iPortalUser_typeof(obj) { "@babel/helpers - typeof"; return iPortalUser_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, iPortalUser_typeof(obj); }
  30340. function iPortalUser_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30341. function iPortalUser_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  30342. function iPortalUser_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalUser_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalUser_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  30343. function iPortalUser_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) iPortalUser_setPrototypeOf(subClass, superClass); }
  30344. function iPortalUser_setPrototypeOf(o, p) { iPortalUser_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iPortalUser_setPrototypeOf(o, p); }
  30345. function iPortalUser_createSuper(Derived) { var hasNativeReflectConstruct = iPortalUser_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = iPortalUser_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = iPortalUser_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return iPortalUser_possibleConstructorReturn(this, result); }; }
  30346. function iPortalUser_possibleConstructorReturn(self, call) { if (call && (iPortalUser_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return iPortalUser_assertThisInitialized(self); }
  30347. function iPortalUser_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30348. function iPortalUser_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  30349. function iPortalUser_getPrototypeOf(o) { iPortalUser_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iPortalUser_getPrototypeOf(o); }
  30350. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30351. * This program are made available under the terms of the Apache License, Version 2.0
  30352. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30353. /**
  30354. * @class IPortalUser
  30355. * @aliasclass iPortalUser
  30356. * @deprecatedclass SuperMap.iPortalUser
  30357. * @classdesc iPortal 门户中用户信息的封装类。用于管理用户资源,包括可删除,添加资源。
  30358. * @version 10.0.1
  30359. * @category iPortal/Online Resources
  30360. * @param {string} iportalUrl - 服务地址。
  30361. * @extends {IPortalServiceBase}
  30362. * @usage
  30363. */
  30364. var IPortalUser = /*#__PURE__*/function (_IPortalServiceBase) {
  30365. iPortalUser_inherits(IPortalUser, _IPortalServiceBase);
  30366. var _super = iPortalUser_createSuper(IPortalUser);
  30367. function IPortalUser(iportalUrl) {
  30368. var _this;
  30369. iPortalUser_classCallCheck(this, IPortalUser);
  30370. _this = _super.call(this, iportalUrl);
  30371. _this.iportalUrl = iportalUrl;
  30372. return _this;
  30373. }
  30374. /**
  30375. * @function IPortalUser.prototype.deleteResources
  30376. * @description 删除资源。
  30377. * @param {Object} params - 删除资源所需的参数对象:{ids,resourceType}。
  30378. * @returns {Promise} 返回包含删除操作状态的 Promise 对象。
  30379. */
  30380. iPortalUser_createClass(IPortalUser, [{
  30381. key: "deleteResources",
  30382. value: function deleteResources(params) {
  30383. var resourceName = params.resourceType.replace("_", "").toLowerCase();
  30384. var deleteResourceUrl = this.iportalUrl + "/web/" + resourceName + "s.json?ids=" + encodeURI(JSON.stringify(params.ids));
  30385. if (resourceName === 'data') {
  30386. deleteResourceUrl = this.iportalUrl + "/web/mycontent/datas/delete.json";
  30387. return this.request("POST", deleteResourceUrl, JSON.stringify(params.ids));
  30388. }
  30389. return this.request("DELETE", deleteResourceUrl);
  30390. }
  30391. /**
  30392. * @function IPortalUser.prototype.addMap
  30393. * @description 添加地图。
  30394. * @version 10.1.0
  30395. * @param {IPortalAddResourceParam} addMapParams - 添加地图的参数。
  30396. * @returns {Promise} 返回包含添加地图结果的 Promise 对象。
  30397. */
  30398. }, {
  30399. key: "addMap",
  30400. value: function addMap(addMapParams) {
  30401. if (!(addMapParams instanceof IPortalAddResourceParam)) {
  30402. return this.getErrMsgPromise("addMapParams is not instanceof IPortalAddResourceParam !");
  30403. }
  30404. var cloneAddMapParams = {
  30405. rootUrl: addMapParams.rootUrl,
  30406. tags: addMapParams.tags,
  30407. authorizeSetting: addMapParams.entities
  30408. };
  30409. var addMapUrl = this.iportalUrl + "/web/maps/batchaddmaps.json";
  30410. return this.request("POST", addMapUrl, JSON.stringify(cloneAddMapParams)).then(function (result) {
  30411. return result;
  30412. });
  30413. }
  30414. /**
  30415. * @function IPortalUser.prototype.addScene
  30416. * @description 添加场景。
  30417. * @version 10.1.0
  30418. * @param {IPortalAddResourceParam} addSceneParams - 添加场景的参数。
  30419. * @returns {Promise} 返回包含添加场景结果的 Promise 对象。
  30420. */
  30421. }, {
  30422. key: "addScene",
  30423. value: function addScene(addSceneParams) {
  30424. if (!(addSceneParams instanceof IPortalAddResourceParam)) {
  30425. return this.getErrMsgPromise("addSceneParams is not instanceof IPortalAddResourceParam !");
  30426. }
  30427. var cloneAddSceneParams = {
  30428. rootUrl: addSceneParams.rootUrl,
  30429. tags: addSceneParams.tags,
  30430. authorizeSetting: addSceneParams.entities
  30431. };
  30432. var addSceneUrl = this.iportalUrl + "/web/scenes/batchaddscenes.json";
  30433. return this.request("POST", addSceneUrl, JSON.stringify(cloneAddSceneParams)).then(function (result) {
  30434. return result;
  30435. });
  30436. }
  30437. /**
  30438. * @function IPortalUser.prototype.registerService
  30439. * @description 注册服务。
  30440. * @version 10.1.0
  30441. * @param {IPortalRegisterServiceParam} registerParams - 注册服务的参数。
  30442. * @returns {Promise} 返回包含注册服务结果的 Promise 对象。
  30443. */
  30444. }, {
  30445. key: "registerService",
  30446. value: function registerService(registerParams) {
  30447. if (!(registerParams instanceof IPortalRegisterServiceParam)) {
  30448. return this.getErrMsgPromise("registerParams is not instanceof IPortalRegisterServiceParam !");
  30449. }
  30450. var cloneRegisterParams = {
  30451. type: registerParams.type,
  30452. tags: registerParams.tags,
  30453. authorizeSetting: registerParams.entities,
  30454. metadata: registerParams.metadata,
  30455. addedMapNames: registerParams.addedMapNames,
  30456. addedSceneNames: registerParams.addedSceneNames
  30457. };
  30458. var registerUrl = this.iportalUrl + "/web/services.json";
  30459. return this.request("POST", registerUrl, JSON.stringify(cloneRegisterParams)).then(function (result) {
  30460. return result;
  30461. });
  30462. }
  30463. /**
  30464. * @function IPortalUser.prototype.getErrMsgPromise
  30465. * @description 获取包含错误信息的Promise对象。
  30466. * @version 10.1.0
  30467. * @param {string} errMsg - 传入的错误信息。
  30468. * @returns {Promise} 返回包含错误信息的 Promise 对象。
  30469. */
  30470. }, {
  30471. key: "getErrMsgPromise",
  30472. value: function getErrMsgPromise(errMsg) {
  30473. return new Promise(function (resolve) {
  30474. resolve(errMsg);
  30475. });
  30476. }
  30477. /**
  30478. * @function IPortalUser.prototype.uploadDataRequest
  30479. * @description 上传数据。
  30480. * @version 10.1.0
  30481. * @param {number} id - 上传数据的资源ID。
  30482. * @param {Object} formData - 请求体为文本数据流。
  30483. * @returns {Promise} 返回包含上传数据操作的 Promise 对象。
  30484. */
  30485. }, {
  30486. key: "uploadDataRequest",
  30487. value: function uploadDataRequest(id, formData) {
  30488. var uploadDataUrl = this.iportalUrl + "/web/mycontent/datas/" + id + "/upload.json";
  30489. return this.request("POST", uploadDataUrl, formData);
  30490. }
  30491. /**
  30492. * @function IPortalUser.prototype.addData
  30493. * @description 上传/注册数据。
  30494. * @version 10.1.0
  30495. * @param {IPortalAddDataParam} params - 上传/注册数据所需的参数。
  30496. * @param {Object} [formData] - 请求体为文本数据流(上传数据时传入)。
  30497. * @returns {Promise} 返回上传/注册数据的 Promise 对象。
  30498. */
  30499. }, {
  30500. key: "addData",
  30501. value: function addData(params, formData) {
  30502. var _this2 = this;
  30503. if (!(params instanceof IPortalAddDataParam)) {
  30504. return this.getErrMsgPromise("params is not instanceof iPortalAddDataParam !");
  30505. }
  30506. var datasUrl = this.iportalUrl + "/web/mycontent/datas.json";
  30507. var entity = {
  30508. fileName: params.fileName,
  30509. tags: params.tags,
  30510. type: params.type
  30511. };
  30512. var type = params.type.toLowerCase();
  30513. var dataMetaInfo;
  30514. if (type === "excel" || type === "csv") {
  30515. if (!(params.dataMetaInfo instanceof IPortalDataMetaInfoParam)) {
  30516. return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");
  30517. }
  30518. dataMetaInfo = {
  30519. xField: params.dataMetaInfo.xField,
  30520. yField: params.dataMetaInfo.yField
  30521. };
  30522. if (type === 'csv') {
  30523. dataMetaInfo.fileEncoding = params.dataMetaInfo.fileEncoding;
  30524. }
  30525. entity.coordType = "WGS84";
  30526. entity.dataMetaInfo = dataMetaInfo;
  30527. } else if (type === "hdfs" || type === "hbase") {
  30528. if (!(params.dataMetaInfo instanceof IPortalDataMetaInfoParam)) {
  30529. return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");
  30530. }
  30531. if (!(params.dataMetaInfo.dataStoreInfo instanceof IPortalDataStoreInfoParam)) {
  30532. return this.getErrMsgPromise("params.dataMetaInfo.dataStoreInfo is not instanceof iPortalDataStoreInfoParam !");
  30533. }
  30534. var dataStoreInfo = {
  30535. type: params.dataMetaInfo.dataStoreInfo.type
  30536. };
  30537. switch (type) {
  30538. case "hdfs":
  30539. dataStoreInfo.url = params.dataMetaInfo.dataStoreInfo.url;
  30540. dataMetaInfo = {
  30541. url: params.dataMetaInfo.url,
  30542. dataStoreInfo: dataStoreInfo
  30543. };
  30544. break;
  30545. case "hbase":
  30546. if (!(params.dataMetaInfo.dataStoreInfo.connectionInfo instanceof IPortalDataConnectionInfoParam)) {
  30547. return this.getErrMsgPromise("params.dataMetaInfo.dataStoreInfo.connectionInfo is not instanceof iPortalDataConnectionInfoParam !");
  30548. }
  30549. dataStoreInfo.connectionInfo = {
  30550. dataBase: params.dataMetaInfo.dataStoreInfo.connectionInfo.dataBase,
  30551. server: params.dataMetaInfo.dataStoreInfo.connectionInfo.server,
  30552. engineType: 'HBASE'
  30553. };
  30554. dataStoreInfo.datastoreType = "SPATIAL"; //该字段SPATIAL表示HBASE注册
  30555. dataMetaInfo = {
  30556. dataStoreInfo: dataStoreInfo
  30557. };
  30558. break;
  30559. }
  30560. entity.dataMetaInfo = dataMetaInfo;
  30561. }
  30562. return this.request("POST", datasUrl, JSON.stringify(entity)).then(function (res) {
  30563. if (type === "hdfs" || type === "hbase") {
  30564. return res;
  30565. } else {
  30566. if (res.childID) {
  30567. return _this2.uploadDataRequest(res.childID, formData);
  30568. } else {
  30569. return res.customResult;
  30570. }
  30571. }
  30572. });
  30573. }
  30574. /**
  30575. * @function IPortalUser.prototype.publishOrUnpublish
  30576. * @description 发布/取消发布。
  30577. * @version 10.1.0
  30578. * @param {Object} options - 发布/取消发布数据服务所需的参数。
  30579. * @param {Object} options.dataId - 数据项ID。
  30580. * @param {Object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
  30581. * @param {Object} [options.dataServiceId] - 发布的服务 ID。
  30582. * @param {boolean} forPublish - 是否取消发布。
  30583. * @returns {Promise} 返回发布/取消发布数据服务的 Promise 对象。
  30584. */
  30585. }, {
  30586. key: "publishOrUnpublish",
  30587. value: function publishOrUnpublish(option, forPublish) {
  30588. if (!option.dataId || !option.serviceType) {
  30589. return this.getErrMsgPromise("option.dataID and option.serviceType are Required!");
  30590. }
  30591. var dataId = option.dataId;
  30592. var dataServiceId = option.dataServiceId;
  30593. var serviceType = option.serviceType;
  30594. var publishUrl = this.iportalUrl + "/web/mycontent/datas/" + dataId + "/publishstatus.json?serviceType=" + serviceType;
  30595. if (dataServiceId) {
  30596. publishUrl += "&dataServiceId=" + dataServiceId;
  30597. }
  30598. return this.request("PUT", publishUrl, JSON.stringify(forPublish)).then(function (res) {
  30599. // 发起服务状态查询
  30600. if (forPublish) {
  30601. // 发布服务的结果异步处理
  30602. // var publishStateUrl = this.iportalUrl + "web/mycontent/datas/" + dataId + "/publishstatus.rjson";
  30603. if (!dataServiceId) {
  30604. // 发布服务时会回传serviceIDs,发布服务之前serviceIDs为空
  30605. dataServiceId = res.customResult;
  30606. }
  30607. return dataServiceId;
  30608. } else {
  30609. // 取消发布的结果同步处理
  30610. return res;
  30611. }
  30612. });
  30613. }
  30614. /**
  30615. * @function IPortalUser.prototype.getDataPublishedStatus
  30616. * @description 查询服务状态,发起服务状态查询。
  30617. * @version 10.1.0
  30618. * @param {number} dataId - 查询服务状态的数据项ID。
  30619. * @param {string} dataServiceId - 发布的服务ID。
  30620. * @returns {Promise} 返回查询服务状态的 Promise 对象。
  30621. */
  30622. }, {
  30623. key: "getDataPublishedStatus",
  30624. value: function getDataPublishedStatus(dataId, dataServiceId) {
  30625. var publishStateUrl = this.iportalUrl + "/web/mycontent/datas/" + dataId + "/publishstatus.json?dataServiceId=" + dataServiceId + "&forPublish=true";
  30626. return this.request("GET", publishStateUrl);
  30627. }
  30628. /**
  30629. * @function IPortalUser.prototype.unPublishedDataService
  30630. * @description 取消发布。
  30631. * @version 10.1.0
  30632. * @param {Object} options - 取消发布服务具体参数。
  30633. * @param {Object} options.dataId - 数据项ID。
  30634. * @param {Object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
  30635. * @param {Object} [options.dataServiceId] - 发布的服务 ID。
  30636. * @returns {Promise} 返回取消发布数据服务的 Promise 对象。
  30637. */
  30638. }, {
  30639. key: "unPublishDataService",
  30640. value: function unPublishDataService(option) {
  30641. return this.publishOrUnpublish(option, false);
  30642. }
  30643. /**
  30644. * @function IPortalUser.prototype.publishedDataService
  30645. * @description 发布数据服务。
  30646. * @version 10.1.0
  30647. * @param {Object} options - 发布数据服务具体参数。
  30648. * @param {Object} options.dataId - 数据项ID。
  30649. * @param {Object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
  30650. * @param {Object} [options.dataServiceId] - 发布的服务 ID。
  30651. * @returns {Promise} 返回发布数据服务的 Promise 对象。
  30652. */
  30653. }, {
  30654. key: "publishDataService",
  30655. value: function publishDataService(option) {
  30656. return this.publishOrUnpublish(option, true);
  30657. }
  30658. }]);
  30659. return IPortalUser;
  30660. }(IPortalServiceBase);
  30661. ;// CONCATENATED MODULE: ./src/common/iPortal/index.js
  30662. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30663. * This program are made available under the terms of the Apache License, Version 2.0
  30664. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30665. ;// CONCATENATED MODULE: ./src/common/iServer/CommonServiceBase.js
  30666. function CommonServiceBase_typeof(obj) { "@babel/helpers - typeof"; return CommonServiceBase_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, CommonServiceBase_typeof(obj); }
  30667. function CommonServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30668. function CommonServiceBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  30669. function CommonServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) CommonServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) CommonServiceBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  30670. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30671. * This program are made available under the terms of the Apache License, Version 2.0
  30672. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30673. /**
  30674. * @class CommonServiceBase
  30675. * @deprecatedclass SuperMap.CommonServiceBase
  30676. * @category iServer Core
  30677. * @classdesc 对接 iServer 各种服务的 Service 的基类。
  30678. * @param {string} url - 服务地址。
  30679. * @param {Object} options - 参数。
  30680. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  30681. * @param {string} [options.proxy] - 服务代理地址。
  30682. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  30683. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30684. * @param {Object} [options.headers] - 请求头。
  30685. * @usage
  30686. */
  30687. var CommonServiceBase = /*#__PURE__*/function () {
  30688. function CommonServiceBase(url, options) {
  30689. CommonServiceBase_classCallCheck(this, CommonServiceBase);
  30690. var me = this;
  30691. this.EVENT_TYPES = ['processCompleted', 'processFailed'];
  30692. this.events = null;
  30693. this.eventListeners = null;
  30694. this.url = null;
  30695. this.urls = null;
  30696. this.proxy = null;
  30697. this.index = null;
  30698. this.length = null;
  30699. this.totalTimes = null;
  30700. this.POLLING_TIMES = 3;
  30701. this.isInTheSameDomain = null;
  30702. this.withCredentials = false;
  30703. if (Util_Util.isArray(url)) {
  30704. me.urls = url;
  30705. me.length = url.length;
  30706. me.totalTimes = me.length;
  30707. if (me.length === 1) {
  30708. me.url = url[0];
  30709. } else {
  30710. me.index = parseInt(Math.random() * me.length);
  30711. me.url = url[me.index];
  30712. }
  30713. } else {
  30714. me.totalTimes = 1;
  30715. me.url = url;
  30716. }
  30717. if (Util_Util.isArray(url) && !me.isServiceSupportPolling()) {
  30718. me.url = url[0];
  30719. me.totalTimes = 1;
  30720. }
  30721. options = options || {};
  30722. this.crossOrigin = options.crossOrigin;
  30723. this.headers = options.headers;
  30724. Util_Util.extend(this, options);
  30725. me.isInTheSameDomain = Util_Util.isInTheSameDomain(me.url);
  30726. me.events = new Events(me, null, me.EVENT_TYPES, true);
  30727. if (me.eventListeners instanceof Object) {
  30728. me.events.on(me.eventListeners);
  30729. }
  30730. this.CLASS_NAME = 'SuperMap.CommonServiceBase';
  30731. }
  30732. /**
  30733. * @function CommonServiceBase.prototype.destroy
  30734. * @description 释放资源,将引用的资源属性置空。
  30735. */
  30736. CommonServiceBase_createClass(CommonServiceBase, [{
  30737. key: "destroy",
  30738. value: function destroy() {
  30739. var me = this;
  30740. if (Util_Util.isArray(me.urls)) {
  30741. me.urls = null;
  30742. me.index = null;
  30743. me.length = null;
  30744. me.totalTimes = null;
  30745. }
  30746. me.url = null;
  30747. me._processSuccess = null;
  30748. me._processFailed = null;
  30749. me.isInTheSameDomain = null;
  30750. me.EVENT_TYPES = null;
  30751. if (me.events) {
  30752. me.events.destroy();
  30753. me.events = null;
  30754. }
  30755. if (me.eventListeners) {
  30756. me.eventListeners = null;
  30757. }
  30758. }
  30759. /**
  30760. * @function CommonServiceBase.prototype.request
  30761. * @description: 该方法用于向服务发送请求。
  30762. * @param {Object} options - 参数。
  30763. * @param {string} [options.method='GET'] - 请求方式,包括 "GET","POST","PUT","DELETE"。
  30764. * @param {string} [options.url] - 发送请求的地址。
  30765. * @param {Object} [options.params] - 作为查询字符串添加到 URL 中的一组键值对,此参数只适用于 GET 方式发送的请求。
  30766. * @param {string} [options.data] - 发送到服务器的数据。
  30767. * @param {function} options.success - 请求成功后的回调函数。
  30768. * @param {function} options.failure - 请求失败后的回调函数。
  30769. * @param {Object} [options.scope] - 如果回调函数是对象的一个公共方法,设定该对象的范围。
  30770. * @param {boolean} [options.isInTheSameDomain] - 请求是否在当前域中。
  30771. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  30772. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30773. * @param {Object} [options.headers] - 请求头。
  30774. */
  30775. }, {
  30776. key: "request",
  30777. value: function request(options) {
  30778. var format = options.scope.format;
  30779. if (format && !this.supportDataFormat(format)) {
  30780. throw new Error("".concat(this.CLASS_NAME, " is not surport ").concat(format, " format!"));
  30781. }
  30782. var me = this;
  30783. options.url = options.url || me.url;
  30784. if (this._returnContent(options) && !options.url.includes('returnContent=true')) {
  30785. options.url = Util_Util.urlAppend(options.url, 'returnContent=true');
  30786. }
  30787. options.proxy = options.proxy || me.proxy;
  30788. options.withCredentials = options.withCredentials != undefined ? options.withCredentials : me.withCredentials;
  30789. options.crossOrigin = options.crossOrigin != undefined ? options.crossOrigin : me.crossOrigin;
  30790. options.headers = options.headers || me.headers;
  30791. options.isInTheSameDomain = me.isInTheSameDomain;
  30792. options.withoutFormatSuffix = options.scope.withoutFormatSuffix || false;
  30793. //为url添加安全认证信息片段
  30794. options.url = SecurityManager.appendCredential(options.url);
  30795. me.calculatePollingTimes();
  30796. options.scope = me;
  30797. var success = options.scope ? options.success.bind(options.scope) : options.success;
  30798. var failure = options.scope ? options.failure.bind(options.scope) : options.failure;
  30799. options.success = me.getUrlCompleted(success, options);
  30800. options.failure = me.getUrlFailed(failure, options);
  30801. me._commit(options);
  30802. }
  30803. /**
  30804. * @function CommonServiceBase.prototype.getUrlCompleted
  30805. * @description 请求成功后执行此方法。
  30806. * @param {Object} cb - 成功回调函数。
  30807. * @param {Object} options - 请求参数对象。
  30808. * @private
  30809. */
  30810. }, {
  30811. key: "getUrlCompleted",
  30812. value: function getUrlCompleted(cb, options) {
  30813. // @param {Object} result - 服务器返回的结果对象。
  30814. return function (result) {
  30815. cb && cb(result, options);
  30816. };
  30817. }
  30818. /**
  30819. * @function CommonServiceBase.prototype.getUrlFailed
  30820. * @description 请求失败后执行此方法。
  30821. * @param {Object} cb - 失败回调函数。
  30822. * @param {Object} options - 请求参数对象。
  30823. * @private
  30824. */
  30825. }, {
  30826. key: "getUrlFailed",
  30827. value: function getUrlFailed(cb, options) {
  30828. var me = this;
  30829. // @param {Object} result - 服务器返回的结果对象。
  30830. return function (result) {
  30831. if (me.totalTimes > 0) {
  30832. me.totalTimes--;
  30833. me.ajaxPolling(options);
  30834. } else {
  30835. cb && cb(result, options);
  30836. }
  30837. };
  30838. }
  30839. /**
  30840. *
  30841. * @function CommonServiceBase.prototype.ajaxPolling
  30842. * @description 请求失败后,如果剩余请求失败次数不为 0,重新获取 URL 发送请求。
  30843. * @param {Object} options - 请求参数对象。
  30844. * @private
  30845. */
  30846. }, {
  30847. key: "ajaxPolling",
  30848. value: function ajaxPolling(options) {
  30849. var me = this,
  30850. url = options.url,
  30851. re = /^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;
  30852. me.index = parseInt(Math.random() * me.length);
  30853. me.url = me.urls[me.index];
  30854. url = url.replace(re, re.exec(me.url)[0]);
  30855. options.url = url;
  30856. options.isInTheSameDomain = Util_Util.isInTheSameDomain(url);
  30857. me._commit(options);
  30858. }
  30859. /**
  30860. * @function CommonServiceBase.prototype.calculatePollingTimes
  30861. * @description 计算剩余请求失败执行次数。
  30862. */
  30863. }, {
  30864. key: "calculatePollingTimes",
  30865. value: function calculatePollingTimes() {
  30866. var me = this;
  30867. if (me.times) {
  30868. if (me.totalTimes > me.POLLING_TIMES) {
  30869. if (me.times > me.POLLING_TIMES) {
  30870. me.totalTimes = me.POLLING_TIMES;
  30871. } else {
  30872. me.totalTimes = me.times;
  30873. }
  30874. } else {
  30875. if (me.times < me.totalTimes) {
  30876. me.totalTimes = me.times;
  30877. }
  30878. }
  30879. } else {
  30880. if (me.totalTimes > me.POLLING_TIMES) {
  30881. me.totalTimes = me.POLLING_TIMES;
  30882. }
  30883. }
  30884. me.totalTimes--;
  30885. }
  30886. /**
  30887. * @function CommonServiceBase.prototype.isServiceSupportPolling
  30888. * @description 判断服务是否支持轮询。
  30889. */
  30890. }, {
  30891. key: "isServiceSupportPolling",
  30892. value: function isServiceSupportPolling() {
  30893. var me = this;
  30894. return !(me.CLASS_NAME === 'SuperMap.REST.ThemeService' || me.CLASS_NAME === 'SuperMap.REST.EditFeaturesService');
  30895. }
  30896. /**
  30897. * @function CommonServiceBase.prototype.serviceProcessCompleted
  30898. * @description 状态完成,执行此方法。
  30899. * @param {Object} result - 服务器返回的结果对象。
  30900. * @param {Object} options - 请求参数对象。
  30901. * @private
  30902. */
  30903. }, {
  30904. key: "serviceProcessCompleted",
  30905. value: function serviceProcessCompleted(result, options) {
  30906. result = Util_Util.transformResult(result);
  30907. this.events.triggerEvent('processCompleted', {
  30908. result: result,
  30909. options: options
  30910. });
  30911. }
  30912. /**
  30913. * @function CommonServiceBase.prototype.serviceProcessFailed
  30914. * @description 状态失败,执行此方法。
  30915. * @param {Object} result - 服务器返回的结果对象。
  30916. * @param {Object} options - 请求参数对象。对象
  30917. * @private
  30918. */
  30919. }, {
  30920. key: "serviceProcessFailed",
  30921. value: function serviceProcessFailed(result, options) {
  30922. result = Util_Util.transformResult(result);
  30923. var error = result.error || result;
  30924. this.events.triggerEvent('processFailed', {
  30925. error: error,
  30926. options: options
  30927. });
  30928. }
  30929. }, {
  30930. key: "_returnContent",
  30931. value: function _returnContent(options) {
  30932. if (options.scope.format === DataFormat.FGB) {
  30933. return false;
  30934. }
  30935. if (options.scope.returnContent) {
  30936. return true;
  30937. }
  30938. return false;
  30939. }
  30940. }, {
  30941. key: "supportDataFormat",
  30942. value: function supportDataFormat(foramt) {
  30943. return this.dataFormat().includes(foramt);
  30944. }
  30945. }, {
  30946. key: "dataFormat",
  30947. value: function dataFormat() {
  30948. return [DataFormat.GEOJSON, DataFormat.ISERVER];
  30949. }
  30950. }, {
  30951. key: "_commit",
  30952. value: function _commit(options) {
  30953. if (options.method === 'POST' || options.method === 'PUT' || options.method === 'PATCH') {
  30954. if (options.params) {
  30955. options.url = Util_Util.urlAppend(options.url, Util_Util.getParameterString(options.params || {}));
  30956. }
  30957. if (CommonServiceBase_typeof(options.data) === 'object') {
  30958. try {
  30959. options.params = Util_Util.toJSON(options.data);
  30960. } catch (e) {
  30961. console.log('不是json对象');
  30962. }
  30963. } else {
  30964. options.params = options.data;
  30965. }
  30966. }
  30967. FetchRequest.commit(options.method, options.url, options.params, {
  30968. headers: options.headers,
  30969. withoutFormatSuffix: options.withoutFormatSuffix,
  30970. withCredentials: options.withCredentials,
  30971. crossOrigin: options.crossOrigin,
  30972. timeout: options.async ? 0 : null,
  30973. proxy: options.proxy
  30974. }).then(function (response) {
  30975. if (response.text) {
  30976. return response.text();
  30977. }
  30978. if (response.json) {
  30979. return response.json();
  30980. }
  30981. return response;
  30982. }).then(function (text) {
  30983. var requestResult = text;
  30984. if (typeof text === 'string') {
  30985. requestResult = new JSONFormat().read(text);
  30986. }
  30987. if (!requestResult || requestResult.error || requestResult.code >= 300 && requestResult.code !== 304) {
  30988. if (requestResult && requestResult.error) {
  30989. requestResult = {
  30990. error: requestResult.error
  30991. };
  30992. } else {
  30993. requestResult = {
  30994. error: requestResult
  30995. };
  30996. }
  30997. }
  30998. if (requestResult && options.scope.format === DataFormat.FGB) {
  30999. requestResult.newResourceLocation = requestResult.newResourceLocation.replace('.json', '') + '.fgb';
  31000. }
  31001. return requestResult;
  31002. })["catch"](function (e) {
  31003. return {
  31004. error: e
  31005. };
  31006. }).then(function (requestResult) {
  31007. if (requestResult.error) {
  31008. var failure = options.scope ? FunctionExt.bind(options.failure, options.scope) : options.failure;
  31009. failure(requestResult);
  31010. } else {
  31011. requestResult.succeed = requestResult.succeed == undefined ? true : requestResult.succeed;
  31012. var success = options.scope ? FunctionExt.bind(options.success, options.scope) : options.success;
  31013. success(requestResult);
  31014. }
  31015. });
  31016. }
  31017. }]);
  31018. return CommonServiceBase;
  31019. }();
  31020. /**
  31021. * 服务器请求回调函数。
  31022. * @callback RequestCallback
  31023. * @category BaseTypes Util
  31024. * @example
  31025. * var requestCallback = function (serviceResult){
  31026. * console.log(serviceResult.result);
  31027. * }
  31028. * new QueryService(url).queryByBounds(param, requestCallback);
  31029. * @param {Object} serviceResult
  31030. * @param {Object} serviceResult.result 服务器返回结果。
  31031. * @param {Object} serviceResult.object 发布应用程序事件的对象。
  31032. * @param {Object} serviceResult.type 事件类型。
  31033. * @param {Object} serviceResult.element 接受浏览器事件的 DOM 节点。
  31034. * @param {Object} serviceResult.options 请求参数。
  31035. */
  31036. ;// CONCATENATED MODULE: ./src/common/iServer/GeoCodingParameter.js
  31037. function GeoCodingParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31038. function GeoCodingParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  31039. function GeoCodingParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoCodingParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoCodingParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  31040. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31041. * This program are made available under the terms of the Apache License, Version 2.0
  31042. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31043. /**
  31044. * @class GeoCodingParameter
  31045. * @deprecatedclass SuperMap.GeoCodingParameter
  31046. * @category iServer AddressMatch
  31047. * @classdesc 地理正向匹配参数类。
  31048. * @param {Object} options - 参数。
  31049. * @param {string} options.address - 地点关键词。
  31050. * @param {number} [options.fromIndex] - 设置返回对象的起始索引值。
  31051. * @param {number} [options.toIndex] - 设置返回对象的结束索引值。
  31052. * @param {Array.<string>} [options.filters] - 过滤字段,限定查询区域。
  31053. * @param {string} [options.prjCoordSys] - 查询结果的坐标系。
  31054. * @param {number} [options.maxReturn] - 最大返回结果数。
  31055. * @usage
  31056. */
  31057. var GeoCodingParameter = /*#__PURE__*/function () {
  31058. function GeoCodingParameter(options) {
  31059. GeoCodingParameter_classCallCheck(this, GeoCodingParameter);
  31060. if (options.filters && typeof options.filters === 'string') {
  31061. options.filters = options.filters.split(',');
  31062. }
  31063. /**
  31064. * @member {string} GeoCodingParameter.prototype.address
  31065. * @description 地点关键词。
  31066. */
  31067. this.address = null;
  31068. /**
  31069. * @member {number} [GeoCodingParameter.prototype.fromIndex]
  31070. * @description 设置返回对象的起始索引值。
  31071. */
  31072. this.fromIndex = null;
  31073. /**
  31074. * @member {number} [GeoCodingParameter.prototype.toIndex]
  31075. * @description 设置返回对象的结束索引值。
  31076. */
  31077. this.toIndex = null;
  31078. /**
  31079. * @member {Array.<string>} [GeoCodingParameter.prototype.filters]
  31080. * @description 过滤字段,限定查询区域。
  31081. */
  31082. this.filters = null;
  31083. /**
  31084. * @member {string} [GeoCodingParameter.prototype.prjCoordSys]
  31085. * @description 查询结果的坐标系。
  31086. */
  31087. this.prjCoordSys = null;
  31088. /**
  31089. * @member {number} [GeoCodingParameter.prototype.maxReturn]
  31090. * @description 最大返回结果数。
  31091. */
  31092. this.maxReturn = null;
  31093. Util_Util.extend(this, options);
  31094. }
  31095. /**
  31096. * @function GeoCodingParameter.prototype.destroy
  31097. * @description 释放资源,将引用资源的属性置空。
  31098. */
  31099. GeoCodingParameter_createClass(GeoCodingParameter, [{
  31100. key: "destroy",
  31101. value: function destroy() {
  31102. this.address = null;
  31103. this.fromIndex = null;
  31104. this.toIndex = null;
  31105. this.filters = null;
  31106. this.prjCoordSys = null;
  31107. this.maxReturn = null;
  31108. }
  31109. }]);
  31110. return GeoCodingParameter;
  31111. }();
  31112. ;// CONCATENATED MODULE: ./src/common/iServer/GeoDecodingParameter.js
  31113. function GeoDecodingParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31114. function GeoDecodingParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  31115. function GeoDecodingParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoDecodingParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoDecodingParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  31116. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31117. * This program are made available under the terms of the Apache License, Version 2.0
  31118. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31119. /**
  31120. * @class GeoDecodingParameter
  31121. * @deprecatedclass SuperMap.GeoDecodingParameter
  31122. * @category iServer AddressMatch
  31123. * @classdesc 地理反向匹配参数类。
  31124. * @param {Object} options - 参数。
  31125. * @param {number} options.x - 查询位置的横坐标。
  31126. * @param {number} options.y - 查询位置的纵坐标。
  31127. * @param {number} [options.fromIndex] - 设置返回对象的起始索引值。
  31128. * @param {number} [options.toIndex] - 设置返回对象的结束索引值。
  31129. * @param {Array.<string>} [options.filters] - 过滤字段,限定查询区域。
  31130. * @param {string} [options.prjCoordSys] - 查询结果的坐标系。
  31131. * @param {number} [options.maxReturn] - 最大返回结果数。
  31132. * @param {number} [options.geoDecodingRadius] - 查询半径。
  31133. * @usage
  31134. */
  31135. var GeoDecodingParameter = /*#__PURE__*/function () {
  31136. function GeoDecodingParameter(options) {
  31137. GeoDecodingParameter_classCallCheck(this, GeoDecodingParameter);
  31138. if (options.filters) {
  31139. options.filters = options.filters.split(',');
  31140. }
  31141. /**
  31142. * @member {number} GeoDecodingParameter.prototype.x
  31143. * @description 查询位置的横坐标。
  31144. */
  31145. this.x = null;
  31146. /**
  31147. * @member {number} GeoDecodingParameter.prototype.y
  31148. * @description 查询位置的纵坐标。
  31149. */
  31150. this.y = null;
  31151. /**
  31152. * @member {number} [GeoDecodingParameter.prototype.fromIndex]
  31153. * @description 设置返回对象的起始索引值。
  31154. */
  31155. this.fromIndex = null;
  31156. /**
  31157. * @member {number} [GeoDecodingParameter.prototype.toIndex]
  31158. * @description 设置返回对象的结束索引值。
  31159. */
  31160. this.toIndex = null;
  31161. /**
  31162. * @member {Array.<string>} [GeoDecodingParameter.prototype.filters]
  31163. * @description 过滤字段,限定查询区域。
  31164. */
  31165. this.filters = null;
  31166. /**
  31167. * @member {string} [GeoDecodingParameter.prototype.prjCoordSys]
  31168. * @description 查询结果的坐标系。
  31169. */
  31170. this.prjCoordSys = null;
  31171. /**
  31172. * @member {number} [GeoDecodingParameter.prototype.maxReturn]
  31173. * @description 最大返回结果数。
  31174. */
  31175. this.maxReturn = null;
  31176. /**
  31177. * @member {number} GeoDecodingParameter.prototype.geoDecodingRadius
  31178. * @description 查询半径。
  31179. */
  31180. this.geoDecodingRadius = null;
  31181. Util_Util.extend(this, options);
  31182. }
  31183. /**
  31184. * @function GeoDecodingParameter.prototype.destroy
  31185. * @description 释放资源,将引用资源的属性置空。
  31186. */
  31187. GeoDecodingParameter_createClass(GeoDecodingParameter, [{
  31188. key: "destroy",
  31189. value: function destroy() {
  31190. this.x = null;
  31191. this.y = null;
  31192. this.fromIndex = null;
  31193. this.toIndex = null;
  31194. this.filters = null;
  31195. this.prjCoordSys = null;
  31196. this.maxReturn = null;
  31197. this.geoDecodingRadius = null;
  31198. }
  31199. }]);
  31200. return GeoDecodingParameter;
  31201. }();
  31202. ;// CONCATENATED MODULE: ./src/common/iServer/AddressMatchService.js
  31203. function AddressMatchService_typeof(obj) { "@babel/helpers - typeof"; return AddressMatchService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, AddressMatchService_typeof(obj); }
  31204. function AddressMatchService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31205. function AddressMatchService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  31206. function AddressMatchService_createClass(Constructor, protoProps, staticProps) { if (protoProps) AddressMatchService_defineProperties(Constructor.prototype, protoProps); if (staticProps) AddressMatchService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  31207. function AddressMatchService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { AddressMatchService_get = Reflect.get.bind(); } else { AddressMatchService_get = function _get(target, property, receiver) { var base = AddressMatchService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return AddressMatchService_get.apply(this, arguments); }
  31208. function AddressMatchService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = AddressMatchService_getPrototypeOf(object); if (object === null) break; } return object; }
  31209. function AddressMatchService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) AddressMatchService_setPrototypeOf(subClass, superClass); }
  31210. function AddressMatchService_setPrototypeOf(o, p) { AddressMatchService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return AddressMatchService_setPrototypeOf(o, p); }
  31211. function AddressMatchService_createSuper(Derived) { var hasNativeReflectConstruct = AddressMatchService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = AddressMatchService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = AddressMatchService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return AddressMatchService_possibleConstructorReturn(this, result); }; }
  31212. function AddressMatchService_possibleConstructorReturn(self, call) { if (call && (AddressMatchService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return AddressMatchService_assertThisInitialized(self); }
  31213. function AddressMatchService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31214. function AddressMatchService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  31215. function AddressMatchService_getPrototypeOf(o) { AddressMatchService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AddressMatchService_getPrototypeOf(o); }
  31216. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31217. * This program are made available under the terms of the Apache License, Version 2.0
  31218. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31219. /**
  31220. * @class AddressMatchService
  31221. * @deprecatedclass SuperMap.AddressMatchService
  31222. * @category iServer AddressMatch
  31223. * @classdesc 地址匹配服务,包括正向匹配和反向匹配。
  31224. * @param {string} url - 服务地址。
  31225. * @param {Object} options - 可选参数。
  31226. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  31227. * @param {Object} [options.headers] - 请求头。
  31228. * @usage
  31229. */
  31230. var AddressMatchService_AddressMatchService = /*#__PURE__*/function (_CommonServiceBase) {
  31231. AddressMatchService_inherits(AddressMatchService, _CommonServiceBase);
  31232. var _super = AddressMatchService_createSuper(AddressMatchService);
  31233. function AddressMatchService(url, options) {
  31234. var _this;
  31235. AddressMatchService_classCallCheck(this, AddressMatchService);
  31236. _this = _super.call(this, url, options);
  31237. _this.options = options || {};
  31238. _this.eventCount = 0;
  31239. _this.CLASS_NAME = 'SuperMap.AddressMatchService';
  31240. return _this;
  31241. }
  31242. /**
  31243. * @function AddressMatchService.prototype.destroy
  31244. * @override
  31245. */
  31246. AddressMatchService_createClass(AddressMatchService, [{
  31247. key: "destroy",
  31248. value: function destroy() {
  31249. AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "destroy", this).call(this);
  31250. }
  31251. /**
  31252. * @function AddressMatchService.prototype.code
  31253. * @param {string} url - 正向地址匹配服务地址。
  31254. * @param {GeoCodingParameter} params - 正向地址匹配服务参数。
  31255. */
  31256. }, {
  31257. key: "code",
  31258. value: function code(url, params, callback) {
  31259. if (!(params instanceof GeoCodingParameter)) {
  31260. return;
  31261. }
  31262. this.processAsync(url, params, callback);
  31263. }
  31264. /**
  31265. * @function AddressMatchService.prototype.decode
  31266. * @param {string} url - 反向地址匹配服务地址。
  31267. * @param {GeoDecodingParameter} params - 反向地址匹配服务参数。
  31268. */
  31269. }, {
  31270. key: "decode",
  31271. value: function decode(url, params, callback) {
  31272. if (!(params instanceof GeoDecodingParameter)) {
  31273. return;
  31274. }
  31275. this.processAsync(url, params, callback);
  31276. }
  31277. /**
  31278. * @function AddressMatchService.prototype.processAsync
  31279. * @description 负责将客户端的动态分段服务参数传递到服务端。
  31280. * @param {string} url - 服务地址。
  31281. * @param {Object} params - 参数。
  31282. */
  31283. }, {
  31284. key: "processAsync",
  31285. value: function processAsync(url, params, callback) {
  31286. var eventId = ++this.eventCount;
  31287. var eventListeners = {
  31288. scope: this,
  31289. processCompleted: function processCompleted(result) {
  31290. if (eventId === result.result.eventId && callback) {
  31291. delete result.result.eventId;
  31292. callback(result);
  31293. this.events && this.events.un(eventListeners);
  31294. return false;
  31295. }
  31296. },
  31297. processFailed: function processFailed(result) {
  31298. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  31299. callback(result);
  31300. this.events && this.events.un(eventListeners);
  31301. return false;
  31302. }
  31303. }
  31304. };
  31305. this.events.on(eventListeners);
  31306. this.request({
  31307. method: 'GET',
  31308. url: url,
  31309. params: params,
  31310. scope: this,
  31311. success: function success(result, options) {
  31312. result.eventId = eventId;
  31313. this.serviceProcessCompleted(result, options);
  31314. },
  31315. failure: function failure(result, options) {
  31316. if (result.error) {
  31317. result.error.eventId = eventId;
  31318. }
  31319. result.eventId = eventId;
  31320. this.serviceProcessFailed(result, options);
  31321. }
  31322. });
  31323. }
  31324. /**
  31325. * @function AddressMatchService.prototype.serviceProcessCompleted
  31326. * @param {Object} result - 服务器返回的结果对象。
  31327. * @description 服务流程是否完成
  31328. */
  31329. }, {
  31330. key: "serviceProcessCompleted",
  31331. value: function serviceProcessCompleted(result, options) {
  31332. if (result.succeed) {
  31333. delete result.succeed;
  31334. }
  31335. AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "serviceProcessCompleted", this).call(this, result, options);
  31336. }
  31337. /**
  31338. * @function AddressMatchService.prototype.serviceProcessCompleted
  31339. * @param {Object} result - 服务器返回的结果对象。
  31340. * @description 服务流程是否失败
  31341. */
  31342. }, {
  31343. key: "serviceProcessFailed",
  31344. value: function serviceProcessFailed(result, options) {
  31345. AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "serviceProcessFailed", this).call(this, result, options);
  31346. }
  31347. }]);
  31348. return AddressMatchService;
  31349. }(CommonServiceBase);
  31350. ;// CONCATENATED MODULE: ./src/common/iServer/AggregationParameter.js
  31351. function AggregationParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31352. function AggregationParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  31353. function AggregationParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) AggregationParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) AggregationParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  31354. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31355. * This program are made available under the terms of the Apache License, Version 2.0
  31356. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31357. /**
  31358. * @class AggregationParameter
  31359. * @deprecatedclass SuperMap.AggregationParameter
  31360. * @classdesc 聚合查询参数设置,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
  31361. * @category iServer Data FeatureResults
  31362. * @param {Object} options - 参数。
  31363. * @param {string} options.aggName - 聚合名称。
  31364. * @param {string} options.aggFieldName - 聚合字段。
  31365. * @usage
  31366. */
  31367. var AggregationParameter = /*#__PURE__*/function () {
  31368. function AggregationParameter(options) {
  31369. AggregationParameter_classCallCheck(this, AggregationParameter);
  31370. /**
  31371. * @member {string} AggregationParameter.prototype.aggName
  31372. * @description 聚合名称。
  31373. */
  31374. this.aggName = null;
  31375. /**
  31376. * @member {string} AggregationParameter.prototype.aggFieldName
  31377. * @description 聚合字段。
  31378. */
  31379. this.aggFieldName = null;
  31380. this.CLASS_NAME = 'SuperMap.AggregationParameter';
  31381. Util_Util.extend(this, options);
  31382. }
  31383. AggregationParameter_createClass(AggregationParameter, [{
  31384. key: "destroy",
  31385. value: function destroy() {
  31386. var me = this;
  31387. me.aggName = null;
  31388. me.aggFieldName = null;
  31389. me.aggType = null;
  31390. }
  31391. }]);
  31392. return AggregationParameter;
  31393. }();
  31394. ;// CONCATENATED MODULE: ./src/common/iServer/BucketAggParameter.js
  31395. function BucketAggParameter_typeof(obj) { "@babel/helpers - typeof"; return BucketAggParameter_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, BucketAggParameter_typeof(obj); }
  31396. function BucketAggParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31397. function BucketAggParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  31398. function BucketAggParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) BucketAggParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) BucketAggParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  31399. function BucketAggParameter_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) BucketAggParameter_setPrototypeOf(subClass, superClass); }
  31400. function BucketAggParameter_setPrototypeOf(o, p) { BucketAggParameter_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return BucketAggParameter_setPrototypeOf(o, p); }
  31401. function BucketAggParameter_createSuper(Derived) { var hasNativeReflectConstruct = BucketAggParameter_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = BucketAggParameter_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = BucketAggParameter_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return BucketAggParameter_possibleConstructorReturn(this, result); }; }
  31402. function BucketAggParameter_possibleConstructorReturn(self, call) { if (call && (BucketAggParameter_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return BucketAggParameter_assertThisInitialized(self); }
  31403. function BucketAggParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31404. function BucketAggParameter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  31405. function BucketAggParameter_getPrototypeOf(o) { BucketAggParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BucketAggParameter_getPrototypeOf(o); }
  31406. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31407. * This program are made available under the terms of the Apache License, Version 2.0
  31408. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31409. /**
  31410. * @class BucketAggParameter
  31411. * @deprecatedclass SuperMap.BucketAggParameter
  31412. * @classdesc 子聚合类查询参数设置,该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  31413. * @category iServer Data FeatureResults
  31414. * @param {Object} options - 参数。
  31415. * @param {Array.<MetricsAggParameter>} options.subAggs - 子聚合类集合。
  31416. * @extends {AggregationParameter}
  31417. * @usage
  31418. */
  31419. var BucketAggParameter = /*#__PURE__*/function (_AggregationParameter) {
  31420. BucketAggParameter_inherits(BucketAggParameter, _AggregationParameter);
  31421. var _super = BucketAggParameter_createSuper(BucketAggParameter);
  31422. function BucketAggParameter(options) {
  31423. var _this;
  31424. BucketAggParameter_classCallCheck(this, BucketAggParameter);
  31425. _this = _super.call(this);
  31426. /**
  31427. * @member {Array.<MetricsAggParameter>} BucketAggParameter.prototype.subAggs
  31428. * @description 子聚合类集合。
  31429. */
  31430. _this.subAggs = null;
  31431. _this.aggType = null;
  31432. _this.CLASS_NAME = 'SuperMap.BucketAggParameter';
  31433. Util_Util.extend(BucketAggParameter_assertThisInitialized(_this), options);
  31434. return _this;
  31435. }
  31436. BucketAggParameter_createClass(BucketAggParameter, [{
  31437. key: "destroy",
  31438. value: function destroy() {
  31439. var me = this;
  31440. if (me.subAggs) {
  31441. me.subAggs = null;
  31442. }
  31443. }
  31444. }]);
  31445. return BucketAggParameter;
  31446. }(AggregationParameter);
  31447. ;// CONCATENATED MODULE: ./src/common/iServer/MetricsAggParameter.js
  31448. function MetricsAggParameter_typeof(obj) { "@babel/helpers - typeof"; return MetricsAggParameter_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, MetricsAggParameter_typeof(obj); }
  31449. function MetricsAggParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31450. function MetricsAggParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  31451. function MetricsAggParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) MetricsAggParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) MetricsAggParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  31452. function MetricsAggParameter_get() { if (typeof Reflect !== "undefined" && Reflect.get) { MetricsAggParameter_get = Reflect.get.bind(); } else { MetricsAggParameter_get = function _get(target, property, receiver) { var base = MetricsAggParameter_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return MetricsAggParameter_get.apply(this, arguments); }
  31453. function MetricsAggParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MetricsAggParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  31454. function MetricsAggParameter_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) MetricsAggParameter_setPrototypeOf(subClass, superClass); }
  31455. function MetricsAggParameter_setPrototypeOf(o, p) { MetricsAggParameter_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MetricsAggParameter_setPrototypeOf(o, p); }
  31456. function MetricsAggParameter_createSuper(Derived) { var hasNativeReflectConstruct = MetricsAggParameter_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MetricsAggParameter_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MetricsAggParameter_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MetricsAggParameter_possibleConstructorReturn(this, result); }; }
  31457. function MetricsAggParameter_possibleConstructorReturn(self, call) { if (call && (MetricsAggParameter_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return MetricsAggParameter_assertThisInitialized(self); }
  31458. function MetricsAggParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31459. function MetricsAggParameter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  31460. function MetricsAggParameter_getPrototypeOf(o) { MetricsAggParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MetricsAggParameter_getPrototypeOf(o); }
  31461. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31462. * This program are made available under the terms of the Apache License, Version 2.0
  31463. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31464. /**
  31465. * @class MetricsAggParameter
  31466. * @deprecatedclass SuperMap.MetricsAggParameter
  31467. * @classdesc 指标聚合查询参数类,该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  31468. * @category iServer Data FeatureResults
  31469. * @param {Object} options - 可选参数。
  31470. * @param {MetricsAggType} [options.aggType = 'avg'] - 聚合类型。
  31471. * @extends {AggregationParameter}
  31472. * @usage
  31473. */
  31474. var MetricsAggParameter = /*#__PURE__*/function (_AggregationParameter) {
  31475. MetricsAggParameter_inherits(MetricsAggParameter, _AggregationParameter);
  31476. var _super = MetricsAggParameter_createSuper(MetricsAggParameter);
  31477. function MetricsAggParameter(option) {
  31478. var _this;
  31479. MetricsAggParameter_classCallCheck(this, MetricsAggParameter);
  31480. _this = _super.call(this);
  31481. /**
  31482. * @member {MetricsAggType} [MetricsAggParameter.prototype.aggType=MetricsAggType.AVG]
  31483. * @description 指标聚合类型。
  31484. */
  31485. _this.aggType = MetricsAggType.AVG;
  31486. Util_Util.extend(MetricsAggParameter_assertThisInitialized(_this), option);
  31487. _this.CLASS_NAME = 'SuperMap.MetricsAggParameter';
  31488. return _this;
  31489. }
  31490. MetricsAggParameter_createClass(MetricsAggParameter, [{
  31491. key: "destroy",
  31492. value: function destroy() {
  31493. MetricsAggParameter_get(MetricsAggParameter_getPrototypeOf(MetricsAggParameter.prototype), "destroy", this).call(this);
  31494. var me = this;
  31495. me.aggType = null;
  31496. }
  31497. }]);
  31498. return MetricsAggParameter;
  31499. }(AggregationParameter);
  31500. ;// CONCATENATED MODULE: ./src/common/iServer/AreaSolarRadiationParameters.js
  31501. function AreaSolarRadiationParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31502. function AreaSolarRadiationParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  31503. function AreaSolarRadiationParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) AreaSolarRadiationParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) AreaSolarRadiationParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  31504. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31505. * This program are made available under the terms of the Apache License, Version 2.0
  31506. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31507. /**
  31508. * @class AreaSolarRadiationParameters
  31509. * @deprecatedclass SuperMap.AreaSolarRadiationParameters
  31510. * @category iServer SpatialAnalyst SolarRadiationAnalyst
  31511. * @classdesc 地区太阳辐射参数类。
  31512. * @param {Object} options - 参数。
  31513. * @param {string} options.dataset - 要用来做地区太阳辐射数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"的形式来表示,例如:JingjinTerrain@Jingjin。
  31514. * @param {string} options.targetDatasourceName - 指定的存储结果数据集的数据源名称, 例如:"Jingjin"。
  31515. * @param {string} options.totalGridName - 指定地区太阳辐射总辐射量数据集的名称。
  31516. * @param {string} options.diffuseDatasetGridName - 指定地区太阳辐射散射辐射量数据集的名称。
  31517. * @param {string} options.durationDatasetGridName - 指定地区太阳辐射太阳直射持续时间数据集的名称。
  31518. * @param {string} options.directDatasetGridName - 指定地区太阳辐射直射辐射量数据集的名称。
  31519. * @param {number} options.latitude - 待计算区域的纬度值。
  31520. * @param {string} [options.timeMode = 'MULTIDAYS'] - 时间模式。可选值"WITHINDAY"(单日)或"MULTIDAYS"(多日)。
  31521. * @param {number} options.dayStart - 起始日期(年内的第几天)。
  31522. * @param {number} options.dayEnd - 结束日期(年内的第几天)。
  31523. * @param {number} [options.hourStart] - 起始时间(一天中的第几个小时)。
  31524. * @param {number} [options.hourEnd] - 结束时间(一天中的第几个小时)。
  31525. * @param {number} [options.transmittance] - 太阳辐射穿过大气的透射率。
  31526. * @param {number} [options.hourInterval=0.5] - 计算时的小时间隔(设置的越小计算量越大并且计算结果更精确,如果修改此参数,必须使用整数)。
  31527. * @param {number} [options.dayInterval=5] - 计算时的天数间隔(设置的越小计算量越大并且计算结果更精确,必须使用整数)。
  31528. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  31529. * @usage
  31530. */
  31531. var AreaSolarRadiationParameters = /*#__PURE__*/function () {
  31532. function AreaSolarRadiationParameters(options) {
  31533. AreaSolarRadiationParameters_classCallCheck(this, AreaSolarRadiationParameters);
  31534. /**
  31535. * @member {string} AreaSolarRadiationParameters.prototype.dataset
  31536. * @description 要用来做地区太阳辐射数据源中数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示,例如:JingjinTerrain@Jingjin。注:地区太阳辐射数据必须为栅格数据集。
  31537. */
  31538. this.dataset = null;
  31539. /**
  31540. * @member {string} AreaSolarRadiationParameters.prototype.targetDatasourceName
  31541. * @description 指定的存储结果数据集的数据源名称,例如:"Jingjin"。
  31542. */
  31543. this.targetDatasourceName = null;
  31544. /**
  31545. * @member {string} AreaSolarRadiationParameters.prototype.totalGridName
  31546. * @description 指定地区太阳辐射总辐射量数据集的名称。
  31547. */
  31548. this.totalGridName = null;
  31549. /**
  31550. * @member {string} AreaSolarRadiationParameters.prototype.diffuseDatasetGridName
  31551. * @description 指定地区太阳辐射散射辐射量数据集的名称。
  31552. */
  31553. this.diffuseDatasetGridName = null;
  31554. /**
  31555. * @member {string} AreaSolarRadiationParameters.prototype.durationDatasetGridName
  31556. * @description 指定地区太阳辐射太阳直射持续时间数据集的名称。
  31557. */
  31558. this.durationDatasetGridName = null;
  31559. /**
  31560. * @member {string} AreaSolarRadiationParameters.prototype.directDatasetGridName
  31561. * @description 指定地区太阳辐射直射辐射量数据集的名称。
  31562. */
  31563. this.directDatasetGridName = null;
  31564. /**
  31565. * @member {number} AreaSolarRadiationParameters.prototype.latitude
  31566. * @description 待计算区域的纬度值。
  31567. */
  31568. this.latitude = null;
  31569. /**
  31570. * @member {string} [AreaSolarRadiationParameters.prototype.timeMode='MULTIDAYS']
  31571. * @description 时间模式。可选值"WITHINDAY"(单日)或"MULTIDAYS"(多日)。
  31572. */
  31573. this.timeMode = "MULTIDAYS";
  31574. /**
  31575. * @member {number} AreaSolarRadiationParameters.prototype.dayStart
  31576. * @description 起始日期(年内的第几天)。
  31577. */
  31578. this.dayStart = null;
  31579. /**
  31580. * @member {number} AreaSolarRadiationParameters.prototype.dayEnd
  31581. * @description 结束日期(年内的第几天)。
  31582. */
  31583. this.dayEnd = null;
  31584. /**
  31585. * @member {number} [AreaSolarRadiationParameters.prototype.hourStart]
  31586. * @description 起始时间(一天中的第几个小时)。
  31587. */
  31588. this.hourStart = null;
  31589. /**
  31590. * @member {number} [AreaSolarRadiationParameters.prototype.hourEnd]
  31591. * @description 结束时间(一天中的第几个小时)。
  31592. */
  31593. this.hourEnd = null;
  31594. /**
  31595. * @member {number} [AreaSolarRadiationParameters.prototype.transmittance]
  31596. * @description 太阳辐射穿过大气的透射率。
  31597. */
  31598. this.transmittance = null;
  31599. /**
  31600. * @member {number} [AreaSolarRadiationParameters.prototype.hourInterval=0.5]
  31601. * @description 计算时的小时间隔(设置的越小计算量越大并且计算结果更精确, 如果修改此参数,必须使用整数)
  31602. */
  31603. this.hourInterval = null;
  31604. /**
  31605. * @member {number} [AreaSolarRadiationParameters.prototype.dayInterval=5]
  31606. * @description 计算时的天数间隔(设置的越小计算量越大并且计算结果更精确, 必须使用整数)
  31607. */
  31608. this.dayInterval = null;
  31609. /**
  31610. * @member {boolean} [AreaSolarRadiationParameters.prototype.deleteExistResultDataset=false]
  31611. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  31612. */
  31613. this.deleteExistResultDataset = false;
  31614. Util_Util.extend(this, options);
  31615. this.CLASS_NAME = "SuperMap.AreaSolarRadiationParameters";
  31616. }
  31617. /**
  31618. * @function AreaSolarRadiationParameters.prototype.destroy
  31619. * @description 释放资源,将引用资源的属性置空。
  31620. */
  31621. AreaSolarRadiationParameters_createClass(AreaSolarRadiationParameters, [{
  31622. key: "destroy",
  31623. value: function destroy() {
  31624. var me = this;
  31625. me.dataset = null;
  31626. me.zFactor = 1.0;
  31627. me.averageCurvatureName = null;
  31628. me.profileCurvatureName = null;
  31629. me.planCurvatureName = null;
  31630. me.deleteExistResultDataset = true;
  31631. }
  31632. /**
  31633. * @function AreaSolarRadiationParameters.toObject
  31634. * @param {AreaSolarRadiationParameters} param - 地区太阳辐射参数类。
  31635. * @param {AreaSolarRadiationParameters} tempObj - 地区太阳辐射参数对象。
  31636. * @returns {Object} JSON对象。
  31637. * @description 将AreaSolarRadiationParameters对象转换成JSON对象。
  31638. */
  31639. }], [{
  31640. key: "toObject",
  31641. value: function toObject(param, tempObj) {
  31642. var parameter = {};
  31643. for (var name in param) {
  31644. if (name !== "dataset") {
  31645. var name1 = name === "latitude" || name === "timeMode" || name === "dayStart";
  31646. var name2 = name === "dayEnd" || name === "hourStart" || name === "hourEnd";
  31647. var name3 = name === "transmittance" || name === "hourInterval" || name === "dayInterval";
  31648. if (name1 || name2 || name3) {
  31649. parameter[name] = param[name];
  31650. } else {
  31651. tempObj[name] = param[name];
  31652. }
  31653. }
  31654. }
  31655. tempObj["parameter"] = parameter;
  31656. }
  31657. }]);
  31658. return AreaSolarRadiationParameters;
  31659. }();
  31660. ;// CONCATENATED MODULE: ./src/common/iServer/SpatialAnalystBase.js
  31661. function SpatialAnalystBase_typeof(obj) { "@babel/helpers - typeof"; return SpatialAnalystBase_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SpatialAnalystBase_typeof(obj); }
  31662. function SpatialAnalystBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31663. function SpatialAnalystBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  31664. function SpatialAnalystBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) SpatialAnalystBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) SpatialAnalystBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  31665. function SpatialAnalystBase_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SpatialAnalystBase_get = Reflect.get.bind(); } else { SpatialAnalystBase_get = function _get(target, property, receiver) { var base = SpatialAnalystBase_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SpatialAnalystBase_get.apply(this, arguments); }
  31666. function SpatialAnalystBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SpatialAnalystBase_getPrototypeOf(object); if (object === null) break; } return object; }
  31667. function SpatialAnalystBase_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SpatialAnalystBase_setPrototypeOf(subClass, superClass); }
  31668. function SpatialAnalystBase_setPrototypeOf(o, p) { SpatialAnalystBase_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SpatialAnalystBase_setPrototypeOf(o, p); }
  31669. function SpatialAnalystBase_createSuper(Derived) { var hasNativeReflectConstruct = SpatialAnalystBase_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SpatialAnalystBase_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SpatialAnalystBase_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SpatialAnalystBase_possibleConstructorReturn(this, result); }; }
  31670. function SpatialAnalystBase_possibleConstructorReturn(self, call) { if (call && (SpatialAnalystBase_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SpatialAnalystBase_assertThisInitialized(self); }
  31671. function SpatialAnalystBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31672. function SpatialAnalystBase_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  31673. function SpatialAnalystBase_getPrototypeOf(o) { SpatialAnalystBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SpatialAnalystBase_getPrototypeOf(o); }
  31674. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31675. * This program are made available under the terms of the Apache License, Version 2.0
  31676. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31677. /**
  31678. * @class SpatialAnalystBase
  31679. * @deprecatedclass SuperMap.SpatialAnalystBase
  31680. * @category iServer Core
  31681. * @classdesc 空间分析服务基类。
  31682. * @param {string} url - 地址。
  31683. * @param {Object} options - 可选参数。
  31684. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  31685. * @param {Object} [options.headers] - 请求头。
  31686. * @extends {CommonServiceBase}
  31687. * @usage
  31688. */
  31689. var SpatialAnalystBase = /*#__PURE__*/function (_CommonServiceBase) {
  31690. SpatialAnalystBase_inherits(SpatialAnalystBase, _CommonServiceBase);
  31691. var _super = SpatialAnalystBase_createSuper(SpatialAnalystBase);
  31692. function SpatialAnalystBase(url, options) {
  31693. var _this;
  31694. SpatialAnalystBase_classCallCheck(this, SpatialAnalystBase);
  31695. _this = _super.call(this, url, options);
  31696. /**
  31697. * @member {DataFormat} [SpatialAnalystBase.prototype.format=DataFormat.GEOJSON]
  31698. * @description 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  31699. */
  31700. _this.format = options.format || DataFormat.GEOJSON;
  31701. _this.CLASS_NAME = "SuperMap.SpatialAnalystBase";
  31702. return _this;
  31703. }
  31704. /**
  31705. * @function SpatialAnalystBase.prototype.destroy
  31706. * @override
  31707. */
  31708. SpatialAnalystBase_createClass(SpatialAnalystBase, [{
  31709. key: "destroy",
  31710. value: function destroy() {
  31711. SpatialAnalystBase_get(SpatialAnalystBase_getPrototypeOf(SpatialAnalystBase.prototype), "destroy", this).call(this);
  31712. this.format = null;
  31713. }
  31714. /**
  31715. * @function SpatialAnalystBase.prototype.serviceProcessCompleted
  31716. * @description 分析完成,执行此方法。
  31717. * @param {Object} result - 服务器返回的结果对象。
  31718. */
  31719. }, {
  31720. key: "serviceProcessCompleted",
  31721. value: function serviceProcessCompleted(result, options) {
  31722. var me = this,
  31723. analystResult;
  31724. result = Util_Util.transformResult(result);
  31725. if (result && me.format === DataFormat.GEOJSON && typeof me.toGeoJSONResult === 'function') {
  31726. //批量分析时会返回多个结果
  31727. if (Util_Util.isArray(result)) {
  31728. for (var i = 0; i < result.length; i++) {
  31729. result[i] = me.toGeoJSONResult(result[i]);
  31730. }
  31731. analystResult = result;
  31732. } else {
  31733. analystResult = me.toGeoJSONResult(result);
  31734. }
  31735. }
  31736. if (!analystResult) {
  31737. analystResult = result;
  31738. }
  31739. me.events.triggerEvent("processCompleted", {
  31740. result: analystResult,
  31741. options: options
  31742. });
  31743. }
  31744. /**
  31745. * @function SpatialAnalystBase.prototype.toGeoJSONResult
  31746. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  31747. * @param {Object} result - 服务器返回的结果对象。
  31748. *
  31749. */
  31750. }, {
  31751. key: "toGeoJSONResult",
  31752. value: function toGeoJSONResult(result) {
  31753. if (!result) {
  31754. return null;
  31755. }
  31756. //批量叠加分析时结果这样处理
  31757. if (result.result && result.result.resultGeometry) {
  31758. result = result.result;
  31759. }
  31760. var geoJSONFormat = new GeoJSON();
  31761. if (result.recordsets) {
  31762. for (var i = 0, recordsets = result.recordsets, len = recordsets.length; i < len; i++) {
  31763. if (recordsets[i].features) {
  31764. recordsets[i].features = geoJSONFormat.toGeoJSON(recordsets[i].features);
  31765. }
  31766. }
  31767. } else if (result.recordset && result.recordset.features) {
  31768. result.recordset.features = geoJSONFormat.toGeoJSON(result.recordset.features);
  31769. }
  31770. if (result.resultGeometry) {
  31771. result.resultGeometry = geoJSONFormat.toGeoJSON(result.resultGeometry);
  31772. }
  31773. if (result.regions) {
  31774. result.regions = geoJSONFormat.toGeoJSON(result.regions);
  31775. }
  31776. return result;
  31777. }
  31778. }]);
  31779. return SpatialAnalystBase;
  31780. }(CommonServiceBase);
  31781. ;// CONCATENATED MODULE: ./src/common/iServer/AreaSolarRadiationService.js
  31782. function AreaSolarRadiationService_typeof(obj) { "@babel/helpers - typeof"; return AreaSolarRadiationService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, AreaSolarRadiationService_typeof(obj); }
  31783. function AreaSolarRadiationService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31784. function AreaSolarRadiationService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  31785. function AreaSolarRadiationService_createClass(Constructor, protoProps, staticProps) { if (protoProps) AreaSolarRadiationService_defineProperties(Constructor.prototype, protoProps); if (staticProps) AreaSolarRadiationService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  31786. function AreaSolarRadiationService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { AreaSolarRadiationService_get = Reflect.get.bind(); } else { AreaSolarRadiationService_get = function _get(target, property, receiver) { var base = AreaSolarRadiationService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return AreaSolarRadiationService_get.apply(this, arguments); }
  31787. function AreaSolarRadiationService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = AreaSolarRadiationService_getPrototypeOf(object); if (object === null) break; } return object; }
  31788. function AreaSolarRadiationService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) AreaSolarRadiationService_setPrototypeOf(subClass, superClass); }
  31789. function AreaSolarRadiationService_setPrototypeOf(o, p) { AreaSolarRadiationService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return AreaSolarRadiationService_setPrototypeOf(o, p); }
  31790. function AreaSolarRadiationService_createSuper(Derived) { var hasNativeReflectConstruct = AreaSolarRadiationService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = AreaSolarRadiationService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = AreaSolarRadiationService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return AreaSolarRadiationService_possibleConstructorReturn(this, result); }; }
  31791. function AreaSolarRadiationService_possibleConstructorReturn(self, call) { if (call && (AreaSolarRadiationService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return AreaSolarRadiationService_assertThisInitialized(self); }
  31792. function AreaSolarRadiationService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31793. function AreaSolarRadiationService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  31794. function AreaSolarRadiationService_getPrototypeOf(o) { AreaSolarRadiationService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AreaSolarRadiationService_getPrototypeOf(o); }
  31795. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31796. * This program are made available under the terms of the Apache License, Version 2.0
  31797. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31798. /**
  31799. * @class AreaSolarRadiationService
  31800. * @deprecatedclass SuperMap.AreaSolarRadiationService
  31801. * @category iServer SpatialAnalyst SolarRadiationAnalyst
  31802. * @classdesc 地区太阳辐射服务类。
  31803. * @param {string} url - 服务的访问地址。如:</br>http://localhost:8090/iserver/services/spatialanalyst-sample/restjsr/spatialanalyst。</br>
  31804. * @param {Object} options - 参数。</br>
  31805. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  31806. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  31807. * @param {Object} [options.headers] - 请求头。
  31808. * @extends {SpatialAnalystBase}
  31809. * @example 例如:
  31810. * (start code)
  31811. * var myAreaSolarRadiationService = new AreaSolarRadiationService(url);
  31812. * myAreaSolarRadiationService.on({
  31813. * "processCompleted": processCompleted,
  31814. * "processFailed": processFailed
  31815. * }
  31816. * );
  31817. * (end)
  31818. * @usage
  31819. */
  31820. var AreaSolarRadiationService = /*#__PURE__*/function (_SpatialAnalystBase) {
  31821. AreaSolarRadiationService_inherits(AreaSolarRadiationService, _SpatialAnalystBase);
  31822. var _super = AreaSolarRadiationService_createSuper(AreaSolarRadiationService);
  31823. function AreaSolarRadiationService(url, options) {
  31824. var _this;
  31825. AreaSolarRadiationService_classCallCheck(this, AreaSolarRadiationService);
  31826. _this = _super.call(this, url, options);
  31827. _this.CLASS_NAME = "SuperMap.AreaSolarRadiationService";
  31828. return _this;
  31829. }
  31830. /**
  31831. * @function AreaSolarRadiationService.prototype.destroy
  31832. * @override
  31833. */
  31834. AreaSolarRadiationService_createClass(AreaSolarRadiationService, [{
  31835. key: "destroy",
  31836. value: function destroy() {
  31837. AreaSolarRadiationService_get(AreaSolarRadiationService_getPrototypeOf(AreaSolarRadiationService.prototype), "destroy", this).call(this);
  31838. }
  31839. /**
  31840. * @function AreaSolarRadiationService.prototype.processAsync
  31841. * @description 负责将客户端的查询参数传递到服务端。
  31842. * @param {AreaSolarRadiationParameters} parameter - 地区太阳辐射参数。
  31843. */
  31844. }, {
  31845. key: "processAsync",
  31846. value: function processAsync(parameter) {
  31847. if (!(parameter instanceof AreaSolarRadiationParameters)) {
  31848. return;
  31849. }
  31850. var me = this;
  31851. var parameterObject = {};
  31852. if (parameter instanceof AreaSolarRadiationParameters) {
  31853. me.url = Util_Util.urlPathAppend(me.url, "datasets/".concat(parameter.dataset, "/solarradiation"));
  31854. }
  31855. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  31856. AreaSolarRadiationParameters.toObject(parameter, parameterObject);
  31857. var jsonParameters = Util_Util.toJSON(parameterObject);
  31858. me.request({
  31859. method: 'POST',
  31860. data: jsonParameters,
  31861. scope: me,
  31862. success: me.serviceProcessCompleted,
  31863. failure: me.serviceProcessFailed
  31864. });
  31865. }
  31866. }]);
  31867. return AreaSolarRadiationService;
  31868. }(SpatialAnalystBase);
  31869. ;// CONCATENATED MODULE: ./src/common/iServer/BufferDistance.js
  31870. function BufferDistance_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31871. function BufferDistance_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  31872. function BufferDistance_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferDistance_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferDistance_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  31873. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31874. * This program are made available under the terms of the Apache License, Version 2.0
  31875. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31876. /**
  31877. * @class BufferDistance
  31878. * @deprecatedclass SuperMap.BufferDistance
  31879. * @category iServer SpatialAnalyst BufferAnalyst
  31880. * @classdesc 缓冲区分析的缓冲距离类。通过该类可以设置缓冲区分析的缓冲距离,距离可以是数值也可以是数值型的字段表达式。
  31881. * @param {Object} options - 可选参数。
  31882. * @param {string} [options.exp] - 以数值型的字段表达式作为缓冲区分析的距离值。
  31883. * @param {number} [options.value=100] - 以数值作为缓冲区分析的距离值。单位:米。
  31884. * @usage
  31885. */
  31886. var BufferDistance = /*#__PURE__*/function () {
  31887. function BufferDistance(options) {
  31888. BufferDistance_classCallCheck(this, BufferDistance);
  31889. /**
  31890. * @member {string} [BufferDistance.prototype.exp]
  31891. * @description 以数值型的字段表达式作为缓冲区分析的距离值。
  31892. */
  31893. this.exp = null;
  31894. /**
  31895. * @member {number} [BufferDistance.prototype.value=100]
  31896. * @description 以数值作为缓冲区分析的距离值。单位:米。
  31897. */
  31898. this.value = 100;
  31899. Util_Util.extend(this, options);
  31900. this.CLASS_NAME = "SuperMap.BufferDistance";
  31901. }
  31902. /**
  31903. * @function BufferDistance.prototype.destroy
  31904. * @description 释放资源,将引用资源的属性置空。
  31905. */
  31906. BufferDistance_createClass(BufferDistance, [{
  31907. key: "destroy",
  31908. value: function destroy() {
  31909. this.exp = null;
  31910. this.value = null;
  31911. }
  31912. }]);
  31913. return BufferDistance;
  31914. }();
  31915. ;// CONCATENATED MODULE: ./src/common/iServer/BufferSetting.js
  31916. function BufferSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31917. function BufferSetting_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  31918. function BufferSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferSetting_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  31919. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31920. * This program are made available under the terms of the Apache License, Version 2.0
  31921. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31922. /**
  31923. * @class BufferSetting
  31924. * @deprecatedclass SuperMap.BufferSetting
  31925. * @category iServer SpatialAnalyst BufferAnalyst
  31926. * @classdesc 缓冲区分析通用设置类。
  31927. * @param {Object} options - 可选参数。
  31928. * @param {BufferEndType} [options.endType=BufferEndType.FLAT] - 缓冲区端点枚举值。
  31929. * @param {BufferDistance} [options.leftDistance=100] - 左侧缓冲距离。
  31930. * @param {BufferDistance} [options.rightDistance=100] - 右侧缓冲距离。
  31931. * @param {number} [options.semicircleLineSegment=4] - 圆头缓冲圆弧处线段的个数。
  31932. * @param {BufferRadiusUnit} [options.radiusUnit=BufferRadiusUnit.METER] - 缓冲半径单位。
  31933. * @usage
  31934. */
  31935. var BufferSetting = /*#__PURE__*/function () {
  31936. function BufferSetting(options) {
  31937. BufferSetting_classCallCheck(this, BufferSetting);
  31938. /**
  31939. * @member {BufferEndType} [BufferSetting.prototype.endType = BufferEndType.FLAT]
  31940. * @description 缓冲区端点枚举值。分为平头和圆头两种。
  31941. */
  31942. this.endType = BufferEndType.FLAT;
  31943. /**
  31944. * @member {BufferDistance} [BufferSetting.prototype.leftDistance=100]
  31945. * @description 左侧缓冲距离。
  31946. * 当为 GeometryBufferAnalyst 时,单位为默认地图的投影系的单位(如3857为米,4326为度),
  31947. * 当为 DatasetBufferAnalyst 时,单位通过{@link BufferSetting.radiusUnit}设置(默认全部为米)。
  31948. */
  31949. this.leftDistance = new BufferDistance();
  31950. /**
  31951. * @member {BufferDistance} [BufferSetting.prototype.rightDistance=100]
  31952. * @description 右侧缓冲距离。
  31953. * 当为 GeometryBufferAnalyst 时,单位为默认地图的投影系的单位(如3857为米,4326为度),
  31954. * 当为 DatasetBufferAnalyst 时,单位通过{@link BufferSetting#radiusUnit}设置(默认全部为米)。
  31955. */
  31956. this.rightDistance = new BufferDistance();
  31957. /**
  31958. * @member {number} [BufferSetting.prototype.semicircleLineSegment=4]
  31959. * @description 圆头缓冲圆弧处线段的个数。即用多少个线段来模拟一个半圆。
  31960. */
  31961. this.semicircleLineSegment = 4;
  31962. /**
  31963. * @member {BufferRadiusUnit} [BufferSetting.prototype.radiusUnit = BufferRadiusUnit.METER]
  31964. * @description 缓冲半径单位,可以是{@link BufferRadiusUnit.METER}、{@link BufferRadiusUnit.MILLIMETER}、
  31965. * {@link BufferRadiusUnit.CENTIMETER}、{@link BufferRadiusUnit.DECIMETER}、{@link BufferRadiusUnit.KILOMETER}、
  31966. * {@link BufferRadiusUnit.FOOT}、{@link BufferRadiusUnit.INCH}、{@link BufferRadiusUnit.MILE}、{@link BufferRadiusUnit.YARD}。
  31967. * 仅对BufferAnalyst有效。
  31968. */
  31969. this.radiusUnit = BufferRadiusUnit.METER;
  31970. if (options) {
  31971. Util_Util.extend(this, options);
  31972. }
  31973. this.CLASS_NAME = "SuperMap.BufferSetting";
  31974. }
  31975. /**
  31976. * @function BufferSetting.prototype.destroy
  31977. * @description 释放资源,将引用资源的属性置空。
  31978. */
  31979. BufferSetting_createClass(BufferSetting, [{
  31980. key: "destroy",
  31981. value: function destroy() {
  31982. var me = this;
  31983. me.endType = null;
  31984. if (me.leftDistance) {
  31985. me.leftDistance.destroy();
  31986. me.leftDistance = null;
  31987. }
  31988. if (me.rightDistance) {
  31989. me.rightDistance.destroy();
  31990. me.rightDistance = null;
  31991. }
  31992. me.semicircleLineSegment = null;
  31993. me.radiusUnit = null;
  31994. }
  31995. }]);
  31996. return BufferSetting;
  31997. }();
  31998. ;// CONCATENATED MODULE: ./src/common/iServer/BufferAnalystParameters.js
  31999. function BufferAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32000. function BufferAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  32001. function BufferAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  32002. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32003. * This program are made available under the terms of the Apache License, Version 2.0
  32004. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32005. /**
  32006. * @class BufferAnalystParameters
  32007. * @deprecatedclass SuperMap.BufferAnalystParameters
  32008. * @category iServer SpatialAnalyst BufferAnalyst
  32009. * @classdesc 缓冲区分析参数基类。
  32010. * @param {Object} options - 参数。
  32011. * @param {BufferSetting} [options.bufferSetting] - 设置缓冲区通用参数。为缓冲区分析提供必要的参数信息,包括左缓冲距离、右缓冲距离、端点类型、圆头缓冲圆弧处线段的个数信息。
  32012. * @usage
  32013. */
  32014. var BufferAnalystParameters = /*#__PURE__*/function () {
  32015. function BufferAnalystParameters(options) {
  32016. BufferAnalystParameters_classCallCheck(this, BufferAnalystParameters);
  32017. var me = this;
  32018. /**
  32019. * @member {BufferSetting} [BufferAnalystParameters.prototype.bufferSetting]
  32020. * @description 设置缓冲区通用参数。为缓冲区分析提供必要的参数信息,包括左缓冲距离、右缓冲距离、端点类型、圆头缓冲圆弧处线段的个数信息。
  32021. */
  32022. me.bufferSetting = new BufferSetting();
  32023. Util_Util.extend(this, options);
  32024. this.CLASS_NAME = "SuperMap.BufferAnalystParameters";
  32025. }
  32026. /**
  32027. * @function BufferAnalystParameters.prototype.destroy
  32028. * @description 释放资源,将引用资源的属性置空。
  32029. */
  32030. BufferAnalystParameters_createClass(BufferAnalystParameters, [{
  32031. key: "destroy",
  32032. value: function destroy() {
  32033. var me = this;
  32034. if (me.bufferSetting) {
  32035. me.bufferSetting.destroy();
  32036. me.bufferSetting = null;
  32037. }
  32038. }
  32039. }]);
  32040. return BufferAnalystParameters;
  32041. }();
  32042. ;// CONCATENATED MODULE: ./src/common/iServer/DataReturnOption.js
  32043. function DataReturnOption_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32044. function DataReturnOption_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  32045. function DataReturnOption_createClass(Constructor, protoProps, staticProps) { if (protoProps) DataReturnOption_defineProperties(Constructor.prototype, protoProps); if (staticProps) DataReturnOption_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  32046. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32047. * This program are made available under the terms of the Apache License, Version 2.0
  32048. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32049. /**
  32050. * @class DataReturnOption
  32051. * @deprecatedclass SuperMap.DataReturnOption
  32052. * @category iServer Data Dataset
  32053. * @classdesc 数据返回设置类。
  32054. * @param {Object} options - 参数。
  32055. * @param {number} [options.expectCount=1000] - 设置返回的最大记录数,小于或者等于 0 时表示返回所有记录数。
  32056. * @param {string} [options.dataset] - 设置结果数据集标识,当 dataReturnMode 为 {@link DataReturnMode.DATASET_ONLY}或{@link DataReturnMode.DATASET_AND_RECORDSET}时有效,
  32057. * 作为返回数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示。
  32058. * @param {DataReturnMode} [options.dataReturnMode=DataReturnMode.RECORDSET_ONLY] - 数据返回模式。
  32059. * @param {boolean} [options.deleteExistResultDataset=true] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  32060. * @usage
  32061. */
  32062. var DataReturnOption = /*#__PURE__*/function () {
  32063. function DataReturnOption(options) {
  32064. DataReturnOption_classCallCheck(this, DataReturnOption);
  32065. /**
  32066. * @member {number} [DataReturnOption.prototype.expectCount=1000]
  32067. * @description 设置返回的最大记录数,小于或者等于0时表示返回所有记录数。
  32068. */
  32069. this.expectCount = 1000;
  32070. /**
  32071. * @member {string} [DataReturnOption.prototype.dataset]
  32072. * @description 设置结果数据集标识,当dataReturnMode为 {@link DataReturnMode.DATASET_ONLY}
  32073. * 或{@link DataReturnMode.DATASET_AND_RECORDSET}时有效,
  32074. * 作为返回数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示。
  32075. */
  32076. this.dataset = null;
  32077. /**
  32078. * @member {DataReturnMode} [DataReturnOption.prototype.dataReturnMode=DataReturnMode.RECORDSET_ONLY]
  32079. * @description 数据返回模式。
  32080. */
  32081. this.dataReturnMode = DataReturnMode.RECORDSET_ONLY;
  32082. /**
  32083. * @member {boolean} [DataReturnOption.prototype.deleteExistResultDataset=true]
  32084. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  32085. */
  32086. this.deleteExistResultDataset = true;
  32087. Util_Util.extend(this, options);
  32088. this.CLASS_NAME = "SuperMap.DataReturnOption";
  32089. }
  32090. /**
  32091. * @function DataReturnOption.prototype.destroy
  32092. * @description 释放资源,将引用资源的属性置空。
  32093. */
  32094. DataReturnOption_createClass(DataReturnOption, [{
  32095. key: "destroy",
  32096. value: function destroy() {
  32097. var me = this;
  32098. me.expectCount = null;
  32099. me.dataset = null;
  32100. me.dataReturnMode = null;
  32101. me.deleteExistResultDataset = null;
  32102. }
  32103. }]);
  32104. return DataReturnOption;
  32105. }();
  32106. ;// CONCATENATED MODULE: ./src/common/iServer/FilterParameter.js
  32107. function FilterParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32108. function FilterParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  32109. function FilterParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) FilterParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) FilterParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  32110. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32111. * This program are made available under the terms of the Apache License, Version 2.0
  32112. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32113. /**
  32114. * @class FilterParameter
  32115. * @deprecatedclass SuperMap.FilterParameter
  32116. * @category iServer Data FeatureResults
  32117. * @classdesc 查询过滤条件参数类。该类用于设置查询数据集的查询过滤参数。
  32118. * @param {Object} options - 参数。
  32119. * @param {string} options.attributeFilter - 属性过滤条件。
  32120. * @param {string} options.name - 查询数据集名称或者图层名称。
  32121. * @param {Array.<JoinItem>} [options.joinItems] - 与外部表的连接信息 JoinItem 数组。
  32122. * @param {Array.<LinkItem>} [options.linkItems] - 与外部表的关联信息 LinkItem 数组。
  32123. * @param {Array.<string>} [options.ids] - 查询 id 数组,即属性表中的 SmID 值。
  32124. * @param {string} [options.orderBy] - 查询排序的字段,orderBy 的字段须为数值型的。
  32125. * @param {string} [options.groupBy] - 查询分组条件的字段。
  32126. * @param {Array.<string>} [options.fields] - 查询字段数组。
  32127. * @usage
  32128. */
  32129. var FilterParameter = /*#__PURE__*/function () {
  32130. function FilterParameter(options) {
  32131. FilterParameter_classCallCheck(this, FilterParameter);
  32132. /**
  32133. * @member {string} FilterParameter.prototype.attributeFilter
  32134. * @description 属性过滤条件。
  32135. * 相当于 SQL 语句中的 WHERE 子句,其格式为:WHERE <条件表达式>,
  32136. * attributeFilter 就是其中的“条件表达式”。
  32137. * 该字段的用法为 attributeFilter = "过滤条件"。
  32138. * 例如,要查询字段 fieldValue 小于100的记录,设置 attributeFilter = "fieldValue < 100";
  32139. * 要查询字段 name 的值为“酒店”的记录,设置 attributeFilter = "name like '%酒店%'",等等。
  32140. */
  32141. this.attributeFilter = null;
  32142. /**
  32143. * @member {string} FilterParameter.prototype.name
  32144. * @description 查询数据集名称或者图层名称,根据实际的查询对象而定。
  32145. * 一般情况下该字段为数据集名称,但在进行与地图相关功能的操作时,
  32146. * 需要设置为图层名称(图层名称格式:数据集名称@数据源别名)。
  32147. * 因为一个地图的图层可能是来自于不同数据源的数据集,
  32148. * 而不同的数据源中可能存在同名的数据集,
  32149. * 使用数据集名称不能唯一的确定数据集,
  32150. * 所以在进行与地图相关功能的操作时,该值需要设置为图层名称。
  32151. */
  32152. this.name = null;
  32153. /**
  32154. * @member {Array.<JoinItem>} [FilterParameter.prototype.joinItems]
  32155. * @description 与外部表的连接信息 JoinItem 数组。
  32156. */
  32157. this.joinItems = null;
  32158. /**
  32159. * @member {Array.<LinkItem>} [FilterParameter.prototype.linkItems]
  32160. * @description 与外部表的关联信息 LinkItem 数组。
  32161. */
  32162. this.linkItems = null;
  32163. /**
  32164. * @member {Array.<string>} [FilterParameter.prototype.ids]
  32165. * @description 查询 id 数组,即属性表中的 SmID 值。
  32166. */
  32167. this.ids = null;
  32168. /**
  32169. * @member {string} [FilterParameter.prototype.orderBy]
  32170. * @description 查询排序的字段,orderBy的字段须为数值型的。
  32171. * 相当于 SQL 语句中的 ORDER BY 子句,其格式为:ORDER BY <列名>,
  32172. * 列名即属性表中每一列的名称,列又可称为属性,在 SuperMap 中又称为字段。
  32173. * 对单个字段排序时,该字段的用法为 orderBy = "字段名";
  32174. * 对多个字段排序时,字段之间以英文逗号进行分割,用法为 orderBy = "字段名1, 字段名2"。
  32175. * 例如,现有一个国家数据集,它有两个字段分别为“SmArea”和“pop_1994”,
  32176. * 分别表示国家的面积和1994年的各国人口数量。
  32177. * 如果要按照各国人口数量对记录进行排序,则 orderBy = "pop_1994";
  32178. * 如果要以面积和人口进行排序,则 orderBy = "SmArea, pop_1994"。
  32179. */
  32180. this.orderBy = null;
  32181. /**
  32182. * @member {string} [FilterParameter.prototype.groupBy]
  32183. * @description 查询分组条件的字段。
  32184. * 相当于 SQL 语句中的 GROUP BY 子句,其格式为:GROUP BY <列名>,
  32185. * 列名即属性表中每一列的名称,列又可称为属性,在 SuperMap 中又称为字段。
  32186. * 对单个字段分组时,该字段的用法为 groupBy = "字段名";
  32187. * 对多个字段分组时,字段之间以英文逗号进行分割,用法为 groupBy = "字段名1, 字段名2"。
  32188. * 例如,现有一个全球城市数据集,该数据集有两个字段分别为“Continent”和“Country”,
  32189. * 分别表示某个城市所属的洲和国家。
  32190. * 如果要按照国家对全球的城市进行分组,可以设置 groupBy = "Country";
  32191. * 如果以洲和国家对城市进行分组,设置 groupBy = "Continent, Country"。
  32192. */
  32193. this.groupBy = null;
  32194. /**
  32195. * @member {Array.<string>} [FilterParameter.prototype.fields]
  32196. * @description 查询字段数组,如果不设置则使用系统返回的所有字段。
  32197. */
  32198. this.fields = null;
  32199. if (options) {
  32200. Util_Util.extend(this, options);
  32201. }
  32202. this.CLASS_NAME = "SuperMap.FilterParameter";
  32203. }
  32204. /**
  32205. * @function FilterParameter.prototype.destroy
  32206. * @description 释放资源,将引用资源的属性置空。
  32207. */
  32208. FilterParameter_createClass(FilterParameter, [{
  32209. key: "destroy",
  32210. value: function destroy() {
  32211. var me = this;
  32212. me.attributeFilter = null;
  32213. me.name = null;
  32214. if (me.joinItems) {
  32215. for (var i = 0, joinItems = me.joinItems, len = joinItems.length; i < len; i++) {
  32216. joinItems[i].destroy();
  32217. }
  32218. me.joinItems = null;
  32219. }
  32220. if (me.linkItems) {
  32221. for (var _i2 = 0, linkItems = me.linkItems, _len2 = linkItems.length; _i2 < _len2; _i2++) {
  32222. linkItems[_i2].destroy();
  32223. }
  32224. me.linkItems = null;
  32225. }
  32226. me.ids = null;
  32227. me.orderBy = null;
  32228. me.groupBy = null;
  32229. me.fields = null;
  32230. }
  32231. }]);
  32232. return FilterParameter;
  32233. }();
  32234. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetBufferAnalystParameters.js
  32235. function DatasetBufferAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return DatasetBufferAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, DatasetBufferAnalystParameters_typeof(obj); }
  32236. function DatasetBufferAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32237. function DatasetBufferAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  32238. function DatasetBufferAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetBufferAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetBufferAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  32239. function DatasetBufferAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { DatasetBufferAnalystParameters_get = Reflect.get.bind(); } else { DatasetBufferAnalystParameters_get = function _get(target, property, receiver) { var base = DatasetBufferAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return DatasetBufferAnalystParameters_get.apply(this, arguments); }
  32240. function DatasetBufferAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetBufferAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  32241. function DatasetBufferAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) DatasetBufferAnalystParameters_setPrototypeOf(subClass, superClass); }
  32242. function DatasetBufferAnalystParameters_setPrototypeOf(o, p) { DatasetBufferAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetBufferAnalystParameters_setPrototypeOf(o, p); }
  32243. function DatasetBufferAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = DatasetBufferAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DatasetBufferAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DatasetBufferAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DatasetBufferAnalystParameters_possibleConstructorReturn(this, result); }; }
  32244. function DatasetBufferAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetBufferAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return DatasetBufferAnalystParameters_assertThisInitialized(self); }
  32245. function DatasetBufferAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32246. function DatasetBufferAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  32247. function DatasetBufferAnalystParameters_getPrototypeOf(o) { DatasetBufferAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetBufferAnalystParameters_getPrototypeOf(o); }
  32248. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32249. * This program are made available under the terms of the Apache License, Version 2.0
  32250. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32251. /**
  32252. * @class DatasetBufferAnalystParameters
  32253. * @deprecatedclass SuperMap.DatasetBufferAnalystParameters
  32254. * @category iServer SpatialAnalyst BufferAnalyst
  32255. * @classdesc 数据集缓冲区分析参数类。
  32256. * @param {Object} options - 参数。
  32257. * @param {string} options.dataset - 要用来做缓冲区分析的数据源中数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示。
  32258. * @param {FilterParameter} [options.filterQueryParameter] - 设置数据集中几何对象的过滤条件。只有满足此条件的几何对象才参与缓冲区分析。
  32259. * @param {DataReturnOption} [options.resultSetting] - 结果返回设置类。
  32260. * @param {boolean} [options.isAttributeRetained=true] - 是否保留进行缓冲区分析的对象的字段属性。当 isUnion 字段为 false 时该字段有效。
  32261. * @param {boolean} [options.isUnion=false] - 是否将缓冲区与源记录集中的对象合并后返回。对于面对象而言,要求源数据集中的面对象不相交。
  32262. * @param {BufferSetting} [options.bufferSetting] - 设置缓冲区通用参数。
  32263. *
  32264. * @extends {BufferAnalystParameters}
  32265. * @usage
  32266. */
  32267. var DatasetBufferAnalystParameters = /*#__PURE__*/function (_BufferAnalystParamet) {
  32268. DatasetBufferAnalystParameters_inherits(DatasetBufferAnalystParameters, _BufferAnalystParamet);
  32269. var _super = DatasetBufferAnalystParameters_createSuper(DatasetBufferAnalystParameters);
  32270. function DatasetBufferAnalystParameters(options) {
  32271. var _this;
  32272. DatasetBufferAnalystParameters_classCallCheck(this, DatasetBufferAnalystParameters);
  32273. _this = _super.call(this, options);
  32274. /**
  32275. * @member {string} DatasetBufferAnalystParameters.prototype.dataset
  32276. * @description 要用来做缓冲区分析的数据源中数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示。
  32277. */
  32278. _this.dataset = null;
  32279. /**
  32280. * @member {FilterParameter} [DatasetBufferAnalystParameters.prototype.filterQueryParameter]
  32281. * @description 设置数据集中几何对象的过滤条件。只有满足此条件的几何对象才参与缓冲区分析。
  32282. */
  32283. _this.filterQueryParameter = new FilterParameter();
  32284. /**
  32285. * @member {DataReturnOption} [DatasetBufferAnalystParameters.prototype.resultSetting]
  32286. * @description 结果返回设置类。
  32287. */
  32288. _this.resultSetting = new DataReturnOption();
  32289. /**
  32290. * @member {boolean} [DatasetBufferAnalystParameters.prototype.isAttributeRetained=true]
  32291. * @description 是否保留进行缓冲区分析的对象的字段属性。当 isUnion 字段为 false 时该字段有效。
  32292. */
  32293. _this.isAttributeRetained = true;
  32294. /**
  32295. * @member {boolean} [DatasetBufferAnalystParameters.prototype.isUnion=false]
  32296. * @description 是否将缓冲区与源记录集中的对象合并后返回。对于面对象而言,要求源数据集中的面对象不相交。
  32297. */
  32298. _this.isUnion = false;
  32299. Util_Util.extend(DatasetBufferAnalystParameters_assertThisInitialized(_this), options);
  32300. _this.CLASS_NAME = "SuperMap.DatasetBufferAnalystParameters";
  32301. return _this;
  32302. }
  32303. /**
  32304. * @function DatasetBufferAnalystParameters.prototype.destroy
  32305. * @override
  32306. */
  32307. DatasetBufferAnalystParameters_createClass(DatasetBufferAnalystParameters, [{
  32308. key: "destroy",
  32309. value: function destroy() {
  32310. DatasetBufferAnalystParameters_get(DatasetBufferAnalystParameters_getPrototypeOf(DatasetBufferAnalystParameters.prototype), "destroy", this).call(this);
  32311. var me = this;
  32312. me.dataset = null;
  32313. if (me.filterQueryParameter) {
  32314. me.filterQueryParameter.destroy();
  32315. me.filterQueryParameter = null;
  32316. }
  32317. if (me.resultSetting) {
  32318. me.resultSetting.destroy();
  32319. me.resultSetting = null;
  32320. }
  32321. me.isAttributeRetained = null;
  32322. me.isUnion = null;
  32323. }
  32324. /**
  32325. * @function DatasetBufferAnalystParameters.toObject
  32326. * @param {DatasetBufferAnalystParameters} datasetBufferAnalystParameters - 数据集缓冲区分析参数类。
  32327. * @param {DatasetBufferAnalystParameters} tempObj - 数据集缓冲区分析参数对象。
  32328. * @description 将数据集缓冲区分析参数对象转换为 JSON 对象。
  32329. * @returns {Object} JSON 对象。
  32330. */
  32331. }], [{
  32332. key: "toObject",
  32333. value: function toObject(datasetBufferAnalystParameters, tempObj) {
  32334. for (var name in datasetBufferAnalystParameters) {
  32335. if (name === "bufferSetting") {
  32336. datasetBufferAnalystParameters.bufferSetting.radiusUnit = datasetBufferAnalystParameters.bufferSetting.radiusUnit.toUpperCase();
  32337. tempObj.bufferAnalystParameter = datasetBufferAnalystParameters.bufferSetting;
  32338. } else if (name === "resultSetting") {
  32339. tempObj.dataReturnOption = datasetBufferAnalystParameters.resultSetting;
  32340. } else if (name === "dataset") {
  32341. continue;
  32342. } else {
  32343. tempObj[name] = datasetBufferAnalystParameters[name];
  32344. }
  32345. }
  32346. }
  32347. }]);
  32348. return DatasetBufferAnalystParameters;
  32349. }(BufferAnalystParameters);
  32350. ;// CONCATENATED MODULE: ./src/common/iServer/GeometryBufferAnalystParameters.js
  32351. function GeometryBufferAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return GeometryBufferAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GeometryBufferAnalystParameters_typeof(obj); }
  32352. function GeometryBufferAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32353. function GeometryBufferAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  32354. function GeometryBufferAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryBufferAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryBufferAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  32355. function GeometryBufferAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GeometryBufferAnalystParameters_get = Reflect.get.bind(); } else { GeometryBufferAnalystParameters_get = function _get(target, property, receiver) { var base = GeometryBufferAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GeometryBufferAnalystParameters_get.apply(this, arguments); }
  32356. function GeometryBufferAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryBufferAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  32357. function GeometryBufferAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GeometryBufferAnalystParameters_setPrototypeOf(subClass, superClass); }
  32358. function GeometryBufferAnalystParameters_setPrototypeOf(o, p) { GeometryBufferAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryBufferAnalystParameters_setPrototypeOf(o, p); }
  32359. function GeometryBufferAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = GeometryBufferAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeometryBufferAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeometryBufferAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeometryBufferAnalystParameters_possibleConstructorReturn(this, result); }; }
  32360. function GeometryBufferAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometryBufferAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GeometryBufferAnalystParameters_assertThisInitialized(self); }
  32361. function GeometryBufferAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32362. function GeometryBufferAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  32363. function GeometryBufferAnalystParameters_getPrototypeOf(o) { GeometryBufferAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryBufferAnalystParameters_getPrototypeOf(o); }
  32364. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32365. * This program are made available under the terms of the Apache License, Version 2.0
  32366. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32367. /**
  32368. * @class GeometryBufferAnalystParameters
  32369. * @deprecatedclass SuperMap.GeometryBufferAnalystParameters
  32370. * @category iServer SpatialAnalyst BufferAnalyst
  32371. * @classdesc 几何对象缓冲区分析参数类。
  32372. * 对指定的某个几何对象做缓冲区分析。通过该类可以指定要做缓冲区分析的几何对象、缓冲区参数等。
  32373. * @param {Object} options - 参数。
  32374. * @param {GeoJSONObject} options.sourceGeometry - 要做缓冲区分析的几何对象。
  32375. * @param {number} options.sourceGeometrySRID - 缓冲区几何对象投影坐标参数, 如 4326,3857。
  32376. * @param {BufferSetting} [options.bufferSetting] - 设置缓冲区通用参数。
  32377. * @extends {BufferAnalystParameters}
  32378. * @usage
  32379. */
  32380. var GeometryBufferAnalystParameters = /*#__PURE__*/function (_BufferAnalystParamet) {
  32381. GeometryBufferAnalystParameters_inherits(GeometryBufferAnalystParameters, _BufferAnalystParamet);
  32382. var _super = GeometryBufferAnalystParameters_createSuper(GeometryBufferAnalystParameters);
  32383. function GeometryBufferAnalystParameters(options) {
  32384. var _this;
  32385. GeometryBufferAnalystParameters_classCallCheck(this, GeometryBufferAnalystParameters);
  32386. _this = _super.call(this, options);
  32387. /**
  32388. * @member {GeoJSONObject} GeometryBufferAnalystParameters.prototype.sourceGeometry
  32389. * @description 要做缓冲区分析的几何对象。<br>
  32390. * 点类型可以是:{@link GeometryPoint}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}。</br>
  32391. * 线类型可以是:{@link GeometryLineString}|{@link GeometryLinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。</br>
  32392. * 面类型可以是:{@link GeometryPolygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
  32393. */
  32394. _this.sourceGeometry = null;
  32395. /**
  32396. * @member {number} GeometryBufferAnalystParameters.prototype.sourceGeometrySRID
  32397. * @description 缓冲区几何对象投影坐标参数, 如 4326,3857。
  32398. */
  32399. _this.sourceGeometrySRID = null;
  32400. if (options) {
  32401. Util_Util.extend(GeometryBufferAnalystParameters_assertThisInitialized(_this), options);
  32402. }
  32403. _this.CLASS_NAME = " SuperMap.GeometryBufferAnalystParameters";
  32404. return _this;
  32405. }
  32406. /**
  32407. * @function GeometryBufferAnalystParameters.prototype.destroy
  32408. * @override
  32409. */
  32410. GeometryBufferAnalystParameters_createClass(GeometryBufferAnalystParameters, [{
  32411. key: "destroy",
  32412. value: function destroy() {
  32413. GeometryBufferAnalystParameters_get(GeometryBufferAnalystParameters_getPrototypeOf(GeometryBufferAnalystParameters.prototype), "destroy", this).call(this);
  32414. var me = this;
  32415. if (me.sourceGeometry) {
  32416. me.sourceGeometry.destroy();
  32417. me.sourceGeometry = null;
  32418. }
  32419. }
  32420. /**
  32421. * @function GeometryBufferAnalystParameters.toObject
  32422. * @param {GeometryBufferAnalystParameters} geometryBufferAnalystParameters - 几何对象缓冲区分析参数类。
  32423. * @param {GeometryBufferAnalystParameters} tempObj - 几何对象缓冲区分析参数对象。
  32424. * @description 将几何对象缓冲区分析参数对象转换为 JSON 对象。
  32425. * @returns {Object} JSON 对象。
  32426. */
  32427. }], [{
  32428. key: "toObject",
  32429. value: function toObject(geometryBufferAnalystParameters, tempObj) {
  32430. for (var name in geometryBufferAnalystParameters) {
  32431. if (name === "bufferSetting") {
  32432. var tempBufferSetting = {};
  32433. for (var key in geometryBufferAnalystParameters.bufferSetting) {
  32434. tempBufferSetting[key] = geometryBufferAnalystParameters.bufferSetting[key];
  32435. }
  32436. tempObj.analystParameter = tempBufferSetting;
  32437. } else if (name === "sourceGeometry") {
  32438. tempObj.sourceGeometry = ServerGeometry.fromGeometry(geometryBufferAnalystParameters.sourceGeometry);
  32439. } else {
  32440. tempObj[name] = geometryBufferAnalystParameters[name];
  32441. }
  32442. }
  32443. }
  32444. }]);
  32445. return GeometryBufferAnalystParameters;
  32446. }(BufferAnalystParameters);
  32447. ;// CONCATENATED MODULE: ./src/common/iServer/BufferAnalystService.js
  32448. function BufferAnalystService_typeof(obj) { "@babel/helpers - typeof"; return BufferAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, BufferAnalystService_typeof(obj); }
  32449. function BufferAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32450. function BufferAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  32451. function BufferAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  32452. function BufferAnalystService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { BufferAnalystService_get = Reflect.get.bind(); } else { BufferAnalystService_get = function _get(target, property, receiver) { var base = BufferAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return BufferAnalystService_get.apply(this, arguments); }
  32453. function BufferAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = BufferAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  32454. function BufferAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) BufferAnalystService_setPrototypeOf(subClass, superClass); }
  32455. function BufferAnalystService_setPrototypeOf(o, p) { BufferAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return BufferAnalystService_setPrototypeOf(o, p); }
  32456. function BufferAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = BufferAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = BufferAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = BufferAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return BufferAnalystService_possibleConstructorReturn(this, result); }; }
  32457. function BufferAnalystService_possibleConstructorReturn(self, call) { if (call && (BufferAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return BufferAnalystService_assertThisInitialized(self); }
  32458. function BufferAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32459. function BufferAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  32460. function BufferAnalystService_getPrototypeOf(o) { BufferAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BufferAnalystService_getPrototypeOf(o); }
  32461. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32462. * This program are made available under the terms of the Apache License, Version 2.0
  32463. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32464. /**
  32465. * @class BufferAnalystService
  32466. * @deprecatedclass SuperMap.BufferAnalystService
  32467. * @category iServer SpatialAnalyst BufferAnalyst
  32468. * @classdesc 缓冲区分析服务类。
  32469. * 该类负责将客户设置的缓冲区分析参数传递给服务端,并接收服务端返回的缓冲区分析结果数据。
  32470. * 缓冲区分析结果通过该类支持的事件的监听函数参数获取。
  32471. * @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  32472. * @param {Object} options - 参数。
  32473. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  32474. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32475. * @param {Object} [options.headers] - 请求头。
  32476. * @extends {SpatialAnalystBase}
  32477. * @example 例如:
  32478. * (start code)
  32479. * var myBufferAnalystService = new BufferAnalystService(url, {
  32480. * eventListeners: {
  32481. * "processCompleted": bufferCompleted,
  32482. * "processFailed": bufferFailed
  32483. * }
  32484. * });
  32485. * (end)
  32486. * @usage
  32487. */
  32488. var BufferAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  32489. BufferAnalystService_inherits(BufferAnalystService, _SpatialAnalystBase);
  32490. var _super = BufferAnalystService_createSuper(BufferAnalystService);
  32491. function BufferAnalystService(url, options) {
  32492. var _this;
  32493. BufferAnalystService_classCallCheck(this, BufferAnalystService);
  32494. _this = _super.call(this, url, options);
  32495. /**
  32496. * @member {string} BufferAnalystService.prototype.mode
  32497. * @description 缓冲区分析类型
  32498. */
  32499. _this.mode = null;
  32500. if (options) {
  32501. Util_Util.extend(BufferAnalystService_assertThisInitialized(_this), options);
  32502. }
  32503. _this.CLASS_NAME = "SuperMap.BufferAnalystService";
  32504. return _this;
  32505. }
  32506. /**
  32507. * @function BufferAnalystService.prototype.destroy
  32508. * @override
  32509. */
  32510. BufferAnalystService_createClass(BufferAnalystService, [{
  32511. key: "destroy",
  32512. value: function destroy() {
  32513. BufferAnalystService_get(BufferAnalystService_getPrototypeOf(BufferAnalystService.prototype), "destroy", this).call(this);
  32514. this.mode = null;
  32515. }
  32516. /**
  32517. * @method BufferAnalystService.prototype.processAsync
  32518. * @description 负责将客户端的查询参数传递到服务端。
  32519. * @param {BufferAnalystParameters} parameter - 缓冲区分析参数
  32520. */
  32521. }, {
  32522. key: "processAsync",
  32523. value: function processAsync(parameter) {
  32524. var parameterObject = {};
  32525. var me = this;
  32526. if (parameter instanceof DatasetBufferAnalystParameters) {
  32527. me.mode = 'datasets';
  32528. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/buffer');
  32529. DatasetBufferAnalystParameters.toObject(parameter, parameterObject);
  32530. } else if (parameter instanceof GeometryBufferAnalystParameters) {
  32531. me.mode = 'geometry';
  32532. me.url = Util_Util.urlPathAppend(me.url, 'geometry/buffer');
  32533. GeometryBufferAnalystParameters.toObject(parameter, parameterObject);
  32534. }
  32535. var jsonParameters = Util_Util.toJSON(parameterObject);
  32536. this.returnContent = true;
  32537. me.request({
  32538. method: "POST",
  32539. data: jsonParameters,
  32540. scope: me,
  32541. success: me.serviceProcessCompleted,
  32542. failure: me.serviceProcessFailed
  32543. });
  32544. }
  32545. }, {
  32546. key: "dataFormat",
  32547. value: function dataFormat() {
  32548. return [DataFormat.GEOJSON, DataFormat.ISERVER, DataFormat.FGB];
  32549. }
  32550. }]);
  32551. return BufferAnalystService;
  32552. }(SpatialAnalystBase);
  32553. ;// CONCATENATED MODULE: ./src/common/iServer/DatasourceConnectionInfo.js
  32554. function DatasourceConnectionInfo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32555. function DatasourceConnectionInfo_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  32556. function DatasourceConnectionInfo_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasourceConnectionInfo_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasourceConnectionInfo_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  32557. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32558. * This program are made available under the terms of the Apache License, Version 2.0
  32559. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32560. // eslint-disable-line no-unused-vars
  32561. /**
  32562. * @class DatasourceConnectionInfo
  32563. * @deprecatedclass SuperMap.DatasourceConnectionInfo
  32564. * @category iServer Data Datasource
  32565. * @classdesc 数据源连接信息类。该类包括了进行数据源连接的所有信息,如所要连接的服务器名称、数据库名称、用户名以及密码等。
  32566. * 当保存为工作空间时,工作空间中的数据源的连接信息都将存储到工作空间文件中。对于不同类型的数据源,其连接信息有所区别。
  32567. * 所以在使用该类所包含的成员时,请注意该成员所适用的数据源类型。对于从数据源对象中返回的数据连接信息对象,只有 connect 方法可以被修改,
  32568. * 其他内容是不可以被修改的。对于用户创建的数据源连接信息对象,其内容都可以修改。
  32569. * @param {Object} options - 参数。
  32570. * @param {string} options.alias - 数据源别名。
  32571. * @param {string} options.dataBase - 数据源连接的数据库名。
  32572. * @param {boolean} [options.connect] - 数据源是否自动连接数据。
  32573. * @param {string} [options.driver] - 使用 ODBC(Open Database Connectivity,开放数据库互连)的数据库的驱动程序名。
  32574. * @param {EngineType} [options.engineType] - 数据源连接的引擎类型。
  32575. * @param {boolean} [options.exclusive] - 是否以独占方式打开数据源。
  32576. * @param {boolean} [options.OpenLinkTable] - 是否把数据库中的其他非 SuperMap 数据表作为 LinkTable 打开。
  32577. * @param {string} [options.password] - 登录数据源连接的数据库或文件的密码。
  32578. * @param {boolean} [options.readOnly] - 是否以只读方式打开数据源。
  32579. * @param {string} [options.server] - 数据库服务器名或 SDB 文件名。
  32580. * @param {string} [options.user] - 登录数据库的用户名。
  32581. * @usage
  32582. */
  32583. var DatasourceConnectionInfo = /*#__PURE__*/function () {
  32584. function DatasourceConnectionInfo(options) {
  32585. DatasourceConnectionInfo_classCallCheck(this, DatasourceConnectionInfo);
  32586. /**
  32587. * @member {string} DatasourceConnectionInfo.prototype.alias
  32588. * @description 数据源别名。
  32589. */
  32590. this.alias = null;
  32591. /**
  32592. * @member {boolean} [DatasourceConnectionInfo.prototype.connect]
  32593. * @description 数据源是否自动连接数据。
  32594. */
  32595. this.connect = null;
  32596. /**
  32597. * @member {string} DatasourceConnectionInfo.prototype.dataBase
  32598. * @description 数据源连接的数据库名。
  32599. */
  32600. this.dataBase = null;
  32601. /**
  32602. * @member {string} [DatasourceConnectionInfo.prototype.driver]
  32603. * @description 使用 ODBC(Open Database Connectivity,开放数据库互连) 的数据库的驱动程序名。
  32604. * 其中,对于 SQL Server 数据库与 iServer 发布的 WMTS 服务,此为必设参数。
  32605. * 对于 SQL Server 数据库,它使用 ODBC 连接,所设置的驱动程序名为 "SQL Server" 或 "SQL Native Client";
  32606. * 对于 iServer 发布的 WMTS 服务,设置的驱动名称为 "WMTS"。
  32607. */
  32608. this.driver = null;
  32609. /**
  32610. * @member {EngineType} [DatasourceConnectionInfo.prototype.engineType]
  32611. * @description 数据源连接的引擎类型。
  32612. */
  32613. this.engineType = null;
  32614. /**
  32615. * @member {boolean} [DatasourceConnectionInfo.prototype.exclusive]
  32616. * @description 是否以独占方式打开数据源。
  32617. */
  32618. this.exclusive = null;
  32619. /**
  32620. * @member {boolean} [DatasourceConnectionInfo.prototype.OpenLinkTable]
  32621. * @description 是否把数据库中的其他非 SuperMap 数据表作为 LinkTable 打开。
  32622. */
  32623. this.OpenLinkTable = null;
  32624. /**
  32625. * @member {string} [DatasourceConnectionInfo.prototype.password]
  32626. * @description 登录数据源连接的数据库或文件的密码。
  32627. */
  32628. this.password = null;
  32629. /**
  32630. * @member {boolean} [DatasourceConnectionInfo.prototype.readOnly]
  32631. * @description 是否以只读方式打开数据源。
  32632. */
  32633. this.readOnly = null;
  32634. /**
  32635. * @member {string} [DatasourceConnectionInfo.prototype.server]
  32636. * @description 数据库服务器名、文件名或服务地址。
  32637. * 1.对于 SDB 和 UDB 文件,为其文件的绝对路径。注意:当绝对路径的长度超过 UTF-8 编码格式的 260 字节长度,该数据源无法打开。
  32638. * 2.对于 Oracle 数据库,其服务器名为其 TNS 服务名称。
  32639. * 3.对于 SQL Server 数据库,其服务器名为其系统的 DSN(Database Source Name) 名称。
  32640. * 4.对于 PostgreSQL 数据库,其服务器名为 “IP:端口号”,默认的端口号是 5432。
  32641. * 5.对于 DB2 数据库,已经进行了编目,所以不需要进行服务器的设置。
  32642. * 6.对于 Kingbase 数据库,其服务器名为其 IP 地址。
  32643. * 7.对于 GoogleMaps 数据源,其服务器地址,默认设置为 “{@link http://maps.google.com}”,且不可更改。
  32644. * 8.对于 SuperMapCould 数据源,为其服务地址。
  32645. * 9.对于 MAPWORLD 数据源,为其服务地址,默认设置为 “{@link http://www.tianditu.cn}”,且不可更改。
  32646. * 10.对于 OGC 和 REST 数据源,为其服务地址。
  32647. */
  32648. this.server = null;
  32649. /**
  32650. * @member {string} DatasourceConnectionInfo.prototype.user
  32651. * @description 登录数据库的用户名。
  32652. */
  32653. this.user = null;
  32654. if (options) {
  32655. Util_Util.extend(this, options);
  32656. }
  32657. this.CLASS_NAME = "SuperMap.DatasourceConnectionInfo";
  32658. }
  32659. /**
  32660. * @function DatasourceConnectionInfo.prototype.destroy
  32661. * @description 释放资源,将引用资源的属性置空。
  32662. */
  32663. DatasourceConnectionInfo_createClass(DatasourceConnectionInfo, [{
  32664. key: "destroy",
  32665. value: function destroy() {
  32666. var me = this;
  32667. me.alias = null;
  32668. me.connect = null;
  32669. me.dataBase = null;
  32670. me.driver = null;
  32671. me.engineType = null;
  32672. me.exclusive = null;
  32673. me.OpenLinkTable = null;
  32674. me.password = null;
  32675. me.readOnly = null;
  32676. me.server = null;
  32677. me.user = null;
  32678. }
  32679. }]);
  32680. return DatasourceConnectionInfo;
  32681. }();
  32682. ;// CONCATENATED MODULE: ./src/common/iServer/OutputSetting.js
  32683. function OutputSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32684. function OutputSetting_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  32685. function OutputSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) OutputSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) OutputSetting_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  32686. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32687. * This program are made available under the terms of the Apache License, Version 2.0
  32688. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32689. /**
  32690. * @class OutputSetting
  32691. * @deprecatedclass SuperMap.OutputSetting
  32692. * @category iServer ProcessingService
  32693. * @classdesc 分布式分析输出类型设置类。
  32694. * @param {Object} options - 参数。
  32695. * @param {DatasourceConnectionInfo} options.datasourceInfo - 数据源连接信息。
  32696. * @param {string} [options.datasetName='analystResult'] - 结果数据集名称。
  32697. * @param {OutputType} [options.type=OutputType.UDB] - 输出类型。
  32698. * @param {string} [options.outputPath] - 分析结果输出路径。
  32699. * @usage
  32700. */
  32701. var OutputSetting = /*#__PURE__*/function () {
  32702. function OutputSetting(options) {
  32703. OutputSetting_classCallCheck(this, OutputSetting);
  32704. /**
  32705. * @member {OutputType} OutputSetting.prototype.type
  32706. * @description 分布式分析的输出类型。
  32707. */
  32708. this.type = OutputType.UDB;
  32709. /**
  32710. * @member {string} [OutputSetting.prototype.datasetName='analystResult']
  32711. * @description 分布式分析的输出结果数据集名称。
  32712. */
  32713. this.datasetName = "analystResult";
  32714. /**
  32715. * @member {DatasourceConnectionInfo} OutputSetting.prototype.datasourceInfo
  32716. * @description 分布式分析的输出结果数据源连接信息。
  32717. */
  32718. this.datasourceInfo = null;
  32719. /**
  32720. * @member {string} [OutputSetting.prototype.outputPath]
  32721. * @description 分布式分析的分析结果输出路径。
  32722. */
  32723. this.outputPath = "";
  32724. Util_Util.extend(this, options);
  32725. this.CLASS_NAME = "SuperMap.OutputSetting";
  32726. }
  32727. /**
  32728. * @function OutputSetting.prototype.destroy
  32729. * @description 释放资源,将引用资源的属性置空。
  32730. */
  32731. OutputSetting_createClass(OutputSetting, [{
  32732. key: "destroy",
  32733. value: function destroy() {
  32734. var me = this;
  32735. me.type = null;
  32736. me.datasetName = null;
  32737. me.outputPath = null;
  32738. if (me.datasourceInfo instanceof DatasourceConnectionInfo) {
  32739. me.datasourceInfo.destroy();
  32740. me.datasourceInfo = null;
  32741. }
  32742. }
  32743. }]);
  32744. return OutputSetting;
  32745. }();
  32746. ;// CONCATENATED MODULE: ./src/common/iServer/MappingParameters.js
  32747. function MappingParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32748. function MappingParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  32749. function MappingParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) MappingParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) MappingParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  32750. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32751. * This program are made available under the terms of the Apache License, Version 2.0
  32752. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32753. /**
  32754. * @class MappingParameters
  32755. * @deprecatedclass SuperMap.MappingParameters
  32756. * @category iServer ProcessingService
  32757. * @classdesc 分析后结果可视化的参数类。
  32758. * @param {Object} options - 参数。
  32759. * @param {Array.<ThemeGridRangeItem>} [options.items] - 栅格分段专题图子项数组。
  32760. * @param {number} [options.numericPrecision=1] - 精度,此字段用于设置分析结果标签专题图中标签数值的精度,如“1”表示精确到小数点的后一位。
  32761. * @param {RangeMode} [options.rangeMode=RangeMode.EQUALINTERVAL] - 专题图分段模式。
  32762. * @param {number} [options.rangeCount] - 专题图分段个数。
  32763. * @param {ColorGradientType} [options.colorGradientType=ColorGradientType.YELLOW_RED] - 专题图颜色渐变模式。
  32764. * @usage
  32765. */
  32766. var MappingParameters = /*#__PURE__*/function () {
  32767. function MappingParameters(options) {
  32768. MappingParameters_classCallCheck(this, MappingParameters);
  32769. /**
  32770. * @member {Array.<ThemeGridRangeItem>} [MappingParameters.prototype.items]
  32771. * @description 栅格分段专题图子项数组。
  32772. */
  32773. this.items = null;
  32774. /**
  32775. * @member {number} [MappingParameters.prototype.numericPrecision=1]
  32776. * @description 精度,此字段用于设置分析结果标签专题图中标签数值的精度,如“1”表示精确到小数点的后一位。
  32777. */
  32778. this.numericPrecision = 1;
  32779. /**
  32780. * @member {RangeMode} [MappingParameters.prototype.RangeMode=RangeMode.EQUALINTERVAL]
  32781. * @description 专题图分段模式。
  32782. */
  32783. this.rangeMode = RangeMode.EQUALINTERVAL;
  32784. /**
  32785. * @member {number} [MappingParameters.prototype.rangeCount]
  32786. * @description 专题图分段个数。
  32787. */
  32788. this.rangeCount = "";
  32789. /**
  32790. * @member {ColorGradientType} [MappingParameters.prototype.colorGradientType=ColorGradientType.YELLOW_RED]
  32791. * @description 专题图颜色渐变模式。
  32792. */
  32793. this.colorGradientType = ColorGradientType.YELLOW_RED;
  32794. Util_Util.extend(this, options);
  32795. this.CLASS_NAME = "SuperMap.MappingParameters";
  32796. }
  32797. /**
  32798. * @function MappingParameters.prototype.destroy
  32799. * @description 释放资源,将引用资源的属性置空。
  32800. */
  32801. MappingParameters_createClass(MappingParameters, [{
  32802. key: "destroy",
  32803. value: function destroy() {
  32804. var me = this;
  32805. if (me.items) {
  32806. if (me.items.length > 0) {
  32807. for (var item in me.items) {
  32808. me.items[item].destroy();
  32809. me.items[item] = null;
  32810. }
  32811. }
  32812. me.items = null;
  32813. }
  32814. me.numericPrecision = null;
  32815. me.rangeMode = null;
  32816. me.rangeCount = null;
  32817. me.colorGradientType = null;
  32818. }
  32819. }]);
  32820. return MappingParameters;
  32821. }();
  32822. ;// CONCATENATED MODULE: ./src/common/iServer/BuffersAnalystJobsParameter.js
  32823. function BuffersAnalystJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32824. function BuffersAnalystJobsParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  32825. function BuffersAnalystJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) BuffersAnalystJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) BuffersAnalystJobsParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  32826. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32827. * This program are made available under the terms of the Apache License, Version 2.0
  32828. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32829. /**
  32830. * @class BuffersAnalystJobsParameter
  32831. * @deprecatedclass SuperMap.BuffersAnalystJobsParameter
  32832. * @category iServer ProcessingService BufferAnalyst
  32833. * @classdesc 缓冲区分析任务参数类。
  32834. * @param {Object} options - 参数。
  32835. * @param {string} options.datasetName - 数据集名。
  32836. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} [options.bounds] - 分析范围(默认为全图范围)。
  32837. * @param {string} [options.distance='15'] - 缓冲距离,或缓冲区半径。
  32838. * @param {string} [options.distanceField='pickup_latitude'] - 缓冲区分析距离字段。
  32839. * @param {AnalystSizeUnit} [options.distanceUnit=AnalystSizeUnit.METER] - 缓冲距离单位单位。
  32840. * @param {OutputSetting} [options.output] - 输出参数设置。
  32841. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  32842. * @usage
  32843. */
  32844. var BuffersAnalystJobsParameter = /*#__PURE__*/function () {
  32845. function BuffersAnalystJobsParameter(options) {
  32846. BuffersAnalystJobsParameter_classCallCheck(this, BuffersAnalystJobsParameter);
  32847. /**
  32848. * @member {string} BuffersAnalystJobsParameter.prototype.datasetName
  32849. * @description 数据集名。
  32850. */
  32851. this.datasetName = '';
  32852. /**
  32853. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} BuffersAnalystJobsParameter.prototype.bounds
  32854. * @description 分析范围。
  32855. */
  32856. this.bounds = '';
  32857. /**
  32858. * @member {string} [BuffersAnalystJobsParameter.prototype.distance='15']
  32859. * @description 缓冲距离,或称为缓冲区半径。当缓冲距离字段为空时,此参数有效。
  32860. */
  32861. this.distance = '';
  32862. /**
  32863. * @member {string} [BuffersAnalystJobsParameter.prototype.distanceField='pickup_latitude']
  32864. * @description 缓冲距离字段。
  32865. */
  32866. this.distanceField = '';
  32867. /**
  32868. * @member {AnalystSizeUnit} [BuffersAnalystJobsParameter.prototype.distanceUnit=AnalystSizeUnit.METER]
  32869. * @description 缓冲距离单位。
  32870. */
  32871. this.distanceUnit = AnalystSizeUnit.METER;
  32872. /**
  32873. * @member {string} BuffersAnalystJobsParameter.prototype.dissolveField
  32874. * @description 融合字段,根据字段值对缓冲区结果面对象进行融合。
  32875. */
  32876. this.dissolveField = '';
  32877. /**
  32878. * @member {OutputSetting} [BuffersAnalystJobsParameter.prototype.output]
  32879. * @description 输出参数设置类。
  32880. */
  32881. this.output = null;
  32882. /**
  32883. * @member {MappingParameters} [BuffersAnalystJobsParameter.prototype.mappingParameters]
  32884. * @description 分析后结果可视化的参数类。
  32885. */
  32886. this.mappingParameters = null;
  32887. if (!options) {
  32888. return this;
  32889. }
  32890. Util_Util.extend(this, options);
  32891. this.CLASS_NAME = 'SuperMap.BuffersAnalystJobsParameter';
  32892. }
  32893. /**
  32894. * @function BuffersAnalystJobsParameter.prototype.destroy
  32895. * @description 释放资源,将引用资源的属性置空。
  32896. */
  32897. BuffersAnalystJobsParameter_createClass(BuffersAnalystJobsParameter, [{
  32898. key: "destroy",
  32899. value: function destroy() {
  32900. this.datasetName = null;
  32901. this.bounds = null;
  32902. this.distance = null;
  32903. this.distanceField = null;
  32904. this.distanceUnit = null;
  32905. this.dissolveField = null;
  32906. if (this.output instanceof OutputSetting) {
  32907. this.output.destroy();
  32908. this.output = null;
  32909. }
  32910. if (this.mappingParameters instanceof MappingParameters) {
  32911. this.mappingParameters.destroy();
  32912. this.mappingParameters = null;
  32913. }
  32914. }
  32915. /**
  32916. * @function BuffersAnalystJobsParameter.toObject
  32917. * @param {BuffersAnalystJobsParameter} BuffersAnalystJobsParameter - 缓冲区分析任务参数。
  32918. * @param {Object} tempObj - 目标对象。
  32919. * @description 生成缓冲区分析任务对象。
  32920. */
  32921. }], [{
  32922. key: "toObject",
  32923. value: function toObject(_BuffersAnalystJobsParameter, tempObj) {
  32924. for (var name in _BuffersAnalystJobsParameter) {
  32925. if (name === 'datasetName') {
  32926. tempObj['input'] = tempObj['input'] || {};
  32927. tempObj['input'][name] = _BuffersAnalystJobsParameter[name];
  32928. continue;
  32929. }
  32930. if (name === 'output') {
  32931. tempObj['output'] = tempObj['output'] || {};
  32932. tempObj['output'] = _BuffersAnalystJobsParameter[name];
  32933. continue;
  32934. }
  32935. tempObj['analyst'] = tempObj['analyst'] || {};
  32936. if (name === 'bounds' && _BuffersAnalystJobsParameter[name]) {
  32937. tempObj['analyst'][name] = _BuffersAnalystJobsParameter[name].toBBOX();
  32938. } else {
  32939. tempObj['analyst'][name] = _BuffersAnalystJobsParameter[name];
  32940. }
  32941. if (name === 'mappingParameters') {
  32942. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  32943. tempObj['analyst']['mappingParameters'] = _BuffersAnalystJobsParameter[name];
  32944. }
  32945. }
  32946. }
  32947. }]);
  32948. return BuffersAnalystJobsParameter;
  32949. }();
  32950. ;// CONCATENATED MODULE: ./src/common/iServer/ProcessingServiceBase.js
  32951. function ProcessingServiceBase_typeof(obj) { "@babel/helpers - typeof"; return ProcessingServiceBase_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ProcessingServiceBase_typeof(obj); }
  32952. function ProcessingServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32953. function ProcessingServiceBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  32954. function ProcessingServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) ProcessingServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) ProcessingServiceBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  32955. function ProcessingServiceBase_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ProcessingServiceBase_get = Reflect.get.bind(); } else { ProcessingServiceBase_get = function _get(target, property, receiver) { var base = ProcessingServiceBase_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ProcessingServiceBase_get.apply(this, arguments); }
  32956. function ProcessingServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ProcessingServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
  32957. function ProcessingServiceBase_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ProcessingServiceBase_setPrototypeOf(subClass, superClass); }
  32958. function ProcessingServiceBase_setPrototypeOf(o, p) { ProcessingServiceBase_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ProcessingServiceBase_setPrototypeOf(o, p); }
  32959. function ProcessingServiceBase_createSuper(Derived) { var hasNativeReflectConstruct = ProcessingServiceBase_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ProcessingServiceBase_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ProcessingServiceBase_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ProcessingServiceBase_possibleConstructorReturn(this, result); }; }
  32960. function ProcessingServiceBase_possibleConstructorReturn(self, call) { if (call && (ProcessingServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ProcessingServiceBase_assertThisInitialized(self); }
  32961. function ProcessingServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32962. function ProcessingServiceBase_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  32963. function ProcessingServiceBase_getPrototypeOf(o) { ProcessingServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ProcessingServiceBase_getPrototypeOf(o); }
  32964. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32965. * This program are made available under the terms of the Apache License, Version 2.0
  32966. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32967. /**
  32968. * @class ProcessingServiceBase
  32969. * @deprecatedclass SuperMap.ProcessingServiceBase
  32970. * @category iServer Core
  32971. * @classdesc 分布式分析服务基类
  32972. * @extends {CommonServiceBase}
  32973. * @param {string} url - 服务地址。
  32974. * @param {Object} options - 参数。
  32975. * @param {Events} options.events - 处理所有事件的对象。
  32976. * @param {number} options.index - 服务访问地址在数组中的位置。
  32977. * @param {number} options.length - 服务访问地址数组长度。
  32978. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  32979. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32980. * @param {Object} [options.headers] - 请求头。
  32981. * @usage
  32982. */
  32983. var ProcessingServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
  32984. ProcessingServiceBase_inherits(ProcessingServiceBase, _CommonServiceBase);
  32985. var _super = ProcessingServiceBase_createSuper(ProcessingServiceBase);
  32986. function ProcessingServiceBase(url, options) {
  32987. var _this;
  32988. ProcessingServiceBase_classCallCheck(this, ProcessingServiceBase);
  32989. options = options || {};
  32990. /*
  32991. * Constant: EVENT_TYPES
  32992. * {Array.<string>}
  32993. * 此类支持的事件类型
  32994. * - *processCompleted* 创建成功后触发的事件。
  32995. * - *processFailed* 创建失败后触发的事件 。
  32996. * - *processRunning* 创建过程的整个阶段都会触发的事件,用于获取创建过程的状态 。
  32997. */
  32998. options.EVENT_TYPES = ["processCompleted", "processFailed", "processRunning"];
  32999. _this = _super.call(this, url, options);
  33000. _this.CLASS_NAME = "SuperMap.ProcessingServiceBase";
  33001. return _this;
  33002. }
  33003. /**
  33004. * @function ProcessingServiceBase.prototype.destroy
  33005. * @override
  33006. */
  33007. ProcessingServiceBase_createClass(ProcessingServiceBase, [{
  33008. key: "destroy",
  33009. value: function destroy() {
  33010. ProcessingServiceBase_get(ProcessingServiceBase_getPrototypeOf(ProcessingServiceBase.prototype), "destroy", this).call(this);
  33011. }
  33012. /**
  33013. * @function ProcessingServiceBase.prototype.getJobs
  33014. * @description 获取分布式分析任务。
  33015. * @param {string} url - 资源地址。
  33016. */
  33017. }, {
  33018. key: "getJobs",
  33019. value: function getJobs(url) {
  33020. var me = this;
  33021. FetchRequest.get(SecurityManager.appendCredential(url), null, {
  33022. proxy: me.proxy
  33023. }).then(function (response) {
  33024. return response.json();
  33025. }).then(function (result) {
  33026. me.events.triggerEvent("processCompleted", {
  33027. result: result
  33028. });
  33029. })["catch"](function (e) {
  33030. me.eventListeners.processFailed({
  33031. error: e
  33032. });
  33033. });
  33034. }
  33035. /**
  33036. * @function ProcessingServiceBase.prototype.addJob
  33037. * @description 添加分布式分析任务。
  33038. * @param {string} url - 资源根地址。
  33039. * @param {Object} params - 创建一个空间分析的请求参数。
  33040. * @param {string} paramType - 请求参数类型。
  33041. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  33042. */
  33043. }, {
  33044. key: "addJob",
  33045. value: function addJob(url, params, paramType, seconds) {
  33046. var me = this,
  33047. parameterObject = null;
  33048. if (params && params instanceof paramType) {
  33049. parameterObject = new Object();
  33050. paramType.toObject(params, parameterObject);
  33051. }
  33052. var headers = Object.assign({
  33053. 'Content-Type': 'application/x-www-form-urlencoded'
  33054. }, me.headers || {});
  33055. var options = {
  33056. proxy: me.proxy,
  33057. headers: headers,
  33058. withCredentials: me.withCredentials,
  33059. crossOrigin: me.crossOrigin,
  33060. isInTheSameDomain: me.isInTheSameDomain
  33061. };
  33062. FetchRequest.post(SecurityManager.appendCredential(url), JSON.stringify(parameterObject), options).then(function (response) {
  33063. return response.json();
  33064. }).then(function (result) {
  33065. if (result.succeed) {
  33066. me.serviceProcessCompleted(result, seconds);
  33067. } else {
  33068. me.serviceProcessFailed(result);
  33069. }
  33070. })["catch"](function (e) {
  33071. me.serviceProcessFailed({
  33072. error: e
  33073. });
  33074. });
  33075. }
  33076. }, {
  33077. key: "serviceProcessCompleted",
  33078. value: function serviceProcessCompleted(result, seconds) {
  33079. result = Util_Util.transformResult(result);
  33080. seconds = seconds || 1000;
  33081. var me = this;
  33082. if (result) {
  33083. var id = setInterval(function () {
  33084. FetchRequest.get(SecurityManager.appendCredential(result.newResourceLocation), {
  33085. _t: new Date().getTime()
  33086. }).then(function (response) {
  33087. return response.json();
  33088. }).then(function (job) {
  33089. me.events.triggerEvent("processRunning", {
  33090. id: job.id,
  33091. state: job.state
  33092. });
  33093. if (job.state.runState === 'LOST' || job.state.runState === 'KILLED' || job.state.runState === 'FAILED') {
  33094. clearInterval(id);
  33095. me.events.triggerEvent("processFailed", {
  33096. error: job.state.errorMsg,
  33097. state: job.state.runState
  33098. });
  33099. }
  33100. if (job.state.runState === 'FINISHED' && job.setting.serviceInfo) {
  33101. clearInterval(id);
  33102. me.events.triggerEvent("processCompleted", {
  33103. result: job
  33104. });
  33105. }
  33106. })["catch"](function (e) {
  33107. clearInterval(id);
  33108. me.events.triggerEvent("processFailed", {
  33109. error: e
  33110. });
  33111. });
  33112. }, seconds);
  33113. }
  33114. }
  33115. }, {
  33116. key: "serviceProcessFailed",
  33117. value: function serviceProcessFailed(result) {
  33118. ProcessingServiceBase_get(ProcessingServiceBase_getPrototypeOf(ProcessingServiceBase.prototype), "serviceProcessFailed", this).call(this, result);
  33119. }
  33120. }]);
  33121. return ProcessingServiceBase;
  33122. }(CommonServiceBase);
  33123. ;// CONCATENATED MODULE: ./src/common/iServer/BuffersAnalystJobsService.js
  33124. function BuffersAnalystJobsService_typeof(obj) { "@babel/helpers - typeof"; return BuffersAnalystJobsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, BuffersAnalystJobsService_typeof(obj); }
  33125. function BuffersAnalystJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33126. function BuffersAnalystJobsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  33127. function BuffersAnalystJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) BuffersAnalystJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) BuffersAnalystJobsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  33128. function BuffersAnalystJobsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { BuffersAnalystJobsService_get = Reflect.get.bind(); } else { BuffersAnalystJobsService_get = function _get(target, property, receiver) { var base = BuffersAnalystJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return BuffersAnalystJobsService_get.apply(this, arguments); }
  33129. function BuffersAnalystJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = BuffersAnalystJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  33130. function BuffersAnalystJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) BuffersAnalystJobsService_setPrototypeOf(subClass, superClass); }
  33131. function BuffersAnalystJobsService_setPrototypeOf(o, p) { BuffersAnalystJobsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return BuffersAnalystJobsService_setPrototypeOf(o, p); }
  33132. function BuffersAnalystJobsService_createSuper(Derived) { var hasNativeReflectConstruct = BuffersAnalystJobsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = BuffersAnalystJobsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = BuffersAnalystJobsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return BuffersAnalystJobsService_possibleConstructorReturn(this, result); }; }
  33133. function BuffersAnalystJobsService_possibleConstructorReturn(self, call) { if (call && (BuffersAnalystJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return BuffersAnalystJobsService_assertThisInitialized(self); }
  33134. function BuffersAnalystJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33135. function BuffersAnalystJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  33136. function BuffersAnalystJobsService_getPrototypeOf(o) { BuffersAnalystJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BuffersAnalystJobsService_getPrototypeOf(o); }
  33137. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33138. * This program are made available under the terms of the Apache License, Version 2.0
  33139. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33140. /**
  33141. * @class BuffersAnalystJobsService
  33142. * @deprecatedclass SuperMap.BuffersAnalystJobsService
  33143. * @category iServer ProcessingService BufferAnalyst
  33144. * @classdesc 缓冲区分析服务类。
  33145. * @extends {ProcessingServiceBase}
  33146. * @param {string} url - 服务地址。
  33147. * @param {Object} options - 参数。
  33148. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33149. * @param {Object} [options.headers] - 请求头。
  33150. * @usage
  33151. */
  33152. var BuffersAnalystJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  33153. BuffersAnalystJobsService_inherits(BuffersAnalystJobsService, _ProcessingServiceBas);
  33154. var _super = BuffersAnalystJobsService_createSuper(BuffersAnalystJobsService);
  33155. function BuffersAnalystJobsService(url, options) {
  33156. var _this;
  33157. BuffersAnalystJobsService_classCallCheck(this, BuffersAnalystJobsService);
  33158. _this = _super.call(this, url, options);
  33159. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/buffers');
  33160. _this.CLASS_NAME = 'SuperMap.BuffersAnalystJobsService';
  33161. return _this;
  33162. }
  33163. /**
  33164. *@override
  33165. */
  33166. BuffersAnalystJobsService_createClass(BuffersAnalystJobsService, [{
  33167. key: "destroy",
  33168. value: function destroy() {
  33169. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "destroy", this).call(this);
  33170. }
  33171. /**
  33172. * @function BuffersAnalystJobsService.prototype.getBufferJobs
  33173. * @description 获取缓冲区分析所有任务
  33174. */
  33175. }, {
  33176. key: "getBuffersJobs",
  33177. value: function getBuffersJobs() {
  33178. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "getJobs", this).call(this, this.url);
  33179. }
  33180. /**
  33181. * @function BuffersAnalystJobsService.prototype.getBufferJob
  33182. * @description 获取指定id的缓冲区分析服务
  33183. * @param {string} id - 指定要获取数据的id。
  33184. */
  33185. }, {
  33186. key: "getBuffersJob",
  33187. value: function getBuffersJob(id) {
  33188. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  33189. }
  33190. /**
  33191. * @function BuffersAnalystJobsService.prototype.addBufferJob
  33192. * @description 新建缓冲区分析服务
  33193. * @param {BuffersAnalystJobsParameter} params - 创建一个空间分析的请求参数。
  33194. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  33195. */
  33196. }, {
  33197. key: "addBuffersJob",
  33198. value: function addBuffersJob(params, seconds) {
  33199. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "addJob", this).call(this, this.url, params, BuffersAnalystJobsParameter, seconds);
  33200. }
  33201. }]);
  33202. return BuffersAnalystJobsService;
  33203. }(ProcessingServiceBase);
  33204. ;// CONCATENATED MODULE: ./src/common/iServer/BurstPipelineAnalystParameters.js
  33205. function BurstPipelineAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33206. function BurstPipelineAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  33207. function BurstPipelineAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) BurstPipelineAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) BurstPipelineAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  33208. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33209. * This program are made available under the terms of the Apache License, Version 2.0
  33210. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33211. /**
  33212. * @class BurstPipelineAnalystParameters
  33213. * @deprecatedclass SuperMap.BurstPipelineAnalystParameters
  33214. * @category iServer NetworkAnalyst BurstAnalyse
  33215. * @classdesc 爆管分析参数类。
  33216. * @param {Object} options - 参数。
  33217. * @param {Array.<number>} options.sourceNodeIDs - 指定的设施点 ID 数组。
  33218. * @param {number} [options.edgeID] - 指定的弧段ID,edgeID 与 nodeID 必须指定一个。
  33219. * @param {number} [options.nodeID] - 指定的结点ID,edgeID 与 nodeID 必须指定一个。
  33220. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。
  33221. * @usage
  33222. */
  33223. var BurstPipelineAnalystParameters = /*#__PURE__*/function () {
  33224. function BurstPipelineAnalystParameters(options) {
  33225. BurstPipelineAnalystParameters_classCallCheck(this, BurstPipelineAnalystParameters);
  33226. var me = this;
  33227. /**
  33228. * @member {Array.<number>} BurstPipelineAnalystParameters.prototype.sourceNodeIDs
  33229. * @description 指定的设施点 ID 数组。
  33230. */
  33231. this.sourceNodeIDs = null;
  33232. /**
  33233. * @member {number} [BurstPipelineAnalystParameters.prototype.edgeID]
  33234. * @description 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  33235. */
  33236. this.edgeID = null;
  33237. /**
  33238. * @member {number} [BurstPipelineAnalystParameters.prototype.nodeID]
  33239. * @description 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  33240. */
  33241. this.nodeID = null;
  33242. /**
  33243. * @member {boolean} [BurstPipelineAnalystParameters.prototype.isUncertainDirectionValid=false]
  33244. * @description 指定不确定流向是否有效。
  33245. * 指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行。
  33246. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  33247. */
  33248. this.isUncertainDirectionValid = false;
  33249. Util_Util.extend(me, options);
  33250. this.CLASS_NAME = "SuperMap.BurstPipelineAnalystParameters";
  33251. }
  33252. /**
  33253. * @function BurstPipelineAnalystParameters.prototype.destroy
  33254. * @description 释放资源,将引用资源的属性置空。
  33255. */
  33256. BurstPipelineAnalystParameters_createClass(BurstPipelineAnalystParameters, [{
  33257. key: "destroy",
  33258. value: function destroy() {
  33259. var me = this;
  33260. me.sourceNodeIDs = null;
  33261. me.edgeID = null;
  33262. me.nodeID = null;
  33263. me.isUncertainDirectionValid = null;
  33264. }
  33265. }]);
  33266. return BurstPipelineAnalystParameters;
  33267. }();
  33268. ;// CONCATENATED MODULE: ./src/common/iServer/NetworkAnalystServiceBase.js
  33269. function NetworkAnalystServiceBase_typeof(obj) { "@babel/helpers - typeof"; return NetworkAnalystServiceBase_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, NetworkAnalystServiceBase_typeof(obj); }
  33270. function NetworkAnalystServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33271. function NetworkAnalystServiceBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  33272. function NetworkAnalystServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) NetworkAnalystServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) NetworkAnalystServiceBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  33273. function NetworkAnalystServiceBase_get() { if (typeof Reflect !== "undefined" && Reflect.get) { NetworkAnalystServiceBase_get = Reflect.get.bind(); } else { NetworkAnalystServiceBase_get = function _get(target, property, receiver) { var base = NetworkAnalystServiceBase_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return NetworkAnalystServiceBase_get.apply(this, arguments); }
  33274. function NetworkAnalystServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = NetworkAnalystServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
  33275. function NetworkAnalystServiceBase_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) NetworkAnalystServiceBase_setPrototypeOf(subClass, superClass); }
  33276. function NetworkAnalystServiceBase_setPrototypeOf(o, p) { NetworkAnalystServiceBase_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NetworkAnalystServiceBase_setPrototypeOf(o, p); }
  33277. function NetworkAnalystServiceBase_createSuper(Derived) { var hasNativeReflectConstruct = NetworkAnalystServiceBase_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = NetworkAnalystServiceBase_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = NetworkAnalystServiceBase_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return NetworkAnalystServiceBase_possibleConstructorReturn(this, result); }; }
  33278. function NetworkAnalystServiceBase_possibleConstructorReturn(self, call) { if (call && (NetworkAnalystServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return NetworkAnalystServiceBase_assertThisInitialized(self); }
  33279. function NetworkAnalystServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33280. function NetworkAnalystServiceBase_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  33281. function NetworkAnalystServiceBase_getPrototypeOf(o) { NetworkAnalystServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NetworkAnalystServiceBase_getPrototypeOf(o); }
  33282. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33283. * This program are made available under the terms of the Apache License, Version 2.0
  33284. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33285. /**
  33286. * @class NetworkAnalystServiceBase
  33287. * @deprecatedclass SuperMap.NetworkAnalystServiceBase
  33288. * @category iServer Core
  33289. * @classdesc 网络分析服务基类。
  33290. * @extends {CommonServiceBase}
  33291. * @param {string} url - 服务地址。
  33292. * @param {Object} options - 可选参数。
  33293. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33294. * @param {Object} [options.headers] - 请求头。
  33295. * @usage
  33296. */
  33297. var NetworkAnalystServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
  33298. NetworkAnalystServiceBase_inherits(NetworkAnalystServiceBase, _CommonServiceBase);
  33299. var _super = NetworkAnalystServiceBase_createSuper(NetworkAnalystServiceBase);
  33300. function NetworkAnalystServiceBase(url, options) {
  33301. var _this;
  33302. NetworkAnalystServiceBase_classCallCheck(this, NetworkAnalystServiceBase);
  33303. _this = _super.call(this, url, options);
  33304. /**
  33305. * @member {DataFormat} [NetworkAnalystServiceBase.prototype.format=DataFormat.GEOJSON]
  33306. * @description 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式,参数格式为 "ISERVER","GEOJSON"
  33307. */
  33308. _this.format = DataFormat.GEOJSON;
  33309. _this.CLASS_NAME = "SuperMap.NetworkAnalystServiceBase";
  33310. return _this;
  33311. }
  33312. /**
  33313. * @function NetworkAnalystServiceBase.prototype.destroy
  33314. * @description 释放资源,将引用的资源属性置空。
  33315. */
  33316. NetworkAnalystServiceBase_createClass(NetworkAnalystServiceBase, [{
  33317. key: "destroy",
  33318. value: function destroy() {
  33319. NetworkAnalystServiceBase_get(NetworkAnalystServiceBase_getPrototypeOf(NetworkAnalystServiceBase.prototype), "destroy", this).call(this);
  33320. this.format = null;
  33321. }
  33322. /**
  33323. * @function NetworkAnalystServiceBase.prototype.serviceProcessCompleted
  33324. * @description 分析完成,执行此方法。
  33325. * @param {Object} result - 服务器返回的结果对象。
  33326. */
  33327. }, {
  33328. key: "serviceProcessCompleted",
  33329. value: function serviceProcessCompleted(result, options) {
  33330. var me = this,
  33331. analystResult;
  33332. result = Util_Util.transformResult(result);
  33333. if (result && me.format === DataFormat.GEOJSON && typeof me.toGeoJSONResult === 'function') {
  33334. analystResult = me.toGeoJSONResult(result);
  33335. }
  33336. if (!analystResult) {
  33337. analystResult = result;
  33338. }
  33339. me.events.triggerEvent("processCompleted", {
  33340. result: analystResult,
  33341. options: options
  33342. });
  33343. }
  33344. /**
  33345. * @function NetworkAnalystServiceBase.prototype.toGeoJSONResult
  33346. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。只处理结果中的路由,由子类实现。
  33347. * @param {Object} result - 服务器返回的结果对象。
  33348. * @returns {GeoJSONObject} GeoJSON 对象。
  33349. */
  33350. }, {
  33351. key: "toGeoJSONResult",
  33352. value: function toGeoJSONResult(result) {
  33353. // eslint-disable-line no-unused-vars
  33354. return null;
  33355. }
  33356. }]);
  33357. return NetworkAnalystServiceBase;
  33358. }(CommonServiceBase);
  33359. ;// CONCATENATED MODULE: ./src/common/iServer/BurstPipelineAnalystService.js
  33360. function BurstPipelineAnalystService_typeof(obj) { "@babel/helpers - typeof"; return BurstPipelineAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, BurstPipelineAnalystService_typeof(obj); }
  33361. function BurstPipelineAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33362. function BurstPipelineAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  33363. function BurstPipelineAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) BurstPipelineAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) BurstPipelineAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  33364. function BurstPipelineAnalystService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { BurstPipelineAnalystService_get = Reflect.get.bind(); } else { BurstPipelineAnalystService_get = function _get(target, property, receiver) { var base = BurstPipelineAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return BurstPipelineAnalystService_get.apply(this, arguments); }
  33365. function BurstPipelineAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = BurstPipelineAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  33366. function BurstPipelineAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) BurstPipelineAnalystService_setPrototypeOf(subClass, superClass); }
  33367. function BurstPipelineAnalystService_setPrototypeOf(o, p) { BurstPipelineAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return BurstPipelineAnalystService_setPrototypeOf(o, p); }
  33368. function BurstPipelineAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = BurstPipelineAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = BurstPipelineAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = BurstPipelineAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return BurstPipelineAnalystService_possibleConstructorReturn(this, result); }; }
  33369. function BurstPipelineAnalystService_possibleConstructorReturn(self, call) { if (call && (BurstPipelineAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return BurstPipelineAnalystService_assertThisInitialized(self); }
  33370. function BurstPipelineAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33371. function BurstPipelineAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  33372. function BurstPipelineAnalystService_getPrototypeOf(o) { BurstPipelineAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BurstPipelineAnalystService_getPrototypeOf(o); }
  33373. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33374. * This program are made available under the terms of the Apache License, Version 2.0
  33375. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33376. /**
  33377. * @class BurstPipelineAnalystService
  33378. * @deprecatedclass SuperMap.BurstPipelineAnalystService
  33379. * @category iServer NetworkAnalyst BurstAnalyse
  33380. * @classdesc 爆管分析服务类。即将给定弧段或节点作为爆管点来进行分析,返回关键结点 ID 数组、普通结点 ID 数组及其上下游弧段 ID 数组。
  33381. * @extends {NetworkAnalystServiceBase}
  33382. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  33383. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源},
  33384. * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet"。
  33385. * @param {Object} options - 参数。
  33386. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  33387. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33388. * @param {Object} [options.headers] - 请求头。
  33389. * @usage
  33390. */
  33391. var BurstPipelineAnalystService = /*#__PURE__*/function (_NetworkAnalystServic) {
  33392. BurstPipelineAnalystService_inherits(BurstPipelineAnalystService, _NetworkAnalystServic);
  33393. var _super = BurstPipelineAnalystService_createSuper(BurstPipelineAnalystService);
  33394. function BurstPipelineAnalystService(url, options) {
  33395. var _this;
  33396. BurstPipelineAnalystService_classCallCheck(this, BurstPipelineAnalystService);
  33397. _this = _super.call(this, url, options);
  33398. _this.CLASS_NAME = "SuperMap.BurstPipelineAnalystService";
  33399. return _this;
  33400. }
  33401. /**
  33402. * @function BurstPipelineAnalystService.prototype.destroy
  33403. * @override
  33404. */
  33405. BurstPipelineAnalystService_createClass(BurstPipelineAnalystService, [{
  33406. key: "destroy",
  33407. value: function destroy() {
  33408. BurstPipelineAnalystService_get(BurstPipelineAnalystService_getPrototypeOf(BurstPipelineAnalystService.prototype), "destroy", this).call(this);
  33409. }
  33410. /**
  33411. * @function BurstPipelineAnalystService.prototype.processAsync
  33412. * @description 负责将客户端的查询参数传递到服务端。
  33413. * @params {BurstPipelineAnalystParameters} params - 爆管分析参数类
  33414. */
  33415. }, {
  33416. key: "processAsync",
  33417. value: function processAsync(params) {
  33418. if (!(params instanceof BurstPipelineAnalystParameters)) {
  33419. return null;
  33420. }
  33421. var me = this,
  33422. jsonObject;
  33423. me.url = Util_Util.urlPathAppend(me.url, 'burstAnalyse');
  33424. jsonObject = {
  33425. sourceNodeIDs: params.sourceNodeIDs,
  33426. isUncertainDirectionValid: params.isUncertainDirectionValid
  33427. };
  33428. //必传参数不正确,就终止
  33429. if (params.edgeID !== null && params.nodeID !== null) {
  33430. throw new Error('edgeID and nodeID cannot be null at the same time.');
  33431. }
  33432. if (params.edgeID === null && params.nodeID === null) {
  33433. throw new Error('edgeID and nodeID cannot be null at the same time.');
  33434. }
  33435. if (params.edgeID !== null) {
  33436. jsonObject.edgeID = params.edgeID;
  33437. } else {
  33438. jsonObject.nodeID = params.nodeID;
  33439. }
  33440. me.request({
  33441. method: "GET",
  33442. params: jsonObject,
  33443. scope: me,
  33444. success: me.serviceProcessCompleted,
  33445. failure: me.serviceProcessFailed
  33446. });
  33447. }
  33448. }]);
  33449. return BurstPipelineAnalystService;
  33450. }(NetworkAnalystServiceBase);
  33451. ;// CONCATENATED MODULE: ./src/common/iServer/ChartFeatureInfoSpecsService.js
  33452. function ChartFeatureInfoSpecsService_typeof(obj) { "@babel/helpers - typeof"; return ChartFeatureInfoSpecsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ChartFeatureInfoSpecsService_typeof(obj); }
  33453. function ChartFeatureInfoSpecsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33454. function ChartFeatureInfoSpecsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  33455. function ChartFeatureInfoSpecsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartFeatureInfoSpecsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartFeatureInfoSpecsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  33456. function ChartFeatureInfoSpecsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ChartFeatureInfoSpecsService_get = Reflect.get.bind(); } else { ChartFeatureInfoSpecsService_get = function _get(target, property, receiver) { var base = ChartFeatureInfoSpecsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ChartFeatureInfoSpecsService_get.apply(this, arguments); }
  33457. function ChartFeatureInfoSpecsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ChartFeatureInfoSpecsService_getPrototypeOf(object); if (object === null) break; } return object; }
  33458. function ChartFeatureInfoSpecsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ChartFeatureInfoSpecsService_setPrototypeOf(subClass, superClass); }
  33459. function ChartFeatureInfoSpecsService_setPrototypeOf(o, p) { ChartFeatureInfoSpecsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ChartFeatureInfoSpecsService_setPrototypeOf(o, p); }
  33460. function ChartFeatureInfoSpecsService_createSuper(Derived) { var hasNativeReflectConstruct = ChartFeatureInfoSpecsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ChartFeatureInfoSpecsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ChartFeatureInfoSpecsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ChartFeatureInfoSpecsService_possibleConstructorReturn(this, result); }; }
  33461. function ChartFeatureInfoSpecsService_possibleConstructorReturn(self, call) { if (call && (ChartFeatureInfoSpecsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ChartFeatureInfoSpecsService_assertThisInitialized(self); }
  33462. function ChartFeatureInfoSpecsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33463. function ChartFeatureInfoSpecsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  33464. function ChartFeatureInfoSpecsService_getPrototypeOf(o) { ChartFeatureInfoSpecsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ChartFeatureInfoSpecsService_getPrototypeOf(o); }
  33465. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33466. * This program are made available under the terms of the Apache License, Version 2.0
  33467. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33468. /**
  33469. * @class ChartFeatureInfoSpecsService
  33470. * @deprecatedclass SuperMap.ChartFeatureInfoSpecsService
  33471. * @category iServer Map Chart
  33472. * @classdesc 海图物标信息服务类,通过该服务类可以查询到服务端支持的所有海图物标信息。
  33473. * 用户可以通过两种方式获取查询结果:
  33474. * 一种是通过监听 ChartFeatureInfoSpecsEvent.PROCESS_COMPLETE 事件;
  33475. * 另一种是使用 AsyncResponder 类实现异步处理。
  33476. * @extends {CommonServiceBase}
  33477. * @param {string} url - 地图(特指海图)服务地址。
  33478. * 如:"http://localhost:8090/iserver/services/map-ChartW/rest/maps/海图"。
  33479. * 发送请求格式类似于:"http://localhost:8090/iserver/services/map-ChartW/rest/maps/海图/chartFeatureInfoSpecs.json"。
  33480. * @param {Object} options - 参数。
  33481. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  33482. * @param {DataFormat} [options.format] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式,参数格式为"ISERVER","GEOJSON"。
  33483. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33484. * @param {Object} [options.headers] - 请求头。
  33485. * @usage
  33486. */
  33487. var ChartFeatureInfoSpecsService = /*#__PURE__*/function (_CommonServiceBase) {
  33488. ChartFeatureInfoSpecsService_inherits(ChartFeatureInfoSpecsService, _CommonServiceBase);
  33489. var _super = ChartFeatureInfoSpecsService_createSuper(ChartFeatureInfoSpecsService);
  33490. function ChartFeatureInfoSpecsService(url, options) {
  33491. var _this;
  33492. ChartFeatureInfoSpecsService_classCallCheck(this, ChartFeatureInfoSpecsService);
  33493. _this = _super.call(this, url, options);
  33494. _this.CLASS_NAME = "SuperMap.ChartFeatureInfoSpecsService";
  33495. return _this;
  33496. }
  33497. /**
  33498. * @function ChartFeatureInfoSpecsService.prototype.destroy
  33499. * @override
  33500. */
  33501. ChartFeatureInfoSpecsService_createClass(ChartFeatureInfoSpecsService, [{
  33502. key: "destroy",
  33503. value: function destroy() {
  33504. ChartFeatureInfoSpecsService_get(ChartFeatureInfoSpecsService_getPrototypeOf(ChartFeatureInfoSpecsService.prototype), "destroy", this).call(this);
  33505. Util_Util.reset(this);
  33506. }
  33507. /**
  33508. * @function ChartFeatureInfoSpecsService.prototype.processAsync
  33509. * @description 根据地图(特指海图)服务地址与服务端完成异步通讯,获取物标信息。
  33510. * 当查询物标信息成功时,将触发 ChartFeatureInfoSpecsEvent.PROCESS_COMPLETE
  33511. * 事件。用可以通过户两种方式获取图层信息:
  33512. * 1. 通过 AsyncResponder 类获取(推荐使用);
  33513. * 2. 通过监听 ChartFeatureInfoSpecsEvent.PROCESS_COMPLETE 事件获取。
  33514. */
  33515. }, {
  33516. key: "processAsync",
  33517. value: function processAsync() {
  33518. var me = this,
  33519. method = "GET";
  33520. if (!me.isTempLayers) {
  33521. Util_Util.urlPathAppend(me.url, 'chartFeatureInfoSpecs');
  33522. }
  33523. me.request({
  33524. method: method,
  33525. params: null,
  33526. scope: me,
  33527. success: me.serviceProcessCompleted,
  33528. failure: me.serviceProcessFailed
  33529. });
  33530. }
  33531. }]);
  33532. return ChartFeatureInfoSpecsService;
  33533. }(CommonServiceBase);
  33534. ;// CONCATENATED MODULE: ./src/common/iServer/ChartQueryFilterParameter.js
  33535. function ChartQueryFilterParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33536. function ChartQueryFilterParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  33537. function ChartQueryFilterParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartQueryFilterParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartQueryFilterParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  33538. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33539. * This program are made available under the terms of the Apache License, Version 2.0
  33540. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33541. /**
  33542. * @class ChartQueryFilterParameter
  33543. * @deprecatedclass SuperMap.ChartQueryFilterParameter
  33544. * @category iServer Map Chart
  33545. * @classdesc 海图查询过滤参数类,用于设置海图查询的过滤参数。包括:物标代码、物标可应用对象的选择(是否查询点、线或面)、属性字段过滤条件。
  33546. * @param {Object} options - 参数。
  33547. * @param {string} options.attributeFilter - 属性字段过滤条件。
  33548. * @param {number} options.chartFeatureInfoSpecCode - 查询的物标代号。
  33549. * @param {boolean} [options.isQueryPoint] - 是否查询点。
  33550. * @param {boolean} [options.isQueryLine] - 是否查询线。
  33551. * @param {boolean} [options.isQueryRegion] - 是否查询面。
  33552. * @usage
  33553. */
  33554. var ChartQueryFilterParameter = /*#__PURE__*/function () {
  33555. function ChartQueryFilterParameter(options) {
  33556. ChartQueryFilterParameter_classCallCheck(this, ChartQueryFilterParameter);
  33557. /**
  33558. * @member {boolean} [ChartQueryFilterParameter.prototype.isQueryPoint]
  33559. * @description 是否查询点。
  33560. */
  33561. this.isQueryPoint = null;
  33562. /**
  33563. * @member {boolean} [ChartQueryFilterParameter.prototype.isQueryLine]
  33564. * @description 是否查询线。
  33565. */
  33566. this.isQueryLine = null;
  33567. /**
  33568. * @member {boolean} [ChartQueryFilterParameter.prototype.isQueryRegion]
  33569. * @description 是否查询面。
  33570. */
  33571. this.isQueryRegion = null;
  33572. /**
  33573. * @member {string} ChartQueryFilterParameter.prototype.attributeFilter
  33574. * @description 属性字段过滤条件。
  33575. */
  33576. this.attributeFilter = null;
  33577. /**
  33578. * @member {number} ChartQueryFilterParameter.prototype.chartFeatureInfoSpecCode
  33579. * @description 查询的物标代号。
  33580. */
  33581. this.chartFeatureInfoSpecCode = null;
  33582. Util_Util.extend(this, options);
  33583. this.CLASS_NAME = "SuperMap.ChartQueryFilterParameter";
  33584. }
  33585. /**
  33586. * @function ChartQueryFilterParameter.prototype.destroy
  33587. * @description 释放资源,将引用资源的属性置空。
  33588. */
  33589. ChartQueryFilterParameter_createClass(ChartQueryFilterParameter, [{
  33590. key: "destroy",
  33591. value: function destroy() {
  33592. var me = this;
  33593. me.isQueryPoint = null;
  33594. me.isQueryLine = null;
  33595. me.isQueryRegion = null;
  33596. me.attributeFilter = null;
  33597. me.chartFeatureInfoSpecCode = null;
  33598. }
  33599. /**
  33600. * @function ChartQueryFilterParameter.prototype.toJson
  33601. * @description 将属性信息转化成 JSON 格式字符串。
  33602. */
  33603. }, {
  33604. key: "toJson",
  33605. value: function toJson() {
  33606. var json = "";
  33607. json += "\"isQueryPoint\":" + this.isQueryPoint + ",";
  33608. json += "\"isQueryLine\":" + this.isQueryLine + ",";
  33609. json += "\"isQueryRegion\":" + this.isQueryRegion + ",";
  33610. if (this.attributeFilter) {
  33611. json += "\"attributeFilter\": \"" + this.attributeFilter + "\",";
  33612. }
  33613. json += "\"chartFeatureInfoSpecCode\":" + this.chartFeatureInfoSpecCode;
  33614. json = "{" + json + "}";
  33615. return json;
  33616. }
  33617. }]);
  33618. return ChartQueryFilterParameter;
  33619. }();
  33620. ;// CONCATENATED MODULE: ./src/common/iServer/ChartQueryParameters.js
  33621. function ChartQueryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33622. function ChartQueryParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  33623. function ChartQueryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartQueryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartQueryParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  33624. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33625. * This program are made available under the terms of the Apache License, Version 2.0
  33626. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33627. /**
  33628. * @class ChartQueryParameters
  33629. * @deprecatedclass SuperMap.ChartQueryParameters
  33630. * @category iServer Map Chart
  33631. * @classdesc 海图查询参数类,该类用于设置海图查询时的相关参数,海图查询分为海图属性查询和海图范围查询两类,通过属性 queryMode 指定查询模式。
  33632. * 必设属性有:queryMode、chartLayerNames、chartQueryFilterParameters。当进行海图范围查询时,必设属性还包括 bounds。
  33633. * @param {Object} options - 参数。
  33634. * @param {string} options.queryMode - 海图查询模式类型,支持两种查询方式:海图属性查询("ChartAttributeQuery")和海图空间查询("ChartBoundsQuery")。
  33635. * @param {Array.<string>} options.chartLayerNames - 查询的海图图层的名称。
  33636. * @param {Array.<ChartQueryFilterParameter>} options.chartQueryFilterParameters - 海图查询过滤参数。包括:物标代码、物标可应用对象的选择(是否查询点、线或面)、属性字段过滤条件。
  33637. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 海图查询范围。当进行海图范围查询时,此为必选参数。
  33638. * @param {boolean} [options.returnContent=true] - 获取或设置是返回查询结果记录集 recordsets,还是返回查询结果的资源 resourceInfo。
  33639. * @param {number} [options.startRecord=0] - 查询起始记录位置。
  33640. * @param {number} [options.expectCount] - 期望查询结果返回的记录数,该值大于0。
  33641. * @usage
  33642. */
  33643. var ChartQueryParameters = /*#__PURE__*/function () {
  33644. function ChartQueryParameters(options) {
  33645. ChartQueryParameters_classCallCheck(this, ChartQueryParameters);
  33646. /**
  33647. * @member {string} ChartQueryParameters.prototype.queryMode
  33648. * @description 海图查询模式类型,支持两种查询方式:海图属性查询("ChartAttributeQuery")和海图空间查询("ChartBoundsQuery")。
  33649. */
  33650. this.queryMode = null;
  33651. /**
  33652. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} ChartQueryParameters.prototype.bounds
  33653. * @description 海图查询范围。
  33654. */
  33655. this.bounds = null;
  33656. /**
  33657. * @member {Array.<string>} ChartQueryParameters.prototype.chartLayerNames
  33658. * @description 查询的海图图层的名称。
  33659. */
  33660. this.chartLayerNames = null;
  33661. /**
  33662. * @member {Array.<ChartQueryFilterParameter>} ChartQueryParameters.prototype.chartQueryFilterParameters
  33663. * @description 海图查询过滤参数。包括:物标代码、物标可应用对象的选择(是否查询点、线或面)、属性字段过滤条件。
  33664. */
  33665. this.chartQueryFilterParameters = null;
  33666. /**
  33667. * @member {boolean} [ChartQueryParameters.prototype.returnContent=true]
  33668. * @description 获取或设置是返回查询结果记录集 recordsets,还是返回查询结果的资源 resourceInfo。
  33669. */
  33670. this.returnContent = true;
  33671. /**
  33672. * @member {number} [ChartQueryParameters.prototype.startRecord=0]
  33673. * @description 查询起始记录位置。
  33674. */
  33675. this.startRecord = 0;
  33676. /**
  33677. * @member {number} [ChartQueryParameters.prototype.expectCount]
  33678. * @description 期望查询结果返回的记录数,该值大于0。
  33679. */
  33680. this.expectCount = null;
  33681. Util_Util.extend(this, options);
  33682. this.CLASS_NAME = "SuperMap.ChartQueryParameters";
  33683. }
  33684. /**
  33685. * @function ChartQueryParameters.prototype.destroy
  33686. * @description 释放资源,将引用资源的属性置空。
  33687. */
  33688. ChartQueryParameters_createClass(ChartQueryParameters, [{
  33689. key: "destroy",
  33690. value: function destroy() {
  33691. var me = this;
  33692. me.queryMode = null;
  33693. me.bounds = null;
  33694. me.chartLayerNames = null;
  33695. me.chartQueryFilterParameters = null;
  33696. me.returnContent = true;
  33697. me.startRecord = 0;
  33698. me.expectCount = null;
  33699. }
  33700. /**
  33701. * @function ChartQueryParameters.prototype.getVariablesJson
  33702. * @description 将属性信息转换成能够被服务识别的 JSON 格式字符串。
  33703. * @returns {string} JSON 字符串。
  33704. */
  33705. }, {
  33706. key: "getVariablesJson",
  33707. value: function getVariablesJson() {
  33708. var json = "";
  33709. json += "\"queryMode\":\"" + this.queryMode + "\",";
  33710. if (this.chartLayerNames && this.chartLayerNames.length) {
  33711. var chartLayersArray = [];
  33712. var layerLength = this.chartLayerNames.length;
  33713. for (var i = 0; i < layerLength; i++) {
  33714. chartLayersArray.push("\"" + this.chartLayerNames[i] + "\"");
  33715. }
  33716. var layerNames = "[" + chartLayersArray.join(",") + "]";
  33717. json += "\"chartLayerNames\":" + layerNames + ",";
  33718. }
  33719. if (this.queryMode === "ChartBoundsQuery" && this.bounds) {
  33720. json += "\"bounds\":" + "{" + "\"leftBottom\":" + "{" + "\"x\":" + this.bounds.left + "," + "\"y\":" + this.bounds.bottom + "}" + "," + "\"rightTop\":" + "{" + "\"x\":" + this.bounds.right + "," + "\"y\":" + this.bounds.top + "}" + "},";
  33721. }
  33722. if (this.chartQueryFilterParameters && this.chartQueryFilterParameters.length) {
  33723. var chartParamArray = [];
  33724. var chartLength = this.chartQueryFilterParameters.length;
  33725. for (var j = 0; j < chartLength; j++) {
  33726. var chartQueryFilterParameter = this.chartQueryFilterParameters[j];
  33727. if (!(chartQueryFilterParameter instanceof ChartQueryFilterParameter)) {
  33728. continue;
  33729. }
  33730. chartParamArray.push(chartQueryFilterParameter.toJson());
  33731. }
  33732. var chartParamsJson = "[" + chartParamArray.join(",") + "]";
  33733. chartParamsJson = "\"chartQueryParams\":" + chartParamsJson + ",";
  33734. chartParamsJson += "\"startRecord\":" + this.startRecord + ",";
  33735. chartParamsJson += "\"expectCount\":" + this.expectCount;
  33736. chartParamsJson = "{" + chartParamsJson + "}";
  33737. json += "\"chartQueryParameters\":" + chartParamsJson;
  33738. }
  33739. json = "{" + json + "}";
  33740. return json;
  33741. }
  33742. }]);
  33743. return ChartQueryParameters;
  33744. }();
  33745. ;// CONCATENATED MODULE: ./src/common/iServer/QueryParameters.js
  33746. function QueryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33747. function QueryParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  33748. function QueryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  33749. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33750. * This program are made available under the terms of the Apache License, Version 2.0
  33751. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33752. /**
  33753. * @class QueryParameters
  33754. * @deprecatedclass SuperMap.QueryParameters
  33755. * @category iServer Map QueryResults
  33756. * @classdesc 查询参数基类。距离查询、SQL 查询、几何地物查询等各自的参数均继承此类。
  33757. * @param {Object} options - 参数。
  33758. * @param {Array.<FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  33759. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  33760. * @param {Object} [options.prjCoordSys] - 自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  33761. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  33762. * @param {GeometryType} [options.networkType=GeometryType.LINE] - 网络数据集对应的查询类型。
  33763. * @param {QueryOption} [options.queryOption=QueryOption.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  33764. * @param {number} [options.startRecord=0] - 查询起始记录号。
  33765. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  33766. * @param {boolean} [options.returnCustomResult=false] - 仅供三维使用。
  33767. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  33768. * @usage
  33769. */
  33770. var QueryParameters = /*#__PURE__*/function () {
  33771. function QueryParameters(options) {
  33772. QueryParameters_classCallCheck(this, QueryParameters);
  33773. if (!options) {
  33774. return;
  33775. }
  33776. /**
  33777. * @member {string} [QueryParameters.prototype.customParams]
  33778. * @description 自定义参数,供扩展使用。
  33779. */
  33780. this.customParams = null;
  33781. /**
  33782. * @member {Object} [QueryParameters.prototype.prjCoordSys]
  33783. * @description 自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}
  33784. */
  33785. this.prjCoordSys = null;
  33786. /**
  33787. * @member {number} [QueryParameters.prototype.expectCount=100000]
  33788. * @description 期望返回结果记录个数,默认返回100000条查询记录,
  33789. * 如果实际不足100000条则返回实际记录条数。
  33790. */
  33791. this.expectCount = 100000;
  33792. /**
  33793. * @member {GeometryType} [QueryParameters.prototype.networkType=GeometryType.LINE]
  33794. * @description 网络数据集对应的查询类型,分为点和线两种类型。
  33795. */
  33796. this.networkType = REST_GeometryType.LINE;
  33797. /**
  33798. * @member {QueryOption} [QueryParameters.prototype.queryOption=QueryOption.ATTRIBUTEANDGEOMETRY]
  33799. * @description 查询结果类型枚举类。
  33800. * 该类描述查询结果返回类型,包括只返回属性、
  33801. * 只返回几何实体以及返回属性和几何实体。
  33802. */
  33803. this.queryOption = QueryOption.ATTRIBUTEANDGEOMETRY;
  33804. /**
  33805. * @member {Array.<FilterParameter>} QueryParameters.prototype.queryParams
  33806. * @description 查询过滤条件参数数组。
  33807. * 该类用于设置查询数据集的查询过滤参数。
  33808. */
  33809. this.queryParams = null;
  33810. /**
  33811. * @member {number} [QueryParameters.prototype.startRecord=0]
  33812. * @description 查询起始记录号。
  33813. */
  33814. this.startRecord = 0;
  33815. /**
  33816. * @member {number} [QueryParameters.prototype.holdTime=10]
  33817. * @description 资源在服务端保存的时间,单位为分钟。
  33818. */
  33819. this.holdTime = 10;
  33820. /**
  33821. * @member {boolean} [QueryParameters.prototype.returnCustomResult=false]
  33822. * @description 仅供三维使用。
  33823. */
  33824. this.returnCustomResult = false;
  33825. /**
  33826. * @member {boolean} [QueryParameters.prototype.returnFeatureWithFieldCaption=false]
  33827. * @description 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  33828. */
  33829. this.returnFeatureWithFieldCaption = false;
  33830. Util_Util.extend(this, options);
  33831. this.CLASS_NAME = "SuperMap.QueryParameters";
  33832. }
  33833. /**
  33834. * @function QueryParameters.prototype.destroy
  33835. * @description 释放资源,将引用资源的属性置空。
  33836. */
  33837. QueryParameters_createClass(QueryParameters, [{
  33838. key: "destroy",
  33839. value: function destroy() {
  33840. var me = this;
  33841. me.customParams = null;
  33842. me.expectCount = null;
  33843. me.networkType = null;
  33844. me.queryOption = null;
  33845. if (me.queryParams) {
  33846. for (var i = 0, qps = me.queryParams, len = qps.length; i < len; i++) {
  33847. qps[i].destroy();
  33848. }
  33849. me.queryParams = null;
  33850. }
  33851. me.startRecord = null;
  33852. me.holdTime = null;
  33853. me.returnCustomResult = null;
  33854. me.prjCoordSys = null;
  33855. }
  33856. }]);
  33857. return QueryParameters;
  33858. }();
  33859. ;// CONCATENATED MODULE: ./src/common/iServer/ChartQueryService.js
  33860. function ChartQueryService_typeof(obj) { "@babel/helpers - typeof"; return ChartQueryService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ChartQueryService_typeof(obj); }
  33861. function ChartQueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33862. function ChartQueryService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  33863. function ChartQueryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartQueryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartQueryService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  33864. function ChartQueryService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ChartQueryService_setPrototypeOf(subClass, superClass); }
  33865. function ChartQueryService_setPrototypeOf(o, p) { ChartQueryService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ChartQueryService_setPrototypeOf(o, p); }
  33866. function ChartQueryService_createSuper(Derived) { var hasNativeReflectConstruct = ChartQueryService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ChartQueryService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ChartQueryService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ChartQueryService_possibleConstructorReturn(this, result); }; }
  33867. function ChartQueryService_possibleConstructorReturn(self, call) { if (call && (ChartQueryService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ChartQueryService_assertThisInitialized(self); }
  33868. function ChartQueryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33869. function ChartQueryService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  33870. function ChartQueryService_getPrototypeOf(o) { ChartQueryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ChartQueryService_getPrototypeOf(o); }
  33871. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33872. * This program are made available under the terms of the Apache License, Version 2.0
  33873. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33874. /**
  33875. * @class ChartQueryService
  33876. * @deprecatedclass SuperMap.ChartQueryService
  33877. * @category iServer Map Chart
  33878. * @classdesc 海图查询服务类。该类负责将海图查询所需参数(ChartQueryParameters)传递至服务端,并获取服务端的返回结果。
  33879. * 用户可以通过两种方式获取查询结果:
  33880. * 1.通过 AsyncResponder 类获取(推荐使用);
  33881. * 2.通过监听 QueryEvent.PROCESS_COMPLETE 事件获取。
  33882. * @extends {CommonServiceBase}
  33883. * @param {string} url - 地图查询服务访问地址。如:"http://localhost:8090/iserver/services/map-ChartW/rest/maps/海图"。
  33884. * @param {Object} options - 参数。
  33885. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  33886. * @param {DataFormat} [options.format] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为"ISERVER","GEOJSON"。
  33887. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33888. * @param {Object} [options.headers] - 请求头。
  33889. * @example
  33890. * 下面示例显示了如何进行海图属性查询:
  33891. * var nameArray = ["GB4X0000_52000"];
  33892. * var chartQueryFilterParameter = new ChartQueryFilterParameter({
  33893. * isQueryPoint:true,
  33894. * isQueryLine:true,
  33895. * isQueryRegion:true,
  33896. * attributeFilter:"SmID<10",
  33897. * chartFeatureInfoSpecCode:1
  33898. * });
  33899. *
  33900. * var chartQueryParameters = new ChartQueryParameters({
  33901. * queryMode:"ChartAttributeQuery",
  33902. * chartLayerNames:nameArray,
  33903. * returnContent:true,
  33904. * chartQueryFilterParameters:[chartQueryFilterParameter]
  33905. * });
  33906. *
  33907. * var chartQueryService = new ChartQueryService(url);
  33908. *
  33909. * chartQueryService.events.on({
  33910. * "processCompleted":processCompleted,
  33911. * "processFailed":processFailed
  33912. * });
  33913. * chartQueryService.processAsync(chartQueryParameters);
  33914. * @usage
  33915. */
  33916. var ChartQueryService = /*#__PURE__*/function (_CommonServiceBase) {
  33917. ChartQueryService_inherits(ChartQueryService, _CommonServiceBase);
  33918. var _super = ChartQueryService_createSuper(ChartQueryService);
  33919. function ChartQueryService(url, options) {
  33920. var _this;
  33921. ChartQueryService_classCallCheck(this, ChartQueryService);
  33922. _this = _super.call(this, url, options);
  33923. options = options || {};
  33924. /**
  33925. * @member {boolean} ChartQueryService.prototype.returnContent
  33926. * @description 是否立即返回新创建资源的表述还是返回新资源的URI。
  33927. */
  33928. _this.returnContent = null;
  33929. /**
  33930. * @member {DataFormat} ChartQueryService.prototype.format
  33931. * @description 查询结果返回格式,目前支持iServerJSON 和GeoJSON两种格式
  33932. * 参数格式为"ISERVER","GEOJSON",GEOJSON
  33933. */
  33934. _this.format = DataFormat.GEOJSON;
  33935. Util_Util.extend(ChartQueryService_assertThisInitialized(_this), options);
  33936. var me = ChartQueryService_assertThisInitialized(_this);
  33937. if (options.format) {
  33938. me.format = options.format.toUpperCase();
  33939. }
  33940. if (!me.url) {
  33941. return ChartQueryService_possibleConstructorReturn(_this);
  33942. }
  33943. me.url = Util_Util.urlPathAppend(me.url, 'queryResults');
  33944. _this.CLASS_NAME = "SuperMap.ChartQueryService";
  33945. return _this;
  33946. }
  33947. /**
  33948. * @function ChartQueryService.prototype.destroy
  33949. * @override
  33950. */
  33951. ChartQueryService_createClass(ChartQueryService, [{
  33952. key: "destroy",
  33953. value: function destroy() {
  33954. var me = this;
  33955. CommonServiceBase.prototype.destroy.apply(this, arguments);
  33956. me.returnContent = null;
  33957. me.format = null;
  33958. }
  33959. /**
  33960. * @function ChartQueryService.prototype.processAsync
  33961. * @description 使用服务地址 URL 实例化 ChartQueryService 对象。
  33962. * @param {ChartQueryParameters} params - 查询参数。
  33963. */
  33964. }, {
  33965. key: "processAsync",
  33966. value: function processAsync(params) {
  33967. //todo重点需要添加代码的地方
  33968. if (!(params instanceof ChartQueryParameters)) {
  33969. return;
  33970. }
  33971. var me = this,
  33972. jsonParameters;
  33973. me.returnContent = params.returnContent;
  33974. jsonParameters = params.getVariablesJson();
  33975. if (me.returnContent) {
  33976. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  33977. }
  33978. me.request({
  33979. method: "POST",
  33980. data: jsonParameters,
  33981. scope: me,
  33982. success: me.serviceProcessCompleted,
  33983. failure: me.serviceProcessFailed
  33984. });
  33985. }
  33986. /**
  33987. * @function ChartQueryService.prototype.serviceProcessCompleted
  33988. * @description 查询完成,执行此方法。
  33989. * @param {Object} result - 服务器返回的结果对象。
  33990. */
  33991. }, {
  33992. key: "serviceProcessCompleted",
  33993. value: function serviceProcessCompleted(result, options) {
  33994. var me = this;
  33995. result = Util_Util.transformResult(result);
  33996. if (result && result.recordsets && me.format === DataFormat.GEOJSON) {
  33997. for (var i = 0, recordsets = result.recordsets, len = recordsets.length; i < len; i++) {
  33998. if (recordsets[i].features) {
  33999. var geoJSONFormat = new GeoJSON();
  34000. recordsets[i].features = geoJSONFormat.toGeoJSON(recordsets[i].features);
  34001. }
  34002. }
  34003. }
  34004. me.events.triggerEvent("processCompleted", {
  34005. result: result,
  34006. options: options
  34007. });
  34008. }
  34009. /**
  34010. * @function ChartQueryService.prototype.getQueryParameters
  34011. * @description 将 JSON 对象表示的查询参数转化为 QueryParameters 对象。
  34012. * @param {Object} params - JSON 字符串表示的查询参数。
  34013. * @returns {QueryParameters} 返回查询结果
  34014. */
  34015. }, {
  34016. key: "getQueryParameters",
  34017. value: function getQueryParameters(params) {
  34018. return new QueryParameters({
  34019. queryMode: params.queryMode,
  34020. bounds: params.bounds,
  34021. chartLayerNames: params.chartLayerNames,
  34022. chartQueryFilterParameters: params.chartQueryFilterParameters,
  34023. returnContent: params.returnContent
  34024. });
  34025. }
  34026. }]);
  34027. return ChartQueryService;
  34028. }(CommonServiceBase);
  34029. ;// CONCATENATED MODULE: ./src/common/iServer/ClipParameter.js
  34030. function ClipParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34031. function ClipParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  34032. function ClipParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) ClipParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) ClipParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  34033. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34034. * This program are made available under the terms of the Apache License, Version 2.0
  34035. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34036. /**
  34037. * @class ClipParameter
  34038. * @deprecatedclass SuperMap.ClipParameter
  34039. * @category iServer SpatialAnalyst InterpolationAnalyst
  34040. * @classdesc 用于裁剪的参数。优先使用用户指定的裁剪区域多边形进行裁剪,也可以通过指定数据源和数据集名,从而使用指定数据集的边界多边形进行裁剪。
  34041. * @param {Object} options - 可选参数。
  34042. * @param {string} [options.clipDatasetName] - 裁剪的数据集名。
  34043. * @param {string} [options.clipDatasourceName] - 裁剪的数据集所在数据源的名字。
  34044. * @param {GeometryPolygon|L.Polygon|L.GeoJSON|ol.geom.Polygon|ol.format.GeoJSON|GeoJSONObject} [options.clipRegion] - 用户指定的裁剪区域。
  34045. * @param {boolean} [options.isClipInRegion=true] - 是否对裁剪区内的数据集进行裁剪。
  34046. * @param {boolean} [options.isExactClip=true] - 是否使用精确裁剪。
  34047. * @usage
  34048. */
  34049. var ClipParameter = /*#__PURE__*/function () {
  34050. function ClipParameter(options) {
  34051. ClipParameter_classCallCheck(this, ClipParameter);
  34052. /**
  34053. * @member {string} ClipParameter.prototype.clipDatasetName
  34054. * @description 用于裁剪的数据集名,clipDatasetName 与 clipRegion 必须设置一个。
  34055. */
  34056. this.clipDatasetName = null;
  34057. /**
  34058. * @member {string} ClipParameter.prototype.clipDatasourceName
  34059. * @description 用于裁剪的数据集所在数据源的名字。当 clipRegion 不设置时起作用。
  34060. */
  34061. this.clipDatasourceName = null;
  34062. /**
  34063. * @member {GeometryPolygon|L.Polygon|L.GeoJSON|ol.geom.Polygon|ol.format.GeoJSON|GeoJSONObject} ClipParameter.prototype.clipRegion
  34064. * @description 用户指定的裁剪区域,优先使用,clipDatasetName 与 clipRegion 必须设置一个。
  34065. */
  34066. this.clipRegion = null;
  34067. /**
  34068. * @member {boolean} [ClipParameter.prototype.isClipInRegion=true]
  34069. * @description 是否对裁剪区内的数据集进行裁剪。若为 true,则对裁剪区域内的结果进行裁剪,若为 false,则对裁剪区域外的结果进行裁剪。
  34070. */
  34071. this.isClipInRegion = true;
  34072. /**
  34073. * @member {boolean} [ClipParameter.prototype.isExactClip=true]
  34074. * @description 是否使用精确裁剪。
  34075. */
  34076. this.isExactClip = null;
  34077. if (options) {
  34078. Util_Util.extend(this, options);
  34079. }
  34080. this.CLASS_NAME = "SuperMap.ClipParameter";
  34081. }
  34082. /**
  34083. * @function ClipParameter.prototype.destroy
  34084. * @description 释放资源,将引用资源的属性置空。
  34085. */
  34086. ClipParameter_createClass(ClipParameter, [{
  34087. key: "destroy",
  34088. value: function destroy() {
  34089. var me = this;
  34090. me.clipDatasetName = null;
  34091. me.clipDatasourceName = null;
  34092. me.clipRegion = null;
  34093. me.isClipInRegion = null;
  34094. me.isExactClip = null;
  34095. }
  34096. /**
  34097. * @function ClipParameter.prototype.toJSON
  34098. * @description 将 ClipParameter 对象转化为 JSON 字符串。
  34099. * @returns {string} 返回转换后的 JSON 字符串。
  34100. */
  34101. }, {
  34102. key: "toJSON",
  34103. value: function toJSON() {
  34104. return Util_Util.toJSON({
  34105. isClipInRegion: this.isClipInRegion,
  34106. clipDatasetName: this.clipDatasetName,
  34107. clipDatasourceName: this.clipDatasourceName,
  34108. isExactClip: this.isExactClip,
  34109. clipRegion: ServerGeometry.fromGeometry(this.clipRegion)
  34110. });
  34111. }
  34112. }]);
  34113. return ClipParameter;
  34114. }();
  34115. ;// CONCATENATED MODULE: ./src/common/iServer/ColorDictionary.js
  34116. function ColorDictionary_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34117. function ColorDictionary_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  34118. function ColorDictionary_createClass(Constructor, protoProps, staticProps) { if (protoProps) ColorDictionary_defineProperties(Constructor.prototype, protoProps); if (staticProps) ColorDictionary_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  34119. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34120. * This program are made available under the terms of the Apache License, Version 2.0
  34121. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34122. /**
  34123. * @class ColorDictionary
  34124. * @deprecatedclass SuperMap.ColorDictionary
  34125. * @category iServer Map Theme
  34126. * @classdesc 颜色对照表类。颜色对照表中的键名为具体的高程值,键值表示该高程值要显示的颜色。
  34127. * 对于栅格图层中高程值小于颜色对照表中高程最小值的点使用颜色对照表中高程最小值对应的颜色,
  34128. * 对于栅格图层中高程值大于颜色对照表中高程最大值的点使用颜色对照表中高程最大值对应的颜色,
  34129. * 对于栅格图层中高程值在颜色对照表中没有对应颜色的点,则查找颜色对照表中与当前高程值相邻的两个高程对应的颜色,
  34130. * 然后通过渐变运算要显示的颜色。如果设置了颜色对照表的话,则颜色表设置无效。
  34131. * @param {Object} options - 参数。
  34132. * @param {number} options.elevation - 高程值。
  34133. * @param {ServerColor} options.color - 服务端颜色类。
  34134. * @usage
  34135. */
  34136. var ColorDictionary = /*#__PURE__*/function () {
  34137. function ColorDictionary(options) {
  34138. ColorDictionary_classCallCheck(this, ColorDictionary);
  34139. options = options || {};
  34140. /**
  34141. * @member {number} ColorDictionary.prototype.elevation
  34142. * @description 高程值。
  34143. */
  34144. this.elevation = null;
  34145. /**
  34146. * @member {ServerColor} ColorDictionary.prototype.color
  34147. * @description 服务端颜色类。
  34148. */
  34149. this.color = null;
  34150. Util_Util.extend(this, options);
  34151. var me = this,
  34152. c = me.color;
  34153. if (c) {
  34154. me.color = new ServerColor(c.red, c.green, c.blue);
  34155. }
  34156. this.CLASS_NAME = "SuperMap.ColorDictionary";
  34157. }
  34158. /**
  34159. * @function ColorDictionary.prototype.destroy
  34160. * @description 释放资源,将引用资源的属性置空。
  34161. */
  34162. ColorDictionary_createClass(ColorDictionary, [{
  34163. key: "destroy",
  34164. value: function destroy() {
  34165. Util_Util.reset(this);
  34166. }
  34167. /**
  34168. * @function ColorDictionary.prototype.toServerJSONObject
  34169. * @description 转换成对应的 JSON 格式对象。
  34170. * @returns {Object} JSON 对象。
  34171. */
  34172. }, {
  34173. key: "toServerJSONObject",
  34174. value: function toServerJSONObject() {
  34175. var dataObj = {};
  34176. dataObj = Util_Util.copyAttributes(dataObj, this);
  34177. return dataObj;
  34178. }
  34179. }]);
  34180. return ColorDictionary;
  34181. }();
  34182. ;// CONCATENATED MODULE: ./src/common/iServer/TransportationAnalystResultSetting.js
  34183. function TransportationAnalystResultSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34184. function TransportationAnalystResultSetting_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  34185. function TransportationAnalystResultSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransportationAnalystResultSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransportationAnalystResultSetting_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  34186. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34187. * This program are made available under the terms of the Apache License, Version 2.0
  34188. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34189. /**
  34190. * @class TransportationAnalystResultSetting
  34191. * @deprecatedclass SuperMap.TransportationAnalystResultSetting
  34192. * @category iServer NetworkAnalyst
  34193. * @classdesc 交通网络分析结果参数类。通过该类设置交通网络分析返回的结果,包括是否返回图片、是否返回弧段空间信息、是否返回结点空间信息等。
  34194. * @param {Object} options - 可选参数。
  34195. * @param {boolean} [options.returnEdgeFeatures=false] - 是否在分析结果中包含弧段要素集合。
  34196. * @param {boolean} [options.returnEdgeGeometry=false] - 返回的弧段要素集合中是否包含几何对象信息。
  34197. * @param {boolean} [options.returnEdgeIDs=false] - 返回结果中是否包含经过弧段 ID 集合。
  34198. * @param {boolean} [options.returnNodeFeatures=false] - 是否在分析结果中包含结点要素集合。
  34199. * @param {boolean} [options.returnNodeGeometry=false] - 返回的结点要素集合中是否包含几何对象信息。
  34200. * @param {boolean} [options.returnNodeIDs=false] - 返回结果中是否包含经过结点 ID 集合。
  34201. * @param {boolean} [options.returnPathGuides=false] - 返回分析结果中是否包含行驶导引集合。
  34202. * @param {boolean} [options.returnRoutes=false] - 返回分析结果中是否包含路由对象的集合。
  34203. * @usage
  34204. */
  34205. var TransportationAnalystResultSetting = /*#__PURE__*/function () {
  34206. function TransportationAnalystResultSetting(options) {
  34207. TransportationAnalystResultSetting_classCallCheck(this, TransportationAnalystResultSetting);
  34208. if (!options) {
  34209. return;
  34210. }
  34211. /**
  34212. * @member {boolean} TransportationAnalystResultSetting.prototype.returnEdgeFeatures
  34213. * @description 是否在分析结果中包含弧段要素集合。弧段要素包括弧段的空间信息和属性信息。
  34214. */
  34215. this.returnEdgeFeatures = false;
  34216. /**
  34217. * @member {boolean} [TransportationAnalystResultSetting.prototype.returnEdgeGeometry=false]
  34218. * @description 返回的弧段要素集合中是否包含几何对象信息。
  34219. */
  34220. this.returnEdgeGeometry = false;
  34221. /**
  34222. * @member {boolean} [TransportationAnalystResultSetting.prototype.returnEdgeIDs=false]
  34223. * @description 返回结果中是否包含经过弧段 ID 集合。
  34224. */
  34225. this.returnEdgeIDs = false;
  34226. /**
  34227. * @member {boolean} [TransportationAnalystResultSetting.prototype.returnNodeFeatures=false]
  34228. * @description 是否在分析结果中包含结点要素集合。
  34229. * 结点要素包括结点的空间信息和属性信息。其中返回的结点要素是否包含空间信息可通过 returnNodeGeometry 字段设置。
  34230. */
  34231. this.returnNodeFeatures = false;
  34232. /**
  34233. * @member {boolean} [TransportationAnalystResultSetting.prototype.returnNodeGeometry=false]
  34234. * @description 返回的结点要素集合中是否包含几何对象信息。
  34235. */
  34236. this.returnNodeGeometry = false;
  34237. /**
  34238. * @member {boolean} [TransportationAnalystResultSetting.prototype.returnNodeIDs=false]
  34239. * @description 返回结果中是否包含经过结点 ID 集合。
  34240. */
  34241. this.returnNodeIDs = false;
  34242. /**
  34243. * @member {boolean} TransportationAnalystResultSetting.prototype.returnPathGuides
  34244. * @description 返回分析结果中是否包含行驶导引集合。
  34245. */
  34246. this.returnPathGuides = false;
  34247. /**
  34248. * @member {boolean} TransportationAnalystResultSetting.prototype.returnRoutes
  34249. * @description 返回分析结果中是否包含路由对象的集合。
  34250. */
  34251. this.returnRoutes = false;
  34252. Util_Util.extend(this, options);
  34253. this.CLASS_NAME = "SuperMap.TransportationAnalystResultSetting";
  34254. }
  34255. /**
  34256. * @function TransportationAnalystResultSetting.prototype.destroy
  34257. * @description 释放资源,将引用资源的属性置空。
  34258. */
  34259. TransportationAnalystResultSetting_createClass(TransportationAnalystResultSetting, [{
  34260. key: "destroy",
  34261. value: function destroy() {
  34262. var me = this;
  34263. me.returnEdgeFeatures = null;
  34264. me.returnEdgeGeometry = null;
  34265. me.returnEdgeIDs = null;
  34266. me.returnNodeFeatures = null;
  34267. me.returnNodeGeometry = null;
  34268. me.returnNodeIDs = null;
  34269. me.returnPathGuides = null;
  34270. me.returnRoutes = null;
  34271. }
  34272. }]);
  34273. return TransportationAnalystResultSetting;
  34274. }();
  34275. ;// CONCATENATED MODULE: ./src/common/iServer/TransportationAnalystParameter.js
  34276. function TransportationAnalystParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34277. function TransportationAnalystParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  34278. function TransportationAnalystParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransportationAnalystParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransportationAnalystParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  34279. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34280. * This program are made available under the terms of the Apache License, Version 2.0
  34281. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34282. /**
  34283. * @class TransportationAnalystParameter
  34284. * @deprecatedclass SuperMap.TransportationAnalystParameter
  34285. * @category iServer NetworkAnalyst
  34286. * @classdesc 交通网络分析通用参数类。该类主要用来提供交通网络分析所需的通用参数。
  34287. * 通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息,还可以对分析结果包含的内容进行一些设置。
  34288. * @param {Object} options - 参数。
  34289. * @param {Array.<number>} options.barrierEdgeIDs - 网络分析中障碍弧段的 ID 数组。
  34290. * @param {Array.<number>} options.barrierNodeIDs - 网络分析中障碍点的 ID 数组。
  34291. * @param {string} options.turnWeightField - 转向权重字段的名称。
  34292. * @param {TransportationAnalystResultSetting} options.resultSetting - 分析结果返回内容。
  34293. * @param {Array.<GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} [options.barrierPoints] - 网络分析中 Point2D 类型的障碍点数组。
  34294. * @param {string} [options.weightFieldName] - 阻力字段的名称。
  34295. * @usage
  34296. */
  34297. var TransportationAnalystParameter = /*#__PURE__*/function () {
  34298. function TransportationAnalystParameter(options) {
  34299. TransportationAnalystParameter_classCallCheck(this, TransportationAnalystParameter);
  34300. if (!options) {
  34301. return;
  34302. }
  34303. /**
  34304. * @member {Array.<number>} TransportationAnalystParameter.prototype.barrierEdgeIDs
  34305. * @description 网络分析中障碍弧段的 ID 数组。弧段设置为障碍边之后,表示双向都不通。
  34306. */
  34307. this.barrierEdgeIDs = null;
  34308. /**
  34309. * @member {Array.<number>} TransportationAnalystParameter.prototype.barrierNodeIDs
  34310. * @description 网络分析中障碍点的 ID 数组。结点设置为障碍点之后,表示任何方向都不能通过此结点。
  34311. */
  34312. this.barrierNodeIDs = null;
  34313. /**
  34314. * @member {Array.<GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} TransportationAnalystParameter.prototype.barrierPoints
  34315. * @description 网络分析中 Point2D 类型的障碍点数组。障碍点表示任何方向都不能通过此点。</br>
  34316. * 当各网络分析参数类中的 isAnalyzeById 属性设置为 false 时,该属性才生效。
  34317. */
  34318. this.barrierPoints = null;
  34319. /**
  34320. * @member {string} [TransportationAnalystParameter.prototype.weightFieldName]
  34321. * @description 阻力字段的名称,标识了进行网络分析时所使用的阻力字段,例如表示时间、长度等的字段都可以用作阻力字段。
  34322. * 该字段默值为服务器发布的所有耗费字段的第一个字段。
  34323. */
  34324. this.weightFieldName = null;
  34325. /**
  34326. * @member {string} TransportationAnalystParameter.prototype.turnWeightField
  34327. * @description 转向权重字段的名称。
  34328. */
  34329. this.turnWeightField = null;
  34330. /**
  34331. * @member {TransportationAnalystResultSetting} TransportationAnalystParameter.prototype.resultSetting
  34332. * @description 分析结果返回内容。
  34333. */
  34334. this.resultSetting = new TransportationAnalystResultSetting();
  34335. Util_Util.extend(this, options);
  34336. this.CLASS_NAME = "SuperMap.TransportationAnalystParameter";
  34337. }
  34338. /**
  34339. * @function TransportationAnalystParameter.prototype.destroy
  34340. * @description 释放资源,将引用资源的属性置空。
  34341. */
  34342. TransportationAnalystParameter_createClass(TransportationAnalystParameter, [{
  34343. key: "destroy",
  34344. value: function destroy() {
  34345. var me = this;
  34346. me.barrierEdgeIDs = null;
  34347. me.barrierNodeIDs = null;
  34348. me.weightFieldName = null;
  34349. me.turnWeightField = null;
  34350. if (me.resultSetting) {
  34351. me.resultSetting.destroy();
  34352. me.resultSetting = null;
  34353. }
  34354. if (me.barrierPoints && me.barrierPoints.length) {
  34355. for (var i in me.barrierPoints) {
  34356. me.barrierPoints[i].destroy();
  34357. }
  34358. }
  34359. me.barrierPoints = null;
  34360. }
  34361. }]);
  34362. return TransportationAnalystParameter;
  34363. }();
  34364. ;// CONCATENATED MODULE: ./src/common/iServer/ComputeWeightMatrixParameters.js
  34365. function ComputeWeightMatrixParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34366. function ComputeWeightMatrixParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  34367. function ComputeWeightMatrixParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ComputeWeightMatrixParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ComputeWeightMatrixParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  34368. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34369. * This program are made available under the terms of the Apache License, Version 2.0
  34370. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34371. /**
  34372. * @class ComputeWeightMatrixParameters
  34373. * @deprecatedclass SuperMap.ComputeWeightMatrixParameters
  34374. * @category iServer NetworkAnalyst WeightMatrix
  34375. * @classdesc 耗费矩阵分析参数类。根据交通网络分析参数中的耗费字段返回一个耗费矩阵。该矩阵是一个二维数组,用来存储任意两点间的资源消耗。
  34376. * @param {Object} options - 参数。
  34377. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 指定路径分析的结点。
  34378. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} options.nodes - 要计算耗费矩阵的点数组。
  34379. * @param {TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  34380. * @usage
  34381. */
  34382. var ComputeWeightMatrixParameters = /*#__PURE__*/function () {
  34383. function ComputeWeightMatrixParameters(options) {
  34384. ComputeWeightMatrixParameters_classCallCheck(this, ComputeWeightMatrixParameters);
  34385. /**
  34386. * @member {boolean} [ComputeWeightMatrixParameters.prototype.isAnalyzeById=false]
  34387. * @description 是否通过节点 ID 指定路径分析的结点,即通过坐标点指定。
  34388. */
  34389. this.isAnalyzeById = false;
  34390. /**
  34391. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} ComputeWeightMatrixParameters.prototype.nodes
  34392. * @description 要计算耗费矩阵的点数组。
  34393. * 当 {@link ComputeWeightMatrixParameters.isAnalyzeById} = false 时,nodes 应为点的坐标数组;
  34394. * 当 {@link ComputeWeightMatrixParameters.isAnalyzeById} = true 时,nodes 应为点的 ID 数组。
  34395. */
  34396. this.nodes = null;
  34397. /**
  34398. * @member {TransportationAnalystParameter} ComputeWeightMatrixParameters.prototype.parameter
  34399. * @description 交通网络分析通用参数。
  34400. */
  34401. this.parameter = new TransportationAnalystParameter();
  34402. Util_Util.extend(this, options);
  34403. this.CLASS_NAME = "SuperMap.ComputeWeightMatrixParameters";
  34404. }
  34405. /**
  34406. * @function ComputeWeightMatrixParameters.prototype.destroy
  34407. * @description 释放资源,将引用资源的属性置空。
  34408. */
  34409. ComputeWeightMatrixParameters_createClass(ComputeWeightMatrixParameters, [{
  34410. key: "destroy",
  34411. value: function destroy() {
  34412. var me = this;
  34413. me.isAnalyzeById = null;
  34414. me.nodes = null;
  34415. if (me.parameter) {
  34416. me.parameter.destroy();
  34417. me.parameter = null;
  34418. }
  34419. }
  34420. }]);
  34421. return ComputeWeightMatrixParameters;
  34422. }();
  34423. ;// CONCATENATED MODULE: ./src/common/iServer/ComputeWeightMatrixService.js
  34424. function ComputeWeightMatrixService_typeof(obj) { "@babel/helpers - typeof"; return ComputeWeightMatrixService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ComputeWeightMatrixService_typeof(obj); }
  34425. function ComputeWeightMatrixService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34426. function ComputeWeightMatrixService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  34427. function ComputeWeightMatrixService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ComputeWeightMatrixService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ComputeWeightMatrixService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  34428. function ComputeWeightMatrixService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ComputeWeightMatrixService_get = Reflect.get.bind(); } else { ComputeWeightMatrixService_get = function _get(target, property, receiver) { var base = ComputeWeightMatrixService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ComputeWeightMatrixService_get.apply(this, arguments); }
  34429. function ComputeWeightMatrixService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ComputeWeightMatrixService_getPrototypeOf(object); if (object === null) break; } return object; }
  34430. function ComputeWeightMatrixService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ComputeWeightMatrixService_setPrototypeOf(subClass, superClass); }
  34431. function ComputeWeightMatrixService_setPrototypeOf(o, p) { ComputeWeightMatrixService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ComputeWeightMatrixService_setPrototypeOf(o, p); }
  34432. function ComputeWeightMatrixService_createSuper(Derived) { var hasNativeReflectConstruct = ComputeWeightMatrixService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ComputeWeightMatrixService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ComputeWeightMatrixService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ComputeWeightMatrixService_possibleConstructorReturn(this, result); }; }
  34433. function ComputeWeightMatrixService_possibleConstructorReturn(self, call) { if (call && (ComputeWeightMatrixService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ComputeWeightMatrixService_assertThisInitialized(self); }
  34434. function ComputeWeightMatrixService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34435. function ComputeWeightMatrixService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  34436. function ComputeWeightMatrixService_getPrototypeOf(o) { ComputeWeightMatrixService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ComputeWeightMatrixService_getPrototypeOf(o); }
  34437. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34438. * This program are made available under the terms of the Apache License, Version 2.0
  34439. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34440. /**
  34441. * @class ComputeWeightMatrixService
  34442. * @deprecatedclass SuperMap.ComputeWeightMatrixService
  34443. * @category iServer NetworkAnalyst WeightMatrix
  34444. * @classdesc 耗费矩阵分析服务类。
  34445. * 耗费矩阵是根据交通网络分析参数中的耗费字段来计算一个二维数组,
  34446. * 用来存储指定的任意两点间的资源消耗。
  34447. * 耗费矩阵分析结果通过该类支持的事件的监听函数参数获取
  34448. * @extends {NetworkAnalystServiceBase}
  34449. * @example
  34450. * var mycomputeWeightMatrixService = new ComputeWeightMatrixService(url,{
  34451. * eventListeners: {
  34452. * "processCompleted": computeWeightMatrixCompleted,
  34453. * "processFailed": computeWeightMatrixnError
  34454. * }
  34455. * });
  34456. * @param {string} url - 耗费矩阵分析服务地址。请求服务的URL应为:
  34457. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  34458. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  34459. * @param {Object} options - 参数。
  34460. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  34461. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34462. * @param {Object} [options.headers] - 请求头。
  34463. * @usage
  34464. */
  34465. var ComputeWeightMatrixService = /*#__PURE__*/function (_NetworkAnalystServic) {
  34466. ComputeWeightMatrixService_inherits(ComputeWeightMatrixService, _NetworkAnalystServic);
  34467. var _super = ComputeWeightMatrixService_createSuper(ComputeWeightMatrixService);
  34468. function ComputeWeightMatrixService(url, options) {
  34469. var _this;
  34470. ComputeWeightMatrixService_classCallCheck(this, ComputeWeightMatrixService);
  34471. _this = _super.call(this, url, options);
  34472. _this.CLASS_NAME = "SuperMap.ComputeWeightMatrixService";
  34473. return _this;
  34474. }
  34475. /**
  34476. * @function ComputeWeightMatrixService.prototype.destroy
  34477. * @override
  34478. */
  34479. ComputeWeightMatrixService_createClass(ComputeWeightMatrixService, [{
  34480. key: "destroy",
  34481. value: function destroy() {
  34482. ComputeWeightMatrixService_get(ComputeWeightMatrixService_getPrototypeOf(ComputeWeightMatrixService.prototype), "destroy", this).call(this);
  34483. }
  34484. /**
  34485. * @function ComputeWeightMatrixService.prototype.processAsync
  34486. * @description 负责将客户端的查询参数传递到服务端。
  34487. * @param {ComputeWeightMatrixParameters} params - 耗费矩阵分析参数类
  34488. */
  34489. }, {
  34490. key: "processAsync",
  34491. value: function processAsync(params) {
  34492. if (!(params instanceof ComputeWeightMatrixParameters)) {
  34493. return;
  34494. }
  34495. var me = this,
  34496. jsonObject;
  34497. me.url = Util_Util.urlPathAppend(me.url, 'weightmatrix');
  34498. jsonObject = {
  34499. parameter: Util_Util.toJSON(params.parameter),
  34500. nodes: me.getJson(params.isAnalyzeById, params.nodes)
  34501. };
  34502. me.request({
  34503. method: "GET",
  34504. params: jsonObject,
  34505. scope: me,
  34506. success: me.serviceProcessCompleted,
  34507. failure: me.serviceProcessFailed
  34508. });
  34509. }
  34510. /**
  34511. * @function ComputeWeightMatrixService.prototype.getJson
  34512. * @description 将对象转化为JSON字符串。
  34513. * @param {boolean} isAnalyzeById - 是否通过id分析
  34514. * @param {Array.<ComputeWeightMatrixParameters>} params - 分析参数数组
  34515. * @returns {string} 转化后的JSON字符串。
  34516. */
  34517. }, {
  34518. key: "getJson",
  34519. value: function getJson(isAnalyzeById, params) {
  34520. var jsonString = "[",
  34521. len = params ? params.length : 0;
  34522. if (isAnalyzeById === false) {
  34523. for (var i = 0; i < len; i++) {
  34524. if (i > 0) {
  34525. jsonString += ",";
  34526. }
  34527. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  34528. }
  34529. } else if (isAnalyzeById === true) {
  34530. for (var _i2 = 0; _i2 < len; _i2++) {
  34531. if (_i2 > 0) {
  34532. jsonString += ",";
  34533. }
  34534. jsonString += params[_i2];
  34535. }
  34536. }
  34537. jsonString += ']';
  34538. return jsonString;
  34539. }
  34540. }]);
  34541. return ComputeWeightMatrixService;
  34542. }(NetworkAnalystServiceBase);
  34543. ;// CONCATENATED MODULE: ./src/common/iServer/DataFlowService.js
  34544. function DataFlowService_typeof(obj) { "@babel/helpers - typeof"; return DataFlowService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, DataFlowService_typeof(obj); }
  34545. function DataFlowService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34546. function DataFlowService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  34547. function DataFlowService_createClass(Constructor, protoProps, staticProps) { if (protoProps) DataFlowService_defineProperties(Constructor.prototype, protoProps); if (staticProps) DataFlowService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  34548. function DataFlowService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) DataFlowService_setPrototypeOf(subClass, superClass); }
  34549. function DataFlowService_setPrototypeOf(o, p) { DataFlowService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DataFlowService_setPrototypeOf(o, p); }
  34550. function DataFlowService_createSuper(Derived) { var hasNativeReflectConstruct = DataFlowService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DataFlowService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DataFlowService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DataFlowService_possibleConstructorReturn(this, result); }; }
  34551. function DataFlowService_possibleConstructorReturn(self, call) { if (call && (DataFlowService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return DataFlowService_assertThisInitialized(self); }
  34552. function DataFlowService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34553. function DataFlowService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  34554. function DataFlowService_getPrototypeOf(o) { DataFlowService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DataFlowService_getPrototypeOf(o); }
  34555. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34556. * This program are made available under the terms of the Apache License, Version 2.0
  34557. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34558. /**
  34559. * @class DataFlowService
  34560. * @deprecatedclass SuperMap.DataFlowService
  34561. * @category iServer DataFlow
  34562. * @classdesc 数据流服务类。
  34563. * @extends {CommonServiceBase}
  34564. * @param {string} url - 数据流服务地址。
  34565. * @param {Object} options - 参数。
  34566. * @param {function} options.style - 设置数据加载样式。
  34567. * @param {function} [options.onEachFeature] - 设置每个数据加载popup等。
  34568. * @param {GeoJSONObject} [options.geometry] - 指定几何范围,该范围内的要素才能被订阅。
  34569. * @param {Object} [options.excludeField] - 排除字段。
  34570. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34571. * @param {Object} [options.headers] - 请求头。
  34572. * @usage
  34573. */
  34574. var DataFlowService_DataFlowService = /*#__PURE__*/function (_CommonServiceBase) {
  34575. DataFlowService_inherits(DataFlowService, _CommonServiceBase);
  34576. var _super = DataFlowService_createSuper(DataFlowService);
  34577. function DataFlowService(url, options) {
  34578. var _this;
  34579. DataFlowService_classCallCheck(this, DataFlowService);
  34580. options = options || {};
  34581. /*
  34582. * @constant EVENT_TYPES
  34583. * {Array.<string>}
  34584. * 此类支持的事件类型
  34585. */
  34586. options.EVENT_TYPES = ["broadcastSocketConnected", "broadcastSocketClosed", "broadcastSocketError", "broadcastFailed", "broadcastSucceeded", "subscribeSocketConnected", "subscribeSocketClosed", "subscribeSocketError", "messageSucceeded", "setFilterParamSucceeded"];
  34587. _this = _super.call(this, url, options);
  34588. /**
  34589. * @member {GeoJSONObject} DataFlowService.prototype.geometry
  34590. * @description 指定几何范围,该范围内的要素才能被订阅。
  34591. */
  34592. _this.geometry = null;
  34593. /**
  34594. * @member {Object} DataFlowService.prototype.prjCoordSys
  34595. * @description 动态投影参数。
  34596. */
  34597. _this.prjCoordSys = null;
  34598. /**
  34599. * @member {Object} DataFlowService.prototype.excludeField
  34600. * @description 排除字段。
  34601. */
  34602. _this.excludeField = null;
  34603. Util_Util.extend(DataFlowService_assertThisInitialized(_this), options);
  34604. _this.CLASS_NAME = "SuperMap.DataFlowService";
  34605. return _this;
  34606. }
  34607. /**
  34608. * @function DataFlowService.prototype.initBroadcast
  34609. * @description 初始化广播。
  34610. * @returns {DataFlowService}
  34611. */
  34612. DataFlowService_createClass(DataFlowService, [{
  34613. key: "initBroadcast",
  34614. value: function initBroadcast() {
  34615. var me = this;
  34616. this.broadcastWebSocket = this._connect(Util_Util.urlPathAppend(me.url, 'broadcast'));
  34617. this.broadcastWebSocket.onopen = function (e) {
  34618. me.broadcastWebSocket.isOpen = true;
  34619. e.eventType = 'broadcastSocketConnected';
  34620. me.events.triggerEvent('broadcastSocketConnected', e);
  34621. };
  34622. this.broadcastWebSocket.onclose = function (e) {
  34623. if (me.broadcastWebSocket) {
  34624. me.broadcastWebSocket.isOpen = false;
  34625. }
  34626. e.eventType = 'broadcastSocketClosed';
  34627. me.events.triggerEvent('broadcastSocketClosed', e);
  34628. };
  34629. this.broadcastWebSocket.onerror = function (e) {
  34630. e.eventType = 'broadcastSocketError';
  34631. me.events.triggerEvent('broadcastSocketError', e);
  34632. };
  34633. return this;
  34634. }
  34635. /**
  34636. * @function DataFlowService.prototype.broadcast
  34637. * @description 加载广播数据。
  34638. * @param {GeoJSONObject} geoJSONFeature - JSON 格式的要素数据。
  34639. */
  34640. }, {
  34641. key: "broadcast",
  34642. value: function broadcast(geoJSONFeature) {
  34643. if (!this.broadcastWebSocket || !this.broadcastWebSocket.isOpen) {
  34644. this.events.triggerEvent('broadcastFailed');
  34645. return;
  34646. }
  34647. this.broadcastWebSocket.send(JSON.stringify(geoJSONFeature));
  34648. this.events.triggerEvent('broadcastSucceeded');
  34649. }
  34650. /**
  34651. * @function DataFlowService.prototype.initSubscribe
  34652. * @description 初始化订阅数据。
  34653. * @returns {DataFlowService} DataFlowService的实例对象。
  34654. */
  34655. }, {
  34656. key: "initSubscribe",
  34657. value: function initSubscribe() {
  34658. var me = this;
  34659. this.subscribeWebSocket = this._connect(Util_Util.urlPathAppend(me.url, 'subscribe'));
  34660. this.subscribeWebSocket.onopen = function (e) {
  34661. me.subscribeWebSocket.send(me._getFilterParams());
  34662. e.eventType = 'subscribeSocketConnected';
  34663. me.events.triggerEvent('subscribeSocketConnected', e);
  34664. };
  34665. this.subscribeWebSocket.onclose = function (e) {
  34666. e.eventType = 'subscribeWebSocketClosed';
  34667. me.events.triggerEvent('subscribeWebSocketClosed', e);
  34668. };
  34669. this.subscribeWebSocket.onerror = function (e) {
  34670. e.eventType = 'subscribeSocketError';
  34671. me.events.triggerEvent('subscribeSocketError', e);
  34672. };
  34673. this.subscribeWebSocket.onmessage = function (e) {
  34674. me._onMessage(e);
  34675. };
  34676. return this;
  34677. }
  34678. /**
  34679. * @function DataFlowService.prototype.setExcludeField
  34680. * @description 设置排除字段。
  34681. * @param {Object} excludeField - 排除字段。
  34682. * @returns {DataFlowService} DataFlowService的实例对象。
  34683. */
  34684. }, {
  34685. key: "setExcludeField",
  34686. value: function setExcludeField(excludeField) {
  34687. this.excludeField = excludeField;
  34688. this.subscribeWebSocket.send(this._getFilterParams());
  34689. return this;
  34690. }
  34691. /**
  34692. * @function DataFlowService.prototype.setGeometry
  34693. * @description 设置添加的几何要素数据。
  34694. * @param {GeoJSONObject} geometry - 指定几何范围,该范围内的要素才能被订阅。
  34695. * @returns {DataFlowService} DataFlowService的实例对象。
  34696. */
  34697. }, {
  34698. key: "setGeometry",
  34699. value: function setGeometry(geometry) {
  34700. this.geometry = geometry;
  34701. this.subscribeWebSocket.send(this._getFilterParams());
  34702. return this;
  34703. }
  34704. /**
  34705. * @function DataFlowService.prototype.unSubscribe
  34706. * @description 结束订阅数据。
  34707. */
  34708. }, {
  34709. key: "unSubscribe",
  34710. value: function unSubscribe() {
  34711. if (!this.subscribeWebSocket) {
  34712. return;
  34713. }
  34714. this.subscribeWebSocket.close();
  34715. this.subscribeWebSocket = null;
  34716. }
  34717. /**
  34718. * @function DataFlowService.prototype.unBroadcast
  34719. * @description 结束加载广播。
  34720. */
  34721. }, {
  34722. key: "unBroadcast",
  34723. value: function unBroadcast() {
  34724. if (!this.broadcastWebSocket) {
  34725. return;
  34726. }
  34727. this.broadcastWebSocket.close();
  34728. this.broadcastWebSocket = null;
  34729. }
  34730. /**
  34731. * @function DataFlowService.prototype.destroy
  34732. * @override
  34733. */
  34734. }, {
  34735. key: "destroy",
  34736. value: function destroy() {
  34737. CommonServiceBase.prototype.destroy.apply(this, arguments);
  34738. var me = this;
  34739. me.geometry = null;
  34740. me.prjCoordSys = null;
  34741. me.excludeField = null;
  34742. this.unBroadcast();
  34743. this.unSubscribe();
  34744. }
  34745. }, {
  34746. key: "_getFilterParams",
  34747. value: function _getFilterParams() {
  34748. var filter = {
  34749. filterParam: {
  34750. prjCoordSys: this.prjCoordSys,
  34751. excludeField: this.excludeField,
  34752. geometry: this.geometry
  34753. }
  34754. };
  34755. return Util_Util.toJSON(filter);
  34756. }
  34757. }, {
  34758. key: "_onMessage",
  34759. value: function _onMessage(e) {
  34760. if (e.data && e.data.indexOf("filterParam") >= 0) {
  34761. var filterParam = JSON.parse(e.data);
  34762. e.filterParam = filterParam;
  34763. e.eventType = 'setFilterParamSucceeded';
  34764. this.events.triggerEvent('setFilterParamSucceeded', e);
  34765. return;
  34766. }
  34767. var feature = JSON.parse(e.data);
  34768. e.featureResult = feature;
  34769. e.eventType = 'messageSucceeded';
  34770. this.events.triggerEvent('messageSucceeded', e);
  34771. }
  34772. }, {
  34773. key: "_connect",
  34774. value: function _connect(url) {
  34775. url = SecurityManager.appendCredential(url);
  34776. if ("WebSocket" in window) {
  34777. return new WebSocket(url);
  34778. } else if ("MozWebSocket" in window) {
  34779. var mozWebSocket = window.MozWebSocket;
  34780. return new mozWebSocket(url);
  34781. } else {
  34782. console.log("no WebSocket");
  34783. return null;
  34784. }
  34785. }
  34786. }]);
  34787. return DataFlowService;
  34788. }(CommonServiceBase);
  34789. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetInfo.js
  34790. function DatasetInfo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34791. function DatasetInfo_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  34792. function DatasetInfo_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetInfo_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetInfo_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  34793. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34794. * This program are made available under the terms of the Apache License, Version 2.0
  34795. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34796. /**
  34797. * @class DatasetInfo
  34798. * @deprecatedclass SuperMap.DatasetInfo
  34799. * @category iServer Data Dataset
  34800. * @classdesc 数据集信息类。
  34801. * 数据集一般为存储在一起的相关数据的集合;根据数据类型的不同,分为矢量数据集、栅格数据集(griddataset)和
  34802. * 影像数据集(image dataset),以及为了处理特定问题而设计的数据集,如拓扑数据集,网络数据集等。
  34803. * 数据集是 GIS 数据组织的最小单位。其中矢量数据集是由同种类型空间要素组成的集合,
  34804. * 所以也可以称为要素集。根据要素的空间特征的不同,矢量数据集又分为点数据集,
  34805. * 线数据集,面数据集等,各矢量数据集是空间特征和性质相同的数据组织起来的集合。
  34806. * 目前版本支持的数据集主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD 数据集)、
  34807. * 网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。
  34808. * @param {Object} options - 参数。
  34809. * @param {Bounds} [options.bounds] - 数据集范围。
  34810. * @param {string} [options.dataSourceName] - 数据源名称。
  34811. * @param {string} [options.description] - 数据集的描述信息。
  34812. * @param {string} [options.encodeType] - 数据集存储时的压缩编码方式。
  34813. * @param {boolean} [options.isReadOnly] - 数据集是否为只读。
  34814. * @param {string} options.name - 数据集名称。
  34815. * @param {Object} [options.prjCoordSys] - 数据集的投影信息。如:prjCoordSys={"epsgCode":3857}。
  34816. * @param {string} [options.tableName] - 表名。
  34817. * @param {string} options.type - 数据集类型。主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD 数据集)、网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。
  34818. * @usage
  34819. */
  34820. var DatasetInfo = /*#__PURE__*/function () {
  34821. function DatasetInfo(options) {
  34822. DatasetInfo_classCallCheck(this, DatasetInfo);
  34823. options = options || {};
  34824. /**
  34825. * @member {Bounds} [DatasetInfo.prototype.bounds]
  34826. * @description 数据集范围,该字段只读。
  34827. */
  34828. this.bounds = null;
  34829. /**
  34830. * @member {string} [DatasetInfo.prototype.dataSourceName]
  34831. * @description 数据源名称,该字段只读。
  34832. */
  34833. this.dataSourceName = null;
  34834. /**
  34835. * @member {string} [DatasetInfo.prototype.description]
  34836. * @description 数据集的描述信息。
  34837. */
  34838. this.description = null;
  34839. /**
  34840. * @member {string} [DatasetInfo.prototype.encodeType]
  34841. * @description 数据集存储时的压缩编码方式,该字段只读。
  34842. */
  34843. this.encodeType = null;
  34844. /**
  34845. * @member {boolean} [DatasetInfo.prototype.isReadOnly]
  34846. * @description 数据集是否为只读。
  34847. */
  34848. this.isReadOnly = null;
  34849. /**
  34850. * @member {string} DatasetInfo.prototype.name
  34851. * @description 数据集名称,该字段必须且只读。
  34852. */
  34853. this.name = null;
  34854. /**
  34855. * @member {Object} [DatasetInfo.prototype.prjCoordSys]
  34856. * @description 数据集的投影信息。
  34857. */
  34858. this.prjCoordSys = null;
  34859. /**
  34860. * @member {string} [DatasetInfo.prototype.tableName]
  34861. * @description 表名,该字段只读。
  34862. */
  34863. this.tableName = null;
  34864. /**
  34865. * @member {string} DatasetInfo.prototype.type
  34866. * @description 数据集类型,该字段必设。主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD 数据集)、网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。
  34867. */
  34868. this.type = null;
  34869. Util_Util.extend(this, options);
  34870. var b = this.bounds;
  34871. if (b) {
  34872. this.bounds = new Bounds(b.leftBottom.x, b.leftBottom.y, b.rightTop.x, b.rightTop.y);
  34873. }
  34874. this.CLASS_NAME = "SuperMap.DatasetInfo";
  34875. }
  34876. /**
  34877. * @function DatasetInfo.prototype.destroy
  34878. * @description 释放资源,将引用资源的属性置空。
  34879. */
  34880. DatasetInfo_createClass(DatasetInfo, [{
  34881. key: "destroy",
  34882. value: function destroy() {
  34883. Util_Util.reset(this);
  34884. }
  34885. /**
  34886. * @function DatasetInfo.prototype.toServerJSONObject
  34887. * @description 转换成对应的 JSON 格式对象。
  34888. * @returns {Object} JSON 对象。
  34889. */
  34890. }, {
  34891. key: "toServerJSONObject",
  34892. value: function toServerJSONObject() {
  34893. var dataObj = {};
  34894. dataObj = Util_Util.copyAttributes(dataObj, this);
  34895. if (dataObj.bounds) {
  34896. if (dataObj.bounds.toServerJSONObject) {
  34897. dataObj.bounds = dataObj.bounds.toServerJSONObject();
  34898. }
  34899. }
  34900. return dataObj;
  34901. }
  34902. }]);
  34903. return DatasetInfo;
  34904. }();
  34905. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayAnalystParameters.js
  34906. function OverlayAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34907. function OverlayAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  34908. function OverlayAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  34909. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34910. * This program are made available under the terms of the Apache License, Version 2.0
  34911. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34912. /**
  34913. * @class OverlayAnalystParameters
  34914. * @deprecatedclass SuperMap.OverlayAnalystParameters
  34915. * @category iServer SpatialAnalyst OverlayAnalyst
  34916. * @classdesc 叠加分析参数基类。数据集叠加分析参数和几何对象叠加分析参数均继承此基类。
  34917. * @param {Object} options - 参数。
  34918. * @usage
  34919. */
  34920. var OverlayAnalystParameters = /*#__PURE__*/function () {
  34921. function OverlayAnalystParameters(options) {
  34922. OverlayAnalystParameters_classCallCheck(this, OverlayAnalystParameters);
  34923. /**
  34924. * @member {OverlayOperationType} [OverlayAnalystParameters.prototype.operation=OverlayOperationType.UNION]
  34925. * @description 指定叠加分析操作类型。
  34926. */
  34927. this.operation = OverlayOperationType.UNION;
  34928. if (options) {
  34929. Util_Util.extend(this, options);
  34930. }
  34931. this.CLASS_NAME = "SuperMap.OverlayAnalystParameters";
  34932. }
  34933. /**
  34934. * @function OverlayAnalystParameters.prototype.destroy
  34935. * @description 释放资源,将引用资源的属性置空。
  34936. */
  34937. OverlayAnalystParameters_createClass(OverlayAnalystParameters, [{
  34938. key: "destroy",
  34939. value: function destroy() {
  34940. var me = this;
  34941. me.operation = null;
  34942. }
  34943. }]);
  34944. return OverlayAnalystParameters;
  34945. }();
  34946. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetOverlayAnalystParameters.js
  34947. function DatasetOverlayAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return DatasetOverlayAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, DatasetOverlayAnalystParameters_typeof(obj); }
  34948. function DatasetOverlayAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34949. function DatasetOverlayAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  34950. function DatasetOverlayAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetOverlayAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetOverlayAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  34951. function DatasetOverlayAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { DatasetOverlayAnalystParameters_get = Reflect.get.bind(); } else { DatasetOverlayAnalystParameters_get = function _get(target, property, receiver) { var base = DatasetOverlayAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return DatasetOverlayAnalystParameters_get.apply(this, arguments); }
  34952. function DatasetOverlayAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetOverlayAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  34953. function DatasetOverlayAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) DatasetOverlayAnalystParameters_setPrototypeOf(subClass, superClass); }
  34954. function DatasetOverlayAnalystParameters_setPrototypeOf(o, p) { DatasetOverlayAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetOverlayAnalystParameters_setPrototypeOf(o, p); }
  34955. function DatasetOverlayAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = DatasetOverlayAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DatasetOverlayAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DatasetOverlayAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DatasetOverlayAnalystParameters_possibleConstructorReturn(this, result); }; }
  34956. function DatasetOverlayAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetOverlayAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return DatasetOverlayAnalystParameters_assertThisInitialized(self); }
  34957. function DatasetOverlayAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34958. function DatasetOverlayAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  34959. function DatasetOverlayAnalystParameters_getPrototypeOf(o) { DatasetOverlayAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetOverlayAnalystParameters_getPrototypeOf(o); }
  34960. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34961. * This program are made available under the terms of the Apache License, Version 2.0
  34962. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34963. /**
  34964. * @class DatasetOverlayAnalystParameters
  34965. * @deprecatedclass SuperMap.DatasetOverlayAnalystParameters
  34966. * @category iServer SpatialAnalyst OverlayAnalyst
  34967. * @classdesc 数据集叠加分析参数类。
  34968. * @param {Object} options - 参数。
  34969. * @param {string} options.operateDataset -数据集名称。
  34970. * @param {string} options.sourceDataset - 源数据集名称。
  34971. * @param {Array.<string>} [options.operateDatasetFields] - 叠加分析中操作数据集保留在结果数据集中的字段名列表。
  34972. * @param {FilterParameter} [options.operateDatasetFilter] - 设置操作数据集中空间对象过滤条件。
  34973. * @param {Array.<GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject>} [options.operateRegions] - 操作面对象集合,表示与这些面对象进行叠加分析。与 operateDataset 参数互斥,冲突时以 operateDataset 为准。
  34974. * @param {Array.<string>} [options.sourceDatasetFields] - 叠加分析中源数据集保留在结果数据集中的字段名列表。
  34975. * @param {FilterParameter} [options.sourceDatasetFilter] - 设置源数据集中空间对象过滤条件。
  34976. * @param {number} [options.tolerance=0] - 容限。
  34977. * @param {OverlayOperationType} options.operation - 叠加操作枚举值。
  34978. * @param {DataReturnOption} [options.resultSetting] - 结果返回设置类。
  34979. * @extends {GetFeaturesParametersBase}
  34980. * @usage
  34981. */
  34982. var DatasetOverlayAnalystParameters = /*#__PURE__*/function (_OverlayAnalystParame) {
  34983. DatasetOverlayAnalystParameters_inherits(DatasetOverlayAnalystParameters, _OverlayAnalystParame);
  34984. var _super = DatasetOverlayAnalystParameters_createSuper(DatasetOverlayAnalystParameters);
  34985. function DatasetOverlayAnalystParameters(options) {
  34986. var _this;
  34987. DatasetOverlayAnalystParameters_classCallCheck(this, DatasetOverlayAnalystParameters);
  34988. _this = _super.call(this, options);
  34989. /**
  34990. * @member {string} DatasetOverlayAnalystParameters.prototype.operateDataset
  34991. * @description 叠加分析中操作数据集的名称。
  34992. */
  34993. _this.operateDataset = null;
  34994. /**
  34995. * @member {Array.<string>} [DatasetOverlayAnalystParameters.prototype.operateDatasetFields]
  34996. * @description 叠加分析中操作数据集保留在结果数据集中的字段名列表。
  34997. */
  34998. _this.operateDatasetFields = [];
  34999. /**
  35000. * @member {FilterParameter} DatasetOverlayAnalystParameters.prototype.operateDatasetFilter
  35001. * @description 设置操作数据集中空间对象过滤条件。
  35002. */
  35003. _this.operateDatasetFilter = new FilterParameter();
  35004. /**
  35005. * @member {Array.<GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject>} [DatasetOverlayAnalystParameters.prototype.operateRegions]
  35006. * @description 操作面对象集合,表示与这些面对象进行叠加分析。与 operateDataset 参数互斥,冲突时以 operateDataset 为准。
  35007. */
  35008. _this.operateRegions = [];
  35009. /**
  35010. * @member {string} DatasetOverlayAnalystParameters.prototype.sourceDataset
  35011. * @description 叠加分析中源数据集的名称。
  35012. */
  35013. _this.sourceDataset = null;
  35014. /**
  35015. * @member {Array.<string>} [DatasetOverlayAnalystParameters.prototype.sourceDatasetFields]
  35016. * @description 叠加分析中源数据集保留在结果数据集中的字段名列表。
  35017. */
  35018. _this.sourceDatasetFields = [];
  35019. /**
  35020. * @member {FilterParameter} [DatasetOverlayAnalystParameters.prototype.filterQueryParameter]
  35021. * @description 设置源数据集中空间对象过滤条件。
  35022. */
  35023. _this.sourceDatasetFilter = new FilterParameter();
  35024. /**
  35025. * @member {number} [DatasetOverlayAnalystParameters.prototype.tolerance=0]
  35026. * @description 容限。
  35027. */
  35028. _this.tolerance = 0;
  35029. /**
  35030. * @member {DataReturnOption} [DatasetOverlayAnalystParameters.prototype.resultSetting]
  35031. * @description 结果返回设置类。
  35032. */
  35033. _this.resultSetting = new DataReturnOption();
  35034. Util_Util.extend(DatasetOverlayAnalystParameters_assertThisInitialized(_this), options);
  35035. _this.CLASS_NAME = "SuperMap.DatasetOverlayAnalystParameters";
  35036. return _this;
  35037. }
  35038. /**
  35039. * @function DatasetOverlayAnalystParameters.prototype.destroy
  35040. * @override
  35041. */
  35042. DatasetOverlayAnalystParameters_createClass(DatasetOverlayAnalystParameters, [{
  35043. key: "destroy",
  35044. value: function destroy() {
  35045. DatasetOverlayAnalystParameters_get(DatasetOverlayAnalystParameters_getPrototypeOf(DatasetOverlayAnalystParameters.prototype), "destroy", this).call(this);
  35046. var me = this;
  35047. me.operateDataset = null;
  35048. me.operateDatasetFields = null;
  35049. if (me.operateDatasetFilter) {
  35050. me.operateDatasetFilter.destroy();
  35051. me.operateDatasetFilter = null;
  35052. }
  35053. if (me.operateRegions) {
  35054. for (var i = 0, opRegions = me.operateRegions, len = opRegions.length; i < len; i++) {
  35055. opRegions[i].destroy();
  35056. }
  35057. me.operateRegions = null;
  35058. }
  35059. me.sourceDataset = null;
  35060. me.sourceDatasetFields = null;
  35061. if (me.sourceDatasetFilter) {
  35062. me.sourceDatasetFilter.destroy();
  35063. me.sourceDatasetFilter = null;
  35064. }
  35065. me.tolerance = null;
  35066. if (me.resultSetting) {
  35067. me.resultSetting.destroy();
  35068. me.resultSetting = null;
  35069. }
  35070. }
  35071. /**
  35072. * @function DatasetOverlayAnalystParameters.toObject
  35073. * @param {DatasetOverlayAnalystParameters} datasetOverlayAnalystParameters - 数据集叠加分析参数类。
  35074. * @param {DatasetOverlayAnalystParameters} tempObj - 数据集叠加分析参数对象。
  35075. * @description 将数据集叠加分析参数类转换为 JSON 对象。
  35076. * @returns {Object} JSON 对象。
  35077. */
  35078. }], [{
  35079. key: "toObject",
  35080. value: function toObject(datasetOverlayAnalystParameters, tempObj) {
  35081. for (var name in datasetOverlayAnalystParameters) {
  35082. if (name === "sourceDataset") {
  35083. continue;
  35084. } else if (name === "operateRegions") {
  35085. tempObj.operateRegions = [];
  35086. var ors = datasetOverlayAnalystParameters.operateRegions;
  35087. for (var index in ors) {
  35088. if (ors.hasOwnProperty(index)) {
  35089. //icl542
  35090. tempObj.operateRegions[index] = ServerGeometry.fromGeometry(ors[index]);
  35091. }
  35092. }
  35093. } else if (name === "resultSetting") {
  35094. tempObj.dataReturnOption = datasetOverlayAnalystParameters.resultSetting;
  35095. } else {
  35096. tempObj[name] = datasetOverlayAnalystParameters[name];
  35097. }
  35098. }
  35099. }
  35100. }]);
  35101. return DatasetOverlayAnalystParameters;
  35102. }(OverlayAnalystParameters);
  35103. ;// CONCATENATED MODULE: ./src/common/iServer/SurfaceAnalystParametersSetting.js
  35104. function SurfaceAnalystParametersSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35105. function SurfaceAnalystParametersSetting_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  35106. function SurfaceAnalystParametersSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) SurfaceAnalystParametersSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) SurfaceAnalystParametersSetting_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  35107. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35108. * This program are made available under the terms of the Apache License, Version 2.0
  35109. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35110. /**
  35111. * @class SurfaceAnalystParametersSetting
  35112. * @deprecatedclass SuperMap.SurfaceAnalystParametersSetting
  35113. * @category iServer SpatialAnalyst SurfaceAnalyst
  35114. * @classdesc 表面分析参数设置类。
  35115. * 通过该类可以设置表面分析提取等值线、提取等值面的一些参数,包括基准值、等值距、光滑度、光滑方法等。
  35116. * @param {Object} options - 参数。
  35117. * @param {GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject} [options.clipRegion] - 裁剪面对象,如果不需要对操作结果进行裁剪,可以使用 null 值取代该参数。
  35118. * @param {number} [options.datumValue=0] - 提取等值线、提取等值面的基准值。
  35119. * @param {Array.<number>} options.expectedZValues - 期望分析结果的 Z 值集合。
  35120. * @param {number} [options.interval=0] - 等值距。等值距是两条等值线之间的间隔值。
  35121. * @param {number} [options.resampleTolerance=0] - 重采样容限。
  35122. * @param {SmoothMethod} [options.smoothMethod=SmoothMethod.BSPLINE] - 光滑处理所使用的方法。
  35123. * @param {number} [options.smoothness=0] - 等值线或等值面的边界线的光滑度。
  35124. * @usage
  35125. */
  35126. var SurfaceAnalystParametersSetting = /*#__PURE__*/function () {
  35127. function SurfaceAnalystParametersSetting(options) {
  35128. SurfaceAnalystParametersSetting_classCallCheck(this, SurfaceAnalystParametersSetting);
  35129. /**
  35130. * @member {GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject} [SurfaceAnalystParametersSetting.prototype.clipRegion]
  35131. * @description 获取或设置裁剪面对象,如果不需要对操作结果进行裁剪,可以使用 null 值取代该参数。
  35132. */
  35133. this.clipRegion = null;
  35134. /**
  35135. * @member {number} [SurfaceAnalystParametersSetting.prototype.datumValue=0]
  35136. * @description 获取或设置表面分析中提取等值线、提取等值面的基准值。
  35137. * 基准值是作为一个生成等值线的初始起算值,并不一定是最小等值线的值。例如,高程范围为 220 -1550 的 DEM 栅格数据,
  35138. * 如果设基准值为 0,等值距为 50,则提取等值线时,以基准值 0 为起点,等值距 50 为间隔提取等值线,
  35139. * 因为给定高程的最小值是 220,所以,在给定范围内提取等值线的最小高程是 250。
  35140. * 提取等值线的结果是:最小等值线值为 250,最大等值线值为 1550。
  35141. */
  35142. this.datumValue = 0;
  35143. /**
  35144. * @member {Array.<number>} SurfaceAnalystParametersSetting.prototype.expectedZValues
  35145. * @description 获取或设置期望分析结果的 Z 值集合。
  35146. * Z 值集合存储一系列数值,该数值为待提取等值线的值。即仅高程值在 Z 值集合中的等值线会被提取。
  35147. */
  35148. this.expectedZValues = null;
  35149. /**
  35150. * @member {number} [SurfaceAnalystParametersSetting.prototype.interval=0]
  35151. * @description 获取或设置等值距。等值距是两条等值线之间的间隔值。
  35152. */
  35153. this.interval = 0;
  35154. /**
  35155. * @member {number} [SurfaceAnalystParametersSetting.prototype.resampleTolerance=0]
  35156. * @description 获取或设置重采样容限。
  35157. * 容限值越大,采样结果数据越简化。当分析结果出现交叉时,可通过调整重采样容限为较小的值来处理。
  35158. */
  35159. this.resampleTolerance = 0;
  35160. /**
  35161. * @member {SmoothMethod} [SurfaceAnalystParametersSetting.prototype.smoothMethod=SmoothMethod.BSPLINE]
  35162. * @description 获取或设置光滑处理所使用的方法。
  35163. */
  35164. this.smoothMethod = SmoothMethod.BSPLINE;
  35165. /**
  35166. * @member {number} [SurfaceAnalystParametersSetting.prototype.smoothness=0]
  35167. * @description 获取或设置表面分析中等值线或等值面的边界线的光滑度。
  35168. * 以为 0-5 为例,光滑度为 0 表示不进行光滑操作,值越大表示光滑度越高。
  35169. * 随着光滑度的增加,提取的等值线越光滑,当然光滑度越大,
  35170. * 计算所需的时间和占用的内存也就越大。而且,当等值距较小时,
  35171. * 光滑度太高会出现等值线相交的问题。
  35172. */
  35173. this.smoothness = 0;
  35174. if (options) {
  35175. Util_Util.extend(this, options);
  35176. }
  35177. this.CLASS_NAME = "SuperMap.SurfaceAnalystParametersSetting";
  35178. }
  35179. /**
  35180. * @function SurfaceAnalystParametersSetting.prototype.destroy
  35181. * @description 释放资源,将引用资源的属性置空。
  35182. */
  35183. SurfaceAnalystParametersSetting_createClass(SurfaceAnalystParametersSetting, [{
  35184. key: "destroy",
  35185. value: function destroy() {
  35186. var me = this;
  35187. if (me.clipRegion) {
  35188. me.clipRegion.destroy();
  35189. me.clipRegion = null;
  35190. }
  35191. me.datumValue = null;
  35192. me.expectedZValues = null;
  35193. me.interval = null;
  35194. me.resampleTolerance = null;
  35195. me.smoothMethod = null;
  35196. me.smoothness = null;
  35197. }
  35198. /**
  35199. * @function SurfaceAnalystParametersSetting.prototype.toJSON
  35200. * @description 将对象转化为 JSON 字符串。
  35201. * @returns {string} 对象 JSON 字符串。
  35202. */
  35203. }, {
  35204. key: "toJSON",
  35205. value: function toJSON() {
  35206. var json = "'datumValue':" + Util_Util.toJSON(this.datumValue);
  35207. json += ",'interval':" + Util_Util.toJSON(this.interval);
  35208. json += ",'resampleTolerance':" + Util_Util.toJSON(this.resampleTolerance);
  35209. json += ",'smoothMethod':" + Util_Util.toJSON(this.smoothMethod);
  35210. json += ",'smoothness':" + Util_Util.toJSON(this.smoothness);
  35211. if (this.expectedZValues != null) {
  35212. json += "," + "'expectedZValues':" + Util_Util.toJSON(this.expectedZValues);
  35213. }
  35214. if (this.clipRegion != null) {
  35215. var serverGeometry = this.clipRegion;
  35216. if (this.clipRegion instanceof Geometry_Geometry && this.clipRegion.components) {
  35217. serverGeometry = ServerGeometry.fromGeometry(this.clipRegion);
  35218. }
  35219. json += ",'clipRegion':" + Util_Util.toJSON(serverGeometry);
  35220. }
  35221. return "{" + json + "}";
  35222. }
  35223. }]);
  35224. return SurfaceAnalystParametersSetting;
  35225. }();
  35226. ;// CONCATENATED MODULE: ./src/common/iServer/SurfaceAnalystParameters.js
  35227. function SurfaceAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35228. function SurfaceAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  35229. function SurfaceAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SurfaceAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SurfaceAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  35230. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35231. * This program are made available under the terms of the Apache License, Version 2.0
  35232. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35233. /**
  35234. * @class SurfaceAnalystParameters
  35235. * @deprecatedclass SuperMap.SurfaceAnalystParameters
  35236. * @category iServer SpatialAnalyst SurfaceAnalyst
  35237. * @classdesc 表面分析提取操作参数类。通过该类可以为进行表面分析提供参数信息,包括表面分析的方法提取等值线、提取等值面和中间结果的分辨率,
  35238. * {@link DatasetSurfaceAnalystParameters} 和 {@link GeometrySurfaceAnalystParameters} 继承自该类。
  35239. * @param {Object} options - 参数。
  35240. * @param {SurfaceAnalystParametersSetting} options.extractParameter - 表面分析参数设置类。
  35241. * @param {number} options.resolution - 指定中间结果(栅格数据集)的分辨率。
  35242. * @param {DataReturnOption} options.resultSetting - 结果返回设置类。
  35243. * @param {SurfaceAnalystMethod} [options.surfaceAnalystMethod=SurfaceAnalystMethod.ISOLINE] - 获取或设置表面分析的提取方法,提取等值线和提取等值面。
  35244. * @usage
  35245. */
  35246. var SurfaceAnalystParameters = /*#__PURE__*/function () {
  35247. function SurfaceAnalystParameters(options) {
  35248. SurfaceAnalystParameters_classCallCheck(this, SurfaceAnalystParameters);
  35249. /**
  35250. * @member {number} SurfaceAnalystParameters.prototype.resolution
  35251. * @description 获取或设置指定中间结果(栅格数据集)的分辨率。
  35252. */
  35253. this.resolution = 0;
  35254. /**
  35255. * @member {SurfaceAnalystParametersSetting} SurfaceAnalystParameters.prototype.extractParameter
  35256. * @description 获取或设置表面分析参数。
  35257. * 在进行点数据集进行提取等值面分析时,暂时不支持 SurfaceAnalystParametersSetting 类中的 expectedZValues 字段。
  35258. */
  35259. this.extractParameter = new SurfaceAnalystParametersSetting();
  35260. /**
  35261. * @member {DataReturnOption} SurfaceAnalystParameters.prototype.resultSetting
  35262. * @description 结果返回设置类。
  35263. */
  35264. this.resultSetting = new DataReturnOption();
  35265. /**
  35266. * @member {SurfaceAnalystMethod} [SurfaceAnalystParameters.prototype.surfaceAnalystMethod=SurfaceAnalystMethod.ISOLINE]
  35267. * @description 获取或设置表面分析的提取方法,提取等值线和提取等值面。
  35268. */
  35269. this.surfaceAnalystMethod = SurfaceAnalystMethod.ISOLINE;
  35270. if (options) {
  35271. Util_Util.extend(this, options);
  35272. }
  35273. this.CLASS_NAME = "SuperMap.SurfaceAnalystParameters";
  35274. }
  35275. /**
  35276. * @function SurfaceAnalystParameters.prototype.destroy
  35277. * @description 释放资源,将引用资源的属性置空。
  35278. */
  35279. SurfaceAnalystParameters_createClass(SurfaceAnalystParameters, [{
  35280. key: "destroy",
  35281. value: function destroy() {
  35282. var me = this;
  35283. me.resolution = null;
  35284. if (me.extractParameter) {
  35285. me.extractParameter.destroy();
  35286. me.extractParameter = null;
  35287. }
  35288. if (me.resultSetting) {
  35289. me.resultSetting.destroy();
  35290. me.resultSetting = null;
  35291. }
  35292. me.surfaceAnalystMethod = null;
  35293. }
  35294. }]);
  35295. return SurfaceAnalystParameters;
  35296. }();
  35297. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetSurfaceAnalystParameters.js
  35298. function DatasetSurfaceAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return DatasetSurfaceAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, DatasetSurfaceAnalystParameters_typeof(obj); }
  35299. function DatasetSurfaceAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35300. function DatasetSurfaceAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  35301. function DatasetSurfaceAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetSurfaceAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetSurfaceAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  35302. function DatasetSurfaceAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { DatasetSurfaceAnalystParameters_get = Reflect.get.bind(); } else { DatasetSurfaceAnalystParameters_get = function _get(target, property, receiver) { var base = DatasetSurfaceAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return DatasetSurfaceAnalystParameters_get.apply(this, arguments); }
  35303. function DatasetSurfaceAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetSurfaceAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  35304. function DatasetSurfaceAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) DatasetSurfaceAnalystParameters_setPrototypeOf(subClass, superClass); }
  35305. function DatasetSurfaceAnalystParameters_setPrototypeOf(o, p) { DatasetSurfaceAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetSurfaceAnalystParameters_setPrototypeOf(o, p); }
  35306. function DatasetSurfaceAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = DatasetSurfaceAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DatasetSurfaceAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DatasetSurfaceAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DatasetSurfaceAnalystParameters_possibleConstructorReturn(this, result); }; }
  35307. function DatasetSurfaceAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetSurfaceAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return DatasetSurfaceAnalystParameters_assertThisInitialized(self); }
  35308. function DatasetSurfaceAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35309. function DatasetSurfaceAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  35310. function DatasetSurfaceAnalystParameters_getPrototypeOf(o) { DatasetSurfaceAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetSurfaceAnalystParameters_getPrototypeOf(o); }
  35311. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35312. * This program are made available under the terms of the Apache License, Version 2.0
  35313. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35314. /**
  35315. * @class DatasetSurfaceAnalystParameters
  35316. * @deprecatedclass SuperMap.DatasetSurfaceAnalystParameters
  35317. * @category iServer SpatialAnalyst SurfaceAnalyst
  35318. * @classdesc 数据集表面分析参数类。该类对数据集表面分析所用到的参数进行设置。
  35319. * @param {Object} options - 参数。
  35320. * @param {string} options.dataset - 数据集名称。
  35321. * @param {string} options.zValueFieldName - 字段名称。
  35322. * @param {number} options.resolution - 指定中间结果(栅格数据集)的分辨率。
  35323. * @param {SurfaceAnalystParametersSetting} options.extractParameter - 表面分析参数设置类。获取或设置表面分析参数。
  35324. * @param {FilterParameter} [options.filterQueryParameter] - 查询过滤条件参数。
  35325. * @param {DataReturnOption} [options.resultSetting] - 结果返回设置类。
  35326. * @param {SurfaceAnalystMethod} [options.surfaceAnalystMethod=SurfaceAnalystMethod.ISOLINE] - 表面分析的提取方法,提取等值线和提取等值面。
  35327. * @extends {SurfaceAnalystParameters}
  35328. * @usage
  35329. */
  35330. var DatasetSurfaceAnalystParameters = /*#__PURE__*/function (_SurfaceAnalystParame) {
  35331. DatasetSurfaceAnalystParameters_inherits(DatasetSurfaceAnalystParameters, _SurfaceAnalystParame);
  35332. var _super = DatasetSurfaceAnalystParameters_createSuper(DatasetSurfaceAnalystParameters);
  35333. function DatasetSurfaceAnalystParameters(options) {
  35334. var _this;
  35335. DatasetSurfaceAnalystParameters_classCallCheck(this, DatasetSurfaceAnalystParameters);
  35336. _this = _super.call(this, options);
  35337. /**
  35338. * @member {string} DatasetSurfaceAnalystParameters.prototype.dataset
  35339. * @description 要用来做数据集表面分析的数据源中数据集的名称。该名称用形如 "数据集名称@数据源别名" 形式来表示,例如:Country@World。
  35340. */
  35341. _this.dataset = null;
  35342. /**
  35343. * @member {FilterParameter} DatasetSurfaceAnalystParameters.prototype.filterQueryParameter
  35344. * @description 获取或设置查询过滤条件参数。
  35345. */
  35346. _this.filterQueryParameter = new FilterParameter();
  35347. /**
  35348. * @member {string} DatasetSurfaceAnalystParameters.prototype.zValueFieldName
  35349. * @description 获取或设置用于提取操作的字段名称。提取等值线时,将使用该字段中的值,对点记录集中的点数据进行插值分析,得到栅格数据集(中间结果),接着从栅格数据集提取等值线。
  35350. */
  35351. _this.zValueFieldName = null;
  35352. if (options) {
  35353. Util_Util.extend(DatasetSurfaceAnalystParameters_assertThisInitialized(_this), options);
  35354. }
  35355. _this.CLASS_NAME = "SuperMap.DatasetSurfaceAnalystParameters";
  35356. return _this;
  35357. }
  35358. /**
  35359. * @function DatasetSurfaceAnalystParameters.prototype.destroy
  35360. * @override
  35361. */
  35362. DatasetSurfaceAnalystParameters_createClass(DatasetSurfaceAnalystParameters, [{
  35363. key: "destroy",
  35364. value: function destroy() {
  35365. DatasetSurfaceAnalystParameters_get(DatasetSurfaceAnalystParameters_getPrototypeOf(DatasetSurfaceAnalystParameters.prototype), "destroy", this).call(this);
  35366. var me = this;
  35367. me.dataset = null;
  35368. if (me.filterQueryParameter) {
  35369. me.filterQueryParameter.destroy();
  35370. me.filterQueryParameter = null;
  35371. }
  35372. me.zValueFieldName = null;
  35373. }
  35374. /**
  35375. * @function DatasetSurfaceAnalystParameters.toObject
  35376. * @param {DatasetSurfaceAnalystParameters} datasetSurfaceAnalystParameters - 数据集表面分析参数类。
  35377. * @param {DatasetSurfaceAnalystParameters} tempObj - 数据集表面分析参数对象。
  35378. * @description 将数据集表面分析参数对象转换为 JSON 对象。
  35379. * @returns JSON 对象。
  35380. */
  35381. }], [{
  35382. key: "toObject",
  35383. value: function toObject(datasetSurfaceAnalystParameters, tempObj) {
  35384. for (var name in datasetSurfaceAnalystParameters) {
  35385. if (name === "filterQueryParameter") {
  35386. tempObj.filterQueryParameter = datasetSurfaceAnalystParameters.filterQueryParameter;
  35387. }
  35388. if (name === "extractParameter") {
  35389. if (datasetSurfaceAnalystParameters.extractParameter.clipRegion instanceof Geometry_Geometry && datasetSurfaceAnalystParameters.extractParameter.clipRegion.components) {
  35390. datasetSurfaceAnalystParameters.extractParameter.clipRegion = ServerGeometry.fromGeometry(datasetSurfaceAnalystParameters.extractParameter.clipRegion);
  35391. }
  35392. tempObj.extractParameter = datasetSurfaceAnalystParameters.extractParameter;
  35393. } else if (name === "dataset") {
  35394. continue;
  35395. } else if (name === "surfaceAnalystMethod") {
  35396. continue;
  35397. } else {
  35398. tempObj[name] = datasetSurfaceAnalystParameters[name];
  35399. }
  35400. }
  35401. }
  35402. }]);
  35403. return DatasetSurfaceAnalystParameters;
  35404. }(SurfaceAnalystParameters);
  35405. ;// CONCATENATED MODULE: ./src/common/iServer/ThiessenAnalystParameters.js
  35406. function ThiessenAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35407. function ThiessenAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  35408. function ThiessenAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThiessenAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThiessenAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  35409. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35410. * This program are made available under the terms of the Apache License, Version 2.0
  35411. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35412. /**
  35413. * @class ThiessenAnalystParameters
  35414. * @deprecatedclass SuperMap.ThiessenAnalystParameters
  35415. * @category iServer SpatialAnalyst ThiessenPolygonAnalyst
  35416. * @classdesc 泰森多边形分析参数基类。
  35417. * @param {Object} options - 可选参数。
  35418. * @param {GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject} [options.clipRegion] - 结果数据裁剪区域,可以为 null,表示不对结果进行裁剪。
  35419. * @param {boolean} [options.createResultDataset=false] - 是否返回结果数据集。
  35420. * @param {string} [options.resultDatasetName] - 指定结果数据集名称。
  35421. * @param {string} [options.resultDatasourceName] - 指定结果数据集所在数据源,默认为当前数据源。
  35422. * @param {boolean} [options.returnResultRegion=true] - 是否返回分析得到的多边形面数组。
  35423. * @usage
  35424. */
  35425. var ThiessenAnalystParameters = /*#__PURE__*/function () {
  35426. function ThiessenAnalystParameters(options) {
  35427. ThiessenAnalystParameters_classCallCheck(this, ThiessenAnalystParameters);
  35428. if (!options) {
  35429. return;
  35430. }
  35431. /**
  35432. * @member {GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject} [ThiessenAnalystParameters.prototype.clipRegion]
  35433. * @description 结果数据裁剪区域,可以为 null,表示不对结果进行裁剪。
  35434. */
  35435. this.clipRegion = null;
  35436. /**
  35437. * @member {boolean} [ThiessenAnalystParameters.prototype.createResultDataset=false]
  35438. * @description 是否返回结果数据集。如果为 true,则必须设置属性 resultDatasetName 和 resultDatasourceName。
  35439. */
  35440. this.createResultDataset = false;
  35441. /**
  35442. * @member {string} ThiessenAnalystParameters.prototype.resultDatasetName
  35443. * @description 指定结果数据集名称。
  35444. */
  35445. this.resultDatasetName = null;
  35446. /**
  35447. * @member {string} ThiessenAnalystParameters.prototype.resultDatasourceName
  35448. * @description 指定结果数据集所在数据源。
  35449. */
  35450. this.resultDatasourceName = null;
  35451. /**
  35452. * @member {boolean} ThiessenAnalystParameters.prototype.returnResultRegion
  35453. * @description 是否返回分析得到的多边形面数组。
  35454. */
  35455. this.returnResultRegion = true;
  35456. Util_Util.extend(this, options);
  35457. this.CLASS_NAME = "SuperMap.ThiessenAnalystParameters";
  35458. }
  35459. /**
  35460. * @function ThiessenAnalystParameters.prototype.destroy
  35461. * @description 释放资源,将引用资源的属性置空。
  35462. */
  35463. ThiessenAnalystParameters_createClass(ThiessenAnalystParameters, [{
  35464. key: "destroy",
  35465. value: function destroy() {
  35466. var me = this;
  35467. if (me.clipRegion) {
  35468. me.clipRegion.destroy();
  35469. me.clipRegion = null;
  35470. }
  35471. me.createResultDataset = null;
  35472. me.resultDatasetName = null;
  35473. me.resultDatasourceName = null;
  35474. me.returnResultRegion = null;
  35475. }
  35476. }]);
  35477. return ThiessenAnalystParameters;
  35478. }();
  35479. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetThiessenAnalystParameters.js
  35480. function DatasetThiessenAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return DatasetThiessenAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, DatasetThiessenAnalystParameters_typeof(obj); }
  35481. function DatasetThiessenAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35482. function DatasetThiessenAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  35483. function DatasetThiessenAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetThiessenAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetThiessenAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  35484. function DatasetThiessenAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { DatasetThiessenAnalystParameters_get = Reflect.get.bind(); } else { DatasetThiessenAnalystParameters_get = function _get(target, property, receiver) { var base = DatasetThiessenAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return DatasetThiessenAnalystParameters_get.apply(this, arguments); }
  35485. function DatasetThiessenAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetThiessenAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  35486. function DatasetThiessenAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) DatasetThiessenAnalystParameters_setPrototypeOf(subClass, superClass); }
  35487. function DatasetThiessenAnalystParameters_setPrototypeOf(o, p) { DatasetThiessenAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetThiessenAnalystParameters_setPrototypeOf(o, p); }
  35488. function DatasetThiessenAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = DatasetThiessenAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DatasetThiessenAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DatasetThiessenAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DatasetThiessenAnalystParameters_possibleConstructorReturn(this, result); }; }
  35489. function DatasetThiessenAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetThiessenAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return DatasetThiessenAnalystParameters_assertThisInitialized(self); }
  35490. function DatasetThiessenAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35491. function DatasetThiessenAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  35492. function DatasetThiessenAnalystParameters_getPrototypeOf(o) { DatasetThiessenAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetThiessenAnalystParameters_getPrototypeOf(o); }
  35493. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35494. * This program are made available under the terms of the Apache License, Version 2.0
  35495. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35496. /**
  35497. * @class DatasetThiessenAnalystParameters
  35498. * @deprecatedclass SuperMap.DatasetThiessenAnalystParameters
  35499. * @category iServer SpatialAnalyst ThiessenAnalyst
  35500. * @classdesc 数据集泰森多边形分析参数类。
  35501. * @param {Object} options - 参数。
  35502. * @param {FilterParameter} [options.filterQueryParameter] - 过滤参数类,即对数据集中的所有点进行分析。
  35503. * @extends {ThiessenAnalystParameters}
  35504. * @usage
  35505. */
  35506. var DatasetThiessenAnalystParameters = /*#__PURE__*/function (_ThiessenAnalystParam) {
  35507. DatasetThiessenAnalystParameters_inherits(DatasetThiessenAnalystParameters, _ThiessenAnalystParam);
  35508. var _super = DatasetThiessenAnalystParameters_createSuper(DatasetThiessenAnalystParameters);
  35509. function DatasetThiessenAnalystParameters(options) {
  35510. var _this;
  35511. DatasetThiessenAnalystParameters_classCallCheck(this, DatasetThiessenAnalystParameters);
  35512. _this = _super.call(this, options);
  35513. /**
  35514. * @member {FilterParameter} [DatasetThiessenAnalystParameters.prototype.filterQueryParameter]
  35515. * @description 过滤条件,对待分析数据集中的点进行过滤,即对数据集中的所有点进行分析。
  35516. * @example
  35517. * var filterQueryParameter = new FilterParameter({
  35518. * name: "Countries@World",
  35519. * attributeFilter: "SmID>100"
  35520. * });
  35521. */
  35522. _this.filterQueryParameter = null;
  35523. /**
  35524. * @member {string} DatasetThiessenAnalystParameters.prototype.dataset
  35525. * @description 数据集名称待分析的数据集名称,请使用 "datasetName@datasourceName" 格式来表示。
  35526. */
  35527. _this.dataset = null;
  35528. if (options) {
  35529. Util_Util.extend(DatasetThiessenAnalystParameters_assertThisInitialized(_this), options);
  35530. }
  35531. _this.CLASS_NAME = "SuperMap.DatasetThiessenAnalystParameters";
  35532. return _this;
  35533. }
  35534. /**
  35535. * @function DatasetThiessenAnalystParameters.prototype.destroy
  35536. * @override
  35537. */
  35538. DatasetThiessenAnalystParameters_createClass(DatasetThiessenAnalystParameters, [{
  35539. key: "destroy",
  35540. value: function destroy() {
  35541. DatasetThiessenAnalystParameters_get(DatasetThiessenAnalystParameters_getPrototypeOf(DatasetThiessenAnalystParameters.prototype), "destroy", this).call(this);
  35542. var me = this;
  35543. if (me.filterQueryParameter) {
  35544. me.filterQueryParameter.destroy();
  35545. me.filterQueryParameter = null;
  35546. }
  35547. }
  35548. /**
  35549. * @function DatasetThiessenAnalystParameters.toObject
  35550. * @param {DatasetThiessenAnalystParameters} datasetThiessenAnalystParameters - 泰森多边形分析服务参数类。
  35551. * @param {DatasetThiessenAnalystParameters} tempObj - 泰森多边形分析服务参数对象。
  35552. * @description 将泰森多边形分析服务参数对象转换为 JSON 对象。
  35553. * @returns JSON 对象。
  35554. */
  35555. }], [{
  35556. key: "toObject",
  35557. value: function toObject(datasetThiessenAnalystParameters, tempObj) {
  35558. for (var name in datasetThiessenAnalystParameters) {
  35559. if (name === "clipRegion") {
  35560. tempObj.clipRegion = ServerGeometry.fromGeometry(datasetThiessenAnalystParameters.clipRegion);
  35561. } else {
  35562. tempObj[name] = datasetThiessenAnalystParameters[name];
  35563. }
  35564. }
  35565. }
  35566. }]);
  35567. return DatasetThiessenAnalystParameters;
  35568. }(ThiessenAnalystParameters);
  35569. ;// CONCATENATED MODULE: ./src/common/iServer/DatasourceService.js
  35570. function DatasourceService_typeof(obj) { "@babel/helpers - typeof"; return DatasourceService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, DatasourceService_typeof(obj); }
  35571. function DatasourceService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35572. function DatasourceService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  35573. function DatasourceService_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasourceService_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasourceService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  35574. function DatasourceService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { DatasourceService_get = Reflect.get.bind(); } else { DatasourceService_get = function _get(target, property, receiver) { var base = DatasourceService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return DatasourceService_get.apply(this, arguments); }
  35575. function DatasourceService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasourceService_getPrototypeOf(object); if (object === null) break; } return object; }
  35576. function DatasourceService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) DatasourceService_setPrototypeOf(subClass, superClass); }
  35577. function DatasourceService_setPrototypeOf(o, p) { DatasourceService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasourceService_setPrototypeOf(o, p); }
  35578. function DatasourceService_createSuper(Derived) { var hasNativeReflectConstruct = DatasourceService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DatasourceService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DatasourceService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DatasourceService_possibleConstructorReturn(this, result); }; }
  35579. function DatasourceService_possibleConstructorReturn(self, call) { if (call && (DatasourceService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return DatasourceService_assertThisInitialized(self); }
  35580. function DatasourceService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35581. function DatasourceService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  35582. function DatasourceService_getPrototypeOf(o) { DatasourceService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasourceService_getPrototypeOf(o); }
  35583. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35584. * This program are made available under the terms of the Apache License, Version 2.0
  35585. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35586. /**
  35587. * @class DatasourceService
  35588. * @deprecatedclass SuperMap.DatasourceService
  35589. * @category iServer Data Datasource
  35590. * @classdesc 数据源查询服务类。
  35591. * @param {string} url - 服务地址。如访问World Data服务,只需将url设为:http://localhost:8090/iserver/services/data-world/rest/data 即可。
  35592. * @param {Object} options - 参数。
  35593. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  35594. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  35595. * @param {string} options.datasource - 要查询的数据集所在的数据源名称。
  35596. * @param {string} options.dataset - 要查询的数据集名称。
  35597. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35598. * @param {Object} [options.headers] - 请求头。
  35599. * @extends {CommonServiceBase}
  35600. * @usage
  35601. */
  35602. var DatasourceService_DatasourceService = /*#__PURE__*/function (_CommonServiceBase) {
  35603. DatasourceService_inherits(DatasourceService, _CommonServiceBase);
  35604. var _super = DatasourceService_createSuper(DatasourceService);
  35605. function DatasourceService(url, options) {
  35606. var _this;
  35607. DatasourceService_classCallCheck(this, DatasourceService);
  35608. _this = _super.call(this, url, options);
  35609. if (options) {
  35610. Util_Util.extend(DatasourceService_assertThisInitialized(_this), options);
  35611. }
  35612. _this.eventCount = 0;
  35613. _this.CLASS_NAME = "SuperMap.DatasourceService";
  35614. return _this;
  35615. }
  35616. /**
  35617. * @function DatasourceService.prototype.destroy
  35618. * @override
  35619. */
  35620. DatasourceService_createClass(DatasourceService, [{
  35621. key: "destroy",
  35622. value: function destroy() {
  35623. this.eventCount = 0;
  35624. DatasourceService_get(DatasourceService_getPrototypeOf(DatasourceService.prototype), "destroy", this).call(this);
  35625. }
  35626. /**
  35627. * @function DatasourceService.prototype.getDatasourceService
  35628. * @description 获取指定数据源信息。
  35629. */
  35630. }, {
  35631. key: "getDatasourceService",
  35632. value: function getDatasourceService(datasourceName, callback) {
  35633. var url = Util_Util.urlPathAppend(this.url, "datasources/name/".concat(datasourceName));
  35634. this.processAsync(url, "GET", callback);
  35635. }
  35636. /**
  35637. * @function DatasourceService.prototype.getDatasourcesService
  35638. * @description 获取所有数据源信息。
  35639. */
  35640. }, {
  35641. key: "getDatasourcesService",
  35642. value: function getDatasourcesService(callback) {
  35643. var url = Util_Util.urlPathAppend(this.url, "datasources");
  35644. this.processAsync(url, "GET", callback);
  35645. }
  35646. /**
  35647. * @function DatasourceService.prototype.setDatasourceService
  35648. * @description 更新数据源信息。
  35649. */
  35650. }, {
  35651. key: "setDatasourceService",
  35652. value: function setDatasourceService(params, callback) {
  35653. if (!params) {
  35654. return;
  35655. }
  35656. var url = Util_Util.urlPathAppend(this.url, "datasources/name/".concat(params.datasourceName));
  35657. this.processAsync(url, "PUT", callback, params);
  35658. }
  35659. }, {
  35660. key: "processAsync",
  35661. value: function processAsync(url, method, callback, params) {
  35662. var eventId = ++this.eventCount;
  35663. var eventListeners = {
  35664. scope: this,
  35665. processCompleted: function processCompleted(result) {
  35666. if (eventId === result.result.eventId && callback) {
  35667. delete result.result.eventId;
  35668. callback(result);
  35669. this.events && this.events.un(eventListeners);
  35670. return false;
  35671. }
  35672. },
  35673. processFailed: function processFailed(result) {
  35674. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  35675. callback(result);
  35676. this.events && this.events.un(eventListeners);
  35677. return false;
  35678. }
  35679. }
  35680. };
  35681. this.events.on(eventListeners);
  35682. var me = this;
  35683. var requestConfig = {
  35684. url: url,
  35685. method: method,
  35686. scope: me,
  35687. success: function success(result, options) {
  35688. result.eventId = eventId;
  35689. this.serviceProcessCompleted(result, options);
  35690. },
  35691. failure: function failure(result, options) {
  35692. if (result.error) {
  35693. result.error.eventId = eventId;
  35694. }
  35695. result.eventId = eventId;
  35696. this.serviceProcessFailed(result, options);
  35697. }
  35698. };
  35699. params && (requestConfig.data = Util_Util.toJSON(params));
  35700. me.request(requestConfig);
  35701. }
  35702. }]);
  35703. return DatasourceService;
  35704. }(CommonServiceBase);
  35705. ;// CONCATENATED MODULE: ./src/common/iServer/DensityKernelAnalystParameters.js
  35706. function DensityKernelAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35707. function DensityKernelAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  35708. function DensityKernelAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DensityKernelAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DensityKernelAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  35709. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35710. * This program are made available under the terms of the Apache License, Version 2.0
  35711. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35712. /**
  35713. * @class DensityKernelAnalystParameters
  35714. * @deprecatedclass SuperMap.DensityKernelAnalystParameters
  35715. * @category iServer SpatialAnalyst DensityAnalyst
  35716. * @classdesc 核密度分析参数类。
  35717. * @param {Object} options - 参数。
  35718. * @param {string} options.dataset - 要用来做核密度分析数据源中数据集的名称。该名称用形如 "数据集名称@数据源别名" 形式来表示,例如:BaseMap_P@Jingjin。
  35719. * @param {string} options.fieldName - 用于进行核密度分析的测量值的字段名称,核密度分析不支持文本类型的字段。
  35720. * @param {string} options.resultGridName - 指定结果数据集名称。
  35721. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} [options.bounds] - 核密度分析的范围,用于确定结果栅格数据集的范围。如果缺省,则默认为原数据集的范围。
  35722. * @param {number} [options.searchRadius] - 栅格邻域内用于计算密度的查找半径,单位与当前数据集相同。默认值为当前数据集的长宽中的最大值除30。
  35723. * @param {number} [options.resultGridDatasetResolution] - 密度分析结果栅格数据的分辨率,单位与当前数据集相同。默认值为当前数据集的长宽中的最小值除500。
  35724. * @param {string} [options.targetDatasource] - 指定的存储结果数据集的数据源,默认为当前分析的数据集所在的数据源。
  35725. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  35726. * @usage
  35727. */
  35728. var DensityKernelAnalystParameters = /*#__PURE__*/function () {
  35729. function DensityKernelAnalystParameters(options) {
  35730. DensityKernelAnalystParameters_classCallCheck(this, DensityKernelAnalystParameters);
  35731. /**
  35732. * @member {string} DensityKernelAnalystParameters.prototype.dataset
  35733. * @description 要用来做核密度分析数据源中数据集的名称。
  35734. * 该名称用形如 "数据集名称@数据源别名" 形式来表示,例如:Railway@Changchun。
  35735. * 注:核密度分析支持点数据集和线数据集。
  35736. */
  35737. this.dataset = null;
  35738. /**
  35739. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} [DensityKernelAnalystParameters.prototype.bounds]
  35740. * @description 核密度分析的范围,用于确定结果栅格数据集的范围。
  35741. * 如果缺省,则默认为原数据集的范围。
  35742. */
  35743. this.bounds = null;
  35744. /**
  35745. * @member {string} DensityKernelAnalystParameters.prototype.fieldName
  35746. * @description 用于进行核密度分析的测量值的字段名称,核密度分析不支持文本类型的字段。
  35747. */
  35748. this.fieldName = null;
  35749. /**
  35750. * @member {number} [DensityKernelAnalystParameters.prototype.resultGridDatasetResolution]
  35751. * @description 密度分析结果栅格数据的分辨率,单位与当前数据集相同。默认值为当前数据集的长宽中的最小值除500。
  35752. */
  35753. this.resultGridDatasetResolution = null;
  35754. /**
  35755. * @member {number} [DensityKernelAnalystParameters.prototype.searchRadius]
  35756. * @description 栅格邻域内用于计算密度的查找半径,单位与当前数据集相同。默认值为当前数据集的长宽中的最大值除30。
  35757. */
  35758. this.searchRadius = null;
  35759. /**
  35760. * @member {string} [DensityKernelAnalystParameters.prototype.targetDatasource]
  35761. * @description 指定的存储结果数据集的数据源,默认为当前分析的数据集所在的数据源。
  35762. */
  35763. this.targetDatasource = null;
  35764. /**
  35765. * @member {string} DensityKernelAnalystParameters.prototype.resultGridName
  35766. * @description 指定结果数据集名称。
  35767. */
  35768. this.resultGridName = null;
  35769. /**
  35770. * @member {boolean} [DensityKernelAnalystParameters.prototype.deleteExistResultDataset=false]
  35771. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  35772. */
  35773. this.deleteExistResultDataset = false;
  35774. Util_Util.extend(this, options);
  35775. this.CLASS_NAME = "SuperMap.DensityKernelAnalystParameters";
  35776. }
  35777. /**
  35778. * @function DensityKernelAnalystParameters.prototype.destroy
  35779. * @description 释放资源,将引用资源的属性置空。
  35780. */
  35781. DensityKernelAnalystParameters_createClass(DensityKernelAnalystParameters, [{
  35782. key: "destroy",
  35783. value: function destroy() {
  35784. var me = this;
  35785. me.dataset = null;
  35786. me.bounds = null;
  35787. me.fieldName = null;
  35788. me.resultGridDatasetResolution = null;
  35789. me.searchRadius = null;
  35790. me.targetDatasource = null;
  35791. me.resultGridName = null;
  35792. me.deleteExistResultDataset = null;
  35793. }
  35794. /**
  35795. * @function DensityKernelAnalystParameters.toObject
  35796. * @param {DensityKernelAnalystParameters} densityKernelAnalystParameters -核密度分析参数类。
  35797. * @param {DensityKernelAnalystParameters} tempObj - 核密度分析参数对象。
  35798. * @description 将核密度分析参数对象转换成 JSON 对象。
  35799. * @returns JSON 对象。
  35800. */
  35801. }], [{
  35802. key: "toObject",
  35803. value: function toObject(densityKernelAnalystParameters, tempObj) {
  35804. for (var name in densityKernelAnalystParameters) {
  35805. if (name !== "dataset") {
  35806. tempObj[name] = densityKernelAnalystParameters[name];
  35807. }
  35808. }
  35809. }
  35810. }]);
  35811. return DensityKernelAnalystParameters;
  35812. }();
  35813. ;// CONCATENATED MODULE: ./src/common/iServer/DensityAnalystService.js
  35814. function DensityAnalystService_typeof(obj) { "@babel/helpers - typeof"; return DensityAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, DensityAnalystService_typeof(obj); }
  35815. function DensityAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35816. function DensityAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  35817. function DensityAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) DensityAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) DensityAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  35818. function DensityAnalystService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { DensityAnalystService_get = Reflect.get.bind(); } else { DensityAnalystService_get = function _get(target, property, receiver) { var base = DensityAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return DensityAnalystService_get.apply(this, arguments); }
  35819. function DensityAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DensityAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  35820. function DensityAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) DensityAnalystService_setPrototypeOf(subClass, superClass); }
  35821. function DensityAnalystService_setPrototypeOf(o, p) { DensityAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DensityAnalystService_setPrototypeOf(o, p); }
  35822. function DensityAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = DensityAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DensityAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DensityAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DensityAnalystService_possibleConstructorReturn(this, result); }; }
  35823. function DensityAnalystService_possibleConstructorReturn(self, call) { if (call && (DensityAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return DensityAnalystService_assertThisInitialized(self); }
  35824. function DensityAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35825. function DensityAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  35826. function DensityAnalystService_getPrototypeOf(o) { DensityAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DensityAnalystService_getPrototypeOf(o); }
  35827. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35828. * This program are made available under the terms of the Apache License, Version 2.0
  35829. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35830. /**
  35831. * @class DensityAnalystService
  35832. * @deprecatedclass SuperMap.DensityAnalystService
  35833. * @category iServer SpatialAnalyst DensityAnalyst
  35834. * @classdesc
  35835. * 密度分析服务类,密度分析可计算每个输出栅格像元周围圆形邻域内输入的点或线对象的密度。
  35836. * 密度分析,在某种意义上来说,相当于在表面上将输入的点线对象的测量值散开来,将每个点或线对象的测量量分布在整个研究区域,并计算输出栅格中每个像元的密度值。目前提供1种密度分析:核密度分析(Kernel)。
  35837. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst 。
  35838. * @param {Object} options - 参数。
  35839. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  35840. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35841. * @param {Object} [options.headers] - 请求头。
  35842. * @extends {SpatialAnalystBase}
  35843. * @example 例如:
  35844. * var myDensityAnalystService = new DensityAnalystService(url);
  35845. * myDensityAnalystService.on({
  35846. * "processCompleted": processCompleted,
  35847. * "processFailed": processFailed
  35848. * }
  35849. * );
  35850. * @usage
  35851. */
  35852. var DensityAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  35853. DensityAnalystService_inherits(DensityAnalystService, _SpatialAnalystBase);
  35854. var _super = DensityAnalystService_createSuper(DensityAnalystService);
  35855. function DensityAnalystService(url, options) {
  35856. var _this;
  35857. DensityAnalystService_classCallCheck(this, DensityAnalystService);
  35858. _this = _super.call(this, url, options);
  35859. /**
  35860. * @member {string} DensityAnalystService.prototype.mode
  35861. * @description 密度分析类型。
  35862. */
  35863. _this.mode = null;
  35864. if (options) {
  35865. Util_Util.extend(DensityAnalystService_assertThisInitialized(_this), options);
  35866. }
  35867. _this.CLASS_NAME = "SuperMap.DensityAnalystService";
  35868. return _this;
  35869. }
  35870. /**
  35871. * @function DensityAnalystService.prototype.destroy
  35872. * @description 释放资源,将引用资源的属性置空。
  35873. */
  35874. DensityAnalystService_createClass(DensityAnalystService, [{
  35875. key: "destroy",
  35876. value: function destroy() {
  35877. DensityAnalystService_get(DensityAnalystService_getPrototypeOf(DensityAnalystService.prototype), "destroy", this).call(this);
  35878. this.mode = null;
  35879. }
  35880. /**
  35881. * @function DensityAnalystService.prototype.processAsync
  35882. * @description 负责将客户端的查询参数传递到服务端。
  35883. * @param {DensityKernelAnalystParameters} parameter - 核密度分析参数。
  35884. */
  35885. }, {
  35886. key: "processAsync",
  35887. value: function processAsync(parameter) {
  35888. var me = this;
  35889. var parameterObject = new Object();
  35890. if (parameter instanceof DensityKernelAnalystParameters) {
  35891. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/densityanalyst/kernel');
  35892. me.mode = "kernel";
  35893. }
  35894. DensityKernelAnalystParameters.toObject(parameter, parameterObject);
  35895. var jsonParameters = Util_Util.toJSON(parameterObject);
  35896. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  35897. me.request({
  35898. method: "POST",
  35899. data: jsonParameters,
  35900. scope: me,
  35901. success: me.serviceProcessCompleted,
  35902. failure: me.serviceProcessFailed
  35903. });
  35904. }
  35905. }]);
  35906. return DensityAnalystService;
  35907. }(SpatialAnalystBase);
  35908. ;// CONCATENATED MODULE: ./src/common/iServer/EditFeaturesParameters.js
  35909. function EditFeaturesParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35910. function EditFeaturesParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  35911. function EditFeaturesParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) EditFeaturesParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) EditFeaturesParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  35912. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35913. * This program are made available under the terms of the Apache License, Version 2.0
  35914. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35915. /**
  35916. * @class EditFeaturesParameters
  35917. * @deprecatedclass SuperMap.EditFeaturesParameters
  35918. * @category iServer Data Feature
  35919. * @classdesc 数据集添加、修改、删除参数类。
  35920. * @param {Object} options - 参数。
  35921. * @param {Array.<FeatureVector|GeoJSONObject|ol.Feature>} options.features - 当前需要创建或者是修改的要素集。
  35922. * @param {boolean} [options.returnContent=false] - 是否返回要素内容。如果为true则返回创建要素的 ID 数组,否则返回 featureResult 资源的 URI。
  35923. * @param {EditType} [options.editType=EditType.ADD] - POST 动作类型 (ADD、UPDATE、DELETE)。
  35924. * @param {Array.<string|number>} [options.IDs] - 删除要素时的要素的 ID 数组。
  35925. * @usage
  35926. */
  35927. var EditFeaturesParameters = /*#__PURE__*/function () {
  35928. function EditFeaturesParameters(options) {
  35929. EditFeaturesParameters_classCallCheck(this, EditFeaturesParameters);
  35930. /**
  35931. * @member {string} EditFeaturesParameters.prototype.dataSourceName
  35932. * @description 当前需要创建或者是修改的要素的数据源。
  35933. */
  35934. this.dataSourceName = null;
  35935. /**
  35936. * @member {string} EditFeaturesParameters.prototype.dataSetName
  35937. * @description 当前需要创建或者是修改的要素的数据集。
  35938. */
  35939. this.dataSetName = null;
  35940. /**
  35941. * @member {Array.<FeatureVector|GeoJSONObject|ol.Feature>} EditFeaturesParameters.prototype.features
  35942. * @description 当前需要创建或者是修改的要素集。
  35943. */
  35944. this.features = null;
  35945. /**
  35946. * @member {EditType} [EditFeaturesParameters.prototype.editType=EditType.ADD]
  35947. * @description 要素集更新类型 (add、update、delete)。
  35948. */
  35949. this.editType = EditType.ADD;
  35950. /**
  35951. * @member {Array.<string|number>} [EditFeaturesParameters.prototype.IDs]
  35952. * @description 执行删除时要素集 ID 集合。
  35953. */
  35954. this.IDs = null;
  35955. /**
  35956. * @member {boolean} [EditFeaturesParameters.prototype.returnContent=false]
  35957. * @description 要素添加时,isUseBatch 不传或传为 false 的情况下有效。
  35958. * true 表示直接返回新创建的要素的 ID 数组;false 表示返回创建的 featureResult 资源的 URI。
  35959. */
  35960. this.returnContent = false;
  35961. /**
  35962. * @member {boolean} [EditFeaturesParameters.prototype.isUseBatch=false]
  35963. * @description 是否使用批量添加要素功能,要素添加时有效。批量添加能够提高要素编辑效率。true 表示批量添加;false 表示不使用批量添加。
  35964. */
  35965. this.isUseBatch = false;
  35966. Util_Util.extend(this, options);
  35967. this.CLASS_NAME = "SuperMap.EditFeaturesParameters";
  35968. }
  35969. /**
  35970. * @function EditFeaturesParameters.prototype.destroy
  35971. * @description 释放资源,将引用资源的属性置空。
  35972. */
  35973. EditFeaturesParameters_createClass(EditFeaturesParameters, [{
  35974. key: "destroy",
  35975. value: function destroy() {
  35976. var me = this;
  35977. me.dataSourceName = null;
  35978. me.dataSetName = null;
  35979. me.features = null;
  35980. me.editType = null;
  35981. me.IDs = null;
  35982. me.returnContent = null;
  35983. }
  35984. /**
  35985. * @function EditFeaturesParameters.prototype.toJsonParameters
  35986. * @description 将 EditFeaturesParameters 对象参数转换为 JSON 字符串。
  35987. * @param {EditFeaturesParameters} params - 地物编辑参数。
  35988. * @returns {string} JSON 字符串。
  35989. */
  35990. }], [{
  35991. key: "toJsonParameters",
  35992. value: function toJsonParameters(params) {
  35993. var feature,
  35994. len,
  35995. features,
  35996. editType = params.editType;
  35997. if (editType === EditType.DELETE) {
  35998. if (params.IDs === null) {
  35999. return;
  36000. }
  36001. features = {
  36002. ids: params.IDs
  36003. };
  36004. } else {
  36005. features = [];
  36006. if (params.features) {
  36007. len = params.features.length;
  36008. for (var i = 0; i < len; i++) {
  36009. feature = params.features[i];
  36010. feature.geometry = ServerGeometry.fromGeometry(feature.geometry);
  36011. features.push(feature);
  36012. }
  36013. }
  36014. }
  36015. return Util_Util.toJSON(features);
  36016. }
  36017. }]);
  36018. return EditFeaturesParameters;
  36019. }();
  36020. ;// CONCATENATED MODULE: ./src/common/iServer/EditFeaturesService.js
  36021. function EditFeaturesService_typeof(obj) { "@babel/helpers - typeof"; return EditFeaturesService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, EditFeaturesService_typeof(obj); }
  36022. function EditFeaturesService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36023. function EditFeaturesService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  36024. function EditFeaturesService_createClass(Constructor, protoProps, staticProps) { if (protoProps) EditFeaturesService_defineProperties(Constructor.prototype, protoProps); if (staticProps) EditFeaturesService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  36025. function EditFeaturesService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { EditFeaturesService_get = Reflect.get.bind(); } else { EditFeaturesService_get = function _get(target, property, receiver) { var base = EditFeaturesService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return EditFeaturesService_get.apply(this, arguments); }
  36026. function EditFeaturesService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = EditFeaturesService_getPrototypeOf(object); if (object === null) break; } return object; }
  36027. function EditFeaturesService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) EditFeaturesService_setPrototypeOf(subClass, superClass); }
  36028. function EditFeaturesService_setPrototypeOf(o, p) { EditFeaturesService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return EditFeaturesService_setPrototypeOf(o, p); }
  36029. function EditFeaturesService_createSuper(Derived) { var hasNativeReflectConstruct = EditFeaturesService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = EditFeaturesService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = EditFeaturesService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return EditFeaturesService_possibleConstructorReturn(this, result); }; }
  36030. function EditFeaturesService_possibleConstructorReturn(self, call) { if (call && (EditFeaturesService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return EditFeaturesService_assertThisInitialized(self); }
  36031. function EditFeaturesService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36032. function EditFeaturesService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  36033. function EditFeaturesService_getPrototypeOf(o) { EditFeaturesService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return EditFeaturesService_getPrototypeOf(o); }
  36034. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36035. * This program are made available under the terms of the Apache License, Version 2.0
  36036. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36037. /**
  36038. * @class EditFeaturesService
  36039. * @deprecatedclass SuperMap.EditFeaturesService
  36040. * @category iServer Data Feature
  36041. * @classdesc 数据服务中数据集添加、更新、删除服务类。
  36042. * @extends {CommonServiceBase}
  36043. * @param {string} url - 服务端的数据服务资源地址。请求数据服务中数据集编辑服务,URL 应为:</br>
  36044. * http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/datasources/name/{数据源名}/datasets/name/{数据集名} 。</br>
  36045. * 例如:http://localhost:8090/iserver/services/data-jingjin/rest/data/datasources/name/Jingjin/datasets/name/Landuse_R
  36046. * @param {Object} options - 参数。
  36047. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  36048. * @param {DataFormat} [format] -查询结果返回格式,目前支持iServerJSON 和GeoJSON两种格式。参数格式为"ISERVER","GEOJSON"。
  36049. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36050. * @param {Object} [options.headers] - 请求头。
  36051. * @example
  36052. * var myService = new EditFeaturesService(url, {eventListeners: {
  36053. * "processCompleted": editFeatureCompleted,
  36054. * "processFailed": editFeatureError
  36055. * }
  36056. * };
  36057. * @usage
  36058. */
  36059. var EditFeaturesService = /*#__PURE__*/function (_CommonServiceBase) {
  36060. EditFeaturesService_inherits(EditFeaturesService, _CommonServiceBase);
  36061. var _super = EditFeaturesService_createSuper(EditFeaturesService);
  36062. function EditFeaturesService(url, options) {
  36063. var _this;
  36064. EditFeaturesService_classCallCheck(this, EditFeaturesService);
  36065. _this = _super.call(this, url, options);
  36066. /**
  36067. * @member {boolean} [EditFeaturesService.prototype.returnContent=false]
  36068. * @description要素添加时,isUseBatch 不传或传为 false 的情况下有效。true 表示直接返回新创建的要素的 ID 数组;false 表示返回创建的 featureResult 资源的 URI。
  36069. */
  36070. _this.returnContent = false;
  36071. /**
  36072. * @member {boolean} [EditFeaturesService.prototype.isUseBatch=false]
  36073. * @description 是否使用批量添加要素功能,要素添加时有效。
  36074. * 批量添加能够提高要素编辑效率。
  36075. * true 表示批量添加;false 表示不使用批量添加。
  36076. */
  36077. _this.isUseBatch = false;
  36078. if (options) {
  36079. Util_Util.extend(EditFeaturesService_assertThisInitialized(_this), options);
  36080. }
  36081. _this.url = Util_Util.urlPathAppend(_this.url, 'features');
  36082. _this.CLASS_NAME = "SuperMap.EditFeaturesService";
  36083. return _this;
  36084. }
  36085. /**
  36086. * @function EditFeaturesService.prototype.destroy
  36087. * @override
  36088. */
  36089. EditFeaturesService_createClass(EditFeaturesService, [{
  36090. key: "destroy",
  36091. value: function destroy() {
  36092. EditFeaturesService_get(EditFeaturesService_getPrototypeOf(EditFeaturesService.prototype), "destroy", this).call(this);
  36093. var me = this;
  36094. me.returnContent = null;
  36095. me.isUseBatch = null;
  36096. me.fromIndex = null;
  36097. me.toIndex = null;
  36098. }
  36099. /**
  36100. * @function EditFeaturesService.prototype.processAsync
  36101. * @description 负责将客户端的更新参数传递到服务端。
  36102. * @param {EditFeaturesParameters} params - 编辑要素参数。
  36103. */
  36104. }, {
  36105. key: "processAsync",
  36106. value: function processAsync(params) {
  36107. if (!(params instanceof EditFeaturesParameters)) {
  36108. return;
  36109. }
  36110. var me = this,
  36111. method = "POST",
  36112. ids = "",
  36113. editType = params.editType,
  36114. jsonParameters = null;
  36115. me.returnContent = params.returnContent;
  36116. me.isUseBatch = params.isUseBatch;
  36117. jsonParameters = EditFeaturesParameters.toJsonParameters(params);
  36118. if (editType === EditType.DELETE) {
  36119. ids = Util_Util.toJSON(params.IDs);
  36120. jsonParameters = ids;
  36121. var urlWithIds = Util_Util.urlAppend(me.url, Util_Util.getParameterString({
  36122. ids: ids
  36123. }));
  36124. if (FetchRequest.urlIsLong(urlWithIds)) {
  36125. me.url = Util_Util.urlAppend(me.url, Util_Util.getParameterString({
  36126. _method: 'DELETE'
  36127. }));
  36128. method = "POST";
  36129. } else {
  36130. me.url = urlWithIds;
  36131. method = "DELETE";
  36132. }
  36133. } else if (editType === EditType.UPDATE) {
  36134. method = "PUT";
  36135. } else {
  36136. if (me.isUseBatch) {
  36137. me.url = Util_Util.urlAppend(me.url, "isUseBatch=".concat(me.isUseBatch));
  36138. me.returnContent = false;
  36139. }
  36140. if (me.returnContent) {
  36141. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  36142. method = "POST";
  36143. }
  36144. }
  36145. me.request({
  36146. method: method,
  36147. data: jsonParameters,
  36148. scope: me,
  36149. success: me.serviceProcessCompleted,
  36150. failure: me.serviceProcessFailed
  36151. });
  36152. }
  36153. }]);
  36154. return EditFeaturesService;
  36155. }(CommonServiceBase);
  36156. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalyst3DParameters.js
  36157. function FacilityAnalyst3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36158. function FacilityAnalyst3DParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  36159. function FacilityAnalyst3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalyst3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalyst3DParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  36160. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36161. * This program are made available under the terms of the Apache License, Version 2.0
  36162. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36163. /**
  36164. * @class FacilityAnalyst3DParameters
  36165. * @deprecatedclass SuperMap.FacilityAnalyst3DParameters
  36166. * @category iServer FacilityAnalyst3D
  36167. * @classdesc 最近设施分析参数基类。最近设施分析是指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  36168. * 设施点一般为学校、超市、加油站等服务设施;事件点为需要服务设施的事件位置。例如事件发生点是一起交通事故,要求查找在 10 分钟内能到达的最近医院,
  36169. * 超过 10 分钟能到达的都不予考虑。此例中,事故发生地即是一个事件点,周边的医院则是设施点。最近设施查找实际上也是一种路径分析,因此对路径分析起作用的障碍边、障碍点、转向表、耗费等属性在最近设施分析时同样可设置。
  36170. * @param {Object} options - 参数。
  36171. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  36172. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  36173. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  36174. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  36175. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  36176. * @usage
  36177. */
  36178. var FacilityAnalyst3DParameters = /*#__PURE__*/function () {
  36179. function FacilityAnalyst3DParameters(options) {
  36180. FacilityAnalyst3DParameters_classCallCheck(this, FacilityAnalyst3DParameters);
  36181. /**
  36182. * @member {number} [FacilityAnalyst3DParameters.prototype.edgeID]
  36183. * @description 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  36184. */
  36185. this.edgeID = null;
  36186. /**
  36187. * @member {number} [FacilityAnalyst3DParameters.prototype.nodeID]
  36188. * @description 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  36189. */
  36190. this.nodeID = null;
  36191. /**
  36192. * @member {string} FacilityAnalyst3DParameters.prototype.weightName
  36193. * @description 指定的权值字段信息对象的名称。
  36194. */
  36195. this.weightName = null;
  36196. /**
  36197. * @member {boolean} [FacilityAnalyst3DParameters.prototype.isUncertainDirectionValid=false]
  36198. * @description 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  36199. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  36200. */
  36201. this.isUncertainDirectionValid = false;
  36202. Util_Util.extend(this, options);
  36203. this.CLASS_NAME = "SuperMap.FacilityAnalyst3DParameters";
  36204. }
  36205. /**
  36206. * @function FacilityAnalyst3DParameters.prototype.destroy
  36207. * @description 释放资源,将资源的属性置空。
  36208. */
  36209. FacilityAnalyst3DParameters_createClass(FacilityAnalyst3DParameters, [{
  36210. key: "destroy",
  36211. value: function destroy() {
  36212. var me = this;
  36213. me.edgeID = null;
  36214. me.nodeID = null;
  36215. me.weightName = null;
  36216. me.isUncertainDirectionValid = null;
  36217. }
  36218. }]);
  36219. return FacilityAnalyst3DParameters;
  36220. }();
  36221. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSinks3DParameters.js
  36222. function FacilityAnalystSinks3DParameters_typeof(obj) { "@babel/helpers - typeof"; return FacilityAnalystSinks3DParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FacilityAnalystSinks3DParameters_typeof(obj); }
  36223. function FacilityAnalystSinks3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36224. function FacilityAnalystSinks3DParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  36225. function FacilityAnalystSinks3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSinks3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSinks3DParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  36226. function FacilityAnalystSinks3DParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystSinks3DParameters_get = Reflect.get.bind(); } else { FacilityAnalystSinks3DParameters_get = function _get(target, property, receiver) { var base = FacilityAnalystSinks3DParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FacilityAnalystSinks3DParameters_get.apply(this, arguments); }
  36227. function FacilityAnalystSinks3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystSinks3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  36228. function FacilityAnalystSinks3DParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FacilityAnalystSinks3DParameters_setPrototypeOf(subClass, superClass); }
  36229. function FacilityAnalystSinks3DParameters_setPrototypeOf(o, p) { FacilityAnalystSinks3DParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSinks3DParameters_setPrototypeOf(o, p); }
  36230. function FacilityAnalystSinks3DParameters_createSuper(Derived) { var hasNativeReflectConstruct = FacilityAnalystSinks3DParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FacilityAnalystSinks3DParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FacilityAnalystSinks3DParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FacilityAnalystSinks3DParameters_possibleConstructorReturn(this, result); }; }
  36231. function FacilityAnalystSinks3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSinks3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FacilityAnalystSinks3DParameters_assertThisInitialized(self); }
  36232. function FacilityAnalystSinks3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36233. function FacilityAnalystSinks3DParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  36234. function FacilityAnalystSinks3DParameters_getPrototypeOf(o) { FacilityAnalystSinks3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSinks3DParameters_getPrototypeOf(o); }
  36235. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36236. * This program are made available under the terms of the Apache License, Version 2.0
  36237. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36238. /**
  36239. * @class FacilityAnalystSinks3DParameters
  36240. * @deprecatedclass SuperMap.FacilityAnalystSinks3DParameters
  36241. * @category iServer FacilityAnalyst3D Sinks
  36242. * @classdesc 最近设施分析参数类(汇查找资源)。最近设施分析是指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  36243. * 设施点一般为学校、超市、加油站等服务设施;事件点为需要服务设施的事件位置。例如事件发生点是一起交通事故,要求查找在10分钟内能到达的最近医院,超过10分钟能到达的都不予考虑。此例中,事故发生地即是一个事件点,周边的医院则是设施点。最近设施查找实际上也是一种路径分析,因此对路径分析起作用的障碍边、障碍点、转向表、耗费等属性在最近设施分析时同样可设置。
  36244. * @extends {FacilityAnalyst3DParameters}
  36245. * @param {Object} options - 参数。
  36246. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  36247. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  36248. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  36249. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  36250. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  36251. * @usage
  36252. */
  36253. var FacilityAnalystSinks3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  36254. FacilityAnalystSinks3DParameters_inherits(FacilityAnalystSinks3DParameters, _FacilityAnalyst3DPar);
  36255. var _super = FacilityAnalystSinks3DParameters_createSuper(FacilityAnalystSinks3DParameters);
  36256. function FacilityAnalystSinks3DParameters(options) {
  36257. var _this;
  36258. FacilityAnalystSinks3DParameters_classCallCheck(this, FacilityAnalystSinks3DParameters);
  36259. _this = _super.call(this, options);
  36260. _this.CLASS_NAME = "SuperMap.FacilityAnalystSinks3DParameters";
  36261. return _this;
  36262. }
  36263. /**
  36264. * @function FacilityAnalystSinks3DParameters.prototype.destroy
  36265. * @override
  36266. */
  36267. FacilityAnalystSinks3DParameters_createClass(FacilityAnalystSinks3DParameters, [{
  36268. key: "destroy",
  36269. value: function destroy() {
  36270. FacilityAnalystSinks3DParameters_get(FacilityAnalystSinks3DParameters_getPrototypeOf(FacilityAnalystSinks3DParameters.prototype), "destroy", this).call(this);
  36271. }
  36272. }]);
  36273. return FacilityAnalystSinks3DParameters;
  36274. }(FacilityAnalyst3DParameters);
  36275. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSinks3DService.js
  36276. function FacilityAnalystSinks3DService_typeof(obj) { "@babel/helpers - typeof"; return FacilityAnalystSinks3DService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FacilityAnalystSinks3DService_typeof(obj); }
  36277. function FacilityAnalystSinks3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36278. function FacilityAnalystSinks3DService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  36279. function FacilityAnalystSinks3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSinks3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSinks3DService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  36280. function FacilityAnalystSinks3DService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FacilityAnalystSinks3DService_setPrototypeOf(subClass, superClass); }
  36281. function FacilityAnalystSinks3DService_setPrototypeOf(o, p) { FacilityAnalystSinks3DService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSinks3DService_setPrototypeOf(o, p); }
  36282. function FacilityAnalystSinks3DService_createSuper(Derived) { var hasNativeReflectConstruct = FacilityAnalystSinks3DService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FacilityAnalystSinks3DService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FacilityAnalystSinks3DService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FacilityAnalystSinks3DService_possibleConstructorReturn(this, result); }; }
  36283. function FacilityAnalystSinks3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSinks3DService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FacilityAnalystSinks3DService_assertThisInitialized(self); }
  36284. function FacilityAnalystSinks3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36285. function FacilityAnalystSinks3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  36286. function FacilityAnalystSinks3DService_getPrototypeOf(o) { FacilityAnalystSinks3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSinks3DService_getPrototypeOf(o); }
  36287. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36288. * This program are made available under the terms of the Apache License, Version 2.0
  36289. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36290. /**
  36291. * @class FacilityAnalystSinks3DService
  36292. * @deprecatedclass SuperMap.FacilityAnalystSinks3DService
  36293. * @category iServer FacilityAnalyst3D Sinks
  36294. * @classdesc 最近设施分析服务类(汇查找资源)<br>
  36295. * 最近设施分析是指在网络上给定一个事件点和一组设施点,
  36296. * 查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  36297. * 该类负责将客户端指定的最近设施分析参数传递给服务端,并接收服务端返回的结果数据。
  36298. * 最近设施分析结果通过该类支持的事件的监听函数参数获取
  36299. * @extends {CommonServiceBase}
  36300. * @example
  36301. * var myFacilityAnalystSinks3DService = new FacilityAnalystSinks3DService(url, {
  36302. * eventListeners: {
  36303. * "processCompleted": facilityAnalystSinks3DCompleted,
  36304. * "processFailed": facilityAnalystSinks3DError
  36305. * }
  36306. * });
  36307. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:<br>
  36308. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};<br>
  36309. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。<br>
  36310. * @param {Object} options - 参数。
  36311. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  36312. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36313. * @param {Object} [options.headers] - 请求头。
  36314. * @usage
  36315. */
  36316. var FacilityAnalystSinks3DService = /*#__PURE__*/function (_CommonServiceBase) {
  36317. FacilityAnalystSinks3DService_inherits(FacilityAnalystSinks3DService, _CommonServiceBase);
  36318. var _super = FacilityAnalystSinks3DService_createSuper(FacilityAnalystSinks3DService);
  36319. function FacilityAnalystSinks3DService(url, options) {
  36320. var _this;
  36321. FacilityAnalystSinks3DService_classCallCheck(this, FacilityAnalystSinks3DService);
  36322. _this = _super.call(this, url, options);
  36323. _this.CLASS_NAME = "SuperMap.FacilityAnalystSinks3DService";
  36324. return _this;
  36325. }
  36326. /**
  36327. * @function FacilityAnalystSinks3DService.prototype.destroy
  36328. * @override
  36329. */
  36330. FacilityAnalystSinks3DService_createClass(FacilityAnalystSinks3DService, [{
  36331. key: "destroy",
  36332. value: function destroy() {
  36333. CommonServiceBase.prototype.destroy.apply(this, arguments);
  36334. }
  36335. /**
  36336. * @function FacilityAnalystSinks3DService.prototype.processAsync
  36337. * @description 负责将客户端的查询参数传递到服务端。
  36338. * @param {FacilityAnalystSinks3DParameters} params - 最近设施分析参数类(汇查找资源)
  36339. */
  36340. }, {
  36341. key: "processAsync",
  36342. value: function processAsync(params) {
  36343. if (!(params instanceof FacilityAnalystSinks3DParameters)) {
  36344. return;
  36345. }
  36346. var me = this,
  36347. jsonObject;
  36348. me.url = Util_Util.urlPathAppend(me.url, 'sinks');
  36349. jsonObject = {
  36350. edgeID: params.edgeID,
  36351. nodeID: params.nodeID,
  36352. weightName: params.weightName,
  36353. isUncertainDirectionValid: params.isUncertainDirectionValid
  36354. };
  36355. me.request({
  36356. method: "GET",
  36357. params: jsonObject,
  36358. scope: me,
  36359. success: me.serviceProcessCompleted,
  36360. failure: me.serviceProcessFailed
  36361. });
  36362. }
  36363. }]);
  36364. return FacilityAnalystSinks3DService;
  36365. }(CommonServiceBase);
  36366. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSources3DParameters.js
  36367. function FacilityAnalystSources3DParameters_typeof(obj) { "@babel/helpers - typeof"; return FacilityAnalystSources3DParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FacilityAnalystSources3DParameters_typeof(obj); }
  36368. function FacilityAnalystSources3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36369. function FacilityAnalystSources3DParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  36370. function FacilityAnalystSources3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSources3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSources3DParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  36371. function FacilityAnalystSources3DParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystSources3DParameters_get = Reflect.get.bind(); } else { FacilityAnalystSources3DParameters_get = function _get(target, property, receiver) { var base = FacilityAnalystSources3DParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FacilityAnalystSources3DParameters_get.apply(this, arguments); }
  36372. function FacilityAnalystSources3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystSources3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  36373. function FacilityAnalystSources3DParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FacilityAnalystSources3DParameters_setPrototypeOf(subClass, superClass); }
  36374. function FacilityAnalystSources3DParameters_setPrototypeOf(o, p) { FacilityAnalystSources3DParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSources3DParameters_setPrototypeOf(o, p); }
  36375. function FacilityAnalystSources3DParameters_createSuper(Derived) { var hasNativeReflectConstruct = FacilityAnalystSources3DParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FacilityAnalystSources3DParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FacilityAnalystSources3DParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FacilityAnalystSources3DParameters_possibleConstructorReturn(this, result); }; }
  36376. function FacilityAnalystSources3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSources3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FacilityAnalystSources3DParameters_assertThisInitialized(self); }
  36377. function FacilityAnalystSources3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36378. function FacilityAnalystSources3DParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  36379. function FacilityAnalystSources3DParameters_getPrototypeOf(o) { FacilityAnalystSources3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSources3DParameters_getPrototypeOf(o); }
  36380. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36381. * This program are made available under the terms of the Apache License, Version 2.0
  36382. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36383. /**
  36384. * @class FacilityAnalystSources3DParameters
  36385. * @deprecatedclass SuperMap.FacilityAnalystSources3DParameters
  36386. * @category iServer FacilityAnalyst3D Sources
  36387. * @classdesc 最近设施分析参数类(源查找资源)。最近设施分析是指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  36388. * 设施点一般为学校、超市、加油站等服务设施;事件点为需要服务设施的事件位置。例如事件发生点是一起交通事故,要求查找在10分钟内能到达的最近医院,超过10分钟能到达的都不予考虑。此例中,事故发生地即是一个事件点,周边的医院则是设施点。最近设施查找实际上也是一种路径分析,因此对路径分析起作用的障碍边、障碍点、转向表、耗费等属性在最近设施分析时同样可设置。
  36389. * @extends {FacilityAnalyst3DParameters}
  36390. * @param {Object} options - 参数。
  36391. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  36392. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  36393. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  36394. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  36395. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  36396. * @usage
  36397. */
  36398. var FacilityAnalystSources3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  36399. FacilityAnalystSources3DParameters_inherits(FacilityAnalystSources3DParameters, _FacilityAnalyst3DPar);
  36400. var _super = FacilityAnalystSources3DParameters_createSuper(FacilityAnalystSources3DParameters);
  36401. function FacilityAnalystSources3DParameters(options) {
  36402. var _this;
  36403. FacilityAnalystSources3DParameters_classCallCheck(this, FacilityAnalystSources3DParameters);
  36404. _this = _super.call(this, options);
  36405. _this.CLASS_NAME = "SuperMap.FacilityAnalystSources3DParameters";
  36406. return _this;
  36407. }
  36408. /**
  36409. * @function FacilityAnalystSources3DParameters.prototype.destroy
  36410. * @override
  36411. */
  36412. FacilityAnalystSources3DParameters_createClass(FacilityAnalystSources3DParameters, [{
  36413. key: "destroy",
  36414. value: function destroy() {
  36415. FacilityAnalystSources3DParameters_get(FacilityAnalystSources3DParameters_getPrototypeOf(FacilityAnalystSources3DParameters.prototype), "destroy", this).call(this);
  36416. }
  36417. }]);
  36418. return FacilityAnalystSources3DParameters;
  36419. }(FacilityAnalyst3DParameters);
  36420. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSources3DService.js
  36421. function FacilityAnalystSources3DService_typeof(obj) { "@babel/helpers - typeof"; return FacilityAnalystSources3DService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FacilityAnalystSources3DService_typeof(obj); }
  36422. function FacilityAnalystSources3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36423. function FacilityAnalystSources3DService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  36424. function FacilityAnalystSources3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSources3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSources3DService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  36425. function FacilityAnalystSources3DService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystSources3DService_get = Reflect.get.bind(); } else { FacilityAnalystSources3DService_get = function _get(target, property, receiver) { var base = FacilityAnalystSources3DService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FacilityAnalystSources3DService_get.apply(this, arguments); }
  36426. function FacilityAnalystSources3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystSources3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  36427. function FacilityAnalystSources3DService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FacilityAnalystSources3DService_setPrototypeOf(subClass, superClass); }
  36428. function FacilityAnalystSources3DService_setPrototypeOf(o, p) { FacilityAnalystSources3DService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSources3DService_setPrototypeOf(o, p); }
  36429. function FacilityAnalystSources3DService_createSuper(Derived) { var hasNativeReflectConstruct = FacilityAnalystSources3DService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FacilityAnalystSources3DService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FacilityAnalystSources3DService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FacilityAnalystSources3DService_possibleConstructorReturn(this, result); }; }
  36430. function FacilityAnalystSources3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSources3DService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FacilityAnalystSources3DService_assertThisInitialized(self); }
  36431. function FacilityAnalystSources3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36432. function FacilityAnalystSources3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  36433. function FacilityAnalystSources3DService_getPrototypeOf(o) { FacilityAnalystSources3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSources3DService_getPrototypeOf(o); }
  36434. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36435. * This program are made available under the terms of the Apache License, Version 2.0
  36436. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36437. /**
  36438. * @class FacilityAnalystSources3DService
  36439. * @deprecatedclass SuperMap.FacilityAnalystSources3DService
  36440. * @category iServer FacilityAnalyst3D Sources
  36441. * @classdesc 最近设施分析服务类(源查找资源)
  36442. * 最近设施分析是指在网络上给定一个事件点和一组设施点,
  36443. * 查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  36444. * 该类负责将客户端指定的最近设施分析参数传递给服务端,并接收服务端返回的结果数据。
  36445. * 最近设施分析结果通过该类支持的事件的监听函数参数获取。
  36446. * @extends {CommonServiceBase}
  36447. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  36448. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  36449. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  36450. * @param {Object} options - 参数。
  36451. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  36452. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36453. * @param {Object} [options.headers] - 请求头。
  36454. * @usage
  36455. */
  36456. var FacilityAnalystSources3DService = /*#__PURE__*/function (_CommonServiceBase) {
  36457. FacilityAnalystSources3DService_inherits(FacilityAnalystSources3DService, _CommonServiceBase);
  36458. var _super = FacilityAnalystSources3DService_createSuper(FacilityAnalystSources3DService);
  36459. function FacilityAnalystSources3DService(url, options) {
  36460. var _this;
  36461. FacilityAnalystSources3DService_classCallCheck(this, FacilityAnalystSources3DService);
  36462. _this = _super.call(this, url, options);
  36463. _this.CLASS_NAME = "SuperMap.FacilityAnalystSources3DService";
  36464. return _this;
  36465. }
  36466. /**
  36467. * @function FacilityAnalystSources3DService.prototype.destroy
  36468. * @override
  36469. */
  36470. FacilityAnalystSources3DService_createClass(FacilityAnalystSources3DService, [{
  36471. key: "destroy",
  36472. value: function destroy() {
  36473. FacilityAnalystSources3DService_get(FacilityAnalystSources3DService_getPrototypeOf(FacilityAnalystSources3DService.prototype), "destroy", this).call(this);
  36474. }
  36475. /**
  36476. * @function FacilityAnalystSources3DService.prototype.processAsync
  36477. * @description 负责将客户端的查询参数传递到服务端。
  36478. * @param {FacilityAnalystSources3DParameters} params - 最近设施分析参数类(源查找资源)
  36479. */
  36480. }, {
  36481. key: "processAsync",
  36482. value: function processAsync(params) {
  36483. if (!(params instanceof FacilityAnalystSources3DParameters)) {
  36484. return;
  36485. }
  36486. var me = this,
  36487. jsonObject;
  36488. me.url = Util_Util.urlPathAppend(me.url, 'sources');
  36489. jsonObject = {
  36490. edgeID: params.edgeID,
  36491. nodeID: params.nodeID,
  36492. weightName: params.weightName,
  36493. isUncertainDirectionValid: params.isUncertainDirectionValid
  36494. };
  36495. me.request({
  36496. method: "GET",
  36497. params: jsonObject,
  36498. scope: me,
  36499. success: me.serviceProcessCompleted,
  36500. failure: me.serviceProcessFailed
  36501. });
  36502. }
  36503. }]);
  36504. return FacilityAnalystSources3DService;
  36505. }(CommonServiceBase);
  36506. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystStreamParameters.js
  36507. function FacilityAnalystStreamParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36508. function FacilityAnalystStreamParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  36509. function FacilityAnalystStreamParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystStreamParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystStreamParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  36510. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36511. * This program are made available under the terms of the Apache License, Version 2.0
  36512. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36513. /**
  36514. * @class FacilityAnalystStreamParameters
  36515. * @deprecatedclass SuperMap.FacilityAnalystStreamParameters
  36516. * @category iServer NetworkAnalyst UpstreamCirticalFaclilities
  36517. * @classdesc 上游/下游关键设施查找资源参数类。
  36518. * @param {Object} options - 参数。
  36519. * @param {Array.<number>} options.sourceNodeIDs - 指定的设施点 ID 数组。
  36520. * @param {number} options.queryType - 分析类型,只能是 0 (上游关键设施查询) 或者是 1(下游关键设施查询)。
  36521. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  36522. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  36523. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。
  36524. * @usage
  36525. */
  36526. var FacilityAnalystStreamParameters = /*#__PURE__*/function () {
  36527. function FacilityAnalystStreamParameters(options) {
  36528. FacilityAnalystStreamParameters_classCallCheck(this, FacilityAnalystStreamParameters);
  36529. /**
  36530. * @member {Array.<number>} [FacilityAnalystStreamParameters.prototype.sourceNodeIDs]
  36531. * @description 指定的设施点 ID 数组。
  36532. */
  36533. this.sourceNodeIDs = null;
  36534. /**
  36535. * @member {number} [FacilityAnalystStreamParameters.prototype.edgeID]
  36536. * @description 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  36537. */
  36538. this.edgeID = null;
  36539. /**
  36540. * @member {number} [FacilityAnalystStreamParameters.prototype.nodeID]
  36541. * @description 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  36542. */
  36543. this.nodeID = null;
  36544. /**
  36545. * @member {boolean} [FacilityAnalystStreamParameters.prototype.isUncertainDirectionValid=false]
  36546. * @description 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  36547. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  36548. */
  36549. this.isUncertainDirectionValid = false;
  36550. /**
  36551. * @member {number} FacilityAnalystStreamParameters.prototype.queryType
  36552. * @description 分析类型,只能是 0 (上游关键设施查询) 或者是 1(下游关键设施查询)。
  36553. */
  36554. this.queryType = null;
  36555. Util_Util.extend(this, options);
  36556. this.CLASS_NAME = "SuperMap.FacilityAnalystStreamParameters";
  36557. }
  36558. /**
  36559. * @function FacilityAnalystStreamParameters.prototype.destroy
  36560. * @description 释放资源,将引用资源的属性置空。
  36561. */
  36562. FacilityAnalystStreamParameters_createClass(FacilityAnalystStreamParameters, [{
  36563. key: "destroy",
  36564. value: function destroy() {
  36565. var me = this;
  36566. me.edgeID = null;
  36567. me.nodeID = null;
  36568. me.weightName = null;
  36569. me.isUncertainDirectionValid = null;
  36570. me.type = null;
  36571. }
  36572. }]);
  36573. return FacilityAnalystStreamParameters;
  36574. }();
  36575. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystStreamService.js
  36576. function FacilityAnalystStreamService_typeof(obj) { "@babel/helpers - typeof"; return FacilityAnalystStreamService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FacilityAnalystStreamService_typeof(obj); }
  36577. function FacilityAnalystStreamService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36578. function FacilityAnalystStreamService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  36579. function FacilityAnalystStreamService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystStreamService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystStreamService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  36580. function FacilityAnalystStreamService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystStreamService_get = Reflect.get.bind(); } else { FacilityAnalystStreamService_get = function _get(target, property, receiver) { var base = FacilityAnalystStreamService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FacilityAnalystStreamService_get.apply(this, arguments); }
  36581. function FacilityAnalystStreamService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystStreamService_getPrototypeOf(object); if (object === null) break; } return object; }
  36582. function FacilityAnalystStreamService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FacilityAnalystStreamService_setPrototypeOf(subClass, superClass); }
  36583. function FacilityAnalystStreamService_setPrototypeOf(o, p) { FacilityAnalystStreamService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystStreamService_setPrototypeOf(o, p); }
  36584. function FacilityAnalystStreamService_createSuper(Derived) { var hasNativeReflectConstruct = FacilityAnalystStreamService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FacilityAnalystStreamService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FacilityAnalystStreamService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FacilityAnalystStreamService_possibleConstructorReturn(this, result); }; }
  36585. function FacilityAnalystStreamService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystStreamService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FacilityAnalystStreamService_assertThisInitialized(self); }
  36586. function FacilityAnalystStreamService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36587. function FacilityAnalystStreamService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  36588. function FacilityAnalystStreamService_getPrototypeOf(o) { FacilityAnalystStreamService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystStreamService_getPrototypeOf(o); }
  36589. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36590. * This program are made available under the terms of the Apache License, Version 2.0
  36591. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36592. /**
  36593. * @class FacilityAnalystStreamService
  36594. * @deprecatedclass SuperMap.FacilityAnalystStreamService
  36595. * @category iServer NetworkAnalyst UpstreamCirticalFaclilities
  36596. * @classdesc 上游/下游 关键设施查找资源服务类:即查找给定弧段或节点的上游/下游中的关键设施结点,返回关键结点 ID 数组及其下游弧段 ID 数组。
  36597. * @extends NetworkAnalystServiceBase
  36598. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  36599. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  36600. * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet";
  36601. * @param {Object} options - 参数。
  36602. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  36603. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36604. * @param {Object} [options.headers] - 请求头。
  36605. * @usage
  36606. */
  36607. var FacilityAnalystStreamService = /*#__PURE__*/function (_NetworkAnalystServic) {
  36608. FacilityAnalystStreamService_inherits(FacilityAnalystStreamService, _NetworkAnalystServic);
  36609. var _super = FacilityAnalystStreamService_createSuper(FacilityAnalystStreamService);
  36610. function FacilityAnalystStreamService(url, options) {
  36611. var _this;
  36612. FacilityAnalystStreamService_classCallCheck(this, FacilityAnalystStreamService);
  36613. _this = _super.call(this, url, options);
  36614. _this.CLASS_NAME = "SuperMap.FacilityAnalystStreamService";
  36615. return _this;
  36616. }
  36617. /**
  36618. * @function FacilityAnalystStreamService.prototype.destroy
  36619. * @override
  36620. */
  36621. FacilityAnalystStreamService_createClass(FacilityAnalystStreamService, [{
  36622. key: "destroy",
  36623. value: function destroy() {
  36624. FacilityAnalystStreamService_get(FacilityAnalystStreamService_getPrototypeOf(FacilityAnalystStreamService.prototype), "destroy", this).call(this);
  36625. }
  36626. /**
  36627. * @function FacilityAnalystStreamService.prototype.processAsync
  36628. * @description 负责将客户端的查询参数传递到服务端。
  36629. * @param {FacilityAnalystStreamParameters} params - 上游/下游关键设施查找资源参数类。
  36630. */
  36631. }, {
  36632. key: "processAsync",
  36633. value: function processAsync(params) {
  36634. if (!(params instanceof FacilityAnalystStreamParameters)) {
  36635. return;
  36636. }
  36637. var me = this,
  36638. jsonObject;
  36639. //URL 通过参数类型来判断是 上游 还是下游 查询
  36640. if (params.queryType === 0) {
  36641. me.url = Util_Util.urlPathAppend(me.url, 'upstreamcirticalfaclilities');
  36642. } else if (params.queryType === 1) {
  36643. me.url = Util_Util.urlPathAppend(me.url, 'downstreamcirticalfaclilities');
  36644. } else {
  36645. return;
  36646. }
  36647. jsonObject = {
  36648. sourceNodeIDs: params.sourceNodeIDs,
  36649. isUncertainDirectionValid: params.isUncertainDirectionValid
  36650. };
  36651. if (params.edgeID !== null && params.nodeID !== null) {
  36652. return;
  36653. }
  36654. if (params.edgeID === null && params.nodeID === null) {
  36655. return;
  36656. }
  36657. if (params.edgeID !== null) {
  36658. jsonObject.edgeID = params.edgeID;
  36659. } else {
  36660. jsonObject.nodeID = params.nodeID;
  36661. }
  36662. me.request({
  36663. method: "GET",
  36664. params: jsonObject,
  36665. scope: me,
  36666. success: me.serviceProcessCompleted,
  36667. failure: me.serviceProcessFailed
  36668. });
  36669. }
  36670. }]);
  36671. return FacilityAnalystStreamService;
  36672. }(NetworkAnalystServiceBase);
  36673. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTracedown3DParameters.js
  36674. function FacilityAnalystTracedown3DParameters_typeof(obj) { "@babel/helpers - typeof"; return FacilityAnalystTracedown3DParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FacilityAnalystTracedown3DParameters_typeof(obj); }
  36675. function FacilityAnalystTracedown3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36676. function FacilityAnalystTracedown3DParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  36677. function FacilityAnalystTracedown3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTracedown3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTracedown3DParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  36678. function FacilityAnalystTracedown3DParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystTracedown3DParameters_get = Reflect.get.bind(); } else { FacilityAnalystTracedown3DParameters_get = function _get(target, property, receiver) { var base = FacilityAnalystTracedown3DParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FacilityAnalystTracedown3DParameters_get.apply(this, arguments); }
  36679. function FacilityAnalystTracedown3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTracedown3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  36680. function FacilityAnalystTracedown3DParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FacilityAnalystTracedown3DParameters_setPrototypeOf(subClass, superClass); }
  36681. function FacilityAnalystTracedown3DParameters_setPrototypeOf(o, p) { FacilityAnalystTracedown3DParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTracedown3DParameters_setPrototypeOf(o, p); }
  36682. function FacilityAnalystTracedown3DParameters_createSuper(Derived) { var hasNativeReflectConstruct = FacilityAnalystTracedown3DParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FacilityAnalystTracedown3DParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FacilityAnalystTracedown3DParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FacilityAnalystTracedown3DParameters_possibleConstructorReturn(this, result); }; }
  36683. function FacilityAnalystTracedown3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTracedown3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FacilityAnalystTracedown3DParameters_assertThisInitialized(self); }
  36684. function FacilityAnalystTracedown3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36685. function FacilityAnalystTracedown3DParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  36686. function FacilityAnalystTracedown3DParameters_getPrototypeOf(o) { FacilityAnalystTracedown3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTracedown3DParameters_getPrototypeOf(o); }
  36687. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36688. * This program are made available under the terms of the Apache License, Version 2.0
  36689. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36690. /**
  36691. * @class FacilityAnalystTracedown3DParameters
  36692. * @deprecatedclass SuperMap.FacilityAnalystTracedown3DParameters
  36693. * @category iServer FacilityAnalyst3D TraceDownResult
  36694. * @classdesc 下游追踪资源参数类。
  36695. * @extends {FacilityAnalyst3DParameters}
  36696. * @param {Object} options - 参数。
  36697. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  36698. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  36699. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  36700. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  36701. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  36702. * @usage
  36703. */
  36704. var FacilityAnalystTracedown3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  36705. FacilityAnalystTracedown3DParameters_inherits(FacilityAnalystTracedown3DParameters, _FacilityAnalyst3DPar);
  36706. var _super = FacilityAnalystTracedown3DParameters_createSuper(FacilityAnalystTracedown3DParameters);
  36707. function FacilityAnalystTracedown3DParameters(options) {
  36708. var _this;
  36709. FacilityAnalystTracedown3DParameters_classCallCheck(this, FacilityAnalystTracedown3DParameters);
  36710. _this = _super.call(this, options);
  36711. _this.CLASS_NAME = "SuperMap.FacilityAnalystTracedown3DParameters";
  36712. return _this;
  36713. }
  36714. /**
  36715. * @function FacilityAnalystTracedown3DParameters.prototype.destroy
  36716. * @override
  36717. */
  36718. FacilityAnalystTracedown3DParameters_createClass(FacilityAnalystTracedown3DParameters, [{
  36719. key: "destroy",
  36720. value: function destroy() {
  36721. FacilityAnalystTracedown3DParameters_get(FacilityAnalystTracedown3DParameters_getPrototypeOf(FacilityAnalystTracedown3DParameters.prototype), "destroy", this).call(this);
  36722. }
  36723. }]);
  36724. return FacilityAnalystTracedown3DParameters;
  36725. }(FacilityAnalyst3DParameters);
  36726. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTracedown3DService.js
  36727. function FacilityAnalystTracedown3DService_typeof(obj) { "@babel/helpers - typeof"; return FacilityAnalystTracedown3DService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FacilityAnalystTracedown3DService_typeof(obj); }
  36728. function FacilityAnalystTracedown3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36729. function FacilityAnalystTracedown3DService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  36730. function FacilityAnalystTracedown3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTracedown3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTracedown3DService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  36731. function FacilityAnalystTracedown3DService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystTracedown3DService_get = Reflect.get.bind(); } else { FacilityAnalystTracedown3DService_get = function _get(target, property, receiver) { var base = FacilityAnalystTracedown3DService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FacilityAnalystTracedown3DService_get.apply(this, arguments); }
  36732. function FacilityAnalystTracedown3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTracedown3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  36733. function FacilityAnalystTracedown3DService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FacilityAnalystTracedown3DService_setPrototypeOf(subClass, superClass); }
  36734. function FacilityAnalystTracedown3DService_setPrototypeOf(o, p) { FacilityAnalystTracedown3DService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTracedown3DService_setPrototypeOf(o, p); }
  36735. function FacilityAnalystTracedown3DService_createSuper(Derived) { var hasNativeReflectConstruct = FacilityAnalystTracedown3DService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FacilityAnalystTracedown3DService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FacilityAnalystTracedown3DService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FacilityAnalystTracedown3DService_possibleConstructorReturn(this, result); }; }
  36736. function FacilityAnalystTracedown3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTracedown3DService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FacilityAnalystTracedown3DService_assertThisInitialized(self); }
  36737. function FacilityAnalystTracedown3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36738. function FacilityAnalystTracedown3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  36739. function FacilityAnalystTracedown3DService_getPrototypeOf(o) { FacilityAnalystTracedown3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTracedown3DService_getPrototypeOf(o); }
  36740. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36741. * This program are made available under the terms of the Apache License, Version 2.0
  36742. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36743. /**
  36744. * @class FacilityAnalystTracedown3DService
  36745. * @deprecatedclass SuperMap.FacilityAnalystTracedown3DService
  36746. * @category iServer FacilityAnalyst3D TraceDownResult
  36747. * @classdesc 下游追踪资源服务类
  36748. * @extends {CommonServiceBase}
  36749. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  36750. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  36751. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  36752. * @param {Object} options - 参数。
  36753. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  36754. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36755. * @param {Object} [options.headers] - 请求头。
  36756. * @usage
  36757. */
  36758. var FacilityAnalystTracedown3DService = /*#__PURE__*/function (_CommonServiceBase) {
  36759. FacilityAnalystTracedown3DService_inherits(FacilityAnalystTracedown3DService, _CommonServiceBase);
  36760. var _super = FacilityAnalystTracedown3DService_createSuper(FacilityAnalystTracedown3DService);
  36761. function FacilityAnalystTracedown3DService(url, options) {
  36762. var _this;
  36763. FacilityAnalystTracedown3DService_classCallCheck(this, FacilityAnalystTracedown3DService);
  36764. _this = _super.call(this, url, options);
  36765. _this.CLASS_NAME = "SuperMap.FacilityAnalystTracedown3DService";
  36766. return _this;
  36767. }
  36768. /**
  36769. * @function FacilityAnalystTracedown3DService.prototype.destroy
  36770. * @override
  36771. */
  36772. FacilityAnalystTracedown3DService_createClass(FacilityAnalystTracedown3DService, [{
  36773. key: "destroy",
  36774. value: function destroy() {
  36775. FacilityAnalystTracedown3DService_get(FacilityAnalystTracedown3DService_getPrototypeOf(FacilityAnalystTracedown3DService.prototype), "destroy", this).call(this);
  36776. }
  36777. /**
  36778. * @function FacilityAnalystTracedown3DService.prototype.processAsync
  36779. * @description 负责将客户端的查询参数传递到服务端。
  36780. * @param {FacilityAnalystTracedown3DParameters} params - 下游追踪资源参数类。
  36781. */
  36782. }, {
  36783. key: "processAsync",
  36784. value: function processAsync(params) {
  36785. if (!(params instanceof FacilityAnalystTracedown3DParameters)) {
  36786. return;
  36787. }
  36788. var me = this,
  36789. jsonObject;
  36790. me.url = Util_Util.urlPathAppend(me.url, 'tracedownresult');
  36791. jsonObject = {
  36792. edgeID: params.edgeID,
  36793. nodeID: params.nodeID,
  36794. weightName: params.weightName,
  36795. isUncertainDirectionValid: params.isUncertainDirectionValid
  36796. };
  36797. me.request({
  36798. method: "GET",
  36799. params: jsonObject,
  36800. scope: me,
  36801. success: me.serviceProcessCompleted,
  36802. failure: me.serviceProcessFailed
  36803. });
  36804. }
  36805. }]);
  36806. return FacilityAnalystTracedown3DService;
  36807. }(CommonServiceBase);
  36808. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTraceup3DParameters.js
  36809. function FacilityAnalystTraceup3DParameters_typeof(obj) { "@babel/helpers - typeof"; return FacilityAnalystTraceup3DParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FacilityAnalystTraceup3DParameters_typeof(obj); }
  36810. function FacilityAnalystTraceup3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36811. function FacilityAnalystTraceup3DParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  36812. function FacilityAnalystTraceup3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTraceup3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTraceup3DParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  36813. function FacilityAnalystTraceup3DParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystTraceup3DParameters_get = Reflect.get.bind(); } else { FacilityAnalystTraceup3DParameters_get = function _get(target, property, receiver) { var base = FacilityAnalystTraceup3DParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FacilityAnalystTraceup3DParameters_get.apply(this, arguments); }
  36814. function FacilityAnalystTraceup3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTraceup3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  36815. function FacilityAnalystTraceup3DParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FacilityAnalystTraceup3DParameters_setPrototypeOf(subClass, superClass); }
  36816. function FacilityAnalystTraceup3DParameters_setPrototypeOf(o, p) { FacilityAnalystTraceup3DParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTraceup3DParameters_setPrototypeOf(o, p); }
  36817. function FacilityAnalystTraceup3DParameters_createSuper(Derived) { var hasNativeReflectConstruct = FacilityAnalystTraceup3DParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FacilityAnalystTraceup3DParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FacilityAnalystTraceup3DParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FacilityAnalystTraceup3DParameters_possibleConstructorReturn(this, result); }; }
  36818. function FacilityAnalystTraceup3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTraceup3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FacilityAnalystTraceup3DParameters_assertThisInitialized(self); }
  36819. function FacilityAnalystTraceup3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36820. function FacilityAnalystTraceup3DParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  36821. function FacilityAnalystTraceup3DParameters_getPrototypeOf(o) { FacilityAnalystTraceup3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTraceup3DParameters_getPrototypeOf(o); }
  36822. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36823. * This program are made available under the terms of the Apache License, Version 2.0
  36824. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36825. /**
  36826. * @class FacilityAnalystTraceup3DParameters
  36827. * @deprecatedclass SuperMap.FacilityAnalystTraceup3DParameters
  36828. * @category iServer FacilityAnalyst3D TraceUpResult
  36829. * @classdesc 上游追踪资源参数类。
  36830. * @extends {FacilityAnalyst3DParameters}
  36831. * @param {Object} options - 参数。
  36832. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  36833. * @param {number} [options.edgeID] - 指定的弧段ID,edgeID 与 nodeID 必须指定一个。
  36834. * @param {number} [options.nodeID] - 指定的结点ID,edgeID 与 nodeID 必须指定一个。
  36835. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  36836. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  36837. * @usage
  36838. */
  36839. var FacilityAnalystTraceup3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  36840. FacilityAnalystTraceup3DParameters_inherits(FacilityAnalystTraceup3DParameters, _FacilityAnalyst3DPar);
  36841. var _super = FacilityAnalystTraceup3DParameters_createSuper(FacilityAnalystTraceup3DParameters);
  36842. function FacilityAnalystTraceup3DParameters(options) {
  36843. var _this;
  36844. FacilityAnalystTraceup3DParameters_classCallCheck(this, FacilityAnalystTraceup3DParameters);
  36845. _this = _super.call(this, options);
  36846. _this.CLASS_NAME = "SuperMap.FacilityAnalystTraceup3DParameters";
  36847. return _this;
  36848. }
  36849. /**
  36850. * @function FacilityAnalystTraceup3DParameters.prototype.destroy
  36851. * @override
  36852. */
  36853. FacilityAnalystTraceup3DParameters_createClass(FacilityAnalystTraceup3DParameters, [{
  36854. key: "destroy",
  36855. value: function destroy() {
  36856. FacilityAnalystTraceup3DParameters_get(FacilityAnalystTraceup3DParameters_getPrototypeOf(FacilityAnalystTraceup3DParameters.prototype), "destroy", this).call(this);
  36857. }
  36858. }]);
  36859. return FacilityAnalystTraceup3DParameters;
  36860. }(FacilityAnalyst3DParameters);
  36861. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTraceup3DService.js
  36862. function FacilityAnalystTraceup3DService_typeof(obj) { "@babel/helpers - typeof"; return FacilityAnalystTraceup3DService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FacilityAnalystTraceup3DService_typeof(obj); }
  36863. function FacilityAnalystTraceup3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36864. function FacilityAnalystTraceup3DService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  36865. function FacilityAnalystTraceup3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTraceup3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTraceup3DService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  36866. function FacilityAnalystTraceup3DService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystTraceup3DService_get = Reflect.get.bind(); } else { FacilityAnalystTraceup3DService_get = function _get(target, property, receiver) { var base = FacilityAnalystTraceup3DService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FacilityAnalystTraceup3DService_get.apply(this, arguments); }
  36867. function FacilityAnalystTraceup3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTraceup3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  36868. function FacilityAnalystTraceup3DService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FacilityAnalystTraceup3DService_setPrototypeOf(subClass, superClass); }
  36869. function FacilityAnalystTraceup3DService_setPrototypeOf(o, p) { FacilityAnalystTraceup3DService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTraceup3DService_setPrototypeOf(o, p); }
  36870. function FacilityAnalystTraceup3DService_createSuper(Derived) { var hasNativeReflectConstruct = FacilityAnalystTraceup3DService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FacilityAnalystTraceup3DService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FacilityAnalystTraceup3DService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FacilityAnalystTraceup3DService_possibleConstructorReturn(this, result); }; }
  36871. function FacilityAnalystTraceup3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTraceup3DService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FacilityAnalystTraceup3DService_assertThisInitialized(self); }
  36872. function FacilityAnalystTraceup3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36873. function FacilityAnalystTraceup3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  36874. function FacilityAnalystTraceup3DService_getPrototypeOf(o) { FacilityAnalystTraceup3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTraceup3DService_getPrototypeOf(o); }
  36875. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36876. * This program are made available under the terms of the Apache License, Version 2.0
  36877. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36878. /**
  36879. * @class FacilityAnalystTraceup3DService
  36880. * @deprecatedclass SuperMap.FacilityAnalystTraceup3DService
  36881. * @category iServer FacilityAnalyst3D TraceUpResult
  36882. * @classdesc 上游追踪资源服务类
  36883. * @extends {CommonServiceBase}
  36884. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  36885. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  36886. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  36887. * @param {Object} options - 参数。
  36888. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  36889. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36890. * @param {Object} [options.headers] - 请求头。
  36891. * @usage
  36892. */
  36893. var FacilityAnalystTraceup3DService = /*#__PURE__*/function (_CommonServiceBase) {
  36894. FacilityAnalystTraceup3DService_inherits(FacilityAnalystTraceup3DService, _CommonServiceBase);
  36895. var _super = FacilityAnalystTraceup3DService_createSuper(FacilityAnalystTraceup3DService);
  36896. function FacilityAnalystTraceup3DService(url, options) {
  36897. var _this;
  36898. FacilityAnalystTraceup3DService_classCallCheck(this, FacilityAnalystTraceup3DService);
  36899. _this = _super.call(this, url, options);
  36900. _this.CLASS_NAME = "SuperMap.FacilityAnalystTraceup3DService";
  36901. return _this;
  36902. }
  36903. /**
  36904. * @function FacilityAnalystTraceup3DService.prototype.destroy
  36905. * @override
  36906. */
  36907. FacilityAnalystTraceup3DService_createClass(FacilityAnalystTraceup3DService, [{
  36908. key: "destroy",
  36909. value: function destroy() {
  36910. FacilityAnalystTraceup3DService_get(FacilityAnalystTraceup3DService_getPrototypeOf(FacilityAnalystTraceup3DService.prototype), "destroy", this).call(this);
  36911. }
  36912. /**
  36913. * @function FacilityAnalystTraceup3DService.prototype.processAsync
  36914. * @description 负责将客户端的查询参数传递到服务端。
  36915. * @param {FacilityAnalystTraceup3DParameters} params - 上游追踪资源参数类
  36916. */
  36917. }, {
  36918. key: "processAsync",
  36919. value: function processAsync(params) {
  36920. if (!(params instanceof FacilityAnalystTraceup3DParameters)) {
  36921. return;
  36922. }
  36923. var me = this,
  36924. jsonObject;
  36925. me.url = Util_Util.urlPathAppend(me.url, 'traceupresult');
  36926. jsonObject = {
  36927. edgeID: params.edgeID,
  36928. nodeID: params.nodeID,
  36929. weightName: params.weightName,
  36930. isUncertainDirectionValid: params.isUncertainDirectionValid
  36931. };
  36932. me.request({
  36933. method: "GET",
  36934. params: jsonObject,
  36935. scope: me,
  36936. success: me.serviceProcessCompleted,
  36937. failure: me.serviceProcessFailed
  36938. });
  36939. }
  36940. }]);
  36941. return FacilityAnalystTraceup3DService;
  36942. }(CommonServiceBase);
  36943. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystUpstream3DParameters.js
  36944. function FacilityAnalystUpstream3DParameters_typeof(obj) { "@babel/helpers - typeof"; return FacilityAnalystUpstream3DParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FacilityAnalystUpstream3DParameters_typeof(obj); }
  36945. function FacilityAnalystUpstream3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36946. function FacilityAnalystUpstream3DParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  36947. function FacilityAnalystUpstream3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystUpstream3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystUpstream3DParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  36948. function FacilityAnalystUpstream3DParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystUpstream3DParameters_get = Reflect.get.bind(); } else { FacilityAnalystUpstream3DParameters_get = function _get(target, property, receiver) { var base = FacilityAnalystUpstream3DParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FacilityAnalystUpstream3DParameters_get.apply(this, arguments); }
  36949. function FacilityAnalystUpstream3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystUpstream3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  36950. function FacilityAnalystUpstream3DParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FacilityAnalystUpstream3DParameters_setPrototypeOf(subClass, superClass); }
  36951. function FacilityAnalystUpstream3DParameters_setPrototypeOf(o, p) { FacilityAnalystUpstream3DParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystUpstream3DParameters_setPrototypeOf(o, p); }
  36952. function FacilityAnalystUpstream3DParameters_createSuper(Derived) { var hasNativeReflectConstruct = FacilityAnalystUpstream3DParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FacilityAnalystUpstream3DParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FacilityAnalystUpstream3DParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FacilityAnalystUpstream3DParameters_possibleConstructorReturn(this, result); }; }
  36953. function FacilityAnalystUpstream3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystUpstream3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FacilityAnalystUpstream3DParameters_assertThisInitialized(self); }
  36954. function FacilityAnalystUpstream3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36955. function FacilityAnalystUpstream3DParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  36956. function FacilityAnalystUpstream3DParameters_getPrototypeOf(o) { FacilityAnalystUpstream3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystUpstream3DParameters_getPrototypeOf(o); }
  36957. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36958. * This program are made available under the terms of the Apache License, Version 2.0
  36959. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36960. /**
  36961. * @class FacilityAnalystUpstream3DParameters
  36962. * @deprecatedclass SuperMap.FacilityAnalystUpstream3DParameters
  36963. * @category iServer FacilityAnalyst3D UpstreamCirticalFaclilities
  36964. * @classdesc 上游关键设施查找资源参数类。
  36965. * @extends {FacilityAnalyst3DParameters}
  36966. * @param {Object} options - 参数。
  36967. * @param {Array.<number>} options.sourceNodeIDs - 指定的设施点 ID 数组。
  36968. * @param {number} [options.edgeID] - 指定的弧段ID。edgeID 与 nodeID 必须指定一个。
  36969. * @param {number} [options.nodeID] - 指定的结点ID。edgeID 与 edgeID 必须指定一个。
  36970. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  36971. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  36972. * @usage
  36973. */
  36974. var FacilityAnalystUpstream3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  36975. FacilityAnalystUpstream3DParameters_inherits(FacilityAnalystUpstream3DParameters, _FacilityAnalyst3DPar);
  36976. var _super = FacilityAnalystUpstream3DParameters_createSuper(FacilityAnalystUpstream3DParameters);
  36977. function FacilityAnalystUpstream3DParameters(options) {
  36978. var _this;
  36979. FacilityAnalystUpstream3DParameters_classCallCheck(this, FacilityAnalystUpstream3DParameters);
  36980. _this = _super.call(this, options);
  36981. options = options || {};
  36982. _this.sourceNodeIDs = null;
  36983. Util_Util.extend(FacilityAnalystUpstream3DParameters_assertThisInitialized(_this), options);
  36984. _this.CLASS_NAME = "SuperMap.FacilityAnalystUpstream3DParameters";
  36985. return _this;
  36986. }
  36987. /**
  36988. * @function FacilityAnalystUpstream3DParameters.prototype.destroy
  36989. * @override
  36990. */
  36991. FacilityAnalystUpstream3DParameters_createClass(FacilityAnalystUpstream3DParameters, [{
  36992. key: "destroy",
  36993. value: function destroy() {
  36994. FacilityAnalystUpstream3DParameters_get(FacilityAnalystUpstream3DParameters_getPrototypeOf(FacilityAnalystUpstream3DParameters.prototype), "destroy", this).call(this);
  36995. this.sourceNodeIDs = null;
  36996. }
  36997. }]);
  36998. return FacilityAnalystUpstream3DParameters;
  36999. }(FacilityAnalyst3DParameters);
  37000. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystUpstream3DService.js
  37001. function FacilityAnalystUpstream3DService_typeof(obj) { "@babel/helpers - typeof"; return FacilityAnalystUpstream3DService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FacilityAnalystUpstream3DService_typeof(obj); }
  37002. function FacilityAnalystUpstream3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37003. function FacilityAnalystUpstream3DService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  37004. function FacilityAnalystUpstream3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystUpstream3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystUpstream3DService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  37005. function FacilityAnalystUpstream3DService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystUpstream3DService_get = Reflect.get.bind(); } else { FacilityAnalystUpstream3DService_get = function _get(target, property, receiver) { var base = FacilityAnalystUpstream3DService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FacilityAnalystUpstream3DService_get.apply(this, arguments); }
  37006. function FacilityAnalystUpstream3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystUpstream3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  37007. function FacilityAnalystUpstream3DService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FacilityAnalystUpstream3DService_setPrototypeOf(subClass, superClass); }
  37008. function FacilityAnalystUpstream3DService_setPrototypeOf(o, p) { FacilityAnalystUpstream3DService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystUpstream3DService_setPrototypeOf(o, p); }
  37009. function FacilityAnalystUpstream3DService_createSuper(Derived) { var hasNativeReflectConstruct = FacilityAnalystUpstream3DService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FacilityAnalystUpstream3DService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FacilityAnalystUpstream3DService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FacilityAnalystUpstream3DService_possibleConstructorReturn(this, result); }; }
  37010. function FacilityAnalystUpstream3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystUpstream3DService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FacilityAnalystUpstream3DService_assertThisInitialized(self); }
  37011. function FacilityAnalystUpstream3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  37012. function FacilityAnalystUpstream3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  37013. function FacilityAnalystUpstream3DService_getPrototypeOf(o) { FacilityAnalystUpstream3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystUpstream3DService_getPrototypeOf(o); }
  37014. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  37015. * This program are made available under the terms of the Apache License, Version 2.0
  37016. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37017. /**
  37018. * @class FacilityAnalystUpstream3DService
  37019. * @deprecatedclass SuperMap.FacilityAnalystUpstream3DService
  37020. * @category iServer FacilityAnalyst3D UpstreamCirticalFaclilities
  37021. * @classdesc 上游关键设施查找资源服务类
  37022. * @extends {CommonServiceBase}
  37023. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  37024. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  37025. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  37026. * @param {Object} options - 参数。
  37027. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  37028. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  37029. * @param {Object} [options.headers] - 请求头。
  37030. * @usage
  37031. */
  37032. var FacilityAnalystUpstream3DService = /*#__PURE__*/function (_CommonServiceBase) {
  37033. FacilityAnalystUpstream3DService_inherits(FacilityAnalystUpstream3DService, _CommonServiceBase);
  37034. var _super = FacilityAnalystUpstream3DService_createSuper(FacilityAnalystUpstream3DService);
  37035. function FacilityAnalystUpstream3DService(url, options) {
  37036. var _this;
  37037. FacilityAnalystUpstream3DService_classCallCheck(this, FacilityAnalystUpstream3DService);
  37038. _this = _super.call(this, url, options);
  37039. _this.CLASS_NAME = "SuperMap.FacilityAnalystUpstream3DService";
  37040. return _this;
  37041. }
  37042. /**
  37043. * @function FacilityAnalystUpstream3DService.prototype.destroy
  37044. * @override
  37045. */
  37046. FacilityAnalystUpstream3DService_createClass(FacilityAnalystUpstream3DService, [{
  37047. key: "destroy",
  37048. value: function destroy() {
  37049. FacilityAnalystUpstream3DService_get(FacilityAnalystUpstream3DService_getPrototypeOf(FacilityAnalystUpstream3DService.prototype), "destroy", this).call(this);
  37050. }
  37051. /**
  37052. * @function FacilityAnalystUpstream3DService.prototype.processAsync
  37053. * @description 负责将客户端的查询参数传递到服务端。
  37054. * @param {FacilityAnalystUpstream3DParameters} params - 上游关键设施查找资源参数类
  37055. */
  37056. }, {
  37057. key: "processAsync",
  37058. value: function processAsync(params) {
  37059. if (!(params instanceof FacilityAnalystUpstream3DParameters)) {
  37060. return;
  37061. }
  37062. var me = this,
  37063. jsonObject;
  37064. me.url = Util_Util.urlPathAppend(me.url, 'upstreamcirticalfaclilities');
  37065. jsonObject = {
  37066. sourceNodeIDs: params.sourceNodeIDs,
  37067. edgeID: params.edgeID,
  37068. nodeID: params.nodeID,
  37069. isUncertainDirectionValid: params.isUncertainDirectionValid
  37070. };
  37071. me.request({
  37072. method: "GET",
  37073. params: jsonObject,
  37074. scope: me,
  37075. success: me.serviceProcessCompleted,
  37076. failure: me.serviceProcessFailed
  37077. });
  37078. }
  37079. }]);
  37080. return FacilityAnalystUpstream3DService;
  37081. }(CommonServiceBase);
  37082. ;// CONCATENATED MODULE: ./src/common/iServer/FieldParameters.js
  37083. function FieldParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37084. function FieldParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  37085. function FieldParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  37086. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  37087. * This program are made available under the terms of the Apache License, Version 2.0
  37088. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37089. /**
  37090. * @class FieldParameters
  37091. * @deprecatedclass SuperMap.FieldParameters
  37092. * @category iServer Data Field
  37093. * @classdesc 字段信息查询参数类。
  37094. * @param {Object} options - 参数。
  37095. * @param {string} options.datasource - 数据源名称。
  37096. * @param {string} options.dataset - 数据集名称。
  37097. * @usage
  37098. */
  37099. var FieldParameters = /*#__PURE__*/function () {
  37100. function FieldParameters(options) {
  37101. FieldParameters_classCallCheck(this, FieldParameters);
  37102. /**
  37103. * @member {string} FieldParameters.prototype.datasource
  37104. * @description 要查询的数据集所在的数据源名称。
  37105. */
  37106. this.datasource = null;
  37107. /**
  37108. * @member {string} FieldParameters.prototype.dataset
  37109. * @description 要查询的数据集名称。
  37110. */
  37111. this.dataset = null;
  37112. if (options) {
  37113. Util_Util.extend(this, options);
  37114. }
  37115. this.CLASS_NAME = "SuperMap.FieldParameters";
  37116. }
  37117. /**
  37118. * @function FieldParameters.prototype.destroy
  37119. * @description 释放资源,将引用资源的属性置空。
  37120. */
  37121. FieldParameters_createClass(FieldParameters, [{
  37122. key: "destroy",
  37123. value: function destroy() {
  37124. var me = this;
  37125. me.datasource = null;
  37126. me.dataset = null;
  37127. }
  37128. }]);
  37129. return FieldParameters;
  37130. }();
  37131. ;// CONCATENATED MODULE: ./src/common/iServer/FieldStatisticsParameters.js
  37132. function FieldStatisticsParameters_typeof(obj) { "@babel/helpers - typeof"; return FieldStatisticsParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FieldStatisticsParameters_typeof(obj); }
  37133. function FieldStatisticsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37134. function FieldStatisticsParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  37135. function FieldStatisticsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldStatisticsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldStatisticsParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  37136. function FieldStatisticsParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FieldStatisticsParameters_setPrototypeOf(subClass, superClass); }
  37137. function FieldStatisticsParameters_setPrototypeOf(o, p) { FieldStatisticsParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FieldStatisticsParameters_setPrototypeOf(o, p); }
  37138. function FieldStatisticsParameters_createSuper(Derived) { var hasNativeReflectConstruct = FieldStatisticsParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FieldStatisticsParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FieldStatisticsParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FieldStatisticsParameters_possibleConstructorReturn(this, result); }; }
  37139. function FieldStatisticsParameters_possibleConstructorReturn(self, call) { if (call && (FieldStatisticsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FieldStatisticsParameters_assertThisInitialized(self); }
  37140. function FieldStatisticsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  37141. function FieldStatisticsParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  37142. function FieldStatisticsParameters_getPrototypeOf(o) { FieldStatisticsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FieldStatisticsParameters_getPrototypeOf(o); }
  37143. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  37144. * This program are made available under the terms of the Apache License, Version 2.0
  37145. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37146. /**
  37147. * @class FieldStatisticsParameters
  37148. * @deprecatedclass SuperMap.FieldStatisticsParameters
  37149. * @category iServer Data Field
  37150. * @classdesc 字段统计信息查询参数类。
  37151. * @param {Object} options - 参数。
  37152. * @param {string} options.datasource - 数据源名称。
  37153. * @param {string} options.dataset - 数据集名称。
  37154. * @param {string} options.fieldName - 字段名。
  37155. * @param {(string.<StatisticMode>|Array.<string.<StatisticMode>>)} statisticMode - 字段统计方法类型。
  37156. * @extends {FieldParameters}
  37157. * @usage
  37158. */
  37159. var FieldStatisticsParameters = /*#__PURE__*/function (_FieldParameters) {
  37160. FieldStatisticsParameters_inherits(FieldStatisticsParameters, _FieldParameters);
  37161. var _super = FieldStatisticsParameters_createSuper(FieldStatisticsParameters);
  37162. function FieldStatisticsParameters(options) {
  37163. var _this;
  37164. FieldStatisticsParameters_classCallCheck(this, FieldStatisticsParameters);
  37165. _this = _super.call(this, options);
  37166. /**
  37167. * @member {string} FieldStatisticsParameters.prototype.fieldName
  37168. * @description 字段名。
  37169. */
  37170. _this.fieldName = null;
  37171. /**
  37172. * @member {(string.<StatisticMode>|Array.<string.<StatisticMode>>)} FieldStatisticsParameters.prototype.statisticMode
  37173. * @description 字段统计方法类型。
  37174. */
  37175. _this.statisticMode = null;
  37176. if (options) {
  37177. Util_Util.extend(FieldStatisticsParameters_assertThisInitialized(_this), options);
  37178. }
  37179. _this.CLASS_NAME = "SuperMap.FieldStatisticsParameters";
  37180. return _this;
  37181. }
  37182. /**
  37183. * @function FieldStatisticsParameters.prototype.destroy
  37184. * @description 释放资源,将引用资源的属性置空。
  37185. */
  37186. FieldStatisticsParameters_createClass(FieldStatisticsParameters, [{
  37187. key: "destroy",
  37188. value: function destroy() {
  37189. var me = this;
  37190. me.fieldName = null;
  37191. me.statisticMode = null;
  37192. }
  37193. }]);
  37194. return FieldStatisticsParameters;
  37195. }(FieldParameters);
  37196. ;// CONCATENATED MODULE: ./src/common/iServer/FieldStatisticService.js
  37197. function FieldStatisticService_typeof(obj) { "@babel/helpers - typeof"; return FieldStatisticService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FieldStatisticService_typeof(obj); }
  37198. function FieldStatisticService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37199. function FieldStatisticService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  37200. function FieldStatisticService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldStatisticService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldStatisticService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  37201. function FieldStatisticService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FieldStatisticService_get = Reflect.get.bind(); } else { FieldStatisticService_get = function _get(target, property, receiver) { var base = FieldStatisticService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FieldStatisticService_get.apply(this, arguments); }
  37202. function FieldStatisticService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FieldStatisticService_getPrototypeOf(object); if (object === null) break; } return object; }
  37203. function FieldStatisticService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FieldStatisticService_setPrototypeOf(subClass, superClass); }
  37204. function FieldStatisticService_setPrototypeOf(o, p) { FieldStatisticService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FieldStatisticService_setPrototypeOf(o, p); }
  37205. function FieldStatisticService_createSuper(Derived) { var hasNativeReflectConstruct = FieldStatisticService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FieldStatisticService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FieldStatisticService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FieldStatisticService_possibleConstructorReturn(this, result); }; }
  37206. function FieldStatisticService_possibleConstructorReturn(self, call) { if (call && (FieldStatisticService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FieldStatisticService_assertThisInitialized(self); }
  37207. function FieldStatisticService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  37208. function FieldStatisticService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  37209. function FieldStatisticService_getPrototypeOf(o) { FieldStatisticService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FieldStatisticService_getPrototypeOf(o); }
  37210. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  37211. * This program are made available under the terms of the Apache License, Version 2.0
  37212. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37213. /**
  37214. * @class FieldStatisticService
  37215. * @deprecatedclass SuperMap.FieldStatisticService
  37216. * @category iServer Data Field
  37217. * @classdesc 字段查询统计服务类。用来完成对指定数据集指定字段的查询统计分析,即求平均值,最大值等。
  37218. * @extends {CommonServiceBase}
  37219. * @param {string} url - 服务地址。如访问 World Map 服务,只需将 url 设为:http://localhost:8090/iserver/services/data-world/rest/data 即可。
  37220. * @param {Object} options - 参数。
  37221. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  37222. * @param {DataFormat} [options.format] - 查询结果返回格式,目前支持 iServerJSON 和GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  37223. * @param {string} options.datasource - 数据集所在的数据源名称。
  37224. * @param {string} options.dataset - 数据集名称。
  37225. * @param {string} options.field - 查询统计的目标字段名称。
  37226. * @param {StatisticMode} options.statisticMode - 字段查询统计的方法类型。
  37227. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  37228. * @param {Object} [options.headers] - 请求头。
  37229. * @example
  37230. * var myService = new FieldStatisticService(url, {eventListeners: {
  37231. * "processCompleted": fieldStatisticCompleted,
  37232. * "processFailed": fieldStatisticError
  37233. * },
  37234. * datasource: "World",
  37235. * dataset: "Countries",
  37236. * field: "SmID",
  37237. * statisticMode: StatisticMode.AVERAGE
  37238. * };
  37239. * @usage
  37240. */
  37241. var FieldStatisticService = /*#__PURE__*/function (_CommonServiceBase) {
  37242. FieldStatisticService_inherits(FieldStatisticService, _CommonServiceBase);
  37243. var _super = FieldStatisticService_createSuper(FieldStatisticService);
  37244. function FieldStatisticService(url, options) {
  37245. var _this;
  37246. FieldStatisticService_classCallCheck(this, FieldStatisticService);
  37247. _this = _super.call(this, url, options);
  37248. /**
  37249. * @member {string} FieldStatisticService.prototype.datasource
  37250. * @description 数据集所在的数据源名称。
  37251. */
  37252. _this.datasource = null;
  37253. /**
  37254. * @member {string} FieldStatisticService.prototype.dataset
  37255. * @description 数据集名称。
  37256. */
  37257. _this.dataset = null;
  37258. /**
  37259. * @member {string} FieldStatisticService.prototype.field
  37260. * @description 查询统计的目标字段名称。
  37261. */
  37262. _this.field = null;
  37263. /**
  37264. * @member {StatisticMode} FieldStatisticService.prototype.statisticMode
  37265. * @description 字段查询统计的方法类型。
  37266. */
  37267. _this.statisticMode = null;
  37268. if (options) {
  37269. Util_Util.extend(FieldStatisticService_assertThisInitialized(_this), options);
  37270. }
  37271. _this.CLASS_NAME = "SuperMap.FieldStatisticService";
  37272. return _this;
  37273. }
  37274. /**
  37275. * @function FieldStatisticService.prototype.destroy
  37276. * @override
  37277. */
  37278. FieldStatisticService_createClass(FieldStatisticService, [{
  37279. key: "destroy",
  37280. value: function destroy() {
  37281. FieldStatisticService_get(FieldStatisticService_getPrototypeOf(FieldStatisticService.prototype), "destroy", this).call(this);
  37282. var me = this;
  37283. me.datasource = null;
  37284. me.dataset = null;
  37285. me.field = null;
  37286. me.statisticMode = null;
  37287. }
  37288. /**
  37289. * @function FieldStatisticService.prototype.processAsync
  37290. * @description 执行服务,进行指定字段的查询统计。
  37291. */
  37292. }, {
  37293. key: "processAsync",
  37294. value: function processAsync() {
  37295. var me = this,
  37296. fieldStatisticURL = "datasources/" + me.datasource + "/datasets/" + me.dataset + "/fields/" + me.field + "/" + me.statisticMode;
  37297. me.url = Util_Util.urlPathAppend(me.url, fieldStatisticURL);
  37298. me.request({
  37299. method: "GET",
  37300. data: null,
  37301. scope: me,
  37302. success: me.serviceProcessCompleted,
  37303. failure: me.serviceProcessFailed
  37304. });
  37305. }
  37306. }]);
  37307. return FieldStatisticService;
  37308. }(CommonServiceBase);
  37309. ;// CONCATENATED MODULE: ./src/common/iServer/FindClosestFacilitiesParameters.js
  37310. function FindClosestFacilitiesParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37311. function FindClosestFacilitiesParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  37312. function FindClosestFacilitiesParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindClosestFacilitiesParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindClosestFacilitiesParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  37313. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  37314. * This program are made available under the terms of the Apache License, Version 2.0
  37315. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37316. /**
  37317. * @class FindClosestFacilitiesParameters
  37318. * @deprecatedclass SuperMap.FindClosestFacilitiesParameters
  37319. * @category iServer NetworkAnalyst ClosestFacility
  37320. * @classdesc 最近设施分析参数类。
  37321. * @param {Object} options - 参数。
  37322. * @param {GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} options.event - 事件点,一般为需要获得服务设施服务的事件位置。
  37323. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} options.facilities - 设施点集合,一般为提供服务的服务设施位置。
  37324. * @param {number} [options.expectFacilityCount=1] - 要查找的设施点数量。
  37325. * @param {boolean} [options.fromEvent=false] - 是否从事件点到设施点进行查找。
  37326. * @param {boolean} [options.isAnalyzeById=false] - 事件点和设施点是否通过节点 ID 号来指定。
  37327. * @param {number} [options.maxWeight=0] - 权值的最大限值。单位与该类中 parameter 字段(交通网络分析通用参数)中设置的耗费字段一致。
  37328. * @param {TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  37329. * @usage
  37330. */
  37331. var FindClosestFacilitiesParameters = /*#__PURE__*/function () {
  37332. function FindClosestFacilitiesParameters(options) {
  37333. FindClosestFacilitiesParameters_classCallCheck(this, FindClosestFacilitiesParameters);
  37334. /**
  37335. * @member {GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} FindClosestFacilitiesParameters.prototype.event
  37336. * @description 事件点,一般为需要获得服务设施服务的事件位置。
  37337. * 可以通过两种方式赋予事件点:当该类中字段 isAnalyzeById = true 时,应输入事件点 ID 号;当 isAnalyzeById = false 时,应输入事件点坐标。
  37338. */
  37339. this.event = null;
  37340. /**
  37341. * @member {number} [FindClosestFacilitiesParameters.prototype.expectFacilityCount=1]
  37342. * @description 要查找的设施点数量。
  37343. */
  37344. this.expectFacilityCount = 1;
  37345. /**
  37346. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} [FindClosestFacilitiesParameters.prototype.facilities=false]
  37347. * @description 设施点集合,一般为提供服务的服务设施位置。
  37348. * 可以通过两种方式赋予设施点:当该类中字段 isAnalyzeById = true 时,应输入设施点 ID 号;当 isAnalyzeById = false 时,应输入设施点坐标。
  37349. */
  37350. this.facilities = null;
  37351. /**
  37352. * @member {boolean} [FindClosestFacilitiesParameters.prototype.fromEvent=false]
  37353. * @description 是否从事件点到设施点进行查找。最近设施分析主要是通过设施点和事件点之间最优的路线来分析在一定范围内哪个或哪些设施与事件点有最优路线的关系。
  37354. * 这个行走线路是通过网络图层进行网络分析算法计算出来的两点间的最优路线。由于存在从 A 点到 B 点与从 B 点到 A 点的耗费不一样的情况,因此起止点不同可能会得到不同的最优路线。因此在进行最近设施分析之前,需要设置获取的最优路线的方向,即是以事件点作为起点到最近设施点的方向分析,还是以最近设施点为起点到事件点的方向分析。如果需要以事件点作为起点到设施点方向进行查找,设置该字段值为 true;设置为 false,表示从设施点到事件点进行查找。
  37355. */
  37356. this.fromEvent = false;
  37357. /**
  37358. * @member {boolean} [FindClosestFacilitiesParameters.prototype.isAnalyzeById=false]
  37359. * @description 事件点和设施点是否通过节点 ID 号来指定,设置为 false,表示通过坐标点指定事件点和设施点。
  37360. */
  37361. this.isAnalyzeById = false;
  37362. /**
  37363. * @member {number} [FindClosestFacilitiesParameters.prototype.maxWeight=0]
  37364. * @description 权值的最大限值。单位与该类中 parameter 字段(交通网络分析通用参数)中设置的耗费字段一致。
  37365. * 例如事件发生点是一起交通事故,要求查找在 10 分钟内能到达的最近医院,超过 10 分钟能到达的都不予考虑。
  37366. * 那么需要将网络分析参数中 parameter.weightFieldName 设置为表示时间的字段,然后设置查找范围的半径值为10。
  37367. */
  37368. this.maxWeight = 0;
  37369. /**
  37370. * @member {TransportationAnalystParameter} [FindClosestFacilitiesParameters.prototype.parameter]
  37371. * @description 交通网络分析通用参数。通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息。
  37372. * 它为 TransportationAnalystParameter 类型,虽然为可选参数,但是如果不设置其中的 resultSetting 字段,
  37373. * 则返回结果空间信息等都为空。
  37374. */
  37375. this.parameter = new TransportationAnalystParameter();
  37376. Util_Util.extend(this, options);
  37377. this.CLASS_NAME = "SuperMap.FindClosestFacilitiesParameters";
  37378. }
  37379. /**
  37380. * @function FindClosestFacilitiesParameters.prototype.destroy
  37381. * @description 释放资源,将引用资源的属性置空。
  37382. */
  37383. FindClosestFacilitiesParameters_createClass(FindClosestFacilitiesParameters, [{
  37384. key: "destroy",
  37385. value: function destroy() {
  37386. var me = this;
  37387. me.event = null;
  37388. me.expectFacilityCount = null;
  37389. me.facilities = null;
  37390. me.fromEvent = null;
  37391. me.isAnalyzeById = null;
  37392. me.maxWeight = null;
  37393. if (me.parameter) {
  37394. me.parameter.destroy();
  37395. me.parameter = null;
  37396. }
  37397. }
  37398. }]);
  37399. return FindClosestFacilitiesParameters;
  37400. }();
  37401. ;// CONCATENATED MODULE: ./src/common/iServer/FindClosestFacilitiesService.js
  37402. function FindClosestFacilitiesService_typeof(obj) { "@babel/helpers - typeof"; return FindClosestFacilitiesService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FindClosestFacilitiesService_typeof(obj); }
  37403. function FindClosestFacilitiesService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37404. function FindClosestFacilitiesService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  37405. function FindClosestFacilitiesService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindClosestFacilitiesService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindClosestFacilitiesService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  37406. function FindClosestFacilitiesService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FindClosestFacilitiesService_get = Reflect.get.bind(); } else { FindClosestFacilitiesService_get = function _get(target, property, receiver) { var base = FindClosestFacilitiesService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FindClosestFacilitiesService_get.apply(this, arguments); }
  37407. function FindClosestFacilitiesService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindClosestFacilitiesService_getPrototypeOf(object); if (object === null) break; } return object; }
  37408. function FindClosestFacilitiesService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FindClosestFacilitiesService_setPrototypeOf(subClass, superClass); }
  37409. function FindClosestFacilitiesService_setPrototypeOf(o, p) { FindClosestFacilitiesService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindClosestFacilitiesService_setPrototypeOf(o, p); }
  37410. function FindClosestFacilitiesService_createSuper(Derived) { var hasNativeReflectConstruct = FindClosestFacilitiesService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FindClosestFacilitiesService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FindClosestFacilitiesService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FindClosestFacilitiesService_possibleConstructorReturn(this, result); }; }
  37411. function FindClosestFacilitiesService_possibleConstructorReturn(self, call) { if (call && (FindClosestFacilitiesService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FindClosestFacilitiesService_assertThisInitialized(self); }
  37412. function FindClosestFacilitiesService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  37413. function FindClosestFacilitiesService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  37414. function FindClosestFacilitiesService_getPrototypeOf(o) { FindClosestFacilitiesService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindClosestFacilitiesService_getPrototypeOf(o); }
  37415. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  37416. * This program are made available under the terms of the Apache License, Version 2.0
  37417. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37418. /**
  37419. * @class FindClosestFacilitiesService
  37420. * @deprecatedclass SuperMap.FindClosestFacilitiesService
  37421. * @category iServer NetworkAnalyst ClosestFacility
  37422. * @classdesc 最近设施分析服务类。
  37423. * 最近设施分析是指在网络上给定一个事件点和一组设施点,
  37424. * 查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  37425. * 该类负责将客户端指定的最近设施分析参数传递给服务端,并接收服务端返回的结果数据。
  37426. * 最近设施分析结果通过该类支持的事件的监听函数参数获取
  37427. * @extends {NetworkAnalystServiceBase}
  37428. * @example
  37429. * var myfindClosestFacilitiesService = new FindClosestFacilitiesService(url, {
  37430. * eventListeners: {
  37431. * "processCompleted": findClosestFacilitiesCompleted,
  37432. * "processFailed": findClosestFacilitiesError
  37433. * }
  37434. * });
  37435. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  37436. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  37437. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  37438. * @param {Object} options - 参数。
  37439. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  37440. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  37441. * @param {Object} [options.headers] - 请求头。
  37442. * @usage
  37443. */
  37444. var FindClosestFacilitiesService = /*#__PURE__*/function (_NetworkAnalystServic) {
  37445. FindClosestFacilitiesService_inherits(FindClosestFacilitiesService, _NetworkAnalystServic);
  37446. var _super = FindClosestFacilitiesService_createSuper(FindClosestFacilitiesService);
  37447. function FindClosestFacilitiesService(url, options) {
  37448. var _this;
  37449. FindClosestFacilitiesService_classCallCheck(this, FindClosestFacilitiesService);
  37450. _this = _super.call(this, url, options);
  37451. _this.CLASS_NAME = "SuperMap.FindClosestFacilitiesService";
  37452. return _this;
  37453. }
  37454. /**
  37455. * @function FindClosestFacilitiesService.prototype.destroy
  37456. * @override
  37457. */
  37458. FindClosestFacilitiesService_createClass(FindClosestFacilitiesService, [{
  37459. key: "destroy",
  37460. value: function destroy() {
  37461. FindClosestFacilitiesService_get(FindClosestFacilitiesService_getPrototypeOf(FindClosestFacilitiesService.prototype), "destroy", this).call(this);
  37462. }
  37463. /**
  37464. * @function FindClosestFacilitiesService.prototype.processAsync
  37465. * @description 负责将客户端的查询参数传递到服务端。
  37466. * @param {FindClosestFacilitiesParameters} params - 最近设施分析服务参数类
  37467. */
  37468. }, {
  37469. key: "processAsync",
  37470. value: function processAsync(params) {
  37471. if (!(params instanceof FindClosestFacilitiesParameters)) {
  37472. return;
  37473. }
  37474. var me = this,
  37475. jsonObject;
  37476. me.url = Util_Util.urlPathAppend(me.url, 'closestfacility');
  37477. jsonObject = {
  37478. expectFacilityCount: params.expectFacilityCount,
  37479. fromEvent: params.fromEvent,
  37480. maxWeight: params.maxWeight,
  37481. parameter: Util_Util.toJSON(params.parameter),
  37482. event: Util_Util.toJSON(params.event),
  37483. facilities: me.getJson(params.isAnalyzeById, params.facilities)
  37484. };
  37485. me.request({
  37486. method: "GET",
  37487. params: jsonObject,
  37488. scope: me,
  37489. success: me.serviceProcessCompleted,
  37490. failure: me.serviceProcessFailed
  37491. });
  37492. }
  37493. /**
  37494. * @function FindClosestFacilitiesService.prototype.getJson
  37495. * @description 将对象转化为JSON字符串。
  37496. * @param {boolean} isAnalyzeById - 是否通过ID来分析
  37497. * @param {Array.<Object>} params - 分析参数数组
  37498. * @returns {Object} 转化后的JSON字符串。
  37499. */
  37500. }, {
  37501. key: "getJson",
  37502. value: function getJson(isAnalyzeById, params) {
  37503. var jsonString = "[",
  37504. len = params ? params.length : 0;
  37505. if (isAnalyzeById === false) {
  37506. for (var i = 0; i < len; i++) {
  37507. if (i > 0) {
  37508. jsonString += ",";
  37509. }
  37510. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  37511. }
  37512. } else if (isAnalyzeById === true) {
  37513. for (var _i2 = 0; _i2 < len; _i2++) {
  37514. if (_i2 > 0) {
  37515. jsonString += ",";
  37516. }
  37517. jsonString += params[_i2];
  37518. }
  37519. }
  37520. jsonString += ']';
  37521. return jsonString;
  37522. }
  37523. /**
  37524. * @function FindClosestFacilitiesService.prototype.toGeoJSONResult
  37525. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  37526. * @param {Object} result - 服务器返回的结果对象。
  37527. */
  37528. }, {
  37529. key: "toGeoJSONResult",
  37530. value: function toGeoJSONResult(result) {
  37531. if (!result || !result.facilityPathList) {
  37532. return result;
  37533. }
  37534. var geoJSONFormat = new GeoJSON();
  37535. result.facilityPathList.map(function (path) {
  37536. if (path.route) {
  37537. path.route = geoJSONFormat.toGeoJSON(path.route);
  37538. }
  37539. if (path.pathGuideItems) {
  37540. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  37541. }
  37542. if (path.edgeFeatures) {
  37543. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  37544. }
  37545. if (path.nodeFeatures) {
  37546. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  37547. }
  37548. return path;
  37549. });
  37550. return result;
  37551. }
  37552. }]);
  37553. return FindClosestFacilitiesService;
  37554. }(NetworkAnalystServiceBase);
  37555. ;// CONCATENATED MODULE: ./src/common/iServer/FindLocationParameters.js
  37556. function FindLocationParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37557. function FindLocationParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  37558. function FindLocationParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindLocationParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindLocationParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  37559. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  37560. * This program are made available under the terms of the Apache License, Version 2.0
  37561. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37562. /**
  37563. * @class FindLocationParameters
  37564. * @deprecatedclass SuperMap.FindLocationParameters
  37565. * @category iServer NetworkAnalyst Location
  37566. * @classdesc 选址分区分析参数类。
  37567. * @param {Object} options - 参数。
  37568. * @param {string} options.turnWeightField - 转向权值字段的名称。
  37569. * @param {string} options.weightName - 阻力字段的名称,标识了进行网络分析时所使用的阻力字段。
  37570. * @param {Array.<SupplyCenter>} options.supplyCenters - 资源供给中心集合。
  37571. * @param {number} [options.expectedSupplyCenterCount=1] - 期望用于最终设施选址的资源供给中心数量。
  37572. * @param {boolean} [options.isFromCenter=false] - 是否从中心点开始分配资源。
  37573. * @usage
  37574. */
  37575. var FindLocationParameters = /*#__PURE__*/function () {
  37576. function FindLocationParameters(options) {
  37577. FindLocationParameters_classCallCheck(this, FindLocationParameters);
  37578. /**
  37579. * @member {number} [FindLocationParameters.prototype.expectedSupplyCenterCount=1]
  37580. * @description 期望用于最终设施选址的资源供给中心数量。
  37581. * 当输入值为 0 时,最终设施选址的资源供给中心数量默认为覆盖分析区域内的所需最少的供给中心数。
  37582. */
  37583. this.expectedSupplyCenterCount = null;
  37584. /**
  37585. * @member {boolean} [FindLocationParameters.prototype.isFromCenter=false]
  37586. * @description 是否从中心点开始分配资源。
  37587. * 由于网路数据中的弧段具有正反阻力,即弧段的正向阻力值与其反向阻力值可能不同,
  37588. * 因此,在进行分析时,从资源供给中心开始分配资源到需求点与从需求点向资源供给中心分配这两种分配形式下,所得的分析结果会不同。
  37589. */
  37590. this.isFromCenter = false;
  37591. /**
  37592. * @member {Array.<SupplyCenter>} FindLocationParameters.prototype.supplyCenters
  37593. * @description 资源供给中心集合。
  37594. * 资源供给中心是提供资源和服务的设施,对应于网络结点,
  37595. * 资源供给中心的相关信息包括资源量、最大阻力值、资源供给中心类型,资源供给中心在网络中所处结点的 ID 等,以便在进行选址分区分析时使用。
  37596. */
  37597. this.supplyCenters = null;
  37598. /**
  37599. * @member {string} FindLocationParameters.prototype.turnWeightField
  37600. * @description 转向权值字段的名称。
  37601. */
  37602. this.turnWeightField = null;
  37603. /**
  37604. * @member {string} FindLocationParameters.prototype.weightName
  37605. * @description 阻力字段的名称,标识了进行网络分析时所使用的阻力字段。
  37606. */
  37607. this.weightName = null;
  37608. Util_Util.extend(this, options);
  37609. this.CLASS_NAME = "SuperMap.FindLocationParameters";
  37610. }
  37611. /**
  37612. * @function FindLocationParameters.prototype.destroy
  37613. * @description 释放资源,将引用资源的属性置空。
  37614. */
  37615. FindLocationParameters_createClass(FindLocationParameters, [{
  37616. key: "destroy",
  37617. value: function destroy() {
  37618. var me = this;
  37619. me.expectedSupplyCenterCount = null;
  37620. me.isFromCenter = null;
  37621. me.turnWeightField = null;
  37622. me.weightName = null;
  37623. if (me.supplyCenters) {
  37624. for (var i = 0, supplyCenters = me.supplyCenters, len = supplyCenters.length; i < len; i++) {
  37625. supplyCenters[i].destroy();
  37626. }
  37627. me.supplyCenters = null;
  37628. }
  37629. }
  37630. }]);
  37631. return FindLocationParameters;
  37632. }();
  37633. ;// CONCATENATED MODULE: ./src/common/iServer/FindLocationService.js
  37634. function FindLocationService_typeof(obj) { "@babel/helpers - typeof"; return FindLocationService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FindLocationService_typeof(obj); }
  37635. function FindLocationService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37636. function FindLocationService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  37637. function FindLocationService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindLocationService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindLocationService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  37638. function FindLocationService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FindLocationService_get = Reflect.get.bind(); } else { FindLocationService_get = function _get(target, property, receiver) { var base = FindLocationService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FindLocationService_get.apply(this, arguments); }
  37639. function FindLocationService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindLocationService_getPrototypeOf(object); if (object === null) break; } return object; }
  37640. function FindLocationService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FindLocationService_setPrototypeOf(subClass, superClass); }
  37641. function FindLocationService_setPrototypeOf(o, p) { FindLocationService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindLocationService_setPrototypeOf(o, p); }
  37642. function FindLocationService_createSuper(Derived) { var hasNativeReflectConstruct = FindLocationService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FindLocationService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FindLocationService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FindLocationService_possibleConstructorReturn(this, result); }; }
  37643. function FindLocationService_possibleConstructorReturn(self, call) { if (call && (FindLocationService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FindLocationService_assertThisInitialized(self); }
  37644. function FindLocationService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  37645. function FindLocationService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  37646. function FindLocationService_getPrototypeOf(o) { FindLocationService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindLocationService_getPrototypeOf(o); }
  37647. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  37648. * This program are made available under the terms of the Apache License, Version 2.0
  37649. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37650. /**
  37651. * @class FindLocationService
  37652. * @deprecatedclass SuperMap.FindLocationService
  37653. * @category iServer NetworkAnalyst Location
  37654. * @classdesc 选址分区分析服务类。
  37655. * 选址分区分析是为了确定一个或多个待建设施的最佳或最优位置,使得设施可以用一种最经济有效的方式为需求方提供服务或者商品。
  37656. * 选址分区不仅仅是一个选址过程,还要将需求点的需求分配到相应的新建设施的服务区中,因此称之为选址与分区。
  37657. * 选址分区分析结果通过该类支持的事件的监听函数参数获取
  37658. * @extends {NetworkAnalystServiceBase}
  37659. * @example
  37660. * (start code)
  37661. * var findLocationService = new FindLocationService(url, {
  37662. * eventListeners: {
  37663. * "processCompleted": findLocationCompleted,
  37664. * "processFailed": findLocationError
  37665. * }
  37666. * });
  37667. * (end)
  37668. * @param {string} url - 服务地址。
  37669. * 如 http://localhost:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun 。
  37670. * @param {Object} options - 参数。
  37671. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  37672. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  37673. * @param {Object} [options.headers] - 请求头。
  37674. * @usage
  37675. */
  37676. var FindLocationService = /*#__PURE__*/function (_NetworkAnalystServic) {
  37677. FindLocationService_inherits(FindLocationService, _NetworkAnalystServic);
  37678. var _super = FindLocationService_createSuper(FindLocationService);
  37679. function FindLocationService(url, options) {
  37680. var _this;
  37681. FindLocationService_classCallCheck(this, FindLocationService);
  37682. _this = _super.call(this, url, options);
  37683. _this.CLASS_NAME = "SuperMap.FindLocationService";
  37684. return _this;
  37685. }
  37686. /**
  37687. * @function FindLocationService.prototype.destroy
  37688. * @override
  37689. */
  37690. FindLocationService_createClass(FindLocationService, [{
  37691. key: "destroy",
  37692. value: function destroy() {
  37693. FindLocationService_get(FindLocationService_getPrototypeOf(FindLocationService.prototype), "destroy", this).call(this);
  37694. }
  37695. /**
  37696. * @function FindLocationService.prototype.processAsync
  37697. * @description 负责将客户端的查询参数传递到服务端。
  37698. * @param {FindLocationParameters} params - 选址分区分析服务参数类
  37699. */
  37700. }, {
  37701. key: "processAsync",
  37702. value: function processAsync(params) {
  37703. if (!(params instanceof FindLocationParameters)) {
  37704. return;
  37705. }
  37706. var me = this,
  37707. jsonObject;
  37708. me.url = Util_Util.urlPathAppend(me.url, 'location');
  37709. jsonObject = {
  37710. isFromCenter: params.isFromCenter,
  37711. expectedSupplyCenterCount: params.expectedSupplyCenterCount,
  37712. weightName: params.weightName,
  37713. turnWeightField: params.turnWeightField,
  37714. returnEdgeFeature: true,
  37715. returnEdgeGeometry: true,
  37716. returnNodeFeature: true,
  37717. mapParameter: Util_Util.toJSON(params.mapParameter),
  37718. supplyCenters: me.getCentersJson(params.supplyCenters)
  37719. };
  37720. me.request({
  37721. method: "GET",
  37722. params: jsonObject,
  37723. scope: me,
  37724. success: me.serviceProcessCompleted,
  37725. failure: me.serviceProcessFailed
  37726. });
  37727. }
  37728. /**
  37729. * @function FindLocationService.prototype.getCentersJson
  37730. * @description 将数组对象转化为JSON字符串。
  37731. * @param {Array} params - 需要转换的参数
  37732. * @returns {string} 转化后的JSON字符串。
  37733. */
  37734. }, {
  37735. key: "getCentersJson",
  37736. value: function getCentersJson(params) {
  37737. var json = "[",
  37738. len = params ? params.length : 0;
  37739. for (var i = 0; i < len; i++) {
  37740. if (i > 0) {
  37741. json += ",";
  37742. }
  37743. json += Util_Util.toJSON(params[i]);
  37744. }
  37745. json += "]";
  37746. return json;
  37747. }
  37748. /**
  37749. * @function FindLocationService.prototype.toGeoJSONResult
  37750. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  37751. * @param {Object} result - 服务器返回的结果对象。
  37752. */
  37753. }, {
  37754. key: "toGeoJSONResult",
  37755. value: function toGeoJSONResult(result) {
  37756. if (!result) {
  37757. return null;
  37758. }
  37759. var geoJSONFormat = new GeoJSON();
  37760. if (result.demandResults) {
  37761. result.demandResults = geoJSONFormat.toGeoJSON(result.demandResults);
  37762. }
  37763. if (result.supplyResults) {
  37764. result.supplyResults = geoJSONFormat.toGeoJSON(result.supplyResults);
  37765. }
  37766. return result;
  37767. }
  37768. }]);
  37769. return FindLocationService;
  37770. }(NetworkAnalystServiceBase);
  37771. ;// CONCATENATED MODULE: ./src/common/iServer/FindMTSPPathsParameters.js
  37772. function FindMTSPPathsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37773. function FindMTSPPathsParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  37774. function FindMTSPPathsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindMTSPPathsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindMTSPPathsParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  37775. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  37776. * This program are made available under the terms of the Apache License, Version 2.0
  37777. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37778. /**
  37779. * @class FindMTSPPathsParameters
  37780. * @deprecatedclass SuperMap.FindMTSPPathsParameters
  37781. * @category iServer NetworkAnalyst MTSPPath
  37782. * @classdesc 多旅行商分析参数类。
  37783. * @param {Object} options - 参数。
  37784. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} options.centers - 配送中心集合。
  37785. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} options.nodes - 配送目标集合。
  37786. * @param {boolean} [options.hasLeastTotalCost=false] - 配送模式是否为总花费最小方案。
  37787. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 号来指定配送中心点和配送目的点,即通过坐标点指定。
  37788. * @param {TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  37789. * @usage
  37790. */
  37791. var FindMTSPPathsParameters = /*#__PURE__*/function () {
  37792. function FindMTSPPathsParameters(options) {
  37793. FindMTSPPathsParameters_classCallCheck(this, FindMTSPPathsParameters);
  37794. /**
  37795. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} FindMTSPPathsParameters.prototype.centers
  37796. * @description 配送中心集合。
  37797. * 当 FindMTSPPathsParameters.isAnalyzeById = false 时,centers 应为点的坐标数组;
  37798. * 当 FindMTSPPathsParameters.isAnalyzeById = true 时,centers 应为点的 ID 数组。
  37799. */
  37800. this.centers = null;
  37801. /**
  37802. * @member {boolean} [FindMTSPPathsParameters.prototype.hasLeastTotalCost=false]
  37803. * @description 配送模式是否为总花费最小方案。
  37804. * 若为 true,则按照总花费最小的模式进行配送,此时可能会出现某几个配送中心点配送的花费较多而其他配送中心点的花费很少的情况。
  37805. * 若为 false,则为局部最优,此方案会控制每个配送中心点的花费,使各个中心点花费相对平均,此时总花费不一定最小。
  37806. */
  37807. this.hasLeastTotalCost = false;
  37808. /**
  37809. * @member {boolean} [FindMTSPPathsParameters.prototype.isAnalyzeById=false]
  37810. * @description 是否通过节点 ID 号来指定配送中心点和配送目的点,即通过坐标点指定。
  37811. */
  37812. this.isAnalyzeById = false;
  37813. /**
  37814. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} FindMTSPPathsParameters.prototype.nodes
  37815. * @description 配送目标集合。
  37816. * 当 FindMTSPPathsParameters.isAnalyzeById = false 时,nodes 应为点的坐标数组;
  37817. * 当 FindMTSPPathsParameters.isAnalyzeById = true 时,nodes 应为点的 ID 数组。
  37818. */
  37819. this.nodes = null;
  37820. /**
  37821. * @member {TransportationAnalystParameter} [FindMTSPPathsParameters.prototype.parameter]
  37822. * @description 交通网络分析通用参数。
  37823. * 通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息。
  37824. * TransportationAnalystParameter 类型,它虽然为可选参数,但是如果不设置其中的 resultSetting 字段,则返回结果空间信息等都为空。
  37825. */
  37826. this.parameter = new TransportationAnalystParameter();
  37827. Util_Util.extend(this, options);
  37828. this.CLASS_NAME = "SuperMap.FindMTSPPathsParameters";
  37829. }
  37830. /**
  37831. * @function FindMTSPPathsParameters.prototype.destroy
  37832. * @description 释放资源,将引用资源的属性置空。
  37833. */
  37834. FindMTSPPathsParameters_createClass(FindMTSPPathsParameters, [{
  37835. key: "destroy",
  37836. value: function destroy() {
  37837. var me = this;
  37838. me.centers = null;
  37839. me.hasLeastTotalCost = null;
  37840. me.isAnalyzeById = null;
  37841. me.nodes = null;
  37842. me.maxWeight = null;
  37843. if (me.parameter) {
  37844. me.parameter.destroy();
  37845. me.parameter = null;
  37846. }
  37847. }
  37848. }]);
  37849. return FindMTSPPathsParameters;
  37850. }();
  37851. ;// CONCATENATED MODULE: ./src/common/iServer/FindMTSPPathsService.js
  37852. function FindMTSPPathsService_typeof(obj) { "@babel/helpers - typeof"; return FindMTSPPathsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FindMTSPPathsService_typeof(obj); }
  37853. function FindMTSPPathsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37854. function FindMTSPPathsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  37855. function FindMTSPPathsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindMTSPPathsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindMTSPPathsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  37856. function FindMTSPPathsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FindMTSPPathsService_get = Reflect.get.bind(); } else { FindMTSPPathsService_get = function _get(target, property, receiver) { var base = FindMTSPPathsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FindMTSPPathsService_get.apply(this, arguments); }
  37857. function FindMTSPPathsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindMTSPPathsService_getPrototypeOf(object); if (object === null) break; } return object; }
  37858. function FindMTSPPathsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FindMTSPPathsService_setPrototypeOf(subClass, superClass); }
  37859. function FindMTSPPathsService_setPrototypeOf(o, p) { FindMTSPPathsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindMTSPPathsService_setPrototypeOf(o, p); }
  37860. function FindMTSPPathsService_createSuper(Derived) { var hasNativeReflectConstruct = FindMTSPPathsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FindMTSPPathsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FindMTSPPathsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FindMTSPPathsService_possibleConstructorReturn(this, result); }; }
  37861. function FindMTSPPathsService_possibleConstructorReturn(self, call) { if (call && (FindMTSPPathsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FindMTSPPathsService_assertThisInitialized(self); }
  37862. function FindMTSPPathsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  37863. function FindMTSPPathsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  37864. function FindMTSPPathsService_getPrototypeOf(o) { FindMTSPPathsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindMTSPPathsService_getPrototypeOf(o); }
  37865. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  37866. * This program are made available under the terms of the Apache License, Version 2.0
  37867. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37868. /**
  37869. * @class FindMTSPPathsService
  37870. * @deprecatedclass SuperMap.FindMTSPPathsService
  37871. * @category iServer NetworkAnalyst MTSPPath
  37872. * @classdesc 多旅行商分析服务类
  37873. * 多旅行商分析也称为物流配送,是指在网络数据集中,给定 M 个配送中心点和 N 个配送目的地(M,N 为大于零的整数)。
  37874. * 查找经济有效的配送路径,并给出相应的行走路线。
  37875. * 物流配送功能就是解决如何合理分配配送次序和送货路线,使配送总花费达到最小或每个配送中心的花费达到最小。
  37876. * 该类负责将客户端指定的多旅行商分析参数传递给服务端,并接收服务端返回的结果数据。
  37877. * 多旅行商分析结果通过该类支持的事件的监听函数参数获取。
  37878. * @extends {NetworkAnalystServiceBase}
  37879. * @example
  37880. * var myFindMTSPPathsService = new FindMTSPPathsService(url, {
  37881. * eventListeners: {
  37882. * "processCompleted": findMTSPPathsCompleted,
  37883. * "processFailed": findMTSPPathsError
  37884. * }
  37885. * });
  37886. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  37887. * http://{服务器地址}:{服务端口号}/iserver/services/网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  37888. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  37889. * @param {Object} options - 互服务时所需可选参数。如:
  37890. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  37891. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  37892. * @param {Object} [options.headers] - 请求头。
  37893. * @usage
  37894. */
  37895. var FindMTSPPathsService = /*#__PURE__*/function (_NetworkAnalystServic) {
  37896. FindMTSPPathsService_inherits(FindMTSPPathsService, _NetworkAnalystServic);
  37897. var _super = FindMTSPPathsService_createSuper(FindMTSPPathsService);
  37898. function FindMTSPPathsService(url, options) {
  37899. var _this;
  37900. FindMTSPPathsService_classCallCheck(this, FindMTSPPathsService);
  37901. _this = _super.call(this, url, options);
  37902. _this.CLASS_NAME = "SuperMap.FindMTSPPathsService";
  37903. return _this;
  37904. }
  37905. /**
  37906. * @function FindMTSPPathsService.prototype.destroy
  37907. * @override
  37908. */
  37909. FindMTSPPathsService_createClass(FindMTSPPathsService, [{
  37910. key: "destroy",
  37911. value: function destroy() {
  37912. FindMTSPPathsService_get(FindMTSPPathsService_getPrototypeOf(FindMTSPPathsService.prototype), "destroy", this).call(this);
  37913. }
  37914. /**
  37915. * @function FindMTSPPathsService..prototype.processAsync
  37916. * @description 负责将客户端的查询参数传递到服务端。
  37917. * @param {FindMTSPPathsParameters} params - 多旅行商分析服务参数类
  37918. */
  37919. }, {
  37920. key: "processAsync",
  37921. value: function processAsync(params) {
  37922. if (!(params instanceof FindMTSPPathsParameters)) {
  37923. return;
  37924. }
  37925. var me = this,
  37926. jsonObject,
  37927. //end = me.url.substr(me.url.length - 1, 1),
  37928. centers = me.getJson(params.isAnalyzeById, params.centers),
  37929. nodes = me.getJson(params.isAnalyzeById, params.nodes);
  37930. me.url = Util_Util.urlPathAppend(me.url, 'mtsppath');
  37931. jsonObject = {
  37932. centers: centers,
  37933. nodes: nodes,
  37934. parameter: Util_Util.toJSON(params.parameter),
  37935. hasLeastTotalCost: params.hasLeastTotalCost
  37936. };
  37937. me.request({
  37938. method: "GET",
  37939. params: jsonObject,
  37940. scope: me,
  37941. success: me.serviceProcessCompleted,
  37942. failure: me.serviceProcessFailed
  37943. });
  37944. }
  37945. /**
  37946. * @function FindMTSPPathsService.prototype.getJson
  37947. * @description 将对象转化为JSON字符串。
  37948. * @param {boolean} isAnalyzeById - 是否通过id分析
  37949. * @param {Array} params - 需要转换的数字
  37950. * @returns {Object} 转化后的JSON字符串。
  37951. */
  37952. }, {
  37953. key: "getJson",
  37954. value: function getJson(isAnalyzeById, params) {
  37955. var jsonString = "[",
  37956. len = params ? params.length : 0;
  37957. if (isAnalyzeById === false) {
  37958. for (var i = 0; i < len; i++) {
  37959. if (i > 0) {
  37960. jsonString += ",";
  37961. }
  37962. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  37963. }
  37964. } else if (isAnalyzeById === true) {
  37965. for (var _i2 = 0; _i2 < len; _i2++) {
  37966. if (_i2 > 0) {
  37967. jsonString += ",";
  37968. }
  37969. jsonString += params[_i2];
  37970. }
  37971. }
  37972. jsonString += ']';
  37973. return jsonString;
  37974. }
  37975. /**
  37976. * @function FindMTSPPathsService.prototype.toGeoJSONResult
  37977. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  37978. * @param {Object} result - 服务器返回的结果对象。
  37979. */
  37980. }, {
  37981. key: "toGeoJSONResult",
  37982. value: function toGeoJSONResult(result) {
  37983. if (!result || !result.pathList) {
  37984. return null;
  37985. }
  37986. var geoJSONFormat = new GeoJSON();
  37987. result.pathList.map(function (path) {
  37988. if (path.route) {
  37989. path.route = geoJSONFormat.toGeoJSON(path.route);
  37990. }
  37991. if (path.pathGuideItems) {
  37992. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  37993. }
  37994. if (path.edgeFeatures) {
  37995. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  37996. }
  37997. if (path.nodeFeatures) {
  37998. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  37999. }
  38000. return path;
  38001. });
  38002. return result;
  38003. }
  38004. }]);
  38005. return FindMTSPPathsService;
  38006. }(NetworkAnalystServiceBase);
  38007. ;// CONCATENATED MODULE: ./src/common/iServer/FindPathParameters.js
  38008. function FindPathParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38009. function FindPathParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  38010. function FindPathParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindPathParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindPathParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  38011. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  38012. * This program are made available under the terms of the Apache License, Version 2.0
  38013. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38014. /**
  38015. * @class FindPathParameters
  38016. * @deprecatedclass SuperMap.FindPathParameters
  38017. * @category iServer NetworkAnalyst Path
  38018. * @classdesc 最佳路径分析参数类。最佳路径是在网络数据集中指定一些结点,按照顺序访问结点从而求解起止点之间阻抗最小的路径。
  38019. * 例如如果要顺序访问 1、2、3、4 四个结点,则需要分别找到1、2结点间的最佳路径 R1—2,2、3 间的最佳路径 R2—3 和 3、4 结点间的最佳路径 R3—4,
  38020. * 顺序访问 1、2、3、4 四个结点的最佳路径就是 R = R1—2 + R2—3 + R3—4。
  38021. * 阻抗就是指从一点到另一点的耗费,在实际应用中我们可以将距离、时间、花费等作为阻抗条件。
  38022. * 阻抗最小也就可以理解为从一点到另一点距离最短、时间最少、花费最低等。当两点间距离最短时为最短路径,它是最佳路径问题的一个特例。
  38023. * 阻抗值通过 {@link TransportationAnalystParameter#weightFieldName}设置。
  38024. * 计算最佳路径除了受阻抗影响外,还受转向字段的影响。转向值通过 {@link TransportationAnalystParameter#turnWeightField} 设置。
  38025. *
  38026. * @param {Object} options - 参数。
  38027. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} options.nodes - 最佳路径分析经过的结点或设施点数组。该字段至少包含两个点。
  38028. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 指定路径分析的结点。
  38029. * @param {boolean} [options.hasLeastEdgeCount=false] - 是否按照弧段数最少的进行最佳路径分析。
  38030. * @param {TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  38031. * @usage
  38032. */
  38033. var FindPathParameters = /*#__PURE__*/function () {
  38034. function FindPathParameters(options) {
  38035. FindPathParameters_classCallCheck(this, FindPathParameters);
  38036. /**
  38037. * @member {boolean} [FindPathParameters.prototype.isAnalyzeById=false]
  38038. * @description 是否通过节点 ID 指定路径分析的结点。
  38039. * 指定路径分析经过的结点或设施点有两种方式:输入结点 ID 号或直接输入点坐标。
  38040. * 当该字段为 true 时,表示通过结点 ID 指定途经点,即 FindPathParameters.nodes = [ID1,ID2,...];
  38041. * 反之表示通过结点坐标指定途经点,即 FindPathParameters.nodes = [{x1,y1},{x2,y2},...] 。
  38042. */
  38043. this.isAnalyzeById = false;
  38044. /**
  38045. * @member {boolean} [FindPathParameters.prototype.hasLeastEdgeCount=false]
  38046. * @description 是否按照弧段数最少的进行最佳路径分析。
  38047. * true 表示按照弧段数最少进行分析,返回弧段数最少的路径中一个阻抗最小的最佳路径;
  38048. * false 表示直接返回阻抗最小的路径,而不考虑弧段的多少。
  38049. */
  38050. this.hasLeastEdgeCount = null;
  38051. /**
  38052. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} FindPathParameters.prototype.nodes
  38053. * @description 最佳路径分析经过的结点或设施点数组,必设字段。该字段至少包含两个点。
  38054. * 当 FindPathParameters.isAnalyzeById = false 时,nodes 应为点的坐标数组;
  38055. * 当 FindPathParameters.isAnalyzeById = true 时,nodes 应为点的 ID 数组。
  38056. */
  38057. this.nodes = null;
  38058. /**
  38059. * @member {TransportationAnalystParameter} FindPathParameters.prototype.parameter
  38060. * @description 交通网络分析通用参数。
  38061. */
  38062. this.parameter = new TransportationAnalystParameter();
  38063. Util_Util.extend(this, options);
  38064. this.CLASS_NAME = "SuperMap.FindPathParameters";
  38065. }
  38066. /**
  38067. * @function FindPathParameters.prototype.destroy
  38068. * @description 释放资源,将引用资源的属性置空。
  38069. */
  38070. FindPathParameters_createClass(FindPathParameters, [{
  38071. key: "destroy",
  38072. value: function destroy() {
  38073. var me = this;
  38074. me.isAnalyzeById = null;
  38075. me.hasLeastEdgeCount = null;
  38076. me.nodes = null;
  38077. if (me.parameter) {
  38078. me.parameter.destroy();
  38079. me.parameter = null;
  38080. }
  38081. }
  38082. }]);
  38083. return FindPathParameters;
  38084. }();
  38085. ;// CONCATENATED MODULE: ./src/common/iServer/FindPathService.js
  38086. function FindPathService_typeof(obj) { "@babel/helpers - typeof"; return FindPathService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FindPathService_typeof(obj); }
  38087. function FindPathService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38088. function FindPathService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  38089. function FindPathService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindPathService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindPathService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  38090. function FindPathService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FindPathService_get = Reflect.get.bind(); } else { FindPathService_get = function _get(target, property, receiver) { var base = FindPathService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FindPathService_get.apply(this, arguments); }
  38091. function FindPathService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindPathService_getPrototypeOf(object); if (object === null) break; } return object; }
  38092. function FindPathService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FindPathService_setPrototypeOf(subClass, superClass); }
  38093. function FindPathService_setPrototypeOf(o, p) { FindPathService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindPathService_setPrototypeOf(o, p); }
  38094. function FindPathService_createSuper(Derived) { var hasNativeReflectConstruct = FindPathService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FindPathService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FindPathService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FindPathService_possibleConstructorReturn(this, result); }; }
  38095. function FindPathService_possibleConstructorReturn(self, call) { if (call && (FindPathService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FindPathService_assertThisInitialized(self); }
  38096. function FindPathService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  38097. function FindPathService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  38098. function FindPathService_getPrototypeOf(o) { FindPathService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindPathService_getPrototypeOf(o); }
  38099. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  38100. * This program are made available under the terms of the Apache License, Version 2.0
  38101. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38102. /**
  38103. * @class FindPathService
  38104. * @deprecatedclass SuperMap.FindPathService
  38105. * @category iServer NetworkAnalyst Path
  38106. * @classdesc 最佳路径分析服务类。
  38107. * 最佳路径是在网络数据集中指定一些节点,按照节点的选择顺序,
  38108. * 顺序访问这些节点从而求解起止点之间阻抗最小的路经。
  38109. * 该类负责将客户端指定的最佳路径分析参数传递给服务端,并接收服务端返回的结果数据。
  38110. * 最佳路径分析结果通过该类支持的事件的监听函数参数获取
  38111. * @extends {NetworkAnalystServiceBase}
  38112. * @example
  38113. * var myFindPathService = new FindPathService(url, {
  38114. * eventListeners: {
  38115. * "processCompleted": findPathCompleted,
  38116. * "processFailed": findPathError
  38117. * }
  38118. * });
  38119. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  38120. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  38121. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  38122. * @param {Object} options - 参数。
  38123. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  38124. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  38125. * @param {Object} [options.headers] - 请求头。
  38126. * @usage
  38127. */
  38128. var FindPathService = /*#__PURE__*/function (_NetworkAnalystServic) {
  38129. FindPathService_inherits(FindPathService, _NetworkAnalystServic);
  38130. var _super = FindPathService_createSuper(FindPathService);
  38131. function FindPathService(url, options) {
  38132. var _this;
  38133. FindPathService_classCallCheck(this, FindPathService);
  38134. _this = _super.call(this, url, options);
  38135. _this.CLASS_NAME = "SuperMap.FindPathService";
  38136. return _this;
  38137. }
  38138. /**
  38139. * @function FindPathService.prototype.destroy
  38140. * @override
  38141. */
  38142. FindPathService_createClass(FindPathService, [{
  38143. key: "destroy",
  38144. value: function destroy() {
  38145. FindPathService_get(FindPathService_getPrototypeOf(FindPathService.prototype), "destroy", this).call(this);
  38146. }
  38147. /**
  38148. * @function FindPathService.prototype.processAsync
  38149. * @description 负责将客户端的查询参数传递到服务端。
  38150. * @param {FindPathParameters} params - 最佳路径分析服务参数类
  38151. */
  38152. }, {
  38153. key: "processAsync",
  38154. value: function processAsync(params) {
  38155. if (!(params instanceof FindPathParameters)) {
  38156. return;
  38157. }
  38158. var me = this,
  38159. jsonObject;
  38160. me.url = Util_Util.urlPathAppend(me.url, 'path');
  38161. jsonObject = {
  38162. hasLeastEdgeCount: params.hasLeastEdgeCount,
  38163. parameter: Util_Util.toJSON(params.parameter),
  38164. nodes: me.getJson(params.isAnalyzeById, params.nodes)
  38165. };
  38166. me.request({
  38167. method: "GET",
  38168. params: jsonObject,
  38169. scope: me,
  38170. success: me.serviceProcessCompleted,
  38171. failure: me.serviceProcessFailed
  38172. });
  38173. }
  38174. /**
  38175. * @function FindPathService.prototype.getJson
  38176. * @description 将对象转化为JSON字符串。
  38177. * @param {boolean} isAnalyzeById - 是否通过id分析
  38178. * @param {Array} params - 需要转换的数字
  38179. * @returns {Object} 转化后的JSON字符串。
  38180. */
  38181. }, {
  38182. key: "getJson",
  38183. value: function getJson(isAnalyzeById, params) {
  38184. var jsonString = "[",
  38185. len = params ? params.length : 0;
  38186. if (isAnalyzeById === false) {
  38187. for (var i = 0; i < len; i++) {
  38188. if (i > 0) {
  38189. jsonString += ",";
  38190. }
  38191. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  38192. }
  38193. } else if (isAnalyzeById === true) {
  38194. for (var _i2 = 0; _i2 < len; _i2++) {
  38195. if (_i2 > 0) {
  38196. jsonString += ",";
  38197. }
  38198. jsonString += params[_i2];
  38199. }
  38200. }
  38201. jsonString += ']';
  38202. return jsonString;
  38203. }
  38204. /**
  38205. * @function FindMTSPPathsService.prototype.toGeoJSONResult
  38206. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  38207. * @param {Object} result - 服务器返回的结果对象。
  38208. */
  38209. }, {
  38210. key: "toGeoJSONResult",
  38211. value: function toGeoJSONResult(result) {
  38212. if (!result || !result.pathList || result.pathList.length < 1) {
  38213. return null;
  38214. }
  38215. var geoJSONFormat = new GeoJSON();
  38216. result.pathList.forEach(function (path) {
  38217. if (path.route) {
  38218. path.route = geoJSONFormat.toGeoJSON(path.route);
  38219. }
  38220. if (path.pathGuideItems) {
  38221. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  38222. }
  38223. if (path.edgeFeatures) {
  38224. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  38225. }
  38226. if (path.nodeFeatures) {
  38227. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  38228. }
  38229. });
  38230. return result;
  38231. }
  38232. }]);
  38233. return FindPathService;
  38234. }(NetworkAnalystServiceBase);
  38235. ;// CONCATENATED MODULE: ./src/common/iServer/FindServiceAreasParameters.js
  38236. function FindServiceAreasParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38237. function FindServiceAreasParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  38238. function FindServiceAreasParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindServiceAreasParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindServiceAreasParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  38239. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  38240. * This program are made available under the terms of the Apache License, Version 2.0
  38241. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38242. /**
  38243. * @class FindServiceAreasParameters
  38244. * @deprecatedclass SuperMap.FindServiceAreasParameters
  38245. * @category iServer NetworkAnalyst ServiceArea
  38246. * @classdesc 服务区分析参数类。
  38247. * 服务区分析是以指定服务站点为中心,在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
  38248. * 例如:计算某快餐店能够在30分钟内送达快餐的区域。
  38249. * @param {Object} options - 参数。
  38250. * @param {Array.<number>} options.weights - 每个服务站点提供服务的阻力半径,超过这个阻力半径的区域不予考虑,其单位与阻力字段一致。
  38251. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} options.centers - 服务站点数组。
  38252. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 指定路径分析的结点。
  38253. * @param {boolean} [options.isCenterMutuallyExclusive=false] - 是否中心点互斥。
  38254. * @param {boolean} [options.isFromCenter=false] - 是否从中心点开始分析。
  38255. * @param {TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  38256. * @usage
  38257. */
  38258. var FindServiceAreasParameters = /*#__PURE__*/function () {
  38259. function FindServiceAreasParameters(options) {
  38260. FindServiceAreasParameters_classCallCheck(this, FindServiceAreasParameters);
  38261. /**
  38262. * @member {boolean} [FindServiceAreasParameters.prototype.isAnalyzeById=false]
  38263. * @description 是否通过节点 ID 指定路径分析的结点。
  38264. * 指定路径分析经过的结点或设施点有两种方式:输入结点 ID 号或直接输入点坐标。
  38265. * 当该字段为 true 时,表示通过结点 ID 指定途经点,即 FindServiceAreasParameters.centers = [ID1,ID2,...];
  38266. * 反之表示通过结点坐标指定途经点,即 FindServiceAreasParameters.centers = [{x1,y1},{x2,y2},...]。
  38267. */
  38268. this.isAnalyzeById = false;
  38269. /**
  38270. * @member {boolean} [FindServiceAreasParameters.prototype.isCenterMutuallyExclusive=false]
  38271. * @description 是否中心点互斥,即按照中心点的距离进行判断是否要进行互斥处理。
  38272. * 若分析出的服务区有重叠的部分,则通过设置该参数进行互斥处理。
  38273. */
  38274. this.isCenterMutuallyExclusive = false;
  38275. /**
  38276. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} FindServiceAreasParameters.prototype.centers
  38277. * @description 服务站点数组。
  38278. * 当该类的 iSAnalyzeById = true 时,通过结点 ID 号指定服务站点;当 iSAnalyzeById = false 时,通过点坐标指定服务站点。
  38279. */
  38280. this.centers = null;
  38281. /**
  38282. * @member {boolean} [FindServiceAreasParameters.prototype.isFromCenter=false]
  38283. * @description 是否从中心点开始分析。
  38284. * 从中心点开始分析和不从中心点开始分析,体现了服务中心和需要该服务的需求地的关系模式。
  38285. * 从中心点开始分析,是一个服务中心向服务需求地提供服务;
  38286. * 而不从中心点开始分析,是一个服务需求地主动到服务中心获得服务。
  38287. */
  38288. this.isFromCenter = false;
  38289. /**
  38290. * APIProperty: weights
  38291. * @member {Array.<number>} FindServiceAreasParameters.prototype.weights
  38292. * @description 每个服务站点提供服务的阻力半径,即超过这个阻力半径的区域不予考虑,其单位与阻力字段一致。
  38293. * 该字段为一个数组,数组长度跟服务中心个数一致,按照索引顺序与站点一一对应,每个元素表示了在对每个服务中心进行服务区分析时,所用的服务半径。
  38294. */
  38295. this.weights = null;
  38296. /**
  38297. * @member {TransportationAnalystParameter} FindServiceAreasParameters.prototype.parameter
  38298. * @description 交通网络分析通用参数。
  38299. */
  38300. this.parameter = new TransportationAnalystParameter();
  38301. Util_Util.extend(this, options);
  38302. this.CLASS_NAME = "SuperMap.FindServiceAreasParameters";
  38303. }
  38304. /**
  38305. * @function FindServiceAreasParameters.prototype.destroy
  38306. * @description 释放资源,将引用资源的属性置空。
  38307. */
  38308. FindServiceAreasParameters_createClass(FindServiceAreasParameters, [{
  38309. key: "destroy",
  38310. value: function destroy() {
  38311. var me = this;
  38312. me.isAnalyzeById = null;
  38313. me.isCenterMutuallyExclusive = null;
  38314. me.centers = null;
  38315. me.isFromCenter = null;
  38316. me.weights = null;
  38317. if (me.parameter) {
  38318. me.parameter.destroy();
  38319. me.parameter = null;
  38320. }
  38321. }
  38322. }]);
  38323. return FindServiceAreasParameters;
  38324. }();
  38325. ;// CONCATENATED MODULE: ./src/common/iServer/FindServiceAreasService.js
  38326. function FindServiceAreasService_typeof(obj) { "@babel/helpers - typeof"; return FindServiceAreasService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FindServiceAreasService_typeof(obj); }
  38327. function FindServiceAreasService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38328. function FindServiceAreasService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  38329. function FindServiceAreasService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindServiceAreasService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindServiceAreasService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  38330. function FindServiceAreasService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FindServiceAreasService_get = Reflect.get.bind(); } else { FindServiceAreasService_get = function _get(target, property, receiver) { var base = FindServiceAreasService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FindServiceAreasService_get.apply(this, arguments); }
  38331. function FindServiceAreasService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindServiceAreasService_getPrototypeOf(object); if (object === null) break; } return object; }
  38332. function FindServiceAreasService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FindServiceAreasService_setPrototypeOf(subClass, superClass); }
  38333. function FindServiceAreasService_setPrototypeOf(o, p) { FindServiceAreasService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindServiceAreasService_setPrototypeOf(o, p); }
  38334. function FindServiceAreasService_createSuper(Derived) { var hasNativeReflectConstruct = FindServiceAreasService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FindServiceAreasService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FindServiceAreasService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FindServiceAreasService_possibleConstructorReturn(this, result); }; }
  38335. function FindServiceAreasService_possibleConstructorReturn(self, call) { if (call && (FindServiceAreasService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FindServiceAreasService_assertThisInitialized(self); }
  38336. function FindServiceAreasService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  38337. function FindServiceAreasService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  38338. function FindServiceAreasService_getPrototypeOf(o) { FindServiceAreasService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindServiceAreasService_getPrototypeOf(o); }
  38339. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  38340. * This program are made available under the terms of the Apache License, Version 2.0
  38341. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38342. /**
  38343. * @class FindServiceAreasService
  38344. * @deprecatedclass SuperMap.FindServiceAreasService
  38345. * @category iServer NetworkAnalyst ServiceArea
  38346. * @classdesc 服务区分析服务类。
  38347. * 服务区分析是以指定服务站点为中心,
  38348. * 在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
  38349. * 该类负责将客户端指定的服务区分析参数传递给服务端,并接收服务端返回的结果数据。
  38350. * 服务区分析结果通过该类支持的事件的监听函数参数获取
  38351. * @extends {NetworkAnalystServiceBase}
  38352. * @example
  38353. * var myFindServiceAreasService = new FindServiceAreasService(url, {
  38354. * eventListeners: {
  38355. * "processCompleted": findServiceAreasCompleted,
  38356. * "processFailed": findServiceAreasError
  38357. * }
  38358. * });
  38359. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  38360. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  38361. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  38362. * @param {Object} options - 互服务时所需可选参数。如:
  38363. * @param {Object} options.eventListeners - 需要被注册的监听器对象
  38364. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  38365. * @param {Object} [options.headers] - 请求头。
  38366. * @usage
  38367. */
  38368. var FindServiceAreasService = /*#__PURE__*/function (_NetworkAnalystServic) {
  38369. FindServiceAreasService_inherits(FindServiceAreasService, _NetworkAnalystServic);
  38370. var _super = FindServiceAreasService_createSuper(FindServiceAreasService);
  38371. function FindServiceAreasService(url, options) {
  38372. var _this;
  38373. FindServiceAreasService_classCallCheck(this, FindServiceAreasService);
  38374. _this = _super.call(this, url, options);
  38375. _this.CLASS_NAME = "SuperMap.FindServiceAreasService";
  38376. return _this;
  38377. }
  38378. /**
  38379. * @function FindServiceAreasService.prototype.destroy
  38380. * @override
  38381. */
  38382. FindServiceAreasService_createClass(FindServiceAreasService, [{
  38383. key: "destroy",
  38384. value: function destroy() {
  38385. FindServiceAreasService_get(FindServiceAreasService_getPrototypeOf(FindServiceAreasService.prototype), "destroy", this).call(this);
  38386. }
  38387. /**
  38388. * @function FindServiceAreasService.prototype.processAsync
  38389. * @description 负责将客户端的查询参数传递到服务端。
  38390. * @param {FindServiceAreasParameters} params - 服务区分析服务参数类
  38391. */
  38392. }, {
  38393. key: "processAsync",
  38394. value: function processAsync(params) {
  38395. if (!(params instanceof FindServiceAreasParameters)) {
  38396. return;
  38397. }
  38398. var me = this,
  38399. jsonObject;
  38400. me.url = Util_Util.urlPathAppend(me.url, 'servicearea');
  38401. jsonObject = {
  38402. isFromCenter: params.isFromCenter,
  38403. isCenterMutuallyExclusive: params.isCenterMutuallyExclusive,
  38404. parameter: Util_Util.toJSON(params.parameter),
  38405. centers: me.getJson(params.isAnalyzeById, params.centers),
  38406. weights: me.getJson(true, params.weights)
  38407. };
  38408. me.request({
  38409. method: "GET",
  38410. params: jsonObject,
  38411. scope: me,
  38412. success: me.serviceProcessCompleted,
  38413. failure: me.serviceProcessFailed
  38414. });
  38415. }
  38416. /**
  38417. * @function FindServiceAreasService.prototype.getJson
  38418. * @description 将对象转化为JSON字符串。
  38419. * @param {boolean} isAnalyzeById - 是否通过id分析
  38420. * @param {Array} params - 需要转换的数字
  38421. * @returns {Object} 转化后的JSON字符串。
  38422. */
  38423. }, {
  38424. key: "getJson",
  38425. value: function getJson(isAnalyzeById, params) {
  38426. var jsonString = "[",
  38427. len = params ? params.length : 0;
  38428. if (isAnalyzeById === false) {
  38429. for (var i = 0; i < len; i++) {
  38430. if (i > 0) {
  38431. jsonString += ",";
  38432. }
  38433. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  38434. }
  38435. } else if (isAnalyzeById === true) {
  38436. for (var _i2 = 0; _i2 < len; _i2++) {
  38437. if (_i2 > 0) {
  38438. jsonString += ",";
  38439. }
  38440. jsonString += params[_i2];
  38441. }
  38442. }
  38443. jsonString += ']';
  38444. return jsonString;
  38445. }
  38446. /**
  38447. * @function FindServiceAreasService.prototype.toGeoJSONResult
  38448. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  38449. * @param {Object} result - 服务器返回的结果对象。
  38450. */
  38451. }, {
  38452. key: "toGeoJSONResult",
  38453. value: function toGeoJSONResult(result) {
  38454. if (!result || !result.serviceAreaList) {
  38455. return result;
  38456. }
  38457. var geoJSONFormat = new GeoJSON();
  38458. result.serviceAreaList.map(function (serviceArea) {
  38459. if (serviceArea.serviceRegion) {
  38460. serviceArea.serviceRegion = geoJSONFormat.toGeoJSON(serviceArea.serviceRegion);
  38461. }
  38462. if (serviceArea.edgeFeatures) {
  38463. serviceArea.edgeFeatures = geoJSONFormat.toGeoJSON(serviceArea.edgeFeatures);
  38464. }
  38465. if (serviceArea.nodeFeatures) {
  38466. serviceArea.nodeFeatures = geoJSONFormat.toGeoJSON(serviceArea.nodeFeatures);
  38467. }
  38468. if (serviceArea.routes) {
  38469. serviceArea.routes = geoJSONFormat.toGeoJSON(serviceArea.routes);
  38470. }
  38471. return serviceArea;
  38472. });
  38473. return result;
  38474. }
  38475. }]);
  38476. return FindServiceAreasService;
  38477. }(NetworkAnalystServiceBase);
  38478. ;// CONCATENATED MODULE: ./src/common/iServer/FindTSPPathsParameters.js
  38479. function FindTSPPathsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38480. function FindTSPPathsParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  38481. function FindTSPPathsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindTSPPathsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindTSPPathsParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  38482. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  38483. * This program are made available under the terms of the Apache License, Version 2.0
  38484. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38485. /**
  38486. * @class FindTSPPathsParameters
  38487. * @deprecatedclass SuperMap.FindTSPPathsParameters
  38488. * @category iServer NetworkAnalyst TSPPath
  38489. * @classdesc 旅行商分析参数类。
  38490. * 旅行商分析是路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
  38491. * 旅行商分析也可以指定到达的终点,这时查找从起点能够遍历所有途经点最后到达终点,且花费最小的路径。
  38492. * 旅行商分析和最佳路径分析都是在网络中寻找遍历所有站点的最经济的路径,区别是在遍历网络所有站点的过程中对结点访问顺序不同。
  38493. * 最佳路径分析必须按照指定顺序对站点进行访问,而旅行商分析是无序的路径分析。
  38494. * @param {Object} options - 参数。
  38495. * @param {boolean} [options.endNodeAssigned=false] - 是否指定终止点,将指定的途经点的最后一个点作为终止点。true 表示指定终止点,则旅行商必须最后一个访问终止点。
  38496. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 号来指定配送中心点和配送目的点。
  38497. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} options.nodes - 配送目标集合。
  38498. * @param {TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  38499. * @usage
  38500. */
  38501. var FindTSPPathsParameters = /*#__PURE__*/function () {
  38502. function FindTSPPathsParameters(options) {
  38503. FindTSPPathsParameters_classCallCheck(this, FindTSPPathsParameters);
  38504. /**
  38505. * @member {boolean} [FindTSPPathsParameters.prototype.endNodeAssigned=false]
  38506. * @description 是否指定终止点,将指定的途经点的最后一个点作为终止点。
  38507. * true 表示指定终止点,则旅行商必须最后一个访问终止点。
  38508. */
  38509. this.endNodeAssigned = false;
  38510. /**
  38511. * @member {boolean} [FindTSPPathsParameters.prototype.isAnalyzeById=false]
  38512. * @description 是否通过节点 ID 号来指定途经点。
  38513. */
  38514. this.isAnalyzeById = false;
  38515. /**
  38516. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} FindTSPPathsParameters.prototype.nodes
  38517. * @description 旅行商分析途经点数组。
  38518. * 当 FindTSPPathsParameters.isAnalyzeById = false 时,nodes 应为点的坐标数组;
  38519. * 当 FindTSPPathsParameters.isAnalyzeById = true 时,nodes 应为点的 ID 数组。
  38520. */
  38521. this.nodes = null;
  38522. /**
  38523. * @member {TransportationAnalystParameter} [FindTSPPathsParameters.prototype.parameter]
  38524. * @description 交通网络分析通用参数。通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息。
  38525. * TransportationAnalystParameter 类型,它虽然为可选参数,但是如果不设置其中的 resultSetting
  38526. * 字段,则返回结果空间信息等都为空。
  38527. */
  38528. this.parameter = new TransportationAnalystParameter();
  38529. Util_Util.extend(this, options);
  38530. this.CLASS_NAME = "SuperMap.FindTSPPathsParameters";
  38531. }
  38532. /**
  38533. * @function FindTSPPathsParameters.prototype.destroy
  38534. * @description 释放资源,将引用资源的属性置空。
  38535. */
  38536. FindTSPPathsParameters_createClass(FindTSPPathsParameters, [{
  38537. key: "destroy",
  38538. value: function destroy() {
  38539. var me = this;
  38540. me.endNodeAssigned = null;
  38541. me.isAnalyzeById = null;
  38542. me.nodes = null;
  38543. if (me.parameter) {
  38544. me.parameter.destroy();
  38545. me.parameter = null;
  38546. }
  38547. }
  38548. }]);
  38549. return FindTSPPathsParameters;
  38550. }();
  38551. ;// CONCATENATED MODULE: ./src/common/iServer/FindTSPPathsService.js
  38552. function FindTSPPathsService_typeof(obj) { "@babel/helpers - typeof"; return FindTSPPathsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FindTSPPathsService_typeof(obj); }
  38553. function FindTSPPathsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38554. function FindTSPPathsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  38555. function FindTSPPathsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindTSPPathsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindTSPPathsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  38556. function FindTSPPathsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { FindTSPPathsService_get = Reflect.get.bind(); } else { FindTSPPathsService_get = function _get(target, property, receiver) { var base = FindTSPPathsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return FindTSPPathsService_get.apply(this, arguments); }
  38557. function FindTSPPathsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindTSPPathsService_getPrototypeOf(object); if (object === null) break; } return object; }
  38558. function FindTSPPathsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FindTSPPathsService_setPrototypeOf(subClass, superClass); }
  38559. function FindTSPPathsService_setPrototypeOf(o, p) { FindTSPPathsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindTSPPathsService_setPrototypeOf(o, p); }
  38560. function FindTSPPathsService_createSuper(Derived) { var hasNativeReflectConstruct = FindTSPPathsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FindTSPPathsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FindTSPPathsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FindTSPPathsService_possibleConstructorReturn(this, result); }; }
  38561. function FindTSPPathsService_possibleConstructorReturn(self, call) { if (call && (FindTSPPathsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FindTSPPathsService_assertThisInitialized(self); }
  38562. function FindTSPPathsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  38563. function FindTSPPathsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  38564. function FindTSPPathsService_getPrototypeOf(o) { FindTSPPathsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindTSPPathsService_getPrototypeOf(o); }
  38565. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  38566. * This program are made available under the terms of the Apache License, Version 2.0
  38567. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38568. /**
  38569. * @class FindTSPPathsService
  38570. * @deprecatedclass SuperMap.FindTSPPathsService
  38571. * @category iServer NetworkAnalyst TSPPath
  38572. * @classdesc 旅行商分析服务类
  38573. * 旅行商分析是路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
  38574. * 旅行商分析也可以指定到达的终点,这时查找从起点能够遍历所有途经点最后到达终点,且花费最小的路径。
  38575. * 该类负责将客户端指定的旅行商分析参数传递给服务端,并接收服务端返回的结果数据。
  38576. * 旅行商分析结果通过该类支持的事件的监听函数参数获取
  38577. * @extends {NetworkAnalystServiceBase}
  38578. * @example
  38579. * (start code)
  38580. * var myFindTSPPathsService = new FindTSPPathsService(url, {
  38581. * eventListeners: {
  38582. * "processCompleted": findTSPPathsCompleted,
  38583. * "processFailed": findTSPPathsError
  38584. * }
  38585. * });
  38586. * (end)
  38587. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  38588. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  38589. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  38590. * @param {Object} options - 参数。
  38591. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  38592. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  38593. * @param {Object} [options.headers] - 请求头。
  38594. * @usage
  38595. */
  38596. var FindTSPPathsService = /*#__PURE__*/function (_NetworkAnalystServic) {
  38597. FindTSPPathsService_inherits(FindTSPPathsService, _NetworkAnalystServic);
  38598. var _super = FindTSPPathsService_createSuper(FindTSPPathsService);
  38599. function FindTSPPathsService(url, options) {
  38600. var _this;
  38601. FindTSPPathsService_classCallCheck(this, FindTSPPathsService);
  38602. _this = _super.call(this, url, options);
  38603. _this.CLASS_NAME = "SuperMap.FindTSPPathsService";
  38604. return _this;
  38605. }
  38606. /**
  38607. * @function FindTSPPathsService.prototype.destroy
  38608. * @override
  38609. */
  38610. FindTSPPathsService_createClass(FindTSPPathsService, [{
  38611. key: "destroy",
  38612. value: function destroy() {
  38613. FindTSPPathsService_get(FindTSPPathsService_getPrototypeOf(FindTSPPathsService.prototype), "destroy", this).call(this);
  38614. }
  38615. /**
  38616. * @function FindTSPPathsService.prototype.processAsync
  38617. * @description 负责将客户端的查询参数传递到服务端。
  38618. * @param {FindTSPPathsParameters} params - 旅行商分析服务参数类。
  38619. */
  38620. }, {
  38621. key: "processAsync",
  38622. value: function processAsync(params) {
  38623. if (!(params instanceof FindTSPPathsParameters)) {
  38624. return;
  38625. }
  38626. var me = this,
  38627. jsonObject;
  38628. me.url = Util_Util.urlPathAppend(me.url, 'tsppath');
  38629. jsonObject = {
  38630. parameter: Util_Util.toJSON(params.parameter),
  38631. endNodeAssigned: params.endNodeAssigned,
  38632. nodes: me.getNodesJson(params)
  38633. };
  38634. me.request({
  38635. method: "GET",
  38636. params: jsonObject,
  38637. scope: me,
  38638. success: me.serviceProcessCompleted,
  38639. failure: me.serviceProcessFailed
  38640. });
  38641. }
  38642. /**
  38643. * @function FindTSPPathsService.prototype.getNodesJson
  38644. * @description 将节点对象转化为JSON字符串。
  38645. * @param {FindTSPPathsParameters} params - 旅行商分析服务参数类。
  38646. * @returns {string} 转化后的JSON字符串。
  38647. */
  38648. }, {
  38649. key: "getNodesJson",
  38650. value: function getNodesJson(params) {
  38651. var jsonParameters = "",
  38652. nodesString,
  38653. i,
  38654. len,
  38655. nodes;
  38656. if (params.isAnalyzeById === false) {
  38657. for (nodesString = "[", i = 0, nodes = params.nodes, len = nodes.length; i < len; i++) {
  38658. if (i > 0) {
  38659. nodesString += ",";
  38660. }
  38661. nodesString += '{"x":' + nodes[i].x + ',"y":' + nodes[i].y + '}';
  38662. }
  38663. nodesString += ']';
  38664. jsonParameters += nodesString;
  38665. } else if (params.isAnalyzeById === true) {
  38666. var nodeIDsString = "[",
  38667. _nodes = params.nodes,
  38668. _len = _nodes.length;
  38669. for (var _i2 = 0; _i2 < _len; _i2++) {
  38670. if (_i2 > 0) {
  38671. nodeIDsString += ",";
  38672. }
  38673. nodeIDsString += _nodes[_i2];
  38674. }
  38675. nodeIDsString += ']';
  38676. jsonParameters += nodeIDsString;
  38677. }
  38678. return jsonParameters;
  38679. }
  38680. /**
  38681. * @function FindTSPPathsService.prototype.toGeoJSONResult
  38682. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  38683. * @param {Object} result - 服务器返回的结果对象。
  38684. */
  38685. }, {
  38686. key: "toGeoJSONResult",
  38687. value: function toGeoJSONResult(result) {
  38688. if (!result || !result.tspPathList) {
  38689. return null;
  38690. }
  38691. var geoJSONFormat = new GeoJSON();
  38692. result.tspPathList.forEach(function (path) {
  38693. if (path.route) {
  38694. path.route = geoJSONFormat.toGeoJSON(path.route);
  38695. }
  38696. if (path.pathGuideItems) {
  38697. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  38698. }
  38699. if (path.edgeFeatures) {
  38700. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  38701. }
  38702. if (path.nodeFeatures) {
  38703. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  38704. }
  38705. });
  38706. return result;
  38707. }
  38708. }]);
  38709. return FindTSPPathsService;
  38710. }(NetworkAnalystServiceBase);
  38711. ;// CONCATENATED MODULE: ./src/common/iServer/GenerateSpatialDataParameters.js
  38712. function GenerateSpatialDataParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38713. function GenerateSpatialDataParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  38714. function GenerateSpatialDataParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GenerateSpatialDataParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GenerateSpatialDataParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  38715. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  38716. * This program are made available under the terms of the Apache License, Version 2.0
  38717. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38718. /**
  38719. * @class GenerateSpatialDataParameters
  38720. * @deprecatedclass SuperMap.GenerateSpatialDataParameters
  38721. * @category iServer SpatialAnalyst GenerateSpatialData
  38722. * @classdesc 动态分段操作参数类。通过该类可以为动态分段提供参数信息。
  38723. * @param {Object} options - 参数。
  38724. * @param {string} options.routeTable - 路由数据集。
  38725. * @param {string} options.routeIDField - 路由数据集的标识字段。
  38726. * @param {string} options.eventTable - 用于生成空间数据的事件表名。
  38727. * @param {DataReturnOption} options.dataReturnOption - 设置数据返回选项。
  38728. * @param {string} [options.attributeFilter] - 属性过滤条件。
  38729. * @param {string} options.eventRouteIDField - 用于生成空间数据的事件表的路由标识字段。
  38730. * @param {string} [options.measureField] - 用于生成空间数据的事件表的刻度字段,只有当事件为点事件的时候该属性才有意义。
  38731. * @param {string} [options.measureStartField] - 用于生成空间数据的事件表的起始刻度字段,只有当事件为线事件的时候该属性才有意义。
  38732. * @param {string} [options.measureEndField] - 用于生成空间数据的事件表的终止刻度字段,只有当事件为线事件的时候该属性才有意义。
  38733. * @param {string} [options.measureOffsetField] - 刻度偏移量字段。
  38734. * @param {string} [options.errorInfoField] - 错误信息字段,直接写入原事件表,用于描述事件未能生成对应的点或线时的错误信息。
  38735. * @param {Array.<string>} [options.retainedFields] - 欲保留到结果空间数据中的字段集合(系统字段除外)。
  38736. * @usage
  38737. */
  38738. var GenerateSpatialDataParameters = /*#__PURE__*/function () {
  38739. function GenerateSpatialDataParameters(options) {
  38740. GenerateSpatialDataParameters_classCallCheck(this, GenerateSpatialDataParameters);
  38741. /**
  38742. * @member {string} GenerateSpatialDataParameters.prototype.routeTable
  38743. * @description 路由数据集。
  38744. */
  38745. this.routeTable = null;
  38746. /**
  38747. * @member {string} GenerateSpatialDataParameters.prototype.routeIDField
  38748. * @description 路由数据集的标识字段。
  38749. */
  38750. this.routeIDField = null;
  38751. /**
  38752. * @member {string} [GenerateSpatialDataParameters.prototype.attributeFilter]
  38753. * @description 属性过滤条件。
  38754. * 当 {@link GenerateSpatialDataParameters.prototype.dataReturnOption.dataReturnMode} 为 {@link DataReturnMode.DATASET_AND_RECORDSET} 或 {@link DataReturnMode.RECORDSET_ONLY} 时有效。
  38755. */
  38756. this.attributeFilter = null;
  38757. /**
  38758. * @member {string} GenerateSpatialDataParameters.prototype.eventTable
  38759. * @description 用于生成空间数据的事件表名。
  38760. */
  38761. this.eventTable = null;
  38762. /**
  38763. * @member {string} GenerateSpatialDataParameters.prototype.eventRouteIDField
  38764. * @description 用于生成空间数据的事件表的路由标识字段。
  38765. */
  38766. this.eventRouteIDField = null;
  38767. /**
  38768. * @member {string} [GenerateSpatialDataParameters.prototype.measureField]
  38769. * @description 用于生成空间数据的事件表的刻度字段,只有当事件为点事件的时候该属性才有意义。
  38770. */
  38771. this.measureField = null;
  38772. /**
  38773. * @member {string} [GenerateSpatialDataParameters.prototype.measureStartField]
  38774. * @description 用于生成空间数据的事件表的起始刻度字段,只有当事件为线事件的时候该属性才有意义。
  38775. */
  38776. this.measureStartField = null;
  38777. /**
  38778. * @member {string} [GenerateSpatialDataParameters.prototype.measureEndField]
  38779. * @description 用于生成空间数据的事件表的终止刻度字段,只有当事件为线事件的时候该属性才有意义。
  38780. */
  38781. this.measureEndField = null;
  38782. /**
  38783. * @member {string} [GenerateSpatialDataParameters.prototype.measureOffsetField]
  38784. * @description 刻度偏移量字段。
  38785. */
  38786. this.measureOffsetField = null;
  38787. /**
  38788. * @member {string} [GenerateSpatialDataParameters.prototype.errorInfoField]
  38789. * @description 错误信息字段,直接写入原事件表,用于描述事件未能生成对应的点或线时的错误信息。
  38790. */
  38791. this.errorInfoField = null;
  38792. /**
  38793. * @member {Array.<string>} [GenerateSpatialDataParameters.prototype.retainedFields]
  38794. * @description 欲保留到结果空间数据中的字段集合(系统字段除外)。
  38795. * 生成空间数据时,无论是否指定保留字段,路由 ID 字段、刻度偏移量字段、刻度值字段(点事件为刻度字段,线事件是起始和终止刻度字段)都会保留到结果空间数据中;
  38796. * 如果没有指定 retainedFields 参数或者 retainedFields 参数数组长度为 0,则返回所有用户字段。
  38797. */
  38798. this.retainedFields = null;
  38799. /**
  38800. * @member {DataReturnOption} GenerateSpatialDataParameters.prototype.dataReturnOption
  38801. * @description 设置数据返回的选项。
  38802. */
  38803. this.dataReturnOption = null;
  38804. if (options) {
  38805. Util_Util.extend(this, options);
  38806. }
  38807. this.CLASS_NAME = "SuperMap.GenerateSpatialDataParameters";
  38808. }
  38809. /**
  38810. * @function GenerateSpatialDataParameters.prototype.destroy
  38811. * @description 释放资源,将引用资源的属性置空。
  38812. */
  38813. GenerateSpatialDataParameters_createClass(GenerateSpatialDataParameters, [{
  38814. key: "destroy",
  38815. value: function destroy() {
  38816. var me = this;
  38817. if (me.routeTable) {
  38818. me.routeTable = null;
  38819. }
  38820. me.routeIDField = null;
  38821. me.attributeFilter = null;
  38822. me.eventTable = null;
  38823. me.eventRouteIDField = null;
  38824. me.measureField = null;
  38825. me.measureStartField = null;
  38826. me.measureEndField = null;
  38827. me.measureOffsetField = null;
  38828. me.errorInfoField = null;
  38829. if (me.dataReturnOption) {
  38830. me.dataReturnOption.destroy();
  38831. me.dataReturnOption = null;
  38832. }
  38833. }
  38834. }]);
  38835. return GenerateSpatialDataParameters;
  38836. }();
  38837. ;// CONCATENATED MODULE: ./src/common/iServer/GenerateSpatialDataService.js
  38838. function GenerateSpatialDataService_typeof(obj) { "@babel/helpers - typeof"; return GenerateSpatialDataService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GenerateSpatialDataService_typeof(obj); }
  38839. function GenerateSpatialDataService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38840. function GenerateSpatialDataService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  38841. function GenerateSpatialDataService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GenerateSpatialDataService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GenerateSpatialDataService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  38842. function GenerateSpatialDataService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GenerateSpatialDataService_get = Reflect.get.bind(); } else { GenerateSpatialDataService_get = function _get(target, property, receiver) { var base = GenerateSpatialDataService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GenerateSpatialDataService_get.apply(this, arguments); }
  38843. function GenerateSpatialDataService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GenerateSpatialDataService_getPrototypeOf(object); if (object === null) break; } return object; }
  38844. function GenerateSpatialDataService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GenerateSpatialDataService_setPrototypeOf(subClass, superClass); }
  38845. function GenerateSpatialDataService_setPrototypeOf(o, p) { GenerateSpatialDataService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GenerateSpatialDataService_setPrototypeOf(o, p); }
  38846. function GenerateSpatialDataService_createSuper(Derived) { var hasNativeReflectConstruct = GenerateSpatialDataService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GenerateSpatialDataService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GenerateSpatialDataService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GenerateSpatialDataService_possibleConstructorReturn(this, result); }; }
  38847. function GenerateSpatialDataService_possibleConstructorReturn(self, call) { if (call && (GenerateSpatialDataService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GenerateSpatialDataService_assertThisInitialized(self); }
  38848. function GenerateSpatialDataService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  38849. function GenerateSpatialDataService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  38850. function GenerateSpatialDataService_getPrototypeOf(o) { GenerateSpatialDataService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GenerateSpatialDataService_getPrototypeOf(o); }
  38851. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  38852. * This program are made available under the terms of the Apache License, Version 2.0
  38853. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38854. /**
  38855. * @class GenerateSpatialDataService
  38856. * @deprecatedclass SuperMap.GenerateSpatialDataService
  38857. * @category iServer SpatialAnalyst GenerateSpatialData
  38858. * @classdesc 动态分段分析服务类。该类负责将客户设置的动态分段分析服务参数传递给服务端,并接收服务端返回的动态分段分析结果数据。
  38859. * 获取的结果数据包括 originResult 、result 两种,其中,originResult 为服务端返回的用 JSON 对象表示的动态分段分析结果数据,result 为服务端返回的动态分段分析结果数据。
  38860. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  38861. * @param {Object} options - 参数。</br>
  38862. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  38863. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  38864. * @param {Object} [options.headers] - 请求头。
  38865. * @extends {SpatialAnalystBase}
  38866. * @example 实例化该类如下例所示:
  38867. * (start code)
  38868. * function GenerateSpatialData(){
  38869. *
  38870. * //配置数据返回选项(option)
  38871. * var option = new DataReturnOption({
  38872. * expectCount: 1000,
  38873. * dataset: "generateSpatialData",
  38874. * deleteExistResultDataset: true,
  38875. * dataReturnMode: DataReturnMode.DATASET_ONLY
  38876. * }),
  38877. * //配置动态分段参数(Parameters)
  38878. * parameters = new GenerateSpatialDataParameters({
  38879. * routeTable: "RouteDT_road@Changchun",
  38880. * routeIDField: "RouteID",
  38881. * eventTable: "LinearEventTabDT@Changchun",
  38882. * eventRouteIDField: "RouteID",
  38883. * measureField: "",
  38884. * measureStartField: "LineMeasureFrom",
  38885. * measureEndField: "LineMeasureTo",
  38886. * measureOffsetField: "",
  38887. * errorInfoField: "",
  38888. * retainedFields:[],
  38889. * dataReturnOption: option
  38890. * }),
  38891. * //配置动态分段iService
  38892. * iService = new GenerateSpatialDataService(Changchun_spatialanalyst, {
  38893. * eventListeners: {
  38894. * processCompleted: generateCompleted,
  38895. * processFailed: generateFailded
  38896. * }
  38897. * });
  38898. * //执行
  38899. * iService.processAsync(parameters);
  38900. * function Completed(generateSpatialDataEventArgs){//todo};
  38901. * function Error(generateSpatialDataEventArgs){//todo};
  38902. * (end)
  38903. * @usage
  38904. */
  38905. var GenerateSpatialDataService = /*#__PURE__*/function (_SpatialAnalystBase) {
  38906. GenerateSpatialDataService_inherits(GenerateSpatialDataService, _SpatialAnalystBase);
  38907. var _super = GenerateSpatialDataService_createSuper(GenerateSpatialDataService);
  38908. function GenerateSpatialDataService(url, options) {
  38909. var _this;
  38910. GenerateSpatialDataService_classCallCheck(this, GenerateSpatialDataService);
  38911. _this = _super.call(this, url, options);
  38912. _this.CLASS_NAME = "SuperMap.GenerateSpatialDataService";
  38913. return _this;
  38914. }
  38915. /**
  38916. * @function GenerateSpatialDataService.prototype.destroy
  38917. * @override
  38918. */
  38919. GenerateSpatialDataService_createClass(GenerateSpatialDataService, [{
  38920. key: "destroy",
  38921. value: function destroy() {
  38922. GenerateSpatialDataService_get(GenerateSpatialDataService_getPrototypeOf(GenerateSpatialDataService.prototype), "destroy", this).call(this);
  38923. }
  38924. /**
  38925. * @function GenerateSpatialDataService.prototype.processAsync
  38926. * @description 负责将客户端的动态分段服务参数传递到服务端。
  38927. * @param {GenerateSpatialDataParameters} params - 动态分段操作参数类。
  38928. */
  38929. }, {
  38930. key: "processAsync",
  38931. value: function processAsync(params) {
  38932. if (!(params instanceof GenerateSpatialDataParameters)) {
  38933. return;
  38934. }
  38935. var me = this,
  38936. jsonParameters;
  38937. jsonParameters = me.getJsonParameters(params);
  38938. me.request({
  38939. method: "POST",
  38940. data: jsonParameters,
  38941. scope: me,
  38942. success: me.serviceProcessCompleted,
  38943. failure: me.serviceProcessFailed
  38944. });
  38945. }
  38946. /**
  38947. * @function GenerateSpatialDataService.prototype.getJsonParameters
  38948. * @description 将参数转化为 JSON 字符串。
  38949. * @param {GenerateSpatialDataParameters} params - 动态分段操作参数类。
  38950. * @returns {string}转化后的JSON字符串。
  38951. */
  38952. }, {
  38953. key: "getJsonParameters",
  38954. value: function getJsonParameters(params) {
  38955. var jsonParameters = "",
  38956. jsonStr = "datasets/" + params.routeTable + "/linearreferencing/generatespatialdata",
  38957. me = this;
  38958. me.url = Util_Util.urlPathAppend(me.url, jsonStr);
  38959. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  38960. jsonParameters = Util_Util.toJSON(params);
  38961. return jsonParameters;
  38962. }
  38963. }]);
  38964. return GenerateSpatialDataService;
  38965. }(SpatialAnalystBase);
  38966. ;// CONCATENATED MODULE: ./src/common/iServer/GeoHashGridAggParameter.js
  38967. function GeoHashGridAggParameter_typeof(obj) { "@babel/helpers - typeof"; return GeoHashGridAggParameter_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GeoHashGridAggParameter_typeof(obj); }
  38968. function GeoHashGridAggParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38969. function GeoHashGridAggParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  38970. function GeoHashGridAggParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoHashGridAggParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoHashGridAggParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  38971. function GeoHashGridAggParameter_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GeoHashGridAggParameter_get = Reflect.get.bind(); } else { GeoHashGridAggParameter_get = function _get(target, property, receiver) { var base = GeoHashGridAggParameter_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GeoHashGridAggParameter_get.apply(this, arguments); }
  38972. function GeoHashGridAggParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoHashGridAggParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  38973. function GeoHashGridAggParameter_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GeoHashGridAggParameter_setPrototypeOf(subClass, superClass); }
  38974. function GeoHashGridAggParameter_setPrototypeOf(o, p) { GeoHashGridAggParameter_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoHashGridAggParameter_setPrototypeOf(o, p); }
  38975. function GeoHashGridAggParameter_createSuper(Derived) { var hasNativeReflectConstruct = GeoHashGridAggParameter_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeoHashGridAggParameter_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeoHashGridAggParameter_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeoHashGridAggParameter_possibleConstructorReturn(this, result); }; }
  38976. function GeoHashGridAggParameter_possibleConstructorReturn(self, call) { if (call && (GeoHashGridAggParameter_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GeoHashGridAggParameter_assertThisInitialized(self); }
  38977. function GeoHashGridAggParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  38978. function GeoHashGridAggParameter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  38979. function GeoHashGridAggParameter_getPrototypeOf(o) { GeoHashGridAggParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoHashGridAggParameter_getPrototypeOf(o); }
  38980. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  38981. * This program are made available under the terms of the Apache License, Version 2.0
  38982. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38983. /**
  38984. * @class GeoHashGridAggParameter
  38985. * @deprecatedclass SuperMap.GeoHashGridAggParameter
  38986. * @classdesc 格网聚合查询参数类,该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  38987. * @category iServer Data FeatureResults
  38988. * @param {Object} options - 可选参数。
  38989. * @param {number} [options.precision=5] - 精度。
  38990. * @extends {BucketAggParameter}
  38991. * @usage
  38992. */
  38993. var GeoHashGridAggParameter = /*#__PURE__*/function (_BucketAggParameter) {
  38994. GeoHashGridAggParameter_inherits(GeoHashGridAggParameter, _BucketAggParameter);
  38995. var _super = GeoHashGridAggParameter_createSuper(GeoHashGridAggParameter);
  38996. function GeoHashGridAggParameter(options) {
  38997. var _this;
  38998. GeoHashGridAggParameter_classCallCheck(this, GeoHashGridAggParameter);
  38999. _this = _super.call(this);
  39000. /**
  39001. * @member {number} [GeoHashGridAggParameter.prototype.precision=5]
  39002. * @description 网格中数字的精度。
  39003. */
  39004. _this.precision = 5;
  39005. Util_Util.extend(GeoHashGridAggParameter_assertThisInitialized(_this), options);
  39006. /**
  39007. * @member {BucketAggType} [GeoHashGridAggParameter.prototype.aggType=BucketAggType.GEOHASH_GRID]
  39008. * @description 格网聚合类型。
  39009. */
  39010. _this.aggType = BucketAggType.GEOHASH_GRID;
  39011. _this.CLASS_NAME = 'SuperMap.GeoHashGridAggParameter';
  39012. return _this;
  39013. }
  39014. GeoHashGridAggParameter_createClass(GeoHashGridAggParameter, [{
  39015. key: "destroy",
  39016. value: function destroy() {
  39017. GeoHashGridAggParameter_get(GeoHashGridAggParameter_getPrototypeOf(GeoHashGridAggParameter.prototype), "destroy", this).call(this);
  39018. this.aggType = null;
  39019. this.precision = null;
  39020. }
  39021. /**
  39022. * @function GeoHashGridAggParameter.toJsonParameters
  39023. * @description 将对象转为 JSON 格式。
  39024. * @param param 转换对象。
  39025. * @returns {Object}
  39026. */
  39027. }], [{
  39028. key: "toJsonParameters",
  39029. value: function toJsonParameters(param) {
  39030. var parameters = {
  39031. aggName: param.aggName,
  39032. aggFieldName: param.aggFieldName,
  39033. aggType: param.aggType,
  39034. precision: param.precision
  39035. };
  39036. return Util_Util.toJson(parameters);
  39037. }
  39038. }]);
  39039. return GeoHashGridAggParameter;
  39040. }(BucketAggParameter);
  39041. ;// CONCATENATED MODULE: ./src/common/iServer/GeometryOverlayAnalystParameters.js
  39042. function GeometryOverlayAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return GeometryOverlayAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GeometryOverlayAnalystParameters_typeof(obj); }
  39043. function GeometryOverlayAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39044. function GeometryOverlayAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  39045. function GeometryOverlayAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryOverlayAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryOverlayAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  39046. function GeometryOverlayAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GeometryOverlayAnalystParameters_get = Reflect.get.bind(); } else { GeometryOverlayAnalystParameters_get = function _get(target, property, receiver) { var base = GeometryOverlayAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GeometryOverlayAnalystParameters_get.apply(this, arguments); }
  39047. function GeometryOverlayAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryOverlayAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  39048. function GeometryOverlayAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GeometryOverlayAnalystParameters_setPrototypeOf(subClass, superClass); }
  39049. function GeometryOverlayAnalystParameters_setPrototypeOf(o, p) { GeometryOverlayAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryOverlayAnalystParameters_setPrototypeOf(o, p); }
  39050. function GeometryOverlayAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = GeometryOverlayAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeometryOverlayAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeometryOverlayAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeometryOverlayAnalystParameters_possibleConstructorReturn(this, result); }; }
  39051. function GeometryOverlayAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometryOverlayAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GeometryOverlayAnalystParameters_assertThisInitialized(self); }
  39052. function GeometryOverlayAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39053. function GeometryOverlayAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  39054. function GeometryOverlayAnalystParameters_getPrototypeOf(o) { GeometryOverlayAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryOverlayAnalystParameters_getPrototypeOf(o); }
  39055. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39056. * This program are made available under the terms of the Apache License, Version 2.0
  39057. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39058. /**
  39059. * @class GeometryOverlayAnalystParameters
  39060. * @deprecatedclass SuperMap.GeometryOverlayAnalystParameters
  39061. * @category iServer SpatialAnalyst OverlayAnalyst
  39062. * @classdesc
  39063. * 几何对象叠加分析参数类。对指定的某两个几何对象做叠加分析。通过该类可以指定要做叠加分析的几何对象、叠加操作类型。
  39064. * @param {Object} options - 参数。
  39065. * @param {GeoJSONObject} options.operateGeometry - 叠加分析的操作几何对象。<br>
  39066. * 点类型可以是:{@link GeometryPoint}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}|{@link GeoJSONObject}。<br>
  39067. * 线类型可以是:{@link GeometryLineString}|{@link GeometryLinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link GeoJSONObject}。<br>
  39068. * 面类型可以是:{@link GeometryPolygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link GeoJSONObject}。<br>
  39069. * @param {GeoJSONObject} options.sourceGeometry - 叠加分析的源几何对象。
  39070. * @param {Array.<GeoJSONFeature>} [options.operateGeometries] - 批量叠加分析的操作几何对象数组。
  39071. * @param {Array.<GeoJSONFeature>} [options.sourceGeometries] -批量叠加分析的源几何对象数组。
  39072. * @param {OverlayOperationType} [options.operation] - 叠加操作枚举值。
  39073. * @extends {OverlayAnalystParameters}
  39074. * @usage
  39075. */
  39076. var GeometryOverlayAnalystParameters = /*#__PURE__*/function (_OverlayAnalystParame) {
  39077. GeometryOverlayAnalystParameters_inherits(GeometryOverlayAnalystParameters, _OverlayAnalystParame);
  39078. var _super = GeometryOverlayAnalystParameters_createSuper(GeometryOverlayAnalystParameters);
  39079. function GeometryOverlayAnalystParameters(options) {
  39080. var _this;
  39081. GeometryOverlayAnalystParameters_classCallCheck(this, GeometryOverlayAnalystParameters);
  39082. _this = _super.call(this, options);
  39083. if (options && options.operateGeometry) {
  39084. _this.operateGeometry = options.operateGeometry;
  39085. }
  39086. if (options && options.sourceGeometry) {
  39087. _this.sourceGeometry = options.sourceGeometry;
  39088. }
  39089. if (options && options.operateGeometries) {
  39090. _this.operateGeometries = options.operateGeometries;
  39091. }
  39092. if (options && options.sourceGeometries) {
  39093. _this.sourceGeometries = options.sourceGeometries;
  39094. }
  39095. if (options) {
  39096. Util_Util.extend(GeometryOverlayAnalystParameters_assertThisInitialized(_this), options);
  39097. }
  39098. _this.CLASS_NAME = "SuperMap.GeometryOverlayAnalystParameters";
  39099. return _this;
  39100. }
  39101. /**
  39102. * @function GeometryOverlayAnalystParameters.prototype.destroy
  39103. * @override
  39104. */
  39105. GeometryOverlayAnalystParameters_createClass(GeometryOverlayAnalystParameters, [{
  39106. key: "destroy",
  39107. value: function destroy() {
  39108. GeometryOverlayAnalystParameters_get(GeometryOverlayAnalystParameters_getPrototypeOf(GeometryOverlayAnalystParameters.prototype), "destroy", this).call(this);
  39109. var me = this;
  39110. if (me.sourceGeometry) {
  39111. me.sourceGeometry.destroy();
  39112. me.sourceGeometry = null;
  39113. }
  39114. if (me.sourceGeometries) {
  39115. me.sourceGeometries.destroy();
  39116. me.sourceGeometries = null;
  39117. }
  39118. if (me.sourceGeometry) {
  39119. me.sourceGeometry.destroy();
  39120. me.sourceGeometry = null;
  39121. }
  39122. if (me.operateGeometries) {
  39123. me.operateGeometries.destroy();
  39124. me.operateGeometries = null;
  39125. }
  39126. }
  39127. /**
  39128. * @function GeometryOverlayAnalystParameters.toObject
  39129. * @param {GeometryOverlayAnalystParameters} geometryOverlayAnalystParameters - 几何对象叠加分析参数类。
  39130. * @param {GeometryOverlayAnalystParameters} tempObj - 几何对象叠加分析参数对象。
  39131. * @description 将几何对象叠加分析参数对象转换为 JSON 对象。
  39132. * @returns {Object} JSON 对象。
  39133. */
  39134. }], [{
  39135. key: "toObject",
  39136. value: function toObject(geometryOverlayAnalystParameters, tempObj) {
  39137. for (var name in geometryOverlayAnalystParameters) {
  39138. if (name === "sourceGeometry") {
  39139. tempObj.sourceGeometry = ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.sourceGeometry);
  39140. } else if (name === "sourceGeometries") {
  39141. var sourceGeometries = [];
  39142. for (var i = 0; i < geometryOverlayAnalystParameters.sourceGeometries.length; i++) {
  39143. sourceGeometries.push(ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.sourceGeometries[i]));
  39144. }
  39145. tempObj.sourceGeometries = sourceGeometries;
  39146. } else if (name === "operateGeometry") {
  39147. tempObj.operateGeometry = ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.operateGeometry);
  39148. } else if (name === "operateGeometries") {
  39149. var operateGeometries = [];
  39150. for (var j = 0; j < geometryOverlayAnalystParameters.operateGeometries.length; j++) {
  39151. operateGeometries.push(ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.operateGeometries[j]));
  39152. }
  39153. tempObj.operateGeometries = operateGeometries;
  39154. } else {
  39155. tempObj[name] = geometryOverlayAnalystParameters[name];
  39156. }
  39157. }
  39158. }
  39159. }]);
  39160. return GeometryOverlayAnalystParameters;
  39161. }(OverlayAnalystParameters);
  39162. ;// CONCATENATED MODULE: ./src/common/iServer/GeometrySurfaceAnalystParameters.js
  39163. function GeometrySurfaceAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return GeometrySurfaceAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GeometrySurfaceAnalystParameters_typeof(obj); }
  39164. function GeometrySurfaceAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39165. function GeometrySurfaceAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  39166. function GeometrySurfaceAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometrySurfaceAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometrySurfaceAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  39167. function GeometrySurfaceAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GeometrySurfaceAnalystParameters_get = Reflect.get.bind(); } else { GeometrySurfaceAnalystParameters_get = function _get(target, property, receiver) { var base = GeometrySurfaceAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GeometrySurfaceAnalystParameters_get.apply(this, arguments); }
  39168. function GeometrySurfaceAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometrySurfaceAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  39169. function GeometrySurfaceAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GeometrySurfaceAnalystParameters_setPrototypeOf(subClass, superClass); }
  39170. function GeometrySurfaceAnalystParameters_setPrototypeOf(o, p) { GeometrySurfaceAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometrySurfaceAnalystParameters_setPrototypeOf(o, p); }
  39171. function GeometrySurfaceAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = GeometrySurfaceAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeometrySurfaceAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeometrySurfaceAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeometrySurfaceAnalystParameters_possibleConstructorReturn(this, result); }; }
  39172. function GeometrySurfaceAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometrySurfaceAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GeometrySurfaceAnalystParameters_assertThisInitialized(self); }
  39173. function GeometrySurfaceAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39174. function GeometrySurfaceAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  39175. function GeometrySurfaceAnalystParameters_getPrototypeOf(o) { GeometrySurfaceAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometrySurfaceAnalystParameters_getPrototypeOf(o); }
  39176. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39177. * This program are made available under the terms of the Apache License, Version 2.0
  39178. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39179. /**
  39180. * @class GeometrySurfaceAnalystParameters
  39181. * @deprecatedclass SuperMap.GeometrySurfaceAnalystParameters
  39182. * @category iServer SpatialAnalyst SurfaceAnalyst
  39183. * @classdesc 几何对象表面分析参数类。该类对几何对象表面分析所用到的参数进行设置。
  39184. * @param {Object} options - 参数。
  39185. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} options.points - 表面分析的坐标点数组。
  39186. * @param {Array.<number>} options.zValues - 表面分析的坐标点的 Z 值数组。
  39187. * @param {number} [options.resolution] - 获取或设置指定中间结果(栅格数据集)的分辨率。
  39188. * @param {DataReturnOption} [options.resultSetting] - 结果返回设置类。
  39189. * @param {SurfaceAnalystParametersSetting} options.extractParameter - 获取或设置表面分析参数。
  39190. * @param {SurfaceAnalystMethod} [options.surfaceAnalystMethod = SurfaceAnalystMethod.ISOLINE] - 获取或设置表面分析的提取方法,提取等值线和提取等值面。
  39191. * @extends {SurfaceAnalystParameters}
  39192. * @usage
  39193. */
  39194. var GeometrySurfaceAnalystParameters = /*#__PURE__*/function (_SurfaceAnalystParame) {
  39195. GeometrySurfaceAnalystParameters_inherits(GeometrySurfaceAnalystParameters, _SurfaceAnalystParame);
  39196. var _super = GeometrySurfaceAnalystParameters_createSuper(GeometrySurfaceAnalystParameters);
  39197. function GeometrySurfaceAnalystParameters(options) {
  39198. var _this;
  39199. GeometrySurfaceAnalystParameters_classCallCheck(this, GeometrySurfaceAnalystParameters);
  39200. _this = _super.call(this, options);
  39201. /**
  39202. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} GeometrySurfaceAnalystParameters.prototype.points
  39203. * @description 获取或设置用于表面分析的坐标点数组。
  39204. */
  39205. _this.points = null;
  39206. /**
  39207. * @member {Array.<number>} GeometrySurfaceAnalystParameters.prototype.zValues
  39208. * @description 获取或设置用于提取操作的值。提取等值线时,将使用该数组中的值,
  39209. * 对几何对象中的坐标点数组进行插值分析,得到栅格数据集(中间结果),接着从栅格数据集提取等值线。
  39210. */
  39211. _this.zValues = null;
  39212. if (options) {
  39213. Util_Util.extend(GeometrySurfaceAnalystParameters_assertThisInitialized(_this), options);
  39214. }
  39215. _this.CLASS_NAME = "SuperMap.GeometrySurfaceAnalystParameters";
  39216. return _this;
  39217. }
  39218. /**
  39219. * @function GeometrySurfaceAnalystParameters.prototype.destroy
  39220. * @override
  39221. */
  39222. GeometrySurfaceAnalystParameters_createClass(GeometrySurfaceAnalystParameters, [{
  39223. key: "destroy",
  39224. value: function destroy() {
  39225. GeometrySurfaceAnalystParameters_get(GeometrySurfaceAnalystParameters_getPrototypeOf(GeometrySurfaceAnalystParameters.prototype), "destroy", this).call(this);
  39226. var me = this;
  39227. if (me.points) {
  39228. for (var i = 0, points = me.points, len = points.length; i < len; i++) {
  39229. points[i].destroy();
  39230. }
  39231. me.points = null;
  39232. }
  39233. me.zValues = null;
  39234. }
  39235. }]);
  39236. return GeometrySurfaceAnalystParameters;
  39237. }(SurfaceAnalystParameters);
  39238. ;// CONCATENATED MODULE: ./src/common/iServer/GeometryThiessenAnalystParameters.js
  39239. function GeometryThiessenAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return GeometryThiessenAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GeometryThiessenAnalystParameters_typeof(obj); }
  39240. function GeometryThiessenAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39241. function GeometryThiessenAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  39242. function GeometryThiessenAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryThiessenAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryThiessenAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  39243. function GeometryThiessenAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GeometryThiessenAnalystParameters_get = Reflect.get.bind(); } else { GeometryThiessenAnalystParameters_get = function _get(target, property, receiver) { var base = GeometryThiessenAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GeometryThiessenAnalystParameters_get.apply(this, arguments); }
  39244. function GeometryThiessenAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryThiessenAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  39245. function GeometryThiessenAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GeometryThiessenAnalystParameters_setPrototypeOf(subClass, superClass); }
  39246. function GeometryThiessenAnalystParameters_setPrototypeOf(o, p) { GeometryThiessenAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryThiessenAnalystParameters_setPrototypeOf(o, p); }
  39247. function GeometryThiessenAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = GeometryThiessenAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeometryThiessenAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeometryThiessenAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeometryThiessenAnalystParameters_possibleConstructorReturn(this, result); }; }
  39248. function GeometryThiessenAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometryThiessenAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GeometryThiessenAnalystParameters_assertThisInitialized(self); }
  39249. function GeometryThiessenAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39250. function GeometryThiessenAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  39251. function GeometryThiessenAnalystParameters_getPrototypeOf(o) { GeometryThiessenAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryThiessenAnalystParameters_getPrototypeOf(o); }
  39252. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39253. * This program are made available under the terms of the Apache License, Version 2.0
  39254. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39255. /**
  39256. * @class GeometryThiessenAnalystParameters
  39257. * @deprecatedclass SuperMap.GeometryThiessenAnalystParameters
  39258. * @constructs GeometryThiessenAnalystParameters
  39259. * @category iServer SpatialAnalyst ThiessenPolygonAnalyst
  39260. * @classdesc 几何对象泰森多边形分析参数类。对指定的某个几何对象做泰森多边形分析。通过该类可以指定要做泰森多边形分析的几何对象、返回数据集名称等。
  39261. * @param {Object} options - 参数。
  39262. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} options.points - 使用点数组进行分析时使用的几何对象。
  39263. * @extends {ThiessenAnalystParameters}
  39264. * @usage
  39265. */
  39266. var GeometryThiessenAnalystParameters = /*#__PURE__*/function (_ThiessenAnalystParam) {
  39267. GeometryThiessenAnalystParameters_inherits(GeometryThiessenAnalystParameters, _ThiessenAnalystParam);
  39268. var _super = GeometryThiessenAnalystParameters_createSuper(GeometryThiessenAnalystParameters);
  39269. function GeometryThiessenAnalystParameters(options) {
  39270. var _this;
  39271. GeometryThiessenAnalystParameters_classCallCheck(this, GeometryThiessenAnalystParameters);
  39272. _this = _super.call(this, options);
  39273. /**
  39274. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} GeometryThiessenAnalystParameters.prototype.points
  39275. * @description 使用点数组进行分析时使用的几何对象。
  39276. */
  39277. _this.points = null;
  39278. if (options) {
  39279. Util_Util.extend(GeometryThiessenAnalystParameters_assertThisInitialized(_this), options);
  39280. }
  39281. _this.CLASS_NAME = "SuperMap.GeometryThiessenAnalystParameters";
  39282. return _this;
  39283. }
  39284. /**
  39285. * @function GeometryThiessenAnalystParameters.prototype.destroy
  39286. * @override
  39287. */
  39288. GeometryThiessenAnalystParameters_createClass(GeometryThiessenAnalystParameters, [{
  39289. key: "destroy",
  39290. value: function destroy() {
  39291. GeometryThiessenAnalystParameters_get(GeometryThiessenAnalystParameters_getPrototypeOf(GeometryThiessenAnalystParameters.prototype), "destroy", this).call(this);
  39292. var me = this;
  39293. if (me.points) {
  39294. for (var i = me.points.length - 1; i >= 0; i--) {
  39295. me.points[i].destroy();
  39296. }
  39297. me.points = null;
  39298. }
  39299. }
  39300. /**
  39301. * @function GeometryThiessenAnalystParameters.toObject
  39302. * @param {GeometryThiessenAnalystParameters} geometryThiessenAnalystParameters - 几何对象泰森多边形分析参数类。
  39303. * @param {GeometryThiessenAnalystParameters} tempObj - 几何对象泰森多边形分析参数对象。
  39304. * @description 将几何对象泰森多边形分析参数对象转换为 JSON 对象。
  39305. * @returns {Object} JSON 对象。
  39306. */
  39307. }], [{
  39308. key: "toObject",
  39309. value: function toObject(geometryThiessenAnalystParameters, tempObj) {
  39310. for (var name in geometryThiessenAnalystParameters) {
  39311. if (name === "clipRegion") {
  39312. tempObj.clipRegion = ServerGeometry.fromGeometry(geometryThiessenAnalystParameters.clipRegion);
  39313. } else {
  39314. tempObj[name] = geometryThiessenAnalystParameters[name];
  39315. }
  39316. }
  39317. }
  39318. }]);
  39319. return GeometryThiessenAnalystParameters;
  39320. }(ThiessenAnalystParameters);
  39321. ;// CONCATENATED MODULE: ./src/common/iServer/GeoprocessingService.js
  39322. function GeoprocessingService_typeof(obj) { "@babel/helpers - typeof"; return GeoprocessingService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GeoprocessingService_typeof(obj); }
  39323. function GeoprocessingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39324. function GeoprocessingService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  39325. function GeoprocessingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoprocessingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoprocessingService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  39326. function GeoprocessingService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GeoprocessingService_setPrototypeOf(subClass, superClass); }
  39327. function GeoprocessingService_setPrototypeOf(o, p) { GeoprocessingService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoprocessingService_setPrototypeOf(o, p); }
  39328. function GeoprocessingService_createSuper(Derived) { var hasNativeReflectConstruct = GeoprocessingService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeoprocessingService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeoprocessingService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeoprocessingService_possibleConstructorReturn(this, result); }; }
  39329. function GeoprocessingService_possibleConstructorReturn(self, call) { if (call && (GeoprocessingService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GeoprocessingService_assertThisInitialized(self); }
  39330. function GeoprocessingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39331. function GeoprocessingService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  39332. function GeoprocessingService_getPrototypeOf(o) { GeoprocessingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoprocessingService_getPrototypeOf(o); }
  39333. /**
  39334. * @class GeoprocessingService
  39335. * @deprecatedclass SuperMap.GeoprocessingService
  39336. * @category iServer ProcessingAutomationService
  39337. * @classdesc 处理自动化服务接口的基类。
  39338. * @version 10.1.0
  39339. * @extends {CommonServiceBase}
  39340. * @param {string} url - 服务地址。
  39341. * @param {Object} options - 参数。
  39342. * @param {Events} options.events - 处理所有事件的对象。
  39343. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  39344. * @usage
  39345. */
  39346. var GeoprocessingService_GeoprocessingService = /*#__PURE__*/function (_CommonServiceBase) {
  39347. GeoprocessingService_inherits(GeoprocessingService, _CommonServiceBase);
  39348. var _super = GeoprocessingService_createSuper(GeoprocessingService);
  39349. function GeoprocessingService(url, options) {
  39350. var _this;
  39351. GeoprocessingService_classCallCheck(this, GeoprocessingService);
  39352. options = options || {};
  39353. options.EVENT_TYPES = ['processCompleted', 'processFailed', 'processRunning'];
  39354. _this = _super.call(this, url, options);
  39355. _this.CLASS_NAME = 'SuperMap.GeoprocessingService';
  39356. _this.headers = {};
  39357. _this.crossOrigin = true;
  39358. _this.eventCount = 0;
  39359. return _this;
  39360. }
  39361. /**
  39362. * @function GeoprocessingService.prototype.getTools
  39363. * @description 获取处理自动化工具列表。
  39364. * @param {string} identifier - 处理自动化工具ID。
  39365. */
  39366. GeoprocessingService_createClass(GeoprocessingService, [{
  39367. key: "getTools",
  39368. value: function getTools(callback) {
  39369. this._processAsync({
  39370. url: "".concat(this.url, "/list"),
  39371. callback: callback
  39372. });
  39373. }
  39374. /**
  39375. * @function GeoprocessingService.prototype.getTool
  39376. * @description 获取处理自动化工具的ID、名称、描述、输入参数、环境参数和输出结果等相关参数。
  39377. * @param {string} identifier - 处理自动化工具ID。
  39378. */
  39379. }, {
  39380. key: "getTool",
  39381. value: function getTool(identifier, callback) {
  39382. this._processAsync({
  39383. url: "".concat(this.url, "/").concat(identifier),
  39384. callback: callback
  39385. });
  39386. }
  39387. /**
  39388. * @function GeoprocessingService.prototype.execute
  39389. * @description 同步执行处理自动化工具。
  39390. * @param {string} identifier - 处理自动化工具ID。
  39391. * @param {Object} parameter - 处理自动化工具的输入参数。
  39392. * @param {Object} environment - 处理自动化工具的环境参数。
  39393. */
  39394. }, {
  39395. key: "execute",
  39396. value: function execute(identifier, parameter, environment, callback) {
  39397. parameter = parameter ? parameter : null;
  39398. environment = environment ? environment : null;
  39399. var executeParamter = {
  39400. parameter: parameter,
  39401. environment: environment
  39402. };
  39403. this._processAsync({
  39404. url: "".concat(this.url, "/").concat(identifier, "/execute"),
  39405. executeParamter: executeParamter,
  39406. callback: callback
  39407. });
  39408. }
  39409. /**
  39410. * @function GeoprocessingService.prototype.submitJob
  39411. * @description 异步执行处理自动化工具。
  39412. * @param {string} identifier - 处理自动化工具ID。
  39413. * @param {Object} parameter - 处理自动化工具的输入参数。
  39414. * @param {Object} environments - 处理自动化工具的环境参数。
  39415. */
  39416. }, {
  39417. key: "submitJob",
  39418. value: function submitJob(identifier, parameter, environments, callback) {
  39419. parameter = parameter ? parameter : null;
  39420. environments = environments ? environments : null;
  39421. var asyncParamter = JSON.stringify({
  39422. parameter: parameter,
  39423. environments: environments
  39424. });
  39425. this._processAsync({
  39426. url: "".concat(this.url, "/").concat(identifier, "/jobs"),
  39427. method: 'POST',
  39428. callback: callback,
  39429. params: asyncParamter
  39430. });
  39431. }
  39432. /**
  39433. * @function GeoprocessingService.prototype.waitForJobCompletion
  39434. * @description 获取处理自动化异步执行状态信息。
  39435. * @param {string} jobId - 处理自动化任务ID。
  39436. * @param {string} identifier - 处理自动化工具ID。
  39437. * @param {Object} options - 状态信息参数。
  39438. * @param {number} options.interval - 定时器时间间隔。
  39439. * @param {function} options.statusCallback - 任务状态的回调函数。
  39440. */
  39441. }, {
  39442. key: "waitForJobCompletion",
  39443. value: function waitForJobCompletion(jobId, identifier, options, callback) {
  39444. var me = this;
  39445. var timer = setInterval(function () {
  39446. var serviceProcessCompleted = function serviceProcessCompleted(serverResult, options) {
  39447. var state = serverResult.state.runState;
  39448. if (options.statusCallback) {
  39449. options.statusCallback(state);
  39450. }
  39451. switch (state) {
  39452. case 'FINISHED':
  39453. clearInterval(timer);
  39454. me.events.triggerEvent('processCompleted', {
  39455. result: serverResult,
  39456. options: options
  39457. });
  39458. break;
  39459. case 'FAILED':
  39460. clearInterval(timer);
  39461. me.events.triggerEvent('processFailed', {
  39462. result: serverResult,
  39463. options: options
  39464. });
  39465. break;
  39466. case 'CANCELED':
  39467. clearInterval(timer);
  39468. me.events.triggerEvent('processFailed', {
  39469. result: serverResult,
  39470. options: options
  39471. });
  39472. break;
  39473. }
  39474. };
  39475. me._processAsync({
  39476. url: "".concat(me.url, "/").concat(identifier, "/jobs/").concat(jobId),
  39477. serviceProcessCompleted: serviceProcessCompleted,
  39478. callback: callback
  39479. });
  39480. }, options.interval);
  39481. }
  39482. /**
  39483. * @function GeoprocessingService.prototype.getJobInfo
  39484. * @description 获取处理自动化任务的执行信息。
  39485. * @param {string} identifier - 处理自动化工具ID。
  39486. * @param {string} jobId - 处理自动化任务ID。
  39487. */
  39488. }, {
  39489. key: "getJobInfo",
  39490. value: function getJobInfo(identifier, jobId, callback) {
  39491. this._processAsync({
  39492. url: "".concat(this.url, "/").concat(identifier, "/jobs/").concat(jobId),
  39493. callback: callback
  39494. });
  39495. }
  39496. /**
  39497. * @function GeoprocessingService.prototype.cancelJob
  39498. * @description 取消处理自动化任务的异步执行。
  39499. * @param {string} identifier - 处理自动化工具ID。
  39500. * @param {string} jobId - 处理自动化任务ID。
  39501. */
  39502. }, {
  39503. key: "cancelJob",
  39504. value: function cancelJob(identifier, jobId, callback) {
  39505. this._processAsync({
  39506. url: "".concat(this.url, "/").concat(identifier, "/jobs/").concat(jobId, "/cancel"),
  39507. callback: callback
  39508. });
  39509. }
  39510. /**
  39511. * @function GeoprocessingService.prototype.getJobs
  39512. * @description 获取处理自动化服务任务列表。
  39513. * @param {string} identifier - 处理自动化工具ID。(传参代表identifier算子的任务列表,不传参代表所有任务的列表)
  39514. */
  39515. }, {
  39516. key: "getJobs",
  39517. value: function getJobs(identifier, callback) {
  39518. var url = "".concat(this.url, "/jobs");
  39519. if (identifier) {
  39520. url = "".concat(this.url, "/").concat(identifier, "/jobs");
  39521. }
  39522. this._processAsync({
  39523. url: url,
  39524. callback: callback
  39525. });
  39526. }
  39527. /**
  39528. * @function GeoprocessingService.prototype.getResults
  39529. * @description 处理自动化工具执行的结果等,支持结果过滤。
  39530. * @param {string} identifier - 处理自动化工具ID。
  39531. * @param {string} jobId - 处理自动化任务ID。
  39532. * @param {string} filter - 输出异步结果的ID。(可选,传入filter参数时对该处理自动化工具执行的结果进行过滤获取,不填参时显示所有的执行结果)
  39533. */
  39534. }, {
  39535. key: "getResults",
  39536. value: function getResults(identifier, jobId, filter, callback) {
  39537. var url = "".concat(this.url, "/").concat(identifier, "/jobs/").concat(jobId, "/results");
  39538. if (filter) {
  39539. url = "".concat(url, "/").concat(filter);
  39540. }
  39541. this._processAsync({
  39542. url: url,
  39543. callback: callback
  39544. });
  39545. }
  39546. }, {
  39547. key: "_processAsync",
  39548. value: function _processAsync(_ref) {
  39549. var url = _ref.url,
  39550. method = _ref.method,
  39551. callback = _ref.callback,
  39552. paramter = _ref.paramter,
  39553. serviceProcessCompleted = _ref.serviceProcessCompleted,
  39554. serviceProcessFailed = _ref.serviceProcessFailed;
  39555. var eventId = ++this.eventCount;
  39556. var eventListeners = {
  39557. scope: this,
  39558. processCompleted: function processCompleted(result) {
  39559. if (eventId === result.result.eventId && callback) {
  39560. delete result.result.eventId;
  39561. callback(result);
  39562. this.events && this.events.un(eventListeners);
  39563. return false;
  39564. }
  39565. },
  39566. processFailed: function processFailed(result) {
  39567. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  39568. callback(result);
  39569. this.events && this.events.un(eventListeners);
  39570. return false;
  39571. }
  39572. }
  39573. };
  39574. this.events.on(eventListeners);
  39575. this.request({
  39576. url: url,
  39577. method: method || 'GET',
  39578. params: paramter,
  39579. headers: {
  39580. 'Content-type': 'application/json'
  39581. },
  39582. scope: this,
  39583. success: function success(result, options) {
  39584. result.eventId = eventId;
  39585. var callback = serviceProcessCompleted || this.serviceProcessCompleted.bind(this);
  39586. callback(result, options);
  39587. },
  39588. failure: function failure(result, options) {
  39589. if (result.error) {
  39590. result.error.eventId = eventId;
  39591. }
  39592. result.eventId = eventId;
  39593. var callback = serviceProcessFailed || this.serviceProcessFailed.bind(this);
  39594. callback(result, options);
  39595. }
  39596. });
  39597. }
  39598. }]);
  39599. return GeoprocessingService;
  39600. }(CommonServiceBase);
  39601. ;// CONCATENATED MODULE: ./src/common/iServer/GeoRelationAnalystParameters.js
  39602. function GeoRelationAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39603. function GeoRelationAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  39604. function GeoRelationAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoRelationAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoRelationAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  39605. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39606. * This program are made available under the terms of the Apache License, Version 2.0
  39607. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39608. /**
  39609. * @class GeoRelationAnalystParameters
  39610. * @deprecatedclass SuperMap.GeoRelationAnalystParameters
  39611. * @category iServer SpatialAnalyst GeoRelationAnalyst
  39612. * @classdesc 空间关系分析服务参数类。使用该类可以为空间关系分析服务提供所需的参数信息。
  39613. * @param {Object} options - 参数。
  39614. * @param {FilterParameter} options.sourceFilter - 空间关系分析中的源数据集查询参数。仅 name, ids, attributeFilter 和 fields 字段有效。
  39615. * @param {FilterParameter} options.referenceFilter - 空间关系分析中的参考数据集查询参数。仅 name, ids, attributeFilter 和 fields 字段有效。
  39616. * @param {SpatialRelationType} options.spatialRelationType - 指定的空间关系类型。
  39617. * @param {boolean} [options.isBorderInside] - 边界处理方式,即位于面边线上的点是否被面包含。此参数仅用于空间关系为包含或被包含的情况。
  39618. * @param {boolean} [options.returnFeature] - 是否返回 Feature 信息。
  39619. * @param {boolean} [options.returnGeoRelatedOnly=true] - 仅返回满足指定空间关系的空间对象。
  39620. * @param {number} [options.startRecord=0] - 分析结果起始记录位置。
  39621. * @param {number} [options.expectCount=500] - 空间关系分析期望返回结果记录数,如果实际不足500条结果则返回所有分析结果。
  39622. * @usage
  39623. */
  39624. var GeoRelationAnalystParameters = /*#__PURE__*/function () {
  39625. function GeoRelationAnalystParameters(options) {
  39626. GeoRelationAnalystParameters_classCallCheck(this, GeoRelationAnalystParameters);
  39627. /**
  39628. * @member {string} GeoRelationAnalystParameters.prototype.dataset
  39629. * @description 源数据集名称。
  39630. */
  39631. this.dataset = null;
  39632. /**
  39633. * @member {FilterParameter} GeoRelationAnalystParameters.prototype.sourceFilter
  39634. * @description 空间关系分析中的源数据集查询参数。仅 ids、attributeFilter 和 fields 字段有效。
  39635. */
  39636. this.sourceFilter = null;
  39637. /**
  39638. * @member {FilterParameter} GeoRelationAnalystParameters.prototype.referenceFilter
  39639. * @description 空间关系分析中的参考数据集查询参数。仅 name,ids,attributeFilter 和 fields 字段有效。
  39640. */
  39641. this.referenceFilter = null;
  39642. /**
  39643. * @member {SpatialRelationType} GeoRelationAnalystParameters.prototype.spatialRelationType
  39644. * @description 指定的空间关系类型。
  39645. */
  39646. this.spatialRelationType = null;
  39647. /**
  39648. * @member {boolean} [GeoRelationAnalystParameters.prototype.isBorderInside]
  39649. * @description 边界处理方式,即位于面边线上的点是否被面包含。此参数仅用于空间关系为包含或被包含的情况。
  39650. */
  39651. this.isBorderInside = null;
  39652. /**
  39653. * @member {boolean} [GeoRelationAnalystParameters.prototype.returnFeature]
  39654. * @description 是否返回 Feature 信息。
  39655. */
  39656. this.returnFeature = null;
  39657. /**
  39658. * @member {boolean} [GeoRelationAnalystParameters.prototype.returnGeoRelatedOnly=true]
  39659. * @description 是否仅返回满足指定空间关系的空间对象。
  39660. */
  39661. this.returnGeoRelatedOnly = null;
  39662. /**
  39663. * @member {number} [GeoRelationAnalystParameters.prototype.returnGeoRelatedOnly=0]
  39664. * @description 分析结果起始记录位置。
  39665. */
  39666. this.startRecord = 0;
  39667. /**
  39668. * @member {number} [GeoRelationAnalystParameters.prototype.expectCount=500]
  39669. * @description 空间关系分析期望返回结果记录数,如果实际不足 500 条结果则返回所有分析结果。
  39670. */
  39671. this.expectCount = 500;
  39672. if (options) {
  39673. Util_Util.extend(this, options);
  39674. }
  39675. this.CLASS_NAME = "SuperMap.GeoRelationAnalystParameters";
  39676. }
  39677. /**
  39678. * @function GeoRelationAnalystParameters.prototype.destroy
  39679. * @description 释放资源,将引用资源的属性置空。
  39680. */
  39681. GeoRelationAnalystParameters_createClass(GeoRelationAnalystParameters, [{
  39682. key: "destroy",
  39683. value: function destroy() {
  39684. var me = this;
  39685. if (me.sourceFilter) {
  39686. me.sourceFilter.destroy();
  39687. }
  39688. me.sourceFilter = null;
  39689. if (me.referenceFilter) {
  39690. me.referenceFilter.destroy();
  39691. }
  39692. me.referenceFilter = null;
  39693. me.dataset = null;
  39694. me.spatialRelationType = null;
  39695. me.isBorderInside = null;
  39696. me.returnFeature = null;
  39697. me.returnGeoRelatedOnly = null;
  39698. me.startRecord = null;
  39699. me.expectCount = null;
  39700. }
  39701. }]);
  39702. return GeoRelationAnalystParameters;
  39703. }();
  39704. ;// CONCATENATED MODULE: ./src/common/iServer/GeoRelationAnalystService.js
  39705. function GeoRelationAnalystService_typeof(obj) { "@babel/helpers - typeof"; return GeoRelationAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GeoRelationAnalystService_typeof(obj); }
  39706. function GeoRelationAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39707. function GeoRelationAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  39708. function GeoRelationAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoRelationAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoRelationAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  39709. function GeoRelationAnalystService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GeoRelationAnalystService_get = Reflect.get.bind(); } else { GeoRelationAnalystService_get = function _get(target, property, receiver) { var base = GeoRelationAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GeoRelationAnalystService_get.apply(this, arguments); }
  39710. function GeoRelationAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoRelationAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  39711. function GeoRelationAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GeoRelationAnalystService_setPrototypeOf(subClass, superClass); }
  39712. function GeoRelationAnalystService_setPrototypeOf(o, p) { GeoRelationAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoRelationAnalystService_setPrototypeOf(o, p); }
  39713. function GeoRelationAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = GeoRelationAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeoRelationAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeoRelationAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeoRelationAnalystService_possibleConstructorReturn(this, result); }; }
  39714. function GeoRelationAnalystService_possibleConstructorReturn(self, call) { if (call && (GeoRelationAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GeoRelationAnalystService_assertThisInitialized(self); }
  39715. function GeoRelationAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39716. function GeoRelationAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  39717. function GeoRelationAnalystService_getPrototypeOf(o) { GeoRelationAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoRelationAnalystService_getPrototypeOf(o); }
  39718. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39719. * This program are made available under the terms of the Apache License, Version 2.0
  39720. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39721. /**
  39722. * @class GeoRelationAnalystService
  39723. * @deprecatedclass SuperMap.GeoRelationAnalystService
  39724. * @category iServer SpatialAnalyst GeoRelationAnalyst
  39725. * @classdesc 空间关系分析服务类。该类负责将客户设置的空间关系分析服务参数传递给服务端,并接收服务端返回的空间关系分析结果数据。
  39726. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  39727. * @param {Object} options - 参数。
  39728. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  39729. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  39730. * @param {Object} [options.headers] - 请求头。
  39731. * @extends {SpatialAnalystBase}
  39732. * @example 实例化该类如下例所示:
  39733. * (start code)
  39734. * function datasetGeoRelationAnalystProcess() {
  39735. * var referenceFilter = new FilterParameter({
  39736. * name:"Frame_R@Changchun",
  39737. * attributeFilter:"SmID>0"});
  39738. * var sourceFilter = new FilterParameter({
  39739. * attributeFilter:"SmID>0"});
  39740. * //初始化服务类
  39741. * var datasetGeoRelationService = new GeoRelationAnalystService(
  39742. * "http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst/"),
  39743. * //构建参数类
  39744. * datasetGeoRelationParameters = new GeoRelationAnalystParameters({
  39745. * dataset: "Park@Changchun",
  39746. * startRecord: 0,
  39747. * expectCount: 20,
  39748. * sourceFilter: sourceFilter,
  39749. * referenceFilter: referenceFilter,
  39750. * spatialRelationType: SpatialRelationType.INTERSECT,
  39751. * isBorderInside: true,
  39752. * returnFeature: true,
  39753. * returnGeoRelatedOnly: true
  39754. * });
  39755. * datasetGeoRelationService.events.on({
  39756. * "processCompleted": datasetGeoRelationAnalystCompleted,
  39757. * "processFailed": datasetGeoRelationAnalystFailed});
  39758. * //执行
  39759. * datasetGeoRelationService.processAsync(datasetGeoRelationParameters);
  39760. * }
  39761. * function Completed(datasetGeoRelationAnalystCompleted){//todo};
  39762. * function Error(datasetGeoRelationAnalystFailed){//todo};
  39763. * (end)
  39764. * @usage
  39765. */
  39766. var GeoRelationAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  39767. GeoRelationAnalystService_inherits(GeoRelationAnalystService, _SpatialAnalystBase);
  39768. var _super = GeoRelationAnalystService_createSuper(GeoRelationAnalystService);
  39769. function GeoRelationAnalystService(url, options) {
  39770. var _this;
  39771. GeoRelationAnalystService_classCallCheck(this, GeoRelationAnalystService);
  39772. _this = _super.call(this, url, options);
  39773. _this.CLASS_NAME = "SuperMap.GeoRelationAnalystService";
  39774. return _this;
  39775. }
  39776. /**
  39777. * @function GeoRelationAnalystService.prototype.destroy
  39778. * @override
  39779. */
  39780. GeoRelationAnalystService_createClass(GeoRelationAnalystService, [{
  39781. key: "destroy",
  39782. value: function destroy() {
  39783. GeoRelationAnalystService_get(GeoRelationAnalystService_getPrototypeOf(GeoRelationAnalystService.prototype), "destroy", this).call(this);
  39784. }
  39785. /**
  39786. * @function GeoRelationAnalystService.prototype.processAsync
  39787. * @description 负责将客户端的空间关系分析参数传递到服务端
  39788. * @param {GeoRelationAnalystParameters} parameter - 空间关系分析所需的参数信息。
  39789. */
  39790. }, {
  39791. key: "processAsync",
  39792. value: function processAsync(parameter) {
  39793. if (!(parameter instanceof GeoRelationAnalystParameters)) {
  39794. return;
  39795. }
  39796. var me = this;
  39797. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/georelation');
  39798. var jsonParameters = Util_Util.toJSON(parameter);
  39799. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  39800. me.request({
  39801. method: "POST",
  39802. data: jsonParameters,
  39803. scope: me,
  39804. success: me.serviceProcessCompleted,
  39805. failure: me.serviceProcessFailed
  39806. });
  39807. }
  39808. }]);
  39809. return GeoRelationAnalystService;
  39810. }(SpatialAnalystBase);
  39811. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetService.js
  39812. function DatasetService_typeof(obj) { "@babel/helpers - typeof"; return DatasetService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, DatasetService_typeof(obj); }
  39813. function DatasetService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39814. function DatasetService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  39815. function DatasetService_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetService_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  39816. function DatasetService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { DatasetService_get = Reflect.get.bind(); } else { DatasetService_get = function _get(target, property, receiver) { var base = DatasetService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return DatasetService_get.apply(this, arguments); }
  39817. function DatasetService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetService_getPrototypeOf(object); if (object === null) break; } return object; }
  39818. function DatasetService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) DatasetService_setPrototypeOf(subClass, superClass); }
  39819. function DatasetService_setPrototypeOf(o, p) { DatasetService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetService_setPrototypeOf(o, p); }
  39820. function DatasetService_createSuper(Derived) { var hasNativeReflectConstruct = DatasetService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DatasetService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DatasetService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DatasetService_possibleConstructorReturn(this, result); }; }
  39821. function DatasetService_possibleConstructorReturn(self, call) { if (call && (DatasetService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return DatasetService_assertThisInitialized(self); }
  39822. function DatasetService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39823. function DatasetService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  39824. function DatasetService_getPrototypeOf(o) { DatasetService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetService_getPrototypeOf(o); }
  39825. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39826. * This program are made available under the terms of the Apache License, Version 2.0
  39827. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39828. /**
  39829. * @class DatasetService
  39830. * @deprecatedclass SuperMap.DatasetService
  39831. * @category iServer Data Dataset
  39832. * @classdesc 数据集查询服务。
  39833. * @param {string} url - 服务的访问地址。如访问World Data服务,只需将url设为:http://localhost:8090/iserver/services/data-world/rest/data 即可。
  39834. * @param {Object} options - 参数。
  39835. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  39836. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  39837. * @param {string}options.datasource - 数据源名称。
  39838. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  39839. * @param {Object} [options.headers] - 请求头。
  39840. * @usage
  39841. */
  39842. var DatasetService_DatasetService = /*#__PURE__*/function (_CommonServiceBase) {
  39843. DatasetService_inherits(DatasetService, _CommonServiceBase);
  39844. var _super = DatasetService_createSuper(DatasetService);
  39845. function DatasetService(url, options) {
  39846. var _this;
  39847. DatasetService_classCallCheck(this, DatasetService);
  39848. _this = _super.call(this, url, options);
  39849. if (!options) {
  39850. return DatasetService_possibleConstructorReturn(_this);
  39851. }
  39852. /**
  39853. * @member {string} DatasetService.prototype.datasource
  39854. * @description 要查询的数据集所在的数据源名称。
  39855. */
  39856. _this.datasource = null;
  39857. /**
  39858. * @member {string} DatasetService.prototype.dataset
  39859. * @description 要查询的数据集名称。
  39860. */
  39861. _this.dataset = null;
  39862. _this.eventCount = 0;
  39863. if (options) {
  39864. Util_Util.extend(DatasetService_assertThisInitialized(_this), options);
  39865. }
  39866. _this.CLASS_NAME = "SuperMap.DatasetService";
  39867. return _this;
  39868. }
  39869. /**
  39870. * @function DatasetService.prototype.destroy
  39871. * @override
  39872. */
  39873. DatasetService_createClass(DatasetService, [{
  39874. key: "destroy",
  39875. value: function destroy() {
  39876. DatasetService_get(DatasetService_getPrototypeOf(DatasetService.prototype), "destroy", this).call(this);
  39877. var me = this;
  39878. me.datasource = null;
  39879. me.dataset = null;
  39880. }
  39881. /**
  39882. * @function DatasetService.prototype.getDatasetsService
  39883. * @description 执行服务,查询数据集服务。
  39884. */
  39885. }, {
  39886. key: "getDatasetsService",
  39887. value: function getDatasetsService(params, callback) {
  39888. var url = Util_Util.urlPathAppend(this.url, "datasources/name/".concat(params, "/datasets"));
  39889. this.processAsync(url, 'GET', callback);
  39890. }
  39891. /**
  39892. * @function DatasetService.prototype.getDatasetService
  39893. * @description 执行服务,查询数据集信息服务。
  39894. */
  39895. }, {
  39896. key: "getDatasetService",
  39897. value: function getDatasetService(datasourceName, datasetName, callback) {
  39898. var url = Util_Util.urlPathAppend(this.url, "datasources/name/".concat(datasourceName, "/datasets/name/").concat(datasetName));
  39899. this.processAsync(url, 'GET', callback);
  39900. }
  39901. /**
  39902. * @function DatasetService.prototype.setDatasetService
  39903. * @description 执行服务,更改数据集信息服务。
  39904. */
  39905. }, {
  39906. key: "setDatasetService",
  39907. value: function setDatasetService(params, callback) {
  39908. if (!params) {
  39909. return;
  39910. }
  39911. var url = Util_Util.urlPathAppend(this.url, "datasources/name/".concat(params.datasourceName, "/datasets/name/").concat(params.datasetName));
  39912. delete params.datasourceName;
  39913. this.processAsync(url, 'PUT', callback, params);
  39914. }
  39915. /**
  39916. * @function DatasetService.prototype.deleteDatasetService
  39917. * @description 执行服务,删除数据集信息服务。
  39918. */
  39919. }, {
  39920. key: "deleteDatasetService",
  39921. value: function deleteDatasetService(datasourceName, datasetName, callback) {
  39922. var url = Util_Util.urlPathAppend(this.url, "datasources/name/".concat(datasourceName, "/datasets/name/").concat(datasetName));
  39923. this.processAsync(url, 'DELETE', callback);
  39924. }
  39925. }, {
  39926. key: "processAsync",
  39927. value: function processAsync(url, method, callback, params) {
  39928. var eventId = ++this.eventCount;
  39929. var eventListeners = {
  39930. scope: this,
  39931. processCompleted: function processCompleted(result) {
  39932. if (eventId === result.result.eventId && callback) {
  39933. delete result.result.eventId;
  39934. callback(result);
  39935. this.events && this.events.un(eventListeners);
  39936. return false;
  39937. }
  39938. },
  39939. processFailed: function processFailed(result) {
  39940. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  39941. callback(result);
  39942. this.events && this.events.un(eventListeners);
  39943. return false;
  39944. }
  39945. }
  39946. };
  39947. this.events.on(eventListeners);
  39948. var me = this;
  39949. var requestConfig = {
  39950. url: url,
  39951. method: method,
  39952. scope: me,
  39953. success: function success(result, options) {
  39954. result.eventId = eventId;
  39955. me.serviceProcessCompleted(result, options);
  39956. },
  39957. failure: function failure(result, options) {
  39958. if (result.error) {
  39959. result.error.eventId = eventId;
  39960. }
  39961. result.eventId = eventId;
  39962. me.serviceProcessFailed(result, options);
  39963. }
  39964. };
  39965. params && (requestConfig.data = Util_Util.toJSON(params));
  39966. me.request(requestConfig);
  39967. }
  39968. }]);
  39969. return DatasetService;
  39970. }(CommonServiceBase);
  39971. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesParametersBase.js
  39972. function GetFeaturesParametersBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39973. function GetFeaturesParametersBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  39974. function GetFeaturesParametersBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesParametersBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesParametersBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  39975. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39976. * This program are made available under the terms of the Apache License, Version 2.0
  39977. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39978. /**
  39979. * @class GetFeaturesParametersBase
  39980. * @deprecatedclass SuperMap.GetFeaturesParametersBase
  39981. * @category iServer Data FeatureResults
  39982. * @classdesc 要素查询参数基类。
  39983. * @param {Object} options - 参数。
  39984. * @param {Array.<string>} options.datasetNames - 数据集名称列表。
  39985. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  39986. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  39987. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  39988. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  39989. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  39990. * @param {MetricsAggParameter|GeoHashGridAggParameter} [options.aggregations] - 聚合查询参数。该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  39991. * @usage
  39992. */
  39993. var GetFeaturesParametersBase = /*#__PURE__*/function () {
  39994. function GetFeaturesParametersBase(options) {
  39995. GetFeaturesParametersBase_classCallCheck(this, GetFeaturesParametersBase);
  39996. /**
  39997. * @member {Array.<string>} GetFeaturesParametersBase.prototype.datasetName
  39998. * @description 数据集集合中的数据集名称列表。
  39999. */
  40000. this.datasetNames = null;
  40001. /**
  40002. * @member {string} GetFeaturesParametersBase.prototype.targetEpsgCode
  40003. * @description 动态投影的目标坐标系对应的 EPSG Code,使用时需设置 returnContent 参数为 true。
  40004. */
  40005. this.targetEpsgCode = null;
  40006. /**
  40007. * @member {Object} GetFeaturesParametersBase.prototype.targetPrj
  40008. * @description 动态投影的目标坐标系。使用时需设置 returnContent 参数为 true。如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  40009. */
  40010. this.targetPrj = null;
  40011. /**
  40012. * @member {boolean} [GetFeaturesParametersBase.prototype.returnContent=true]
  40013. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  40014. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  40015. * 如果为 false,则返回的是查询结果资源的 URI。
  40016. */
  40017. this.returnContent = true;
  40018. /**
  40019. * @member {number} [GetFeaturesParametersBase.prototype.fromIndex=0]
  40020. * @description 查询结果的最小索引号。如果该值大于查询结果的最大索引号,则查询结果为空。
  40021. */
  40022. this.fromIndex = 0;
  40023. /**
  40024. * @member {number} [GetFeaturesParametersBase.prototype.toIndex=19]
  40025. * @description 查询结果的最大索引号。如果该值大于查询结果的最大索引号,则以查询结果的最大索引号为终止索引号。
  40026. */
  40027. this.toIndex = 19;
  40028. /**
  40029. * @member {boolean} [GetFeaturesParametersBase.prototype.returnCountOnly=false]
  40030. * @description 只返回查询结果的总数。
  40031. */
  40032. this.returnCountOnly = false;
  40033. /**
  40034. * @member {number} [GetFeaturesParametersBase.prototype.maxFeatures=1000]
  40035. * @description 进行 SQL 查询时,用于设置服务端返回查询结果条目数量。
  40036. */
  40037. this.maxFeatures = null;
  40038. /**
  40039. * @member {number} [GetFeaturesParametersBase.prototype.hasGeometry=true]
  40040. * @description 返回结果是否包含Geometry。
  40041. */
  40042. this.hasGeometry = true;
  40043. /**
  40044. * @member {MetricsAggParameter|GeoHashGridAggParameter} GetFeaturesParametersBase.prototype.aggregations
  40045. * @description 聚合查询参数,该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  40046. */
  40047. this.aggregations = null;
  40048. Util_Util.extend(this, options);
  40049. this.CLASS_NAME = 'SuperMap.GetFeaturesParametersBase';
  40050. }
  40051. /**
  40052. *
  40053. * @function GetFeaturesParametersBase.prototype.destroy
  40054. * @description 释放资源,将引用资源的属性置空。
  40055. */
  40056. GetFeaturesParametersBase_createClass(GetFeaturesParametersBase, [{
  40057. key: "destroy",
  40058. value: function destroy() {
  40059. var me = this;
  40060. me.datasetNames = null;
  40061. me.returnContent = null;
  40062. me.fromIndex = null;
  40063. me.toIndex = null;
  40064. me.hasGeometry = null;
  40065. me.maxFeatures = null;
  40066. me.targetEpsgCode = null;
  40067. me.targetPrj = null;
  40068. if (me.aggregation) {
  40069. me.aggregation = null;
  40070. }
  40071. }
  40072. }]);
  40073. return GetFeaturesParametersBase;
  40074. }();
  40075. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBoundsParameters.js
  40076. function GetFeaturesByBoundsParameters_typeof(obj) { "@babel/helpers - typeof"; return GetFeaturesByBoundsParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFeaturesByBoundsParameters_typeof(obj); }
  40077. function GetFeaturesByBoundsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40078. function GetFeaturesByBoundsParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  40079. function GetFeaturesByBoundsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBoundsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBoundsParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  40080. function GetFeaturesByBoundsParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByBoundsParameters_get = Reflect.get.bind(); } else { GetFeaturesByBoundsParameters_get = function _get(target, property, receiver) { var base = GetFeaturesByBoundsParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFeaturesByBoundsParameters_get.apply(this, arguments); }
  40081. function GetFeaturesByBoundsParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBoundsParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  40082. function GetFeaturesByBoundsParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFeaturesByBoundsParameters_setPrototypeOf(subClass, superClass); }
  40083. function GetFeaturesByBoundsParameters_setPrototypeOf(o, p) { GetFeaturesByBoundsParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBoundsParameters_setPrototypeOf(o, p); }
  40084. function GetFeaturesByBoundsParameters_createSuper(Derived) { var hasNativeReflectConstruct = GetFeaturesByBoundsParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFeaturesByBoundsParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFeaturesByBoundsParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFeaturesByBoundsParameters_possibleConstructorReturn(this, result); }; }
  40085. function GetFeaturesByBoundsParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBoundsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFeaturesByBoundsParameters_assertThisInitialized(self); }
  40086. function GetFeaturesByBoundsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  40087. function GetFeaturesByBoundsParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  40088. function GetFeaturesByBoundsParameters_getPrototypeOf(o) { GetFeaturesByBoundsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBoundsParameters_getPrototypeOf(o); }
  40089. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40090. * This program are made available under the terms of the Apache License, Version 2.0
  40091. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40092. /**
  40093. * @class GetFeaturesByBoundsParameters
  40094. * @deprecatedclass SuperMap.GetFeaturesByBoundsParameters
  40095. * @category iServer Data FeatureResults
  40096. * @classdesc 数据集范围查询参数类,该类用于设置数据集范围查询的相关参数。
  40097. * @param {Object} options - 参数。
  40098. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 查询的范围对象。
  40099. * @param {Array.<string>} options.datasetNames - 数据集名称列表。
  40100. * @param {string} [options.attributeFilter] - 范围查询属性过滤条件。
  40101. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  40102. * @param {SpatialQueryMode} [options.spatialQueryMode=SpatialQueryMode.CONTAIN] - 空间查询模式常量。
  40103. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  40104. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  40105. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  40106. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  40107. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  40108. * @param {MetricsAggParameter|GeoHashGridAggParameter} [options.aggregations] - 聚合查询参数。该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  40109. * @extends {GetFeaturesParametersBase}
  40110. * @usage
  40111. */
  40112. var GetFeaturesByBoundsParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  40113. GetFeaturesByBoundsParameters_inherits(GetFeaturesByBoundsParameters, _GetFeaturesParameter);
  40114. var _super = GetFeaturesByBoundsParameters_createSuper(GetFeaturesByBoundsParameters);
  40115. function GetFeaturesByBoundsParameters(options) {
  40116. var _this;
  40117. GetFeaturesByBoundsParameters_classCallCheck(this, GetFeaturesByBoundsParameters);
  40118. _this = _super.call(this, options);
  40119. /**
  40120. * @member {string} GetFeaturesByBoundsParameters.prototype.getFeatureMode
  40121. * @description 数据集查询模式。范围查询有 "BOUNDS","BOUNDS_ATTRIBUTEFILTER" 两种,当用户设置 attributeFilter 时会自动切换到 BOUNDS_ATTRIBUTEFILTER 访问服务。
  40122. */
  40123. _this.getFeatureMode = GetFeaturesByBoundsParameters.getFeatureMode.BOUNDS;
  40124. /**
  40125. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} GetFeaturesByBoundsParameters.prototype.bounds
  40126. * @description 用于查询的范围对象。
  40127. *
  40128. */
  40129. _this.bounds = null;
  40130. /**
  40131. * @member {Array.<string>} GetFeaturesByBoundsParameters.prototype.fields
  40132. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  40133. */
  40134. _this.fields = null;
  40135. /**
  40136. * @member {string} GetFeaturesByBoundsParameters.prototype.attributeFilter
  40137. * @description 范围查询属性过滤条件。
  40138. */
  40139. _this.attributeFilter = null;
  40140. /**
  40141. * @member {SpatialQueryMode} [GetFeaturesByBoundsParameters.prototype.spatialQueryMode=SpatialQueryMode.CONTAIN]
  40142. * @description 空间查询模式常量。
  40143. */
  40144. _this.spatialQueryMode = SpatialQueryMode.CONTAIN;
  40145. Util_Util.extend(GetFeaturesByBoundsParameters_assertThisInitialized(_this), options);
  40146. _this.CLASS_NAME = 'SuperMap.GetFeaturesByBoundsParameters';
  40147. return _this;
  40148. }
  40149. /**
  40150. * @function GetFeaturesByBoundsParameters.prototype.destroy
  40151. * @override
  40152. */
  40153. GetFeaturesByBoundsParameters_createClass(GetFeaturesByBoundsParameters, [{
  40154. key: "destroy",
  40155. value: function destroy() {
  40156. GetFeaturesByBoundsParameters_get(GetFeaturesByBoundsParameters_getPrototypeOf(GetFeaturesByBoundsParameters.prototype), "destroy", this).call(this);
  40157. var me = this;
  40158. if (me.bounds) {
  40159. me.bounds.destroy();
  40160. me.bounds = null;
  40161. }
  40162. if (me.fields) {
  40163. while (me.fields.length > 0) {
  40164. me.fields.pop();
  40165. }
  40166. me.fields = null;
  40167. }
  40168. me.attributeFilter = null;
  40169. me.spatialQueryMode = null;
  40170. me.getFeatureMode = null;
  40171. }
  40172. /**
  40173. * @function GetFeaturesByBoundsParameters.toJsonParameters
  40174. * @description 将 {@link GetFeaturesByBoundsParameters} 对象参数转换为 JSON 字符串。
  40175. * @param {GetFeaturesByBoundsParameters} params - 范围查询参数。
  40176. * @returns {string} 转化后的 JSON 字符串。
  40177. *
  40178. */
  40179. }], [{
  40180. key: "toJsonParameters",
  40181. value: function toJsonParameters(params) {
  40182. var filterParameter, bounds, parasByBounds;
  40183. bounds = {
  40184. leftBottom: {
  40185. x: params.bounds.left,
  40186. y: params.bounds.bottom
  40187. },
  40188. rightTop: {
  40189. x: params.bounds.right,
  40190. y: params.bounds.top
  40191. }
  40192. };
  40193. parasByBounds = {
  40194. datasetNames: params.datasetNames,
  40195. getFeatureMode: GetFeaturesByBoundsParameters.getFeatureMode.BOUNDS,
  40196. bounds: bounds,
  40197. spatialQueryMode: params.spatialQueryMode
  40198. };
  40199. if (params.fields) {
  40200. filterParameter = new FilterParameter();
  40201. filterParameter.name = params.datasetNames;
  40202. filterParameter.fields = params.fields;
  40203. parasByBounds.queryParameter = filterParameter;
  40204. }
  40205. if (params.attributeFilter) {
  40206. parasByBounds.attributeFilter = params.attributeFilter;
  40207. parasByBounds.getFeatureMode = GetFeaturesByBoundsParameters.getFeatureMode.BOUNDS_ATTRIBUTEFILTER;
  40208. }
  40209. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  40210. parasByBounds.maxFeatures = params.maxFeatures;
  40211. }
  40212. if (typeof params.hasGeometry === 'boolean') {
  40213. parasByBounds.hasGeometry = params.hasGeometry;
  40214. }
  40215. if (params.targetEpsgCode) {
  40216. parasByBounds.targetEpsgCode = params.targetEpsgCode;
  40217. }
  40218. if (!params.targetEpsgCode && params.targetPrj) {
  40219. parasByBounds.targetPrj = params.targetPrj;
  40220. }
  40221. if (params.aggregations) {
  40222. parasByBounds.aggregations = params.aggregations;
  40223. }
  40224. return Util_Util.toJSON(parasByBounds);
  40225. }
  40226. }]);
  40227. return GetFeaturesByBoundsParameters;
  40228. }(GetFeaturesParametersBase);
  40229. GetFeaturesByBoundsParameters.getFeatureMode = {
  40230. BOUNDS: 'BOUNDS',
  40231. BOUNDS_ATTRIBUTEFILTER: 'BOUNDS_ATTRIBUTEFILTER'
  40232. };
  40233. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesServiceBase.js
  40234. function GetFeaturesServiceBase_typeof(obj) { "@babel/helpers - typeof"; return GetFeaturesServiceBase_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFeaturesServiceBase_typeof(obj); }
  40235. function GetFeaturesServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40236. function GetFeaturesServiceBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  40237. function GetFeaturesServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesServiceBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  40238. function GetFeaturesServiceBase_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesServiceBase_get = Reflect.get.bind(); } else { GetFeaturesServiceBase_get = function _get(target, property, receiver) { var base = GetFeaturesServiceBase_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFeaturesServiceBase_get.apply(this, arguments); }
  40239. function GetFeaturesServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
  40240. function GetFeaturesServiceBase_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFeaturesServiceBase_setPrototypeOf(subClass, superClass); }
  40241. function GetFeaturesServiceBase_setPrototypeOf(o, p) { GetFeaturesServiceBase_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesServiceBase_setPrototypeOf(o, p); }
  40242. function GetFeaturesServiceBase_createSuper(Derived) { var hasNativeReflectConstruct = GetFeaturesServiceBase_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFeaturesServiceBase_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFeaturesServiceBase_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFeaturesServiceBase_possibleConstructorReturn(this, result); }; }
  40243. function GetFeaturesServiceBase_possibleConstructorReturn(self, call) { if (call && (GetFeaturesServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFeaturesServiceBase_assertThisInitialized(self); }
  40244. function GetFeaturesServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  40245. function GetFeaturesServiceBase_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  40246. function GetFeaturesServiceBase_getPrototypeOf(o) { GetFeaturesServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesServiceBase_getPrototypeOf(o); }
  40247. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40248. * This program are made available under the terms of the Apache License, Version 2.0
  40249. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40250. /**
  40251. * @class GetFeaturesServiceBase
  40252. * @deprecatedclass SuperMap.GetFeaturesServiceBase
  40253. * @category iServer Data FeatureResults
  40254. * @classdesc 数据服务中数据集查询服务基类。获取结果数据类型为 Object。包含 result 属性,result 的数据格式根据 format 参数决定为 GeoJSON 或者 iServerJSON。
  40255. * @extends CommonServiceBase
  40256. * @param {string} url - 服务地址。请求数据服务中数据集查询服务,
  40257. * URL应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/
  40258. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  40259. * @param {Object} options - 参数。
  40260. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  40261. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  40262. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  40263. * @param {Object} [options.headers] - 请求头。
  40264. * @example
  40265. * var myService = new GetFeaturesServiceBase(url, {
  40266. * eventListeners: {
  40267. * "processCompleted": getFeatureCompleted,
  40268. * "processFailed": getFeatureError
  40269. * }
  40270. * });
  40271. * @usage
  40272. */
  40273. var GetFeaturesServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
  40274. GetFeaturesServiceBase_inherits(GetFeaturesServiceBase, _CommonServiceBase);
  40275. var _super = GetFeaturesServiceBase_createSuper(GetFeaturesServiceBase);
  40276. function GetFeaturesServiceBase(url, options) {
  40277. var _this;
  40278. GetFeaturesServiceBase_classCallCheck(this, GetFeaturesServiceBase);
  40279. _this = _super.call(this, url, options);
  40280. options = options || {};
  40281. /**
  40282. * @member {boolean} [GetFeaturesServiceBase.prototype.returnContent=true]
  40283. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  40284. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  40285. * 如果为 false,则返回的是查询结果资源的 URI。
  40286. */
  40287. _this.returnContent = true;
  40288. /**
  40289. * @member {number} [GetFeaturesServiceBase.prototype.fromIndex=0]
  40290. * @description 查询结果的最小索引号。如果该值大于查询结果的最大索引号,则查询结果为空。
  40291. */
  40292. _this.fromIndex = 0;
  40293. /**
  40294. * @member {number} [GetFeaturesServiceBase.prototype.toIndex=19]
  40295. * @description 查询结果的最大索引号。
  40296. * 如果该值大于查询结果的最大索引号,则以查询结果的最大索引号为终止索引号。
  40297. */
  40298. _this.toIndex = 19;
  40299. /**
  40300. * @member {number} [GetFeaturesServiceBase.prototype.hasGeometry=true]
  40301. * @description 返回结果是否包含Geometry。
  40302. */
  40303. _this.hasGeometry = true;
  40304. /**
  40305. * @member {number} [GetFeaturesServiceBase.prototype.maxFeatures=1000]
  40306. * @description 进行 SQL 查询时,用于设置服务端返回查询结果条目数量。
  40307. */
  40308. _this.maxFeatures = null;
  40309. /**
  40310. * @member {string} [GetFeaturesServiceBase.prototype.format=DataFormat.GEOJSON]
  40311. * @description 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。
  40312. * 参数格式为 "ISERVER","GEOJSON","FGB"。
  40313. */
  40314. _this.format = DataFormat.GEOJSON;
  40315. Util_Util.extend(GetFeaturesServiceBase_assertThisInitialized(_this), options);
  40316. _this.url = Util_Util.urlPathAppend(_this.url, 'featureResults');
  40317. _this.CLASS_NAME = "SuperMap.GetFeaturesServiceBase";
  40318. return _this;
  40319. }
  40320. /**
  40321. * @function GetFeaturesServiceBase.prototype.destroy
  40322. * @description 释放资源,将引用资源的属性置空。
  40323. */
  40324. GetFeaturesServiceBase_createClass(GetFeaturesServiceBase, [{
  40325. key: "destroy",
  40326. value: function destroy() {
  40327. GetFeaturesServiceBase_get(GetFeaturesServiceBase_getPrototypeOf(GetFeaturesServiceBase.prototype), "destroy", this).call(this);
  40328. var me = this;
  40329. me.returnContent = null;
  40330. me.fromIndex = null;
  40331. me.toIndex = null;
  40332. me.maxFeatures = null;
  40333. me.format = null;
  40334. me.hasGeometry = null;
  40335. }
  40336. /**
  40337. * @function GetFeaturesServiceBase.prototype.processAsync
  40338. * @description 将客户端的查询参数传递到服务端。
  40339. * @param {Object} params - 查询参数。
  40340. */
  40341. }, {
  40342. key: "processAsync",
  40343. value: function processAsync(params) {
  40344. if (!params) {
  40345. return;
  40346. }
  40347. var me = this,
  40348. jsonParameters = null,
  40349. firstPara = true;
  40350. me.returnContent = params.returnContent;
  40351. me.fromIndex = params.fromIndex;
  40352. me.toIndex = params.toIndex;
  40353. me.maxFeatures = params.maxFeatures;
  40354. me.hasGeometry = params.hasGeometry;
  40355. if (me.returnContent) {
  40356. firstPara = false;
  40357. }
  40358. var isValidNumber = me.fromIndex != null && me.toIndex != null && !isNaN(me.fromIndex) && !isNaN(me.toIndex);
  40359. if (isValidNumber && me.fromIndex >= 0 && me.toIndex >= 0 && !firstPara) {
  40360. me.url = Util_Util.urlAppend(me.url, "fromIndex=".concat(me.fromIndex, "&toIndex=").concat(me.toIndex));
  40361. }
  40362. if (params.returnCountOnly) {
  40363. me.url = Util_Util.urlAppend(me.url, "&returnCountOnly=" + params.returnContent);
  40364. }
  40365. jsonParameters = me.getJsonParameters(params);
  40366. me.request({
  40367. method: "POST",
  40368. data: jsonParameters,
  40369. scope: me,
  40370. success: me.serviceProcessCompleted,
  40371. failure: me.serviceProcessFailed
  40372. });
  40373. }
  40374. /**
  40375. * @function GetFeaturesServiceBase.prototype.getFeatureComplete
  40376. * @description 查询完成,执行此方法。
  40377. * @param {Object} result - 服务器返回的结果对象。
  40378. */
  40379. }, {
  40380. key: "serviceProcessCompleted",
  40381. value: function serviceProcessCompleted(result, options) {
  40382. var me = this;
  40383. result = Util_Util.transformResult(result);
  40384. if (me.format === DataFormat.GEOJSON && result.features) {
  40385. var geoJSONFormat = new GeoJSON();
  40386. result.features = geoJSONFormat.toGeoJSON(result.features);
  40387. }
  40388. me.events.triggerEvent("processCompleted", {
  40389. result: result,
  40390. options: options
  40391. });
  40392. }
  40393. }, {
  40394. key: "dataFormat",
  40395. value: function dataFormat() {
  40396. return [DataFormat.GEOJSON, DataFormat.ISERVER, DataFormat.FGB];
  40397. }
  40398. }]);
  40399. return GetFeaturesServiceBase;
  40400. }(CommonServiceBase);
  40401. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBoundsService.js
  40402. function GetFeaturesByBoundsService_typeof(obj) { "@babel/helpers - typeof"; return GetFeaturesByBoundsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFeaturesByBoundsService_typeof(obj); }
  40403. function GetFeaturesByBoundsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40404. function GetFeaturesByBoundsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  40405. function GetFeaturesByBoundsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBoundsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBoundsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  40406. function GetFeaturesByBoundsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByBoundsService_get = Reflect.get.bind(); } else { GetFeaturesByBoundsService_get = function _get(target, property, receiver) { var base = GetFeaturesByBoundsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFeaturesByBoundsService_get.apply(this, arguments); }
  40407. function GetFeaturesByBoundsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBoundsService_getPrototypeOf(object); if (object === null) break; } return object; }
  40408. function GetFeaturesByBoundsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFeaturesByBoundsService_setPrototypeOf(subClass, superClass); }
  40409. function GetFeaturesByBoundsService_setPrototypeOf(o, p) { GetFeaturesByBoundsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBoundsService_setPrototypeOf(o, p); }
  40410. function GetFeaturesByBoundsService_createSuper(Derived) { var hasNativeReflectConstruct = GetFeaturesByBoundsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFeaturesByBoundsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFeaturesByBoundsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFeaturesByBoundsService_possibleConstructorReturn(this, result); }; }
  40411. function GetFeaturesByBoundsService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBoundsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFeaturesByBoundsService_assertThisInitialized(self); }
  40412. function GetFeaturesByBoundsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  40413. function GetFeaturesByBoundsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  40414. function GetFeaturesByBoundsService_getPrototypeOf(o) { GetFeaturesByBoundsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBoundsService_getPrototypeOf(o); }
  40415. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40416. * This program are made available under the terms of the Apache License, Version 2.0
  40417. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40418. /**
  40419. * @class GetFeaturesByBoundsService
  40420. * @deprecatedclass SuperMap.GetFeaturesByBoundsService
  40421. * @category iServer Data FeatureResults
  40422. * @classdesc 数据集范围查询服务类,查询与指定范围对象符合一定空间关系的矢量要素。
  40423. * @description 数据集范围查询服务类构造函数。
  40424. * @extends {GetFeaturesServiceBase}
  40425. * @param {string} url - 服务地址。请求数据服务中数据集查询服务,URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;
  40426. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  40427. * @param {Object} options - 参数。
  40428. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  40429. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  40430. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  40431. * @param {Object} [options.headers] - 请求头。
  40432. * @example
  40433. * var myGetFeaturesByBoundsService = new SuperMa.GetFeaturesByBoundsService(url, {
  40434. * eventListeners: {
  40435. * "processCompleted": getFeatureCompleted,
  40436. * "processFailed": getFeatureError
  40437. * }
  40438. * });
  40439. * function getFeatureCompleted(object){//todo};
  40440. * function getFeatureError(object){//todo}
  40441. * @usage
  40442. */
  40443. var GetFeaturesByBoundsService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  40444. GetFeaturesByBoundsService_inherits(GetFeaturesByBoundsService, _GetFeaturesServiceBa);
  40445. var _super = GetFeaturesByBoundsService_createSuper(GetFeaturesByBoundsService);
  40446. function GetFeaturesByBoundsService(url, options) {
  40447. var _this;
  40448. GetFeaturesByBoundsService_classCallCheck(this, GetFeaturesByBoundsService);
  40449. _this = _super.call(this, url, options);
  40450. _this.CLASS_NAME = "SuperMap.GetFeaturesByBoundsService";
  40451. return _this;
  40452. }
  40453. /**
  40454. * @function GetFeaturesByBoundsService.prototype.destroy
  40455. * @override
  40456. */
  40457. GetFeaturesByBoundsService_createClass(GetFeaturesByBoundsService, [{
  40458. key: "destroy",
  40459. value: function destroy() {
  40460. GetFeaturesByBoundsService_get(GetFeaturesByBoundsService_getPrototypeOf(GetFeaturesByBoundsService.prototype), "destroy", this).call(this);
  40461. }
  40462. /**
  40463. * @function GetFeaturesByBoundsService.prototype.getJsonParameters
  40464. * @description 将查询参数转化为 JSON 字符串。在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry,Bounds等)。
  40465. * @param params {GetFeaturesByBoundsParameters}
  40466. * @returns {string} 转化后的 JSON 字符串。
  40467. *
  40468. */
  40469. }, {
  40470. key: "getJsonParameters",
  40471. value: function getJsonParameters(params) {
  40472. return GetFeaturesByBoundsParameters.toJsonParameters(params);
  40473. }
  40474. }]);
  40475. return GetFeaturesByBoundsService;
  40476. }(GetFeaturesServiceBase);
  40477. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBufferParameters.js
  40478. function GetFeaturesByBufferParameters_typeof(obj) { "@babel/helpers - typeof"; return GetFeaturesByBufferParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFeaturesByBufferParameters_typeof(obj); }
  40479. function GetFeaturesByBufferParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40480. function GetFeaturesByBufferParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  40481. function GetFeaturesByBufferParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBufferParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBufferParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  40482. function GetFeaturesByBufferParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByBufferParameters_get = Reflect.get.bind(); } else { GetFeaturesByBufferParameters_get = function _get(target, property, receiver) { var base = GetFeaturesByBufferParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFeaturesByBufferParameters_get.apply(this, arguments); }
  40483. function GetFeaturesByBufferParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBufferParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  40484. function GetFeaturesByBufferParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFeaturesByBufferParameters_setPrototypeOf(subClass, superClass); }
  40485. function GetFeaturesByBufferParameters_setPrototypeOf(o, p) { GetFeaturesByBufferParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBufferParameters_setPrototypeOf(o, p); }
  40486. function GetFeaturesByBufferParameters_createSuper(Derived) { var hasNativeReflectConstruct = GetFeaturesByBufferParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFeaturesByBufferParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFeaturesByBufferParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFeaturesByBufferParameters_possibleConstructorReturn(this, result); }; }
  40487. function GetFeaturesByBufferParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBufferParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFeaturesByBufferParameters_assertThisInitialized(self); }
  40488. function GetFeaturesByBufferParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  40489. function GetFeaturesByBufferParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  40490. function GetFeaturesByBufferParameters_getPrototypeOf(o) { GetFeaturesByBufferParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBufferParameters_getPrototypeOf(o); }
  40491. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40492. * This program are made available under the terms of the Apache License, Version 2.0
  40493. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40494. /**
  40495. * @class GetFeaturesByBufferParameters
  40496. * @deprecatedclass SuperMap.GetFeaturesByBufferParameters
  40497. * @category iServer Data FeatureResults
  40498. * @classdesc 数据集缓冲区查询参数类。
  40499. * @param {Object} options - 参数。
  40500. * @param {number} options.bufferDistance - buffer 距离,单位与所查询图层对应的数据集单位相同。
  40501. * @param {GeoJSONObject} options.geometry - 空间查询条件。
  40502. * @param {Array.<string>} options.dataSetNames - 数据集集合中的数据集名称列表。
  40503. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  40504. * @param {string} [options.attributeFilter] - 属性查询条件。
  40505. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  40506. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  40507. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  40508. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  40509. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  40510. * @extends {GetFeaturesParametersBase}
  40511. * @usage
  40512. */
  40513. var GetFeaturesByBufferParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  40514. GetFeaturesByBufferParameters_inherits(GetFeaturesByBufferParameters, _GetFeaturesParameter);
  40515. var _super = GetFeaturesByBufferParameters_createSuper(GetFeaturesByBufferParameters);
  40516. function GetFeaturesByBufferParameters(options) {
  40517. var _this;
  40518. GetFeaturesByBufferParameters_classCallCheck(this, GetFeaturesByBufferParameters);
  40519. _this = _super.call(this, options);
  40520. /**
  40521. * @member {number} GetFeaturesByBufferParameters.prototype.bufferDistance
  40522. * @description buffer 距离,单位与所查询图层对应的数据集单位相同。
  40523. */
  40524. _this.bufferDistance = null;
  40525. /**
  40526. * @member {string} GetFeaturesByBufferParameters.prototype.attributeFilter
  40527. * @description 属性查询条件。
  40528. */
  40529. _this.attributeFilter = null;
  40530. /**
  40531. * @member {GeoJSONObject} GetFeaturesByBufferParameters.prototype.geometry
  40532. * @description 空间查询条件。<br>
  40533. * 点类型可以是:{@link GeometryPoint}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}|{@link mapboxgl.LngLat}|{@link mapboxgl.Point}|{@link GeoJSONObject}。</br>
  40534. * 线类型可以是:{@link GeometryLineString}|{@link GeometryLinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}|{@link GeoJSONObject}。</br>
  40535. * 面类型可以是:{@link GeometryPolygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}|{@link mapboxgl.LngLatBounds}|{@link GeoJSONObject}。
  40536. */
  40537. _this.geometry = null;
  40538. /**
  40539. * @member {Array.<string>} GetFeaturesByBufferParameters.prototype.fields
  40540. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  40541. */
  40542. _this.fields = null;
  40543. Util_Util.extend(GetFeaturesByBufferParameters_assertThisInitialized(_this), options);
  40544. _this.CLASS_NAME = 'SuperMap.GetFeaturesByBufferParameters';
  40545. return _this;
  40546. }
  40547. /**
  40548. * @function GetFeaturesByBufferParameters.prototype.destroy
  40549. * @override
  40550. */
  40551. GetFeaturesByBufferParameters_createClass(GetFeaturesByBufferParameters, [{
  40552. key: "destroy",
  40553. value: function destroy() {
  40554. GetFeaturesByBufferParameters_get(GetFeaturesByBufferParameters_getPrototypeOf(GetFeaturesByBufferParameters.prototype), "destroy", this).call(this);
  40555. var me = this;
  40556. me.bufferDistance = null;
  40557. me.attributeFilter = null;
  40558. if (me.fields) {
  40559. while (me.fields.length > 0) {
  40560. me.fields.pop();
  40561. }
  40562. me.fields = null;
  40563. }
  40564. if (me.geometry) {
  40565. me.geometry.destroy();
  40566. me.geometry = null;
  40567. }
  40568. }
  40569. /**
  40570. * @function GetFeaturesByBufferParameters.toJsonParameters
  40571. * @description 将 GetFeaturesByBufferParameters 对象转换为 JSON 字符串。
  40572. * @param {GetFeaturesByBufferParameters} params - 数据集缓冲区查询参数对象。
  40573. * @returns {string} 转化后的 JSON 字符串。
  40574. */
  40575. }], [{
  40576. key: "toJsonParameters",
  40577. value: function toJsonParameters(params) {
  40578. var filterParameter, paramsByBuffer, geometry;
  40579. geometry = ServerGeometry.fromGeometry(params.geometry);
  40580. paramsByBuffer = {
  40581. datasetNames: params.datasetNames,
  40582. getFeatureMode: 'BUFFER',
  40583. bufferDistance: params.bufferDistance,
  40584. geometry: geometry
  40585. };
  40586. if (params.fields) {
  40587. filterParameter = new FilterParameter();
  40588. filterParameter.name = params.datasetNames;
  40589. filterParameter.fields = params.fields;
  40590. paramsByBuffer.queryParameter = filterParameter;
  40591. }
  40592. if (params.attributeFilter) {
  40593. paramsByBuffer.attributeFilter = params.attributeFilter;
  40594. paramsByBuffer.getFeatureMode = 'BUFFER_ATTRIBUTEFILTER';
  40595. }
  40596. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  40597. paramsByBuffer.maxFeatures = params.maxFeatures;
  40598. }
  40599. if (typeof params.hasGeometry === 'boolean') {
  40600. paramsByBuffer.hasGeometry = params.hasGeometry;
  40601. }
  40602. if (params.targetEpsgCode) {
  40603. paramsByBuffer.targetEpsgCode = params.targetEpsgCode;
  40604. }
  40605. if (!params.targetEpsgCode && params.targetPrj) {
  40606. paramsByBuffer.targetPrj = params.targetPrj;
  40607. }
  40608. return Util_Util.toJSON(paramsByBuffer);
  40609. }
  40610. }]);
  40611. return GetFeaturesByBufferParameters;
  40612. }(GetFeaturesParametersBase);
  40613. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBufferService.js
  40614. function GetFeaturesByBufferService_typeof(obj) { "@babel/helpers - typeof"; return GetFeaturesByBufferService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFeaturesByBufferService_typeof(obj); }
  40615. function GetFeaturesByBufferService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40616. function GetFeaturesByBufferService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  40617. function GetFeaturesByBufferService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBufferService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBufferService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  40618. function GetFeaturesByBufferService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByBufferService_get = Reflect.get.bind(); } else { GetFeaturesByBufferService_get = function _get(target, property, receiver) { var base = GetFeaturesByBufferService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFeaturesByBufferService_get.apply(this, arguments); }
  40619. function GetFeaturesByBufferService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBufferService_getPrototypeOf(object); if (object === null) break; } return object; }
  40620. function GetFeaturesByBufferService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFeaturesByBufferService_setPrototypeOf(subClass, superClass); }
  40621. function GetFeaturesByBufferService_setPrototypeOf(o, p) { GetFeaturesByBufferService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBufferService_setPrototypeOf(o, p); }
  40622. function GetFeaturesByBufferService_createSuper(Derived) { var hasNativeReflectConstruct = GetFeaturesByBufferService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFeaturesByBufferService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFeaturesByBufferService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFeaturesByBufferService_possibleConstructorReturn(this, result); }; }
  40623. function GetFeaturesByBufferService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBufferService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFeaturesByBufferService_assertThisInitialized(self); }
  40624. function GetFeaturesByBufferService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  40625. function GetFeaturesByBufferService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  40626. function GetFeaturesByBufferService_getPrototypeOf(o) { GetFeaturesByBufferService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBufferService_getPrototypeOf(o); }
  40627. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40628. * This program are made available under the terms of the Apache License, Version 2.0
  40629. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40630. /**
  40631. * @class GetFeaturesByBufferService
  40632. * @deprecatedclass SuperMap.GetFeaturesByBufferService
  40633. * @category iServer Data FeatureResults
  40634. * @classdesc 数据服务中数据集缓冲区查询服务类。
  40635. * @param {string} url - 服务地址。请求数据服务中数据集查询服务,
  40636. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;
  40637. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  40638. * @param {Object} options - 参数。
  40639. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  40640. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  40641. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  40642. * @param {Object} [options.headers] - 请求头。
  40643. * @extends {GetFeaturesServiceBase}
  40644. * @example
  40645. * var myGetFeaturesByBufferService = new GetFeaturesByBufferService(url, {
  40646. * eventListeners: {
  40647. * "processCompleted": GetFeaturesCompleted,
  40648. * "processFailed": GetFeaturesError
  40649. * }
  40650. * });
  40651. * function GetFeaturesCompleted(object){//todo};
  40652. * function GetFeaturesError(object){//todo};
  40653. * @usage
  40654. */
  40655. var GetFeaturesByBufferService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  40656. GetFeaturesByBufferService_inherits(GetFeaturesByBufferService, _GetFeaturesServiceBa);
  40657. var _super = GetFeaturesByBufferService_createSuper(GetFeaturesByBufferService);
  40658. function GetFeaturesByBufferService(url, options) {
  40659. var _this;
  40660. GetFeaturesByBufferService_classCallCheck(this, GetFeaturesByBufferService);
  40661. _this = _super.call(this, url, options);
  40662. _this.CLASS_NAME = "SuperMap.GetFeaturesByBufferService";
  40663. return _this;
  40664. }
  40665. /**
  40666. * @function GetFeaturesByBufferService.prototype.destroy
  40667. * @override
  40668. */
  40669. GetFeaturesByBufferService_createClass(GetFeaturesByBufferService, [{
  40670. key: "destroy",
  40671. value: function destroy() {
  40672. GetFeaturesByBufferService_get(GetFeaturesByBufferService_getPrototypeOf(GetFeaturesByBufferService.prototype), "destroy", this).call(this);
  40673. }
  40674. /**
  40675. * @function GetFeaturesByBufferService.prototype.getJsonParameters
  40676. * @description 将查询参数转化为 JSON 字符串。在本类中重写此方法,可以实现不同种类的查询(IDs, SQL, Buffer, Geometry等)。
  40677. * @param {GetFeaturesByBufferParameters} params - 数据集缓冲区查询参数类。
  40678. * @returns {Object} 转化后的 JSON 字符串。
  40679. */
  40680. }, {
  40681. key: "getJsonParameters",
  40682. value: function getJsonParameters(params) {
  40683. if (!(params instanceof GetFeaturesByBufferParameters)) {
  40684. return;
  40685. }
  40686. return GetFeaturesByBufferParameters.toJsonParameters(params);
  40687. }
  40688. }]);
  40689. return GetFeaturesByBufferService;
  40690. }(GetFeaturesServiceBase);
  40691. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByGeometryParameters.js
  40692. function GetFeaturesByGeometryParameters_typeof(obj) { "@babel/helpers - typeof"; return GetFeaturesByGeometryParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFeaturesByGeometryParameters_typeof(obj); }
  40693. function GetFeaturesByGeometryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40694. function GetFeaturesByGeometryParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  40695. function GetFeaturesByGeometryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByGeometryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByGeometryParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  40696. function GetFeaturesByGeometryParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByGeometryParameters_get = Reflect.get.bind(); } else { GetFeaturesByGeometryParameters_get = function _get(target, property, receiver) { var base = GetFeaturesByGeometryParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFeaturesByGeometryParameters_get.apply(this, arguments); }
  40697. function GetFeaturesByGeometryParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByGeometryParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  40698. function GetFeaturesByGeometryParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFeaturesByGeometryParameters_setPrototypeOf(subClass, superClass); }
  40699. function GetFeaturesByGeometryParameters_setPrototypeOf(o, p) { GetFeaturesByGeometryParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByGeometryParameters_setPrototypeOf(o, p); }
  40700. function GetFeaturesByGeometryParameters_createSuper(Derived) { var hasNativeReflectConstruct = GetFeaturesByGeometryParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFeaturesByGeometryParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFeaturesByGeometryParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFeaturesByGeometryParameters_possibleConstructorReturn(this, result); }; }
  40701. function GetFeaturesByGeometryParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByGeometryParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFeaturesByGeometryParameters_assertThisInitialized(self); }
  40702. function GetFeaturesByGeometryParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  40703. function GetFeaturesByGeometryParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  40704. function GetFeaturesByGeometryParameters_getPrototypeOf(o) { GetFeaturesByGeometryParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByGeometryParameters_getPrototypeOf(o); }
  40705. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40706. * This program are made available under the terms of the Apache License, Version 2.0
  40707. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40708. /**
  40709. * @class GetFeaturesByGeometryParameters
  40710. * @deprecatedclass SuperMap.GetFeaturesByGeometryParameters
  40711. * @category iServer Data FeatureResults
  40712. * @classdesc 数据集几何查询参数类。该类用于设置数据集几何查询的相关参数。
  40713. * @param {Object} options - 参数。
  40714. * @param {GeoJSONObject} options.geometry - 查询的几何对象。
  40715. * @param {Array.<string>} options.datasetNames - 数据集集合中的数据集名称列表。
  40716. * @param {string} [options.attributeFilter] - 几何查询属性过滤条件。
  40717. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  40718. * @param {SpatialQueryMode} [options.spatialQueryMode=SpatialQueryMode.CONTAIN] - 空间查询模式常量。
  40719. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  40720. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  40721. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  40722. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  40723. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  40724. * @param {MetricsAggParameter|GeoHashGridAggParameter} [options.aggregations] - 聚合查询参数。该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  40725. * @extends {GetFeaturesParametersBase}
  40726. * @usage
  40727. */
  40728. var GetFeaturesByGeometryParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  40729. GetFeaturesByGeometryParameters_inherits(GetFeaturesByGeometryParameters, _GetFeaturesParameter);
  40730. var _super = GetFeaturesByGeometryParameters_createSuper(GetFeaturesByGeometryParameters);
  40731. function GetFeaturesByGeometryParameters(options) {
  40732. var _this;
  40733. GetFeaturesByGeometryParameters_classCallCheck(this, GetFeaturesByGeometryParameters);
  40734. _this = _super.call(this, options);
  40735. /**
  40736. * @member {string} GetFeaturesByGeometryParameters.prototype.getFeatureMode
  40737. * @description 数据集查询模式。几何查询有 "SPATIAL","SPATIAL_ATTRIBUTEFILTER" 两种,当用户设置 attributeFilter 时会自动切换到 SPATIAL_ATTRIBUTEFILTER 访问服务。
  40738. */
  40739. _this.getFeatureMode = 'SPATIAL';
  40740. /**
  40741. * @member {GeoJSONObject} GetFeaturesByGeometryParameters.prototype.geometry
  40742. * @description 用于查询的几何对象。 </br>
  40743. * 点类型可以是:{@link GeometryPoint}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}|{@link mapboxgl.LngLat}|{@link mapboxgl.Point}|{@link GeoJSONObject}。</br>
  40744. * 线类型可以是:{@link GeometryLineString}|{@link GeometryLinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}|{@link GeoJSONObject}。</br>
  40745. * 面类型可以是:{@link GeometryPolygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}|{@link mapboxgl.LngLatBounds}|{@link GeoJSONObject}。
  40746. */
  40747. _this.geometry = null;
  40748. /**
  40749. * @member {Array.<string>} GetFeaturesByGeometryParameters.prototype.fields
  40750. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  40751. */
  40752. _this.fields = null;
  40753. /**
  40754. * @member {string} GetFeaturesByGeometryParameters.prototype.attributeFilter
  40755. * @description 几何查询属性过滤条件。
  40756. */
  40757. _this.attributeFilter = null;
  40758. /**
  40759. * @member {SpatialQueryMode} [GetFeaturesByGeometryParameters.prototype.spatialQueryMode=SpatialQueryMode.CONTAIN]
  40760. * @description 空间查询模式常量。
  40761. */
  40762. _this.spatialQueryMode = SpatialQueryMode.CONTAIN;
  40763. Util_Util.extend(GetFeaturesByGeometryParameters_assertThisInitialized(_this), options);
  40764. _this.CLASS_NAME = 'SuperMap.GetFeaturesByGeometryParameters';
  40765. return _this;
  40766. }
  40767. /**
  40768. * @function GetFeaturesByGeometryParameters.prototype.destroy
  40769. * @description 释放资源,将引用资源的属性置空。
  40770. */
  40771. GetFeaturesByGeometryParameters_createClass(GetFeaturesByGeometryParameters, [{
  40772. key: "destroy",
  40773. value: function destroy() {
  40774. GetFeaturesByGeometryParameters_get(GetFeaturesByGeometryParameters_getPrototypeOf(GetFeaturesByGeometryParameters.prototype), "destroy", this).call(this);
  40775. var me = this;
  40776. if (me.geometry) {
  40777. me.geometry.destroy();
  40778. me.geometry = null;
  40779. }
  40780. if (me.fields) {
  40781. while (me.fields.length > 0) {
  40782. me.fields.pop();
  40783. }
  40784. me.fields = null;
  40785. }
  40786. me.attributeFilter = null;
  40787. me.spatialQueryMode = null;
  40788. me.getFeatureMode = null;
  40789. }
  40790. /**
  40791. * @function GetFeaturesByGeometryParameters.toJsonParameters
  40792. * @description 将 GetFeaturesByGeometryParameters 对象参数转换为 JSON 字符串。
  40793. * @param {GetFeaturesByGeometryParameters} params - 查询参数对象。
  40794. * @returns {string} 转化后的 JSON 字符串。
  40795. */
  40796. }], [{
  40797. key: "toJsonParameters",
  40798. value: function toJsonParameters(params) {
  40799. var filterParameter, geometry, parasByGeometry;
  40800. geometry = ServerGeometry.fromGeometry(params.geometry);
  40801. parasByGeometry = {
  40802. datasetNames: params.datasetNames,
  40803. getFeatureMode: 'SPATIAL',
  40804. geometry: geometry,
  40805. spatialQueryMode: params.spatialQueryMode
  40806. };
  40807. if (params.fields) {
  40808. filterParameter = new FilterParameter();
  40809. filterParameter.name = params.datasetNames;
  40810. filterParameter.fields = params.fields;
  40811. parasByGeometry.queryParameter = filterParameter;
  40812. }
  40813. if (params.attributeFilter) {
  40814. parasByGeometry.attributeFilter = params.attributeFilter;
  40815. parasByGeometry.getFeatureMode = 'SPATIAL_ATTRIBUTEFILTER';
  40816. }
  40817. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  40818. parasByGeometry.maxFeatures = params.maxFeatures;
  40819. }
  40820. if (typeof params.hasGeometry === 'boolean') {
  40821. parasByGeometry.hasGeometry = params.hasGeometry;
  40822. }
  40823. if (params.targetEpsgCode) {
  40824. parasByGeometry.targetEpsgCode = params.targetEpsgCode;
  40825. }
  40826. if (!params.targetEpsgCode && params.targetPrj) {
  40827. parasByGeometry.targetPrj = params.targetPrj;
  40828. }
  40829. if (params.aggregations) {
  40830. parasByGeometry.aggregations = params.aggregations;
  40831. }
  40832. return Util_Util.toJSON(parasByGeometry);
  40833. }
  40834. }]);
  40835. return GetFeaturesByGeometryParameters;
  40836. }(GetFeaturesParametersBase);
  40837. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByGeometryService.js
  40838. function GetFeaturesByGeometryService_typeof(obj) { "@babel/helpers - typeof"; return GetFeaturesByGeometryService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFeaturesByGeometryService_typeof(obj); }
  40839. function GetFeaturesByGeometryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40840. function GetFeaturesByGeometryService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  40841. function GetFeaturesByGeometryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByGeometryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByGeometryService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  40842. function GetFeaturesByGeometryService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByGeometryService_get = Reflect.get.bind(); } else { GetFeaturesByGeometryService_get = function _get(target, property, receiver) { var base = GetFeaturesByGeometryService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFeaturesByGeometryService_get.apply(this, arguments); }
  40843. function GetFeaturesByGeometryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByGeometryService_getPrototypeOf(object); if (object === null) break; } return object; }
  40844. function GetFeaturesByGeometryService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFeaturesByGeometryService_setPrototypeOf(subClass, superClass); }
  40845. function GetFeaturesByGeometryService_setPrototypeOf(o, p) { GetFeaturesByGeometryService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByGeometryService_setPrototypeOf(o, p); }
  40846. function GetFeaturesByGeometryService_createSuper(Derived) { var hasNativeReflectConstruct = GetFeaturesByGeometryService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFeaturesByGeometryService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFeaturesByGeometryService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFeaturesByGeometryService_possibleConstructorReturn(this, result); }; }
  40847. function GetFeaturesByGeometryService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByGeometryService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFeaturesByGeometryService_assertThisInitialized(self); }
  40848. function GetFeaturesByGeometryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  40849. function GetFeaturesByGeometryService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  40850. function GetFeaturesByGeometryService_getPrototypeOf(o) { GetFeaturesByGeometryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByGeometryService_getPrototypeOf(o); }
  40851. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40852. * This program are made available under the terms of the Apache License, Version 2.0
  40853. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40854. /**
  40855. * @class GetFeaturesByGeometryService
  40856. * @deprecatedclass SuperMap.GetFeaturesByGeometryService
  40857. * @category iServer Data FeatureResults
  40858. * @classdesc 数据集几何查询服务类,查询与指定几何对象符合一定空间关系的矢量要素。
  40859. * @param {string} url - 服务地址。请求数据服务中数据集查询服务。
  40860. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data;
  40861. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data"
  40862. * @param {Object} options - 参数。
  40863. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  40864. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  40865. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  40866. * @param {Object} [options.headers] - 请求头。
  40867. * @extends {GetFeaturesServiceBase}
  40868. * @example
  40869. * var myService = new GetFeaturesByGeometryService(url, {
  40870. * eventListeners: {
  40871. * "processCompleted": getFeatureCompleted,
  40872. * "processFailed": getFeatureError
  40873. * }
  40874. * });
  40875. * function getFeatureCompleted(object){//todo};
  40876. * function getFeatureError(object){//todo}
  40877. * @usage
  40878. */
  40879. var GetFeaturesByGeometryService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  40880. GetFeaturesByGeometryService_inherits(GetFeaturesByGeometryService, _GetFeaturesServiceBa);
  40881. var _super = GetFeaturesByGeometryService_createSuper(GetFeaturesByGeometryService);
  40882. function GetFeaturesByGeometryService(url, options) {
  40883. var _this;
  40884. GetFeaturesByGeometryService_classCallCheck(this, GetFeaturesByGeometryService);
  40885. _this = _super.call(this, url, options);
  40886. _this.CLASS_NAME = "SuperMap.GetFeaturesByGeometryService";
  40887. return _this;
  40888. }
  40889. /**
  40890. * @function GetFeaturesByGeometryService.prototype.destroy
  40891. * @override
  40892. */
  40893. GetFeaturesByGeometryService_createClass(GetFeaturesByGeometryService, [{
  40894. key: "destroy",
  40895. value: function destroy() {
  40896. GetFeaturesByGeometryService_get(GetFeaturesByGeometryService_getPrototypeOf(GetFeaturesByGeometryService.prototype), "destroy", this).call(this);
  40897. }
  40898. /**
  40899. * @function GetFeaturesByGeometryService.prototype.getJsonParameters
  40900. * @param {GetFeaturesByGeometryParameters} params - 数据集几何查询参数类。
  40901. * @description 将查询参数转化为 JSON 字符串。
  40902. * 在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry等)。
  40903. * @returns {Object} 转化后的 JSON 字符串。
  40904. */
  40905. }, {
  40906. key: "getJsonParameters",
  40907. value: function getJsonParameters(params) {
  40908. return GetFeaturesByGeometryParameters.toJsonParameters(params);
  40909. }
  40910. }]);
  40911. return GetFeaturesByGeometryService;
  40912. }(GetFeaturesServiceBase);
  40913. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByIDsParameters.js
  40914. function GetFeaturesByIDsParameters_typeof(obj) { "@babel/helpers - typeof"; return GetFeaturesByIDsParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFeaturesByIDsParameters_typeof(obj); }
  40915. function GetFeaturesByIDsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40916. function GetFeaturesByIDsParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  40917. function GetFeaturesByIDsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByIDsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByIDsParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  40918. function GetFeaturesByIDsParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByIDsParameters_get = Reflect.get.bind(); } else { GetFeaturesByIDsParameters_get = function _get(target, property, receiver) { var base = GetFeaturesByIDsParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFeaturesByIDsParameters_get.apply(this, arguments); }
  40919. function GetFeaturesByIDsParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByIDsParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  40920. function GetFeaturesByIDsParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFeaturesByIDsParameters_setPrototypeOf(subClass, superClass); }
  40921. function GetFeaturesByIDsParameters_setPrototypeOf(o, p) { GetFeaturesByIDsParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByIDsParameters_setPrototypeOf(o, p); }
  40922. function GetFeaturesByIDsParameters_createSuper(Derived) { var hasNativeReflectConstruct = GetFeaturesByIDsParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFeaturesByIDsParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFeaturesByIDsParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFeaturesByIDsParameters_possibleConstructorReturn(this, result); }; }
  40923. function GetFeaturesByIDsParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByIDsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFeaturesByIDsParameters_assertThisInitialized(self); }
  40924. function GetFeaturesByIDsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  40925. function GetFeaturesByIDsParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  40926. function GetFeaturesByIDsParameters_getPrototypeOf(o) { GetFeaturesByIDsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByIDsParameters_getPrototypeOf(o); }
  40927. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40928. * This program are made available under the terms of the Apache License, Version 2.0
  40929. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40930. /**
  40931. * @class GetFeaturesByIDsParameters
  40932. * @deprecatedclass SuperMap.GetFeaturesByIDsParameters
  40933. * @category iServer Data FeatureResults
  40934. * @classdesc ID 查询参数类。
  40935. * @param {Object} options - 参数。
  40936. * @param {Array.<number>} options.IDs - 指定查询的元素 ID 信息。
  40937. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  40938. * @param {Array.<string>} options.dataSetNames - 数据集集合中的数据集名称列表。
  40939. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  40940. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  40941. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  40942. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  40943. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  40944. * @param {MetricsAggParameter|GeoHashGridAggParameter} [options.aggregations] - 聚合查询参数。该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  40945. * @extends {GetFeaturesParametersBase}
  40946. * @usage
  40947. */
  40948. var GetFeaturesByIDsParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  40949. GetFeaturesByIDsParameters_inherits(GetFeaturesByIDsParameters, _GetFeaturesParameter);
  40950. var _super = GetFeaturesByIDsParameters_createSuper(GetFeaturesByIDsParameters);
  40951. function GetFeaturesByIDsParameters(options) {
  40952. var _this;
  40953. GetFeaturesByIDsParameters_classCallCheck(this, GetFeaturesByIDsParameters);
  40954. _this = _super.call(this, options);
  40955. /**
  40956. * @member {string} GetFeaturesByIDsParameters.prototype.getFeatureMode
  40957. * @description 数据集查询模式。
  40958. */
  40959. _this.getFeatureMode = 'ID';
  40960. /**
  40961. * @member {Array.<number>} GetFeaturesByIDsParameters.prototype.IDs
  40962. * @description 所要查询指定的元素 ID 信息。
  40963. */
  40964. _this.IDs = null;
  40965. /**
  40966. * @member {Array.<string>} GetFeaturesByIDsParameters.prototype.fields
  40967. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  40968. */
  40969. _this.fields = null;
  40970. Util_Util.extend(GetFeaturesByIDsParameters_assertThisInitialized(_this), options);
  40971. _this.CLASS_NAME = 'SuperMap.GetFeaturesByIDsParameters';
  40972. return _this;
  40973. }
  40974. /**
  40975. * @function GetFeaturesByIDsParameters.prototype.destroy
  40976. * @override
  40977. */
  40978. GetFeaturesByIDsParameters_createClass(GetFeaturesByIDsParameters, [{
  40979. key: "destroy",
  40980. value: function destroy() {
  40981. GetFeaturesByIDsParameters_get(GetFeaturesByIDsParameters_getPrototypeOf(GetFeaturesByIDsParameters.prototype), "destroy", this).call(this);
  40982. var me = this;
  40983. me.IDs = null;
  40984. me.getFeatureMode = null;
  40985. if (me.fields) {
  40986. while (me.fields.length > 0) {
  40987. me.fields.pop();
  40988. }
  40989. me.fields = null;
  40990. }
  40991. }
  40992. /**
  40993. * @function GetFeaturesByIDsParameters.toJsonParameters
  40994. * @description 将 GetFeaturesByIDsParameters 对象转换为 JSON 字符串。
  40995. * @param {GetFeaturesByIDsParameters} params - ID 查询参数对象。
  40996. * @returns {string} 转化后的 JSON 字符串。
  40997. */
  40998. }], [{
  40999. key: "toJsonParameters",
  41000. value: function toJsonParameters(params) {
  41001. var parasByIDs, filterParameter;
  41002. parasByIDs = {
  41003. datasetNames: params.datasetNames,
  41004. getFeatureMode: 'ID',
  41005. ids: params.IDs
  41006. };
  41007. if (params.fields) {
  41008. filterParameter = new FilterParameter();
  41009. filterParameter.name = params.datasetNames;
  41010. filterParameter.fields = params.fields;
  41011. parasByIDs.queryParameter = filterParameter;
  41012. }
  41013. if (params.targetEpsgCode) {
  41014. parasByIDs.targetEpsgCode = params.targetEpsgCode;
  41015. }
  41016. if (typeof params.hasGeometry === 'boolean') {
  41017. parasByIDs.hasGeometry = params.hasGeometry;
  41018. }
  41019. if (!params.targetEpsgCode && params.targetPrj) {
  41020. parasByIDs.targetPrj = params.targetPrj;
  41021. }
  41022. if (params.aggregations) {
  41023. parasByIDs.aggregations = params.aggregations;
  41024. }
  41025. return Util_Util.toJSON(parasByIDs);
  41026. }
  41027. }]);
  41028. return GetFeaturesByIDsParameters;
  41029. }(GetFeaturesParametersBase);
  41030. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByIDsService.js
  41031. function GetFeaturesByIDsService_typeof(obj) { "@babel/helpers - typeof"; return GetFeaturesByIDsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFeaturesByIDsService_typeof(obj); }
  41032. function GetFeaturesByIDsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41033. function GetFeaturesByIDsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  41034. function GetFeaturesByIDsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByIDsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByIDsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  41035. function GetFeaturesByIDsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByIDsService_get = Reflect.get.bind(); } else { GetFeaturesByIDsService_get = function _get(target, property, receiver) { var base = GetFeaturesByIDsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFeaturesByIDsService_get.apply(this, arguments); }
  41036. function GetFeaturesByIDsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByIDsService_getPrototypeOf(object); if (object === null) break; } return object; }
  41037. function GetFeaturesByIDsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFeaturesByIDsService_setPrototypeOf(subClass, superClass); }
  41038. function GetFeaturesByIDsService_setPrototypeOf(o, p) { GetFeaturesByIDsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByIDsService_setPrototypeOf(o, p); }
  41039. function GetFeaturesByIDsService_createSuper(Derived) { var hasNativeReflectConstruct = GetFeaturesByIDsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFeaturesByIDsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFeaturesByIDsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFeaturesByIDsService_possibleConstructorReturn(this, result); }; }
  41040. function GetFeaturesByIDsService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByIDsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFeaturesByIDsService_assertThisInitialized(self); }
  41041. function GetFeaturesByIDsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  41042. function GetFeaturesByIDsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  41043. function GetFeaturesByIDsService_getPrototypeOf(o) { GetFeaturesByIDsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByIDsService_getPrototypeOf(o); }
  41044. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41045. * This program are made available under the terms of the Apache License, Version 2.0
  41046. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41047. /**
  41048. * @class GetFeaturesByIDsService
  41049. * @deprecatedclass SuperMap.GetFeaturesByIDsService
  41050. * @category iServer Data FeatureResults
  41051. * @classdesc 数据集ID查询服务类。在数据集集合中查找指定 ID 号对应的空间地物要素。
  41052. * @param {string} url - 服务地址。请求数据服务中数据集查询服务。
  41053. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;</br>
  41054. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  41055. * @param {Object} options - 参数。
  41056. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  41057. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  41058. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  41059. * @param {Object} [options.headers] - 请求头。
  41060. * @extends {GetFeaturesServiceBase}
  41061. * @example
  41062. * var myGetFeaturesByIDsService = new GetFeaturesByIDsService(url, {
  41063. * eventListeners: {
  41064. * "processCompleted": getFeatureCompleted,
  41065. * "processFailed": getFeatureError
  41066. * }
  41067. * });
  41068. * function getFeatureCompleted(object){//todo};
  41069. * function getFeatureError(object){//todo}
  41070. * @usage
  41071. */
  41072. var GetFeaturesByIDsService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  41073. GetFeaturesByIDsService_inherits(GetFeaturesByIDsService, _GetFeaturesServiceBa);
  41074. var _super = GetFeaturesByIDsService_createSuper(GetFeaturesByIDsService);
  41075. function GetFeaturesByIDsService(url, options) {
  41076. var _this;
  41077. GetFeaturesByIDsService_classCallCheck(this, GetFeaturesByIDsService);
  41078. _this = _super.call(this, url, options);
  41079. _this.CLASS_NAME = "SuperMap.GetFeaturesByIDsService";
  41080. return _this;
  41081. }
  41082. /**
  41083. * @function GetFeaturesByIDsService.prototype.destroy
  41084. * @override
  41085. */
  41086. GetFeaturesByIDsService_createClass(GetFeaturesByIDsService, [{
  41087. key: "destroy",
  41088. value: function destroy() {
  41089. GetFeaturesByIDsService_get(GetFeaturesByIDsService_getPrototypeOf(GetFeaturesByIDsService.prototype), "destroy", this).call(this);
  41090. }
  41091. /**
  41092. * @function GetFeaturesByIDsService.prototype.getJsonParameters
  41093. * @description 将查询参数转化为 JSON 字符串。
  41094. * 在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry等)。
  41095. * @param {GetFeaturesByIDsParameters} params - ID查询参数类。
  41096. * @returns {string} 转化后的 JSON 字符串。
  41097. */
  41098. }, {
  41099. key: "getJsonParameters",
  41100. value: function getJsonParameters(params) {
  41101. return GetFeaturesByIDsParameters.toJsonParameters(params);
  41102. }
  41103. }]);
  41104. return GetFeaturesByIDsService;
  41105. }(GetFeaturesServiceBase);
  41106. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesBySQLParameters.js
  41107. function GetFeaturesBySQLParameters_typeof(obj) { "@babel/helpers - typeof"; return GetFeaturesBySQLParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFeaturesBySQLParameters_typeof(obj); }
  41108. function GetFeaturesBySQLParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41109. function GetFeaturesBySQLParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  41110. function GetFeaturesBySQLParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesBySQLParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesBySQLParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  41111. function GetFeaturesBySQLParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesBySQLParameters_get = Reflect.get.bind(); } else { GetFeaturesBySQLParameters_get = function _get(target, property, receiver) { var base = GetFeaturesBySQLParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFeaturesBySQLParameters_get.apply(this, arguments); }
  41112. function GetFeaturesBySQLParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesBySQLParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  41113. function GetFeaturesBySQLParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFeaturesBySQLParameters_setPrototypeOf(subClass, superClass); }
  41114. function GetFeaturesBySQLParameters_setPrototypeOf(o, p) { GetFeaturesBySQLParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesBySQLParameters_setPrototypeOf(o, p); }
  41115. function GetFeaturesBySQLParameters_createSuper(Derived) { var hasNativeReflectConstruct = GetFeaturesBySQLParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFeaturesBySQLParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFeaturesBySQLParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFeaturesBySQLParameters_possibleConstructorReturn(this, result); }; }
  41116. function GetFeaturesBySQLParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesBySQLParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFeaturesBySQLParameters_assertThisInitialized(self); }
  41117. function GetFeaturesBySQLParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  41118. function GetFeaturesBySQLParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  41119. function GetFeaturesBySQLParameters_getPrototypeOf(o) { GetFeaturesBySQLParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesBySQLParameters_getPrototypeOf(o); }
  41120. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41121. * This program are made available under the terms of the Apache License, Version 2.0
  41122. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41123. /**
  41124. * @class GetFeaturesBySQLParameters
  41125. * @deprecatedclass SuperMap.GetFeaturesBySQLParameters
  41126. * @category iServer Data FeatureResults
  41127. * @classdesc 数据集 SQL 查询参数类。
  41128. * @param {Object} options - 参数。
  41129. * @param {FilterParameter} options.queryParameter - 查询过滤条件参数。
  41130. * @param {Array.<string>} options.datasetNames - 数据集集合中的数据集名称列表。
  41131. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  41132. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  41133. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  41134. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  41135. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  41136. * @param {MetricsAggParameter|GeoHashGridAggParameter} [options.aggregations] - 聚合查询参数。该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  41137. * @extends {GetFeaturesParametersBase}
  41138. * @usage
  41139. */
  41140. var GetFeaturesBySQLParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  41141. GetFeaturesBySQLParameters_inherits(GetFeaturesBySQLParameters, _GetFeaturesParameter);
  41142. var _super = GetFeaturesBySQLParameters_createSuper(GetFeaturesBySQLParameters);
  41143. function GetFeaturesBySQLParameters(options) {
  41144. var _this;
  41145. GetFeaturesBySQLParameters_classCallCheck(this, GetFeaturesBySQLParameters);
  41146. _this = _super.call(this, options);
  41147. /**
  41148. * @member {string} GetFeaturesBySQLParameters.prototype.getFeatureMode
  41149. * @description 数据集查询模式。
  41150. */
  41151. _this.getFeatureMode = 'SQL';
  41152. /**
  41153. * @member {FilterParameter} GetFeaturesBySQLParameters.prototype.queryParameter
  41154. * @description 查询过滤条件参数类。
  41155. */
  41156. _this.queryParameter = null;
  41157. Util_Util.extend(GetFeaturesBySQLParameters_assertThisInitialized(_this), options);
  41158. _this.CLASS_NAME = 'SuperMap.GetFeaturesBySQLParameters';
  41159. return _this;
  41160. }
  41161. /**
  41162. * @function GetFeaturesBySQLParameters.prototype.destroy
  41163. * @override
  41164. */
  41165. GetFeaturesBySQLParameters_createClass(GetFeaturesBySQLParameters, [{
  41166. key: "destroy",
  41167. value: function destroy() {
  41168. GetFeaturesBySQLParameters_get(GetFeaturesBySQLParameters_getPrototypeOf(GetFeaturesBySQLParameters.prototype), "destroy", this).call(this);
  41169. var me = this;
  41170. me.getFeatureMode = null;
  41171. if (me.queryParameter) {
  41172. me.queryParameter.destroy();
  41173. me.queryParameter = null;
  41174. }
  41175. }
  41176. /**
  41177. * @function GetFeaturesBySQLParameters.prototype.toJsonParameters
  41178. * @description 将 GetFeaturesBySQLParameters 对象转换为 JSON 字符串。
  41179. * @param {GetFeaturesBySQLParameters} params - 数据集 SQL 查询参数对象。
  41180. * @returns {string} 转化后的 JSON 字符串。
  41181. */
  41182. }], [{
  41183. key: "toJsonParameters",
  41184. value: function toJsonParameters(params) {
  41185. var paramsBySql = {
  41186. datasetNames: params.datasetNames,
  41187. getFeatureMode: 'SQL',
  41188. queryParameter: params.queryParameter
  41189. };
  41190. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  41191. paramsBySql.maxFeatures = params.maxFeatures;
  41192. }
  41193. if (typeof params.hasGeometry === 'boolean') {
  41194. paramsBySql.hasGeometry = params.hasGeometry;
  41195. }
  41196. if (params.aggregations) {
  41197. paramsBySql.aggregations = params.aggregations;
  41198. }
  41199. if (params.targetEpsgCode) {
  41200. paramsBySql.targetEpsgCode = params.targetEpsgCode;
  41201. }
  41202. if (!params.targetEpsgCode && params.targetPrj) {
  41203. paramsBySql.targetPrj = params.targetPrj;
  41204. }
  41205. if (params.aggregations) {
  41206. paramsBySql.aggregations = params.aggregations;
  41207. }
  41208. return Util_Util.toJSON(paramsBySql);
  41209. }
  41210. }]);
  41211. return GetFeaturesBySQLParameters;
  41212. }(GetFeaturesParametersBase);
  41213. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesBySQLService.js
  41214. function GetFeaturesBySQLService_typeof(obj) { "@babel/helpers - typeof"; return GetFeaturesBySQLService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFeaturesBySQLService_typeof(obj); }
  41215. function GetFeaturesBySQLService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41216. function GetFeaturesBySQLService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  41217. function GetFeaturesBySQLService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesBySQLService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesBySQLService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  41218. function GetFeaturesBySQLService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesBySQLService_get = Reflect.get.bind(); } else { GetFeaturesBySQLService_get = function _get(target, property, receiver) { var base = GetFeaturesBySQLService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFeaturesBySQLService_get.apply(this, arguments); }
  41219. function GetFeaturesBySQLService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesBySQLService_getPrototypeOf(object); if (object === null) break; } return object; }
  41220. function GetFeaturesBySQLService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFeaturesBySQLService_setPrototypeOf(subClass, superClass); }
  41221. function GetFeaturesBySQLService_setPrototypeOf(o, p) { GetFeaturesBySQLService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesBySQLService_setPrototypeOf(o, p); }
  41222. function GetFeaturesBySQLService_createSuper(Derived) { var hasNativeReflectConstruct = GetFeaturesBySQLService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFeaturesBySQLService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFeaturesBySQLService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFeaturesBySQLService_possibleConstructorReturn(this, result); }; }
  41223. function GetFeaturesBySQLService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesBySQLService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFeaturesBySQLService_assertThisInitialized(self); }
  41224. function GetFeaturesBySQLService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  41225. function GetFeaturesBySQLService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  41226. function GetFeaturesBySQLService_getPrototypeOf(o) { GetFeaturesBySQLService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesBySQLService_getPrototypeOf(o); }
  41227. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41228. * This program are made available under the terms of the Apache License, Version 2.0
  41229. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41230. /**
  41231. * @class GetFeaturesBySQLService
  41232. * @deprecatedclass SuperMap.GetFeaturesBySQLService
  41233. * @constructs GetFeaturesBySQLService
  41234. * @category iServer Data FeatureResults
  41235. * @classdesc 数据服务中数据集 SQL 查询服务类。在一个或多个指定的图层上查询符合 SQL 条件的空间地物信息。
  41236. * @param {string} url - 服务地址。请求数据服务中数据集查询服务,
  41237. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;</br>
  41238. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  41239. * @param {Object} options - 参数。
  41240. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  41241. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  41242. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  41243. * @param {Object} [options.headers] - 请求头。
  41244. * @extends {GetFeaturesServiceBase}
  41245. * @example
  41246. * var myGetFeaturesBySQLService = new GetFeaturesBySQLService(url, {
  41247. * eventListeners: {
  41248. * "processCompleted": GetFeaturesCompleted,
  41249. * "processFailed": GetFeaturesError
  41250. * }
  41251. * });
  41252. * function getFeaturesCompleted(object){//todo};
  41253. * function getFeaturesError(object){//todo};
  41254. * @usage
  41255. */
  41256. var GetFeaturesBySQLService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  41257. GetFeaturesBySQLService_inherits(GetFeaturesBySQLService, _GetFeaturesServiceBa);
  41258. var _super = GetFeaturesBySQLService_createSuper(GetFeaturesBySQLService);
  41259. function GetFeaturesBySQLService(url, options) {
  41260. var _this;
  41261. GetFeaturesBySQLService_classCallCheck(this, GetFeaturesBySQLService);
  41262. _this = _super.call(this, url, options);
  41263. _this.CLASS_NAME = "SuperMap.GetFeaturesBySQLService";
  41264. return _this;
  41265. }
  41266. /**
  41267. * @function GetFeaturesBySQLService.prototype.destroy
  41268. * @override
  41269. */
  41270. GetFeaturesBySQLService_createClass(GetFeaturesBySQLService, [{
  41271. key: "destroy",
  41272. value: function destroy() {
  41273. GetFeaturesBySQLService_get(GetFeaturesBySQLService_getPrototypeOf(GetFeaturesBySQLService.prototype), "destroy", this).call(this);
  41274. }
  41275. /*
  41276. * @function GetFeaturesBySQLService.prototype.getJsonParameters
  41277. * @description 将查询参数转化为 JSON 字符串。
  41278. * 在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry等)。
  41279. * @param {GetFeaturesBySQLParameters} params - 数据集SQL查询参数类。
  41280. * @returns {string} 转化后的 JSON 字符串。
  41281. */
  41282. }, {
  41283. key: "getJsonParameters",
  41284. value: function getJsonParameters(params) {
  41285. return GetFeaturesBySQLParameters.toJsonParameters(params);
  41286. }
  41287. }]);
  41288. return GetFeaturesBySQLService;
  41289. }(GetFeaturesServiceBase);
  41290. ;// CONCATENATED MODULE: ./src/common/iServer/GetFieldsService.js
  41291. function GetFieldsService_typeof(obj) { "@babel/helpers - typeof"; return GetFieldsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetFieldsService_typeof(obj); }
  41292. function GetFieldsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41293. function GetFieldsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  41294. function GetFieldsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFieldsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFieldsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  41295. function GetFieldsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetFieldsService_get = Reflect.get.bind(); } else { GetFieldsService_get = function _get(target, property, receiver) { var base = GetFieldsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetFieldsService_get.apply(this, arguments); }
  41296. function GetFieldsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFieldsService_getPrototypeOf(object); if (object === null) break; } return object; }
  41297. function GetFieldsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetFieldsService_setPrototypeOf(subClass, superClass); }
  41298. function GetFieldsService_setPrototypeOf(o, p) { GetFieldsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFieldsService_setPrototypeOf(o, p); }
  41299. function GetFieldsService_createSuper(Derived) { var hasNativeReflectConstruct = GetFieldsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetFieldsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetFieldsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetFieldsService_possibleConstructorReturn(this, result); }; }
  41300. function GetFieldsService_possibleConstructorReturn(self, call) { if (call && (GetFieldsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetFieldsService_assertThisInitialized(self); }
  41301. function GetFieldsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  41302. function GetFieldsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  41303. function GetFieldsService_getPrototypeOf(o) { GetFieldsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFieldsService_getPrototypeOf(o); }
  41304. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41305. * This program are made available under the terms of the Apache License, Version 2.0
  41306. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41307. /**
  41308. * @class GetFieldsService
  41309. * @deprecatedclass SuperMap.GetFieldsService
  41310. * @category iServer Data Field
  41311. * @classdesc 字段查询服务,支持查询指定数据集的中所有属性字段(field)的集合。
  41312. * @param {string} url - 服务地址。如访问World Map服务,只需将url设为:http://localhost:8090/iserver/services/data-world/rest/data 即可。
  41313. * @param {Object} options - 参数。
  41314. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  41315. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  41316. * @param {string}options.datasource - 数据源名称。
  41317. * @param {string}options.dataset - 数据集名称。
  41318. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  41319. * @param {Object} [options.headers] - 请求头。
  41320. * @extends {CommonServiceBase}
  41321. * @example
  41322. * var myService = new GetFieldsService(url, {eventListeners: {
  41323. * "processCompleted": getFieldsCompleted,
  41324. * "processFailed": getFieldsError
  41325. * },
  41326. * datasource: "World",
  41327. * dataset: "Countries"
  41328. * };
  41329. * @usage
  41330. */
  41331. var GetFieldsService = /*#__PURE__*/function (_CommonServiceBase) {
  41332. GetFieldsService_inherits(GetFieldsService, _CommonServiceBase);
  41333. var _super = GetFieldsService_createSuper(GetFieldsService);
  41334. function GetFieldsService(url, options) {
  41335. var _this;
  41336. GetFieldsService_classCallCheck(this, GetFieldsService);
  41337. _this = _super.call(this, url, options);
  41338. /**
  41339. * @member {string} GetFieldsService.prototype.datasource
  41340. * @description 要查询的数据集所在的数据源名称。
  41341. */
  41342. _this.datasource = null;
  41343. /**
  41344. * @member {string} GetFieldsService.prototype.dataset
  41345. * @description 要查询的数据集名称。
  41346. */
  41347. _this.dataset = null;
  41348. if (options) {
  41349. Util_Util.extend(GetFieldsService_assertThisInitialized(_this), options);
  41350. }
  41351. _this.CLASS_NAME = "SuperMap.GetFieldsService";
  41352. return _this;
  41353. }
  41354. /**
  41355. * @function GetFieldsService.prototype.destroy
  41356. * @override
  41357. */
  41358. GetFieldsService_createClass(GetFieldsService, [{
  41359. key: "destroy",
  41360. value: function destroy() {
  41361. GetFieldsService_get(GetFieldsService_getPrototypeOf(GetFieldsService.prototype), "destroy", this).call(this);
  41362. var me = this;
  41363. me.datasource = null;
  41364. me.dataset = null;
  41365. }
  41366. /**
  41367. * @function GetFieldsService.prototype.processAsync
  41368. * @description 执行服务,查询指定数据集的字段信息。
  41369. */
  41370. }, {
  41371. key: "processAsync",
  41372. value: function processAsync() {
  41373. var me = this;
  41374. me.url = Util_Util.urlPathAppend(me.url, "datasources/".concat(me.datasource, "/datasets/").concat(me.dataset, "/fields"));
  41375. me.request({
  41376. method: "GET",
  41377. data: null,
  41378. scope: me,
  41379. success: me.serviceProcessCompleted,
  41380. failure: me.serviceProcessFailed
  41381. });
  41382. }
  41383. }]);
  41384. return GetFieldsService;
  41385. }(CommonServiceBase);
  41386. ;// CONCATENATED MODULE: ./src/common/iServer/GetGridCellInfosParameters.js
  41387. function GetGridCellInfosParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41388. function GetGridCellInfosParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  41389. function GetGridCellInfosParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetGridCellInfosParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetGridCellInfosParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  41390. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41391. * This program are made available under the terms of the Apache License, Version 2.0
  41392. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41393. /**
  41394. * @class GetGridCellInfosParameters
  41395. * @deprecatedclass SuperMap.GetGridCellInfosParameters
  41396. * @category iServer Data Grid
  41397. * @classdesc 数据服务栅格查询参数类。
  41398. * @param {Object} options - 参数。
  41399. * @param {string} options.datasetName - 数据集名称。
  41400. * @param {string} options.dataSourceName - 数据源名称。
  41401. * @param {number} options.X - 地理位置 X 轴。
  41402. * @param {number} options.Y - 地理位置 Y 轴。
  41403. * @usage
  41404. */
  41405. var GetGridCellInfosParameters = /*#__PURE__*/function () {
  41406. function GetGridCellInfosParameters(options) {
  41407. GetGridCellInfosParameters_classCallCheck(this, GetGridCellInfosParameters);
  41408. /**
  41409. * @member {string} GetGridCellInfosParameters.prototype.datasetName
  41410. * @description 数据集名称。
  41411. */
  41412. this.datasetName = null;
  41413. /**
  41414. * @member {string} GetGridCellInfosParameters.prototype.dataSourceName
  41415. * @description 数据源名称。
  41416. */
  41417. this.dataSourceName = null;
  41418. /**
  41419. * @member {number} GetGridCellInfosParameters.prototype.X
  41420. * @description 要查询的地理位置 X 轴。
  41421. */
  41422. this.X = null;
  41423. /**
  41424. * @member {number} GetGridCellInfosParameters.prototype.Y
  41425. * @description 要查询的地理位置 Y 轴。
  41426. */
  41427. this.Y = null;
  41428. Util_Util.extend(this, options);
  41429. this.CLASS_NAME = "SuperMap.GetGridCellInfosParameters";
  41430. }
  41431. /**
  41432. * @function GetGridCellInfosParameters.prototype.destroy
  41433. * @description 释放资源,将引用的资源属性置空。
  41434. */
  41435. GetGridCellInfosParameters_createClass(GetGridCellInfosParameters, [{
  41436. key: "destroy",
  41437. value: function destroy() {
  41438. var me = this;
  41439. me.datasetName = null;
  41440. me.dataSourceName = null;
  41441. me.X = null;
  41442. me.Y = null;
  41443. }
  41444. }]);
  41445. return GetGridCellInfosParameters;
  41446. }();
  41447. ;// CONCATENATED MODULE: ./src/common/iServer/GetGridCellInfosService.js
  41448. function GetGridCellInfosService_typeof(obj) { "@babel/helpers - typeof"; return GetGridCellInfosService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetGridCellInfosService_typeof(obj); }
  41449. function GetGridCellInfosService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41450. function GetGridCellInfosService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  41451. function GetGridCellInfosService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetGridCellInfosService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetGridCellInfosService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  41452. function GetGridCellInfosService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetGridCellInfosService_get = Reflect.get.bind(); } else { GetGridCellInfosService_get = function _get(target, property, receiver) { var base = GetGridCellInfosService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetGridCellInfosService_get.apply(this, arguments); }
  41453. function GetGridCellInfosService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetGridCellInfosService_getPrototypeOf(object); if (object === null) break; } return object; }
  41454. function GetGridCellInfosService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetGridCellInfosService_setPrototypeOf(subClass, superClass); }
  41455. function GetGridCellInfosService_setPrototypeOf(o, p) { GetGridCellInfosService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetGridCellInfosService_setPrototypeOf(o, p); }
  41456. function GetGridCellInfosService_createSuper(Derived) { var hasNativeReflectConstruct = GetGridCellInfosService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetGridCellInfosService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetGridCellInfosService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetGridCellInfosService_possibleConstructorReturn(this, result); }; }
  41457. function GetGridCellInfosService_possibleConstructorReturn(self, call) { if (call && (GetGridCellInfosService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetGridCellInfosService_assertThisInitialized(self); }
  41458. function GetGridCellInfosService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  41459. function GetGridCellInfosService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  41460. function GetGridCellInfosService_getPrototypeOf(o) { GetGridCellInfosService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetGridCellInfosService_getPrototypeOf(o); }
  41461. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41462. * This program are made available under the terms of the Apache License, Version 2.0
  41463. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41464. /**
  41465. * @class GetGridCellInfosService
  41466. * @deprecatedclass SuperMap.GetGridCellInfosService
  41467. * @category iServer Data Grid
  41468. * @classdesc 数据栅格查询服务,支持查询指定地理位置的栅格信息。
  41469. * @param {string} url - 服务地址。例如: http://localhost:8090/iserver/services/data-jingjin/rest/data
  41470. * @param {Object} options - 参数。
  41471. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。<br>
  41472. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  41473. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  41474. * @param {Object} [options.headers] - 请求头。
  41475. * @extends {CommonServiceBase}
  41476. * @example
  41477. * var myService = new GetGridCellInfosService(url, {eventListeners: {
  41478. * "processCompleted": queryCompleted,
  41479. * "processFailed": queryError
  41480. * }
  41481. * });
  41482. * @usage
  41483. */
  41484. var GetGridCellInfosService = /*#__PURE__*/function (_CommonServiceBase) {
  41485. GetGridCellInfosService_inherits(GetGridCellInfosService, _CommonServiceBase);
  41486. var _super = GetGridCellInfosService_createSuper(GetGridCellInfosService);
  41487. function GetGridCellInfosService(url, options) {
  41488. var _this;
  41489. GetGridCellInfosService_classCallCheck(this, GetGridCellInfosService);
  41490. _this = _super.call(this, url, options);
  41491. /**
  41492. * @member {string} GetGridCellInfosService.prototype.datasetName
  41493. * @description 数据集名称。
  41494. */
  41495. _this.datasetName = null;
  41496. /**
  41497. * @member {string} GetGridCellInfosService.prototype.dataSourceName
  41498. * @description 数据源名称。
  41499. */
  41500. _this.dataSourceName = null;
  41501. /**
  41502. * @member {string} GetGridCellInfosService.prototype.datasetType
  41503. * @description 数据集类型。
  41504. */
  41505. _this.datasetType = null;
  41506. /**
  41507. * @member {number} GetGridCellInfosService.prototype.X
  41508. * @description 要查询的地理位置X轴
  41509. */
  41510. _this.X = null;
  41511. /**
  41512. * @member {number} GetGridCellInfosService.prototype.Y
  41513. * @description 要查询的地理位置Y轴
  41514. */
  41515. _this.Y = null;
  41516. if (options) {
  41517. Util_Util.extend(GetGridCellInfosService_assertThisInitialized(_this), options);
  41518. }
  41519. _this.eventCount = 0;
  41520. _this.CLASS_NAME = "SuperMap.GetGridCellInfosService";
  41521. return _this;
  41522. }
  41523. /**
  41524. * @function GetGridCellInfosService.prototype.destroy
  41525. * @override
  41526. */
  41527. GetGridCellInfosService_createClass(GetGridCellInfosService, [{
  41528. key: "destroy",
  41529. value: function destroy() {
  41530. GetGridCellInfosService_get(GetGridCellInfosService_getPrototypeOf(GetGridCellInfosService.prototype), "destroy", this).call(this);
  41531. var me = this;
  41532. me.X = null;
  41533. me.Y = null;
  41534. me.datasetName = null;
  41535. me.dataSourceName = null;
  41536. me.datasetType = null;
  41537. }
  41538. /**
  41539. * @function GetGridCellInfosService.prototype.processAsync
  41540. * @description 执行服务,查询数据集信息。
  41541. * @param {GetGridCellInfosParameters} params - 查询参数。
  41542. */
  41543. }, {
  41544. key: "processAsync",
  41545. value: function processAsync(params, callback) {
  41546. if (!(params instanceof GetGridCellInfosParameters)) {
  41547. return;
  41548. }
  41549. Util_Util.extend(this, params);
  41550. var me = this;
  41551. me.url = Util_Util.urlPathAppend(me.url, "datasources/".concat(me.dataSourceName, "/datasets/").concat(me.datasetName));
  41552. me.queryRequest(me.getDatasetInfoCompleted.bind(me), me.getDatasetInfoFailed.bind(me), callback);
  41553. }
  41554. /**
  41555. * @function GetGridCellInfosService.prototype.queryRequest
  41556. * @description 执行服务,查询。
  41557. * @callback {function} successFun - 成功后执行的函数。
  41558. * @callback {function} failedFunc - 失败后执行的函数。
  41559. */
  41560. }, {
  41561. key: "queryRequest",
  41562. value: function queryRequest(successFun, failedFunc, callback) {
  41563. var eventId = ++this.eventCount;
  41564. var eventListeners = {
  41565. scope: this,
  41566. processCompleted: function processCompleted(result) {
  41567. if (eventId === result.result.eventId && callback) {
  41568. delete result.result.eventId;
  41569. callback(result);
  41570. this.events && this.events.un(eventListeners);
  41571. return false;
  41572. }
  41573. },
  41574. processFailed: function processFailed(result) {
  41575. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  41576. callback(result);
  41577. this.events && this.events.un(eventListeners);
  41578. return false;
  41579. }
  41580. }
  41581. };
  41582. this.events.on(eventListeners);
  41583. var me = this;
  41584. me.request({
  41585. method: "GET",
  41586. data: null,
  41587. scope: me,
  41588. success: function success(result, options) {
  41589. result.eventId = eventId;
  41590. successFun(result, options, callback);
  41591. },
  41592. failure: function failure(result, options) {
  41593. if (result.error) {
  41594. result.error.eventId = eventId;
  41595. }
  41596. result.eventId = eventId;
  41597. failedFunc(result, options);
  41598. }
  41599. });
  41600. }
  41601. /**
  41602. * @function GetGridCellInfosService.prototype.getDatasetInfoCompleted
  41603. * @description 数据集查询完成,执行此方法。
  41604. * @param {Object} result - 服务器返回的结果对象。
  41605. */
  41606. }, {
  41607. key: "getDatasetInfoCompleted",
  41608. value: function getDatasetInfoCompleted(result, options, callback) {
  41609. var me = this;
  41610. result = Util_Util.transformResult(result);
  41611. me.datasetType = result.datasetInfo.type;
  41612. me.queryGridInfos(callback);
  41613. }
  41614. /**
  41615. * @function GetGridCellInfosService.prototype.queryGridInfos
  41616. * @description 执行服务,查询数据集栅格信息。
  41617. */
  41618. }, {
  41619. key: "queryGridInfos",
  41620. value: function queryGridInfos(callback) {
  41621. var me = this;
  41622. me.url = Util_Util.urlPathAppend(me.url, me.datasetType == 'GRID' ? 'gridValue' : 'imageValue');
  41623. if (me.X != null && me.Y != null) {
  41624. me.url = Util_Util.urlAppend(me.url, "x=".concat(me.X, "&y=").concat(me.Y));
  41625. }
  41626. me.queryRequest(me.serviceProcessCompleted.bind(me), me.serviceProcessFailed.bind(me), callback);
  41627. }
  41628. /**
  41629. * @function GetGridCellInfosService.prototype.getDatasetInfoFailed
  41630. * @description 数据集查询失败,执行此方法。
  41631. * @param {Object} result - 服务器返回的结果对象。
  41632. */
  41633. }, {
  41634. key: "getDatasetInfoFailed",
  41635. value: function getDatasetInfoFailed(result, options) {
  41636. var me = this;
  41637. me.serviceProcessFailed(result, options);
  41638. }
  41639. }]);
  41640. return GetGridCellInfosService;
  41641. }(CommonServiceBase);
  41642. ;// CONCATENATED MODULE: ./src/common/iServer/Theme.js
  41643. function Theme_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41644. function Theme_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  41645. function Theme_createClass(Constructor, protoProps, staticProps) { if (protoProps) Theme_defineProperties(Constructor.prototype, protoProps); if (staticProps) Theme_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  41646. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41647. * This program are made available under the terms of the Apache License, Version 2.0
  41648. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41649. /**
  41650. * @class CommonTheme
  41651. * @aliasclass Theme
  41652. * @deprecatedclass SuperMap.Theme
  41653. * @category iServer Map Theme
  41654. * @classdesc 专题图基类。
  41655. * @param {string} type - 专题图类型。
  41656. * @param {Object} options - 可选参数。
  41657. * @param {ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  41658. * @usage
  41659. */
  41660. var Theme = /*#__PURE__*/function () {
  41661. function Theme(type, options) {
  41662. Theme_classCallCheck(this, Theme);
  41663. if (!type) {
  41664. return this;
  41665. }
  41666. /**
  41667. * @member {ThemeMemoryData} CommonTheme.prototype.memoryData
  41668. * @description 专题图内存数据。<br>
  41669. * 用内存数据制作专题图的方式与表达式制作专题图的方式互斥,前者优先级较高。
  41670. * 第一个参数代表专题值,即数据集中用来做专题图的字段或表达式的值;第二个参数代表外部值。在制作专题图时,会用外部值代替专题值来制作相应的专题图。
  41671. */
  41672. this.memoryData = null;
  41673. /**
  41674. * @member {string} CommonTheme.prototype.type
  41675. * @description 专题图类型。
  41676. */
  41677. this.type = type;
  41678. if (options) {
  41679. Util_Util.extend(this, options);
  41680. }
  41681. this.CLASS_NAME = "SuperMap.Theme";
  41682. }
  41683. /**
  41684. * @function CommonTheme.prototype.destroy
  41685. * @description 释放资源,将引用资源的属性置空。
  41686. */
  41687. Theme_createClass(Theme, [{
  41688. key: "destroy",
  41689. value: function destroy() {
  41690. var me = this;
  41691. if (me.memoryData) {
  41692. me.memoryData.destroy();
  41693. me.memoryData = null;
  41694. }
  41695. me.type = null;
  41696. }
  41697. /**
  41698. * @function CommonTheme.prototype.toServerJSONObject
  41699. * @description 转换成对应的 JSON 格式对象。
  41700. * @returns {Object} 对应的 JSON 格式对象。
  41701. */
  41702. }, {
  41703. key: "toServerJSONObject",
  41704. value: function toServerJSONObject() {
  41705. //return 子类实现
  41706. return;
  41707. }
  41708. }]);
  41709. return Theme;
  41710. }();
  41711. ;// CONCATENATED MODULE: ./src/common/iServer/ServerTextStyle.js
  41712. function ServerTextStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41713. function ServerTextStyle_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  41714. function ServerTextStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerTextStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerTextStyle_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  41715. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41716. * This program are made available under the terms of the Apache License, Version 2.0
  41717. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41718. /**
  41719. * @class ServerTextStyle
  41720. * @deprecatedclass SuperMap.ServerTextStyle
  41721. * @category iServer Map Theme
  41722. * @classdesc 服务端文本风格类。该类用于定义文本风格的相关属性。
  41723. * @param {Object} options - 可选参数。
  41724. * @param {TextAlignment} [options.align=TextAlignment.BASELINECENTER] - 文本的对齐方式。
  41725. * @param {ServerColor} [options.backColor] - 文本的背景色。默认 backColor = new ServerColor(255, 255, 255)。
  41726. * @param {ServerColor} [options.foreColor] - 文本的前景色。默认 foreColor = new ServerColor(0, 0, 0)。
  41727. * @param {boolean} [options.backOpaque=false] - 文本背景是否不透明。
  41728. * @param {boolean} [options.sizeFixed=true] - 文本大小是否固定。
  41729. * @param {number} [options.fontHeight=6] - 文本字体的高度。
  41730. * @param {number} [options.fontWidth=0] - 文本字体的宽度。
  41731. * @param {number} [options.fontWeight=400] - 文本字体的磅数。
  41732. * @param {string} [options.fontName='Times New Roman'] - 文本字体的名称。
  41733. * @param {boolean} [options.bold=false] - 文本是否为粗体字。
  41734. * @param {boolean} [options.italic=false] - 文本是否采用斜体。
  41735. * @param {number} [options.italicAngle=0] - 字体倾斜角度。
  41736. * @param {boolean} [options.shadow=false] - 文本是否有阴影。
  41737. * @param {boolean} [options.strikeout=false] - 文本字体是否加删除线。
  41738. * @param {boolean} [options.outline=false] - 是否以轮廓的方式来显示文本的背景。
  41739. * @param {number} [options.opaqueRate=0] - 注记文字的不透明度。
  41740. * @param {boolean} [options.underline=false] - 文本字体是否加下划线。
  41741. * @param {number} [options.rotation=0.0] - 文本旋转的角度。
  41742. * @usage
  41743. */
  41744. var ServerTextStyle = /*#__PURE__*/function () {
  41745. function ServerTextStyle(options) {
  41746. ServerTextStyle_classCallCheck(this, ServerTextStyle);
  41747. /**
  41748. * @member {TextAlignment} [ServerTextStyle.prototype.align= TextAlignment.BASELINECENTER]
  41749. * @description 文本的对齐方式。
  41750. */
  41751. this.align = TextAlignment.BASELINECENTER;
  41752. /**
  41753. * @member {ServerColor} [ServerTextStyle.prototype.backColor=(255, 255, 255)]
  41754. * @description 文本的背景色。
  41755. */
  41756. this.backColor = new ServerColor(255, 255, 255);
  41757. /**
  41758. * @member {ServerColor} [ServerTextStyle.prototype.foreColor=(0, 0, 0)]
  41759. * @description 文本的前景色。
  41760. */
  41761. this.foreColor = new ServerColor(0, 0, 0);
  41762. /**
  41763. * @member {boolean} [ServerTextStyle.prototype.backOpaque=false]
  41764. * @description 文本背景是否不透明。true 表示文本背景不透明。
  41765. */
  41766. this.backOpaque = false;
  41767. /**
  41768. * @member {boolean} [ServerTextStyle.prototype.sizeFixed=true]
  41769. * @description 文本大小是否固定。设置为 true,表示图片为固定像素大小,具体大小请参考 fontHeight。当设为 false 时,图片会随着地图缩放而缩放。
  41770. */
  41771. this.sizeFixed = true;
  41772. /**
  41773. * @member {number} [ServerTextStyle.prototype.fontHeight=6]
  41774. * @description 文本字体的高度,单位与 sizeFixed 有关,当 sizeFixed 为 False 时,即非固定文本大小时使用地图坐标单位,
  41775. * 如地理坐标系下的地图中单位为度;当 sizeFixed 为 True 时,单位为毫米(mm)。
  41776. */
  41777. this.fontHeight = 6;
  41778. /**
  41779. * @member {number} [ServerTextStyle.prototype.fontWidth=0]
  41780. * @description 文本字体的宽度。字体的宽度以英文字符为标准,由于一个中文字符相当于两个英文字符。
  41781. */
  41782. this.fontWidth = 0;
  41783. /**
  41784. * @member {number} [ServerTextStyle.prototype.fontWeight=400]
  41785. * @description 文本字体的磅数。表示粗体的具体数值。取值范围为从0-900之间的整百数。
  41786. */
  41787. this.fontWeight = 400;
  41788. /**
  41789. * @member {string} [ServerTextStyle.prototype.fontName="Times New Roman"]
  41790. * @description 文本字体的名称。
  41791. */
  41792. this.fontName = "Times New Roman";
  41793. /**
  41794. * @member {boolean} [ServerTextStyle.prototype.bold=false]
  41795. * @description 文本是否为粗体字。true 表示为粗体。false 表示文本不是粗体字。
  41796. */
  41797. this.bold = false;
  41798. /**
  41799. * @member {boolean} [ServerTextStyle.prototype.italic=false]
  41800. * @description 文本是否采用斜体。true 表示采用斜体。
  41801. */
  41802. this.italic = false;
  41803. /**
  41804. * @member {number} [ServerTextStyle.prototype.italicAngle=0]
  41805. * @description 字体倾斜角度。正负度之间,以度为单位,精确到0.1度。当倾斜角度为0度,为系统默认的字体倾斜样式。
  41806. * 正负度是指以纵轴为起始零度线,其纵轴左侧为正,右侧为负。允许的最大角度为60,最小-60。大于60按照60处理,小于-60按照-60处理。目前只对标签专题图有效。
  41807. */
  41808. this.italicAngle = 0;
  41809. /**
  41810. * @member {boolean} [ServerTextStyle.prototype.shadow=false]
  41811. * @description 文本是否有阴影。true 表示给文本增加阴影。false 表示文本没有阴影。
  41812. */
  41813. this.shadow = false;
  41814. /**
  41815. * @member {boolean} [ServerTextStyle.prototype.strikeout=false]
  41816. * @description 文本字体是否加删除线。true 表示加删除线。false 表示文本字体不加删除线。
  41817. */
  41818. this.strikeout = false;
  41819. /**
  41820. * @member {boolean} [ServerTextStyle.prototype.outline=false]
  41821. * @description 是否以轮廓的方式来显示文本的背景。true 表示以轮廓的方式来显示文本的背景。false 表示不以轮廓的方式来显示文本的背景。
  41822. */
  41823. this.outline = false;
  41824. /**
  41825. * @member {number} [ServerTextStyle.prototype.opaqueRate=0]
  41826. * @description 注记文字的不透明度。不透明度的范围为0-100。0表示透明。
  41827. */
  41828. this.opaqueRate = 0;
  41829. /**
  41830. * @member {boolean} [ServerTextStyle.prototype.underline=false]
  41831. * @description 文本字体是否加下划线。true 表示加下划线。
  41832. */
  41833. this.underline = false;
  41834. /**
  41835. * @member {number} [ServerTextStyle.prototype.rotation=0.0]
  41836. * @description 文本旋转的角度。逆时针方向为正方向,单位为度,精确到0.1度。
  41837. */
  41838. this.rotation = 0.0;
  41839. if (options) {
  41840. Util_Util.extend(this, options);
  41841. }
  41842. this.CLASS_NAME = "SuperMap.ServerTextStyle";
  41843. }
  41844. /**
  41845. * @function ServerTextStyle.prototype.destroy
  41846. * @description 释放资源,将引用资源的属性置空。
  41847. */
  41848. ServerTextStyle_createClass(ServerTextStyle, [{
  41849. key: "destroy",
  41850. value: function destroy() {
  41851. var me = this;
  41852. me.align = null;
  41853. if (me.backColor) {
  41854. me.backColor.destroy();
  41855. me.backColor = null;
  41856. }
  41857. if (me.foreColor) {
  41858. me.foreColor.destroy();
  41859. me.foreColor = null;
  41860. }
  41861. me.backOpaque = null;
  41862. me.sizeFixed = null;
  41863. me.fontHeight = null;
  41864. me.fontWidth = null;
  41865. me.fontWeight = null;
  41866. me.fontName = null;
  41867. me.bold = null;
  41868. me.italic = null;
  41869. me.italicAngle = null;
  41870. me.shadow = null;
  41871. me.strikeout = null;
  41872. me.outline = null;
  41873. me.opaqueRate = null;
  41874. me.underline = null;
  41875. me.rotation = null;
  41876. }
  41877. /**
  41878. * @function ServerTextStyle.fromObj
  41879. * @description 从传入对象获服务端文本风格类。
  41880. * @param {Object} obj - 传入对象
  41881. * @returns {ServerTextStyle} 返回服务端文本风格对象
  41882. */
  41883. }], [{
  41884. key: "fromObj",
  41885. value: function fromObj(obj) {
  41886. var res = new ServerTextStyle(obj);
  41887. Util_Util.copy(res, obj);
  41888. res.backColor = ServerColor.fromJson(obj.backColor);
  41889. res.foreColor = ServerColor.fromJson(obj.foreColor);
  41890. return res;
  41891. }
  41892. }]);
  41893. return ServerTextStyle;
  41894. }();
  41895. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelItem.js
  41896. function ThemeLabelItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41897. function ThemeLabelItem_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  41898. function ThemeLabelItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelItem_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  41899. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41900. * This program are made available under the terms of the Apache License, Version 2.0
  41901. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41902. /**
  41903. * @class ThemeLabelItem
  41904. * @deprecatedclass SuperMap.ThemeLabelItem
  41905. * @category iServer Map Theme
  41906. * @classdesc 分段标签专题图的子项。标签专题图用专题值对点、线、面等对象做标注。
  41907. * 值得注意的是,分段标签专题图允许用户通过 rangeExpression 字段指定用于分段的数值型字段,
  41908. * 同一范围段内的标签具有相同的显示风格,其中每一个范围段就是一个专题图子项,
  41909. * 每一个子项都具有其名称、风格、起始值和终止值。注意:每个分段所表示的范围为 [Start, End)。例如:标签专题图的分段点有两个子项,
  41910. * 他们所代表的分段区间分别为[0,5),[5,10)。那么需要分别设置 ThemeLabelItem[0].start=0,
  41911. * ThemeLabelItem[0].end=5,SuperMap.ThemeLabelItem[1].start=5,SuperMap.ThemeLabelItem[1].end=10。
  41912. * @param {Object} options - 可选参数。
  41913. * @param {string} [options.caption] - 子项的名称。
  41914. * @param {number} [options.end=0] - 子项的终止值。
  41915. * @param {number} [options.start=0] - 子项的分段起始值。
  41916. * @param {boolean} [options.visible=true] - 子项是否可见。
  41917. * @param {ServerTextStyle} [options.style] - 子项文本的显示风格。
  41918. * @usage
  41919. */
  41920. var ThemeLabelItem = /*#__PURE__*/function () {
  41921. function ThemeLabelItem(options) {
  41922. ThemeLabelItem_classCallCheck(this, ThemeLabelItem);
  41923. /**
  41924. * @member {string} [ThemeLabelItem.prototype.caption]
  41925. * @description 标签专题子项的标题。
  41926. */
  41927. this.caption = null;
  41928. /**
  41929. * @member {number} [ThemeLabelItem.prototype.end=0]
  41930. * @description 标签专题图子项的终止值。如果该子项是分段中最后一个子项,那么该终止值就是分段的最大值;
  41931. * 如果不是最后一项,该终止值必须与其下一子项的起始值相同,否则系统抛出异常。
  41932. */
  41933. this.end = 0;
  41934. /**
  41935. * @member {number} [ThemeLabelItem.prototype.start=0]
  41936. * @description 标签专题图子项的分段起始值。如果该子项是分段中第一项,那么该起始值就是分段的最小值;
  41937. * 如果该子项的序号大于等于 1 的时候,该起始值必须与前一子项的终止值相同,否则系统会抛出异常。
  41938. */
  41939. this.start = 0;
  41940. /**
  41941. * @member {boolean} [ThemeLabelItem.prototype.visible=true]
  41942. * @description 标签专题图子项是否可见。如果标签专题图子项可见,则为 true,否则为 false。
  41943. */
  41944. this.visible = true;
  41945. /**
  41946. * @member {ServerTextStyle} ThemeLabelItem.prototype.style
  41947. * @description 标签专题图子项文本的显示风格。各种风格的优先级从高到低为:<br>
  41948. * uniformMixedStyle(标签文本的复合风格),ThemeLabelItem.style(分段子项的文本风格),uniformStyle(统一文本风格)。
  41949. */
  41950. this.style = new ServerTextStyle();
  41951. if (options) {
  41952. Util_Util.extend(this, options);
  41953. }
  41954. this.CLASS_NAME = "SuperMap.ThemeLabelItem";
  41955. }
  41956. /**
  41957. * @function ThemeLabelItem.prototype.destroy
  41958. * @description 释放资源,将引用资源的属性置空。
  41959. */
  41960. ThemeLabelItem_createClass(ThemeLabelItem, [{
  41961. key: "destroy",
  41962. value: function destroy() {
  41963. var me = this;
  41964. me.caption = null;
  41965. me.end = null;
  41966. me.start = null;
  41967. if (me.style) {
  41968. me.style.destroy();
  41969. me.style = null;
  41970. }
  41971. me.visible = null;
  41972. }
  41973. /**
  41974. * @function ThemeLabelItem.fromObj
  41975. * @description 从传入对象获取分段标签专题图的子项类。
  41976. * @param {Object} obj - 传入对象。
  41977. * @returns {ThemeLabelItem} ThemeLabelItem 对象。
  41978. */
  41979. }], [{
  41980. key: "fromObj",
  41981. value: function fromObj(obj) {
  41982. if (!obj) {
  41983. return;
  41984. }
  41985. var t = new ThemeLabelItem();
  41986. Util_Util.copy(t, obj);
  41987. return t;
  41988. }
  41989. }]);
  41990. return ThemeLabelItem;
  41991. }();
  41992. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeUniqueItem.js
  41993. function ThemeUniqueItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41994. function ThemeUniqueItem_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  41995. function ThemeUniqueItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeUniqueItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeUniqueItem_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  41996. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41997. * This program are made available under the terms of the Apache License, Version 2.0
  41998. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41999. /**
  42000. * @class ThemeUniqueItem
  42001. * @deprecatedclass SuperMap.ThemeUniqueItem
  42002. * @category iServer Map Theme
  42003. * @classdesc 单值专题图子项类。单值专题图是将专题值相同的要素归为一类,为每一类设定一种渲染风格,其中每一类就是一个专题图子项。比如,利用单值专题图制作行政区划图,Name 字段代表省/直辖市名,该字段用来做专题变量,如果该字段的字段值总共有 5 种不同值,则该行政区划图有 5 个专题图子项。
  42004. * @param {Object} options - 参数。
  42005. * @param {string} options.unique - 子项的单值字段。
  42006. * @param {string} [options.caption] - 子项的标题。
  42007. * @param {ServerStyle} [options.style] - 子项的风格。
  42008. * @param {boolean} [options.visible=true] - 子项是否可见。
  42009. * @usage
  42010. */
  42011. var ThemeUniqueItem = /*#__PURE__*/function () {
  42012. function ThemeUniqueItem(options) {
  42013. ThemeUniqueItem_classCallCheck(this, ThemeUniqueItem);
  42014. /**
  42015. * @member {string} [ThemeUniqueItem.prototype.caption]
  42016. * @description 单值专题图子项的标题。
  42017. */
  42018. this.caption = null;
  42019. /**
  42020. * @member {ServerStyle} [ThemeUniqueItem.prototype.style]
  42021. * @description 单值专题图子项的显示风格。
  42022. */
  42023. this.style = new ServerStyle();
  42024. /**
  42025. * @member {string} ThemeUniqueItem.prototype.unique
  42026. * @description 单值专题图子项的值,可以为数字、字符串等。
  42027. */
  42028. this.unique = null;
  42029. /**
  42030. * @member {boolean} [ThemeUniqueItem.prototype.visible=true]
  42031. * @description 单值专题图子项的可见性。
  42032. */
  42033. this.visible = true;
  42034. if (options) {
  42035. Util_Util.extend(this, options);
  42036. }
  42037. this.CLASS_NAME = "SuperMap.ThemeUniqueItem";
  42038. }
  42039. /**
  42040. * @function ThemeUniqueItem.prototype.destroy
  42041. * @description 释放资源,将引用资源的属性置空。
  42042. */
  42043. ThemeUniqueItem_createClass(ThemeUniqueItem, [{
  42044. key: "destroy",
  42045. value: function destroy() {
  42046. var me = this;
  42047. me.caption = null;
  42048. me.unique = null;
  42049. if (me.style) {
  42050. me.style.destroy();
  42051. me.style = null;
  42052. }
  42053. me.visible = null;
  42054. }
  42055. /**
  42056. * @function ThemeUniqueItem.prototype.toServerJSONObject
  42057. * @description 转换成对应的 JSON 格式对象。
  42058. * @returns {Object} 对应的 JSON 格式对象。
  42059. */
  42060. }, {
  42061. key: "toServerJSONObject",
  42062. value: function toServerJSONObject() {
  42063. var obj = {};
  42064. obj = Util_Util.copyAttributes(obj, this);
  42065. if (obj.style) {
  42066. if (obj.style.toServerJSONObject) {
  42067. obj.style = obj.style.toServerJSONObject();
  42068. }
  42069. }
  42070. return obj;
  42071. }
  42072. /**
  42073. * @function ThemeUniqueItem.fromObj
  42074. * @description 从传入对象获取单值专题图子项类。
  42075. * @param {Object} obj - 传入对象。
  42076. * @returns {ThemeUniqueItem} ThemeUniqueItem 对象。
  42077. */
  42078. }], [{
  42079. key: "fromObj",
  42080. value: function fromObj(obj) {
  42081. var res = new ThemeUniqueItem();
  42082. Util_Util.copy(res, obj);
  42083. res.style = ServerStyle.fromJson(obj.style);
  42084. return res;
  42085. }
  42086. }]);
  42087. return ThemeUniqueItem;
  42088. }();
  42089. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeOffset.js
  42090. function ThemeOffset_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42091. function ThemeOffset_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  42092. function ThemeOffset_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeOffset_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeOffset_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  42093. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42094. * This program are made available under the terms of the Apache License, Version 2.0
  42095. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  42096. /**
  42097. * @class ThemeOffset
  42098. * @deprecatedclass SuperMap.ThemeOffset
  42099. * @category iServer Map Theme
  42100. * @classdesc 专题图中文本或符号相对于要素内点的偏移量设置类。
  42101. * 通过该类可以设置专题图中标记文本或符号的偏移量以及偏移量是否随地图缩放而改变。
  42102. * @param {Object} options - 可选参数。
  42103. * @param {boolean} [options.offsetFixed=false] - 当前专题图是否固定标记文本或符号的偏移量。
  42104. * @param {string} [options.offsetX='0.0'] - 专题图中文本或符号相对于要素内点的水平偏移量。
  42105. * @param {string} [options.offsetY='0.0'] - 专题图中文本或符号相对于要素内点的垂直偏移量。
  42106. * @usage
  42107. */
  42108. var ThemeOffset = /*#__PURE__*/function () {
  42109. function ThemeOffset(options) {
  42110. ThemeOffset_classCallCheck(this, ThemeOffset);
  42111. /**
  42112. * @member {boolean} [ThemeOffset.prototype.offsetFixed=false]
  42113. * @description 当前专题图是否固定标记文本或符号的偏移量。所谓固定偏移量,指文本或符号的偏移量不随地图的缩放而变化。
  42114. */
  42115. this.offsetFixed = false;
  42116. /**
  42117. * @member {string} [ThemeOffset.prototype.offsetX=0.0]
  42118. * @description 专题图中文本或符号相对于要素内点的水平偏移量。偏移量的单位为地图单位。
  42119. * 该偏移量的值为一个常量值或者字段表达式所表示的值,即如果字段表达式为 SmID,其中 SmID = 2,那么水平偏移量为2。
  42120. */
  42121. this.offsetX = "0.0";
  42122. /**
  42123. * @member {string} [ThemeOffset.prototype.offsetY=0.0]
  42124. * @description 专题图中文本或符号相对于要素内点的垂直偏移量。偏移量的单位为地图单位。
  42125. * 该偏移量的值为一个常量值或者字段表达式所表示的值,即如果字段表达式为 SmID,其中 SmID = 2,那么垂直偏移量为2。
  42126. */
  42127. this.offsetY = "0.0";
  42128. if (options) {
  42129. Util_Util.extend(this, options);
  42130. }
  42131. this.CLASS_NAME = "SuperMap.ThemeOffset";
  42132. }
  42133. /**
  42134. * @function ThemeOffset.prototype.destroy
  42135. * @description 释放资源,将引用资源的属性置空。
  42136. */
  42137. ThemeOffset_createClass(ThemeOffset, [{
  42138. key: "destroy",
  42139. value: function destroy() {
  42140. var me = this;
  42141. me.offsetFixed = null;
  42142. me.offsetX = null;
  42143. me.offsetY = null;
  42144. }
  42145. /**
  42146. * @function ThemeOffset.fromObj
  42147. * @description 从传入对象获取专题图中文本或符号相对于要素内点的偏移量设置类。
  42148. * @param {Object} obj - 传入对象。
  42149. * @returns {ThemeOffset} ThemeOffset 对象。
  42150. */
  42151. }], [{
  42152. key: "fromObj",
  42153. value: function fromObj(obj) {
  42154. if (!obj) {
  42155. return;
  42156. }
  42157. var res = new ThemeOffset();
  42158. Util_Util.copy(res, obj);
  42159. return res;
  42160. }
  42161. }]);
  42162. return ThemeOffset;
  42163. }();
  42164. ;// CONCATENATED MODULE: ./src/common/iServer/LabelMixedTextStyle.js
  42165. function LabelMixedTextStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42166. function LabelMixedTextStyle_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  42167. function LabelMixedTextStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelMixedTextStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelMixedTextStyle_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  42168. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42169. * This program are made available under the terms of the Apache License, Version 2.0
  42170. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  42171. /**
  42172. * @class LabelMixedTextStyle
  42173. * @deprecatedclass SuperMap.LabelMixedTextStyle
  42174. * @category iServer Map Theme
  42175. * @classdesc 标签文本复合风格类。
  42176. * 该类主要用于对标签专题图中标签的文本内容进行风格设置。通过该类用户可以使标签的文字显示不同的风格,比如文本 “喜马拉雅山”,通过本类可以将前三个字用红色显示,后两个字用蓝色显示。对同一文本设置不同的风格实质上是对文本的字符进行分段,同一分段内的字符具有相同的显示风格。对字符分段有两种方式,一种是利用分隔符对文本进行分段;另一种是根据分段索引值进行分段:</br>
  42177. * 1.利用分隔符对文本进行分段: 比如文本 “5&109” 被分隔符 “&” 分为 “5” 和 “109” 两部分,
  42178. * 在显示时,“5” 和分隔符 “&” 使用同一个风格,字符串 “109” 使用相同的风格。<br>
  42179. * 2.利用分段索引值进行分段: 文本中字符的索引值是以0开始的整数,比如文本 “珠穆朗玛峰”,
  42180. * 第一个字符(“珠”)的索引值为 0,第二个字符(“穆”)的索引值为 1,以此类推;当设置分段索引值为 1,3,4,9 时,
  42181. * 字符分段范围相应的就是 (-∞,1),[1,3),[3,4),[4,9),[9,+∞),可以看出索引号为 0 的字符(即“珠” )在第一个分段内,
  42182. * 索引号为 1,2 的字符(即“穆”、“朗”)位于第二个分段内,索引号为 3 的字符(“玛”)在第三个分段内,索引号为 4 的字符(“峰”)在第四个分段内,其余分段中没有字符。
  42183. * @param {Object} options - 可选参数。
  42184. * @param {ServerTextStyle} [options.defaultStyle] - 默认的文本复合风格。
  42185. * @param {string} [options.separator] - 文本的分隔符。
  42186. * @param {boolean} [options.separatorEnabled=false] - 文本的分隔符是否有效。
  42187. * @param {Array.<number>} [options.splitIndexes] - 分段索引值,分段索引值用来对文本中的字符进行分段。
  42188. * @param {Array.<ServerTextStyle>} [options.styles] - 文本样式集合。
  42189. * @usage
  42190. */
  42191. var LabelMixedTextStyle = /*#__PURE__*/function () {
  42192. function LabelMixedTextStyle(options) {
  42193. LabelMixedTextStyle_classCallCheck(this, LabelMixedTextStyle);
  42194. /**
  42195. * @member {ServerTextStyle} LabelMixedTextStyle.prototype.defaultStyle
  42196. * @description 默认的文本复合风格,即 ServerTextStyle 各字段的默认值。
  42197. */
  42198. this.defaultStyle = null;
  42199. /**
  42200. * @member {string} LabelMixedTextStyle.prototype.separator
  42201. * @description 文本的分隔符,分隔符的风格与前一个字符的风格一样。文本的分隔符是一个将文本分割开的符号,
  42202. * 比如文本 “5_109” 被 “ _ ” 分隔为 “5” 和 “109” 两部分,假设有风格数组:style1、style2。
  42203. * 在显示时,“5” 和分隔符 “ _ ” 使用 Style1 风格渲染,字符串 “109” 使用 Style2 的风格。
  42204. */
  42205. this.separator = null;
  42206. /**
  42207. * @member {boolean} [LabelMixedTextStyle.prototype.separatorEnabled=false]
  42208. * @description 文本的分隔符是否有效。分隔符有效时利用分隔符对文本进行分段;无效时根据文本中字符的位置进行分段。
  42209. * 分段后,同一分段内的字符具有相同的显示风格。
  42210. */
  42211. this.separatorEnabled = false;
  42212. /**
  42213. * @member {Array.<number>} LabelMixedTextStyle.prototype.splitIndexes
  42214. * @description 分段索引值,分段索引值用来对文本中的字符进行分段。
  42215. * 文本中字符的索引值是以 0 开始的整数,比如文本“珠穆朗玛峰”,第一个字符(“珠”)的索引值为0,第二个字符(“穆”)的索引值为 1,
  42216. * 以此类推;当设置分段索引值数组为 [1,3,4,9] 时,字符分段范围相应的就是 (-∞,1),[1,3),[3,4),[4,9),[9,+∞),
  42217. * 可以看出索引号为 0 的字符(即 “珠”)在第一个分段内,索引号为 1,2 的字符(即 “穆”、“朗”)位于第二个分段内,
  42218. * 索引号为 3 的字符(“玛”)在第三个分段内,索引号为 4 的字符(“峰”)在第四个分段内,其余分段中没有字符。
  42219. */
  42220. this.splitIndexes = null;
  42221. /**
  42222. * @member {Array.<ServerTextStyle>} LabelMixedTextStyle.prototype.styles
  42223. * @description 文本样式集合。文本样式集合中的样式根据索引与不同分段一一对应,
  42224. * 如果有分段没有风格对应则使用 defaultStyle。
  42225. */
  42226. this.styles = new ServerTextStyle();
  42227. if (options) {
  42228. Util_Util.extend(this, options);
  42229. }
  42230. this.CLASS_NAME = "SuperMap.LabelMixedTextStyle";
  42231. }
  42232. /**
  42233. * @function LabelMixedTextStyle.prototype.destroy
  42234. * @description 释放资源,将引用资源的属性置空。
  42235. */
  42236. LabelMixedTextStyle_createClass(LabelMixedTextStyle, [{
  42237. key: "destroy",
  42238. value: function destroy() {
  42239. var me = this;
  42240. if (me.defaultStyle) {
  42241. me.defaultStyle.destroy();
  42242. me.defaultStyle = null;
  42243. }
  42244. me.separator = null;
  42245. me.separatorEnabled = null;
  42246. if (me.splitIndexes) {
  42247. me.splitIndexes = null;
  42248. }
  42249. if (me.styles) {
  42250. for (var i = 0, styles = me.styles, len = styles.length; i < len; i++) {
  42251. styles[i].destroy();
  42252. }
  42253. me.styles = null;
  42254. }
  42255. }
  42256. /**
  42257. * @function LabelMixedTextStyle.fromObj
  42258. * @description 从传入对象获取标签文本复合风格类。
  42259. * @param {Object} obj - 传入对象。
  42260. * @returns {LabelMixedTextStyle} 返回新的 LabelMixedTextStyle 对象。
  42261. */
  42262. }], [{
  42263. key: "fromObj",
  42264. value: function fromObj(obj) {
  42265. if (!obj) {
  42266. return;
  42267. }
  42268. var res = new LabelMixedTextStyle();
  42269. var stys = obj.styles;
  42270. Util_Util.copy(res, obj);
  42271. res.defaultStyle = new ServerTextStyle(obj.defaultStyle);
  42272. if (stys) {
  42273. res.styles = [];
  42274. for (var i = 0, len = stys.length; i < len; i++) {
  42275. res.styles.push(new ServerTextStyle(stys[i]));
  42276. }
  42277. }
  42278. return res;
  42279. }
  42280. }]);
  42281. return LabelMixedTextStyle;
  42282. }();
  42283. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelText.js
  42284. function ThemeLabelText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42285. function ThemeLabelText_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  42286. function ThemeLabelText_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelText_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelText_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  42287. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42288. * This program are made available under the terms of the Apache License, Version 2.0
  42289. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  42290. /**
  42291. * @class ThemeLabelText
  42292. * @deprecatedclass SuperMap.ThemeLabelText
  42293. * @category iServer Map Theme
  42294. * @classdesc 标签中文本风格类。
  42295. * 通过该类可以设置标签中的文本字体大小和显示风格。
  42296. * @param {Object} options - 参数。
  42297. * @param {number} [options.maxTextHeight=0] - 标签中文本的最大高度。
  42298. * @param {number} [options.maxTextWidth=0] - 标签中文本的最大宽度。
  42299. * @param {number} [options.minTextHeight=0] - 标签中文本的最小高度。
  42300. * @param {number} [options.minTextWidth=0] - 标签中文本的最小宽度。
  42301. * @param {ServerTextStyle} [options.uniformStyle] - 统一文本风格。
  42302. * @param {LabelMixedTextStyle} [options.uniformMixedStyle] - 标签专题图统一的文本复合风格。
  42303. * @usage
  42304. */
  42305. var ThemeLabelText = /*#__PURE__*/function () {
  42306. function ThemeLabelText(options) {
  42307. ThemeLabelText_classCallCheck(this, ThemeLabelText);
  42308. /**
  42309. * @member {number} [ThemeLabelText.prototype.maxTextHeight=0]
  42310. * @description 标签中文本的最大高度。当标签文本不固定大小时,即 ServerTextStyle.sizeFixed = false 有效,
  42311. * 当放大后的文本高度超过最大高度之后就不再放大。高度单位为毫米。
  42312. */
  42313. this.maxTextHeight = 0;
  42314. /**
  42315. * @member {number} [ThemeLabelText.prototype.maxTextWidth=0]
  42316. * @description 标签中文本的最大宽度。当标签文本不固定大小时,即 ServerTextStyle.sizeFixed = false 有效,
  42317. * 当放大后的文本宽度超过最大高度之后就不再放大。宽度单位为毫米。
  42318. */
  42319. this.maxTextWidth = 0;
  42320. /**
  42321. * @member {number} [ThemeLabelText.prototype.minTextHeight=0]
  42322. * @description 标签中文本的最小高度。当标签文本不固定大小时,即 ServerTextStyle.sizeFixed = false 有效,
  42323. * 当缩小后的文本高度小于最小高度之后就不再缩小。高度单位为毫米。
  42324. */
  42325. this.minTextHeight = 0;
  42326. /**
  42327. * @member {number} [ThemeLabelText.prototype.minTextWidth=0]
  42328. * @description 标签中文本的最小宽度。当标签文本不固定大小时,即 ServerTextStyle.sizeFixed = false 有效,
  42329. * 当缩小后的文本宽度小于最小宽度之后就不再缩小。宽度单位为毫米。
  42330. */
  42331. this.minTextWidth = 0;
  42332. /**
  42333. * @member {ServerTextStyle} [ThemeLabelText.prototype.uniformStyle]
  42334. * @description 统一文本风格。当标签专题图子项的个数大于等于1时,
  42335. * uniformStyle 不起作用,各标签的风格使用子项中设置的风格。各种风格的优先级从高到低为:uniformMixedStyle(标签文本的复合风格),
  42336. * ThemeLabelItem.style(分段子项的文本风格),uniformStyle(统一文本风格)。
  42337. */
  42338. this.uniformStyle = new ServerTextStyle();
  42339. /**
  42340. *@member {LabelMixedTextStyle} [ThemeLabelText.prototype.uniformMixedStyle]
  42341. *@description 标签专题图统一的文本复合风格。通过该类可以使同一个标签中的文字使用多种风格显示。各种风格的优先级从高到低为:uniformMixedStyle(标签文本的复合风格),
  42342. * ThemeLabelItem.style(分段子项的文本风格),uniformStyle(统一文本风格)。
  42343. */
  42344. this.uniformMixedStyle = null;
  42345. if (options) {
  42346. Util_Util.extend(this, options);
  42347. }
  42348. this.CLASS_NAME = "SuperMap.ThemeLabelText";
  42349. }
  42350. /**
  42351. * @function ThemeLabelText.prototype.destroy
  42352. * @description 释放资源,将引用资源的属性置空。
  42353. */
  42354. ThemeLabelText_createClass(ThemeLabelText, [{
  42355. key: "destroy",
  42356. value: function destroy() {
  42357. var me = this;
  42358. me.maxTextHeight = null;
  42359. me.maxTextWidth = null;
  42360. me.minTextHeight = null;
  42361. me.minTextWidth = null;
  42362. if (me.uniformStyle) {
  42363. me.uniformStyle.destroy();
  42364. me.uniformStyle = null;
  42365. }
  42366. if (me.uniformMixedStyle) {
  42367. me.uniformMixedStyle.destroy();
  42368. me.uniformMixedStyle = null;
  42369. }
  42370. }
  42371. /**
  42372. * @function ThemeLabelText.fromObj
  42373. * @description 从传入对象获取标签中文本风格类。
  42374. * @param {Object} obj - 传入对象。
  42375. * @returns {ThemeLabelText} ThemeLabelText 对象。
  42376. */
  42377. }], [{
  42378. key: "fromObj",
  42379. value: function fromObj(obj) {
  42380. if (!obj) {
  42381. return;
  42382. }
  42383. var res = new ThemeLabelText();
  42384. Util_Util.copy(res, obj);
  42385. res.uniformStyle = ServerTextStyle.fromObj(obj.uniformStyle);
  42386. res.uniformMixedStyle = LabelMixedTextStyle.fromObj(obj.uniformMixedStyle);
  42387. return res;
  42388. }
  42389. }]);
  42390. return ThemeLabelText;
  42391. }();
  42392. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelAlongLine.js
  42393. function ThemeLabelAlongLine_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42394. function ThemeLabelAlongLine_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  42395. function ThemeLabelAlongLine_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelAlongLine_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelAlongLine_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  42396. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42397. * This program are made available under the terms of the Apache License, Version 2.0
  42398. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  42399. /**
  42400. * @class ThemeLabelAlongLine
  42401. * @deprecatedclass SuperMap.ThemeLabelAlongLine
  42402. * @category iServer Map Theme
  42403. * @classdesc 标签沿线标注样式类。
  42404. * @param {Object} options - 可选参数。
  42405. * @param {boolean} [options.isAlongLine=true] - 是否沿线显示文本。
  42406. * @param {AlongLineDirection} [options.alongLineDirection=AlongLineDirection.LB_TO_RT] - 标签沿线标注方向。
  42407. * @param {boolean} [options.angleFixed=false] - 当沿线显示文本时,是否将文本角度固定。
  42408. * @param {boolean} [options.repeatedLabelAvoided=false] - 沿线循环标注时是否避免标签重复标注。
  42409. * @param {boolean} [options.repeatIntervalFixed=false] - 循环标注间隔是否固定。
  42410. * @param {number} [options.labelRepeatInterval=0] - 沿线且循环标注时循环标注的间隔。
  42411. * @usage
  42412. */
  42413. var ThemeLabelAlongLine = /*#__PURE__*/function () {
  42414. function ThemeLabelAlongLine(options) {
  42415. ThemeLabelAlongLine_classCallCheck(this, ThemeLabelAlongLine);
  42416. /**
  42417. * @member {boolean} [ThemeLabelAlongLine.prototype.isAlongLine=true]
  42418. * @description 是否沿线显示文本。true 表示沿线显示文本,false 表示正常显示文本。
  42419. */
  42420. this.isAlongLine = true;
  42421. /**
  42422. * @member {AlongLineDirection} [ThemeLabelAlongLine.prototype.alongLineDirection=AlongLineDirection.LB_TO_RT]
  42423. * @description 标签沿线标注方向。
  42424. */
  42425. this.alongLineDirection = AlongLineDirection.LB_TO_RT;
  42426. /**
  42427. * @member {boolean} [ThemeLabelAlongLine.prototype.angleFixed=false]
  42428. * @description 当沿线显示文本时,是否将文本角度固定。true 表示按固定文本角度显示文本,false 表示按照沿线角度显示文本。
  42429. * 如果固定角度,则所有标签均按所设置的文本风格中字体的旋转角度来显示,不考虑沿线标注的方向;
  42430. * 如果不固定角度,在显示标签时会同时考虑字体的旋转角度和沿线标注的方向。
  42431. */
  42432. this.angleFixed = false;
  42433. /**
  42434. * @member {boolean} ThemeLabelAlongLine.prototype.repeatedLabelAvoided
  42435. * @description 沿线循环标注时是否避免标签重复标注。
  42436. */
  42437. this.repeatedLabelAvoided = false;
  42438. /**
  42439. * @member {boolean} [ThemeLabelAlongLine.prototype.repeatIntervalFixed=false]
  42440. * @description 循环标注间隔是否固定。true 表示使用固定循环标注间隔,即使用逻辑坐标来显示循环标注间隔;
  42441. * false 表示循环标注间隔随地图的缩放而变化,即使用地理坐标来显示循环标注间隔。
  42442. */
  42443. this.repeatIntervalFixed = false;
  42444. /**
  42445. * @member {number} [ThemeLabelAlongLine.prototype.labelRepeatInterval=0]
  42446. * @description 沿线且循环标注时循环标注的间隔。长度的单位与地图的地理单位一致。只有设定 RepeatedLabelAvoided 为 true
  42447. * 的时候,labelRepeatInterval 属性才有效。
  42448. */
  42449. this.labelRepeatInterval = 0;
  42450. if (options) {
  42451. Util_Util.extend(this, options);
  42452. }
  42453. this.CLASS_NAME = "SuperMap.ThemeLabelAlongLine";
  42454. }
  42455. /**
  42456. * @function ThemeLabelAlongLine.prototype.destroy
  42457. * @description 释放资源,将引用资源的属性置空。
  42458. */
  42459. ThemeLabelAlongLine_createClass(ThemeLabelAlongLine, [{
  42460. key: "destroy",
  42461. value: function destroy() {
  42462. var me = this;
  42463. me.isAlongLine = null;
  42464. me.alongLineDirection = null;
  42465. me.angleFixed = null;
  42466. me.repeatedLabelAvoided = null;
  42467. me.repeatIntervalFixed = null;
  42468. me.labelRepeatInterval = null;
  42469. }
  42470. /**
  42471. * @function ThemeLabelAlongLine.fromObj
  42472. * @description 从传入对象获取标签沿线标注样式类。
  42473. * @param {Object} obj - 传入对象。
  42474. * @returns {ThemeLabelAlongLine} ThemeLabelAlongLine 对象。
  42475. */
  42476. }], [{
  42477. key: "fromObj",
  42478. value: function fromObj(obj) {
  42479. if (!obj) {
  42480. return;
  42481. }
  42482. var t = new ThemeLabelAlongLine();
  42483. Util_Util.copy(t, obj);
  42484. return t;
  42485. }
  42486. }]);
  42487. return ThemeLabelAlongLine;
  42488. }();
  42489. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelBackground.js
  42490. function ThemeLabelBackground_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42491. function ThemeLabelBackground_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  42492. function ThemeLabelBackground_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelBackground_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelBackground_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  42493. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42494. * This program are made available under the terms of the Apache License, Version 2.0
  42495. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  42496. /**
  42497. * @class ThemeLabelBackground
  42498. * @deprecatedclass SuperMap.ThemeLabelBackground
  42499. * @category iServer Map Theme
  42500. * @classdesc 标签背景风格类。通过该类可以设置标签的背景形状和风格。
  42501. * @param {Object} options - 可选参数。
  42502. * @param {LabelBackShape} [options.labelBackShape=LabelBackShape.NONE] - 标签专题图中标签背景的形状枚举类。
  42503. * @param {ServerStyle} [options.backStyle] - 标签专题图中标签背景风格。
  42504. * @usage
  42505. */
  42506. var ThemeLabelBackground = /*#__PURE__*/function () {
  42507. function ThemeLabelBackground(options) {
  42508. ThemeLabelBackground_classCallCheck(this, ThemeLabelBackground);
  42509. /**
  42510. * @member {LabelBackShape} [ThemeLabelBackground.prototype.labelBackShape=LabelBackShape.NONE]
  42511. * @description 标签专题图中标签背景风格。当背景形状
  42512. * labelBackShape 属性设为 NONE(即无背景形状)时,backStyle 属性无效。
  42513. */
  42514. this.labelBackShape = LabelBackShape.NONE;
  42515. /**
  42516. * @member {ServerStyle} [ThemeLabelBackground.prototype.backStyle]
  42517. * @description 标签专题图中标签背景的形状枚举类。背景类型可以是矩形、圆角矩形、菱形、椭圆形、三角形和符号等,即不使用任何的形状作为标签的背景。
  42518. */
  42519. this.backStyle = new ServerStyle();
  42520. if (options) {
  42521. Util_Util.extend(this, options);
  42522. }
  42523. this.CLASS_NAME = "SuperMap.ThemeLabelBackground";
  42524. }
  42525. /**
  42526. * @function ThemeLabelBackground.prototype.destroy
  42527. * @description 释放资源,将引用资源的属性置空。
  42528. */
  42529. ThemeLabelBackground_createClass(ThemeLabelBackground, [{
  42530. key: "destroy",
  42531. value: function destroy() {
  42532. var me = this;
  42533. me.labelBackShape = null;
  42534. if (me.backStyle) {
  42535. me.backStyle.destroy();
  42536. me.backStyle = null;
  42537. }
  42538. }
  42539. /**
  42540. * @function ThemeLabelBackground.fromObj
  42541. * @description 从传入对象获取标签背景风格类。
  42542. * @param {Object} obj - 传入对象。
  42543. * @returns {ThemeLabelBackground} ThemeLabelBackground 对象。
  42544. */
  42545. }], [{
  42546. key: "fromObj",
  42547. value: function fromObj(obj) {
  42548. if (!obj) {
  42549. return;
  42550. }
  42551. var t = new ThemeLabelBackground();
  42552. t.labelBackShape = obj.labelBackShape;
  42553. t.backStyle = ServerStyle.fromJson(obj.backStyle);
  42554. return t;
  42555. }
  42556. }]);
  42557. return ThemeLabelBackground;
  42558. }();
  42559. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabel.js
  42560. function ThemeLabel_typeof(obj) { "@babel/helpers - typeof"; return ThemeLabel_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ThemeLabel_typeof(obj); }
  42561. function ThemeLabel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42562. function ThemeLabel_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  42563. function ThemeLabel_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabel_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabel_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  42564. function ThemeLabel_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeLabel_get = Reflect.get.bind(); } else { ThemeLabel_get = function _get(target, property, receiver) { var base = ThemeLabel_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ThemeLabel_get.apply(this, arguments); }
  42565. function ThemeLabel_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeLabel_getPrototypeOf(object); if (object === null) break; } return object; }
  42566. function ThemeLabel_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ThemeLabel_setPrototypeOf(subClass, superClass); }
  42567. function ThemeLabel_setPrototypeOf(o, p) { ThemeLabel_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeLabel_setPrototypeOf(o, p); }
  42568. function ThemeLabel_createSuper(Derived) { var hasNativeReflectConstruct = ThemeLabel_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThemeLabel_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThemeLabel_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThemeLabel_possibleConstructorReturn(this, result); }; }
  42569. function ThemeLabel_possibleConstructorReturn(self, call) { if (call && (ThemeLabel_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ThemeLabel_assertThisInitialized(self); }
  42570. function ThemeLabel_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  42571. function ThemeLabel_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  42572. function ThemeLabel_getPrototypeOf(o) { ThemeLabel_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeLabel_getPrototypeOf(o); }
  42573. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42574. * This program are made available under the terms of the Apache License, Version 2.0
  42575. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  42576. /**
  42577. * @class ThemeLabel
  42578. * @deprecatedclass SuperMap.ThemeLabel
  42579. * @category iServer Map Theme
  42580. * @classdesc 标签专题图类。
  42581. * @extends CommonTheme
  42582. * @param {Object} options - 参数。
  42583. * @param {Array.<ThemeLabelItem>} options.items - 子项数组。
  42584. * @param {string} options.labelExpression - 标注字段表达式。
  42585. * @param {Array.<LabelImageCell|LabelSymbolCell|LabelThemeCell>} options.matrixCells - 矩阵标签元素数组。
  42586. * @param {ThemeLabelAlongLine} [options.alongLine] - 标签沿线标注方向样式类。
  42587. * @param {ThemeLabelBackground} [options.background] - 标签的背景风格类。
  42588. * @param {LabelOverLengthMode} [options.labelOverLengthMode=LabelOverLengthMode.NONE] - 超长标签的处理模式枚举类。
  42589. * @param {number} [options.maxLabelLength=256] - 标签在每一行显示的最大长度。
  42590. * @param {number} [options.numericPrecision=0] - 通过该字段设置其显示的精度。
  42591. * @param {ThemeOffset} [options.offset] - 指定标签专题图中标记文本相对于要素内点的偏移量对象。
  42592. * @param {boolean} [options.overlapAvoided=true] - 是否允许以文本避让方式显示文本。
  42593. * @param {string} [options.rangeExpression] - 制作分段标签专题的分段字段或字段表达式。
  42594. * @param {boolean} [options.smallGeometryLabeled=false] - 是否显示长度大于被标注对象本身长度的标签。
  42595. * @param {ThemeLabelText} options.text - 标签中文本风格。
  42596. * @param {number} [options.textSpace=0] - 沿线标注,相邻两个文字之间的间距,单位当前设置的字高。
  42597. * @param {ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  42598. * @usage
  42599. */
  42600. var ThemeLabel = /*#__PURE__*/function (_Theme) {
  42601. ThemeLabel_inherits(ThemeLabel, _Theme);
  42602. var _super = ThemeLabel_createSuper(ThemeLabel);
  42603. function ThemeLabel(options) {
  42604. var _this;
  42605. ThemeLabel_classCallCheck(this, ThemeLabel);
  42606. _this = _super.call(this, "LABEL", options);
  42607. /**
  42608. * @member {ThemeLabelAlongLine} [ThemeLabel.prototype.alongLine]
  42609. * @description 标签沿线标注方向样式类。
  42610. * 在该类中可以设置标签是否沿线标注以及沿线标注的多种方式。沿线标注属性只适用于线数据集专题图。
  42611. */
  42612. _this.alongLine = new ThemeLabelAlongLine();
  42613. /**
  42614. * @member {ThemeLabelBackground} [ThemeLabel.prototype.background]
  42615. * @description 标签专题图中标签的背景风格类。通过该字段可以设置标签的背景形状和风格。
  42616. */
  42617. _this.background = new ThemeLabelBackground();
  42618. /**
  42619. * @member {Array.<ThemeLabelItem>} [ThemeLabel.prototype.items]
  42620. * @description 分段标签专题图的子项数组。分段标签专题图使用 rangeExpression
  42621. * 指定数字型的字段作为分段数据,items 中的每个子对象的 [start,end) 分段值必须来源于属性 rangeExpression 的字段值。每个子项拥有自己的风格。
  42622. */
  42623. _this.items = null;
  42624. /**
  42625. * @member {Array.<ThemeLabelUniqueItem>} ThemeLabel.prototype.uniqueItems
  42626. * @description 单值标签专题图子项数组。单值标签专题图使用 uniqueExpression单值标签专题图子项集合。
  42627. */
  42628. _this.uniqueItems = null;
  42629. /**
  42630. * @member {string} ThemeLabel.prototype.labelExpression
  42631. * @description 标注字段表达式。系统将 labelExpression 对应的字段或字段表达式的值以标签的形式显示在图层中。
  42632. */
  42633. _this.labelExpression = null;
  42634. /**
  42635. * @member {LabelOverLengthMode} [ThemeLabel.prototype.labelOverLengthMode=LabelOverLengthMode.NONE] - 标签专题图中超长标签的处理模式枚举类。
  42636. * @description 对于标签的长度超过设置的标签最大长度 maxLabelLength 时称为超长标签。
  42637. */
  42638. _this.labelOverLengthMode = LabelOverLengthMode.NONE;
  42639. /**
  42640. * @member {Array.<LabelImageCell|LabelSymbolCell|LabelThemeCell>} ThemeLabel.prototype.matrixCells
  42641. * @description 矩阵标签元素数组,用于制作矩阵标签专题图。
  42642. * 数组中可以放置符号类型的矩阵标签元素和图片类型的矩阵标签元素。
  42643. */
  42644. _this.matrixCells = null;
  42645. /**
  42646. * @member {number} [ThemeLabel.prototype.maxLabelLength=256]
  42647. * @description 标签在每一行显示的最大长度,一个中文为两个字符。
  42648. * 如果超过最大长度,可以采用两种方式来处理,一种是换行的模式进行显示,另一种是以省略号方式显示。单位为字符。
  42649. */
  42650. _this.maxLabelLength = 256;
  42651. /**
  42652. * @member {number} [ThemeLabel.prototype.numericPrecision=0]
  42653. * @description 如果显示的标签内容为数字,通过该字段设置其显示的精度。例如标签对应的数字是8071.64529347,
  42654. * 如果该属性为0时,显示8071;为1时,显示8071.6;为3时,则是8071.645。
  42655. */
  42656. _this.numericPrecision = 0;
  42657. /**
  42658. * @member {ThemeOffset} [ThemeLabel.prototype.offset]
  42659. * @description 用于设置标签专题图中标记文本相对于要素内点的偏移量对象。
  42660. */
  42661. _this.offset = new ThemeOffset();
  42662. /**
  42663. * @member {boolean} [ThemeLabel.prototype.overlapAvoided=true]
  42664. * @description 是否允许以文本避让方式显示文本。true 表示自动避免文本叠盖。只针对该标签专题图层中的文本数据。
  42665. * 在标签重叠度很大的情况下,即使使用自动避让功能,可能也无法完全避免标签重叠现象。
  42666. */
  42667. _this.overlapAvoided = true;
  42668. /**
  42669. * @member {string} ThemeLabel.prototype.rangeExpression
  42670. * @description 制作分段标签专题的分段字段或字段表达式。该表达式对应的字段(或者字段表达式)的值应该为数值型。
  42671. * 该字段与 items 分段子项联合使用,每个子项的起始值 [start,end)来源于 rangeExpression 字段值。
  42672. * 最后 labelExpression 指定的标签字段(标签专题图要显示的具体内容)会根据分段子项的风格进行分段显示。
  42673. */
  42674. _this.rangeExpression = null;
  42675. /**
  42676. * @member {string} ThemeLabel.prototype.uniqueExpression
  42677. * @description 用于制作单值专题图的字段或字段表达式。
  42678. * 该字段值的数据类型可以为数值型或字符型。如果设置字段表达式,只能是相同数据类型字段间的运算。必须与labelExpression一起使用。
  42679. */
  42680. _this.uniqueExpression = null;
  42681. /**
  42682. * @member {boolean} [ThemeLabel.prototype.smallGeometryLabeled=false]
  42683. * @description 是否显示长度大于被标注对象本身长度的标签。在标签的长度大于线或者面对象本身的长度时,
  42684. * 如果该值为 true,则标签文字会叠加在一起显示,为了清楚完整的显示该标签,
  42685. * 可以采用换行模式来显示标签,但必须保证每行的长度小于对象本身的长度。
  42686. */
  42687. _this.smallGeometryLabeled = false;
  42688. /**
  42689. * @member {ThemeLabelText} ThemeLabel.prototype.text
  42690. * @description 标签中文本风格。
  42691. */
  42692. _this.text = new ThemeLabelText();
  42693. /**
  42694. * @member {number} [ThemeLabel.prototype.textSpace=0]
  42695. * @description 沿线标注,相邻两个文字之间的间距,单位当前设置的字高。
  42696. */
  42697. _this.textSpace = 0;
  42698. if (options) {
  42699. Util_Util.extend(ThemeLabel_assertThisInitialized(_this), options);
  42700. }
  42701. _this.CLASS_NAME = "SuperMap.ThemeLabel";
  42702. return _this;
  42703. }
  42704. /**
  42705. * @function ThemeLabel.prototype.destroy
  42706. * @override
  42707. */
  42708. ThemeLabel_createClass(ThemeLabel, [{
  42709. key: "destroy",
  42710. value: function destroy() {
  42711. ThemeLabel_get(ThemeLabel_getPrototypeOf(ThemeLabel.prototype), "destroy", this).call(this);
  42712. var me = this;
  42713. me.alongLine = null;
  42714. if (me.background) {
  42715. me.background.destroy();
  42716. me.background = null;
  42717. }
  42718. if (me.items) {
  42719. for (var i = 0, items = me.items, len = items.length; i < len; i++) {
  42720. items[i].destroy();
  42721. }
  42722. me.items = null;
  42723. }
  42724. if (me.uniqueItems) {
  42725. for (var j = 0, uniqueItems = me.uniqueItems, uniqueLen = uniqueItems.length; j < uniqueLen; j++) {
  42726. uniqueItems[j].destory();
  42727. }
  42728. me.uniqueItems = null;
  42729. }
  42730. me.labelExpression = null;
  42731. me.labelOverLengthMode = null;
  42732. me.matrixCells = null;
  42733. me.maxLabelLength = null;
  42734. me.numericPrecision = null;
  42735. me.overlapAvoided = null;
  42736. me.rangeExpression = null;
  42737. me.uniqueExpression = null;
  42738. if (me.offset) {
  42739. me.offset.destroy();
  42740. me.offset = null;
  42741. }
  42742. me.overlapAvoided = null;
  42743. me.smallGeometryLabeled = null;
  42744. if (me.text) {
  42745. me.text.destroy();
  42746. me.text = null;
  42747. }
  42748. me.textSpace = null;
  42749. }
  42750. /**
  42751. * @function ThemeLabel.prototype.toJSON
  42752. * @description 将themeLabel对象转化为 JSON 字符串。
  42753. * @returns {string} 返回转换后的 JSON 字符串。
  42754. */
  42755. }, {
  42756. key: "toJSON",
  42757. value: function toJSON() {
  42758. return Util_Util.toJSON(this.toServerJSONObject());
  42759. }
  42760. /**
  42761. * @function ThemeLabel.prototype.toServerJSONObject
  42762. * @description 转换成对应的 JSON 格式对象。
  42763. * @returns {Object} 对应的 JSON 格式对象。
  42764. */
  42765. }, {
  42766. key: "toServerJSONObject",
  42767. value: function toServerJSONObject() {
  42768. var obj = {};
  42769. obj.type = this.type;
  42770. obj.memoryData = this.memoryData;
  42771. if (this.alongLine) {
  42772. obj.alongLine = this.alongLine.isAlongLine;
  42773. obj.alongLineDirection = this.alongLine.alongLineDirection;
  42774. obj.angleFixed = this.alongLine.angleFixed;
  42775. obj.isLabelRepeated = this.alongLine.isLabelRepeated;
  42776. obj.labelRepeatInterval = this.alongLine.labelRepeatInterval;
  42777. obj.repeatedLabelAvoided = this.alongLine.repeatedLabelAvoided;
  42778. obj.repeatIntervalFixed = this.alongLine.repeatIntervalFixed;
  42779. }
  42780. if (this.offset) {
  42781. obj.offsetFixed = this.offset.offsetFixed;
  42782. obj.offsetX = this.offset.offsetX;
  42783. obj.offsetY = this.offset.offsetY;
  42784. }
  42785. if (this.text) {
  42786. obj.maxTextHeight = this.text.maxTextHeight;
  42787. obj.maxTextWidth = this.text.maxTextWidth;
  42788. obj.minTextHeight = this.text.minTextHeight;
  42789. obj.minTextWidth = this.text.minTextWidth;
  42790. obj.uniformStyle = this.text.uniformStyle;
  42791. obj.uniformMixedStyle = this.text.uniformMixedStyle;
  42792. }
  42793. if (this.background) {
  42794. obj.labelBackShape = this.background.labelBackShape;
  42795. obj.backStyle = this.background.backStyle;
  42796. }
  42797. obj.labelOverLengthMode = this.labelOverLengthMode;
  42798. obj.maxLabelLength = this.maxLabelLength;
  42799. obj.smallGeometryLabeled = this.smallGeometryLabeled;
  42800. obj.rangeExpression = this.rangeExpression;
  42801. obj.uniqueExpression = this.uniqueExpression;
  42802. obj.numericPrecision = this.numericPrecision;
  42803. obj.items = this.items;
  42804. obj.uniqueItems = this.uniqueItems;
  42805. obj.labelExpression = this.labelExpression;
  42806. obj.overlapAvoided = this.overlapAvoided;
  42807. obj.matrixCells = this.matrixCells;
  42808. obj.textSpace = this.textSpace;
  42809. return obj;
  42810. }
  42811. /**
  42812. * @function ThemeLabel.fromObj
  42813. * @description 从传入对象获取标签专题图类。
  42814. * @param {Object} obj - 传入对象。
  42815. * @returns {ThemeLabel} ThemeLabel 对象。
  42816. */
  42817. }], [{
  42818. key: "fromObj",
  42819. value: function fromObj(obj) {
  42820. if (!obj) {
  42821. return;
  42822. }
  42823. var lab = new ThemeLabel();
  42824. var itemsL = obj.items,
  42825. itemsU = obj.uniqueItems,
  42826. cells = obj.matrixCells;
  42827. obj.matrixCells = null;
  42828. Util_Util.copy(lab, obj);
  42829. lab.alongLine = ThemeLabelAlongLine.fromObj(obj);
  42830. lab.background = ThemeLabelBackground.fromObj(obj);
  42831. if (itemsL) {
  42832. lab.items = [];
  42833. for (var i = 0, len = itemsL.length; i < len; i++) {
  42834. lab.items.push(ThemeLabelItem.fromObj(itemsL[i]));
  42835. }
  42836. }
  42837. if (itemsU) {
  42838. lab.uniqueItems = [];
  42839. for (var j = 0, uniqueLen = itemsU.length; j < uniqueLen; j++) {
  42840. lab.uniqueItems.push(ThemeUniqueItem.fromObj(itemsU[j]));
  42841. }
  42842. }
  42843. if (cells) {
  42844. lab.matrixCells = [];
  42845. for (var _i2 = 0, _len2 = cells.length; _i2 < _len2; _i2++) {
  42846. //TODO
  42847. //lab.matrixCells.push(LabelMatrixCell.fromObj(cells[i]));
  42848. }
  42849. }
  42850. lab.offset = ThemeOffset.fromObj(obj);
  42851. lab.text = ThemeLabelText.fromObj(obj);
  42852. return lab;
  42853. }
  42854. }]);
  42855. return ThemeLabel;
  42856. }(Theme);
  42857. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeUnique.js
  42858. function ThemeUnique_typeof(obj) { "@babel/helpers - typeof"; return ThemeUnique_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ThemeUnique_typeof(obj); }
  42859. function ThemeUnique_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42860. function ThemeUnique_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  42861. function ThemeUnique_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeUnique_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeUnique_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  42862. function ThemeUnique_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeUnique_get = Reflect.get.bind(); } else { ThemeUnique_get = function _get(target, property, receiver) { var base = ThemeUnique_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ThemeUnique_get.apply(this, arguments); }
  42863. function ThemeUnique_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeUnique_getPrototypeOf(object); if (object === null) break; } return object; }
  42864. function ThemeUnique_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ThemeUnique_setPrototypeOf(subClass, superClass); }
  42865. function ThemeUnique_setPrototypeOf(o, p) { ThemeUnique_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeUnique_setPrototypeOf(o, p); }
  42866. function ThemeUnique_createSuper(Derived) { var hasNativeReflectConstruct = ThemeUnique_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThemeUnique_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThemeUnique_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThemeUnique_possibleConstructorReturn(this, result); }; }
  42867. function ThemeUnique_possibleConstructorReturn(self, call) { if (call && (ThemeUnique_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ThemeUnique_assertThisInitialized(self); }
  42868. function ThemeUnique_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  42869. function ThemeUnique_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  42870. function ThemeUnique_getPrototypeOf(o) { ThemeUnique_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeUnique_getPrototypeOf(o); }
  42871. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42872. * This program are made available under the terms of the Apache License, Version 2.0
  42873. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  42874. /**
  42875. * @class ThemeUnique
  42876. * @deprecatedclass SuperMap.ThemeUnique
  42877. * @category iServer Map Theme
  42878. * @classdesc 单值专题图。单值专题图是利用不同的颜色或符号(线型、填充)表示图层中某一属性信息的不同属性值,属性值相同的要素具有相同的渲染风格。单值专题图多用于具有分类属性的地图上,
  42879. * 比如土壤类型分布图、土地利用图、行政区划图等。单值专题图着重表示现象质的差别,一般不表示数量的特征。尤其是有交叉或重叠现象时,此类不推荐使用,例如:民族分布区等。
  42880. * @extends {CommonTheme}
  42881. * @param {Object} options - 参数。
  42882. * @param {Array.<ThemeUniqueItem>} options.items - 子项类数组。
  42883. * @param {string} options.uniqueExpression - 指定单值专题图的字段或字段表达式。
  42884. * @param {ServerStyle} [options.defaultStyle] - 未参与单值专题图制作的对象的显示风格。
  42885. * @param {ColorGradientType} [options.colorGradientType=ColorGradientType.YELLOW_RED] - 渐变颜色枚举类。
  42886. * @param {ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  42887. * @usage
  42888. */
  42889. var ThemeUnique = /*#__PURE__*/function (_Theme) {
  42890. ThemeUnique_inherits(ThemeUnique, _Theme);
  42891. var _super = ThemeUnique_createSuper(ThemeUnique);
  42892. function ThemeUnique(options) {
  42893. var _this;
  42894. ThemeUnique_classCallCheck(this, ThemeUnique);
  42895. _this = _super.call(this, "UNIQUE", options);
  42896. /**
  42897. * @member {ServerStyle} ThemeUnique.prototype.defaultStyle
  42898. * @description 未参与单值专题图制作的对象的显示风格。
  42899. * 通过单值专题图子项数组 (items)可以指定某些要素参与单值专题图制作,对于那些没有被包含的要素,即不参加单值专题表达的要素,使用该风格显示。
  42900. */
  42901. _this.defaultStyle = new ServerStyle();
  42902. /**
  42903. * @member {Array.<ThemeUniqueItem>} ThemeUnique.prototype.items
  42904. * @description 单值专题图子项类数组。
  42905. * 单值专题图是将专题值相同的要素归为一类,为每一类设定一种渲染风格,其中每一类就是一个专题图子项。比如,利用单值专题图制作行政区划图,
  42906. * Name 字段代表省/直辖市名,该字段用来做专题变量,如果该字段的字段值总共有5种不同值,则该行政区划图有 5 个专题图子项。
  42907. */
  42908. _this.items = null;
  42909. /**
  42910. * @member {string} ThemeUnique.prototype.uniqueExpression
  42911. * @description 用于制作单值专题图的字段或字段表达式。
  42912. * 该字段值的数据类型可以为数值型或字符型。如果设置字段表达式,只能是相同数据类型字段间的运算。
  42913. */
  42914. _this.uniqueExpression = null;
  42915. /**
  42916. * @member {ColorGradientType} [ThemeUnique.prototype.colorGradientType=ColorGradientType.YELLOW_RED]
  42917. * @description 渐变颜色枚举类。
  42918. * 渐变色是由起始色根据一定算法逐渐过渡到终止色的一种混合型颜色。
  42919. * 该类作为单值专题图参数类、分段专题图参数类的属性,负责设置单值专题图、分段专题图的配色方案,在默认情况下专题图所有子项会根据这个配色方案完成填充。
  42920. * 但如果为某几个子项的风格进行单独设置后(设置了 ThemeUniqueItem 或 ThemeRangeItem 类中Style属性),
  42921. * 该配色方案对于这几个子项将不起作用。
  42922. */
  42923. _this.colorGradientType = ColorGradientType.YELLOW_RED;
  42924. if (options) {
  42925. Util_Util.extend(ThemeUnique_assertThisInitialized(_this), options);
  42926. }
  42927. _this.CLASS_NAME = "SuperMap.ThemeUnique";
  42928. return _this;
  42929. }
  42930. /**
  42931. * @function ThemeUnique.prototype.destroy
  42932. * @override
  42933. */
  42934. ThemeUnique_createClass(ThemeUnique, [{
  42935. key: "destroy",
  42936. value: function destroy() {
  42937. ThemeUnique_get(ThemeUnique_getPrototypeOf(ThemeUnique.prototype), "destroy", this).call(this);
  42938. var me = this;
  42939. me.uniqueExpression = null;
  42940. me.colorGradientType = null;
  42941. if (me.items) {
  42942. if (me.items.length > 0) {
  42943. for (var item in me.items) {
  42944. me.items[item].destroy();
  42945. me.items[item] = null;
  42946. }
  42947. }
  42948. me.items = null;
  42949. }
  42950. if (me.defaultStyle) {
  42951. me.defaultStyle.destroy();
  42952. me.defaultStyle = null;
  42953. }
  42954. }
  42955. /**
  42956. * @function ThemeUnique.prototype.toServerJSONObject
  42957. * @description 转换成对应的 JSON 格式对象。
  42958. * @returns {Object} 对应的 JSON 格式对象。
  42959. */
  42960. }, {
  42961. key: "toServerJSONObject",
  42962. value: function toServerJSONObject() {
  42963. var obj = {};
  42964. obj = Util_Util.copyAttributes(obj, this);
  42965. if (obj.defaultStyle) {
  42966. if (obj.defaultStyle.toServerJSONObject) {
  42967. obj.defaultStyle = obj.defaultStyle.toServerJSONObject();
  42968. }
  42969. }
  42970. if (obj.items) {
  42971. var items = [],
  42972. len = obj.items.length;
  42973. for (var i = 0; i < len; i++) {
  42974. items.push(obj.items[i].toServerJSONObject());
  42975. }
  42976. obj.items = items;
  42977. }
  42978. return obj;
  42979. }
  42980. /**
  42981. * @function ThemeUnique.fromObj
  42982. * @description 从传入对象获取单值专题图类。
  42983. * @param {Object} obj - 传入对象。
  42984. * @returns {ThemeUnique} ThemeUnique 对象。
  42985. */
  42986. }], [{
  42987. key: "fromObj",
  42988. value: function fromObj(obj) {
  42989. var res = new ThemeUnique();
  42990. var uItems = obj.items;
  42991. var len = uItems ? uItems.length : 0;
  42992. Util_Util.extend(res, obj);
  42993. res.items = [];
  42994. res.defaultStyle = ServerStyle.fromJson(obj.defaultStyle);
  42995. for (var i = 0; i < len; i++) {
  42996. res.items.push(ThemeUniqueItem.fromObj(uItems[i]));
  42997. }
  42998. return res;
  42999. }
  43000. }]);
  43001. return ThemeUnique;
  43002. }(Theme);
  43003. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphAxes.js
  43004. function ThemeGraphAxes_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43005. function ThemeGraphAxes_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  43006. function ThemeGraphAxes_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphAxes_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphAxes_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  43007. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43008. * This program are made available under the terms of the Apache License, Version 2.0
  43009. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43010. /**
  43011. * @class ThemeGraphAxes
  43012. * @deprecatedclass SuperMap.ThemeGraphAxes
  43013. * @category iServer Map Theme
  43014. * @classdesc 统计专题图坐标轴样式类。
  43015. * @param {Object} options - 参数。
  43016. * @param {ServerColor} [options.axesColor=(0, 0, 0)] - 坐标轴颜色。
  43017. * @param {boolean} [options.axesDisplayed=false] - 是否显示坐标轴。
  43018. * @param {boolean} [options.axesGridDisplayed=false] - 是否在统计图坐标轴上显示网格。
  43019. * @param {boolean} [options.axesTextDisplayed=false] - 是否显示坐标轴的文本标注。
  43020. * @param {ServerTextStyle} [options.axesTextStyle] - 统计符号的最大最小尺寸。
  43021. * @usage
  43022. */
  43023. var ThemeGraphAxes = /*#__PURE__*/function () {
  43024. function ThemeGraphAxes(options) {
  43025. ThemeGraphAxes_classCallCheck(this, ThemeGraphAxes);
  43026. /**
  43027. * @member {ServerColor} [ThemeGraphAxes.prototype.axesColor=(0, 0, 0)]
  43028. * @description 坐标轴颜色。当 axesDisplayed = true 时有效。
  43029. */
  43030. this.axesColor = new ServerColor(0, 0, 0);
  43031. /**
  43032. * @member {boolean} [ThemeGraphAxes.prototype.axesDisplayed=false]
  43033. * @description 是否显示坐标轴。<br>
  43034. * 由于饼状图和环状图无坐标轴,故该属性以及所有与坐标轴设置相关的属性都不适用于它们。并且只有当该值为 true 时,其它设置坐标轴的属性才起作用。
  43035. */
  43036. this.axesDisplayed = false;
  43037. /**
  43038. * @member {boolean} [ThemeGraphAxes.prototype.axesGridDisplayed=false]
  43039. * @description 是否在统计图坐标轴上显示网格。
  43040. */
  43041. this.axesGridDisplayed = false;
  43042. /**
  43043. * @member {boolean} [ThemeGraphAxes.prototype.axesTextDisplayed=false]
  43044. * @description 是否显示坐标轴的文本标注。
  43045. */
  43046. this.axesTextDisplayed = false;
  43047. /**
  43048. * @member {ServerTextStyle} ThemeGraphAxes.prototype.axesTextStyle
  43049. * @description 坐标轴文本风格。当 axesTextDisplayed = true 时有效。
  43050. */
  43051. this.axesTextStyle = new ServerTextStyle();
  43052. if (options) {
  43053. Util_Util.extend(this, options);
  43054. }
  43055. this.CLASS_NAME = "SuperMap.ThemeGraphAxes";
  43056. }
  43057. /**
  43058. * @function ThemeGraphAxes.prototype.destroy
  43059. * @description 释放资源,将引用资源的属性置空。
  43060. */
  43061. ThemeGraphAxes_createClass(ThemeGraphAxes, [{
  43062. key: "destroy",
  43063. value: function destroy() {
  43064. var me = this;
  43065. if (me.axesColor) {
  43066. me.axesColor.destroy();
  43067. me.axesColor = null;
  43068. }
  43069. me.axesDisplayed = null;
  43070. me.axesGridDisplayed = null;
  43071. me.axesTextDisplayed = null;
  43072. if (me.axesTextStyle) {
  43073. me.axesTextStyle.destroy();
  43074. me.axesTextStyle = null;
  43075. }
  43076. }
  43077. /**
  43078. * @function ThemeGraphAxes.fromObj
  43079. * @description 从传入对象获取统计专题图坐标轴样式类。
  43080. * @param {Object} obj - 传入对象。
  43081. * @returns {ThemeGraphAxes} ThemeGraphAxes 对象。
  43082. */
  43083. }], [{
  43084. key: "fromObj",
  43085. value: function fromObj(obj) {
  43086. if (!obj) {
  43087. return;
  43088. }
  43089. var res = new ThemeGraphAxes();
  43090. Util_Util.copy(res, obj);
  43091. res.axesColor = ServerColor.fromJson(obj.axesColor);
  43092. res.axesTextStyle = ServerTextStyle.fromObj(obj.axesTextStyle);
  43093. return res;
  43094. }
  43095. }]);
  43096. return ThemeGraphAxes;
  43097. }();
  43098. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphSize.js
  43099. function ThemeGraphSize_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43100. function ThemeGraphSize_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  43101. function ThemeGraphSize_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphSize_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphSize_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  43102. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43103. * This program are made available under the terms of the Apache License, Version 2.0
  43104. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43105. /**
  43106. * @class ThemeGraphSize
  43107. * @deprecatedclass SuperMap.ThemeGraphSize
  43108. * @category iServer Map Theme
  43109. * @classdesc 统计专题图符号尺寸类。
  43110. * @param {Object} options - 参数。
  43111. * @param {number} [options.maxGraphSize=0] - 统计图中显示的最大图表尺寸基准值。
  43112. * @param {number} [options.minGraphSize=0] - 统计图中显示的最小图表尺寸基准值。
  43113. * @usage
  43114. */
  43115. var ThemeGraphSize = /*#__PURE__*/function () {
  43116. function ThemeGraphSize(options) {
  43117. ThemeGraphSize_classCallCheck(this, ThemeGraphSize);
  43118. /**
  43119. * @member {number} [ThemeGraphSize.prototype.maxGraphSize=0]
  43120. * @description 获取或设置统计图中显示的最大图表尺寸基准值,单位为像素。
  43121. */
  43122. this.maxGraphSize = 0;
  43123. /**
  43124. * @member {number} [ThemeGraphSize.prototype.minGraphSize=0]
  43125. * @description 获取或设置统计图中显示的最小图表尺寸基准值,单位为像素。
  43126. */
  43127. this.minGraphSize = 0;
  43128. if (options) {
  43129. Util_Util.extend(this, options);
  43130. }
  43131. this.CLASS_NAME = "SuperMap.ThemeGraphSize";
  43132. }
  43133. /**
  43134. * @function ThemeGraphSize.prototype.destroy
  43135. * @description 释放资源,将引用资源的属性置空。
  43136. */
  43137. ThemeGraphSize_createClass(ThemeGraphSize, [{
  43138. key: "destroy",
  43139. value: function destroy() {
  43140. var me = this;
  43141. me.maxGraphSize = null;
  43142. me.minGraphSize = null;
  43143. }
  43144. /**
  43145. * @function ThemeGraphSize.fromObj
  43146. * @description 从传入对象获统计专题图符号尺寸类。
  43147. * @param {Object} obj - 传入对象。
  43148. * @returns {ThemeGraphSize} ThemeGraphSize 对象。
  43149. */
  43150. }], [{
  43151. key: "fromObj",
  43152. value: function fromObj(obj) {
  43153. var res = new ThemeGraphSize();
  43154. Util_Util.copy(res, obj);
  43155. return res;
  43156. }
  43157. }]);
  43158. return ThemeGraphSize;
  43159. }();
  43160. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphText.js
  43161. function ThemeGraphText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43162. function ThemeGraphText_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  43163. function ThemeGraphText_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphText_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphText_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  43164. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43165. * This program are made available under the terms of the Apache License, Version 2.0
  43166. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43167. /**
  43168. * @class ThemeGraphText
  43169. * @deprecatedclass SuperMap.ThemeGraphText
  43170. * @category iServer Map Theme
  43171. * @classdesc 统计图文字标注风格类。
  43172. * @param {Object} options - 可选参数。
  43173. * @param {boolean} [options.graphTextDisplayed=false] - 是否显示统计图上的文字标注。
  43174. * @param {ThemeGraphTextFormat} [options.graphTextFormat=ThemeGraphTextFormat.CAPTION] - 统计专题图文本显示格式。
  43175. * @param {ServerTextStyle} [options.graphTextStyle] - 统计图上的文字标注风格。
  43176. * @usage
  43177. */
  43178. var ThemeGraphText = /*#__PURE__*/function () {
  43179. function ThemeGraphText(options) {
  43180. ThemeGraphText_classCallCheck(this, ThemeGraphText);
  43181. /**
  43182. * @member {boolean} [ThemeGraphText.prototype.graphTextDisplayed=false]
  43183. * @description 是否显示统计图上的文字标注。
  43184. */
  43185. this.graphTextDisplayed = false;
  43186. /**
  43187. * @member {ThemeGraphTextFormat} [ThemeGraphText.prototype.graphTextFormat=ThemeGraphTextFormat.CAPTION]
  43188. * @description 统计专题图文本显示格式。
  43189. * 文本显示格式包括百分数、真实数值、标题、标题+百分数、标题+真实数值。
  43190. */
  43191. this.graphTextFormat = ThemeGraphTextFormat.CAPTION;
  43192. /**
  43193. * @member {ServerTextStyle} ThemeGraphText.prototype.graphTextStyle
  43194. * @description 统计图上的文字标注风格。
  43195. */
  43196. this.graphTextStyle = new ServerTextStyle();
  43197. if (options) {
  43198. Util_Util.extend(this, options);
  43199. }
  43200. this.CLASS_NAME = "SuperMap.ThemeGraphText";
  43201. }
  43202. /**
  43203. * @function ThemeGraphText.prototype.destroy
  43204. * @description 释放资源,将引用资源的属性置空。
  43205. */
  43206. ThemeGraphText_createClass(ThemeGraphText, [{
  43207. key: "destroy",
  43208. value: function destroy() {
  43209. var me = this;
  43210. me.graphTextDisplayed = null;
  43211. me.graphTextFormat = null;
  43212. if (me.graphTextStyle) {
  43213. me.graphTextStyle.destroy();
  43214. me.graphTextStyle = null;
  43215. }
  43216. }
  43217. /**
  43218. * @function ThemeGraphText.fromObj
  43219. * @description 从传入对象获取统计图文字标注风格类。
  43220. * @param {Object} obj - 传入对象。
  43221. * @returns {ThemeGraphText} ThemeGraphText 对象。
  43222. */
  43223. }], [{
  43224. key: "fromObj",
  43225. value: function fromObj(obj) {
  43226. var res = new ThemeGraphText();
  43227. Util_Util.copy(res, obj);
  43228. res.graphTextStyle = ServerTextStyle.fromObj(obj.graphTextStyle);
  43229. return res;
  43230. }
  43231. }]);
  43232. return ThemeGraphText;
  43233. }();
  43234. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphItem.js
  43235. function ThemeGraphItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43236. function ThemeGraphItem_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  43237. function ThemeGraphItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphItem_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  43238. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43239. * This program are made available under the terms of the Apache License, Version 2.0
  43240. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43241. /**
  43242. * @class ThemeGraphItem
  43243. * @deprecatedclass SuperMap.ThemeGraphItem
  43244. * @category iServer Map Theme
  43245. * @classdesc 统计专题图子项类。
  43246. * @param {Object} options - 参数。
  43247. * @param {string} [options.caption] - 专题图子项的名称。
  43248. * @param {string} options.graphExpression - 统计专题图的专题变量。
  43249. * @param {Array.<number>} [options.memoryDoubleValues] - 内存数组方式制作专题图时的值数组。
  43250. * @param {ServerStyle} [options.uniformStyle] - 统计专题图子项的显示风格。
  43251. * @usage
  43252. */
  43253. var ThemeGraphItem = /*#__PURE__*/function () {
  43254. function ThemeGraphItem(options) {
  43255. ThemeGraphItem_classCallCheck(this, ThemeGraphItem);
  43256. /**
  43257. * @member {string} [ThemeGraphItem.prototype.caption]
  43258. * @description 专题图子项的名称。
  43259. */
  43260. this.caption = null;
  43261. /**
  43262. * @member {string} ThemeGraphItem.prototype.graphExpression
  43263. * @description 统计专题图的专题变量。专题变量可以是一个字段或字段表达式。字段必须为数值型;表达式只能为数值型的字段间的运算。
  43264. */
  43265. this.graphExpression = null;
  43266. /**
  43267. * @member {Array.<number>} [ThemeGraphItem.prototype.memoryDoubleValues]
  43268. * @description 内存数组方式制作专题图时的值数组。<br>
  43269. * 内存数组方式制作专题图时,只对 SmID 值在键数组({@link ThemeGraph#memoryKeys})中的记录制作专题图。
  43270. * 值数组的数值个数必须与键数组中数值的个数一致。值数组中的值将代替原来的专题值来制作统计专题图。
  43271. * 比如:利用面积字段和周长字段(即有两个统计专题图子项 )作为专题变量制作统计专题图。
  43272. */
  43273. this.memoryDoubleValues = null;
  43274. /**
  43275. * @member {ServerStyle} [ThemeGraphItem.prototype.uniformStyle]
  43276. * @description 统计专题图子项的显示风格。
  43277. * 每一个统计专题图子项都对应一种显示风格。
  43278. */
  43279. this.uniformStyle = new ServerStyle();
  43280. if (options) {
  43281. Util_Util.extend(this, options);
  43282. }
  43283. this.CLASS_NAME = "SuperMap.ThemeGraphItem";
  43284. }
  43285. /**
  43286. * @function ThemeGraphItem.prototype.destroy
  43287. * @description 释放资源,将引用资源的属性置空。
  43288. */
  43289. ThemeGraphItem_createClass(ThemeGraphItem, [{
  43290. key: "destroy",
  43291. value: function destroy() {
  43292. var me = this;
  43293. me.caption = null;
  43294. me.graphExpression = null;
  43295. me.memoryDoubleValues = null;
  43296. me.uniformStyle = null;
  43297. }
  43298. /**
  43299. * @function ThemeGraphItem.fromObj
  43300. * @description 从传入对象获取统计专题图子项类。
  43301. * @param {Object} obj - 传入对象。
  43302. * @returns {ThemeGraphItem} ThemeGraphItem 对象。
  43303. */
  43304. }], [{
  43305. key: "fromObj",
  43306. value: function fromObj(obj) {
  43307. if (!obj) {
  43308. return;
  43309. }
  43310. var res = new ThemeGraphItem();
  43311. Util_Util.copy(res, obj);
  43312. res.uniformStyle = ServerStyle.fromJson(obj.uniformStyle);
  43313. return res;
  43314. }
  43315. }]);
  43316. return ThemeGraphItem;
  43317. }();
  43318. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraph.js
  43319. function ThemeGraph_typeof(obj) { "@babel/helpers - typeof"; return ThemeGraph_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ThemeGraph_typeof(obj); }
  43320. function ThemeGraph_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43321. function ThemeGraph_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  43322. function ThemeGraph_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraph_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraph_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  43323. function ThemeGraph_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeGraph_get = Reflect.get.bind(); } else { ThemeGraph_get = function _get(target, property, receiver) { var base = ThemeGraph_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ThemeGraph_get.apply(this, arguments); }
  43324. function ThemeGraph_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGraph_getPrototypeOf(object); if (object === null) break; } return object; }
  43325. function ThemeGraph_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ThemeGraph_setPrototypeOf(subClass, superClass); }
  43326. function ThemeGraph_setPrototypeOf(o, p) { ThemeGraph_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGraph_setPrototypeOf(o, p); }
  43327. function ThemeGraph_createSuper(Derived) { var hasNativeReflectConstruct = ThemeGraph_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThemeGraph_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThemeGraph_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThemeGraph_possibleConstructorReturn(this, result); }; }
  43328. function ThemeGraph_possibleConstructorReturn(self, call) { if (call && (ThemeGraph_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ThemeGraph_assertThisInitialized(self); }
  43329. function ThemeGraph_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  43330. function ThemeGraph_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  43331. function ThemeGraph_getPrototypeOf(o) { ThemeGraph_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGraph_getPrototypeOf(o); }
  43332. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43333. * This program are made available under the terms of the Apache License, Version 2.0
  43334. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43335. /**
  43336. * @class ThemeGraph
  43337. * @deprecatedclass SuperMap.ThemeGraph
  43338. * @category iServer Map Theme
  43339. * @classdesc 统计专题图类。
  43340. * @extends {CommonTheme}
  43341. * @param {Object} options - 参数。
  43342. * @param {Array.<ThemeGraphItem>} options.items - 统计专题图子项集合。
  43343. * @param {number} [options.barWidth=0] - 柱状专题图中每一个柱的宽度。
  43344. * @param {GraduatedMode} [options.graduatedMode=GraduatedMode.CONSTANT] - 统计图中地理要素的值与图表尺寸间的映射关系。
  43345. * @param {ThemeGraphAxes} [options.graphAxes] - 统计图中坐标轴样式相关信息。
  43346. * @param {ThemeGraphSize} [options.graphSize=0] - 统计符号的最大最小尺寸。
  43347. * @param {boolean} [options.graphSizeFixed=false] - 缩放地图时统计图符号是否固定大小。
  43348. * @param {ThemeGraphText} [options.graphText] - 统计图上的文字是否可见以及文字标注风格。
  43349. * @param {GraphAxesTextDisplayMode} [options.graphAxesTextDisplayMode=GraphAxesTextDisplayMode.NONE] - 统计专题图坐标轴文本显示模式。
  43350. * @param {ThemeGraphType} [options.graphType=ThemeGraphType.AREA] - 统计专题图类型。
  43351. * @param {Array.<number>} [options.memoryKeys] - 以内存数组方式制作专题图时的键数组。
  43352. * @param {boolean} [options.negativeDisplayed=false] - 专题图中是否显示属性为负值的数据。
  43353. * @param {ThemeOffset} [options.offset] - 统计图相对于要素内点的偏移量。
  43354. * @param {boolean} [options.overlapAvoided=true] - 统计图是否采用避让方式显示。
  43355. * @param {number} [options.roseAngle=0] - 统计图中玫瑰图或三维玫瑰图用于等分的角度。
  43356. * @param {number} [options.startAngle=0] - 饼状统计图扇形的起始角度。
  43357. * @usage
  43358. */
  43359. var ThemeGraph = /*#__PURE__*/function (_Theme) {
  43360. ThemeGraph_inherits(ThemeGraph, _Theme);
  43361. var _super = ThemeGraph_createSuper(ThemeGraph);
  43362. function ThemeGraph(options) {
  43363. var _this;
  43364. ThemeGraph_classCallCheck(this, ThemeGraph);
  43365. _this = _super.call(this, "GRAPH", options);
  43366. /**
  43367. * @member {number} [ThemeGraph.prototype.barWidth=0]
  43368. * @description 柱状专题图中每一个柱的宽度。使用地图坐标单位。
  43369. * 只有选择的统计图类型为柱状图(柱状图、三维柱状图、堆叠柱状图、三维堆叠柱状图)时,此项才可设置。
  43370. */
  43371. _this.barWidth = 0;
  43372. /**
  43373. * @member {GraduatedMode} [ThemeGraph.prototype.graduatedMode=GraduatedMode.CONSTANT]
  43374. * @description 统计图中地理要素的值与图表尺寸间的映射关系(常数、对数、平方根),即分级方式。
  43375. * 分级主要是为了减少制作统计专题图中数据大小之间的差异,使得统计图的视觉效果比较好,同时不同类别之间的比较也还是有意义的。
  43376. * 提供三种分级模式:常数、对数和平方根,对于有值为负数的字段,不可以采用对数和平方根的分级方式。不同的等级方式用于确定符号大小的数值是不相同的。
  43377. */
  43378. _this.graduatedMode = GraduatedMode.CONSTANT;
  43379. /**
  43380. * @member {ThemeGraphAxes} ThemeGraph.prototype.graphAxes
  43381. * @description 用于设置统计图中坐标轴样式相关信息,如坐标轴颜色、是否显示、坐标文本样式等。
  43382. */
  43383. _this.graphAxes = new ThemeGraphAxes();
  43384. /**
  43385. * @member {ThemeGraphSize} [ThemeGraph.prototype.graphSize=0]
  43386. * @description 用于设置统计符号的最大最小尺寸。
  43387. */
  43388. _this.graphSize = new ThemeGraphSize();
  43389. /**
  43390. * @member {boolean} [ThemeGraph.prototype.graphSizeFixed=false]
  43391. * @description 缩放地图时统计图符号是否固定大小。即统计图符号将随地图缩放。
  43392. */
  43393. _this.graphSizeFixed = false;
  43394. /**
  43395. * @member {ThemeGraphText} ThemeGraph.prototype.graphText
  43396. * @description 统计图上的文字是否可见以及文字标注风格。
  43397. */
  43398. _this.graphText = new ThemeGraphText();
  43399. /**
  43400. * @member {ThemeGraphType} [ThemeGraph.prototype.graphType=ThemeGraphType.AREA]
  43401. * @description 统计专题图类型。SuperMap 提供了多种类型的统计图,
  43402. * 分别为面积图、阶梯图、折线图、点状图、柱状图、三维柱状图、饼图、三维饼图、玫瑰图、三维玫瑰图、堆叠柱状图、三维堆叠柱状图、环状图。默认为面积图。
  43403. */
  43404. _this.graphType = ThemeGraphType.AREA;
  43405. /**
  43406. * @member {GraphAxesTextDisplayMode} [ThemeGraph.prototype.graphAxesTextDisplayMode=GraphAxesTextDisplayMode.NONE]
  43407. * @description 统计专题图坐标轴文本显示模式。
  43408. */
  43409. _this.graphAxesTextDisplayMode = GraphAxesTextDisplayMode.NONE;
  43410. /**
  43411. * @member {Array.<ThemeGraphItem>} ThemeGraph.prototype.items
  43412. * @description 统计专题图子项集合。
  43413. * 统计专题图可以基于多个变量,反映多种属性,即可以将多个专题变量的值绘制在一个统计图上。每一个专题变量对应的统计图即为一个专题图子项。
  43414. * 对于每个专题图子项可以为其设置标题、风格,甚至可以将该子项再制作成范围分段专题图。
  43415. */
  43416. _this.items = null;
  43417. /**
  43418. * @member {Array.<number>} ThemeGraph.prototype.memoryKeys
  43419. * @description 以内存数组方式制作专题图时的键数组。
  43420. * 键数组内的数值代表 SmID 值,它与 {@link ThemeGraphItem} 类中的值数组({@link ThemeGraphItem#memoryDoubleValues})要关联起来应用。
  43421. * 键数组中数值的个数必须要与值数组的数值个数一致。值数组中的值将代替原来的专题值来制作统计专题图。
  43422. * 目前所有的专题图都支持以内存数组的方式制作专题图,但统计专题图与其他专题图指定内存数组的方式不同,
  43423. * 统计专题图使用 memoryKeys 指定内存数组,而其他专题图则使用 memoryData 来指定内存数组。
  43424. * @example
  43425. * memoryKeys 的使用方法如下:
  43426. * function addThemeGraph() {
  43427. * removeTheme();
  43428. * //创建统计专题图对象,ThemeGraph 必设 items。
  43429. * //专题图参数 ThemeParameters 必设 theme(即以设置好的分段专题图对象)、dataSourceName 和 datasetName
  43430. * var style1 = new ServerStyle({
  43431. * fillForeColor: new ServerColor(92,73,234),
  43432. * lineWidth: 0.1
  43433. * }),
  43434. * style2 = new ServerStyle({
  43435. * fillForeColor: new ServerColor(211,111,240),
  43436. * lineWidth: 0.1
  43437. * }),
  43438. * item1 = new ThemeGraphItem({
  43439. * memoryDoubleValues:[1.18,0.95,0.37,1.31,0.8,1.5],
  43440. * caption: "1992-1995人口增长率",
  43441. * graphExpression: "Pop_Rate95",
  43442. * uniformStyle: style1
  43443. * }),
  43444. * item2 = new ThemeGraphItem({
  43445. * //以内存数组方式制作专题图时的值数组
  43446. * memoryDoubleValues:[2.71,0,0.74,3.1,2.2,3.5],
  43447. * caption: "1995-1999人口增长率", //专题图子项的名称
  43448. * graphExpression: "Pop_Rate99", //统计专题图的专题变量
  43449. * uniformStyle: style2 //统计专题图子项的显示风格
  43450. * }),
  43451. * themeGraph = new ThemeGraph({
  43452. * //以内存数组方式制作专题图时的键数组,键数组内的数值代表 SmID 值
  43453. * memoryKeys:[1,2,4,8,10,12],
  43454. * items: new Array(item1,item2),
  43455. * barWidth: 0.03,
  43456. * //统计图中地理要素的值与图表尺寸间的映射关系为平方根
  43457. * graduatedMode: GraduatedMode.SQUAREROOT,
  43458. * //graphAxes用于设置统计图中坐标轴样式相关信息
  43459. * graphAxes: new ThemeGraphAxes({
  43460. * axesDisplayed: true
  43461. * }),
  43462. * graphSize: new ThemeGraphSize({
  43463. * maxGraphSize: 1,
  43464. * minGraphSize: 0.35
  43465. * }),
  43466. * //统计图上的文字是否可见以及文字标注风格
  43467. * graphText: new ThemeGraphText({
  43468. * graphTextDisplayed: true,
  43469. * graphTextFormat: ThemeGraphTextFormat.VALUE,
  43470. * graphTextStyle: new ServerTextStyle({
  43471. * sizeFixed: true,
  43472. * fontHeight: 9,
  43473. * fontWidth: 5
  43474. * })
  43475. * }),
  43476. * //统计专题图类型为三维柱状图
  43477. * graphType: ThemeGraphType.BAR3D
  43478. * }),
  43479. * //专题图参数对象
  43480. * themeParameters = new ThemeParameters({
  43481. * themes: [themeGraph],
  43482. * dataSourceNames: ["Jingjin"],
  43483. * datasetNames: ["BaseMap_R"]
  43484. * }),
  43485. * //与服务端交互
  43486. * themeService=new ThemeService(url, {
  43487. * eventListeners: {
  43488. * "processCompleted": ThemeCompleted,
  43489. * "processFailed": themeFailed
  43490. * }
  43491. * });
  43492. * themeService.processAsync(themeParameters);
  43493. * }
  43494. */
  43495. _this.memoryKeys = null;
  43496. /**
  43497. * @member {boolean} [ThemeGraph.prototype.negativeDisplayed=false]
  43498. * @description 专题图中是否显示属性为负值的数据。true 表示显示;false 不显示。
  43499. */
  43500. _this.negativeDisplayed = false;
  43501. /**
  43502. * @member {ThemeOffset} ThemeGraph.prototype.offset
  43503. * @description 用于设置统计图相对于要素内点的偏移量。
  43504. */
  43505. _this.offset = new ThemeOffset();
  43506. /**
  43507. * @member {boolean} ThemeGraph.prototype.overlapAvoided
  43508. * @description 统计图是否采用避让方式显示。<br>
  43509. * 1.对数据集制作统计专题图:当统计图采用避让方式显示时,如果 overlapAvoided 为 true,则在统计图重叠度很大的情况下,
  43510. * 会出现无法完全避免统计图重叠的现象;如果 overlapAvoided 为 false,会过滤掉一些统计图,从而保证所有的统计图均不重叠。<br>
  43511. * 2.对数据集同时制作统计专题图和标签专题图:当统计图不显示子项文本时,标签专题图的标签即使和统计图重叠,两者也都可正常显示;
  43512. * 当统计图显示子项文本时,如果统计图中的子项文本和标签专题图中的标签不重叠,则两者均正常显示;如果重叠,则会过滤掉统计图的子项文本,只显示标签。
  43513. */
  43514. _this.overlapAvoided = true;
  43515. /**
  43516. * @member {number} [ThemeGraph.prototype.roseAngle=0]
  43517. * @description 统计图中玫瑰图或三维玫瑰图用于等分的角度,默认为 0 度,精确到 0.1 度。在角度为0或者大于 360 度的情况下均使用 360 度来等分制作统计图的字段数。
  43518. */
  43519. _this.roseAngle = 0;
  43520. /**
  43521. * @member {number} [ThemeGraph.prototype.startAngle=0]
  43522. * @description 饼状统计图扇形的起始角度。精确到 0.1 度,以水平方向为正向。只有选择的统计图类型为饼状图(饼图、三维饼图、玫瑰图、三维玫瑰图)时,此项才可设置。
  43523. */
  43524. _this.startAngle = 0;
  43525. if (options) {
  43526. Util_Util.extend(ThemeGraph_assertThisInitialized(_this), options);
  43527. }
  43528. _this.CLASS_NAME = "SuperMap.ThemeGraph";
  43529. return _this;
  43530. }
  43531. /**
  43532. * @function ThemeGraph.prototype.destroy
  43533. * @override
  43534. */
  43535. ThemeGraph_createClass(ThemeGraph, [{
  43536. key: "destroy",
  43537. value: function destroy() {
  43538. ThemeGraph_get(ThemeGraph_getPrototypeOf(ThemeGraph.prototype), "destroy", this).call(this);
  43539. var me = this;
  43540. me.barWidth = null;
  43541. me.graduatedMode = null;
  43542. if (me.graphAxes) {
  43543. me.graphAxes.destroy();
  43544. me.graphAxes = null;
  43545. }
  43546. if (me.graphSize) {
  43547. me.graphSize.destroy();
  43548. me.graphSize = null;
  43549. }
  43550. me.graphSizeFixed = null;
  43551. if (me.graphText) {
  43552. me.graphText.destroy();
  43553. me.graphText = null;
  43554. }
  43555. me.graphType = null;
  43556. if (me.items) {
  43557. for (var i = 0, items = me.items, len = items.length; i < len; i++) {
  43558. items[i].destroy();
  43559. }
  43560. me.items = null;
  43561. }
  43562. me.memoryKeys = null;
  43563. me.negativeDisplayed = null;
  43564. if (me.offset) {
  43565. me.offset.destroy();
  43566. me.offset = null;
  43567. }
  43568. me.overlapAvoided = null;
  43569. me.roseAngle = null;
  43570. me.startAngle = null;
  43571. me.graphAxesTextDisplayMode = null;
  43572. }
  43573. /**
  43574. * @function ThemeGraph.prototype.toJSON
  43575. * @description 将 ThemeGraph 对象转化为 JSON 字符串。
  43576. * @returns {string} 返回转换后的 JSON 字符串。
  43577. */
  43578. }, {
  43579. key: "toJSON",
  43580. value: function toJSON() {
  43581. return Util_Util.toJSON(this.toServerJSONObject());
  43582. }
  43583. /**
  43584. * @function ThemeGraph.prototype.toServerJSONObject
  43585. * @description 转换成对应的 JSON 格式对象。
  43586. * @returns {Object} 对应的 JSON 格式对象。
  43587. */
  43588. }, {
  43589. key: "toServerJSONObject",
  43590. value: function toServerJSONObject() {
  43591. var obj = {};
  43592. obj.type = this.type;
  43593. if (this.graphText) {
  43594. obj.graphTextDisplayed = this.graphText.graphTextDisplayed;
  43595. obj.graphTextFormat = this.graphText.graphTextFormat;
  43596. obj.graphTextStyle = this.graphText.graphTextStyle;
  43597. }
  43598. if (this.graphAxes) {
  43599. obj.axesColor = this.graphAxes.axesColor;
  43600. obj.axesDisplayed = this.graphAxes.axesDisplayed;
  43601. obj.axesGridDisplayed = this.graphAxes.axesGridDisplayed;
  43602. obj.axesTextDisplayed = this.graphAxes.axesTextDisplayed;
  43603. obj.axesTextStyle = this.graphAxes.axesTextStyle;
  43604. }
  43605. if (this.graphSize) {
  43606. obj.maxGraphSize = this.graphSize.maxGraphSize;
  43607. obj.minGraphSize = this.graphSize.minGraphSize;
  43608. }
  43609. if (this.offset) {
  43610. obj.offsetFixed = this.offset.offsetFixed;
  43611. obj.offsetX = this.offset.offsetX;
  43612. obj.offsetY = this.offset.offsetY;
  43613. }
  43614. obj.barWidth = this.barWidth;
  43615. obj.graduatedMode = this.graduatedMode;
  43616. obj.graphSizeFixed = this.graphSizeFixed;
  43617. obj.graphType = this.graphType;
  43618. obj.graphAxesTextDisplayMode = this.graphAxesTextDisplayMode;
  43619. obj.items = this.items;
  43620. obj.memoryKeys = this.memoryKeys;
  43621. obj.negativeDisplayed = this.negativeDisplayed;
  43622. obj.overlapAvoided = this.overlapAvoided;
  43623. obj.roseAngle = this.roseAngle;
  43624. obj.startAngle = this.startAngle;
  43625. return obj;
  43626. }
  43627. /**
  43628. * @function ThemeGraph.fromObj
  43629. * @description 从传入对象获取统计专题图类。
  43630. * @param {Object} obj - 传入对象。
  43631. * @returns {ThemeGraph} ThemeGraph 对象。
  43632. */
  43633. }], [{
  43634. key: "fromObj",
  43635. value: function fromObj(obj) {
  43636. var res = new ThemeGraph();
  43637. var itemsG = obj.items;
  43638. var len = itemsG ? itemsG.length : 0;
  43639. Util_Util.copy(res, obj);
  43640. res.items = [];
  43641. res.graphAxes = ThemeGraphAxes.fromObj(obj);
  43642. res.graphSize = ThemeGraphSize.fromObj(obj);
  43643. res.graphText = ThemeGraphText.fromObj(obj);
  43644. res.offset = ThemeOffset.fromObj(obj);
  43645. for (var i = 0; i < len; i++) {
  43646. res.items.push(ThemeGraphItem.fromObj(itemsG[i]));
  43647. }
  43648. return res;
  43649. }
  43650. }]);
  43651. return ThemeGraph;
  43652. }(Theme);
  43653. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeDotDensity.js
  43654. function ThemeDotDensity_typeof(obj) { "@babel/helpers - typeof"; return ThemeDotDensity_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ThemeDotDensity_typeof(obj); }
  43655. function ThemeDotDensity_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43656. function ThemeDotDensity_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  43657. function ThemeDotDensity_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeDotDensity_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeDotDensity_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  43658. function ThemeDotDensity_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ThemeDotDensity_setPrototypeOf(subClass, superClass); }
  43659. function ThemeDotDensity_setPrototypeOf(o, p) { ThemeDotDensity_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeDotDensity_setPrototypeOf(o, p); }
  43660. function ThemeDotDensity_createSuper(Derived) { var hasNativeReflectConstruct = ThemeDotDensity_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThemeDotDensity_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThemeDotDensity_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThemeDotDensity_possibleConstructorReturn(this, result); }; }
  43661. function ThemeDotDensity_possibleConstructorReturn(self, call) { if (call && (ThemeDotDensity_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ThemeDotDensity_assertThisInitialized(self); }
  43662. function ThemeDotDensity_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  43663. function ThemeDotDensity_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  43664. function ThemeDotDensity_getPrototypeOf(o) { ThemeDotDensity_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeDotDensity_getPrototypeOf(o); }
  43665. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43666. * This program are made available under the terms of the Apache License, Version 2.0
  43667. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43668. /**
  43669. * @class ThemeDotDensity
  43670. * @deprecatedclass SuperMap.ThemeDotDensity
  43671. * @category iServer Map Theme
  43672. * @classdesc 点密度专题图。点密度专题图用一定大小、形状相同的点表示现象分布范围、数量特征和分布密度。点的多少和所代表的意义由地图的内容确定。
  43673. * 点密度专题图利用图层的某一数值属性信息(专题值)映射为不同等级,每一级别使用不同数量或表现为密度的点符号来表示。
  43674. * 该专题值在各个分区内的分布情况,体现不同区域的相对数量差异。多用于具有数量特征的地图上,
  43675. * 比如表示不同地区的粮食产量、GDP、人口等的分级,主要针对区域或面状的要素,因而,点密度专题图适用于面数据集。
  43676. * 注意:点密度专题图中点的分布是随机的,并不代表实际的分布位置。即使在相关设置完全相同的情况下,
  43677. * 每次制作出的专题图,点的数量相同,但点的位置都有差异。
  43678. * @extends {CommonTheme}
  43679. * @param {Object} options - 参数。
  43680. * @param {string} options.dotExpression - 创建点密度专题图的字段或字段表达式。
  43681. * @param {ServerStyle} [options.style] - 点密度专题图中点的风格。
  43682. * @param {number} [options.value] - 专题图中每一个点所代表的数值。
  43683. * @param {ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  43684. * @usage
  43685. */
  43686. var ThemeDotDensity = /*#__PURE__*/function (_Theme) {
  43687. ThemeDotDensity_inherits(ThemeDotDensity, _Theme);
  43688. var _super = ThemeDotDensity_createSuper(ThemeDotDensity);
  43689. function ThemeDotDensity(options) {
  43690. var _this;
  43691. ThemeDotDensity_classCallCheck(this, ThemeDotDensity);
  43692. _this = _super.call(this, "DOTDENSITY", options);
  43693. /**
  43694. * @member {string} ThemeDotDensity.prototype.dotExpression
  43695. * @description 创建点密度专题图的字段或字段表达式。点的数目或密集程度的来源。
  43696. */
  43697. _this.dotExpression = null;
  43698. /**
  43699. * @member {ServerStyle} ThemeDotDensity.prototype.style
  43700. * @description 点密度专题图中点的风格。
  43701. */
  43702. _this.style = new ServerStyle();
  43703. /**
  43704. * @member {number} ThemeDotDensity.prototype.value
  43705. * @description 专题图中每一个点所代表的数值。<br>
  43706. * 点值的确定与地图比例尺以及点的大小有关。地图比例尺越大,相应的图面范围也越大,
  43707. * 点相应就可以越多,此时点值就可以设置相对小一些。点形状越大,
  43708. * 点值相应就应该设置的小一些。点值过大或过小都是不合适的。
  43709. */
  43710. _this.value = null;
  43711. if (options) {
  43712. Util_Util.extend(ThemeDotDensity_assertThisInitialized(_this), options);
  43713. }
  43714. _this.CLASS_NAME = "SuperMap.ThemeDotDensity";
  43715. return _this;
  43716. }
  43717. /**
  43718. * @function ThemeDotDensity.prototype.destroy
  43719. * @description 释放资源,将引用资源的属性置空。
  43720. */
  43721. ThemeDotDensity_createClass(ThemeDotDensity, [{
  43722. key: "destroy",
  43723. value: function destroy() {
  43724. var me = this;
  43725. me.dotExpression = null;
  43726. me.value = null;
  43727. if (me.style) {
  43728. me.style.destroy();
  43729. me.style = null;
  43730. }
  43731. }
  43732. /**
  43733. * @function ThemeDotDensity.prototype.toServerJSONObject
  43734. * @description 转换成对应的 JSON 格式对象。
  43735. * @returns {Object} 对应的 JSON 格式对象。
  43736. */
  43737. }, {
  43738. key: "toServerJSONObject",
  43739. value: function toServerJSONObject() {
  43740. var obj = {};
  43741. obj = Util_Util.copyAttributes(obj, this);
  43742. if (obj.style) {
  43743. if (obj.style.toServerJSONObject) {
  43744. obj.style = obj.style.toServerJSONObject();
  43745. }
  43746. }
  43747. return obj;
  43748. }
  43749. /**
  43750. * @function ThemeDotDensity.fromObj
  43751. * @description 从传入对象获取点密度专题图中点的风格。
  43752. * @param {Object} obj - 传入对象。
  43753. * @returns {ThemeDotDensity} ThemeDotDensity 对象。
  43754. */
  43755. }], [{
  43756. key: "fromObj",
  43757. value: function fromObj(obj) {
  43758. if (!obj) {
  43759. return;
  43760. }
  43761. var res = new ThemeDotDensity();
  43762. Util_Util.copy(res, obj);
  43763. res.style = ServerStyle.fromJson(obj.style);
  43764. return res;
  43765. }
  43766. }]);
  43767. return ThemeDotDensity;
  43768. }(Theme);
  43769. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraduatedSymbolStyle.js
  43770. function ThemeGraduatedSymbolStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43771. function ThemeGraduatedSymbolStyle_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  43772. function ThemeGraduatedSymbolStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraduatedSymbolStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraduatedSymbolStyle_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  43773. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43774. * This program are made available under the terms of the Apache License, Version 2.0
  43775. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43776. /**
  43777. * @class ThemeGraduatedSymbolStyle
  43778. * @deprecatedclass SuperMap.ThemeGraduatedSymbolStyle
  43779. * @category iServer Map Theme
  43780. * @classdesc 等级符号专题图正负零值显示风格类。
  43781. * @param {Object} options - 参数。
  43782. * @param {boolean} [options.negativeDisplayed=false] - 是否显示负值。
  43783. * @param {ServerStyle} [options.negativeStyle] - 负值的等级符号风格。
  43784. * @param {ServerStyle} [options.positiveStyle] - 正值的等级符号风格。
  43785. * @param {boolean} [options.zeroDisplayed=false] - 是否显示 0 值。
  43786. * @param {ServerStyle} [options.zeroStyle] - 0 值的等级符号风格。
  43787. * @usage
  43788. */
  43789. var ThemeGraduatedSymbolStyle = /*#__PURE__*/function () {
  43790. function ThemeGraduatedSymbolStyle(options) {
  43791. ThemeGraduatedSymbolStyle_classCallCheck(this, ThemeGraduatedSymbolStyle);
  43792. /**
  43793. * @member {boolean} [ThemeGraduatedSymbolStyle.prototype.negativeDisplayed=false]
  43794. * @description 是否显示负值。
  43795. */
  43796. this.negativeDisplayed = false;
  43797. /**
  43798. * @member {ServerStyle} [ThemeGraduatedSymbolStyle.prototype.negativeStyle]
  43799. * @description 负值的等级符号风格。
  43800. */
  43801. this.negativeStyle = new ServerStyle();
  43802. /**
  43803. * @member {ServerStyle} [ThemeGraduatedSymbolStyle.prototype.positiveStyle]
  43804. * @description 正值的等级符号风格。
  43805. */
  43806. this.positiveStyle = new ServerStyle();
  43807. /**
  43808. * @member {boolean} [ThemeGraduatedSymbolStyle.prototype.zeroDisplayed=false]
  43809. * @description 是否显示 0 值。
  43810. */
  43811. this.zeroDisplayed = false;
  43812. /**
  43813. * @member {ServerStyle} ThemeGraduatedSymbolStyle.prototype.zeroStyle
  43814. * @description 0 值的等级符号风格。
  43815. */
  43816. this.zeroStyle = new ServerStyle();
  43817. if (options) {
  43818. Util_Util.extend(this, options);
  43819. }
  43820. this.CLASS_NAME = "SuperMap.ThemeGraduatedSymbolStyle";
  43821. }
  43822. /**
  43823. * @function ThemeGraduatedSymbolStyle.prototype.destroy
  43824. * @description 释放资源,将引用资源的属性置空。
  43825. */
  43826. ThemeGraduatedSymbolStyle_createClass(ThemeGraduatedSymbolStyle, [{
  43827. key: "destroy",
  43828. value: function destroy() {
  43829. var me = this;
  43830. me.negativeDisplayed = null;
  43831. me.negativeStyle = null;
  43832. me.positiveStyle = null;
  43833. me.zeroDisplayed = null;
  43834. me.zeroStyle = null;
  43835. }
  43836. /**
  43837. * @function ThemeGraduatedSymbolStyle.fromObj
  43838. * @description 从传入对象获取等级符号专题图正负零值显示风格类。
  43839. * @param {Object} obj - 传入对象。
  43840. * @returns {ThemeGraduatedSymbolStyle} ThemeGraduatedSymbolStyle 对象。
  43841. */
  43842. }], [{
  43843. key: "fromObj",
  43844. value: function fromObj(obj) {
  43845. if (!obj) {
  43846. return;
  43847. }
  43848. var res = new ThemeGraduatedSymbolStyle();
  43849. Util_Util.copy(res, obj);
  43850. res.negativeStyle = ServerStyle.fromJson(obj.negativeStyle);
  43851. res.positiveStyle = ServerStyle.fromJson(obj.positiveStyle);
  43852. res.zeroStyle = ServerStyle.fromJson(obj.zeroStyle);
  43853. return res;
  43854. }
  43855. }]);
  43856. return ThemeGraduatedSymbolStyle;
  43857. }();
  43858. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraduatedSymbol.js
  43859. function ThemeGraduatedSymbol_typeof(obj) { "@babel/helpers - typeof"; return ThemeGraduatedSymbol_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ThemeGraduatedSymbol_typeof(obj); }
  43860. function ThemeGraduatedSymbol_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43861. function ThemeGraduatedSymbol_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  43862. function ThemeGraduatedSymbol_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraduatedSymbol_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraduatedSymbol_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  43863. function ThemeGraduatedSymbol_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeGraduatedSymbol_get = Reflect.get.bind(); } else { ThemeGraduatedSymbol_get = function _get(target, property, receiver) { var base = ThemeGraduatedSymbol_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ThemeGraduatedSymbol_get.apply(this, arguments); }
  43864. function ThemeGraduatedSymbol_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGraduatedSymbol_getPrototypeOf(object); if (object === null) break; } return object; }
  43865. function ThemeGraduatedSymbol_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ThemeGraduatedSymbol_setPrototypeOf(subClass, superClass); }
  43866. function ThemeGraduatedSymbol_setPrototypeOf(o, p) { ThemeGraduatedSymbol_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGraduatedSymbol_setPrototypeOf(o, p); }
  43867. function ThemeGraduatedSymbol_createSuper(Derived) { var hasNativeReflectConstruct = ThemeGraduatedSymbol_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThemeGraduatedSymbol_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThemeGraduatedSymbol_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThemeGraduatedSymbol_possibleConstructorReturn(this, result); }; }
  43868. function ThemeGraduatedSymbol_possibleConstructorReturn(self, call) { if (call && (ThemeGraduatedSymbol_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ThemeGraduatedSymbol_assertThisInitialized(self); }
  43869. function ThemeGraduatedSymbol_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  43870. function ThemeGraduatedSymbol_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  43871. function ThemeGraduatedSymbol_getPrototypeOf(o) { ThemeGraduatedSymbol_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGraduatedSymbol_getPrototypeOf(o); }
  43872. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43873. * This program are made available under the terms of the Apache License, Version 2.0
  43874. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43875. /**
  43876. * @class ThemeGraduatedSymbol
  43877. * @deprecatedclass SuperMap.ThemeGraduatedSymbol
  43878. * @category iServer Map Theme
  43879. * @classdesc 等级符号专题图。
  43880. * @extends {CommonTheme}
  43881. * @param {Object} options - 参数。
  43882. * @param {ThemeGraduatedSymbolStyle} options.style - 等级符号专题图正负零值显示风格类。
  43883. * @param {string} options.expression - 等级符号专题图的字段或字段表达式。
  43884. * @param {number} [options.baseValue=0] - 等级符号专题图的基准值,单位同专题变量的单位。
  43885. * @param {GraduatedMode} [options.graduatedMode=GraduatedMode.CONSTANT] - 等级符号专题图分级模式。
  43886. * @param {ThemeOffset} [options.offset] - 指定等级符号专题图中标记文本相对于要素内点的偏移量对象。
  43887. * @param {ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  43888. * @usage
  43889. */
  43890. var ThemeGraduatedSymbol = /*#__PURE__*/function (_Theme) {
  43891. ThemeGraduatedSymbol_inherits(ThemeGraduatedSymbol, _Theme);
  43892. var _super = ThemeGraduatedSymbol_createSuper(ThemeGraduatedSymbol);
  43893. function ThemeGraduatedSymbol(options) {
  43894. var _this;
  43895. ThemeGraduatedSymbol_classCallCheck(this, ThemeGraduatedSymbol);
  43896. _this = _super.call(this, "GRADUATEDSYMBOL", options);
  43897. /**
  43898. * @member {number} [ThemeGraduatedSymbol.prototype.baseValue=0]
  43899. * @description 等级符号专题图的基准值,单位同专题变量的单位。<br>
  43900. * 依据此值系统会自动根据分级方式计算其余值对应的符号大小,每个符号的显示大小等于
  43901. * ThemeValueSection.positiveStyle(或 zeroStyle,negativeStyle).markerSize * value / basevalue,
  43902. * 其中 value 是 expression 所指定字段对应的值经过分级计算之后的值。默认值为0,建议通过多次尝试设置该值才能达到较好的显示效果。
  43903. */
  43904. _this.baseValue = 0;
  43905. /**
  43906. * @member {string} ThemeGraduatedSymbol.prototype.expression
  43907. * @description 用于创建等级符号专题图的字段或字段表达式,字段或字段表达式应为数值型。
  43908. */
  43909. _this.expression = null;
  43910. /**
  43911. * @member {GraduatedMode} [ThemeGraduatedSymbol.prototype.graduatedMode=GraduatedMode.CONSTANT]
  43912. * @description 等级符号专题图分级模式。<br>
  43913. * 分级主要是为了减少制作等级符号专题图中数据大小之间的差异。如果数据之间差距较大,则可以采用对数或者平方根的分级方式来进行,
  43914. * 这样就减少了数据之间的绝对大小的差异,使得等级符号图的视觉效果比较好,同时不同类别之间的比较也是有意义的。
  43915. * 有三种分级模式:常数、对数和平方根,对于有值为负数的字段,在用对数或平方根方式分级时,默认对负数取正。
  43916. * 不同的分级模式用于确定符号大小的数值是不相同的:常数按照字段的原始数据进行;对数则是对每条记录对应的专题变量取自然对数;
  43917. * 平方根则是对其取平方根,然后用最终得到的结果来确定其等级符号的大小。
  43918. */
  43919. _this.graduatedMode = GraduatedMode.CONSTAN;
  43920. /**
  43921. * @member {ThemeOffset} [ThemeGraduatedSymbol.prototype.offset]
  43922. * @description 用于设置等级符号图相对于要素内点的偏移量。
  43923. */
  43924. _this.offset = new ThemeOffset();
  43925. /**
  43926. * @member {ThemeGraduatedSymbolStyle} ThemeGraduatedSymbol.prototype.style
  43927. * @description 用于设置等级符号图正负和零值显示风格。
  43928. */
  43929. _this.style = new ThemeGraduatedSymbolStyle();
  43930. if (options) {
  43931. Util_Util.extend(ThemeGraduatedSymbol_assertThisInitialized(_this), options);
  43932. }
  43933. _this.CLASS_NAME = "SuperMap.ThemeGraduatedSymbol";
  43934. return _this;
  43935. }
  43936. /**
  43937. * @function ThemeGraduatedSymbol.prototype.destroy
  43938. * @description 释放资源,将引用资源的属性置空。
  43939. */
  43940. ThemeGraduatedSymbol_createClass(ThemeGraduatedSymbol, [{
  43941. key: "destroy",
  43942. value: function destroy() {
  43943. ThemeGraduatedSymbol_get(ThemeGraduatedSymbol_getPrototypeOf(ThemeGraduatedSymbol.prototype), "destroy", this).call(this);
  43944. var me = this;
  43945. me.expression = null;
  43946. me.graduatedMode = GraduatedMode.CONSTANT;
  43947. if (me.offset) {
  43948. me.offset.destroy();
  43949. me.offset = null;
  43950. }
  43951. if (me.style) {
  43952. me.style.destroy();
  43953. me.style = null;
  43954. }
  43955. }
  43956. /**
  43957. * @function ThemeGraduatedSymbol.prototype.toJSON
  43958. * @description 将 themeLabel 对象转化为 JSON 字符串。
  43959. * @returns {string} 返回转换后的 JSON 字符串。
  43960. */
  43961. }, {
  43962. key: "toJSON",
  43963. value: function toJSON() {
  43964. return Util_Util.toJSON(this.toServerJSONObject());
  43965. }
  43966. /**
  43967. * @function ThemeGraduatedSymbol.prototype.toServerJSONObject
  43968. * @description 转换成对应的 JSON 格式对象。
  43969. * @returns {Object} 对应的 JSON 格式对象。
  43970. */
  43971. }, {
  43972. key: "toServerJSONObject",
  43973. value: function toServerJSONObject() {
  43974. var obj = {};
  43975. obj.type = this.type;
  43976. obj.memoryData = this.memoryData;
  43977. obj.baseValue = this.baseValue;
  43978. obj.expression = this.expression;
  43979. obj.graduatedMode = this.graduatedMode;
  43980. if (this.offset) {
  43981. obj.offsetFixed = this.offset.offsetFixed;
  43982. obj.offsetX = this.offset.offsetX;
  43983. obj.offsetY = this.offset.offsetY;
  43984. }
  43985. if (this.style) {
  43986. obj.negativeStyle = this.style.negativeStyle;
  43987. obj.negativeDisplayed = this.style.negativeDisplayed;
  43988. obj.positiveStyle = this.style.positiveStyle;
  43989. obj.zeroDisplayed = this.style.zeroDisplayed;
  43990. obj.zeroStyle = this.style.zeroStyle;
  43991. }
  43992. return obj;
  43993. }
  43994. /**
  43995. * @function ThemeGraduatedSymbol.fromObj
  43996. * @description 从传入对象获取等级符号专题图。
  43997. * @param {Object} obj - 传入对象。
  43998. * @returns {ThemeGraduatedSymbol} 等级符号专题图对象。
  43999. */
  44000. }], [{
  44001. key: "fromObj",
  44002. value: function fromObj(obj) {
  44003. if (!obj) {
  44004. return;
  44005. }
  44006. var res = new ThemeGraduatedSymbol();
  44007. Util_Util.copy(res, obj);
  44008. res.offset = ThemeOffset.fromObj(obj);
  44009. res.style = ThemeGraduatedSymbolStyle.fromObj(obj);
  44010. return res;
  44011. }
  44012. }]);
  44013. return ThemeGraduatedSymbol;
  44014. }(Theme);
  44015. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeRangeItem.js
  44016. function ThemeRangeItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44017. function ThemeRangeItem_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  44018. function ThemeRangeItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeRangeItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeRangeItem_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  44019. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  44020. * This program are made available under the terms of the Apache License, Version 2.0
  44021. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  44022. /**
  44023. * @class ThemeRangeItem
  44024. * @deprecatedclass SuperMap.ThemeRangeItem
  44025. * @category iServer Map Theme
  44026. * @classdesc 范围分段专题图子项类。在分段专题图中,字段值按照某种分段模式被分成多个范围段,
  44027. * 每个范围段即为一个子项,同一范围段的要素属于同一个分段专题图子项。
  44028. * 每个子项都有其分段起始值、终止值、名称和风格等。每个分段所表示的范围为[start, end)。
  44029. * @param {Object} options - 参数。
  44030. * @param {string} [options.caption] - 子项的标题。
  44031. * @param {number} [options.end=0] - 子项的终止值。
  44032. * @param {number} [options.start=0] - 子项的起始值。
  44033. * @param {ServerStyle} options.style - 子项的风格。
  44034. * @param {boolean} [options.visible=true] - 子项是否可见。
  44035. * @usage
  44036. */
  44037. var ThemeRangeItem = /*#__PURE__*/function () {
  44038. function ThemeRangeItem(options) {
  44039. ThemeRangeItem_classCallCheck(this, ThemeRangeItem);
  44040. /**
  44041. * @member {string} [ThemeRangeItem.prototype.caption]
  44042. * @description 分段专题图子项的标题。
  44043. */
  44044. this.caption = null;
  44045. /**
  44046. * @member {number} [ThemeRangeItem.prototype.end=0]
  44047. * @description 分段专题图子项的终止值,即该段专题值范围的最大值。<br>
  44048. * 如果该子项是分段中最后一个子项,则该终止值应大于分段字段(ThemeRange 类的 rangeExpression 属性)的最大值,若该终止值小于分段字段最大值,
  44049. * 则剩余部分由内部随机定义其颜色;如果不是最后一项,该终止值必须与其下一子项的起始值相同,否则系统抛出异常;
  44050. * 如果设置了范围分段模式和分段数,则会自动计算每段的范围 [start, end),故无需设置 [start, end);当然可以设置,那么结果就会按您设置的值对分段结果进行调整。
  44051. */
  44052. this.end = 0;
  44053. /**
  44054. * @member {number} [ThemeRangeItem.prototype.start=0]
  44055. * @description 分段专题图子项的起始值,即该段专题值范围的最小值。<br>
  44056. * 如果该子项是分段中第一个子项,那么该起始值就是分段的最小值;如果子项的序号大于等于 1 的时候,该起始值必须与前一子项的终止值相同,否则系统会抛出异常。
  44057. * 如果设置了范围分段模式和分段数,则会自动计算每段的范围 [start, end),故无需设置 [start, end);当然可以设置,那么结果就会按您设置的值对分段结果进行调整。
  44058. */
  44059. this.start = 0;
  44060. /**
  44061. * @member {ServerStyle} ThemeRangeItem.prototype.style
  44062. * @description 分段专题图子项的风格。
  44063. * 每一个分段专题图子项都对应一种显示风格。
  44064. */
  44065. this.style = new ServerStyle();
  44066. /**
  44067. * @member {boolean} [ThemeRangeItem.prototype.visible=true]
  44068. * @description 分段专题图子项是否可见。
  44069. */
  44070. this.visible = true;
  44071. if (options) {
  44072. Util_Util.extend(this, options);
  44073. }
  44074. this.CLASS_NAME = "SuperMap.ThemeRangeItem";
  44075. }
  44076. /**
  44077. * @function ThemeRangeItem.prototype.destroy
  44078. * @description 释放资源,将引用资源的属性置空。
  44079. */
  44080. ThemeRangeItem_createClass(ThemeRangeItem, [{
  44081. key: "destroy",
  44082. value: function destroy() {
  44083. var me = this;
  44084. me.caption = null;
  44085. me.end = null;
  44086. me.start = null;
  44087. if (me.style) {
  44088. me.style.destroy();
  44089. me.style = null;
  44090. }
  44091. me.visible = null;
  44092. }
  44093. /**
  44094. * @function ThemeRangeItem.prototypetoServerJSONObject
  44095. * @description 转换成对应的 JSON 格式对象。
  44096. * @returns {Object} 对应的 JSON 格式对象。
  44097. */
  44098. }, {
  44099. key: "toServerJSONObject",
  44100. value: function toServerJSONObject() {
  44101. var obj = {};
  44102. obj = Util_Util.copyAttributes(obj, this);
  44103. if (obj.style) {
  44104. if (obj.style.toServerJSONObject) {
  44105. obj.style = obj.style.toServerJSONObject();
  44106. }
  44107. }
  44108. return obj;
  44109. }
  44110. /**
  44111. * @function ThemeRangeItem.fromObj
  44112. * @description 从传入对象获取范围分段专题图子项类。
  44113. * @param {Object} obj - 传入对象。
  44114. * @returns {ThemeRangeItem} ThemeRangeItem 对象。
  44115. */
  44116. }], [{
  44117. key: "fromObj",
  44118. value: function fromObj(obj) {
  44119. if (!obj) {
  44120. return;
  44121. }
  44122. var res = new ThemeRangeItem();
  44123. Util_Util.copy(res, obj);
  44124. res.style = ServerStyle.fromJson(obj.style);
  44125. return res;
  44126. }
  44127. }]);
  44128. return ThemeRangeItem;
  44129. }();
  44130. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeRange.js
  44131. function ThemeRange_typeof(obj) { "@babel/helpers - typeof"; return ThemeRange_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ThemeRange_typeof(obj); }
  44132. function ThemeRange_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44133. function ThemeRange_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  44134. function ThemeRange_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeRange_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeRange_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  44135. function ThemeRange_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeRange_get = Reflect.get.bind(); } else { ThemeRange_get = function _get(target, property, receiver) { var base = ThemeRange_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ThemeRange_get.apply(this, arguments); }
  44136. function ThemeRange_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeRange_getPrototypeOf(object); if (object === null) break; } return object; }
  44137. function ThemeRange_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ThemeRange_setPrototypeOf(subClass, superClass); }
  44138. function ThemeRange_setPrototypeOf(o, p) { ThemeRange_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeRange_setPrototypeOf(o, p); }
  44139. function ThemeRange_createSuper(Derived) { var hasNativeReflectConstruct = ThemeRange_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThemeRange_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThemeRange_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThemeRange_possibleConstructorReturn(this, result); }; }
  44140. function ThemeRange_possibleConstructorReturn(self, call) { if (call && (ThemeRange_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ThemeRange_assertThisInitialized(self); }
  44141. function ThemeRange_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  44142. function ThemeRange_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  44143. function ThemeRange_getPrototypeOf(o) { ThemeRange_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeRange_getPrototypeOf(o); }
  44144. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  44145. * This program are made available under the terms of the Apache License, Version 2.0
  44146. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  44147. /**
  44148. * @class ThemeRange
  44149. * @deprecatedclass SuperMap.ThemeRange
  44150. * @category iServer Map Theme
  44151. * @classdesc 范围分段专题图。
  44152. * 范围分段专题图是按照指定的分段方法(如:等距离分段法)对字段的属性值进行分段,使用不同的颜色或符号(线型、填充)表示不同范围段落的属性值在整体上的分布情况,体现区域的差异。
  44153. * 在分段专题图中,专题值按照某种分段方式被分成多个范围段,要素根据各自的专题值被分配到其中一个范围段中,在同一个范围段中的要素使用相同的颜色,填充,符号等风格进行显示。
  44154. * 分段专题图所基于的专题变量必须为数值型,分段专题图一般用来反映连续分布现象的数量或程度特征,如降水量的分布,土壤侵蚀强度的分布等。
  44155. * @extends {CommonTheme}
  44156. * @param {Object} options - 参数。
  44157. * @param {Array.<ThemeRangeItem>} options.items - 子项数组。
  44158. * @param {string} options.rangeExpression - 分段字段表达式。
  44159. * @param {number} options.rangeParameter - 分段参数。
  44160. * @param {RangeMode} [options.rangeMode=RangeMode.EQUALINTERVAL] - 分段模式。
  44161. * @param {ColorGradientType} [options.colorGradientType=ColorGradientType.YELLOW_RED] - 渐变颜色枚举类。
  44162. * @param {ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  44163. * @usage
  44164. */
  44165. var ThemeRange = /*#__PURE__*/function (_Theme) {
  44166. ThemeRange_inherits(ThemeRange, _Theme);
  44167. var _super = ThemeRange_createSuper(ThemeRange);
  44168. function ThemeRange(options) {
  44169. var _this;
  44170. ThemeRange_classCallCheck(this, ThemeRange);
  44171. _this = _super.call(this, "RANGE", options);
  44172. /**
  44173. * @member {string} ThemeRange.prototype.precision
  44174. * @description 精准度。
  44175. */
  44176. _this.precision = '1.0E-12';
  44177. /**
  44178. * @member {Array.<ThemeRangeItem>} ThemeRange.prototype.items
  44179. * @description 分段专题图子项数组。<br>
  44180. * 在分段专题图中,字段值按照某种分段模式被分成多个范围段,每个范围段即为一个子项,同一范围段的要素属于同一个分段专题图子项。
  44181. * 每个子项都有其分段起始值、终止值、名称和风格等。每个分段所表示的范围为 [start, end)。
  44182. * 如果设置了范围分段模式和分段数,则会自动计算每段的范围 [start, end),故无需设置 [start, end);当然可以设置,那么结果就会按照您设置的值对分段结果进行调整。
  44183. */
  44184. _this.items = null;
  44185. /**
  44186. * @member {string} ThemeRange.prototype.rangeExpression
  44187. * @description 分段字段表达式。<br>
  44188. * 由于范围分段专题图基于各种分段方法根据一定的距离进行分段,因而范围分段专题图所基于的字段值的数据类型必须为数值型。对于字段表达式,只能为数值型的字段间的运算。
  44189. */
  44190. _this.rangeExpression = null;
  44191. /**
  44192. * @member {RangeMode} [ThemeRange.prototype.rangeMode=RangeMode.EQUALINTERVAL]
  44193. * @description 分段专题图的分段模式。<br>
  44194. * 在分段专题图中,作为专题变量的字段或表达式的值按照某种分段方式被分成多个范围段。
  44195. * 目前 SuperMap 提供的分段方式包括:等距离分段法、平方根分段法、标准差分段法、对数分段法、等计数分段法和自定义距离法,
  44196. * 显然这些分段方法根据一定的距离进行分段,因而范围分段专题图所基于的专题变量必须为数值型。
  44197. */
  44198. _this.rangeMode = RangeMode.EQUALINTERVAL;
  44199. /**
  44200. * @member {number} ThemeRange.prototype.rangeParameter
  44201. * @description 分段参数。
  44202. * 当分段模式为等距离分段法,平方根分段,对数分段法,等计数分段法其中一种模式时,该参数用于设置分段个数;当分段模式为标准差分段法时,
  44203. * 该参数不起作用;当分段模式为自定义距离时,该参数用于设置自定义距离。
  44204. */
  44205. _this.rangeParameter = 0;
  44206. /**
  44207. * @member {ColorGradientType} [ThemeRange.prototype.colorGradientType=ColorGradientType.YELLOW_RED]
  44208. * @description 渐变颜色枚举类。<br>
  44209. * 渐变色是由起始色根据一定算法逐渐过渡到终止色的一种混合型颜色。
  44210. * 该类作为单值专题图参数类、分段专题图参数类的属性,负责设置单值专题图、分段专题图的配色方案,在默认情况下专题图所有子项会根据这个配色方案完成填充。但如果为某几个子项的风格进行单独设置后(设置了 {@link ThemeUniqueItem} 或 {@link ThemeRangeItem} 类中Style属性),
  44211. * 该配色方案对于这几个子项将不起作用。
  44212. */
  44213. _this.colorGradientType = ColorGradientType.YELLOW_RED;
  44214. if (options) {
  44215. Util_Util.extend(ThemeRange_assertThisInitialized(_this), options);
  44216. }
  44217. _this.CLASS_NAME = "SuperMap.ThemeRange";
  44218. return _this;
  44219. }
  44220. /**
  44221. * @function ThemeRange.prototype.destroy
  44222. * @override
  44223. */
  44224. ThemeRange_createClass(ThemeRange, [{
  44225. key: "destroy",
  44226. value: function destroy() {
  44227. ThemeRange_get(ThemeRange_getPrototypeOf(ThemeRange.prototype), "destroy", this).call(this);
  44228. var me = this;
  44229. if (me.items) {
  44230. if (me.items.length > 0) {
  44231. for (var item in me.items) {
  44232. me.items[item].destroy();
  44233. me.items[item] = null;
  44234. }
  44235. }
  44236. me.items = null;
  44237. }
  44238. me.rangeExpression = null;
  44239. me.rangeMode = null;
  44240. me.rangeParameter = null;
  44241. me.colorGradientType = null;
  44242. }
  44243. /**
  44244. * @function ThemeRange.fromObj
  44245. * @description 从传入对象获取范围分段专题图类。
  44246. * @param {Object} obj - 传入对象。
  44247. * @returns {ThemeRange} ThemeRange 对象。
  44248. */
  44249. }], [{
  44250. key: "fromObj",
  44251. value: function fromObj(obj) {
  44252. if (!obj) {
  44253. return;
  44254. }
  44255. var res = new ThemeRange();
  44256. Util_Util.copy(res, obj);
  44257. var itemsR = obj.items;
  44258. var len = itemsR ? itemsR.length : 0;
  44259. res.items = [];
  44260. for (var i = 0; i < len; i++) {
  44261. res.items.push(ThemeRangeItem.fromObj(itemsR[i]));
  44262. }
  44263. return res;
  44264. }
  44265. }]);
  44266. return ThemeRange;
  44267. }(Theme);
  44268. ;// CONCATENATED MODULE: ./src/common/iServer/UGCLayer.js
  44269. function UGCLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44270. function UGCLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  44271. function UGCLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) UGCLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) UGCLayer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  44272. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  44273. * This program are made available under the terms of the Apache License, Version 2.0
  44274. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  44275. /**
  44276. * @class UGCLayer
  44277. * @deprecatedclass SuperMap.UGCLayer
  44278. * @category iServer Map Layer
  44279. * @classdesc SuperMap 图层类。
  44280. * @param {Object} options - 参数。
  44281. * @param {Bounds} options.bounds - 图层范围。
  44282. * @param {string} options.name - 图层的名称。
  44283. * @param {UGCLayerType} options.type - 图层类型。
  44284. * @param {string} [options.caption] - 图层的标题。
  44285. * @param {string} [options.description] - 图层的描述信息。
  44286. * @param {boolean} [options.queryable] - 图层中的对象是否可以查询。
  44287. * @param {boolean} [options.subUGCLayers] - 是否允许图层的符号大小随图缩放。
  44288. * @param {boolean} [options.visible=false] - 地图对象在同一范围内时,是否重叠显示。
  44289. * @usage
  44290. */
  44291. var UGCLayer = /*#__PURE__*/function () {
  44292. function UGCLayer(options) {
  44293. UGCLayer_classCallCheck(this, UGCLayer);
  44294. options = options || {};
  44295. /**
  44296. * @member {Bounds} UGCLayer.prototype.bounds
  44297. * @description 图层范围。
  44298. */
  44299. this.bounds = null;
  44300. /**
  44301. * @member {string} [UGCLayer.prototype.caption]
  44302. * @description 图层的标题。默认情况下图层的标题与图层的名称一致。在图例、图层控制列表中显示的图层名称就是该图层的标题值。
  44303. */
  44304. this.caption = null;
  44305. /**
  44306. * @member {string} UGCLayer.prototype.description
  44307. * @description 图层的描述信息。
  44308. */
  44309. this.description = null;
  44310. /**
  44311. * @member {string} UGCLayer.prototype.name
  44312. * @description 图层的名称。图层的名称在图层所在的地图中唯一标识此图层。该属性区分大小写。
  44313. */
  44314. this.name = null;
  44315. /**
  44316. * @member {boolean} UGCLayer.prototype.queryable
  44317. * @description 图层中的对象是否可以查询。
  44318. */
  44319. this.queryable = null;
  44320. /**
  44321. * @member {Array} UGCLayer.prototype.subLayers
  44322. * @description 子图层集。
  44323. */
  44324. this.subLayers = null;
  44325. /**
  44326. * @member {UGCLayerType} UGCLayer.prototype.type
  44327. * @description 图层类型。
  44328. */
  44329. this.type = null;
  44330. /**
  44331. * @member {boolean} UGCLayer.prototype.visible
  44332. * @description 地图对象在同一范围内时,是否重叠显示。
  44333. */
  44334. this.visible = null;
  44335. Util_Util.extend(this, options);
  44336. this.CLASS_NAME = "SuperMap.UGCLayer";
  44337. }
  44338. /**
  44339. * @function UGCLayer.prototype.destroy
  44340. * @description 释放资源,将引用资源的属性置空。
  44341. */
  44342. UGCLayer_createClass(UGCLayer, [{
  44343. key: "destroy",
  44344. value: function destroy() {
  44345. var me = this;
  44346. Util_Util.reset(me);
  44347. }
  44348. /**
  44349. * @function UGCLayer.prototype.fromJson
  44350. * @description 将服务端 JSON 对象转换成当前客户端对象。
  44351. * @param {Object} jsonObject - 要转换的 JSON 对象。
  44352. */
  44353. }, {
  44354. key: "fromJson",
  44355. value: function fromJson(jsonObject) {
  44356. jsonObject = jsonObject ? jsonObject : {};
  44357. Util_Util.extend(this, jsonObject);
  44358. var b = this.bounds;
  44359. if (b) {
  44360. this.bounds = new Bounds(b.leftBottom.x, b.leftBottom.y, b.rightTop.x, b.rightTop.y);
  44361. }
  44362. }
  44363. /**
  44364. * @function UGCLayer.prototype.toServerJSONObject
  44365. * @description 转换成对应的 JSON 格式对象。
  44366. * @returns {Object} 对应的 JSON 格式对象。
  44367. */
  44368. }, {
  44369. key: "toServerJSONObject",
  44370. value: function toServerJSONObject() {
  44371. var jsonObject = {};
  44372. jsonObject = Util_Util.copyAttributes(jsonObject, this);
  44373. if (jsonObject.bounds) {
  44374. if (jsonObject.bounds.toServerJSONObject) {
  44375. jsonObject.bounds = jsonObject.bounds.toServerJSONObject();
  44376. }
  44377. }
  44378. return jsonObject;
  44379. }
  44380. }]);
  44381. return UGCLayer;
  44382. }();
  44383. ;// CONCATENATED MODULE: ./src/common/iServer/UGCMapLayer.js
  44384. function UGCMapLayer_typeof(obj) { "@babel/helpers - typeof"; return UGCMapLayer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, UGCMapLayer_typeof(obj); }
  44385. function UGCMapLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44386. function UGCMapLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  44387. function UGCMapLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) UGCMapLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) UGCMapLayer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  44388. function UGCMapLayer_get() { if (typeof Reflect !== "undefined" && Reflect.get) { UGCMapLayer_get = Reflect.get.bind(); } else { UGCMapLayer_get = function _get(target, property, receiver) { var base = UGCMapLayer_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return UGCMapLayer_get.apply(this, arguments); }
  44389. function UGCMapLayer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UGCMapLayer_getPrototypeOf(object); if (object === null) break; } return object; }
  44390. function UGCMapLayer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) UGCMapLayer_setPrototypeOf(subClass, superClass); }
  44391. function UGCMapLayer_setPrototypeOf(o, p) { UGCMapLayer_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UGCMapLayer_setPrototypeOf(o, p); }
  44392. function UGCMapLayer_createSuper(Derived) { var hasNativeReflectConstruct = UGCMapLayer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = UGCMapLayer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = UGCMapLayer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return UGCMapLayer_possibleConstructorReturn(this, result); }; }
  44393. function UGCMapLayer_possibleConstructorReturn(self, call) { if (call && (UGCMapLayer_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return UGCMapLayer_assertThisInitialized(self); }
  44394. function UGCMapLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  44395. function UGCMapLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  44396. function UGCMapLayer_getPrototypeOf(o) { UGCMapLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UGCMapLayer_getPrototypeOf(o); }
  44397. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  44398. * This program are made available under the terms of the Apache License, Version 2.0
  44399. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  44400. /**
  44401. * @class UGCMapLayer
  44402. * @deprecatedclass SuperMap.UGCMapLayer
  44403. * @category iServer Map Layer
  44404. * @classdesc SuperMap 地图图层类。
  44405. * @extends {UGCLayer}
  44406. * @param {Object} options - 可选参数。
  44407. * @param {boolean} [options.completeLineSymbolDisplayed] - 是否显示完整线型。
  44408. * @param {number} [options.maxScale] - 地图最大比例尺。
  44409. * @param {number} [options.minScale] - 地图最小比例尺。
  44410. * @param {number} [options.minVisibleGeometrySize] - 几何对象的最小可见大小,以像素为单位。
  44411. * @param {number} [options.opaqueRate] - 图层的不透明度。
  44412. * @param {boolean} [options.symbolScalable] - 是否允许图层的符号大小随图缩放。
  44413. * @param {number} [options.symbolScale] - 图层的符号缩放基准比例尺。
  44414. * @param {boolean} [options.overlapDisplayed=false] - 地图对象在同一范围内时,是否重叠显示。
  44415. * @param {OverlapDisplayedOptions} [options.overlapDisplayedOptions] - 地图的压盖过滤显示选项,当overlapDisplayed 为 false 时有效。
  44416. * @usage
  44417. */
  44418. var UGCMapLayer = /*#__PURE__*/function (_UGCLayer) {
  44419. UGCMapLayer_inherits(UGCMapLayer, _UGCLayer);
  44420. var _super = UGCMapLayer_createSuper(UGCMapLayer);
  44421. function UGCMapLayer(options) {
  44422. var _this;
  44423. UGCMapLayer_classCallCheck(this, UGCMapLayer);
  44424. options = options || {};
  44425. _this = _super.call(this, options);
  44426. /**
  44427. * @member {boolean} UGCMapLayer.prototype.completeLineSymbolDisplayed
  44428. * @description 是否显示完整线型。
  44429. */
  44430. _this.completeLineSymbolDisplayed = null;
  44431. /**
  44432. * @member {number} UGCMapLayer.prototype.maxScale
  44433. * @description 地图最大比例尺。
  44434. */
  44435. _this.maxScale = null;
  44436. /**
  44437. * @member {number} UGCMapLayer.prototype.minScale
  44438. * @description 地图最小比例尺。
  44439. */
  44440. _this.minScale = null;
  44441. /**
  44442. * @member {number} UGCMapLayer.prototype.minVisibleGeometrySize
  44443. * @description 几何对象的最小可见大小,以像素为单位。
  44444. */
  44445. _this.minVisibleGeometrySize = null;
  44446. /**
  44447. * @member {number} UGCMapLayer.prototype.opaqueRate
  44448. * @description 图层的不透明度。
  44449. */
  44450. _this.opaqueRate = null;
  44451. /**
  44452. * @member {boolean} UGCMapLayer.prototype.symbolScalable
  44453. * @description 是否允许图层的符号大小随图缩放。
  44454. */
  44455. _this.symbolScalable = null;
  44456. /**
  44457. * @member {number} UGCMapLayer.prototype.symbolScale
  44458. * @description 图层的符号缩放基准比例尺。
  44459. */
  44460. _this.symbolScale = null;
  44461. /**
  44462. * @member {boolean} [UGCMapLayer.prototype.overlapDisplayed=false]
  44463. * @description 地图对象在同一范围内时,是否重叠显示。
  44464. */
  44465. _this.overlapDisplayed = null;
  44466. /**
  44467. * @member {OverlapDisplayedOptions} UGCMapLayer.prototype.overlapDisplayedOptions
  44468. * @description 地图的压盖过滤显示选项,当 overlapDisplayed 为 false 时有效。
  44469. */
  44470. _this.overlapDisplayedOptions = null;
  44471. _this.CLASS_NAME = "SuperMap.UGCMapLayer";
  44472. return _this;
  44473. }
  44474. /**
  44475. * @function UGCMapLayer.prototype.destroy
  44476. * @override
  44477. */
  44478. UGCMapLayer_createClass(UGCMapLayer, [{
  44479. key: "destroy",
  44480. value: function destroy() {
  44481. UGCMapLayer_get(UGCMapLayer_getPrototypeOf(UGCMapLayer.prototype), "destroy", this).call(this);
  44482. Util_Util.reset(this);
  44483. }
  44484. /**
  44485. * @function UGCMapLayer.prototype.fromJson
  44486. * @description 将服务端 JSON 对象转换成当前客户端对象。
  44487. * @param {Object} jsonObject - 要转换的 JSON 对象。
  44488. */
  44489. }, {
  44490. key: "fromJson",
  44491. value: function fromJson(jsonObject) {
  44492. UGCMapLayer_get(UGCMapLayer_getPrototypeOf(UGCMapLayer.prototype), "fromJson", this).call(this, jsonObject);
  44493. }
  44494. /**
  44495. * @function UGCMapLayer.prototype.toServerJSONObject
  44496. * @description 转换成对应的 JSON 格式对象。
  44497. * @returns {Object} 对应的 JSON 格式对象。
  44498. */
  44499. }, {
  44500. key: "toServerJSONObject",
  44501. value: function toServerJSONObject() {
  44502. return UGCMapLayer_get(UGCMapLayer_getPrototypeOf(UGCMapLayer.prototype), "toServerJSONObject", this).call(this);
  44503. }
  44504. }]);
  44505. return UGCMapLayer;
  44506. }(UGCLayer);
  44507. ;// CONCATENATED MODULE: ./src/common/iServer/JoinItem.js
  44508. function JoinItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44509. function JoinItem_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  44510. function JoinItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) JoinItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) JoinItem_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  44511. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  44512. * This program are made available under the terms of the Apache License, Version 2.0
  44513. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  44514. /**
  44515. * @class JoinItem
  44516. * @deprecatedclass SuperMap.JoinItem
  44517. * @category iServer Data FeatureResults
  44518. * @classdesc 连接信息类。
  44519. * 该类用于矢量数据集与外部表的连接。外部表可以为另一个矢量数据集(其中纯属性数据集中没有空间几何信息)所对应的 DBMS 表,也可以是用户自建的业务表。
  44520. * 需要注意的是,矢量数据集与外部表必须属于同一数据源。表之间的联系的建立有两种方式,一种是连接(join),一种是关联(link)。
  44521. * 连接,实际上是依据相同的字段将一个外部表追加到指定的表;而关联是基于一个相同的字段定义了两个表格之间的联系,但不是实际的追加。
  44522. * 用于连接两个表的字段的名称不一定相同,但类型必须一致。当两个表格之间建立了连接,通过对主表进行操作,可以对外部表进行查询,制作专题图以及分析等。
  44523. * 当两个表格之间是一对一或多对一的关系时,可以使用 join 连接。当为多对一的关系时,允许指定多个字段之间的关联。
  44524. *(注意:JoinItem 目前支持左连接和内连接,不支持全连接和右连接,UDB 引擎不支持内连接。并且用于建立连接的两个表必须在同一个数据源下。)
  44525. * @param {Object} options - 参数。
  44526. * @param {string} options.foreignTableName - 外部表的名称。
  44527. * @param {string} options.joinFilter - 矢量数据集与外部表之间的连接表达式,即设定两个表之间关联的字段。
  44528. * @param {JoinType} options.joinType - 两个表之间连接类型。
  44529. * @example 下面以 SQL 查询说明 joinItem 的使用方法:
  44530. *(start code)
  44531. * function queryBySQL() {
  44532. * // 设置与外部表的连接信息
  44533. * var joinItem = new JoinItem({
  44534. * foreignTableName: "foreignTable",
  44535. * joinFilter: "foreignTable.CONTINENT = Countries.CONTINENT",
  44536. * joinType: "LEFTJOIN"
  44537. * })
  44538. * var queryParam, queryBySQLParams, queryBySQLService;
  44539. * // 设置查询参数,在查询参数中添加joinItem关联条件信息
  44540. * queryParam = new FilterParameter({
  44541. * name: "Countries@World",
  44542. * joinItems: [joinItem]
  44543. * }),
  44544. * queryBySQLParams = new QueryBySQLParameters({
  44545. * queryParams: [queryParam]
  44546. * }),
  44547. * queryBySQLService = new QueryBySQLService(url, {
  44548. * eventListeners: { "processCompleted": processCompleted, "processFailed": processFailed}
  44549. * });
  44550. * queryBySQLService.processAsync(queryBySQLParams);
  44551. * }
  44552. * function processCompleted(queryEventArgs) {//todo}
  44553. * function processFailed(e) {//todo}
  44554. * (end)
  44555. * @usage
  44556. */
  44557. var JoinItem = /*#__PURE__*/function () {
  44558. function JoinItem(options) {
  44559. JoinItem_classCallCheck(this, JoinItem);
  44560. /**
  44561. * @member {string} JoinItem.prototype.foreignTableName
  44562. * @description 外部表的名称。
  44563. * 如果外部表的名称是以 “表名@数据源名” 命名方式,则该属性只需赋值表名。
  44564. * 例如:外部表 Name@changchun,Name 为表名,changchun 为数据源名称,则该属性的赋值应为:Name。
  44565. */
  44566. this.foreignTableName = null;
  44567. /**
  44568. * @member {string} JoinItem.prototype.joinFilter
  44569. * @description 矢量数据集与外部表之间的连接表达式,即设定两个表之间关联的字段。
  44570. * 例如,将房屋面数据集(Building)的 district 字段与房屋拥有者的纯属性数据集(Owner)的 region 字段相连接,
  44571. * 两个数据集对应的表名称分别为 Table_Building 和 Table_Owner,
  44572. * 则连接表达式为 Table_Building.district = Table_Owner.region。
  44573. * 当有多个字段相连接时,用 AND 将多个表达式相连。
  44574. */
  44575. this.joinFilter = null;
  44576. /**
  44577. * @member {JoinType} JoinItem.prototype.joinType
  44578. * @description 两个表之间连接类型。
  44579. * 连接类型决定了对两个表进行连接查询后返回的记录的情况。
  44580. */
  44581. this.joinType = null;
  44582. if (options) {
  44583. Util_Util.extend(this, options);
  44584. }
  44585. this.CLASS_NAME = "SuperMap.JoinItem";
  44586. }
  44587. /**
  44588. * @function JoinItem.prototype.destroy
  44589. * @description 释放资源,将引用资源的属性置空。
  44590. */
  44591. JoinItem_createClass(JoinItem, [{
  44592. key: "destroy",
  44593. value: function destroy() {
  44594. var me = this;
  44595. me.foreignTableName = null;
  44596. me.joinFilter = null;
  44597. me.joinType = null;
  44598. }
  44599. /**
  44600. * @function JoinItem.prototype.toServerJSONObject
  44601. * @description 转换成对应的 JSON 格式对象。
  44602. */
  44603. }, {
  44604. key: "toServerJSONObject",
  44605. value: function toServerJSONObject() {
  44606. var dataObj = {};
  44607. dataObj = Util_Util.copyAttributes(dataObj, this);
  44608. //joinFilter基本是个纯属性对象,这里不再做转换
  44609. return dataObj;
  44610. }
  44611. }]);
  44612. return JoinItem;
  44613. }();
  44614. ;// CONCATENATED MODULE: ./src/common/iServer/UGCSubLayer.js
  44615. function UGCSubLayer_typeof(obj) { "@babel/helpers - typeof"; return UGCSubLayer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, UGCSubLayer_typeof(obj); }
  44616. function UGCSubLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44617. function UGCSubLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  44618. function UGCSubLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) UGCSubLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) UGCSubLayer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  44619. function UGCSubLayer_get() { if (typeof Reflect !== "undefined" && Reflect.get) { UGCSubLayer_get = Reflect.get.bind(); } else { UGCSubLayer_get = function _get(target, property, receiver) { var base = UGCSubLayer_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return UGCSubLayer_get.apply(this, arguments); }
  44620. function UGCSubLayer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UGCSubLayer_getPrototypeOf(object); if (object === null) break; } return object; }
  44621. function UGCSubLayer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) UGCSubLayer_setPrototypeOf(subClass, superClass); }
  44622. function UGCSubLayer_setPrototypeOf(o, p) { UGCSubLayer_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UGCSubLayer_setPrototypeOf(o, p); }
  44623. function UGCSubLayer_createSuper(Derived) { var hasNativeReflectConstruct = UGCSubLayer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = UGCSubLayer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = UGCSubLayer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return UGCSubLayer_possibleConstructorReturn(this, result); }; }
  44624. function UGCSubLayer_possibleConstructorReturn(self, call) { if (call && (UGCSubLayer_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return UGCSubLayer_assertThisInitialized(self); }
  44625. function UGCSubLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  44626. function UGCSubLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  44627. function UGCSubLayer_getPrototypeOf(o) { UGCSubLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UGCSubLayer_getPrototypeOf(o); }
  44628. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  44629. * This program are made available under the terms of the Apache License, Version 2.0
  44630. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  44631. /**
  44632. * @class UGCSubLayer
  44633. * @deprecatedclass SuperMap.UGCSubLayer
  44634. * @category iServer Map Layer
  44635. * @classdesc 地图服务图层属性信息类。影像图层(Image)、专题图层(ServerTheme)、栅格图层(Grid)、矢量图层(Vector)等图层均继承该类。
  44636. * @extends {UGCMapLayer}
  44637. * @param {Object} options - 参数。
  44638. * @param {DatasetInfo} options.datasetInfo - 数据集信息。
  44639. * @param {string} [options.displayFilter] - 图层显示过滤条件。
  44640. * @param {JoinItem} [options.joinItems] - 连接信息类。
  44641. * @param {string} [options.representationField] - 存储制图表达信息的字段。
  44642. * @param {LayerType} [options.ugcLayerType] - 图层类型。
  44643. * @usage
  44644. */
  44645. var UGCSubLayer = /*#__PURE__*/function (_UGCMapLayer) {
  44646. UGCSubLayer_inherits(UGCSubLayer, _UGCMapLayer);
  44647. var _super = UGCSubLayer_createSuper(UGCSubLayer);
  44648. function UGCSubLayer(options) {
  44649. var _this;
  44650. UGCSubLayer_classCallCheck(this, UGCSubLayer);
  44651. options = options || {};
  44652. _this = _super.call(this, options);
  44653. /**
  44654. * @member {DatasetInfo} UGCSubLayer.prototype.datasetInfo
  44655. * @description 数据集信息。
  44656. */
  44657. _this.datasetInfo = null;
  44658. /**
  44659. * @member {string} UGCSubLayer.prototype.displayFilter
  44660. * @description 图层显示过滤条件。
  44661. */
  44662. _this.displayFilter = null;
  44663. /**
  44664. * @member {JoinItem} UGCSubLayer.prototype.joinItems
  44665. * @description 连接信息类。
  44666. */
  44667. _this.joinItems = null;
  44668. /**
  44669. * @member {string} UGCSubLayer.prototype.representationField
  44670. * @description 存储制图表达信息的字段。
  44671. */
  44672. _this.representationField = null;
  44673. /**
  44674. * @member {LayerType} UGCSubLayer.prototype.ugcLayerType
  44675. * @description 图层类型。
  44676. */
  44677. _this.ugcLayerType = null;
  44678. _this.CLASS_NAME = "SuperMap.UGCSubLayer";
  44679. return _this;
  44680. }
  44681. /**
  44682. * @function UGCSubLayer.prototype.fromJson
  44683. * @description 将服务端 JSON 对象转换成当前客户端对象。
  44684. * @param {Object} jsonObject - 要转换的 JSON 对象。
  44685. */
  44686. UGCSubLayer_createClass(UGCSubLayer, [{
  44687. key: "fromJson",
  44688. value: function fromJson(jsonObject) {
  44689. UGCSubLayer_get(UGCSubLayer_getPrototypeOf(UGCSubLayer.prototype), "fromJson", this).call(this, jsonObject);
  44690. if (this.datasetInfo) {
  44691. this.datasetInfo = new DatasetInfo(this.datasetInfo);
  44692. }
  44693. if (this.joinItems && this.joinItems.length) {
  44694. var newJoinItems = [];
  44695. for (var i = 0; i < this.joinItems.length; i++) {
  44696. newJoinItems[i] = new JoinItem(this.joinItems[i]);
  44697. }
  44698. this.joinItems = newJoinItems;
  44699. }
  44700. }
  44701. /**
  44702. * @function UGCSubLayer.prototype.destroy
  44703. * @override
  44704. */
  44705. }, {
  44706. key: "destroy",
  44707. value: function destroy() {
  44708. UGCSubLayer_get(UGCSubLayer_getPrototypeOf(UGCSubLayer.prototype), "destroy", this).call(this);
  44709. Util_Util.reset(this);
  44710. }
  44711. /**
  44712. * @function UGCSubLayer.prototype.toServerJSONObject
  44713. * @description 转换成对应的 JSON 格式对象。
  44714. * @returns {Object} 对应的 JSON 格式对象。
  44715. */
  44716. }, {
  44717. key: "toServerJSONObject",
  44718. value: function toServerJSONObject() {
  44719. var jsonObject = UGCSubLayer_get(UGCSubLayer_getPrototypeOf(UGCSubLayer.prototype), "toServerJSONObject", this).call(this);
  44720. if (jsonObject.joinItems) {
  44721. var joinItems = [];
  44722. for (var i = 0; i < jsonObject.joinItems.length; i++) {
  44723. if (jsonObject.joinItems[i].toServerJSONObject) {
  44724. joinItems[i] = jsonObject.joinItems[i].toServerJSONObject();
  44725. }
  44726. }
  44727. jsonObject.joinItems = joinItems;
  44728. }
  44729. if (jsonObject.datasetInfo) {
  44730. if (jsonObject.datasetInfo.toServerJSONObject) {
  44731. jsonObject.datasetInfo = jsonObject.datasetInfo.toServerJSONObject();
  44732. }
  44733. }
  44734. return jsonObject;
  44735. }
  44736. }]);
  44737. return UGCSubLayer;
  44738. }(UGCMapLayer);
  44739. ;// CONCATENATED MODULE: ./src/common/iServer/ServerTheme.js
  44740. function ServerTheme_typeof(obj) { "@babel/helpers - typeof"; return ServerTheme_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ServerTheme_typeof(obj); }
  44741. function ServerTheme_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44742. function ServerTheme_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  44743. function ServerTheme_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerTheme_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerTheme_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  44744. function ServerTheme_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ServerTheme_get = Reflect.get.bind(); } else { ServerTheme_get = function _get(target, property, receiver) { var base = ServerTheme_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ServerTheme_get.apply(this, arguments); }
  44745. function ServerTheme_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ServerTheme_getPrototypeOf(object); if (object === null) break; } return object; }
  44746. function ServerTheme_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ServerTheme_setPrototypeOf(subClass, superClass); }
  44747. function ServerTheme_setPrototypeOf(o, p) { ServerTheme_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ServerTheme_setPrototypeOf(o, p); }
  44748. function ServerTheme_createSuper(Derived) { var hasNativeReflectConstruct = ServerTheme_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ServerTheme_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ServerTheme_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ServerTheme_possibleConstructorReturn(this, result); }; }
  44749. function ServerTheme_possibleConstructorReturn(self, call) { if (call && (ServerTheme_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ServerTheme_assertThisInitialized(self); }
  44750. function ServerTheme_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  44751. function ServerTheme_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  44752. function ServerTheme_getPrototypeOf(o) { ServerTheme_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ServerTheme_getPrototypeOf(o); }
  44753. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  44754. * This program are made available under the terms of the Apache License, Version 2.0
  44755. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  44756. /**
  44757. * @class ServerTheme
  44758. * @deprecatedclass SuperMap.ServerTheme
  44759. * @category iServer Map Theme
  44760. * @classdesc SuperMap 专题图图层类。
  44761. * @extends {UGCSubLayer}
  44762. * @param {CommonTheme} theme - 专题图对象。
  44763. * @param {LonLat} themeElementPosition - 专题图元素位置。
  44764. * @usage
  44765. */
  44766. var ServerTheme = /*#__PURE__*/function (_UGCSubLayer) {
  44767. ServerTheme_inherits(ServerTheme, _UGCSubLayer);
  44768. var _super = ServerTheme_createSuper(ServerTheme);
  44769. function ServerTheme(options) {
  44770. var _this;
  44771. ServerTheme_classCallCheck(this, ServerTheme);
  44772. options = options || {};
  44773. _this = _super.call(this, options);
  44774. /**
  44775. * @member {CommonTheme} ServerTheme.prototype.theme
  44776. * @description 专题图对象。
  44777. */
  44778. _this.theme = null;
  44779. /**
  44780. * @member {LonLat} ServerTheme.prototype.themeElementPosition
  44781. * @description 专题图元素位置。
  44782. */
  44783. _this.themeElementPosition = null;
  44784. _this.CLASS_NAME = "SuperMap.ServerTheme";
  44785. return _this;
  44786. }
  44787. /**
  44788. * @function ServerTheme.prototype.destroy
  44789. * @description 释放资源,将引用资源的属性置空。
  44790. * @override
  44791. */
  44792. ServerTheme_createClass(ServerTheme, [{
  44793. key: "destroy",
  44794. value: function destroy() {
  44795. ServerTheme_get(ServerTheme_getPrototypeOf(ServerTheme.prototype), "destroy", this).call(this);
  44796. Util_Util.reset(this);
  44797. }
  44798. /**
  44799. * @function ServerTheme.prototype.fromJson
  44800. * @description 将服务端 JSON 对象转换成当前客户端对象。
  44801. * @param {Object} jsonObject - 要转换的 JSON 对象。
  44802. */
  44803. }, {
  44804. key: "fromJson",
  44805. value: function fromJson(jsonObject) {
  44806. ServerTheme_get(ServerTheme_getPrototypeOf(ServerTheme.prototype), "fromJson", this).call(this, jsonObject);
  44807. var themeObj = this.theme;
  44808. var themeT = themeObj && themeObj.type;
  44809. switch (themeT) {
  44810. case 'LABEL':
  44811. this.theme = ThemeLabel.fromObj(themeObj);
  44812. break;
  44813. case 'UNIQUE':
  44814. this.theme = ThemeUnique.fromObj(themeObj);
  44815. break;
  44816. case 'GRAPH':
  44817. this.theme = ThemeGraph.fromObj(themeObj);
  44818. break;
  44819. case 'DOTDENSITY':
  44820. this.theme = ThemeDotDensity.fromObj(themeObj);
  44821. break;
  44822. case 'GRADUATEDSYMBOL':
  44823. this.theme = ThemeGraduatedSymbol.fromObj(themeObj);
  44824. break;
  44825. case 'RANGE':
  44826. this.theme = ThemeRange.fromObj(themeObj);
  44827. break;
  44828. default:
  44829. break;
  44830. }
  44831. if (this.themeElementPosition) {
  44832. //待测试
  44833. this.themeElementPosition = new LonLat(this.themeElementPosition.x, this.themeElementPosition.y);
  44834. }
  44835. }
  44836. /**
  44837. * @function ServerTheme.prototype.toServerJSONObject
  44838. * @description 转换成对应的 JSON 格式对象。
  44839. */
  44840. }, {
  44841. key: "toServerJSONObject",
  44842. value: function toServerJSONObject() {
  44843. //普通属性直接赋值
  44844. var jsonObject = ServerTheme_get(ServerTheme_getPrototypeOf(ServerTheme.prototype), "toServerJSONObject", this).call(this);
  44845. if (jsonObject.themeElementPosition) {
  44846. if (jsonObject.themeElementPosition.toServerJSONObject) {
  44847. jsonObject.themeElementPosition = jsonObject.themeElementPosition.toServerJSONObject();
  44848. }
  44849. }
  44850. if (jsonObject.theme) {
  44851. if (jsonObject.theme.toServerJSONObject) {
  44852. jsonObject.theme = jsonObject.theme.toServerJSONObject();
  44853. }
  44854. }
  44855. return jsonObject;
  44856. }
  44857. }]);
  44858. return ServerTheme;
  44859. }(UGCSubLayer);
  44860. ;// CONCATENATED MODULE: ./src/common/iServer/Grid.js
  44861. function Grid_typeof(obj) { "@babel/helpers - typeof"; return Grid_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Grid_typeof(obj); }
  44862. function Grid_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44863. function Grid_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  44864. function Grid_createClass(Constructor, protoProps, staticProps) { if (protoProps) Grid_defineProperties(Constructor.prototype, protoProps); if (staticProps) Grid_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  44865. function Grid_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Grid_get = Reflect.get.bind(); } else { Grid_get = function _get(target, property, receiver) { var base = Grid_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Grid_get.apply(this, arguments); }
  44866. function Grid_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Grid_getPrototypeOf(object); if (object === null) break; } return object; }
  44867. function Grid_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Grid_setPrototypeOf(subClass, superClass); }
  44868. function Grid_setPrototypeOf(o, p) { Grid_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Grid_setPrototypeOf(o, p); }
  44869. function Grid_createSuper(Derived) { var hasNativeReflectConstruct = Grid_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Grid_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Grid_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Grid_possibleConstructorReturn(this, result); }; }
  44870. function Grid_possibleConstructorReturn(self, call) { if (call && (Grid_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Grid_assertThisInitialized(self); }
  44871. function Grid_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  44872. function Grid_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  44873. function Grid_getPrototypeOf(o) { Grid_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Grid_getPrototypeOf(o); }
  44874. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  44875. * This program are made available under the terms of the Apache License, Version 2.0
  44876. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  44877. /**
  44878. * @class Grid
  44879. * @deprecatedclass SuperMap.Grid
  44880. * @category iServer Map Layer
  44881. * @classdesc SuperMap 栅格图层类。
  44882. * @extends {UGCSubLayer}
  44883. * @param {Object} options - 可选参数。
  44884. * @param {Array.<Object>} [options.colorDictionary] - 颜色对照表对象。
  44885. * @param {number} [options.brightness] - Grid 图层的亮度。
  44886. * @param {ColorGradientType} [options.colorGradientType] - 颜色渐变枚举。
  44887. * @param {ServerColor} [options.colors] - 颜色表对象。
  44888. * @param {number} [options.contrast] - Grid 图层的对比度。
  44889. * @param {GridType} [options.gridType] - 格网类型。
  44890. * @param {number} [options.horizontalSpacing] - 格网水平间隔大小。
  44891. * @param {boolean} [options.sizeFixed] - 格网是否固定大小,如果不固定大小,则格网随着地图缩放。
  44892. * @param {ServerStyle} [options.solidStyle] - 格网实线的样式。
  44893. * @param {ServerColor} [options.specialColor] - 栅格数据集无值数据的颜色。
  44894. * @param {number} [options.specialValue] - 图层的特殊值。
  44895. * @param {boolean} [options.specialValueTransparent] - 图层的特殊值(specialValue)所处区域是否透明。
  44896. * @param {number} [options.verticalSpacing] - 格网垂直间隔大小。
  44897. * @usage
  44898. */
  44899. var Grid = /*#__PURE__*/function (_UGCSubLayer) {
  44900. Grid_inherits(Grid, _UGCSubLayer);
  44901. var _super = Grid_createSuper(Grid);
  44902. function Grid(options) {
  44903. var _this;
  44904. Grid_classCallCheck(this, Grid);
  44905. options = options || {};
  44906. _this = _super.call(this, options);
  44907. /**
  44908. * @member {Array.<ColorDictionary>} Grid.prototype.colorDictionarys
  44909. * @description 颜色对照表对象。
  44910. */
  44911. _this.colorDictionarys = null;
  44912. /**
  44913. * @member {number} Grid.prototype.brightness
  44914. * @description Grid 图层的亮度。
  44915. */
  44916. _this.brightness = null;
  44917. /**
  44918. * @member {ColorGradientType} Grid.prototype.colorGradientType
  44919. * @description 渐变颜色枚举值。
  44920. */
  44921. _this.colorGradientType = null;
  44922. /**
  44923. * @member {ServerColor} Grid.prototype.colors
  44924. * @description 颜色表对象。
  44925. */
  44926. _this.colors = null;
  44927. /**
  44928. * @member {number} Grid.prototype.contrast
  44929. * @description Grid 图层的对比度。
  44930. */
  44931. _this.contrast = null;
  44932. /**
  44933. * @member {ServerStyle} Grid.prototype.dashStyle
  44934. * @description 栅格数据集特殊值数据的颜色。
  44935. */
  44936. _this.dashStyle = null;
  44937. /**
  44938. * @member {GridType} Grid.prototype.gridType
  44939. * @description 格网类型。
  44940. */
  44941. _this.gridType = null;
  44942. /**
  44943. * @member {number} Grid.prototype.horizontalSpacing
  44944. * @description 格网水平间隔大小。
  44945. */
  44946. _this.horizontalSpacing = null;
  44947. /**
  44948. * @member {boolean} Grid.prototype.sizeFixed
  44949. * @description 格网是否固定大小,如果不固定大小,则格网随着地图缩放。
  44950. */
  44951. _this.sizeFixed = null;
  44952. /**
  44953. * @member {ServerStyle} Grid.prototype.solidStyle
  44954. * @description 格网实线的样式。
  44955. */
  44956. _this.solidStyle = null;
  44957. /**
  44958. * @member {ServerColor} Grid.prototype.specialColor
  44959. * @description 栅格数据集无值数据的颜色。
  44960. */
  44961. _this.specialColor = null;
  44962. /**
  44963. * @member {number} Grid.prototype.specialValue
  44964. * @description 图层的特殊值。
  44965. */
  44966. _this.specialValue = null;
  44967. /**
  44968. * @member {boolean} Grid.prototype.specialValueTransparent
  44969. * @description 图层的特殊值(specialValue)所处区域是否透明。
  44970. */
  44971. _this.specialValueTransparent = null;
  44972. /**
  44973. * @member {number} Grid.prototype.verticalSpacing
  44974. * @description 格网垂直间隔大小。
  44975. */
  44976. _this.verticalSpacing = null;
  44977. _this.CLASS_NAME = "SuperMap.Grid";
  44978. return _this;
  44979. }
  44980. /**
  44981. * @function Grid.prototype.destroy
  44982. * @description 释放资源,将引用资源的属性置空。
  44983. */
  44984. Grid_createClass(Grid, [{
  44985. key: "destroy",
  44986. value: function destroy() {
  44987. Grid_get(Grid_getPrototypeOf(Grid.prototype), "destroy", this).call(this);
  44988. Util_Util.reset(this);
  44989. }
  44990. /**
  44991. * @function Grid.prototype.fromJson
  44992. * @description 将服务端 JSON 对象转换成当前客户端对象。
  44993. * @param {Object} jsonObject - 要转换的 JSON 对象。
  44994. */
  44995. }, {
  44996. key: "fromJson",
  44997. value: function fromJson(jsonObject) {
  44998. Grid_get(Grid_getPrototypeOf(Grid.prototype), "fromJson", this).call(this, jsonObject);
  44999. if (this.specialColor) {
  45000. this.specialColor = new ServerColor(this.specialColor.red, this.specialColor.green, this.specialColor.blue);
  45001. }
  45002. if (this.colors) {
  45003. var colors = [],
  45004. color;
  45005. for (var i in this.colors) {
  45006. color = this.colors[i];
  45007. colors.push(new ServerColor(color.red, color.green, color.blue));
  45008. }
  45009. this.colors = colors;
  45010. }
  45011. if (this.dashStyle) {
  45012. this.dashStyle = new ServerStyle(this.dashStyle);
  45013. }
  45014. if (this.solidStyle) {
  45015. this.solidStyle = new ServerStyle(this.solidStyle);
  45016. }
  45017. if (this.colorDictionary) {
  45018. var colorDics = [],
  45019. colorDic;
  45020. for (var key in this.colorDictionary) {
  45021. colorDic = this.colorDictionary[key];
  45022. colorDics.push(new ColorDictionary({
  45023. elevation: key,
  45024. color: colorDic
  45025. }));
  45026. }
  45027. this.colorDictionarys = colorDics;
  45028. }
  45029. delete this.colorDictionary;
  45030. }
  45031. /**
  45032. * @function Grid.prototype.toServerJSONObject
  45033. * @description 转换成对应的 JSON 对象。
  45034. * @returns JSON 对象。
  45035. */
  45036. }, {
  45037. key: "toServerJSONObject",
  45038. value: function toServerJSONObject() {
  45039. var jsonObject = Grid_get(Grid_getPrototypeOf(Grid.prototype), "toServerJSONObject", this).call(this);
  45040. if (jsonObject.dashStyle) {
  45041. if (jsonObject.dashStyle.toServerJSONObject) {
  45042. jsonObject.dashStyle = jsonObject.dashStyle.toServerJSONObject();
  45043. }
  45044. }
  45045. if (jsonObject.solidStyle) {
  45046. if (jsonObject.solidStyle.toServerJSONObject) {
  45047. jsonObject.solidStyle = jsonObject.solidStyle.toServerJSONObject();
  45048. }
  45049. }
  45050. return jsonObject;
  45051. }
  45052. }]);
  45053. return Grid;
  45054. }(UGCSubLayer);
  45055. ;// CONCATENATED MODULE: ./src/common/iServer/Image.js
  45056. function Image_typeof(obj) { "@babel/helpers - typeof"; return Image_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Image_typeof(obj); }
  45057. function Image_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45058. function Image_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  45059. function Image_createClass(Constructor, protoProps, staticProps) { if (protoProps) Image_defineProperties(Constructor.prototype, protoProps); if (staticProps) Image_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  45060. function Image_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Image_get = Reflect.get.bind(); } else { Image_get = function _get(target, property, receiver) { var base = Image_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Image_get.apply(this, arguments); }
  45061. function Image_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Image_getPrototypeOf(object); if (object === null) break; } return object; }
  45062. function Image_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Image_setPrototypeOf(subClass, superClass); }
  45063. function Image_setPrototypeOf(o, p) { Image_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Image_setPrototypeOf(o, p); }
  45064. function Image_createSuper(Derived) { var hasNativeReflectConstruct = Image_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Image_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Image_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Image_possibleConstructorReturn(this, result); }; }
  45065. function Image_possibleConstructorReturn(self, call) { if (call && (Image_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Image_assertThisInitialized(self); }
  45066. function Image_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45067. function Image_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  45068. function Image_getPrototypeOf(o) { Image_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Image_getPrototypeOf(o); }
  45069. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45070. * This program are made available under the terms of the Apache License, Version 2.0
  45071. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45072. /**
  45073. * @class UGCImage
  45074. * @deprecatedclass SuperMap.Image
  45075. * @category iServer Map Layer
  45076. * @classdesc SuperMap 影像图层类
  45077. * @extends {UGCSubLayer}
  45078. * @param {Object} options - 可选参数。
  45079. * @param {ColorSpaceType} [options.colorSpaceType] - 返回影像图层的色彩显示模式。
  45080. * @param {number} [options.brightness] - 影像图层的亮度。
  45081. * @param {Array.<number>} [options.displayBandIndexes] - 返回当前影像图层显示的波段索引。
  45082. * @param {number} [options.contrast] - 影像图层的对比度。
  45083. * @param {boolean} [options.transparent] - 是否背景透明。
  45084. * @param {ServerColor} [options.transparentColor] - 返回背景透明色。
  45085. * @param {number} [options.transparentColorTolerance] - 背景透明色容限。
  45086. * @usage
  45087. * @private
  45088. */
  45089. var UGCImage = /*#__PURE__*/function (_UGCSubLayer) {
  45090. Image_inherits(UGCImage, _UGCSubLayer);
  45091. var _super = Image_createSuper(UGCImage);
  45092. function UGCImage(options) {
  45093. var _this;
  45094. Image_classCallCheck(this, UGCImage);
  45095. options = options || {};
  45096. _this = _super.call(this, options);
  45097. /**
  45098. * @member {number} UGCImage.prototype.brightness
  45099. * @description 影像图层的亮度。
  45100. */
  45101. _this.brightness = null;
  45102. /**
  45103. * @member {ColorSpaceType} UGCImage.prototype.colorSpaceType
  45104. * @description 返回影像图层的色彩显示模式。
  45105. */
  45106. _this.colorSpaceType = null;
  45107. /**
  45108. * @member {number} UGCImage.prototype.contrast
  45109. * @description 影像图层的对比度。
  45110. */
  45111. _this.contrast = null;
  45112. /**
  45113. * @member {Array.<number>} UGCImage.prototype.displayBandIndexes
  45114. * @description 返回当前影像图层显示的波段索引。
  45115. */
  45116. _this.displayBandIndexes = null;
  45117. /**
  45118. * @member {boolean} UGCImage.prototype.transparent
  45119. * @description 是否背景透明。
  45120. */
  45121. _this.transparent = null;
  45122. /**
  45123. * @member {ServerColor} UGCImage.prototype.transparentColor
  45124. * @description 返回背景透明色。
  45125. */
  45126. _this.transparentColor = null;
  45127. /**
  45128. * @member {number} UGCImage.prototype.transparentColorTolerance
  45129. * @description 背景透明色容限。
  45130. */
  45131. _this.transparentColorTolerance = null;
  45132. _this.CLASS_NAME = "SuperMap.Image";
  45133. return _this;
  45134. }
  45135. /**
  45136. * @function UGCImage.prototype.destroy
  45137. * @override
  45138. */
  45139. Image_createClass(UGCImage, [{
  45140. key: "destroy",
  45141. value: function destroy() {
  45142. Image_get(Image_getPrototypeOf(UGCImage.prototype), "destroy", this).call(this);
  45143. Util_Util.reset(this);
  45144. }
  45145. /**
  45146. * @function UGCImage.prototype.fromJson
  45147. * @description 将服务端 JSON 对象转换成当前客户端对象。
  45148. * @param {Object} jsonObject - 要转换的 JSON 对象。
  45149. */
  45150. }, {
  45151. key: "fromJson",
  45152. value: function fromJson(jsonObject) {
  45153. Image_get(Image_getPrototypeOf(UGCImage.prototype), "fromJson", this).call(this, jsonObject);
  45154. if (this.transparentColor) {
  45155. this.transparentColor = new ServerColor(this.transparentColor.red, this.transparentColor.green, this.transparentColor.blue);
  45156. }
  45157. }
  45158. /**
  45159. * @function UGCImage.prototype.toServerJSONObject
  45160. * @description 转换成对应的 JSON 格式对象。
  45161. */
  45162. }, {
  45163. key: "toServerJSONObject",
  45164. value: function toServerJSONObject() {
  45165. return Image_get(Image_getPrototypeOf(UGCImage.prototype), "toServerJSONObject", this).call(this);
  45166. }
  45167. }]);
  45168. return UGCImage;
  45169. }(UGCSubLayer);
  45170. ;// CONCATENATED MODULE: ./src/common/iServer/Vector.js
  45171. function iServer_Vector_typeof(obj) { "@babel/helpers - typeof"; return iServer_Vector_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, iServer_Vector_typeof(obj); }
  45172. function iServer_Vector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45173. function iServer_Vector_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  45174. function iServer_Vector_createClass(Constructor, protoProps, staticProps) { if (protoProps) iServer_Vector_defineProperties(Constructor.prototype, protoProps); if (staticProps) iServer_Vector_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  45175. function iServer_Vector_get() { if (typeof Reflect !== "undefined" && Reflect.get) { iServer_Vector_get = Reflect.get.bind(); } else { iServer_Vector_get = function _get(target, property, receiver) { var base = iServer_Vector_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return iServer_Vector_get.apply(this, arguments); }
  45176. function iServer_Vector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = iServer_Vector_getPrototypeOf(object); if (object === null) break; } return object; }
  45177. function iServer_Vector_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) iServer_Vector_setPrototypeOf(subClass, superClass); }
  45178. function iServer_Vector_setPrototypeOf(o, p) { iServer_Vector_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iServer_Vector_setPrototypeOf(o, p); }
  45179. function iServer_Vector_createSuper(Derived) { var hasNativeReflectConstruct = iServer_Vector_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = iServer_Vector_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = iServer_Vector_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return iServer_Vector_possibleConstructorReturn(this, result); }; }
  45180. function iServer_Vector_possibleConstructorReturn(self, call) { if (call && (iServer_Vector_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return iServer_Vector_assertThisInitialized(self); }
  45181. function iServer_Vector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45182. function iServer_Vector_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  45183. function iServer_Vector_getPrototypeOf(o) { iServer_Vector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iServer_Vector_getPrototypeOf(o); }
  45184. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45185. * This program are made available under the terms of the Apache License, Version 2.0
  45186. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45187. /**
  45188. * @class Vector
  45189. * @deprecatedclass SuperMap.Vector
  45190. * @category iServer Map Layer
  45191. * @classdesc SuperMap 矢量图层类。
  45192. * @extends {UGCSubLayer}
  45193. * @param {Object} options - 可选参数。
  45194. * @param {ServerStyle} [options.style] - 矢量图层的风格。
  45195. * @usage
  45196. */
  45197. var Vector_Vector = /*#__PURE__*/function (_UGCSubLayer) {
  45198. iServer_Vector_inherits(Vector, _UGCSubLayer);
  45199. var _super = iServer_Vector_createSuper(Vector);
  45200. function Vector(options) {
  45201. var _this;
  45202. iServer_Vector_classCallCheck(this, Vector);
  45203. options = options || {};
  45204. _this = _super.call(this, options);
  45205. /**
  45206. * @member {ServerStyle} Vector.prototype.style
  45207. * @description 矢量图层的风格。
  45208. */
  45209. _this.style = null;
  45210. _this.CLASS_NAME = "SuperMap.Vector";
  45211. return _this;
  45212. }
  45213. /**
  45214. * @function Vector.prototype.destroy
  45215. * @description 销毁对象,将其属性置空。
  45216. * @override
  45217. */
  45218. iServer_Vector_createClass(Vector, [{
  45219. key: "destroy",
  45220. value: function destroy() {
  45221. iServer_Vector_get(iServer_Vector_getPrototypeOf(Vector.prototype), "destroy", this).call(this);
  45222. Util_Util.reset(this);
  45223. }
  45224. /**
  45225. * @function Vector.prototype.fromJson
  45226. * @description 将服务端 JSON 对象转换成当前客户端对象。
  45227. * @param {Object} jsonObject - 要转换的 JSON 对象。
  45228. */
  45229. }, {
  45230. key: "fromJson",
  45231. value: function fromJson(jsonObject) {
  45232. iServer_Vector_get(iServer_Vector_getPrototypeOf(Vector.prototype), "fromJson", this).call(this, jsonObject);
  45233. var sty = this.style;
  45234. if (sty) {
  45235. this.style = new ServerStyle(sty);
  45236. }
  45237. }
  45238. /**
  45239. * @function Vector.prototype.toServerJSONObject
  45240. * @description 转换成对应的 JSON 格式对象。
  45241. * @returns {Object} 对应的 JSON 格式对象
  45242. */
  45243. }, {
  45244. key: "toServerJSONObject",
  45245. value: function toServerJSONObject() {
  45246. var jsonObject = iServer_Vector_get(iServer_Vector_getPrototypeOf(Vector.prototype), "toServerJSONObject", this).call(this);
  45247. if (jsonObject.style) {
  45248. if (jsonObject.style.toServerJSONObject) {
  45249. jsonObject.style = jsonObject.style.toServerJSONObject();
  45250. }
  45251. }
  45252. return jsonObject;
  45253. }
  45254. }]);
  45255. return Vector;
  45256. }(UGCSubLayer);
  45257. ;// CONCATENATED MODULE: ./src/common/iServer/GetLayersInfoService.js
  45258. function GetLayersInfoService_typeof(obj) { "@babel/helpers - typeof"; return GetLayersInfoService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GetLayersInfoService_typeof(obj); }
  45259. function GetLayersInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45260. function GetLayersInfoService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  45261. function GetLayersInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetLayersInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetLayersInfoService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  45262. function GetLayersInfoService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GetLayersInfoService_get = Reflect.get.bind(); } else { GetLayersInfoService_get = function _get(target, property, receiver) { var base = GetLayersInfoService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GetLayersInfoService_get.apply(this, arguments); }
  45263. function GetLayersInfoService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetLayersInfoService_getPrototypeOf(object); if (object === null) break; } return object; }
  45264. function GetLayersInfoService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GetLayersInfoService_setPrototypeOf(subClass, superClass); }
  45265. function GetLayersInfoService_setPrototypeOf(o, p) { GetLayersInfoService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetLayersInfoService_setPrototypeOf(o, p); }
  45266. function GetLayersInfoService_createSuper(Derived) { var hasNativeReflectConstruct = GetLayersInfoService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GetLayersInfoService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GetLayersInfoService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GetLayersInfoService_possibleConstructorReturn(this, result); }; }
  45267. function GetLayersInfoService_possibleConstructorReturn(self, call) { if (call && (GetLayersInfoService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GetLayersInfoService_assertThisInitialized(self); }
  45268. function GetLayersInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45269. function GetLayersInfoService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  45270. function GetLayersInfoService_getPrototypeOf(o) { GetLayersInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetLayersInfoService_getPrototypeOf(o); }
  45271. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45272. * This program are made available under the terms of the Apache License, Version 2.0
  45273. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45274. /**
  45275. * @class GetLayersInfoService
  45276. * @deprecatedclass SuperMap.GetLayersInfoService
  45277. * @category iServer Map Layer
  45278. * @classdesc 获取图层信息服务类构造函数。
  45279. * @extends {CommonServiceBase}
  45280. * @param {string} url - 服务地址。请求地图服务,URL 应为:
  45281. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  45282. * 如 http://localhost:8090/iserver/services/map-world/rest/maps/World 。
  45283. * 如果查询临时图层的信息,请指定完成的url,包含临时图层ID信息,如:
  45284. * http://localhost:8090/iserver/services/map-world/rest/maps/World/tempLayersSet/resourceID
  45285. * @param {Object} options - 参数。
  45286. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  45287. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  45288. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  45289. * @param {Object} [options.headers] - 请求头。
  45290. * @param {boolean} options.isTempLayers - 当前url对应的图层是否是临时图层。
  45291. * @usage
  45292. */
  45293. var GetLayersInfoService = /*#__PURE__*/function (_CommonServiceBase) {
  45294. GetLayersInfoService_inherits(GetLayersInfoService, _CommonServiceBase);
  45295. var _super = GetLayersInfoService_createSuper(GetLayersInfoService);
  45296. function GetLayersInfoService(url, options) {
  45297. var _this;
  45298. GetLayersInfoService_classCallCheck(this, GetLayersInfoService);
  45299. _this = _super.call(this, url, options);
  45300. /**
  45301. * @member {boolean} GetLayersInfoService.prototype.isTempLayers
  45302. * @description 当前url对应的图层是否是临时图层。
  45303. */
  45304. _this.isTempLayers = false;
  45305. if (options) {
  45306. Util_Util.extend(GetLayersInfoService_assertThisInitialized(_this), options);
  45307. }
  45308. _this.CLASS_NAME = "SuperMap.GetLayersInfoService";
  45309. return _this;
  45310. }
  45311. /**
  45312. * @function GetLayersInfoService.prototype.destroy
  45313. * @override
  45314. */
  45315. GetLayersInfoService_createClass(GetLayersInfoService, [{
  45316. key: "destroy",
  45317. value: function destroy() {
  45318. GetLayersInfoService_get(GetLayersInfoService_getPrototypeOf(GetLayersInfoService.prototype), "destroy", this).call(this);
  45319. Util_Util.reset(this);
  45320. }
  45321. /**
  45322. * @function GetLayersInfoService.prototype.processAsync
  45323. * @description 负责将客户端的更新参数传递到服务端。
  45324. */
  45325. }, {
  45326. key: "processAsync",
  45327. value: function processAsync() {
  45328. var me = this,
  45329. method = "GET";
  45330. if (!me.isTempLayers) {
  45331. me.url = Util_Util.urlPathAppend(me.url, 'layers');
  45332. }
  45333. me.request({
  45334. method: method,
  45335. params: null,
  45336. scope: me,
  45337. success: me.serviceProcessCompleted,
  45338. failure: me.serviceProcessFailed
  45339. });
  45340. }
  45341. /**
  45342. * @function GetLayersInfoService.prototype.serviceProcessCompleted
  45343. * @description 编辑完成,执行此方法。
  45344. * @param {Object} result - 服务器返回的结果对象。
  45345. */
  45346. }, {
  45347. key: "serviceProcessCompleted",
  45348. value: function serviceProcessCompleted(result, options) {
  45349. var me = this,
  45350. existRes,
  45351. layers,
  45352. len;
  45353. result = Util_Util.transformResult(result);
  45354. existRes = !!result && result.length > 0;
  45355. layers = existRes ? result[0].subLayers.layers : null;
  45356. len = layers ? layers.length : 0;
  45357. me.handleLayers(len, layers);
  45358. me.events.triggerEvent("processCompleted", {
  45359. result: result[0],
  45360. options: options
  45361. });
  45362. }
  45363. /**
  45364. * TODO 专题图时候可能会用到
  45365. * @function GetLayersInfoService.prototype.handleLayers
  45366. * @description 处理 iServer 新增图层组数据 (subLayers.layers 中可能还会含有 subLayers.layers)
  45367. * @param {number} len - subLayers.layers的长度
  45368. * @param {Array.<number>} layers - subLayers.layers的长度数组
  45369. */
  45370. }, {
  45371. key: "handleLayers",
  45372. value: function handleLayers(len, layers) {
  45373. var me = this,
  45374. tempLayer;
  45375. if (len) {
  45376. for (var i = 0; i < len; i++) {
  45377. if (layers[i].subLayers && layers[i].subLayers.layers && layers[i].subLayers.layers.length > 0) {
  45378. me.handleLayers(layers[i].subLayers.layers.length, layers[i].subLayers.layers);
  45379. } else {
  45380. var type = layers[i].ugcLayerType;
  45381. switch (type) {
  45382. case 'THEME':
  45383. tempLayer = new ServerTheme();
  45384. tempLayer.fromJson(layers[i]);
  45385. layers[i] = tempLayer;
  45386. break;
  45387. case 'GRID':
  45388. tempLayer = new Grid();
  45389. tempLayer.fromJson(layers[i]);
  45390. layers[i] = tempLayer;
  45391. break;
  45392. case 'IMAGE':
  45393. tempLayer = new UGCImage();
  45394. tempLayer.fromJson(layers[i]);
  45395. layers[i] = tempLayer;
  45396. break;
  45397. case 'VECTOR':
  45398. tempLayer = new Vector_Vector();
  45399. tempLayer.fromJson(layers[i]);
  45400. layers[i] = tempLayer;
  45401. break;
  45402. default:
  45403. break;
  45404. }
  45405. }
  45406. }
  45407. }
  45408. }
  45409. }]);
  45410. return GetLayersInfoService;
  45411. }(CommonServiceBase);
  45412. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationAnalystParameters.js
  45413. function InterpolationAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45414. function InterpolationAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  45415. function InterpolationAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  45416. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45417. * This program are made available under the terms of the Apache License, Version 2.0
  45418. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45419. /**
  45420. * @class InterpolationAnalystParameters
  45421. * @deprecatedclass SuperMap.InterpolationAnalystParameters
  45422. * @category iServer SpatialAnalyst InterpolationAnalyst
  45423. * @classdesc 插值分析参数类。
  45424. * @param {Object} options - 参数。
  45425. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  45426. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  45427. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  45428. * @param {string} [options.zValueFieldName] - 进行插值分析的字段名称,插值分析不支持文本类型的字段。
  45429. * @param {string} [options.dataset] - 待分析的数据集名称。当插值分析类型(InterpolationAnalystType)为 dataset 时,此为必选参数。
  45430. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystType)为 geometry 时,此参数为必设参数。
  45431. * @param {number} [options.searchRadius=0] - 查找半径,即参与运算点的查找范围,与点数据集单位相同。
  45432. * @param {number} [options.zValueScale=1] - 进行插值分析值的缩放比率。
  45433. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  45434. * @param {FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  45435. * @param {PixelFormat} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  45436. * @param {string} [options.InterpolationAnalystType="dataset"] - 插值分析类型("dataset" 或 "geometry")。
  45437. * @usage
  45438. */
  45439. var InterpolationAnalystParameters = /*#__PURE__*/function () {
  45440. function InterpolationAnalystParameters(options) {
  45441. InterpolationAnalystParameters_classCallCheck(this, InterpolationAnalystParameters);
  45442. if (!options) {
  45443. return;
  45444. }
  45445. /**
  45446. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} InterpolationAnalystParameters.prototype.bounds
  45447. * @description 插值分析的范围,用于确定结果栅格数据集的范围。
  45448. * 如果缺省,则默认为原数据集的范围。鉴于此插值方法为内插方法,原数据集的范围内的插值结果才相对有参考价值,
  45449. * 因此建议此参数不大于原数据集范围。
  45450. */
  45451. this.bounds = null;
  45452. /**
  45453. * @member {number} [InterpolationAnalystParameters.prototype.searchRadius=0]
  45454. * @description 查找半径,即参与运算点的查找范围,与点数据集单位相同。
  45455. * 计算某个位置的 Z 值时,会以该位置为圆心,以查找范围的值为半径,落在这个范围内的采样点都将参与运算。
  45456. * 该值需要根据待插值点数据的分布状况和点数据集范围进行设置。
  45457. */
  45458. this.searchRadius = 0;
  45459. /**
  45460. * @member {string} InterpolationAnalystParameters.prototype.zValueFieldName
  45461. * @description 数据集插值分析中,用于指定进行插值分析的目标字段名,插值分析不支持文本类型的字段。
  45462. * 含义为每个插值点在插值过程中的权重,可以将所有点此字段值设置为 1,即所有点在整体插值中权重相同。
  45463. * 当插值分析类型(InterpolationAnalystType)为 dataset 时,此为必选参数。
  45464. */
  45465. this.zValueFieldName = null;
  45466. /**
  45467. * @member {number} [InterpolationAnalystParameters.prototype.zValueScale=1]
  45468. * @description 用于进行插值分析值的缩放比率。
  45469. * 参加插值分析的值将乘以该参数值后再进行插值,也就是对进行插值分析的值进行统一的扩大或缩小。
  45470. */
  45471. this.zValueScale = 1;
  45472. /**
  45473. * @member {number} InterpolationAnalystParameters.prototype.resolution
  45474. * @description 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  45475. * 该值不能超过待分析数据集的范围边长。
  45476. * 且该值设置时,应该考虑点数据集范围大小来取值,一般为结果栅格行列值(即结果栅格数据集范围除以分辨率),在 500 以内可以较好地体现密度走势。
  45477. */
  45478. this.resolution = null;
  45479. /**
  45480. * @member {FilterParameter} [InterpolationAnalystParameters.prototype.filterQueryParameter]
  45481. * @description 过滤条件,对分析数据集中的点进行过滤,设置为 null 表示对数据集中的所有点进行分析。
  45482. */
  45483. this.filterQueryParameter = null;
  45484. /**
  45485. * @member {string} InterpolationAnalystParameters.prototype.outputDatasetName
  45486. * @description 插值分析结果数据集的名称。
  45487. */
  45488. this.outputDatasetName = null;
  45489. /**
  45490. * @member {string} InterpolationAnalystParameters.prototype.outputDatasourceName
  45491. * @description 插值分析结果数据源的名称。
  45492. */
  45493. this.outputDatasourceName = null;
  45494. /**
  45495. * @member {PixelFormat} [InterpolationAnalystParameters.prototype.pixelFormat]
  45496. * @description 指定结果栅格数据集存储的像素格式。支持存储的像素格式有 BIT16、BIT32、DOUBLE、SINGLE、UBIT1、UBIT4、UBIT8、UBIT24、UBIT32。
  45497. */
  45498. this.pixelFormat = null;
  45499. /**
  45500. * @member {string} [InterpolationAnalystParameters.prototype.dataset]
  45501. * @description 用来做插值分析的数据源中数据集的名称,该名称用形如 "数据集名称@数据源别名" 形式来表示。
  45502. * 当插值分析类型(InterpolationAnalystType)为 dataset 时,此为必选参数。
  45503. */
  45504. this.dataset = null;
  45505. /**
  45506. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} [InterpolationAnalystParameters.prototype.inputPoints]
  45507. * @description 用于做插值分析的离散点(离散点包括Z值)集合。
  45508. * 当插值分析类型(InterpolationAnalystType)为 geometry 时,此参数为必设参数。
  45509. * 通过离散点直接进行插值分析不需要指定输入数据集inputDatasourceName,inputDatasetName以及zValueFieldName。
  45510. */
  45511. this.inputPoints = null;
  45512. /**
  45513. * @member {string} [InterpolationAnalystParameters.prototype.InterpolationAnalystType="dataset"]
  45514. * @description 插值分析类型。插值分析包括数据集插值分析和几何插值分析两类,
  45515. * "dataset" 表示对数据集进行插值分析,"geometry" 表示对离散点数组进行插值分析。
  45516. */
  45517. this.InterpolationAnalystType = "dataset";
  45518. /**
  45519. * @member {ClipParameter} InterpolationAnalystParameters.prototype.clipParam
  45520. * @description 对插值分析结果进行裁剪的参数。
  45521. */
  45522. this.clipParam = null;
  45523. Util_Util.extend(this, options);
  45524. this.CLASS_NAME = "SuperMap.InterpolationAnalystParameters";
  45525. }
  45526. /**
  45527. * @function InterpolationAnalystParameters.prototype.destroy
  45528. * @description 释放资源,将引用资源的属性置空。
  45529. */
  45530. InterpolationAnalystParameters_createClass(InterpolationAnalystParameters, [{
  45531. key: "destroy",
  45532. value: function destroy() {
  45533. var me = this;
  45534. me.bounds = null;
  45535. me.searchRadius = null;
  45536. me.zValueFieldName = null;
  45537. me.zValueScale = null;
  45538. me.resolution = null;
  45539. me.filterQueryParameter = null;
  45540. me.outputDatasetName = null;
  45541. me.pixelFormat = null;
  45542. }
  45543. /**
  45544. * @function InterpolationAnalystParameters.toObject
  45545. * @param {InterpolationAnalystParameters} interpolationAnalystParameters - 插值分析参数类。
  45546. * @param {InterpolationAnalystParameters} tempObj - 插值分析参数对象。
  45547. * @description 将插值分析参数对象转换成 JSON 对象。
  45548. * @returns JSON 对象。
  45549. */
  45550. }], [{
  45551. key: "toObject",
  45552. value: function toObject(interpolationAnalystParameters, tempObj) {
  45553. for (var name in interpolationAnalystParameters) {
  45554. if (name === "inputPoints" && interpolationAnalystParameters.InterpolationAnalystType === "geometry") {
  45555. var objs = [];
  45556. for (var i = 0; i < interpolationAnalystParameters.inputPoints.length; i++) {
  45557. var item = interpolationAnalystParameters.inputPoints[i];
  45558. var obj = {
  45559. x: item.x,
  45560. y: item.y,
  45561. z: item.tag
  45562. };
  45563. objs.push(obj);
  45564. }
  45565. tempObj[name] = objs;
  45566. } else {
  45567. tempObj[name] = interpolationAnalystParameters[name];
  45568. }
  45569. }
  45570. }
  45571. }]);
  45572. return InterpolationAnalystParameters;
  45573. }();
  45574. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationRBFAnalystParameters.js
  45575. function InterpolationRBFAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return InterpolationRBFAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, InterpolationRBFAnalystParameters_typeof(obj); }
  45576. function InterpolationRBFAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45577. function InterpolationRBFAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  45578. function InterpolationRBFAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationRBFAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationRBFAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  45579. function InterpolationRBFAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { InterpolationRBFAnalystParameters_get = Reflect.get.bind(); } else { InterpolationRBFAnalystParameters_get = function _get(target, property, receiver) { var base = InterpolationRBFAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return InterpolationRBFAnalystParameters_get.apply(this, arguments); }
  45580. function InterpolationRBFAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationRBFAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  45581. function InterpolationRBFAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) InterpolationRBFAnalystParameters_setPrototypeOf(subClass, superClass); }
  45582. function InterpolationRBFAnalystParameters_setPrototypeOf(o, p) { InterpolationRBFAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationRBFAnalystParameters_setPrototypeOf(o, p); }
  45583. function InterpolationRBFAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = InterpolationRBFAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = InterpolationRBFAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = InterpolationRBFAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return InterpolationRBFAnalystParameters_possibleConstructorReturn(this, result); }; }
  45584. function InterpolationRBFAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationRBFAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return InterpolationRBFAnalystParameters_assertThisInitialized(self); }
  45585. function InterpolationRBFAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45586. function InterpolationRBFAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  45587. function InterpolationRBFAnalystParameters_getPrototypeOf(o) { InterpolationRBFAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationRBFAnalystParameters_getPrototypeOf(o); }
  45588. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45589. * This program are made available under the terms of the Apache License, Version 2.0
  45590. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45591. /**
  45592. * @class InterpolationRBFAnalystParameters
  45593. * @deprecatedclass SuperMap.InterpolationRBFAnalystParameters
  45594. * @category iServer SpatialAnalyst InterpolationAnalyst
  45595. * @classdesc 样条插值(径向基函数插值法)分析参数类。
  45596. * @extends {InterpolationAnalystParameters}
  45597. * @param {Object} options - 参数。
  45598. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  45599. * @param {string} options.searchMode - 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。
  45600. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  45601. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  45602. * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,此为必选参数。
  45603. * @param {number} [options.smooth=0.1] - 光滑系数,该值表示插值函数曲线与点的逼近程度,值域为0到1。
  45604. * @param {number} [options.tension=40] - 张力系数,用于调整结果栅格数据表面的特性。
  45605. * @param {number} [options.expectedCount=12] - 【固定点数查找】方式下,设置参与插值运算的点数。
  45606. * @param {number} [options.searchRadius=0] - 【定长查找】方式下,设置参与运算点的查找范围。
  45607. * @param {number} [options.maxPointCountForInterpolation=200] - 【块查找】方式下,设置最多参与插值的点数。
  45608. * @param {number} [options.maxPointCountInNode=50] - 【块查找】方式下,设置单个块内最多参与运算点数。
  45609. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  45610. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  45611. * @param {FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  45612. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  45613. * @param {string} [options.dataset] - 要用来做插值分析的数据源中数据集的名称。该名称用形如”数据集名称@数据源别名”形式来表示。当插值分析类型(InterpolationAnalystType)为 dataset 时。此为必选参数。
  45614. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystType)为 geometry 时。此为必选参数。
  45615. * @example
  45616. * var myInterpolationRBFAnalystParameters = new InterpolationRBFAnalystParameters({
  45617. * dataset:"SamplesP@Interpolation",
  45618. * smooth: 0.1,
  45619. * tension: 40,
  45620. * searchMode: "QUADTREE",
  45621. * maxPointCountForInterpolation: 20,
  45622. * maxPointCountInNode: 5,
  45623. * pixelFormat: "BIT16",
  45624. * zValueFieldName: "AVG_TMP",
  45625. * resolution: 3000,
  45626. * filterQueryParameter: {
  45627. * attributeFilter: ""
  45628. * },
  45629. * outputDatasetName: "myRBF"
  45630. * });
  45631. * @usage
  45632. */
  45633. var InterpolationRBFAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  45634. InterpolationRBFAnalystParameters_inherits(InterpolationRBFAnalystParameters, _InterpolationAnalyst);
  45635. var _super = InterpolationRBFAnalystParameters_createSuper(InterpolationRBFAnalystParameters);
  45636. function InterpolationRBFAnalystParameters(options) {
  45637. var _this;
  45638. InterpolationRBFAnalystParameters_classCallCheck(this, InterpolationRBFAnalystParameters);
  45639. _this = _super.call(this, options);
  45640. /**
  45641. * @member {number} [InterpolationRBFAnalystParameters.prototype.smooth=0.1]
  45642. * @description 光滑系数,值域为 0 到 1,常用取值如 0、0.001、0.01、0.1、和 0.5。
  45643. * 该值表示插值函数曲线与点的逼近程度,此数值越大,函数曲线与点的偏差越大,反之越小。
  45644. */
  45645. _this.smooth = 0.1;
  45646. /**
  45647. * @member {number} [InterpolationRBFAnalystParameters.prototype.tension=40]
  45648. * @description 张力系数,常用取值如 0、1、5 和 10。
  45649. * 用于调整结果栅格数据表面的特性,张力越大,插值时每个点对计算结果影响越小,反之越大。
  45650. */
  45651. _this.tension = 40;
  45652. /**
  45653. * @member {SearchMode} InterpolationRBFAnalystParameters.prototype.searchMode
  45654. * @description 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。必设参数。
  45655. * 具体如下:
  45656. * {KDTREE_FIXED_COUNT} 使用 KDTREE 的固定点数方式查找参与内插分析的点。
  45657. * {KDTREE_FIXED_RADIUS} 使用 KDTREE 的定长方式查找参与内插分析的点。
  45658. * {QUADTREE} 使用 QUADTREE 方式查找参与内插分析的点(块查找)。
  45659. */
  45660. _this.searchMode = null;
  45661. /**
  45662. * @member {number} [InterpolationRBFAnalystParameters.prototype.expectedCount=12]
  45663. * @description 【固定点数查找】方式下,设置待查找的点数,即参与插值运算的点数。
  45664. */
  45665. _this.expectedCount = 12;
  45666. /**
  45667. * @member {number} [InterpolationRBFAnalystParameters.prototype.maxPointCountForInterpolation=200]
  45668. * @description 【块查找】方式下,最多参与插值的点数。
  45669. */
  45670. _this.maxPointCountForInterpolation = 200;
  45671. /**
  45672. * @member {number} [InterpolationRBFAnalystParameters.prototype.maxPointCountInNode=50]
  45673. * @description 【块查找】方式下,单个块内最多参与运算点数。
  45674. */
  45675. _this.maxPointCountInNode = 50;
  45676. if (options) {
  45677. Util_Util.extend(InterpolationRBFAnalystParameters_assertThisInitialized(_this), options);
  45678. }
  45679. _this.CLASS_NAME = "SuperMap.InterpolationRBFAnalystParameters";
  45680. return _this;
  45681. }
  45682. /**
  45683. * @function InterpolationRBFAnalystParameters.prototype.destroy
  45684. * @description 释放资源,将引用资源的属性置空。
  45685. */
  45686. InterpolationRBFAnalystParameters_createClass(InterpolationRBFAnalystParameters, [{
  45687. key: "destroy",
  45688. value: function destroy() {
  45689. InterpolationRBFAnalystParameters_get(InterpolationRBFAnalystParameters_getPrototypeOf(InterpolationRBFAnalystParameters.prototype), "destroy", this).call(this);
  45690. var me = this;
  45691. me.smooth = null;
  45692. me.tension = null;
  45693. me.searchMode = null;
  45694. me.expectedCount = null;
  45695. me.maxPointCountForInterpolation = null;
  45696. me.maxPointCountInNode = null;
  45697. }
  45698. /**
  45699. * @function InterpolationRBFAnalystParameters.toObject
  45700. * @param {InterpolationRBFAnalystParameters} datasetInterpolationRBFAnalystParameters - 样条插值(径向基函数插值法)分析参数类。
  45701. * @param {InterpolationRBFAnalystParameters} tempObj - 样条插值(径向基函数插值法)分析参数对象。
  45702. * @description 将样条插值(径向基函数插值法)分析参数对象转换为 JSON 对象。
  45703. * @returns JSON 对象。
  45704. */
  45705. }], [{
  45706. key: "toObject",
  45707. value: function toObject(datasetInterpolationRBFAnalystParameters, tempObj) {
  45708. for (var name in datasetInterpolationRBFAnalystParameters) {
  45709. tempObj[name] = datasetInterpolationRBFAnalystParameters[name];
  45710. }
  45711. }
  45712. }]);
  45713. return InterpolationRBFAnalystParameters;
  45714. }(InterpolationAnalystParameters);
  45715. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationDensityAnalystParameters.js
  45716. function InterpolationDensityAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return InterpolationDensityAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, InterpolationDensityAnalystParameters_typeof(obj); }
  45717. function InterpolationDensityAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45718. function InterpolationDensityAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  45719. function InterpolationDensityAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationDensityAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationDensityAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  45720. function InterpolationDensityAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { InterpolationDensityAnalystParameters_get = Reflect.get.bind(); } else { InterpolationDensityAnalystParameters_get = function _get(target, property, receiver) { var base = InterpolationDensityAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return InterpolationDensityAnalystParameters_get.apply(this, arguments); }
  45721. function InterpolationDensityAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationDensityAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  45722. function InterpolationDensityAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) InterpolationDensityAnalystParameters_setPrototypeOf(subClass, superClass); }
  45723. function InterpolationDensityAnalystParameters_setPrototypeOf(o, p) { InterpolationDensityAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationDensityAnalystParameters_setPrototypeOf(o, p); }
  45724. function InterpolationDensityAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = InterpolationDensityAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = InterpolationDensityAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = InterpolationDensityAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return InterpolationDensityAnalystParameters_possibleConstructorReturn(this, result); }; }
  45725. function InterpolationDensityAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationDensityAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return InterpolationDensityAnalystParameters_assertThisInitialized(self); }
  45726. function InterpolationDensityAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45727. function InterpolationDensityAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  45728. function InterpolationDensityAnalystParameters_getPrototypeOf(o) { InterpolationDensityAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationDensityAnalystParameters_getPrototypeOf(o); }
  45729. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45730. * This program are made available under the terms of the Apache License, Version 2.0
  45731. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45732. /**
  45733. * @class InterpolationDensityAnalystParameters
  45734. * @deprecatedclass SuperMap.InterpolationDensityAnalystParameters
  45735. * @category iServer SpatialAnalyst InterpolationAnalyst
  45736. * @classdesc 点密度插值分析参数类。
  45737. * @param {Object} options - 参数。
  45738. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  45739. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  45740. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  45741. * @param {number} [options.searchRadius=0] - 查找半径,即参与运算点的查找范围,与点数据集单位相同。
  45742. * @param {string} [options.zValueFieldName] - 进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(InterpolationAnalystParameters.prototype.InterpolationAnalystType)为 dataset 时。此为必选参数。
  45743. * @param {number} [options.zValueScale=1] - 进行插值分析值的缩放比率。
  45744. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  45745. * @param {FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  45746. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  45747. * @param {string} [options.dataset] - 用来做插值分析的数据源中数据集的名称,该名称用形如 "数据集名称@数据源别名" 形式来表示。当插值分析类型(InterpolationAnalystParameters.prototype.InterpolationAnalystType)为 dataset 时,此为必选参数。
  45748. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystParameters.prototype.InterpolationAnalystType)为 geometry 时,此为必选参数。
  45749. * @extends {InterpolationAnalystParameters}
  45750. * @example
  45751. * var myInterpolationDensityAnalystParameters = new InterpolationDensityAnalystParameters({
  45752. * dataset: "SamplesP@Interpolation",
  45753. * searchRadius: "100000",
  45754. * pixelFormat: "BIT16",
  45755. * zValueFieldName: "AVG_TMP",
  45756. * resolution: 3000,
  45757. * filterQueryParameter: {
  45758. * attributeFilter: ""
  45759. * },
  45760. * outputDatasetName: "myDensity"
  45761. * });
  45762. * @usage
  45763. */
  45764. var InterpolationDensityAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  45765. InterpolationDensityAnalystParameters_inherits(InterpolationDensityAnalystParameters, _InterpolationAnalyst);
  45766. var _super = InterpolationDensityAnalystParameters_createSuper(InterpolationDensityAnalystParameters);
  45767. function InterpolationDensityAnalystParameters(options) {
  45768. var _this;
  45769. InterpolationDensityAnalystParameters_classCallCheck(this, InterpolationDensityAnalystParameters);
  45770. _this = _super.call(this, options);
  45771. if (options) {
  45772. Util_Util.extend(InterpolationDensityAnalystParameters_assertThisInitialized(_this), options);
  45773. }
  45774. _this.CLASS_NAME = "SuperMap.InterpolationDensityAnalystParameters";
  45775. return _this;
  45776. }
  45777. /**
  45778. * @function InterpolationDensityAnalystParameters.prototype.destroy
  45779. * @description 释放资源,将引用资源的属性置空。
  45780. */
  45781. InterpolationDensityAnalystParameters_createClass(InterpolationDensityAnalystParameters, [{
  45782. key: "destroy",
  45783. value: function destroy() {
  45784. InterpolationDensityAnalystParameters_get(InterpolationDensityAnalystParameters_getPrototypeOf(InterpolationDensityAnalystParameters.prototype), "destroy", this).call(this);
  45785. }
  45786. }]);
  45787. return InterpolationDensityAnalystParameters;
  45788. }(InterpolationAnalystParameters);
  45789. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationIDWAnalystParameters.js
  45790. function InterpolationIDWAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return InterpolationIDWAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, InterpolationIDWAnalystParameters_typeof(obj); }
  45791. function InterpolationIDWAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45792. function InterpolationIDWAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  45793. function InterpolationIDWAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationIDWAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationIDWAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  45794. function InterpolationIDWAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { InterpolationIDWAnalystParameters_get = Reflect.get.bind(); } else { InterpolationIDWAnalystParameters_get = function _get(target, property, receiver) { var base = InterpolationIDWAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return InterpolationIDWAnalystParameters_get.apply(this, arguments); }
  45795. function InterpolationIDWAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationIDWAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  45796. function InterpolationIDWAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) InterpolationIDWAnalystParameters_setPrototypeOf(subClass, superClass); }
  45797. function InterpolationIDWAnalystParameters_setPrototypeOf(o, p) { InterpolationIDWAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationIDWAnalystParameters_setPrototypeOf(o, p); }
  45798. function InterpolationIDWAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = InterpolationIDWAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = InterpolationIDWAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = InterpolationIDWAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return InterpolationIDWAnalystParameters_possibleConstructorReturn(this, result); }; }
  45799. function InterpolationIDWAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationIDWAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return InterpolationIDWAnalystParameters_assertThisInitialized(self); }
  45800. function InterpolationIDWAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45801. function InterpolationIDWAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  45802. function InterpolationIDWAnalystParameters_getPrototypeOf(o) { InterpolationIDWAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationIDWAnalystParameters_getPrototypeOf(o); }
  45803. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45804. * This program are made available under the terms of the Apache License, Version 2.0
  45805. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45806. /**
  45807. * @class InterpolationIDWAnalystParameters
  45808. * @deprecatedclass SuperMap.InterpolationIDWAnalystParameters
  45809. * @category iServer SpatialAnalyst InterpolationAnalyst
  45810. * @classdesc 反距离加权插值(IDW)分析参数类。
  45811. * @param {Object} options - 参数。
  45812. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  45813. * @param {string} options.searchMode - 插值运算时,查找参与运算点的方式,支持固定点数查找、定长查找。
  45814. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  45815. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  45816. * @param {string} [options.zValueFieldName] - 进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,此为必选参数。
  45817. * @param {number} [options.expectedCount=12] - 【固定点数查找】方式下,设置待查找的点数,即参与插值运算的点数。
  45818. * @param {number} [options.searchRadius=0] - 【定长查找】方式下,设置查找半径,即参与运算点的查找范围,与点数据集单位相同。
  45819. * @param {number} [options.power=2] - 距离权重计算的幂次。
  45820. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  45821. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  45822. * @param {FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  45823. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  45824. * @param {string} [options.dataset] - 要用来做插值分析的数据源中数据集的名称。该名称用形如”数据集名称@数据源别名”形式来表示。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,此为必选参数。
  45825. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(SuperMap.InterpolationAnalystType)为 geometry 时,此为必选参数。
  45826. * @extends {InterpolationAnalystParameters}
  45827. * @example 例如:
  45828. * var myInterpolationIDWAnalystParameters = new InterpolationIDWAnalystParameters({
  45829. * dataset:"SamplesP@Interpolation",
  45830. * power: 2,
  45831. * searchMode: "KDTREE_FIXED_COUNT",
  45832. * expectedCount: 12,
  45833. * pixelFormat: "BIT16",
  45834. * zValueFieldName: "AVG_TMP",
  45835. * resolution: 3000,
  45836. * filterQueryParameter: {
  45837. * attributeFilter: ""
  45838. * },
  45839. * outputDatasetName: "myIDW"
  45840. * });
  45841. * @usage
  45842. */
  45843. var InterpolationIDWAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  45844. InterpolationIDWAnalystParameters_inherits(InterpolationIDWAnalystParameters, _InterpolationAnalyst);
  45845. var _super = InterpolationIDWAnalystParameters_createSuper(InterpolationIDWAnalystParameters);
  45846. function InterpolationIDWAnalystParameters(options) {
  45847. var _this;
  45848. InterpolationIDWAnalystParameters_classCallCheck(this, InterpolationIDWAnalystParameters);
  45849. _this = _super.call(this, options);
  45850. /**
  45851. * @member {number} [InterpolationIDWAnalystParameters.prototype.power=2]
  45852. * @description 距离权重计算的幂次。
  45853. * 该值决定了权值下降的速度,幂次越大,随距离的增大权值下降越快,距离预测点越远的点的权值也越小。
  45854. * 理论上,参数值必须大于0,但是0.5到3之间时运算结果更合理,因此推荐值为0.5~3。
  45855. */
  45856. _this.power = 2;
  45857. /**
  45858. * @member {SearchMode} InterpolationIDWAnalystParameters.prototype.searchMode
  45859. * @description 插值运算时,查找参与运算点的方式,支持固定点数查找、定长查找。
  45860. * 具体如下:
  45861. * {KDTREE_FIXED_COUNT} 使用 KDTREE 的固定点数方式查找参与内插分析的点。
  45862. * {KDTREE_FIXED_RADIUS} 使用 KDTREE 的定长方式查找参与内插分析的点。
  45863. */
  45864. _this.searchMode = null;
  45865. /**
  45866. * @member {number} [InterpolationIDWAnalystParameters.prototype.expectedCount=12]
  45867. * @description 【固定点数查找】方式下,设置待查找的点数,即参与插值运算的点数。
  45868. */
  45869. _this.expectedCount = 12;
  45870. if (options) {
  45871. Util_Util.extend(InterpolationIDWAnalystParameters_assertThisInitialized(_this), options);
  45872. }
  45873. _this.CLASS_NAME = "SuperMap.InterpolationIDWAnalystParameters";
  45874. return _this;
  45875. }
  45876. /**
  45877. * @function InterpolationIDWAnalystParameters.prototype.destroy
  45878. * @description 释放资源,将引用资源的属性置空。
  45879. */
  45880. InterpolationIDWAnalystParameters_createClass(InterpolationIDWAnalystParameters, [{
  45881. key: "destroy",
  45882. value: function destroy() {
  45883. InterpolationIDWAnalystParameters_get(InterpolationIDWAnalystParameters_getPrototypeOf(InterpolationIDWAnalystParameters.prototype), "destroy", this).call(this);
  45884. var me = this;
  45885. me.power = null;
  45886. me.searchMode = null;
  45887. me.expectedCount = null;
  45888. }
  45889. }]);
  45890. return InterpolationIDWAnalystParameters;
  45891. }(InterpolationAnalystParameters);
  45892. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationKrigingAnalystParameters.js
  45893. function InterpolationKrigingAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; return InterpolationKrigingAnalystParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, InterpolationKrigingAnalystParameters_typeof(obj); }
  45894. function InterpolationKrigingAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45895. function InterpolationKrigingAnalystParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  45896. function InterpolationKrigingAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationKrigingAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationKrigingAnalystParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  45897. function InterpolationKrigingAnalystParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { InterpolationKrigingAnalystParameters_get = Reflect.get.bind(); } else { InterpolationKrigingAnalystParameters_get = function _get(target, property, receiver) { var base = InterpolationKrigingAnalystParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return InterpolationKrigingAnalystParameters_get.apply(this, arguments); }
  45898. function InterpolationKrigingAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationKrigingAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  45899. function InterpolationKrigingAnalystParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) InterpolationKrigingAnalystParameters_setPrototypeOf(subClass, superClass); }
  45900. function InterpolationKrigingAnalystParameters_setPrototypeOf(o, p) { InterpolationKrigingAnalystParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationKrigingAnalystParameters_setPrototypeOf(o, p); }
  45901. function InterpolationKrigingAnalystParameters_createSuper(Derived) { var hasNativeReflectConstruct = InterpolationKrigingAnalystParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = InterpolationKrigingAnalystParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = InterpolationKrigingAnalystParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return InterpolationKrigingAnalystParameters_possibleConstructorReturn(this, result); }; }
  45902. function InterpolationKrigingAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationKrigingAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return InterpolationKrigingAnalystParameters_assertThisInitialized(self); }
  45903. function InterpolationKrigingAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45904. function InterpolationKrigingAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  45905. function InterpolationKrigingAnalystParameters_getPrototypeOf(o) { InterpolationKrigingAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationKrigingAnalystParameters_getPrototypeOf(o); }
  45906. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45907. * This program are made available under the terms of the Apache License, Version 2.0
  45908. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45909. /**
  45910. * @class InterpolationKrigingAnalystParameters
  45911. * @deprecatedclass SuperMap.InterpolationKrigingAnalystParameters
  45912. * @category iServer SpatialAnalyst InterpolationAnalyst
  45913. * @classdesc 克吕金插值分析参数类。通过该类可以设置克吕金插值分析所需的参数。
  45914. * 克吕金(Kriging)法为地统计学上一种空间数据内插处理方法,主要的目的是利用各数据点间变异数(variance)的大小来推求某一未知点与各已知点的权重关系,
  45915. * 再由各数据点的值和其与未知点的权重关系推求未知点的值。Kriging 法最大的特色不仅是提供一个最小估计误差的预测值,并且可明确地指出误差值的大小。
  45916. * 一般而言,许多地质参数,如地形面,本身即具有连续性,故在一段距离内的任两点必有空间上的关系。反之,在一不规则面上的两点若相距甚远,
  45917. * 则在统计意义上可视为互为独立 (stastically indepedent)。这种随距离而改变的空间上连续性,可用半变异图 (semivariogram) 来表现。
  45918. * 因此,若想由已知的散乱点来推求某一未知点的值,则可利用半变异图推求各已知点与未知点的空间关系,即以下四个参数:<br>
  45919. * 1.块金值(nugget):当采样点间距为0时,理论上半变异函数值为0,但时间上两采样点非常接近时半变异函数值并不为0,即产生了块金效应,
  45920. * 对应的半变异函数值为块金值。块金值可能由于测量误差或者空间变异产生。<br>
  45921. * 2.基台值(sill):随着采样点间距的不断增大,半变异函数的值趋向一个稳定的常数,该常数成为基台值。到达基台值后,半变异函数的值不再随采样点间距而改变,
  45922. * 即大于此间距的采样点不再具有空间相关性。<br>
  45923. * 3.偏基台值:基台值与块金值的差值。<br>
  45924. * 4.自相关阈值(range):也称变程,是半变异函数值达到基台值时,采样点的间距。超过自相关阈值的采样点不再具有空间相关性,将不对预测结果产生影响。<br>
  45925. * 然后,由此空间参数推求半变异数,由各数据点间的半变异数可推求未知点与已知点间的权重关系,进而推求出未知点的值。
  45926. * 克吕金法的优点是以空间统计学作为其坚实的理论基础,物理含义明确;不但能估计测定参数的空间变异分布,而且还可以估算参数的方差分布。克吕金法的缺点是计算步骤较烦琐,
  45927. * 计算量大,且变异函数有时需要根据经验人为选定。
  45928. *
  45929. * 由上述可知,半变异函数是克吕金插值的关键,因此选择合适的半变异函数模型非常重要,SuperMap 提供了以下三种半变异函数模型:<br>
  45930. * 1.指数型(EXPONENTIAL):适用于空间相关关系随样本间距的增加呈指数递减的情况,其空间自相关关系在样本间距的无穷远处完全消失。<br>
  45931. * 2.球型(SPHERICAL):适用于空间自相关关系随样本间距的增加而逐渐减少,直到超出一定的距离时空间自相关关系消失的情况。<br>
  45932. * 3.高斯型(GAUSSIAN):适用于半变异函数值渐进地逼近基台值的情况。<br>
  45933. *
  45934. * 半变异函数中,有一个关键参数即插值的字段值的期望(平均值),由于对于此参数的不同处理方法而衍生出了不同的 Kriging 方法。SuperMap的插值功能基于以下三种常用 Kriging 算法:<br>
  45935. * 1.简单克吕金(Simple Kriging):该方法假定用于插值的字段值的期望(平均值)为已知的某一常数。<br>
  45936. * 2.普通克吕金(Kriging):该方法假定用于插值的字段值的期望(平均值)未知且恒定。它利用一定的数学函数,通过对给定的空间点进行拟合来估算单元格的值,
  45937. * 生成格网数据集。它不仅可以生成一个表面,还可以给出预测结果的精度或者确定性的度量。因此,此方法计算精度较高,常用于地学领域。<br>
  45938. * 3.泛克吕金(Universal Kriging):该方法假定用于插值的字段值的期望(平均值)是未知的变量。在样点数据中存在某种主导趋势且该趋势可以通过某一个确定
  45939. * 的函数或者多项式进行拟合的情况下,适用泛克吕金插值法。<br>
  45940. * @param {Object} options - 参数。
  45941. * @param {string} options.type - 克吕金插值的类型。
  45942. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  45943. * @param {string} options.searchMode - 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。
  45944. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  45945. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  45946. * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(InterpolationAnalystParameters.prototype.InterpolationAnalystType)为 dataset 时,此为必选参数。
  45947. * @param {number} [options.mean] - 【简单克吕金】类型下,插值字段的平均值。
  45948. * @param {number} [options.angle=0] - 克吕金算法中旋转角度值。
  45949. * @param {number} [options.nugget=0] - 克吕金算法中块金效应值。
  45950. * @param {number} [options.range=0] - 克吕金算法中自相关阈值,单位与原数据集单位相同。
  45951. * @param {number} [options.sill=0] - 克吕金算法中基台值。
  45952. * @param {string} [options.variogramMode="SPHERICAL"] - 克吕金插值时的半变函数类型。
  45953. * @param {string} [options.exponent='exp1'] - 【泛克吕金】类型下,用于插值的样点数据中趋势面方程的阶数,可选值为 exp1、exp2。
  45954. * @param {number} [options.expectedCount=12] - 【固定点数查找】方式下,设置待查找的点数;【定长查找】方式下,设置查找的最小点数。
  45955. * @param {number} [options.searchRadius=0] - 【定长查找】方式下,设置参与运算点的查找范围。
  45956. * @param {number} [options.maxPointCountForInterpolation=200] - 【块查找】方式下,设置最多参与插值的点数。
  45957. * @param {number} [options.maxPointCountInNode=50] - 【块查找】方式下,设置单个块内最多参与运算点数。
  45958. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  45959. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  45960. * @param {FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  45961. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  45962. * @param {string} [options.dataset] - 要用来做插值分析的数据源中数据集的名称。该名称用形如 ”数据集名称@数据源别名” 形式来表示。当插值分析类型(InterpolationAnalystParameters.prototype.InterpolationAnalystType)为 dataset 时。
  45963. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystParameters.prototype.InterpolationAnalystType)为 geometry 时。
  45964. * @extends {InterpolationAnalystParameters}
  45965. * @example 例如:
  45966. * var myInterpolationKrigingAnalystParameters = new InterpolationKrigingAnalystParameters({
  45967. * dataset:"SamplesP@Interpolation",
  45968. * type: "KRIGING",
  45969. * angle: 0,
  45970. * mean: 5,
  45971. * nugget: 30,
  45972. * range: 50,
  45973. * sill: 300,
  45974. * variogramMode: "EXPONENTIAL",
  45975. * searchMode: "QUADTREE",
  45976. * maxPointCountForInterpolation: 20,
  45977. * maxPointCountInNode: 5,
  45978. * pixelFormat: "BIT16",
  45979. * zValueFieldName: "AVG_TMP",
  45980. * resolution: 30000,
  45981. * filterQueryParameter: {
  45982. * attributeFilter: ""
  45983. * },
  45984. * outputDatasetName: "myKriging"
  45985. * });
  45986. * @usage
  45987. */
  45988. var InterpolationKrigingAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  45989. InterpolationKrigingAnalystParameters_inherits(InterpolationKrigingAnalystParameters, _InterpolationAnalyst);
  45990. var _super = InterpolationKrigingAnalystParameters_createSuper(InterpolationKrigingAnalystParameters);
  45991. function InterpolationKrigingAnalystParameters(options) {
  45992. var _this;
  45993. InterpolationKrigingAnalystParameters_classCallCheck(this, InterpolationKrigingAnalystParameters);
  45994. _this = _super.call(this, options);
  45995. /**
  45996. * @member {InterpolationAlgorithmType} InterpolationKrigingAnalystParameters.prototype.type
  45997. * @description 克吕金插值的类型。
  45998. * 具体如下:<br>
  45999. * {KRIGING} 普通克吕金插值法。
  46000. * {SimpleKriging} 简单克吕金插值法。
  46001. * {UniversalKriging} 泛克吕金插值法。
  46002. */
  46003. _this.type = null;
  46004. /**
  46005. * @member {number} InterpolationKrigingAnalystParameters.prototype.mean
  46006. * @description 【简单克吕金】方式下,插值字段的平均值。
  46007. * 即采样点插值字段值总和除以采样点数目。
  46008. */
  46009. _this.mean = null;
  46010. /**
  46011. * @member {number} [InterpolationKrigingAnalystParameters.prototype.angle=0]
  46012. * @description 克吕金算法中旋转角度值。
  46013. * 此角度值指示了每个查找邻域相对于水平方向逆时针旋转的角度。
  46014. */
  46015. _this.angle = 0;
  46016. /**
  46017. * @member {number} [InterpolationKrigingAnalystParameters.prototype.nugget=0]
  46018. * @description 克吕金算法中块金效应值。
  46019. */
  46020. _this.nugget = 0;
  46021. /**
  46022. * @member {number} [InterpolationKrigingAnalystParameters.prototype.range=0]
  46023. * @description 克吕金算法中自相关阈值,单位与原数据集单位相同。
  46024. */
  46025. _this.range = 0;
  46026. /**
  46027. * @member {number} [InterpolationKrigingAnalystParameters.prototype.sill=0]
  46028. * @description 克吕金算法中基台值。
  46029. */
  46030. _this.sill = 0;
  46031. /**
  46032. * @member {VariogramMode} [InterpolationKrigingAnalystParameters.prototype.variogramMode=VariogramMode.SPHERICAL]
  46033. * @description 克吕金插值时的半变函数类型。
  46034. * 用户所选择的半变函数类型会影响未知点的预测,特别是曲线在原点处的不同形状有重要意义。
  46035. * 曲线在原点处越陡,则较近领域对该预测值的影响就越大,因此输出表面就会越不光滑。
  46036. */
  46037. _this.variogramMode = VariogramMode.SPHERICAL;
  46038. /**
  46039. * @member {Exponent} [InterpolationKrigingAnalystParameters.prototype.exponent=Exponent.EXP1]
  46040. * @description 【泛克吕金】类型下,用于插值的样点数据中趋势面方程的阶数。
  46041. */
  46042. _this.exponent = Exponent.EXP1;
  46043. /**
  46044. * @member {SearchMode} InterpolationKrigingAnalystParameters.prototype.searchMode
  46045. * @description 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。此为必选参数。
  46046. * 简单克吕金和泛克吕金不支持块查找。
  46047. * 具体如下:<br>
  46048. * {KDTREE_FIXED_COUNT} 使用 KDTREE 的固定点数方式查找参与内插分析的点。<br>
  46049. * {KDTREE_FIXED_RADIUS} 使用 KDTREE 的定长方式查找参与内插分析的点。<br>
  46050. * {QUADTREE} 使用 QUADTREE 方式查找参与内插分析的点(块查找)。
  46051. */
  46052. _this.searchMode = null;
  46053. /**
  46054. * @member {number} [InterpolationKrigingAnalystParameters.prototype.expectedCount=12]
  46055. * @description 【固定点数查找】方式下,设置待查找的点数,即参与插值运算的点数,默认值为12。
  46056. * 【定长查找】方式下,设置查找的最小点数,默认值为12。
  46057. */
  46058. _this.expectedCount = 12;
  46059. /**
  46060. * @member {number} [InterpolationKrigingAnalystParameters.prototype.maxPointCountForInterpolation=200]
  46061. * @description 【块查找】方式下,最多参与插值的点数。
  46062. * 仅用于普通克吕金插值,简单克吕金和泛克吕金不支持块查找。
  46063. */
  46064. _this.maxPointCountForInterpolation = 200;
  46065. /**
  46066. * @member {number} [InterpolationKrigingAnalystParameters.prototype.maxPointCountInNode=50]
  46067. * @description 【块查找】方式下,设置单个块内最多参与运算点数。
  46068. * 仅用于普通克吕金插值,简单克吕金和泛克吕金不支持块查找。
  46069. */
  46070. _this.maxPointCountInNode = 50;
  46071. if (options) {
  46072. Util_Util.extend(InterpolationKrigingAnalystParameters_assertThisInitialized(_this), options);
  46073. }
  46074. _this.CLASS_NAME = "SuperMap.InterpolationKrigingAnalystParameters";
  46075. return _this;
  46076. }
  46077. /**
  46078. * @function InterpolationKrigingAnalystParameters.prototype.destroy
  46079. * @description 释放资源,将引用资源的属性置空。
  46080. */
  46081. InterpolationKrigingAnalystParameters_createClass(InterpolationKrigingAnalystParameters, [{
  46082. key: "destroy",
  46083. value: function destroy() {
  46084. InterpolationKrigingAnalystParameters_get(InterpolationKrigingAnalystParameters_getPrototypeOf(InterpolationKrigingAnalystParameters.prototype), "destroy", this).call(this);
  46085. var me = this;
  46086. me.type = null;
  46087. me.mean = null;
  46088. me.angle = null;
  46089. me.nugget = null;
  46090. me.range = null;
  46091. me.sill = null;
  46092. me.variogramMode = null;
  46093. me.exponent = null;
  46094. me.searchMode = null;
  46095. me.expectedCount = null;
  46096. me.maxPointCountForInterpolation = null;
  46097. me.maxPointCountInNode = null;
  46098. }
  46099. }]);
  46100. return InterpolationKrigingAnalystParameters;
  46101. }(InterpolationAnalystParameters);
  46102. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationAnalystService.js
  46103. function InterpolationAnalystService_typeof(obj) { "@babel/helpers - typeof"; return InterpolationAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, InterpolationAnalystService_typeof(obj); }
  46104. function InterpolationAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46105. function InterpolationAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  46106. function InterpolationAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  46107. function InterpolationAnalystService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { InterpolationAnalystService_get = Reflect.get.bind(); } else { InterpolationAnalystService_get = function _get(target, property, receiver) { var base = InterpolationAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return InterpolationAnalystService_get.apply(this, arguments); }
  46108. function InterpolationAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  46109. function InterpolationAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) InterpolationAnalystService_setPrototypeOf(subClass, superClass); }
  46110. function InterpolationAnalystService_setPrototypeOf(o, p) { InterpolationAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationAnalystService_setPrototypeOf(o, p); }
  46111. function InterpolationAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = InterpolationAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = InterpolationAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = InterpolationAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return InterpolationAnalystService_possibleConstructorReturn(this, result); }; }
  46112. function InterpolationAnalystService_possibleConstructorReturn(self, call) { if (call && (InterpolationAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return InterpolationAnalystService_assertThisInitialized(self); }
  46113. function InterpolationAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46114. function InterpolationAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  46115. function InterpolationAnalystService_getPrototypeOf(o) { InterpolationAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationAnalystService_getPrototypeOf(o); }
  46116. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46117. * This program are made available under the terms of the Apache License, Version 2.0
  46118. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46119. /**
  46120. * @class InterpolationAnalystService
  46121. * @deprecatedclass SuperMap.InterpolationAnalystService
  46122. * @category iServer SpatialAnalyst InterpolationAnalyst
  46123. * @classdesc 插值分析服务类。
  46124. * 插值分析可以将有限的采样点数据,通过插值算法对采样点周围的数值情况进行预测,可以掌握研究区域内数据的总体分布状况,从而使采样的离散点不仅仅反映其所在位置的数值情况,
  46125. * 还可以反映区域的数值分布。目前SuperMap iServer的插值功能提供从点数据集插值得到栅格数据集的功能,支持以下常用的内插方法,
  46126. * 包括:反距离加权插值、克吕金(Kriging)插值法、样条(径向基函数,Radial Basis Function)插值、点密度插值。
  46127. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  46128. * @param {Object} options - 参数。
  46129. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  46130. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  46131. * @param {Object} [options.headers] - 请求头。
  46132. * @extends {SpatialAnalystBase}
  46133. * @example 例如:
  46134. * (start code)
  46135. * var myTInterpolationAnalystService = new InterpolationAnalystService(url);
  46136. * myTInterpolationAnalystService.events.on({
  46137. * "processCompleted": processCompleted,
  46138. * "processFailed": processFailed
  46139. * }
  46140. * );
  46141. * (end)
  46142. * @usage
  46143. */
  46144. var InterpolationAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  46145. InterpolationAnalystService_inherits(InterpolationAnalystService, _SpatialAnalystBase);
  46146. var _super = InterpolationAnalystService_createSuper(InterpolationAnalystService);
  46147. function InterpolationAnalystService(url, options) {
  46148. var _this;
  46149. InterpolationAnalystService_classCallCheck(this, InterpolationAnalystService);
  46150. _this = _super.call(this, url, options);
  46151. /**
  46152. * @member {string} InterpolationAnalystService.prototype.mode
  46153. * @description 插值分析类型。
  46154. */
  46155. _this.mode = null;
  46156. if (options) {
  46157. Util_Util.extend(InterpolationAnalystService_assertThisInitialized(_this), options);
  46158. }
  46159. return _this;
  46160. }
  46161. /**
  46162. * @function InterpolationAnalystService.prototype.destroy
  46163. * @description 释放资源,将引用资源的属性置空。
  46164. */
  46165. InterpolationAnalystService_createClass(InterpolationAnalystService, [{
  46166. key: "destroy",
  46167. value: function destroy() {
  46168. InterpolationAnalystService_get(InterpolationAnalystService_getPrototypeOf(InterpolationAnalystService.prototype), "destroy", this).call(this);
  46169. this.mode = null;
  46170. this.CLASS_NAME = "SuperMap.InterpolationAnalystService";
  46171. }
  46172. /**
  46173. * @function InterpolationAnalystService.prototype.processAsync
  46174. * @description 负责将客户端的查询参数传递到服务端。
  46175. * @param {InterpolationDensityAnalystParameters|InterpolationIDWAnalystParameters|InterpolationRBFAnalystParameters|InterpolationKrigingAnalystParameters} parameter - 插值分析参数类。
  46176. */
  46177. }, {
  46178. key: "processAsync",
  46179. value: function processAsync(parameter) {
  46180. var parameterObject = {};
  46181. var me = this;
  46182. if (parameter instanceof InterpolationDensityAnalystParameters) {
  46183. me.mode = 'Density';
  46184. if (parameter.InterpolationAnalystType === 'geometry') {
  46185. me.url = Util_Util.urlPathAppend(me.url, 'geometry/interpolation/density');
  46186. } else {
  46187. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/density');
  46188. }
  46189. } else if (parameter instanceof InterpolationIDWAnalystParameters) {
  46190. me.mode = 'IDW';
  46191. if (parameter.InterpolationAnalystType === 'geometry') {
  46192. me.url = Util_Util.urlPathAppend(me.url, 'geometry/interpolation/idw');
  46193. } else {
  46194. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/idw');
  46195. }
  46196. } else if (parameter instanceof InterpolationRBFAnalystParameters) {
  46197. me.mode = 'RBF';
  46198. if (parameter.InterpolationAnalystType === 'geometry') {
  46199. me.url = Util_Util.urlPathAppend(me.url, 'geometry/interpolation/rbf');
  46200. } else {
  46201. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/rbf');
  46202. }
  46203. } else if (parameter instanceof InterpolationKrigingAnalystParameters) {
  46204. me.mode = 'Kriging';
  46205. if (parameter.InterpolationAnalystType === 'geometry') {
  46206. me.url = Util_Util.urlPathAppend(me.url, 'geometry/interpolation/kriging');
  46207. } else {
  46208. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/kriging');
  46209. }
  46210. }
  46211. InterpolationAnalystParameters.toObject(parameter, parameterObject);
  46212. var jsonParameters = Util_Util.toJSON(parameterObject);
  46213. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  46214. me.request({
  46215. method: "POST",
  46216. data: jsonParameters,
  46217. scope: me,
  46218. success: me.serviceProcessCompleted,
  46219. failure: me.serviceProcessFailed
  46220. });
  46221. }
  46222. }]);
  46223. return InterpolationAnalystService;
  46224. }(SpatialAnalystBase);
  46225. ;// CONCATENATED MODULE: ./src/common/iServer/KernelDensityJobParameter.js
  46226. function KernelDensityJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46227. function KernelDensityJobParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  46228. function KernelDensityJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) KernelDensityJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) KernelDensityJobParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  46229. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46230. * This program are made available under the terms of the Apache License, Version 2.0
  46231. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46232. /**
  46233. * @class KernelDensityJobParameter
  46234. * @deprecatedclass SuperMap.KernelDensityJobParameter
  46235. * @category iServer ProcessingService DensityAnalyst
  46236. * @classdesc 核密度分析服务参数类。
  46237. * @param {Object} options - 参数。
  46238. * @param {string} options.datasetName - 数据集名。
  46239. * @param {string} options.fields - 权重索引。
  46240. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} [options.query] - 分析范围(默认为全图范围)。
  46241. * @param {number} [options.resolution=80] - 分辨率。
  46242. * @param {number} [options.method=0] - 分析方法。
  46243. * @param {number} [options.meshType=0] - 分析类型。
  46244. * @param {number} [options.radius=300] - 分析的影响半径。
  46245. * @param {AnalystSizeUnit} [options.meshSizeUnit=AnalystSizeUnit.METER] - 网格大小单位。
  46246. * @param {AnalystSizeUnit} [options.radiusUnit=AnalystSizeUnit.METER] - 搜索半径单位。
  46247. * @param {AnalystAreaUnit} [options.areaUnit=AnalystAreaUnit.SQUAREMILE] - 面积单位。
  46248. * @param {OutputSetting} [options.output] - 输出参数设置。
  46249. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  46250. * @usage
  46251. */
  46252. var KernelDensityJobParameter = /*#__PURE__*/function () {
  46253. function KernelDensityJobParameter(options) {
  46254. KernelDensityJobParameter_classCallCheck(this, KernelDensityJobParameter);
  46255. if (!options) {
  46256. return;
  46257. }
  46258. /**
  46259. * @member {string} KernelDensityJobParameter.prototype.datasetName
  46260. * @description 数据集名。
  46261. */
  46262. this.datasetName = "";
  46263. /**
  46264. * @member {SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject} [KernelDensityJobParameter.prototype.query]
  46265. * @description 分析范围。
  46266. */
  46267. this.query = "";
  46268. /**
  46269. * @member {number} [KernelDensityJobParameter.prototype.resolution=80]
  46270. * @description 网格大小。
  46271. */
  46272. this.resolution = 80;
  46273. /**
  46274. * @member {number} [KernelDensityJobParameter.prototype.method=0]
  46275. * @description 分析方法。
  46276. */
  46277. this.method = 0;
  46278. /**
  46279. * @member {number} [KernelDensityJobParameter.prototype.meshType=0]
  46280. * @description 分析类型。
  46281. */
  46282. this.meshType = 0;
  46283. /**
  46284. * @member {string} KernelDensityJobParameter.prototype.fields
  46285. * @description 权重索引。
  46286. */
  46287. this.fields = "";
  46288. /**
  46289. * @member {number} [KernelDensityJobParameter.prototype.radius=300]
  46290. * @description 分析的影响半径。
  46291. */
  46292. this.radius = 300;
  46293. /**
  46294. * @member {AnalystSizeUnit} [KernelDensityJobParameter.prototype.meshSizeUnit=AnalystSizeUnit.METER]
  46295. * @description 网格大小单位。
  46296. */
  46297. this.meshSizeUnit = AnalystSizeUnit.METER;
  46298. /**
  46299. * @member {AnalystSizeUnit} [KernelDensityJobParameter.prototype.radiusUnit=AnalystSizeUnit.METER]
  46300. * @description 搜索半径单位。
  46301. */
  46302. this.radiusUnit = AnalystSizeUnit.METER;
  46303. /**
  46304. * @member {AnalystAreaUnit} [KernelDensityJobParameter.prototype.areaUnit=AnalystAreaUnit.SQUAREMILE]
  46305. * @description 面积单位。
  46306. */
  46307. this.areaUnit = AnalystAreaUnit.SQUAREMILE;
  46308. /**
  46309. * @member {OutputSetting} KernelDensityJobParameter.prototype.output
  46310. * @description 输出参数设置类。
  46311. */
  46312. this.output = null;
  46313. /**
  46314. * @member {MappingParameters} [KernelDensityJobParameter.prototype.mappingParameters]
  46315. * @description 分析后结果可视化的参数类。
  46316. */
  46317. this.mappingParameters = null;
  46318. Util_Util.extend(this, options);
  46319. this.CLASS_NAME = "SuperMap.KernelDensityJobParameter";
  46320. }
  46321. /**
  46322. * @function KernelDensityJobParameter.prototype.destroy
  46323. * @description 释放资源,将引用资源的属性置空。
  46324. */
  46325. KernelDensityJobParameter_createClass(KernelDensityJobParameter, [{
  46326. key: "destroy",
  46327. value: function destroy() {
  46328. this.datasetName = null;
  46329. this.query = null;
  46330. this.resolution = null;
  46331. this.method = null;
  46332. this.radius = null;
  46333. this.meshType = null;
  46334. this.fields = null;
  46335. this.meshSizeUnit = null;
  46336. this.radiusUnit = null;
  46337. this.areaUnit = null;
  46338. if (this.output instanceof OutputSetting) {
  46339. this.output.destroy();
  46340. this.output = null;
  46341. }
  46342. if (this.mappingParameters instanceof MappingParameters) {
  46343. this.mappingParameters.destroy();
  46344. this.mappingParameters = null;
  46345. }
  46346. }
  46347. /**
  46348. * @function KernelDensityJobParameter.toObject
  46349. * @param {KernelDensityJobParameter} kernelDensityJobParameter - 核密度分析服务参数类。
  46350. * @param {KernelDensityJobParameter} tempObj - 核密度分析服务参数对象。
  46351. * @description 将核密度分析服务参数对象转换为 JSON 对象。
  46352. * @returns JSON 对象。
  46353. */
  46354. }], [{
  46355. key: "toObject",
  46356. value: function toObject(kernelDensityJobParameter, tempObj) {
  46357. for (var name in kernelDensityJobParameter) {
  46358. if (name === "datasetName") {
  46359. tempObj['input'] = tempObj['input'] || {};
  46360. tempObj['input'][name] = kernelDensityJobParameter[name];
  46361. continue;
  46362. }
  46363. if (name === "output") {
  46364. tempObj['output'] = tempObj['output'] || {};
  46365. tempObj['output'] = kernelDensityJobParameter[name];
  46366. continue;
  46367. }
  46368. tempObj['analyst'] = tempObj['analyst'] || {};
  46369. if (name === 'query' && kernelDensityJobParameter[name]) {
  46370. tempObj['analyst'][name] = kernelDensityJobParameter[name].toBBOX();
  46371. } else {
  46372. tempObj['analyst'][name] = kernelDensityJobParameter[name];
  46373. }
  46374. if (name === 'mappingParameters') {
  46375. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  46376. tempObj['analyst']['mappingParameters'] = kernelDensityJobParameter[name];
  46377. }
  46378. }
  46379. }
  46380. }]);
  46381. return KernelDensityJobParameter;
  46382. }();
  46383. ;// CONCATENATED MODULE: ./src/common/iServer/KernelDensityJobsService.js
  46384. function KernelDensityJobsService_typeof(obj) { "@babel/helpers - typeof"; return KernelDensityJobsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, KernelDensityJobsService_typeof(obj); }
  46385. function KernelDensityJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46386. function KernelDensityJobsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  46387. function KernelDensityJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) KernelDensityJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) KernelDensityJobsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  46388. function KernelDensityJobsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { KernelDensityJobsService_get = Reflect.get.bind(); } else { KernelDensityJobsService_get = function _get(target, property, receiver) { var base = KernelDensityJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return KernelDensityJobsService_get.apply(this, arguments); }
  46389. function KernelDensityJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = KernelDensityJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  46390. function KernelDensityJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) KernelDensityJobsService_setPrototypeOf(subClass, superClass); }
  46391. function KernelDensityJobsService_setPrototypeOf(o, p) { KernelDensityJobsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return KernelDensityJobsService_setPrototypeOf(o, p); }
  46392. function KernelDensityJobsService_createSuper(Derived) { var hasNativeReflectConstruct = KernelDensityJobsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = KernelDensityJobsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = KernelDensityJobsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return KernelDensityJobsService_possibleConstructorReturn(this, result); }; }
  46393. function KernelDensityJobsService_possibleConstructorReturn(self, call) { if (call && (KernelDensityJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return KernelDensityJobsService_assertThisInitialized(self); }
  46394. function KernelDensityJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46395. function KernelDensityJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  46396. function KernelDensityJobsService_getPrototypeOf(o) { KernelDensityJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return KernelDensityJobsService_getPrototypeOf(o); }
  46397. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46398. * This program are made available under the terms of the Apache License, Version 2.0
  46399. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46400. /**
  46401. * @class KernelDensityJobsService
  46402. * @deprecatedclass SuperMap.KernelDensityJobsService
  46403. * @category iServer ProcessingService DensityAnalyst
  46404. * @classdesc 核密度分析服务类
  46405. * @extends {ProcessingServiceBase}
  46406. * @param {string} url - 服务地址。
  46407. * @param {Object} options - 可选参数。
  46408. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  46409. * @param {Object} [options.headers] - 请求头。
  46410. * @usage
  46411. */
  46412. var KernelDensityJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  46413. KernelDensityJobsService_inherits(KernelDensityJobsService, _ProcessingServiceBas);
  46414. var _super = KernelDensityJobsService_createSuper(KernelDensityJobsService);
  46415. function KernelDensityJobsService(url, options) {
  46416. var _this;
  46417. KernelDensityJobsService_classCallCheck(this, KernelDensityJobsService);
  46418. _this = _super.call(this, url, options);
  46419. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/density');
  46420. _this.CLASS_NAME = "SuperMap.KernelDensityJobsService";
  46421. return _this;
  46422. }
  46423. /**
  46424. * @function KernelDensityJobsService.prototype.destroy
  46425. * @override
  46426. */
  46427. KernelDensityJobsService_createClass(KernelDensityJobsService, [{
  46428. key: "destroy",
  46429. value: function destroy() {
  46430. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "destroy", this).call(this);
  46431. }
  46432. /**
  46433. * @function KernelDensityJobsService.prototype.getKernelDensityJobs
  46434. * @description 获取核密度分析任务
  46435. */
  46436. }, {
  46437. key: "getKernelDensityJobs",
  46438. value: function getKernelDensityJobs() {
  46439. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "getJobs", this).call(this, this.url);
  46440. }
  46441. /**
  46442. * @function KernelDensityJobsService.prototype.getKernelDensityJobs
  46443. * @description 获取指定id的核密度分析服务
  46444. * @param {string} id - 指定要获取数据的id
  46445. */
  46446. }, {
  46447. key: "getKernelDensityJob",
  46448. value: function getKernelDensityJob(id) {
  46449. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  46450. }
  46451. /**
  46452. * @function KernelDensityJobsService.prototype.addKernelDensityJob
  46453. * @description 新建核密度分析服务
  46454. * @param {KernelDensityJobParameter} params - 核密度分析服务参数类。
  46455. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  46456. */
  46457. }, {
  46458. key: "addKernelDensityJob",
  46459. value: function addKernelDensityJob(params, seconds) {
  46460. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "addJob", this).call(this, this.url, params, KernelDensityJobParameter, seconds);
  46461. }
  46462. }]);
  46463. return KernelDensityJobsService;
  46464. }(ProcessingServiceBase);
  46465. ;// CONCATENATED MODULE: ./src/common/iServer/LabelMatrixCell.js
  46466. function LabelMatrixCell_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  46467. function LabelMatrixCell_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelMatrixCell_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelMatrixCell_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  46468. function LabelMatrixCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46469. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46470. * This program are made available under the terms of the Apache License, Version 2.0
  46471. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46472. /**
  46473. * @class LabelMatrixCell
  46474. * @deprecatedclass SuperMap.LabelMatrixCell
  46475. * @category iServer Map Theme
  46476. * @classdesc 矩阵标签元素抽象类。该类可以包含 n*n 个矩阵标签元素,矩阵标签元素的类型可以是图片,符号,标签专题图等。
  46477. * 符号类型的矩阵标签元素类、图片类型的矩阵标签元素类和专题图类型的矩阵标签元素类均继承自该类。
  46478. * @usage
  46479. */
  46480. var LabelMatrixCell = /*#__PURE__*/LabelMatrixCell_createClass(function LabelMatrixCell() {
  46481. LabelMatrixCell_classCallCheck(this, LabelMatrixCell);
  46482. this.CLASS_NAME = "LabelMatrixCell";
  46483. });
  46484. ;// CONCATENATED MODULE: ./src/common/iServer/LabelImageCell.js
  46485. function LabelImageCell_typeof(obj) { "@babel/helpers - typeof"; return LabelImageCell_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, LabelImageCell_typeof(obj); }
  46486. function LabelImageCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46487. function LabelImageCell_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  46488. function LabelImageCell_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelImageCell_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelImageCell_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  46489. function LabelImageCell_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) LabelImageCell_setPrototypeOf(subClass, superClass); }
  46490. function LabelImageCell_setPrototypeOf(o, p) { LabelImageCell_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LabelImageCell_setPrototypeOf(o, p); }
  46491. function LabelImageCell_createSuper(Derived) { var hasNativeReflectConstruct = LabelImageCell_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = LabelImageCell_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = LabelImageCell_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return LabelImageCell_possibleConstructorReturn(this, result); }; }
  46492. function LabelImageCell_possibleConstructorReturn(self, call) { if (call && (LabelImageCell_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return LabelImageCell_assertThisInitialized(self); }
  46493. function LabelImageCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46494. function LabelImageCell_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  46495. function LabelImageCell_getPrototypeOf(o) { LabelImageCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LabelImageCell_getPrototypeOf(o); }
  46496. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46497. * This program are made available under the terms of the Apache License, Version 2.0
  46498. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46499. /**
  46500. * @class LabelImageCell
  46501. * @deprecatedclass SuperMap.LabelImageCell
  46502. * @category iServer Map Theme
  46503. * @classdesc 图片类型的矩阵标签元素类。该类继承自 {@link LabelMatrixCell}类,主要对矩阵标签中的专题图类型的矩阵标签元素进行设置。
  46504. * 矩阵标签专题图是标签专题图(ThemeLabel)的一种,其中矩阵标签中的填充元素又可分为图片类型({@link LabelImageCell})、
  46505. * 符号类型({@link LabelSymbolCell})、专题图类型({@link LabelThemeCell})三种,该类是这三种类型的矩阵标签元素其中的一种,
  46506. * 用于定义符号类型的矩阵标签,如符号 ID 字段名称(符号 ID 与 SuperMap 桌面产品中点、线、面符号的 ID 对应)、大小等。
  46507. * 用户在实现矩阵标签专题图时只需将定义好的矩阵标签元素赋值予 {@link ThemeLabel#matrixCells} 属性即可。matrixCells 是一个二维数组,
  46508. * 每一维可以是任意类型的矩阵标签元素组成的数组(也可是单个标签元素组成的数组,即数组中只有一个元素)。
  46509. * @extends {LabelMatrixCell}
  46510. * @param {Object} options - 可选参数。
  46511. * @param {number} [options.height=0] - 设置图片的高度,单位为毫米。
  46512. * @param {string} [options.pathField] - 设置矩阵标签元素所使用图片的路径。
  46513. * @param {number} [options.rotation=0.0] - 图片的旋转角度。逆时针方向为正方向,单位为度,精确到0.1度。
  46514. * @param {number} [options.width=0] - 设置图片的宽度,单位为毫米。
  46515. * @param {boolean} [options.sizeFixed=false] - 是否固定图片的大小。
  46516. * @usage
  46517. */
  46518. var LabelImageCell = /*#__PURE__*/function (_LabelMatrixCell) {
  46519. LabelImageCell_inherits(LabelImageCell, _LabelMatrixCell);
  46520. var _super = LabelImageCell_createSuper(LabelImageCell);
  46521. function LabelImageCell(options) {
  46522. var _this;
  46523. LabelImageCell_classCallCheck(this, LabelImageCell);
  46524. _this = _super.call(this, options);
  46525. /**
  46526. * @member {number} LabelImageCell.prototype.height
  46527. * @description 设置图片的高度,单位为毫米。
  46528. */
  46529. _this.height = 0;
  46530. /**
  46531. * @member {string} LabelImageCell.prototype.pathField
  46532. * @description 设置矩阵标签元素所使用的图片路径对应的字段名。
  46533. */
  46534. _this.pathField = null;
  46535. /**
  46536. * @member {number} [LabelImageCell.prototype.rotation=0.0]
  46537. * @description 图片的旋转角度。逆时针方向为正方向,单位为度,精确到0.1度。
  46538. */
  46539. _this.rotation = 0.0;
  46540. /**
  46541. * @member {number} LabelImageCell.prototype.width
  46542. * @description 设置图片的宽度,单位为毫米。
  46543. */
  46544. _this.width = 0;
  46545. /**
  46546. * @member {boolean} [LabelImageCell.prototype.sizeFixed=false]
  46547. * @description 是否固定图片的大小。
  46548. */
  46549. _this.sizeFixed = false;
  46550. /**
  46551. * @member {string} LabelImageCell.prototype.type
  46552. * @description 制作矩阵专题图时是必须的。
  46553. */
  46554. _this.type = "IMAGE";
  46555. if (options) {
  46556. Util_Util.extend(LabelImageCell_assertThisInitialized(_this), options);
  46557. }
  46558. _this.CLASS_NAME = "SuperMap.LabelImageCell";
  46559. return _this;
  46560. }
  46561. /**
  46562. * @function LabelImageCell.prototype.destroy
  46563. * @description 释放资源,将引用资源的属性置空。
  46564. */
  46565. LabelImageCell_createClass(LabelImageCell, [{
  46566. key: "destroy",
  46567. value: function destroy() {
  46568. var me = this;
  46569. me.height = null;
  46570. me.pathField = null;
  46571. me.rotation = null;
  46572. me.width = null;
  46573. me.sizeFixed = null;
  46574. }
  46575. }]);
  46576. return LabelImageCell;
  46577. }(LabelMatrixCell);
  46578. ;// CONCATENATED MODULE: ./src/common/iServer/LabelSymbolCell.js
  46579. function LabelSymbolCell_typeof(obj) { "@babel/helpers - typeof"; return LabelSymbolCell_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, LabelSymbolCell_typeof(obj); }
  46580. function LabelSymbolCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46581. function LabelSymbolCell_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  46582. function LabelSymbolCell_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelSymbolCell_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelSymbolCell_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  46583. function LabelSymbolCell_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) LabelSymbolCell_setPrototypeOf(subClass, superClass); }
  46584. function LabelSymbolCell_setPrototypeOf(o, p) { LabelSymbolCell_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LabelSymbolCell_setPrototypeOf(o, p); }
  46585. function LabelSymbolCell_createSuper(Derived) { var hasNativeReflectConstruct = LabelSymbolCell_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = LabelSymbolCell_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = LabelSymbolCell_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return LabelSymbolCell_possibleConstructorReturn(this, result); }; }
  46586. function LabelSymbolCell_possibleConstructorReturn(self, call) { if (call && (LabelSymbolCell_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return LabelSymbolCell_assertThisInitialized(self); }
  46587. function LabelSymbolCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46588. function LabelSymbolCell_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  46589. function LabelSymbolCell_getPrototypeOf(o) { LabelSymbolCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LabelSymbolCell_getPrototypeOf(o); }
  46590. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46591. * This program are made available under the terms of the Apache License, Version 2.0
  46592. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46593. /**
  46594. * @class LabelSymbolCell
  46595. * @deprecatedclass SuperMap.LabelSymbolCell
  46596. * @category iServer Map Theme
  46597. * @classdesc 符号类型的矩阵标签元素类。
  46598. * 该类继承自 {@link LabelMatrixCell}类,主要对矩阵标签中的专题图类型的矩阵标签元素进行设置。
  46599. * 矩阵标签专题图是标签专题图({@link ThemeLabel})的一种,其中矩阵标签中的填充元素又可分为图片类型({@link LabelImageCell})、
  46600. * 符号类型({@link LabelSymbolCell})、专题图类型({@link LabelThemeCell})三种,该类是这三种类型的矩阵标签元素其中的一种,
  46601. * 用于定义符号类型的矩阵标签,如符号 ID 字段名称(符号 ID 与 SuperMap 桌面产品中点、线、面符号的 ID 对应)、大小等。
  46602. * 用户在实现矩阵标签专题图时只需将定义好的矩阵标签元素赋值予 {@link ThemeLabel#matrixCells} 属性即可。matrixCells 属性是一个二维数组,
  46603. * 每一维可以是任意类型的矩阵标签元素组成的数组(也可是单个标签元素组成的数组,即数组中只有一个元素)。
  46604. * @extends {LabelMatrixCell}
  46605. * @param {Object} options - 参数。
  46606. * @param {ServerStyle} options.style - 获取或设置符号样式。
  46607. * @param {string} options.symbolIDField - 符号 ID 或符号 ID 所对应的字段名称。
  46608. * @usage
  46609. */
  46610. var LabelSymbolCell = /*#__PURE__*/function (_LabelMatrixCell) {
  46611. LabelSymbolCell_inherits(LabelSymbolCell, _LabelMatrixCell);
  46612. var _super = LabelSymbolCell_createSuper(LabelSymbolCell);
  46613. function LabelSymbolCell(options) {
  46614. var _this;
  46615. LabelSymbolCell_classCallCheck(this, LabelSymbolCell);
  46616. _this = _super.call(this, options);
  46617. /**
  46618. * @member {ServerStyle} LabelSymbolCell.prototype.style
  46619. * @description 获取或设置符号样式—— {@link ServerStyle} 对象,包括符号大小({@link ServerStyle#markerSize})
  46620. * 和符号旋转({@link ServerStyle#markerAngle})角度,其中用于设置符号 ID 的属性({@link ServerStyle#markerSymbolID})在此处不起作用。
  46621. */
  46622. _this.style = new ServerStyle();
  46623. /**
  46624. * @member {string} LabelSymbolCell.prototype.symbolIDField
  46625. * @description 获取或设置符号 ID 或符号 ID 所对应的字段名称。
  46626. */
  46627. _this.symbolIDField = null;
  46628. /**
  46629. * @member {string} LabelSymbolCell.prototype.type
  46630. * @description 制作矩阵专题图时是必须的。
  46631. */
  46632. _this.type = "SYMBOL";
  46633. if (options) {
  46634. Util_Util.extend(LabelSymbolCell_assertThisInitialized(_this), options);
  46635. }
  46636. _this.CLASS_NAME = "SuperMap.LabelSymbolCell";
  46637. return _this;
  46638. }
  46639. /**
  46640. * @function LabelSymbolCell.prototype.destroy
  46641. * @description 释放资源,将引用资源的属性置空。
  46642. */
  46643. LabelSymbolCell_createClass(LabelSymbolCell, [{
  46644. key: "destroy",
  46645. value: function destroy() {
  46646. var me = this;
  46647. if (me.style) {
  46648. me.style.destroy();
  46649. me.style = null;
  46650. }
  46651. me.symbolIDField = null;
  46652. }
  46653. }]);
  46654. return LabelSymbolCell;
  46655. }(LabelMatrixCell);
  46656. ;// CONCATENATED MODULE: ./src/common/iServer/LabelThemeCell.js
  46657. function LabelThemeCell_typeof(obj) { "@babel/helpers - typeof"; return LabelThemeCell_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, LabelThemeCell_typeof(obj); }
  46658. function LabelThemeCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46659. function LabelThemeCell_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  46660. function LabelThemeCell_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelThemeCell_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelThemeCell_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  46661. function LabelThemeCell_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) LabelThemeCell_setPrototypeOf(subClass, superClass); }
  46662. function LabelThemeCell_setPrototypeOf(o, p) { LabelThemeCell_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LabelThemeCell_setPrototypeOf(o, p); }
  46663. function LabelThemeCell_createSuper(Derived) { var hasNativeReflectConstruct = LabelThemeCell_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = LabelThemeCell_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = LabelThemeCell_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return LabelThemeCell_possibleConstructorReturn(this, result); }; }
  46664. function LabelThemeCell_possibleConstructorReturn(self, call) { if (call && (LabelThemeCell_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return LabelThemeCell_assertThisInitialized(self); }
  46665. function LabelThemeCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46666. function LabelThemeCell_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  46667. function LabelThemeCell_getPrototypeOf(o) { LabelThemeCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LabelThemeCell_getPrototypeOf(o); }
  46668. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46669. * This program are made available under the terms of the Apache License, Version 2.0
  46670. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46671. /**
  46672. * @class LabelThemeCell
  46673. * @deprecatedclass SuperMap.LabelThemeCell
  46674. * @category iServer Map Theme
  46675. * @classdesc 专题图类型的矩阵标签元素类。
  46676. * 该类继承自 {@link LabelMatrixCell} 类,主要对矩阵标签中的专题图类型的矩阵标签元素进行设置。
  46677. * 矩阵标签专题图是标签专题图({@link ThemeLabel})的一种,其中矩阵标签中的填充元素又可分为图片类型({@link LabelImageCell})、
  46678. * 符号类型({@link LabelSymbolCell})、专题图类型({@link LabelThemeCell})三种,该类是这三种类型的矩阵标签元素其中的一种,
  46679. * 用于定义符号类型的矩阵标签,如符号 ID 字段名称(符号 ID 与 SuperMap 桌面产品中点、线、面符号的 ID 对应)、大小等。
  46680. * 用户在实现矩阵标签专题图时只需将定义好的矩阵标签元素赋值予 {@link ThemeLabel#matrixCells} 属性即可。matrixCells 属性是一个二维数组,
  46681. * 每一维可以是任意类型的矩阵标签元素组成的数组(也可是单个标签元素组成的数组,即数组中只有一个元素)。
  46682. * @extends {LabelMatrixCell}
  46683. * @param {Object} options -参数。
  46684. * @param {ThemeLabel} options.themeLabel - 作为矩阵标签元素的标签专题图类。
  46685. * @usage
  46686. */
  46687. var LabelThemeCell = /*#__PURE__*/function (_LabelMatrixCell) {
  46688. LabelThemeCell_inherits(LabelThemeCell, _LabelMatrixCell);
  46689. var _super = LabelThemeCell_createSuper(LabelThemeCell);
  46690. function LabelThemeCell(options) {
  46691. var _this;
  46692. LabelThemeCell_classCallCheck(this, LabelThemeCell);
  46693. _this = _super.call(this, options);
  46694. /**
  46695. * @member {ThemeLabel} LabelThemeCell.prototype.themeLabel
  46696. * @description 使用专题图对象作为矩阵标签的一个元素。
  46697. */
  46698. _this.themeLabel = new ThemeLabel();
  46699. /**
  46700. * @member {string} LabelThemeCell.prototype.type
  46701. * @description 制作矩阵专题图时是必须的。
  46702. */
  46703. _this.type = "THEME";
  46704. if (options) {
  46705. Util_Util.extend(LabelThemeCell_assertThisInitialized(_this), options);
  46706. }
  46707. _this.CLASS_NAME = " SuperMap.LabelThemeCell";
  46708. return _this;
  46709. }
  46710. /**
  46711. * @function LabelThemeCell.prototype.destroy
  46712. * @description 释放资源,将引用资源的属性置空。
  46713. */
  46714. LabelThemeCell_createClass(LabelThemeCell, [{
  46715. key: "destroy",
  46716. value: function destroy() {
  46717. var me = this;
  46718. if (me.themeLabel) {
  46719. me.themeLabel.destroy();
  46720. me.themeLabel = null;
  46721. }
  46722. }
  46723. }]);
  46724. return LabelThemeCell;
  46725. }(LabelMatrixCell);
  46726. ;// CONCATENATED MODULE: ./src/common/iServer/LayerStatus.js
  46727. function LayerStatus_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46728. function LayerStatus_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  46729. function LayerStatus_createClass(Constructor, protoProps, staticProps) { if (protoProps) LayerStatus_defineProperties(Constructor.prototype, protoProps); if (staticProps) LayerStatus_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  46730. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46731. * This program are made available under the terms of the Apache License, Version 2.0
  46732. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46733. /**
  46734. * @class LayerStatus
  46735. * @deprecatedclass SuperMap.LayerStatus
  46736. * @category iServer Map TempLayersSet
  46737. * @classdesc 子图层显示参数类。该类存储了各个子图层的名字和是否可见的状态。
  46738. * @param {Object} options - 参数。
  46739. * @param {string} options.layerName - 图层名称。
  46740. * @param {boolean} [options.isVisible=true] - 图层是否可见,true 表示可见。
  46741. * @param {string} [options.displayFilter] - 图层显示 SQL 过滤条件。
  46742. * @usage
  46743. */
  46744. var LayerStatus = /*#__PURE__*/function () {
  46745. function LayerStatus(options) {
  46746. LayerStatus_classCallCheck(this, LayerStatus);
  46747. /**
  46748. * @member {string} LayerStatus.prototype.layerName
  46749. * @description 获取或设置图层名称。
  46750. */
  46751. this.layerName = null;
  46752. /**
  46753. * @member {boolean} LayerStatus.prototype.isVisible
  46754. * @description 获取或设置图层是否可见,true 表示可见。
  46755. */
  46756. this.isVisible = null;
  46757. /**
  46758. * @member {string} [LayerStatus.prototype.displayFilter]
  46759. * @description 图层显示 SQL 过滤条件,如 layerStatus.displayFilter = "smid < 10",表示仅显示 smid 值小于 10 的对象。
  46760. */
  46761. this.displayFilter = null;
  46762. /**
  46763. * @member {Object} [LayerStatus.prototype.fieldValuesDisplayFilter]
  46764. * @property {Array.<number>} values - 要过滤的值。
  46765. * @property {string} fieldName - 要过滤的字段名称只支持数字类型的字段。
  46766. * @property {string} fieldValuesDisplayMode - 目前有两个 DISPLAY/DISABLE。当为 DISPLAY 时,表示只显示以上设置的相应属性值的要素,否则表示不显示以上设置的相应属性值的要素。
  46767. */
  46768. this.fieldValuesDisplayFilter = null;
  46769. if (options) {
  46770. Util_Util.extend(this, options);
  46771. }
  46772. this.CLASS_NAME = "SuperMap.LayerStatus";
  46773. }
  46774. /**
  46775. * @function LayerStatus.prototype.destroy
  46776. * @description 释放资源,将引用资源的属性置空。
  46777. */
  46778. LayerStatus_createClass(LayerStatus, [{
  46779. key: "destroy",
  46780. value: function destroy() {
  46781. var me = this;
  46782. me.layerName = null;
  46783. me.isVisible = null;
  46784. me.displayFilter = null;
  46785. }
  46786. /**
  46787. * @function LayerStatus.prototype.toJSON
  46788. * @description 生成对应的 JSON。
  46789. * @returns {Object} 对应的 JSON。
  46790. */
  46791. }, {
  46792. key: "toJSON",
  46793. value: function toJSON() {
  46794. var json = '{';
  46795. json += '"type":"UGC",';
  46796. var v = [];
  46797. if (this.layerName) {
  46798. v.push('"name":"' + this.layerName + '"');
  46799. v.push('"visible":' + this.isVisible);
  46800. }
  46801. if (this.displayFilter) {
  46802. v.push('"displayFilter":"' + this.displayFilter + '"');
  46803. }
  46804. if (this.minScale || this.minScale == 0) {
  46805. v.push('"minScale":' + this.minScale);
  46806. }
  46807. if (this.maxScale || this.maxScale == 0) {
  46808. v.push('"maxScale":' + this.maxScale);
  46809. }
  46810. if (this.fieldValuesDisplayFilter) {
  46811. v.push('"fieldValuesDisplayFilter":' + Util_Util.toJSON(this.fieldValuesDisplayFilter));
  46812. }
  46813. json += v;
  46814. json += '}';
  46815. return json;
  46816. }
  46817. }]);
  46818. return LayerStatus;
  46819. }();
  46820. ;// CONCATENATED MODULE: ./src/common/iServer/LinkItem.js
  46821. function LinkItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46822. function LinkItem_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  46823. function LinkItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) LinkItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) LinkItem_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  46824. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46825. * This program are made available under the terms of the Apache License, Version 2.0
  46826. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46827. /**
  46828. * @class LinkItem
  46829. * @deprecatedclass SuperMap.LinkItem
  46830. * @constructs LinkItem
  46831. * @category iServer Data FeatureResults
  46832. * @classdesc 关联信息类。该类用于矢量数据集与外部表的关联。外部表是另一个数据集(其中纯属性数据集中没有空间几何信息)中的 DBMS 表,
  46833. * 矢量数据集与外部表可以属于不同的数据源,但数据源类型目前只支持 SQL Server 和 Oracle 类型。使用 LinkItem 时,
  46834. * 空间数据和属性数据必须满足关联条件,即主空间数据集与外部属性表之间存在关联字段。{@link LinkItem}
  46835. * 只支持左连接,UDB、PostgreSQL 和 DB2 数据源不支持 {@link LinkItem};另外,用于建立关联关系的两个表可以不在同一个数据源下。注意:<br>
  46836. * 1.使用 {@link LinkItem} 的约束条件为:空间数据和属性数据必须有关联条件,即主空间数据集与外部属性表之间存在关联字段;<br>
  46837. * 2.使用外关联表制作专题图时,所关联的字段必须设置表名,例如,如果所关联的字段为 BaseMap_R 数据集的 SmID,就要写成 BaseMap_R.SMID。
  46838. * @param {Object} options - 参数。
  46839. * @param {DatasourceConnectionInfo} options.datasourceConnectionInfo - 关联的外部数据源信息。
  46840. * @param {Array.<string>} options.foreignKeys - 主空间数据集的外键。
  46841. * @param {string} options.foreignTable - 关联的外部属性表的名称。
  46842. * @param {Array.<string>} options.linkFields - 欲保留的外部属性表的字段。
  46843. * @param {string} options.linkFilter - 与外部属性表的连接条件。
  46844. * @param {string} options.name - 此关联信息对象的名称。
  46845. * @param {Array.<string>} options.primaryKeys - 关联的外部属性表的主键。
  46846. * @example 下面以 SQL 查询说明 linkitem 的使用方法:
  46847. * function queryBySQL() {
  46848. * // 设置关联的外部数据库信息,alias表示数据库别名
  46849. * var dc = new DatasourceConnectionInfo({
  46850. * dataBase: "RelQuery",
  46851. * server: "{ip}:{port}",
  46852. * user: "sa",
  46853. * password: "map",
  46854. * driver: "SQL Server",
  46855. * connect: true,
  46856. * OpenLinkTable: false,
  46857. * alias: "RelQuery",
  46858. * engineType: EngineType.SQLPLUS,
  46859. * readOnly: false,
  46860. * exclusive: false
  46861. * });
  46862. * // 设置关联信息
  46863. * var linkItem = new LinkItem({
  46864. * datasourceConnectionInfo: dc,
  46865. * foreignKeys: ["name"],
  46866. * foreignTable: "Pop_2011",
  46867. * linkFields: ["SmID as Pid","pop"],
  46868. * name: "link",
  46869. * primatryKeys: ["name"],
  46870. * });
  46871. * // 设置查询参数,在查询参数中添加linkItem关联条件信息
  46872. * var queryParam, queryBySQLParams, queryBySQLService;
  46873. * queryParam = new FilterParameter({
  46874. * name: "Province@RelQuery",
  46875. * fields: ["SmID","name"],
  46876. * attributeFilter: "SmID<7",
  46877. * linkItems: [linkItem]
  46878. * }),
  46879. * queryBySQLParams = new QueryBySQLParameters({
  46880. * queryParams: [queryParam]
  46881. * }),
  46882. * queryBySQLService = new QueryBySQLService(url, {
  46883. * eventListeners: {
  46884. * "processCompleted": processCompleted,
  46885. * "processFailed": processFailed
  46886. * }
  46887. * });
  46888. * queryBySQLService.processAsync(queryBySQLParams);
  46889. * }
  46890. * function processCompleted(queryEventArgs) {//todo}
  46891. * function processFailed(e) {//todo}
  46892. * @usage
  46893. */
  46894. var LinkItem = /*#__PURE__*/function () {
  46895. function LinkItem(options) {
  46896. LinkItem_classCallCheck(this, LinkItem);
  46897. /**
  46898. * @member {DatasourceConnectionInfo} LinkItem.prototype.datasourceConnectionInfo
  46899. * @description 关联的外部数据源信息。
  46900. */
  46901. this.datasourceConnectionInfo = null;
  46902. /**
  46903. * @member {Array.<string>} LinkItem.prototype.foreignKeys
  46904. * @description 主空间数据集的外键。
  46905. */
  46906. this.foreignKeys = null;
  46907. /**
  46908. * @member {string} LinkItem.prototype.foreignTable
  46909. * @description 关联的外部属性表的名称,目前仅支持 Supermap 管理的表,即另一个矢量数据集所对应的 DBMS 表。
  46910. */
  46911. this.foreignTable = null;
  46912. /**
  46913. * @member {Array.<string>} LinkItem.prototype.linkFields
  46914. * @description 欲保留的外部属性表的字段。如果不设置字段或者设置的字段在外部属性表中不存在的话则不返回任何外部属性表的属性信息。如果欲保留的外部表字段与主表字段存在同名,则还需要指定一个不存在字段名作为外部表的字段别名。
  46915. */
  46916. this.linkFields = null;
  46917. /**
  46918. * @member {string} LinkItem.prototype.linkFilter
  46919. * @description 与外部属性表的连接条件。
  46920. */
  46921. this.linkFilter = null;
  46922. /**
  46923. * @member {string} LinkItem.prototype.name
  46924. * @description 此关联信息对象的名称。
  46925. */
  46926. this.name = null;
  46927. /**
  46928. * @member {Array.<string>} LinkItem.prototype.primaryKeys
  46929. * @description 需要关联的外部属性表的主键。
  46930. */
  46931. this.primaryKeys = null;
  46932. if (options) {
  46933. Util_Util.extend(this, options);
  46934. }
  46935. this.CLASS_NAME = "SuperMap.LinkItem";
  46936. }
  46937. /**
  46938. * @function LinkItem.prototype.destroy
  46939. * @description 释放资源,将引用资源的属性置空。
  46940. */
  46941. LinkItem_createClass(LinkItem, [{
  46942. key: "destroy",
  46943. value: function destroy() {
  46944. var me = this;
  46945. if (me.datasourceConnectionInfo instanceof DatasourceConnectionInfo) {
  46946. me.datasourceConnectionInfo.destroy();
  46947. me.datasourceConnectionInfo = null;
  46948. }
  46949. me.foreignKeys = null;
  46950. me.foreignTable = null;
  46951. me.linkFields = null;
  46952. me.linkFilter = null;
  46953. me.name = null;
  46954. me.primaryKeys = null;
  46955. }
  46956. }]);
  46957. return LinkItem;
  46958. }();
  46959. ;// CONCATENATED MODULE: ./src/common/iServer/MapService.js
  46960. function MapService_typeof(obj) { "@babel/helpers - typeof"; return MapService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, MapService_typeof(obj); }
  46961. function MapService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46962. function MapService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  46963. function MapService_createClass(Constructor, protoProps, staticProps) { if (protoProps) MapService_defineProperties(Constructor.prototype, protoProps); if (staticProps) MapService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  46964. function MapService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { MapService_get = Reflect.get.bind(); } else { MapService_get = function _get(target, property, receiver) { var base = MapService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return MapService_get.apply(this, arguments); }
  46965. function MapService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MapService_getPrototypeOf(object); if (object === null) break; } return object; }
  46966. function MapService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) MapService_setPrototypeOf(subClass, superClass); }
  46967. function MapService_setPrototypeOf(o, p) { MapService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MapService_setPrototypeOf(o, p); }
  46968. function MapService_createSuper(Derived) { var hasNativeReflectConstruct = MapService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MapService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MapService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MapService_possibleConstructorReturn(this, result); }; }
  46969. function MapService_possibleConstructorReturn(self, call) { if (call && (MapService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return MapService_assertThisInitialized(self); }
  46970. function MapService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46971. function MapService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  46972. function MapService_getPrototypeOf(o) { MapService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MapService_getPrototypeOf(o); }
  46973. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46974. * This program are made available under the terms of the Apache License, Version 2.0
  46975. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46976. /**
  46977. * @class MapService
  46978. * @deprecatedclass SuperMap.MapService
  46979. * @category iServer Map
  46980. * @classdesc 地图信息服务类。
  46981. * @extends {CommonServiceBase}
  46982. * @example
  46983. * var myMapService = new MapService(url, {
  46984. * eventListeners:{
  46985. * "processCompleted": MapServiceCompleted,
  46986. * "processFailed": MapServiceFailed
  46987. * }
  46988. * });
  46989. *
  46990. * @param {string} url - 服务地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
  46991. * @param {Object} options - 参数。
  46992. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  46993. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  46994. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  46995. * @param {Object} [options.headers] - 请求头。
  46996. * @usage
  46997. */
  46998. var MapService_MapService = /*#__PURE__*/function (_CommonServiceBase) {
  46999. MapService_inherits(MapService, _CommonServiceBase);
  47000. var _super = MapService_createSuper(MapService);
  47001. function MapService(url, options) {
  47002. var _this;
  47003. MapService_classCallCheck(this, MapService);
  47004. _this = _super.call(this, url, options);
  47005. /**
  47006. * @member {string} MapService.prototype.projection
  47007. * @description 根据投影参数获取地图状态信息。如"EPSG:4326"
  47008. */
  47009. _this.projection = null;
  47010. _this.CLASS_NAME = "SuperMap.MapService";
  47011. if (options) {
  47012. Util_Util.extend(MapService_assertThisInitialized(_this), options);
  47013. }
  47014. var me = MapService_assertThisInitialized(_this);
  47015. if (me.projection) {
  47016. var arr = me.projection.split(":");
  47017. if (arr instanceof Array) {
  47018. if (arr.length === 2) {
  47019. me.url = Util_Util.urlAppend(me.url, "prjCoordSys=".concat(encodeURIComponent("{\"epsgCode\":\"".concat(arr[1], "\"}"))));
  47020. }
  47021. if (arr.length === 1) {
  47022. me.url = Util_Util.urlAppend(me.url, "prjCoordSys=".concat(encodeURIComponent("{\"epsgCode\":\"".concat(arr[0], "\"}"))));
  47023. }
  47024. }
  47025. }
  47026. _this.eventCount = 0;
  47027. return _this;
  47028. }
  47029. /**
  47030. * @function destroy
  47031. * @description 释放资源,将引用的资源属性置空。
  47032. */
  47033. MapService_createClass(MapService, [{
  47034. key: "destroy",
  47035. value: function destroy() {
  47036. MapService_get(MapService_getPrototypeOf(MapService.prototype), "destroy", this).call(this);
  47037. var me = this;
  47038. if (me.events) {
  47039. me.events.un(me.eventListeners);
  47040. me.events.listeners = null;
  47041. me.events.destroy();
  47042. me.events = null;
  47043. me.eventListeners = null;
  47044. }
  47045. }
  47046. /**
  47047. * @function MapService.prototype.processAsync
  47048. * @description 负责将客户端的设置的参数传递到服务端,与服务端完成异步通讯。
  47049. */
  47050. }, {
  47051. key: "processAsync",
  47052. value: function processAsync(callback) {
  47053. var eventId = ++this.eventCount;
  47054. var eventListeners = {
  47055. scope: this,
  47056. processCompleted: function processCompleted(result) {
  47057. if (eventId === result.result.eventId && callback) {
  47058. delete result.result.eventId;
  47059. callback(result);
  47060. this.events && this.events.un(eventListeners);
  47061. return false;
  47062. }
  47063. },
  47064. processFailed: function processFailed(result) {
  47065. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  47066. callback(result);
  47067. this.events && this.events.un(eventListeners);
  47068. return false;
  47069. }
  47070. }
  47071. };
  47072. this.events.on(eventListeners);
  47073. var me = this;
  47074. me.request({
  47075. method: "GET",
  47076. scope: me,
  47077. success: function success(result, options) {
  47078. result.eventId = eventId;
  47079. this.serviceProcessCompleted(result, options);
  47080. },
  47081. failure: function failure(result, options) {
  47082. if (result.error) {
  47083. result.error.eventId = eventId;
  47084. }
  47085. result.eventId = eventId;
  47086. this.serviceProcessFailed(result, options);
  47087. }
  47088. });
  47089. }
  47090. /*
  47091. * Method: getMapStatusCompleted
  47092. * 获取地图状态完成,执行此方法。
  47093. *
  47094. * Parameters:
  47095. * {Object} result - 服务器返回的结果对象。
  47096. */
  47097. }, {
  47098. key: "serviceProcessCompleted",
  47099. value: function serviceProcessCompleted(result, options) {
  47100. var me = this;
  47101. result = Util_Util.transformResult(result);
  47102. var codeStatus = result.code >= 200 && result.code < 300 || result.code == 0 || result.code === 304;
  47103. var isCodeValid = result.code && codeStatus;
  47104. if (!result.code || isCodeValid) {
  47105. me.events && me.events.triggerEvent("processCompleted", {
  47106. result: result,
  47107. options: options
  47108. });
  47109. } else {
  47110. ////在没有token是返回的是200,但是其实是没有权限,所以这里也应该是触发失败事件
  47111. me.events.triggerEvent("processFailed", {
  47112. error: result,
  47113. options: options
  47114. });
  47115. }
  47116. }
  47117. }]);
  47118. return MapService;
  47119. }(CommonServiceBase);
  47120. ;// CONCATENATED MODULE: ./src/common/iServer/MathExpressionAnalysisParameters.js
  47121. function MathExpressionAnalysisParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47122. function MathExpressionAnalysisParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  47123. function MathExpressionAnalysisParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) MathExpressionAnalysisParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) MathExpressionAnalysisParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  47124. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  47125. * This program are made available under the terms of the Apache License, Version 2.0
  47126. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47127. /**
  47128. * @class MathExpressionAnalysisParameters
  47129. * @deprecatedclass SuperMap.MathExpressionAnalysisParameters
  47130. * @category iServer SpatialAnalyst GridMathAnalyst
  47131. * @classdesc 栅格代数运算参数类。
  47132. * @param {Object} options - 参数。
  47133. * @param {string} options.dataset - 指定栅格代数运算数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示,例如:BaseMap_P@Jingjin。
  47134. * @param {string} options.resultGridName - 指定结果数据集名称。
  47135. * @param {string} options.expression - 指定的栅格运算表达式。如:[DatasourceAlias1.Raster1]*2-10。
  47136. * @param {string} options.targetDatasource - 指定存储结果数据集的数据源。
  47137. * @param {GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject} [options.extractRegion] - 栅格代数运算的范围,指定数据集中参与栅格代数运算的区域。
  47138. * 如果缺省,则计算全部区域,如果参与运算的数据集范围不一致,将使用所有数据集的范围的交集作为计算区域 。
  47139. * @param {boolean} [options.isZip=false] - 是否对结果数据集进行压缩处理。
  47140. * @param {boolean} [options.ignoreNoValue=false] - 是否忽略无值栅格数据。true 表示忽略无值数据,即无值栅格不参与运算。
  47141. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  47142. * @usage
  47143. */
  47144. var MathExpressionAnalysisParameters = /*#__PURE__*/function () {
  47145. function MathExpressionAnalysisParameters(options) {
  47146. MathExpressionAnalysisParameters_classCallCheck(this, MathExpressionAnalysisParameters);
  47147. if (!options) {
  47148. return;
  47149. }
  47150. /**
  47151. * @member {string} MathExpressionAnalysisParameters.prototype.dataset
  47152. * @description 要用来做栅格代数运算数据源中数据集的名称。
  47153. * 该名称用形如"数据集名称@数据源别名"形式来表示,例如:JingjinTerrain@Jingjin。
  47154. *
  47155. */
  47156. this.dataset = null;
  47157. /**
  47158. * @member {GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject} [MathExpressionAnalysisParameters.prototype.extractRegion]
  47159. * @description 栅格代数运算的范围,指定数据集中参与栅格代数运算的区域。
  47160. * 如果缺省,则计算全部区域,如果参与运算的数据集范围不一致,将使用所有数据集的范围的交集作为计算区域 。
  47161. */
  47162. this.extractRegion = null;
  47163. /**
  47164. * @member {string} MathExpressionAnalysisParameters.prototype.expression
  47165. * @description 指定的栅格运算表达式。如:"[DatasourceAlias1.Raster1]*2-10"。
  47166. */
  47167. this.expression = null;
  47168. /**
  47169. * @member {boolean} [MathExpressionAnalysisParameters.prototype.isZip=false]
  47170. * @description 是否对结果数据集进行压缩处理。
  47171. */
  47172. this.isZip = false;
  47173. /**
  47174. * @member {boolean} [MathExpressionAnalysisParameters.prototype.ignoreNoValue=false]
  47175. * @description 是否忽略无值栅格数据。
  47176. */
  47177. this.ignoreNoValue = false;
  47178. /**
  47179. * @member {string} MathExpressionAnalysisParameters.prototype.targetDatasource
  47180. * @description 指定存储结果数据集的数据源。
  47181. */
  47182. this.targetDatasource = null;
  47183. /**
  47184. * @member {string} MathExpressionAnalysisParameters.prototype.resultGridName
  47185. * @description 指定结果数据集名称。
  47186. */
  47187. this.resultGridName = null;
  47188. /**
  47189. * @member {boolean} [MathExpressionAnalysisParameters.prototype.deleteExistResultDataset=false]
  47190. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  47191. */
  47192. this.deleteExistResultDataset = false;
  47193. Util_Util.extend(this, options);
  47194. this.CLASS_NAME = "SuperMap.MathExpressionAnalysisParameters";
  47195. }
  47196. /**
  47197. * @function MathExpressionAnalysisParameters.prototype.destroy
  47198. * @description 释放资源,将引用资源的属性置空。
  47199. */
  47200. MathExpressionAnalysisParameters_createClass(MathExpressionAnalysisParameters, [{
  47201. key: "destroy",
  47202. value: function destroy() {
  47203. var me = this;
  47204. me.dataset = null;
  47205. me.bounds = null;
  47206. me.expression = null;
  47207. me.isZip = true;
  47208. me.ignoreNoValue = true;
  47209. me.targetDatasource = null;
  47210. me.resultGridName = null;
  47211. me.deleteExistResultDataset = null;
  47212. }
  47213. /**
  47214. * @function MathExpressionAnalysisParameters.toObject
  47215. * @param {Object} mathExpressionAnalysisParameters - 栅格代数运算参数。
  47216. * @param {Object} tempObj - 目标对象。
  47217. * @description 生成栅格代数运算对象。
  47218. */
  47219. }], [{
  47220. key: "toObject",
  47221. value: function toObject(mathExpressionAnalysisParameters, tempObj) {
  47222. for (var name in mathExpressionAnalysisParameters) {
  47223. if (name !== "dataset") {
  47224. tempObj[name] = mathExpressionAnalysisParameters[name];
  47225. }
  47226. if (name === "extractRegion") {
  47227. if (mathExpressionAnalysisParameters[name]) {
  47228. var bs = mathExpressionAnalysisParameters[name].components[0].components;
  47229. var region = {},
  47230. points = [],
  47231. type = "REGION";
  47232. var len = bs.length;
  47233. for (var i = 0; i < len - 1; i++) {
  47234. var poi = {};
  47235. poi["x"] = bs[i].x;
  47236. poi["y"] = bs[i].y;
  47237. points.push(poi);
  47238. }
  47239. region["points"] = points;
  47240. region["type"] = type;
  47241. tempObj[name] = region;
  47242. }
  47243. }
  47244. }
  47245. }
  47246. }]);
  47247. return MathExpressionAnalysisParameters;
  47248. }();
  47249. ;// CONCATENATED MODULE: ./src/common/iServer/MathExpressionAnalysisService.js
  47250. function MathExpressionAnalysisService_typeof(obj) { "@babel/helpers - typeof"; return MathExpressionAnalysisService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, MathExpressionAnalysisService_typeof(obj); }
  47251. function MathExpressionAnalysisService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47252. function MathExpressionAnalysisService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  47253. function MathExpressionAnalysisService_createClass(Constructor, protoProps, staticProps) { if (protoProps) MathExpressionAnalysisService_defineProperties(Constructor.prototype, protoProps); if (staticProps) MathExpressionAnalysisService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  47254. function MathExpressionAnalysisService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { MathExpressionAnalysisService_get = Reflect.get.bind(); } else { MathExpressionAnalysisService_get = function _get(target, property, receiver) { var base = MathExpressionAnalysisService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return MathExpressionAnalysisService_get.apply(this, arguments); }
  47255. function MathExpressionAnalysisService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MathExpressionAnalysisService_getPrototypeOf(object); if (object === null) break; } return object; }
  47256. function MathExpressionAnalysisService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) MathExpressionAnalysisService_setPrototypeOf(subClass, superClass); }
  47257. function MathExpressionAnalysisService_setPrototypeOf(o, p) { MathExpressionAnalysisService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MathExpressionAnalysisService_setPrototypeOf(o, p); }
  47258. function MathExpressionAnalysisService_createSuper(Derived) { var hasNativeReflectConstruct = MathExpressionAnalysisService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MathExpressionAnalysisService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MathExpressionAnalysisService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MathExpressionAnalysisService_possibleConstructorReturn(this, result); }; }
  47259. function MathExpressionAnalysisService_possibleConstructorReturn(self, call) { if (call && (MathExpressionAnalysisService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return MathExpressionAnalysisService_assertThisInitialized(self); }
  47260. function MathExpressionAnalysisService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  47261. function MathExpressionAnalysisService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  47262. function MathExpressionAnalysisService_getPrototypeOf(o) { MathExpressionAnalysisService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MathExpressionAnalysisService_getPrototypeOf(o); }
  47263. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  47264. * This program are made available under the terms of the Apache License, Version 2.0
  47265. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47266. /**
  47267. * @class MathExpressionAnalysisService
  47268. * @deprecatedclass SuperMap.MathExpressionAnalysisService
  47269. * @category iServer SpatialAnalyst GridMathAnalyst
  47270. * @classdesc 栅格代数运算服务类。
  47271. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst
  47272. * @param {Object} options - 参数。
  47273. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  47274. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  47275. * @param {Object} [options.headers] - 请求头。
  47276. * @extends {SpatialAnalystBase}
  47277. * @example 例如:
  47278. * (start code)
  47279. * var myMathExpressionAnalysisService = new MathExpressionAnalysisService(url);
  47280. * myMathExpressionAnalysisService.on({
  47281. * "processCompleted": processCompleted,
  47282. * "processFailed": processFailed
  47283. * }
  47284. * );
  47285. * (end)
  47286. * @usage
  47287. */
  47288. var MathExpressionAnalysisService = /*#__PURE__*/function (_SpatialAnalystBase) {
  47289. MathExpressionAnalysisService_inherits(MathExpressionAnalysisService, _SpatialAnalystBase);
  47290. var _super = MathExpressionAnalysisService_createSuper(MathExpressionAnalysisService);
  47291. function MathExpressionAnalysisService(url, options) {
  47292. var _this;
  47293. MathExpressionAnalysisService_classCallCheck(this, MathExpressionAnalysisService);
  47294. _this = _super.call(this, url, options);
  47295. _this.CLASS_NAME = "SuperMap.MathExpressionAnalysisService";
  47296. return _this;
  47297. }
  47298. /**
  47299. * @override
  47300. */
  47301. MathExpressionAnalysisService_createClass(MathExpressionAnalysisService, [{
  47302. key: "destroy",
  47303. value: function destroy() {
  47304. MathExpressionAnalysisService_get(MathExpressionAnalysisService_getPrototypeOf(MathExpressionAnalysisService.prototype), "destroy", this).call(this);
  47305. }
  47306. /**
  47307. * @function MathExpressionAnalysisService.prototype.processAsync
  47308. * @description 负责将客户端的查询参数传递到服务端。
  47309. * @param {MathExpressionAnalysisParameters} parameter - 栅格代数运算参数类。
  47310. */
  47311. }, {
  47312. key: "processAsync",
  47313. value: function processAsync(parameter) {
  47314. var me = this;
  47315. var parameterObject = {};
  47316. if (parameter instanceof MathExpressionAnalysisParameters) {
  47317. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/mathanalyst');
  47318. }
  47319. MathExpressionAnalysisParameters.toObject(parameter, parameterObject);
  47320. var jsonParameters = Util_Util.toJSON(parameterObject);
  47321. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  47322. me.request({
  47323. method: "POST",
  47324. data: jsonParameters,
  47325. scope: me,
  47326. success: me.serviceProcessCompleted,
  47327. failure: me.serviceProcessFailed
  47328. });
  47329. }
  47330. }]);
  47331. return MathExpressionAnalysisService;
  47332. }(SpatialAnalystBase);
  47333. ;// CONCATENATED MODULE: ./src/common/iServer/MeasureParameters.js
  47334. function MeasureParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47335. function MeasureParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  47336. function MeasureParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) MeasureParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) MeasureParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  47337. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  47338. * This program are made available under the terms of the Apache License, Version 2.0
  47339. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47340. /**
  47341. * @class MeasureParameters
  47342. * @deprecatedclass SuperMap.MeasureParameters
  47343. * @category iServer Map Measure
  47344. * @classdesc 量算参数类。
  47345. * @param {GeoJSONObject} geometry - 要量算的几何对象。
  47346. * @param {Object} options - 可选参数。
  47347. * @param {Unit} [options.unit=Unit.METER] - 量算单位。
  47348. * @param {string} [options.prjCoordSys] - 用来指定该量算操作所使用的投影。
  47349. * @param {string} [options.distanceMode="Geodesic"] - 用来指定量算的方式为按球面长度 'Geodesic' 或者平面长度 'Planar' 来计算。
  47350. * @usage
  47351. */
  47352. var MeasureParameters = /*#__PURE__*/function () {
  47353. function MeasureParameters(geometry, options) {
  47354. MeasureParameters_classCallCheck(this, MeasureParameters);
  47355. if (!geometry) {
  47356. return;
  47357. }
  47358. /**
  47359. * @member {GeoJSONObject} MeasureParameters.prototype.geometry
  47360. * @description 要量算的几何对象。<br>
  47361. * 点类型可以是:{@link GeometryPoint}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}|{@link GeoJSONObject}。<br>
  47362. * 线类型可以是:{@link GeometryLineString}|{@link GeometryLinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}|{@link GeoJSONObject}。<br>
  47363. * 面类型可以是:{@link GeometryPolygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}|{@link GeoJSONObject}。
  47364. */
  47365. this.geometry = geometry;
  47366. /**
  47367. * @member {Unit} [MeasureParameters.prototype.unit=Unit.METER]
  47368. * @description 量算单位。即量算结果以米为单位。
  47369. */
  47370. this.unit = Unit.METER;
  47371. /**
  47372. * @member {string} [MeasureParameters.prototype.prjCoordSys]
  47373. * @description 用来指定该量算操作所使用的投影。
  47374. */
  47375. this.prjCoordSys = null;
  47376. /**
  47377. * @member {string} [MeasureParameters.prototype.distanceMode="Geodesic"]
  47378. * @description 用来指定量算的方式为按球面长度 'Geodesic' 或者平面长度 'Planar' 来计算。
  47379. * @example
  47380. * var param = new MeasureParameters(getmetry,{distanceMode:'Planar'});
  47381. */
  47382. this.distanceMode = null;
  47383. if (options) {
  47384. Util_Util.extend(this, options);
  47385. }
  47386. this.CLASS_NAME = "SuperMap.MeasureParameters";
  47387. }
  47388. /**
  47389. * @function MeasureParameters.prototype.destroy
  47390. * @description 释放资源,将引用资源的属性置空。
  47391. */
  47392. MeasureParameters_createClass(MeasureParameters, [{
  47393. key: "destroy",
  47394. value: function destroy() {
  47395. var me = this;
  47396. me.geometry = null;
  47397. me.unit = null;
  47398. me.prjCoordSys = null;
  47399. }
  47400. }]);
  47401. return MeasureParameters;
  47402. }();
  47403. ;// CONCATENATED MODULE: ./src/common/iServer/MeasureService.js
  47404. function MeasureService_typeof(obj) { "@babel/helpers - typeof"; return MeasureService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, MeasureService_typeof(obj); }
  47405. function MeasureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47406. function MeasureService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  47407. function MeasureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) MeasureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) MeasureService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  47408. function MeasureService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { MeasureService_get = Reflect.get.bind(); } else { MeasureService_get = function _get(target, property, receiver) { var base = MeasureService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return MeasureService_get.apply(this, arguments); }
  47409. function MeasureService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MeasureService_getPrototypeOf(object); if (object === null) break; } return object; }
  47410. function MeasureService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) MeasureService_setPrototypeOf(subClass, superClass); }
  47411. function MeasureService_setPrototypeOf(o, p) { MeasureService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MeasureService_setPrototypeOf(o, p); }
  47412. function MeasureService_createSuper(Derived) { var hasNativeReflectConstruct = MeasureService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MeasureService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MeasureService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MeasureService_possibleConstructorReturn(this, result); }; }
  47413. function MeasureService_possibleConstructorReturn(self, call) { if (call && (MeasureService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return MeasureService_assertThisInitialized(self); }
  47414. function MeasureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  47415. function MeasureService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  47416. function MeasureService_getPrototypeOf(o) { MeasureService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MeasureService_getPrototypeOf(o); }
  47417. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  47418. * This program are made available under the terms of the Apache License, Version 2.0
  47419. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47420. /**
  47421. * @class MeasureService
  47422. * @deprecatedclass SuperMap.MeasureService
  47423. * @category iServer Map Measure
  47424. * @classdesc 量算服务类。
  47425. * 该类负责将量算参数传递到服务端,并获取服务端返回的量算结果。
  47426. * @extends {CommonServiceBase}
  47427. * @example
  47428. * var myMeasuerService = new MeasureService(url, {
  47429. * measureMode: MeasureMode.DISTANCE,
  47430. * eventListeners:{
  47431. * "processCompleted": measureCompleted
  47432. * }
  47433. * });
  47434. * @param {string} url - 服务地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
  47435. * @param {Object} options - 参数。
  47436. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  47437. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  47438. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  47439. * @param {Object} [options.headers] - 请求头。
  47440. * @param {MeasureMode} options.measureMode - 量算模式,包括距离量算模式和面积量算模式。
  47441. * @usage
  47442. */
  47443. var MeasureService_MeasureService = /*#__PURE__*/function (_CommonServiceBase) {
  47444. MeasureService_inherits(MeasureService, _CommonServiceBase);
  47445. var _super = MeasureService_createSuper(MeasureService);
  47446. function MeasureService(url, options) {
  47447. var _this;
  47448. MeasureService_classCallCheck(this, MeasureService);
  47449. _this = _super.call(this, url, options);
  47450. /**
  47451. * @member {MeasureMode} [MeasureService.prototype.measureMode=MeasureMode.DISTANCE]
  47452. * @description 量算模式,包括距离量算模式和面积量算模式。
  47453. */
  47454. _this.measureMode = MeasureMode.DISTANCE;
  47455. if (options) {
  47456. Util_Util.extend(MeasureService_assertThisInitialized(_this), options);
  47457. }
  47458. _this.eventCount = 0;
  47459. _this.CLASS_NAME = "SuperMap.MeasureService";
  47460. return _this;
  47461. }
  47462. /**
  47463. * @override
  47464. */
  47465. MeasureService_createClass(MeasureService, [{
  47466. key: "destroy",
  47467. value: function destroy() {
  47468. MeasureService_get(MeasureService_getPrototypeOf(MeasureService.prototype), "destroy", this).call(this);
  47469. var me = this;
  47470. me.measureMode = null;
  47471. }
  47472. /**
  47473. * @function MeasureService.prototype.processAsync
  47474. * @description 负责将客户端的量算参数传递到服务端。
  47475. * @param {MeasureParameters} params - 量算参数。
  47476. */
  47477. }, {
  47478. key: "processAsync",
  47479. value: function processAsync(params, callback) {
  47480. if (!(params instanceof MeasureParameters)) {
  47481. return;
  47482. }
  47483. var eventId = ++this.eventCount;
  47484. var eventListeners = {
  47485. scope: this,
  47486. processCompleted: function processCompleted(result) {
  47487. if (eventId === result.result.eventId && callback) {
  47488. delete result.result.eventId;
  47489. callback(result);
  47490. this.events && this.events.un(eventListeners);
  47491. return false;
  47492. }
  47493. },
  47494. processFailed: function processFailed(result) {
  47495. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  47496. callback(result);
  47497. this.events && this.events.un(eventListeners);
  47498. return false;
  47499. }
  47500. }
  47501. };
  47502. this.events.on(eventListeners);
  47503. var me = this,
  47504. geometry = params.geometry,
  47505. pointsCount = 0,
  47506. point2ds = null;
  47507. if (!geometry) {
  47508. return;
  47509. }
  47510. me.url = Util_Util.urlPathAppend(me.url, me.measureMode === MeasureMode.AREA ? 'area' : 'distance');
  47511. var serverGeometry = ServerGeometry.fromGeometry(geometry);
  47512. if (!serverGeometry) {
  47513. return;
  47514. }
  47515. pointsCount = serverGeometry.parts[0];
  47516. point2ds = serverGeometry.points.splice(0, pointsCount);
  47517. var prjCoordSysTemp, prjCodeTemp, paramsTemp;
  47518. if (params.prjCoordSys) {
  47519. if (MeasureService_typeof(params.prjCoordSys) === "object") {
  47520. prjCodeTemp = params.prjCoordSys.projCode;
  47521. prjCoordSysTemp = '{"epsgCode"' + prjCodeTemp.substring(prjCodeTemp.indexOf(":"), prjCodeTemp.length) + "}";
  47522. } else if (typeof params.prjCoordSys === "string") {
  47523. prjCoordSysTemp = '{"epsgCode"' + params.prjCoordSys.substring(params.prjCoordSys.indexOf(":"), params.prjCoordSys.length) + "}";
  47524. }
  47525. paramsTemp = {
  47526. "point2Ds": Util_Util.toJSON(point2ds),
  47527. "unit": params.unit,
  47528. "prjCoordSys": prjCoordSysTemp,
  47529. "distanceMode": params.distanceMode || 'Geodesic'
  47530. };
  47531. } else {
  47532. paramsTemp = {
  47533. "point2Ds": Util_Util.toJSON(point2ds),
  47534. "unit": params.unit,
  47535. "distanceMode": params.distanceMode || 'Geodesic'
  47536. };
  47537. }
  47538. me.request({
  47539. method: "GET",
  47540. params: paramsTemp,
  47541. scope: me,
  47542. success: function success(result, options) {
  47543. result.eventId = eventId;
  47544. this.serviceProcessCompleted(result, options);
  47545. },
  47546. failure: function failure(result, options) {
  47547. if (result.error) {
  47548. result.error.eventId = eventId;
  47549. }
  47550. result.eventId = eventId;
  47551. this.serviceProcessFailed(result, options);
  47552. }
  47553. });
  47554. }
  47555. }]);
  47556. return MeasureService;
  47557. }(CommonServiceBase);
  47558. ;// CONCATENATED MODULE: ./src/common/iServer/OverlapDisplayedOptions.js
  47559. function OverlapDisplayedOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47560. function OverlapDisplayedOptions_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  47561. function OverlapDisplayedOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlapDisplayedOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlapDisplayedOptions_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  47562. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  47563. * This program are made available under the terms of the Apache License, Version 2.0
  47564. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47565. /**
  47566. * @class OverlapDisplayedOptions
  47567. * @deprecatedclass SuperMap.OverlapDisplayedOptions
  47568. * @category iServer Map Layer
  47569. * @classdesc 地图压盖过滤显示选项。在文本或专题图元素显示较密集的区域,文本之间或专题元素之间会发生相互压盖的现象,
  47570. * 该类可以分别控制各种类型的对象的压盖显示情况,进而很好地处理地图中各种类型对象的压盖显示问题。
  47571. * @param {Object} options - 可选参数。
  47572. * @param {boolean} [options.allowPointOverlap=true] - 点和点压盖时是否显示压盖的点对象。
  47573. * @param {boolean} [options.allowPointWithTextDisplay=true] - 标签和相应普通图层上的点是否一起过滤显示,如果过滤显示,
  47574. * 只以图层集合中对应数据集的索引最小的图层的点风格来绘制点。
  47575. * @param {boolean} [options.allowTextOverlap=false] - 文本压盖时是否显示压盖的文本对象。
  47576. * @param {boolean} [options.allowTextAndPointOverlap=true] - 文本和点压盖时是否显示压盖的文本或点对象(此属性不处理文本之间的压盖和点之间的压盖)。
  47577. * @param {boolean} [options.allowThemeGraduatedSymbolOverlap=false] - 等级符号元素压盖时是否显示压盖的等级符号元素。
  47578. * @param {boolean} [options.allowThemeGraphOverlap=false] - 统计专题图元素压盖时是否显示压盖的统计专题图元素。
  47579. * @param {number} [options.horizontalOverlappedSpaceSize=0] - 两个对象之间的横向压盖间距,单位为 0.1 毫米,跟 verticalOverlappedSpaceSize 结合使用,
  47580. * 当两个对象的横向间距小于该值,且纵向间距小于 verticalOverlappedSpaceSize 时认为压盖。
  47581. * @param {number} [options.verticalOverlappedSpaceSize=0] - 两个对象之间的纵向压盖间距,单位为 0.1 毫米,跟 horizontalOverlappedSpaceSize 结合使用,
  47582. * 当两个对象的纵向间距小于该值,且横向间距小于 horizontalOverlappedSpaceSize 时认为压盖。
  47583. * @usage
  47584. */
  47585. var OverlapDisplayedOptions = /*#__PURE__*/function () {
  47586. function OverlapDisplayedOptions(options) {
  47587. OverlapDisplayedOptions_classCallCheck(this, OverlapDisplayedOptions);
  47588. options = options || {};
  47589. /**
  47590. * @member {boolean} [OverlapDisplayedOptions.prototype.allowPointOverlap=true]
  47591. * @description 点和点压盖时是否显示压盖的点对象。
  47592. */
  47593. this.allowPointOverlap = true;
  47594. /**
  47595. * @member {boolean} [OverlapDisplayedOptions.prototype.allowPointWithTextDisplay=true]
  47596. * @description 标签和相应普通图层上的点是否一起过滤显示,如果过滤显示,
  47597. * 只以图层集合中对应数据集的索引最小的图层的点风格来绘制点。
  47598. */
  47599. this.allowPointWithTextDisplay = true;
  47600. /**
  47601. * @member {boolean} [OverlapDisplayedOptions.prototype.allowTextOverlap=false]
  47602. * @description 文本压盖时是否显示压盖的文本对象。
  47603. */
  47604. this.allowTextOverlap = false;
  47605. /**
  47606. * @member {boolean} [OverlapDisplayedOptions.prototype.allowTextAndPointOverlap=true]
  47607. * @description 文本和点压盖时是否显示压盖的文本或点对象(此属性不处理文本之间的压盖和点之间的压盖)。
  47608. */
  47609. this.allowTextAndPointOverlap = true;
  47610. /**
  47611. * @member {boolean} [OverlapDisplayedOptions.prototype.allowThemeGraduatedSymbolOverlap=false]
  47612. * @description 等级符号元素压盖时是否显示压盖的等级符号元素。
  47613. */
  47614. this.allowThemeGraduatedSymbolOverlap = false;
  47615. /**
  47616. * @member {boolean} [OverlapDisplayedOptions.prototype.allowThemeGraphOverlap=false]
  47617. * @description 统计专题图元素压盖时是否显示压盖的统计专题图元素。
  47618. */
  47619. this.allowThemeGraphOverlap = false;
  47620. /**
  47621. * @member {number} [OverlapDisplayedOptions.prototype.horizontalOverlappedSpaceSize=0]
  47622. * @description 两个对象之间的横向压盖间距,单位为0.1毫米,跟 verticalOverlappedSpaceSize 结合使用,
  47623. * 当两个对象的横向间距小于该值,且纵向间距小于 verticalOverlappedSpaceSize 时认为压盖。
  47624. */
  47625. this.horizontalOverlappedSpaceSize = 0;
  47626. /**
  47627. * @member {number} [OverlapDisplayedOptions.prototype.verticalOverlappedSpaceSize=0]
  47628. * @description 两个对象之间的纵向压盖间距,单位为0.1毫米,跟 horizontalOverlappedSpaceSize 结合使用,
  47629. * 当两个对象的纵向间距小于该值,且横向间距小于 horizontalOverlappedSpaceSize 时认为压盖。
  47630. */
  47631. this.verticalOverlappedSpaceSize = 0;
  47632. Util_Util.extend(this, options);
  47633. this.ugcLayer = new UGCLayer(options);
  47634. this.CLASS_NAME = "SuperMap.OverlapDisplayedOptions";
  47635. }
  47636. /**
  47637. * @function OverlapDisplayedOptions.prototype.destroy
  47638. * @description 释放资源,将资源的属性置空。
  47639. */
  47640. OverlapDisplayedOptions_createClass(OverlapDisplayedOptions, [{
  47641. key: "destroy",
  47642. value: function destroy() {
  47643. Util_Util.reset(this);
  47644. }
  47645. /**
  47646. * @function OverlapDisplayedOptions.prototype.fromJson
  47647. * @description 将服务端 JSON 对象转换成当前客户端对象。
  47648. * @param {Object} jsonObject - 要转换的 JSON 对象。
  47649. */
  47650. }, {
  47651. key: "fromJson",
  47652. value: function fromJson(jsonObject) {
  47653. this.ugcLayer.fromJson.apply(this, [jsonObject]);
  47654. }
  47655. /**
  47656. * @function OverlapDisplayedOptions.prototype.toServerJSONObject
  47657. * @description 转换成对应的 JSON 格式对象。
  47658. * @returns {Object} 对应的 JSON 格式对象。
  47659. */
  47660. }, {
  47661. key: "toServerJSONObject",
  47662. value: function toServerJSONObject() {
  47663. var jsonObject = this.ugcLayer.toServerJSONObject.apply(this, arguments);
  47664. return jsonObject;
  47665. }
  47666. /**
  47667. * @function OverlapDisplayedOptions.prototype.toString
  47668. * @description 转换成对应的 tileLayer 请求瓦片时 overlapDisplayedOptions 参数。
  47669. * @returns {string} 对应的 tileLayer 请求瓦片时 overlapDisplayedOptions 参数。
  47670. */
  47671. }, {
  47672. key: "toString",
  47673. value: function toString() {
  47674. var jsonObject = this.ugcLayer.toServerJSONObject.apply(this, arguments);
  47675. var str = "{";
  47676. for (var attr in jsonObject) {
  47677. if (jsonObject.hasOwnProperty(attr)) {
  47678. str += "'" + attr + "':" + jsonObject[attr] + ",";
  47679. }
  47680. }
  47681. str = str.substr(0, str.length - 1);
  47682. str += "}";
  47683. return str;
  47684. }
  47685. }]);
  47686. return OverlapDisplayedOptions;
  47687. }();
  47688. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayAnalystService.js
  47689. function OverlayAnalystService_typeof(obj) { "@babel/helpers - typeof"; return OverlayAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, OverlayAnalystService_typeof(obj); }
  47690. function OverlayAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47691. function OverlayAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  47692. function OverlayAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  47693. function OverlayAnalystService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { OverlayAnalystService_get = Reflect.get.bind(); } else { OverlayAnalystService_get = function _get(target, property, receiver) { var base = OverlayAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return OverlayAnalystService_get.apply(this, arguments); }
  47694. function OverlayAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = OverlayAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  47695. function OverlayAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) OverlayAnalystService_setPrototypeOf(subClass, superClass); }
  47696. function OverlayAnalystService_setPrototypeOf(o, p) { OverlayAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return OverlayAnalystService_setPrototypeOf(o, p); }
  47697. function OverlayAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = OverlayAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = OverlayAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = OverlayAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return OverlayAnalystService_possibleConstructorReturn(this, result); }; }
  47698. function OverlayAnalystService_possibleConstructorReturn(self, call) { if (call && (OverlayAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return OverlayAnalystService_assertThisInitialized(self); }
  47699. function OverlayAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  47700. function OverlayAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  47701. function OverlayAnalystService_getPrototypeOf(o) { OverlayAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return OverlayAnalystService_getPrototypeOf(o); }
  47702. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  47703. * This program are made available under the terms of the Apache License, Version 2.0
  47704. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47705. /**
  47706. * @class OverlayAnalystService
  47707. * @deprecatedclass SuperMap.OverlayAnalystService
  47708. * @category iServer SpatialAnalyst OverlayAnalyst
  47709. * @classdesc 叠加分析服务类。
  47710. * 该类负责将客户设置的叠加分析参数传递给服务端,并接收服务端返回的叠加分析结果数据。
  47711. * 叠加分析结果通过该类支持的事件的监听函数参数获取
  47712. * @param {string} url - 服务地址。如http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  47713. * @param {Object} options - 参数。
  47714. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  47715. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  47716. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  47717. * @param {Object} [options.headers] - 请求头。
  47718. * @extends {CommonServiceBase}
  47719. * @example 例如:
  47720. * (start code)
  47721. * var myOverlayAnalystService = new OverlayAnalystService(url, {
  47722. * eventListeners: {
  47723. * "processCompleted": OverlayCompleted,
  47724. * "processFailed": OverlayFailed
  47725. * }
  47726. * });
  47727. * (end)
  47728. * @usage
  47729. */
  47730. var OverlayAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  47731. OverlayAnalystService_inherits(OverlayAnalystService, _SpatialAnalystBase);
  47732. var _super = OverlayAnalystService_createSuper(OverlayAnalystService);
  47733. function OverlayAnalystService(url, options) {
  47734. var _this;
  47735. OverlayAnalystService_classCallCheck(this, OverlayAnalystService);
  47736. _this = _super.call(this, url, options);
  47737. /**
  47738. * @member {string} OverlayAnalystService.prototype.mode
  47739. * @description 叠加分析类型
  47740. */
  47741. _this.mode = null;
  47742. if (options) {
  47743. Util_Util.extend(OverlayAnalystService_assertThisInitialized(_this), options);
  47744. }
  47745. _this.CLASS_NAME = "SuperMap.OverlayAnalystService";
  47746. return _this;
  47747. }
  47748. /**
  47749. * @override
  47750. */
  47751. OverlayAnalystService_createClass(OverlayAnalystService, [{
  47752. key: "destroy",
  47753. value: function destroy() {
  47754. OverlayAnalystService_get(OverlayAnalystService_getPrototypeOf(OverlayAnalystService.prototype), "destroy", this).call(this);
  47755. this.mode = null;
  47756. }
  47757. /**
  47758. * @function OverlayAnalystService.prototype.processAsync
  47759. * @description 负责将客户端的查询参数传递到服务端。
  47760. * @param {OverlayAnalystParameters} parameter - 叠加分析参数类。
  47761. */
  47762. }, {
  47763. key: "processAsync",
  47764. value: function processAsync(parameter) {
  47765. var parameterObject = {};
  47766. var me = this;
  47767. if (parameter instanceof DatasetOverlayAnalystParameters) {
  47768. me.mode = "datasets";
  47769. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.sourceDataset + '/overlay');
  47770. DatasetOverlayAnalystParameters.toObject(parameter, parameterObject);
  47771. } else if (parameter instanceof GeometryOverlayAnalystParameters) {
  47772. me.mode = "geometry";
  47773. //支持传入多个几何要素进行叠加分析
  47774. if (parameter.operateGeometries && parameter.sourceGeometries) {
  47775. me.url = Util_Util.urlPathAppend(me.url, 'geometry/overlay/batch');
  47776. me.url = Util_Util.urlAppend(me.url, 'ignoreAnalystParam=true');
  47777. } else {
  47778. me.url = Util_Util.urlPathAppend(me.url, 'geometry/overlay');
  47779. }
  47780. GeometryOverlayAnalystParameters.toObject(parameter, parameterObject);
  47781. }
  47782. this.returnContent = true;
  47783. var jsonParameters = Util_Util.toJSON(parameterObject);
  47784. me.request({
  47785. method: "POST",
  47786. data: jsonParameters,
  47787. scope: me,
  47788. success: me.serviceProcessCompleted,
  47789. failure: me.serviceProcessFailed
  47790. });
  47791. }
  47792. }, {
  47793. key: "dataFormat",
  47794. value: function dataFormat() {
  47795. return [DataFormat.GEOJSON, DataFormat.ISERVER, DataFormat.FGB];
  47796. }
  47797. }]);
  47798. return OverlayAnalystService;
  47799. }(SpatialAnalystBase);
  47800. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayGeoJobParameter.js
  47801. function OverlayGeoJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47802. function OverlayGeoJobParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  47803. function OverlayGeoJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayGeoJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayGeoJobParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  47804. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  47805. * This program are made available under the terms of the Apache License, Version 2.0
  47806. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47807. /**
  47808. * @class OverlayGeoJobParameter
  47809. * @deprecatedclass SuperMap.OverlayGeoJobParameter
  47810. * @category iServer ProcessingService OverlayAnalyst
  47811. * @classdesc 叠加分析任务参数类。
  47812. * @param {Object} options - 参数。
  47813. * @param {string} options.datasetName - 数据集名。
  47814. * @param {string} options.datasetOverlay - 叠加对象所在的数据集名称。
  47815. * @param {string} options.srcFields - 输入数据需要保留的字段。
  47816. * @param {string} [options.overlayFields] - 叠加数据需要保留的字段。对分析模式为 clip、update、erase 时,此参数无效。
  47817. * @param {string} [options.mode] - 叠加分析模式。
  47818. * @param {OutputSetting} [options.output] - 输出参数设置。
  47819. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  47820. * @usage
  47821. */
  47822. var OverlayGeoJobParameter = /*#__PURE__*/function () {
  47823. function OverlayGeoJobParameter(options) {
  47824. OverlayGeoJobParameter_classCallCheck(this, OverlayGeoJobParameter);
  47825. if (!options) {
  47826. return;
  47827. }
  47828. /**
  47829. * @member {string} OverlayGeoJobParameter.prototype.datasetName
  47830. * @description 数据集名。
  47831. */
  47832. this.datasetName = "";
  47833. /**
  47834. * @member {string} OverlayGeoJobParameter.prototype.datasetOverlay
  47835. * @description 叠加对象所在的数据集名称。
  47836. */
  47837. this.datasetOverlay = "";
  47838. /**
  47839. * @member {string} [OverlayGeoJobParameter.prototype.mode]
  47840. * @description 叠加分析模式。
  47841. */
  47842. this.mode = "";
  47843. /**
  47844. * @member {string} OverlayGeoJobParameter.prototype.srcFields
  47845. * @description 输入数据需要保留的字段。
  47846. */
  47847. this.srcFields = "";
  47848. /**
  47849. * @member {string} OverlayGeoJobParameter.prototype.overlayFields
  47850. * @description 叠加数据需要保留的字段,对分析模式为 clip、update、erase 时,此参数无效。
  47851. */
  47852. this.overlayFields = "";
  47853. /**
  47854. * @member {OutputSetting} [OverlayGeoJobParameter.prototype.output]
  47855. * @description 输出参数设置类。
  47856. */
  47857. this.output = null;
  47858. /**
  47859. * @member {MappingParameters} [OverlayGeoJobParameter.prototype.mappingParameters]
  47860. * @description 分析后结果可视化的参数类。
  47861. */
  47862. this.mappingParameters = null;
  47863. Util_Util.extend(this, options);
  47864. this.CLASS_NAME = "SuperMap.OverlayGeoJobParameter";
  47865. }
  47866. /**
  47867. * @function OverlayGeoJobParameter.prototype.destroy
  47868. * @description 释放资源,将资源的属性置空。
  47869. */
  47870. OverlayGeoJobParameter_createClass(OverlayGeoJobParameter, [{
  47871. key: "destroy",
  47872. value: function destroy() {
  47873. this.datasetName = null;
  47874. this.datasetOverlay = null;
  47875. this.mode = null;
  47876. this.srcFields = null;
  47877. this.overlayFields = null;
  47878. if (this.output instanceof OutputSetting) {
  47879. this.output.destroy();
  47880. this.output = null;
  47881. }
  47882. if (this.mappingParameters instanceof MappingParameters) {
  47883. this.mappingParameters.destroy();
  47884. this.mappingParameters = null;
  47885. }
  47886. }
  47887. /**
  47888. * @function OverlayGeoJobParameter.toObject
  47889. * @param {Object} OverlayGeoJobParameter - 点聚合分析任务参数。
  47890. * @param {Object} tempObj - 目标对象。
  47891. * @description 生成点聚合分析任务对象。
  47892. */
  47893. }], [{
  47894. key: "toObject",
  47895. value: function toObject(_OverlayGeoJobParameter, tempObj) {
  47896. for (var name in _OverlayGeoJobParameter) {
  47897. if (name == "datasetName") {
  47898. tempObj['input'] = tempObj['input'] || {};
  47899. tempObj['input'][name] = _OverlayGeoJobParameter[name];
  47900. continue;
  47901. }
  47902. if (name === "output") {
  47903. tempObj['output'] = tempObj['output'] || {};
  47904. tempObj['output'] = _OverlayGeoJobParameter[name];
  47905. continue;
  47906. }
  47907. tempObj['analyst'] = tempObj['analyst'] || {};
  47908. tempObj['analyst'][name] = _OverlayGeoJobParameter[name];
  47909. if (name === 'mappingParameters') {
  47910. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  47911. tempObj['analyst']['mappingParameters'] = _OverlayGeoJobParameter[name];
  47912. }
  47913. }
  47914. }
  47915. }]);
  47916. return OverlayGeoJobParameter;
  47917. }();
  47918. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayGeoJobsService.js
  47919. function OverlayGeoJobsService_typeof(obj) { "@babel/helpers - typeof"; return OverlayGeoJobsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, OverlayGeoJobsService_typeof(obj); }
  47920. function OverlayGeoJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47921. function OverlayGeoJobsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  47922. function OverlayGeoJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayGeoJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayGeoJobsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  47923. function OverlayGeoJobsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { OverlayGeoJobsService_get = Reflect.get.bind(); } else { OverlayGeoJobsService_get = function _get(target, property, receiver) { var base = OverlayGeoJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return OverlayGeoJobsService_get.apply(this, arguments); }
  47924. function OverlayGeoJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = OverlayGeoJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  47925. function OverlayGeoJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) OverlayGeoJobsService_setPrototypeOf(subClass, superClass); }
  47926. function OverlayGeoJobsService_setPrototypeOf(o, p) { OverlayGeoJobsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return OverlayGeoJobsService_setPrototypeOf(o, p); }
  47927. function OverlayGeoJobsService_createSuper(Derived) { var hasNativeReflectConstruct = OverlayGeoJobsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = OverlayGeoJobsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = OverlayGeoJobsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return OverlayGeoJobsService_possibleConstructorReturn(this, result); }; }
  47928. function OverlayGeoJobsService_possibleConstructorReturn(self, call) { if (call && (OverlayGeoJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return OverlayGeoJobsService_assertThisInitialized(self); }
  47929. function OverlayGeoJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  47930. function OverlayGeoJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  47931. function OverlayGeoJobsService_getPrototypeOf(o) { OverlayGeoJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return OverlayGeoJobsService_getPrototypeOf(o); }
  47932. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  47933. * This program are made available under the terms of the Apache License, Version 2.0
  47934. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47935. /**
  47936. * @class OverlayGeoJobsService
  47937. * @deprecatedclass SuperMap.OverlayGeoJobsService
  47938. * @category iServer ProcessingService OverlayAnalyst
  47939. * @classdesc 叠加分析任务类。
  47940. * @param {string} url - 服务地址。
  47941. * @param {Object} options - 参数。
  47942. * @param {Events} options.events - 处理所有事件的对象。
  47943. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  47944. * @param {number} options.index - 服务访问地址在数组中的位置。
  47945. * @param {number} options.length - 服务访问地址数组长度。
  47946. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  47947. * @param {Object} [options.headers] - 请求头。
  47948. * @usage
  47949. */
  47950. var OverlayGeoJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  47951. OverlayGeoJobsService_inherits(OverlayGeoJobsService, _ProcessingServiceBas);
  47952. var _super = OverlayGeoJobsService_createSuper(OverlayGeoJobsService);
  47953. function OverlayGeoJobsService(url, options) {
  47954. var _this;
  47955. OverlayGeoJobsService_classCallCheck(this, OverlayGeoJobsService);
  47956. _this = _super.call(this, url, options);
  47957. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/overlay');
  47958. _this.CLASS_NAME = 'SuperMap.OverlayGeoJobsService';
  47959. return _this;
  47960. }
  47961. /**
  47962. * @override
  47963. */
  47964. OverlayGeoJobsService_createClass(OverlayGeoJobsService, [{
  47965. key: "destroy",
  47966. value: function destroy() {
  47967. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "destroy", this).call(this);
  47968. }
  47969. /**
  47970. * @function OverlayGeoJobsService.prototype.getOverlayGeoJobs
  47971. * @description 获取叠加分析任务
  47972. */
  47973. }, {
  47974. key: "getOverlayGeoJobs",
  47975. value: function getOverlayGeoJobs() {
  47976. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "getJobs", this).call(this, this.url);
  47977. }
  47978. /**
  47979. * @function OverlayGeoJobsService.prototype.getOverlayGeoJob
  47980. * @description 获取指定id的叠加分析任务
  47981. * @param {string} id - 指定要获取数据的id
  47982. */
  47983. }, {
  47984. key: "getOverlayGeoJob",
  47985. value: function getOverlayGeoJob(id) {
  47986. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  47987. }
  47988. /**
  47989. * @function OverlayGeoJobsService.prototype.addOverlayGeoJob
  47990. * @description 新建点叠加析服务
  47991. * @param {OverlayGeoJobParameter} params - 创建一个叠加分析的请求参数。
  47992. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  47993. */
  47994. }, {
  47995. key: "addOverlayGeoJob",
  47996. value: function addOverlayGeoJob(params, seconds) {
  47997. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "addJob", this).call(this, this.url, params, OverlayGeoJobParameter, seconds);
  47998. }
  47999. }]);
  48000. return OverlayGeoJobsService;
  48001. }(ProcessingServiceBase);
  48002. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByBoundsParameters.js
  48003. function QueryByBoundsParameters_typeof(obj) { "@babel/helpers - typeof"; return QueryByBoundsParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, QueryByBoundsParameters_typeof(obj); }
  48004. function QueryByBoundsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48005. function QueryByBoundsParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  48006. function QueryByBoundsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByBoundsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByBoundsParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  48007. function QueryByBoundsParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByBoundsParameters_get = Reflect.get.bind(); } else { QueryByBoundsParameters_get = function _get(target, property, receiver) { var base = QueryByBoundsParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return QueryByBoundsParameters_get.apply(this, arguments); }
  48008. function QueryByBoundsParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByBoundsParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  48009. function QueryByBoundsParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) QueryByBoundsParameters_setPrototypeOf(subClass, superClass); }
  48010. function QueryByBoundsParameters_setPrototypeOf(o, p) { QueryByBoundsParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByBoundsParameters_setPrototypeOf(o, p); }
  48011. function QueryByBoundsParameters_createSuper(Derived) { var hasNativeReflectConstruct = QueryByBoundsParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = QueryByBoundsParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = QueryByBoundsParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return QueryByBoundsParameters_possibleConstructorReturn(this, result); }; }
  48012. function QueryByBoundsParameters_possibleConstructorReturn(self, call) { if (call && (QueryByBoundsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return QueryByBoundsParameters_assertThisInitialized(self); }
  48013. function QueryByBoundsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  48014. function QueryByBoundsParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  48015. function QueryByBoundsParameters_getPrototypeOf(o) { QueryByBoundsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByBoundsParameters_getPrototypeOf(o); }
  48016. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  48017. * This program are made available under the terms of the Apache License, Version 2.0
  48018. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48019. /**
  48020. * @class QueryByBoundsParameters
  48021. * @deprecatedclass SuperMap.QueryByBoundsParameters
  48022. * @category iServer Map QueryResults
  48023. * @classdesc Bounds 查询参数类。该类用于设置 Bounds 查询的相关参数。
  48024. * @extends {QueryParameters}
  48025. * @param {Object} options - 参数。
  48026. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 指定的查询范围。
  48027. * @param {Array.<FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  48028. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  48029. * @param {Object} [options.prjCoordSys] -自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  48030. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  48031. * @param {GeometryType} [options.networkType=GeometryType.LINE] - 网络数据集对应的查询类型。
  48032. * @param {QueryOption} [options.queryOption=QueryOption.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  48033. * @param {number} [options.startRecord=0] - 查询起始记录号。
  48034. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  48035. * @param {boolean} [options.returnCustomResult=false] - 仅供三维使用。
  48036. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  48037. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  48038. * @usage
  48039. */
  48040. var QueryByBoundsParameters = /*#__PURE__*/function (_QueryParameters) {
  48041. QueryByBoundsParameters_inherits(QueryByBoundsParameters, _QueryParameters);
  48042. var _super = QueryByBoundsParameters_createSuper(QueryByBoundsParameters);
  48043. function QueryByBoundsParameters(options) {
  48044. var _this;
  48045. QueryByBoundsParameters_classCallCheck(this, QueryByBoundsParameters);
  48046. options = options || {};
  48047. _this = _super.call(this, options);
  48048. /**
  48049. * @member {boolean} [QueryByBoundsParameters.prototype.returnContent=true]
  48050. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  48051. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  48052. * 为 false,则返回的是查询结果资源的 URI。
  48053. */
  48054. _this.returnContent = true;
  48055. /**
  48056. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} QueryByBoundsParameters.prototype.bounds
  48057. * @description 指定的查询范围。
  48058. */
  48059. _this.bounds = null;
  48060. Util_Util.extend(QueryByBoundsParameters_assertThisInitialized(_this), options);
  48061. _this.CLASS_NAME = "SuperMap.QueryByBoundsParameters";
  48062. return _this;
  48063. }
  48064. /**
  48065. * @function QueryByBoundsParameters.prototype.destroy
  48066. * @description 释放资源,将引用资源的属性置空。
  48067. */
  48068. QueryByBoundsParameters_createClass(QueryByBoundsParameters, [{
  48069. key: "destroy",
  48070. value: function destroy() {
  48071. QueryByBoundsParameters_get(QueryByBoundsParameters_getPrototypeOf(QueryByBoundsParameters.prototype), "destroy", this).call(this);
  48072. var me = this;
  48073. me.returnContent = null;
  48074. if (me.bounds) {
  48075. me.bounds = null;
  48076. }
  48077. }
  48078. }]);
  48079. return QueryByBoundsParameters;
  48080. }(QueryParameters);
  48081. ;// CONCATENATED MODULE: ./src/common/iServer/QueryServiceBase.js
  48082. function QueryServiceBase_typeof(obj) { "@babel/helpers - typeof"; return QueryServiceBase_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, QueryServiceBase_typeof(obj); }
  48083. function QueryServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48084. function QueryServiceBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  48085. function QueryServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryServiceBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  48086. function QueryServiceBase_get() { if (typeof Reflect !== "undefined" && Reflect.get) { QueryServiceBase_get = Reflect.get.bind(); } else { QueryServiceBase_get = function _get(target, property, receiver) { var base = QueryServiceBase_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return QueryServiceBase_get.apply(this, arguments); }
  48087. function QueryServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
  48088. function QueryServiceBase_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) QueryServiceBase_setPrototypeOf(subClass, superClass); }
  48089. function QueryServiceBase_setPrototypeOf(o, p) { QueryServiceBase_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryServiceBase_setPrototypeOf(o, p); }
  48090. function QueryServiceBase_createSuper(Derived) { var hasNativeReflectConstruct = QueryServiceBase_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = QueryServiceBase_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = QueryServiceBase_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return QueryServiceBase_possibleConstructorReturn(this, result); }; }
  48091. function QueryServiceBase_possibleConstructorReturn(self, call) { if (call && (QueryServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return QueryServiceBase_assertThisInitialized(self); }
  48092. function QueryServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  48093. function QueryServiceBase_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  48094. function QueryServiceBase_getPrototypeOf(o) { QueryServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryServiceBase_getPrototypeOf(o); }
  48095. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  48096. * This program are made available under the terms of the Apache License, Version 2.0
  48097. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48098. /**
  48099. * @class QueryService
  48100. * @deprecatedclass SuperMap.QueryService
  48101. * @category iServer Map QueryResults
  48102. * @classdesc 查询服务基类。
  48103. * @extends {CommonServiceBase}
  48104. * @param {string} url - 服务地址。请求地图查询服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  48105. * @param {Object} options - 参数。
  48106. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  48107. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  48108. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  48109. * @param {Object} [options.headers] - 请求头。
  48110. * @example
  48111. * var myService = new QueryService(url, {
  48112. * eventListeners: {
  48113. * "processCompleted": queryCompleted,
  48114. * "processFailed": queryError
  48115. * }
  48116. * };
  48117. * @usage
  48118. */
  48119. var QueryServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
  48120. QueryServiceBase_inherits(QueryServiceBase, _CommonServiceBase);
  48121. var _super = QueryServiceBase_createSuper(QueryServiceBase);
  48122. function QueryServiceBase(url, options) {
  48123. var _this;
  48124. QueryServiceBase_classCallCheck(this, QueryServiceBase);
  48125. _this = _super.call(this, url, options);
  48126. /**
  48127. * @member {boolean} QueryService.prototype.returnContent
  48128. * @description 是否立即返回新创建资源的表述还是返回新资源的URI。
  48129. */
  48130. _this.returnContent = false;
  48131. /**
  48132. * @member {string} QueryService.prototype.format
  48133. * @description 查询结果返回格式,目前支持iServerJSON、GeoJSON、FGB三种格式。参数格式为"ISERVER","GEOJSON","FGB"。
  48134. */
  48135. _this.format = DataFormat.GEOJSON;
  48136. _this.returnFeatureWithFieldCaption = false;
  48137. if (options) {
  48138. Util_Util.extend(QueryServiceBase_assertThisInitialized(_this), options);
  48139. }
  48140. _this.CLASS_NAME = "SuperMap.QueryService";
  48141. if (!_this.url) {
  48142. return QueryServiceBase_possibleConstructorReturn(_this);
  48143. }
  48144. if (options && options.format) {
  48145. _this.format = options.format.toUpperCase();
  48146. }
  48147. _this.url = Util_Util.urlPathAppend(_this.url, 'queryResults');
  48148. return _this;
  48149. }
  48150. /**
  48151. * @function QueryService.prototype.destroy
  48152. * @description 释放资源,将引用资源的属性置空。
  48153. */
  48154. QueryServiceBase_createClass(QueryServiceBase, [{
  48155. key: "destroy",
  48156. value: function destroy() {
  48157. QueryServiceBase_get(QueryServiceBase_getPrototypeOf(QueryServiceBase.prototype), "destroy", this).call(this);
  48158. var me = this;
  48159. me.returnContent = null;
  48160. me.format = null;
  48161. }
  48162. /**
  48163. * @function QueryService.prototype.processAsync
  48164. * @description 负责将客户端的查询参数传递到服务端。
  48165. * @param {QueryParameters} params - 查询参数。
  48166. */
  48167. }, {
  48168. key: "processAsync",
  48169. value: function processAsync(params) {
  48170. if (!(params instanceof QueryParameters)) {
  48171. return;
  48172. }
  48173. var me = this,
  48174. returnCustomResult = null,
  48175. jsonParameters = null;
  48176. me.returnContent = params.returnContent;
  48177. jsonParameters = me.getJsonParameters(params);
  48178. if (!me.returnContent) {
  48179. //仅供三维使用 获取高亮图片的bounds
  48180. returnCustomResult = params.returnCustomResult;
  48181. if (returnCustomResult) {
  48182. me.url = Util_Util.urlAppend(me.url, 'returnCustomResult=' + returnCustomResult);
  48183. }
  48184. }
  48185. me.returnFeatureWithFieldCaption = params.returnFeatureWithFieldCaption;
  48186. me.request({
  48187. method: "POST",
  48188. data: jsonParameters,
  48189. scope: me,
  48190. success: me.serviceProcessCompleted,
  48191. failure: me.serviceProcessFailed
  48192. });
  48193. }
  48194. /**
  48195. * @function QueryService.prototype.serviceProcessCompleted
  48196. * @description 查询完成,执行此方法。
  48197. * @param {Object} result - 服务器返回的结果对象。
  48198. */
  48199. }, {
  48200. key: "serviceProcessCompleted",
  48201. value: function serviceProcessCompleted(result, options) {
  48202. var me = this;
  48203. result = Util_Util.transformResult(result);
  48204. var geoJSONFormat = new GeoJSON();
  48205. if (result && result.recordsets) {
  48206. for (var i = 0, recordsets = result.recordsets, len = recordsets.length; i < len; i++) {
  48207. if (recordsets[i].features) {
  48208. if (me.returnFeatureWithFieldCaption === true) {
  48209. recordsets[i].features.map(function (feature) {
  48210. feature.fieldNames = recordsets[i].fieldCaptions;
  48211. return feature;
  48212. });
  48213. }
  48214. if (me.format === DataFormat.GEOJSON) {
  48215. recordsets[i].features = geoJSONFormat.toGeoJSON(recordsets[i].features);
  48216. }
  48217. }
  48218. }
  48219. }
  48220. me.events.triggerEvent("processCompleted", {
  48221. result: result,
  48222. options: options
  48223. });
  48224. }
  48225. }, {
  48226. key: "dataFormat",
  48227. value: function dataFormat() {
  48228. return [DataFormat.GEOJSON, DataFormat.ISERVER, DataFormat.FGB];
  48229. }
  48230. /**
  48231. * @function QueryService.prototype.getQueryParameters
  48232. * @description 将 JSON 对象表示的查询参数转化为 QueryParameters 对象。
  48233. * @param {Object} params - JSON 字符串表示的查询参数。
  48234. * @returns {QueryParameters} 返回转化后的 QueryParameters 对象。
  48235. */
  48236. }, {
  48237. key: "getQueryParameters",
  48238. value: function getQueryParameters(params) {
  48239. return new QueryParameters({
  48240. customParams: params.customParams,
  48241. expectCount: params.expectCount,
  48242. networkType: params.networkType,
  48243. queryOption: params.queryOption,
  48244. queryParams: params.queryParams,
  48245. startRecord: params.startRecord,
  48246. prjCoordSys: params.prjCoordSys,
  48247. holdTime: params.holdTime
  48248. });
  48249. }
  48250. }]);
  48251. return QueryServiceBase;
  48252. }(CommonServiceBase);
  48253. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByBoundsService.js
  48254. function QueryByBoundsService_typeof(obj) { "@babel/helpers - typeof"; return QueryByBoundsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, QueryByBoundsService_typeof(obj); }
  48255. function QueryByBoundsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48256. function QueryByBoundsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  48257. function QueryByBoundsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByBoundsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByBoundsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  48258. function QueryByBoundsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByBoundsService_get = Reflect.get.bind(); } else { QueryByBoundsService_get = function _get(target, property, receiver) { var base = QueryByBoundsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return QueryByBoundsService_get.apply(this, arguments); }
  48259. function QueryByBoundsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByBoundsService_getPrototypeOf(object); if (object === null) break; } return object; }
  48260. function QueryByBoundsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) QueryByBoundsService_setPrototypeOf(subClass, superClass); }
  48261. function QueryByBoundsService_setPrototypeOf(o, p) { QueryByBoundsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByBoundsService_setPrototypeOf(o, p); }
  48262. function QueryByBoundsService_createSuper(Derived) { var hasNativeReflectConstruct = QueryByBoundsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = QueryByBoundsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = QueryByBoundsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return QueryByBoundsService_possibleConstructorReturn(this, result); }; }
  48263. function QueryByBoundsService_possibleConstructorReturn(self, call) { if (call && (QueryByBoundsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return QueryByBoundsService_assertThisInitialized(self); }
  48264. function QueryByBoundsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  48265. function QueryByBoundsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  48266. function QueryByBoundsService_getPrototypeOf(o) { QueryByBoundsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByBoundsService_getPrototypeOf(o); }
  48267. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  48268. * This program are made available under the terms of the Apache License, Version 2.0
  48269. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48270. /**
  48271. * @class QueryByBoundsService
  48272. * @deprecatedclass SuperMap.QueryByBoundsService
  48273. * @category iServer Map QueryResults
  48274. * @classdesc Bounds 查询服务类。
  48275. * @augments {QueryService}
  48276. * @example
  48277. * (start end)
  48278. * var myQueryByBoundsService = new QueryByBoundsService(url, {
  48279. * eventListeners: {
  48280. * "processCompleted": queryCompleted,
  48281. * "processFailed": queryError
  48282. * }
  48283. * });
  48284. * function queryCompleted(object){//todo};
  48285. * function queryError(object){//todo};
  48286. * (end)
  48287. * @param {string} url - 服务地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  48288. * @param {Object} options - 参数。
  48289. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。<br>
  48290. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  48291. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  48292. * @param {Object} [options.headers] - 请求头。
  48293. * @usage
  48294. */
  48295. var QueryByBoundsService = /*#__PURE__*/function (_QueryServiceBase) {
  48296. QueryByBoundsService_inherits(QueryByBoundsService, _QueryServiceBase);
  48297. var _super = QueryByBoundsService_createSuper(QueryByBoundsService);
  48298. function QueryByBoundsService(url, options) {
  48299. var _this;
  48300. QueryByBoundsService_classCallCheck(this, QueryByBoundsService);
  48301. _this = _super.call(this, url, options);
  48302. _this.CLASS_NAME = "SuperMap.QueryByBoundsService";
  48303. return _this;
  48304. }
  48305. /**
  48306. * @override
  48307. */
  48308. QueryByBoundsService_createClass(QueryByBoundsService, [{
  48309. key: "destroy",
  48310. value: function destroy() {
  48311. QueryByBoundsService_get(QueryByBoundsService_getPrototypeOf(QueryByBoundsService.prototype), "destroy", this).call(this);
  48312. }
  48313. /**
  48314. * @function QueryByBoundsService.prototype.getJsonParameters
  48315. * @description 将查询参数转化为 JSON 字符串。
  48316. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds 等)。
  48317. * @param {QueryByBoundsParameters} params - Bounds 查询参数。
  48318. * @returns {Object} 转化后的 JSON 字符串。
  48319. */
  48320. }, {
  48321. key: "getJsonParameters",
  48322. value: function getJsonParameters(params) {
  48323. if (!(params instanceof QueryByBoundsParameters)) {
  48324. return null;
  48325. }
  48326. var me = this,
  48327. jsonParameters = "",
  48328. qp = null,
  48329. bounds = params.bounds;
  48330. qp = me.getQueryParameters(params);
  48331. jsonParameters += "'queryMode':'BoundsQuery','queryParameters':";
  48332. jsonParameters += Util_Util.toJSON(qp);
  48333. jsonParameters += ",'bounds': {'rightTop':{'y':" + bounds.top + ",'x':" + bounds.right + "},'leftBottom':{'y':" + bounds.bottom + ",'x':" + bounds.left + "}}";
  48334. jsonParameters = "{" + jsonParameters + "}";
  48335. return jsonParameters;
  48336. }
  48337. }]);
  48338. return QueryByBoundsService;
  48339. }(QueryServiceBase);
  48340. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByDistanceParameters.js
  48341. function QueryByDistanceParameters_typeof(obj) { "@babel/helpers - typeof"; return QueryByDistanceParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, QueryByDistanceParameters_typeof(obj); }
  48342. function QueryByDistanceParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48343. function QueryByDistanceParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  48344. function QueryByDistanceParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByDistanceParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByDistanceParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  48345. function QueryByDistanceParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByDistanceParameters_get = Reflect.get.bind(); } else { QueryByDistanceParameters_get = function _get(target, property, receiver) { var base = QueryByDistanceParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return QueryByDistanceParameters_get.apply(this, arguments); }
  48346. function QueryByDistanceParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByDistanceParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  48347. function QueryByDistanceParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) QueryByDistanceParameters_setPrototypeOf(subClass, superClass); }
  48348. function QueryByDistanceParameters_setPrototypeOf(o, p) { QueryByDistanceParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByDistanceParameters_setPrototypeOf(o, p); }
  48349. function QueryByDistanceParameters_createSuper(Derived) { var hasNativeReflectConstruct = QueryByDistanceParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = QueryByDistanceParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = QueryByDistanceParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return QueryByDistanceParameters_possibleConstructorReturn(this, result); }; }
  48350. function QueryByDistanceParameters_possibleConstructorReturn(self, call) { if (call && (QueryByDistanceParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return QueryByDistanceParameters_assertThisInitialized(self); }
  48351. function QueryByDistanceParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  48352. function QueryByDistanceParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  48353. function QueryByDistanceParameters_getPrototypeOf(o) { QueryByDistanceParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByDistanceParameters_getPrototypeOf(o); }
  48354. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  48355. * This program are made available under the terms of the Apache License, Version 2.0
  48356. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48357. /**
  48358. * @class QueryByDistanceParameters
  48359. * @deprecatedclass SuperMap.QueryByDistanceParameters
  48360. * @category iServer Map QueryResults
  48361. * @classdesc Distance 查询参数类。
  48362. * 该类用于设置 Distance 查询的相关参数。
  48363. * @extends {QueryParameters}
  48364. * @param {Object} options - 参数。
  48365. * @param {GeoJSONObject} options.geometry - 用于查询的几何对象。
  48366. * @param {Array.<FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  48367. * @param {number} options.distance - 查询距离,单位与所查询图层对应的数据集单位相同。距离查询时,表示距离地物的距离。最近地物查询时,表示搜索的范围。此为必选参数。
  48368. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  48369. * @param {Object} [options.prjCoordSys] -自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  48370. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  48371. * @param {GeometryType} [options.networkType=GeometryType.LINE] - 网络数据集对应的查询类型。
  48372. * @param {QueryOption} [options.queryOption=QueryOption.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  48373. * @param {number} [options.startRecord=0] - 查询起始记录号。
  48374. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  48375. * @param {boolean} [options.returnCustomResult=false] -仅供三维使用。
  48376. * @param {boolean} [options.isNearest=false] - 是否为最近距离查询。
  48377. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  48378. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  48379. * @usage
  48380. */
  48381. var QueryByDistanceParameters = /*#__PURE__*/function (_QueryParameters) {
  48382. QueryByDistanceParameters_inherits(QueryByDistanceParameters, _QueryParameters);
  48383. var _super = QueryByDistanceParameters_createSuper(QueryByDistanceParameters);
  48384. function QueryByDistanceParameters(options) {
  48385. var _this;
  48386. QueryByDistanceParameters_classCallCheck(this, QueryByDistanceParameters);
  48387. options = options || {};
  48388. _this = _super.call(this, options);
  48389. /**
  48390. * @member {number} [QueryByDistanceParameters.prototype.distance=0]
  48391. * @description 查询距离,单位与所查询图层对应的数据集单位相同。
  48392. * 距离查询时,表示距离地物的距离。最近地物查询时,表示搜索的范围。
  48393. */
  48394. /**
  48395. * @member {GeoJSONObject} QueryByDistanceParameters.prototype.geometry
  48396. * @description 用于查询的地理对象。<br>
  48397. * 点类型可以是:{@link GeometryPoint}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}|{@link mapboxgl.LngLat}|{@link mapboxgl.Point}|{@link GeoJSONObject}。<br>
  48398. * 线类型可以是:{@link GeometryLineString}|{@link GeometryLinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}|{@link GeoJSONObject}。<br>
  48399. * 面类型可以是:{@link GeometryPolygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}|{@link mapboxgl.LngLatBounds}|{@link GeoJSONObject}。
  48400. */
  48401. _this.geometry = null;
  48402. /**
  48403. * @member {boolean} [QueryByDistanceParameters.prototype.isNearest=false]
  48404. * @description 是否为最近距离查询。<br>
  48405. * 建议该属性与 expectCount(继承自 {@link QueryParameters})属性联合使用。
  48406. * 当该属性为 true 时,即表示查找最近地物,如果查询结果数大于期望返回的结果记录数(expectCount),
  48407. * 则查找结果为查询总记录中距离中心最近的 expectCount 个地物。
  48408. * 当该属性为不为 true 时,如果查询结果数大于期望返回的结果记录数(expectCount),
  48409. * 则查找结果为从查询总记录中随机抽取的 expectCount 个地物。
  48410. * 目前查询结果不支持按远近距离排序。
  48411. */
  48412. _this.isNearest = null;
  48413. /**
  48414. * @member {boolean} [QueryByDistanceParameters.prototype.returnContent=true]
  48415. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  48416. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  48417. * 为 false,则返回的是查询结果资源的 URI。
  48418. */
  48419. _this.returnContent = true;
  48420. Util_Util.extend(QueryByDistanceParameters_assertThisInitialized(_this), options);
  48421. _this.CLASS_NAME = "SuperMap.QueryByDistanceParameters";
  48422. return _this;
  48423. }
  48424. /**
  48425. * @function QueryByDistanceParameters.prototype.destroy
  48426. * @description 释放资源,将引用资源的属性置空。
  48427. */
  48428. QueryByDistanceParameters_createClass(QueryByDistanceParameters, [{
  48429. key: "destroy",
  48430. value: function destroy() {
  48431. QueryByDistanceParameters_get(QueryByDistanceParameters_getPrototypeOf(QueryByDistanceParameters.prototype), "destroy", this).call(this);
  48432. var me = this;
  48433. me.returnContent = null;
  48434. me.distance = null;
  48435. me.isNearest = null;
  48436. if (me.geometry) {
  48437. me.geometry.destroy();
  48438. me.geometry = null;
  48439. }
  48440. }
  48441. }]);
  48442. return QueryByDistanceParameters;
  48443. }(QueryParameters);
  48444. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByDistanceService.js
  48445. function QueryByDistanceService_typeof(obj) { "@babel/helpers - typeof"; return QueryByDistanceService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, QueryByDistanceService_typeof(obj); }
  48446. function QueryByDistanceService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48447. function QueryByDistanceService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  48448. function QueryByDistanceService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByDistanceService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByDistanceService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  48449. function QueryByDistanceService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByDistanceService_get = Reflect.get.bind(); } else { QueryByDistanceService_get = function _get(target, property, receiver) { var base = QueryByDistanceService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return QueryByDistanceService_get.apply(this, arguments); }
  48450. function QueryByDistanceService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByDistanceService_getPrototypeOf(object); if (object === null) break; } return object; }
  48451. function QueryByDistanceService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) QueryByDistanceService_setPrototypeOf(subClass, superClass); }
  48452. function QueryByDistanceService_setPrototypeOf(o, p) { QueryByDistanceService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByDistanceService_setPrototypeOf(o, p); }
  48453. function QueryByDistanceService_createSuper(Derived) { var hasNativeReflectConstruct = QueryByDistanceService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = QueryByDistanceService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = QueryByDistanceService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return QueryByDistanceService_possibleConstructorReturn(this, result); }; }
  48454. function QueryByDistanceService_possibleConstructorReturn(self, call) { if (call && (QueryByDistanceService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return QueryByDistanceService_assertThisInitialized(self); }
  48455. function QueryByDistanceService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  48456. function QueryByDistanceService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  48457. function QueryByDistanceService_getPrototypeOf(o) { QueryByDistanceService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByDistanceService_getPrototypeOf(o); }
  48458. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  48459. * This program are made available under the terms of the Apache License, Version 2.0
  48460. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48461. /**
  48462. * @class QueryByDistanceService
  48463. * @deprecatedclass SuperMap.QueryByDistanceService
  48464. * @category iServer Map QueryResults
  48465. * @classdesc Distance查询服务类。
  48466. * @extends {QueryServiceBase}
  48467. * @example
  48468. * var myQueryByDistService = new QueryByDistanceService(url, {
  48469. * eventListeners: {
  48470. * "processCompleted": queryCompleted,
  48471. * "processFailed": queryError
  48472. * }
  48473. * });
  48474. * function queryCompleted(object){//todo};
  48475. * function queryError(object){//todo};
  48476. * @param {string} url - 服务地址。如访问World Map服务,只需将url设为:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  48477. * @param {Object} options - 参数。
  48478. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  48479. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  48480. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  48481. * @param {Object} [options.headers] - 请求头。
  48482. * @usage
  48483. */
  48484. var QueryByDistanceService = /*#__PURE__*/function (_QueryServiceBase) {
  48485. QueryByDistanceService_inherits(QueryByDistanceService, _QueryServiceBase);
  48486. var _super = QueryByDistanceService_createSuper(QueryByDistanceService);
  48487. function QueryByDistanceService(url, options) {
  48488. var _this;
  48489. QueryByDistanceService_classCallCheck(this, QueryByDistanceService);
  48490. _this = _super.call(this, url, options);
  48491. _this.CLASS_NAME = "SuperMap.QueryByDistanceService";
  48492. return _this;
  48493. }
  48494. /**
  48495. * @override
  48496. */
  48497. QueryByDistanceService_createClass(QueryByDistanceService, [{
  48498. key: "destroy",
  48499. value: function destroy() {
  48500. QueryByDistanceService_get(QueryByDistanceService_getPrototypeOf(QueryByDistanceService.prototype), "destroy", this).call(this);
  48501. }
  48502. /**
  48503. * @function QueryByDistanceService.prototype.getJsonParameters
  48504. * @description 将查询参数转化为 JSON 字符串。
  48505. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds等)。
  48506. * @param {QueryByDistanceParameters} params - Distance 查询参数类。
  48507. * @returns {Object} 转化后的 JSON 字符串。
  48508. */
  48509. }, {
  48510. key: "getJsonParameters",
  48511. value: function getJsonParameters(params) {
  48512. if (!(params instanceof QueryByDistanceParameters)) {
  48513. return;
  48514. }
  48515. var me = this,
  48516. jsonParameters = "",
  48517. qp = me.getQueryParameters(params);
  48518. var sg = ServerGeometry.fromGeometry(params.geometry);
  48519. jsonParameters += params.isNearest ? "'queryMode':'FindNearest','queryParameters':" : "'queryMode':'DistanceQuery','queryParameters':";
  48520. jsonParameters += Util_Util.toJSON(qp);
  48521. jsonParameters += ",'geometry':" + Util_Util.toJSON(sg) + ",'distance':" + params.distance;
  48522. jsonParameters = "{" + jsonParameters + "}";
  48523. return jsonParameters;
  48524. }
  48525. }]);
  48526. return QueryByDistanceService;
  48527. }(QueryServiceBase);
  48528. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByGeometryParameters.js
  48529. function QueryByGeometryParameters_typeof(obj) { "@babel/helpers - typeof"; return QueryByGeometryParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, QueryByGeometryParameters_typeof(obj); }
  48530. function QueryByGeometryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48531. function QueryByGeometryParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  48532. function QueryByGeometryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByGeometryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByGeometryParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  48533. function QueryByGeometryParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByGeometryParameters_get = Reflect.get.bind(); } else { QueryByGeometryParameters_get = function _get(target, property, receiver) { var base = QueryByGeometryParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return QueryByGeometryParameters_get.apply(this, arguments); }
  48534. function QueryByGeometryParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByGeometryParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  48535. function QueryByGeometryParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) QueryByGeometryParameters_setPrototypeOf(subClass, superClass); }
  48536. function QueryByGeometryParameters_setPrototypeOf(o, p) { QueryByGeometryParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByGeometryParameters_setPrototypeOf(o, p); }
  48537. function QueryByGeometryParameters_createSuper(Derived) { var hasNativeReflectConstruct = QueryByGeometryParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = QueryByGeometryParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = QueryByGeometryParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return QueryByGeometryParameters_possibleConstructorReturn(this, result); }; }
  48538. function QueryByGeometryParameters_possibleConstructorReturn(self, call) { if (call && (QueryByGeometryParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return QueryByGeometryParameters_assertThisInitialized(self); }
  48539. function QueryByGeometryParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  48540. function QueryByGeometryParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  48541. function QueryByGeometryParameters_getPrototypeOf(o) { QueryByGeometryParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByGeometryParameters_getPrototypeOf(o); }
  48542. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  48543. * This program are made available under the terms of the Apache License, Version 2.0
  48544. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48545. /**
  48546. * @class QueryByGeometryParameters
  48547. * @deprecatedclass SuperMap.QueryByGeometryParameters
  48548. * @category iServer Map QueryResults
  48549. * @classdesc Geometry 查询参数类。
  48550. * 该类用于设置 Geometry查询的相关参数。
  48551. * @extends {QueryParameters}
  48552. * @param {Object} options - 参数。
  48553. * @param {Array.<FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  48554. * @param {GeoJSONObject} options.geometry - 查询的几何对象。
  48555. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  48556. * @param {QueryOption} [options.queryOption=QueryOption.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  48557. * @param {Object} [options.prjCoordSys] -自定义参数,供SuperMap Online提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  48558. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  48559. * @param {GeometryType} [options.networkType=GeometryType.LINE] - 网络数据集对应的查询类型。
  48560. * @param {boolean} [options.returnCustomResult=false] -仅供三维使用。
  48561. * @param {number} [options.startRecord=0] - 查询起始记录号。
  48562. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  48563. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  48564. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  48565. * @param {SpatialQueryMode} [spatialQueryMode=SpatialQueryMode.INTERSECT] - 空间查询模式。
  48566. * @usage
  48567. */
  48568. var QueryByGeometryParameters = /*#__PURE__*/function (_QueryParameters) {
  48569. QueryByGeometryParameters_inherits(QueryByGeometryParameters, _QueryParameters);
  48570. var _super = QueryByGeometryParameters_createSuper(QueryByGeometryParameters);
  48571. function QueryByGeometryParameters(options) {
  48572. var _this;
  48573. QueryByGeometryParameters_classCallCheck(this, QueryByGeometryParameters);
  48574. options = options || {};
  48575. _this = _super.call(this, options);
  48576. /**
  48577. * @member {boolean} [QueryByGeometryParameters.prototype.returnContent=true]
  48578. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。<br>
  48579. * 如果为 true,则直接返回新创建资源,即查询结果的表述。<br>
  48580. * 为 false,则返回的是查询结果资源的 URI。
  48581. */
  48582. _this.returnContent = true;
  48583. /**
  48584. * @member {GeoJSONObject} QueryByGeometryParameters.prototype.geometry
  48585. * @description 用于查询的几何对象。<br>
  48586. * 点类型可以是:{@link GeometryPoint}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}|{@link mapboxgl.LngLat}|{@link mapboxgl.Point}|{@link GeoJSONObject}。<br>
  48587. * 线类型可以是:{@link GeometryLineString}|{@link GeometryLinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}|{@link GeoJSONObject}。<br>
  48588. * 面类型可以是:{@link GeometryPolygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}|{@link mapboxgl.LngLatBounds}|{@link GeoJSONObject}。
  48589. */
  48590. _this.geometry = null;
  48591. /**
  48592. * @member {SpatialQueryMode} [QueryByGeometryParameters.prototype.spatialQueryMode=SpatialQueryMode.INTERSECT]
  48593. * @description 空间查询模式。
  48594. */
  48595. _this.spatialQueryMode = SpatialQueryMode.INTERSECT;
  48596. Util_Util.extend(QueryByGeometryParameters_assertThisInitialized(_this), options);
  48597. _this.CLASS_NAME = "SuperMap.QueryByGeometryParameters";
  48598. return _this;
  48599. }
  48600. /**
  48601. * @function QueryByGeometryParameters.prototype.destroy
  48602. * @description 释放资源,将引用资源的属性置空。
  48603. */
  48604. QueryByGeometryParameters_createClass(QueryByGeometryParameters, [{
  48605. key: "destroy",
  48606. value: function destroy() {
  48607. QueryByGeometryParameters_get(QueryByGeometryParameters_getPrototypeOf(QueryByGeometryParameters.prototype), "destroy", this).call(this);
  48608. var me = this;
  48609. me.returnContent = null;
  48610. me.geometry = null;
  48611. me.spatialQueryMode = null;
  48612. }
  48613. }]);
  48614. return QueryByGeometryParameters;
  48615. }(QueryParameters);
  48616. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByGeometryService.js
  48617. function QueryByGeometryService_typeof(obj) { "@babel/helpers - typeof"; return QueryByGeometryService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, QueryByGeometryService_typeof(obj); }
  48618. function QueryByGeometryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48619. function QueryByGeometryService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  48620. function QueryByGeometryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByGeometryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByGeometryService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  48621. function QueryByGeometryService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByGeometryService_get = Reflect.get.bind(); } else { QueryByGeometryService_get = function _get(target, property, receiver) { var base = QueryByGeometryService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return QueryByGeometryService_get.apply(this, arguments); }
  48622. function QueryByGeometryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByGeometryService_getPrototypeOf(object); if (object === null) break; } return object; }
  48623. function QueryByGeometryService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) QueryByGeometryService_setPrototypeOf(subClass, superClass); }
  48624. function QueryByGeometryService_setPrototypeOf(o, p) { QueryByGeometryService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByGeometryService_setPrototypeOf(o, p); }
  48625. function QueryByGeometryService_createSuper(Derived) { var hasNativeReflectConstruct = QueryByGeometryService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = QueryByGeometryService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = QueryByGeometryService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return QueryByGeometryService_possibleConstructorReturn(this, result); }; }
  48626. function QueryByGeometryService_possibleConstructorReturn(self, call) { if (call && (QueryByGeometryService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return QueryByGeometryService_assertThisInitialized(self); }
  48627. function QueryByGeometryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  48628. function QueryByGeometryService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  48629. function QueryByGeometryService_getPrototypeOf(o) { QueryByGeometryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByGeometryService_getPrototypeOf(o); }
  48630. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  48631. * This program are made available under the terms of the Apache License, Version 2.0
  48632. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48633. /**
  48634. * @class QueryByGeometryService
  48635. * @deprecatedclass SuperMap.QueryByGeometryService
  48636. * @category iServer Map QueryResults
  48637. * @classdesc Geometry查询服务类。
  48638. * @extends {QueryServiceBase}
  48639. * @example
  48640. * var myQueryByGeometryService = new QueryByGeometryService(url, {
  48641. * eventListeners: {
  48642. * "processCompleted": queryCompleted,
  48643. * "processFailed": queryError
  48644. * }
  48645. * });
  48646. * function queryCompleted(object){//todo};
  48647. * function queryError(object){//todo};
  48648. * @param {string} url - 服务地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  48649. * @param {Object} options - 参数。
  48650. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  48651. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  48652. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  48653. * @param {Object} [options.headers] - 请求头。
  48654. * @usage
  48655. */
  48656. var QueryByGeometryService = /*#__PURE__*/function (_QueryServiceBase) {
  48657. QueryByGeometryService_inherits(QueryByGeometryService, _QueryServiceBase);
  48658. var _super = QueryByGeometryService_createSuper(QueryByGeometryService);
  48659. function QueryByGeometryService(url, options) {
  48660. var _this;
  48661. QueryByGeometryService_classCallCheck(this, QueryByGeometryService);
  48662. _this = _super.call(this, url, options);
  48663. _this.CLASS_NAME = "SuperMap.QueryByGeometryService";
  48664. return _this;
  48665. }
  48666. /**
  48667. * @override
  48668. */
  48669. QueryByGeometryService_createClass(QueryByGeometryService, [{
  48670. key: "destroy",
  48671. value: function destroy() {
  48672. QueryByGeometryService_get(QueryByGeometryService_getPrototypeOf(QueryByGeometryService.prototype), "destroy", this).call(this);
  48673. }
  48674. /**
  48675. * @function QueryByGeometryService.prototype.getJsonParameters
  48676. * @description 将查询参数转化为 JSON 字符串。
  48677. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds等)。
  48678. * @param {QueryByGeometryParameters} params - Geometry 查询参数类。
  48679. * @returns {Object} 转化后的 JSON 字符串。
  48680. */
  48681. }, {
  48682. key: "getJsonParameters",
  48683. value: function getJsonParameters(params) {
  48684. if (!(params instanceof QueryByGeometryParameters)) {
  48685. return;
  48686. }
  48687. var me = this,
  48688. jsonParameters = "",
  48689. qp = null,
  48690. geometry = params.geometry,
  48691. sg = ServerGeometry.fromGeometry(geometry);
  48692. qp = me.getQueryParameters(params);
  48693. jsonParameters += "'queryMode':'SpatialQuery','queryParameters':";
  48694. jsonParameters += Util_Util.toJSON(qp) + ",'geometry':" + Util_Util.toJSON(sg) + ",'spatialQueryMode':" + Util_Util.toJSON(params.spatialQueryMode);
  48695. jsonParameters = "{" + jsonParameters + "}";
  48696. return jsonParameters;
  48697. }
  48698. }]);
  48699. return QueryByGeometryService;
  48700. }(QueryServiceBase);
  48701. ;// CONCATENATED MODULE: ./src/common/iServer/QueryBySQLParameters.js
  48702. function QueryBySQLParameters_typeof(obj) { "@babel/helpers - typeof"; return QueryBySQLParameters_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, QueryBySQLParameters_typeof(obj); }
  48703. function QueryBySQLParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48704. function QueryBySQLParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  48705. function QueryBySQLParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryBySQLParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryBySQLParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  48706. function QueryBySQLParameters_get() { if (typeof Reflect !== "undefined" && Reflect.get) { QueryBySQLParameters_get = Reflect.get.bind(); } else { QueryBySQLParameters_get = function _get(target, property, receiver) { var base = QueryBySQLParameters_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return QueryBySQLParameters_get.apply(this, arguments); }
  48707. function QueryBySQLParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryBySQLParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  48708. function QueryBySQLParameters_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) QueryBySQLParameters_setPrototypeOf(subClass, superClass); }
  48709. function QueryBySQLParameters_setPrototypeOf(o, p) { QueryBySQLParameters_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryBySQLParameters_setPrototypeOf(o, p); }
  48710. function QueryBySQLParameters_createSuper(Derived) { var hasNativeReflectConstruct = QueryBySQLParameters_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = QueryBySQLParameters_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = QueryBySQLParameters_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return QueryBySQLParameters_possibleConstructorReturn(this, result); }; }
  48711. function QueryBySQLParameters_possibleConstructorReturn(self, call) { if (call && (QueryBySQLParameters_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return QueryBySQLParameters_assertThisInitialized(self); }
  48712. function QueryBySQLParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  48713. function QueryBySQLParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  48714. function QueryBySQLParameters_getPrototypeOf(o) { QueryBySQLParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryBySQLParameters_getPrototypeOf(o); }
  48715. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  48716. * This program are made available under the terms of the Apache License, Version 2.0
  48717. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48718. /**
  48719. * @class QueryBySQLParameters
  48720. * @deprecatedclass SuperMap.QueryBySQLParameters
  48721. * @category iServer Map QueryResults
  48722. * @classdesc SQL 查询参数类。
  48723. * 该类用于设置 SQL 查询的相关参数。
  48724. * @extends {QueryParameters}
  48725. * @param {Object} options - 参数。
  48726. * @param {Array.<FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  48727. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  48728. * @param {Object} [options.prjCoordSys] - 自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  48729. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  48730. * @param {GeometryType} [options.networkType=GeometryType.LINE] - 网络数据集对应的查询类型。
  48731. * @param {QueryOption} [options.queryOption=QueryOption.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  48732. * @param {number} [options.startRecord=0] - 查询起始记录号。
  48733. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  48734. * @param {boolean} [options.returnCustomResult=false] - 仅供三维使用。
  48735. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  48736. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  48737. * @usage
  48738. */
  48739. var QueryBySQLParameters = /*#__PURE__*/function (_QueryParameters) {
  48740. QueryBySQLParameters_inherits(QueryBySQLParameters, _QueryParameters);
  48741. var _super = QueryBySQLParameters_createSuper(QueryBySQLParameters);
  48742. function QueryBySQLParameters(options) {
  48743. var _this;
  48744. QueryBySQLParameters_classCallCheck(this, QueryBySQLParameters);
  48745. options = options || {};
  48746. _this = _super.call(this, options);
  48747. /**
  48748. * @member {boolean} [QueryBySQLParameters.prototype.returnContent=true]
  48749. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  48750. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  48751. * 为 false,则返回的是查询结果资源的 URI。
  48752. */
  48753. _this.returnContent = true;
  48754. Util_Util.extend(QueryBySQLParameters_assertThisInitialized(_this), options);
  48755. _this.CLASS_NAME = "SuperMap.QueryBySQLParameters";
  48756. return _this;
  48757. }
  48758. /**
  48759. * @function QueryBySQLParameters.prototype.destroy
  48760. * @description 释放资源,将引用资源的属性置空。
  48761. */
  48762. QueryBySQLParameters_createClass(QueryBySQLParameters, [{
  48763. key: "destroy",
  48764. value: function destroy() {
  48765. QueryBySQLParameters_get(QueryBySQLParameters_getPrototypeOf(QueryBySQLParameters.prototype), "destroy", this).call(this);
  48766. var me = this;
  48767. me.returnContent = null;
  48768. }
  48769. }]);
  48770. return QueryBySQLParameters;
  48771. }(QueryParameters);
  48772. ;// CONCATENATED MODULE: ./src/common/iServer/QueryBySQLService.js
  48773. function QueryBySQLService_typeof(obj) { "@babel/helpers - typeof"; return QueryBySQLService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, QueryBySQLService_typeof(obj); }
  48774. function QueryBySQLService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48775. function QueryBySQLService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  48776. function QueryBySQLService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryBySQLService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryBySQLService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  48777. function QueryBySQLService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { QueryBySQLService_get = Reflect.get.bind(); } else { QueryBySQLService_get = function _get(target, property, receiver) { var base = QueryBySQLService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return QueryBySQLService_get.apply(this, arguments); }
  48778. function QueryBySQLService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryBySQLService_getPrototypeOf(object); if (object === null) break; } return object; }
  48779. function QueryBySQLService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) QueryBySQLService_setPrototypeOf(subClass, superClass); }
  48780. function QueryBySQLService_setPrototypeOf(o, p) { QueryBySQLService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryBySQLService_setPrototypeOf(o, p); }
  48781. function QueryBySQLService_createSuper(Derived) { var hasNativeReflectConstruct = QueryBySQLService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = QueryBySQLService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = QueryBySQLService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return QueryBySQLService_possibleConstructorReturn(this, result); }; }
  48782. function QueryBySQLService_possibleConstructorReturn(self, call) { if (call && (QueryBySQLService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return QueryBySQLService_assertThisInitialized(self); }
  48783. function QueryBySQLService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  48784. function QueryBySQLService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  48785. function QueryBySQLService_getPrototypeOf(o) { QueryBySQLService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryBySQLService_getPrototypeOf(o); }
  48786. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  48787. * This program are made available under the terms of the Apache License, Version 2.0
  48788. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48789. /**
  48790. * @class QueryBySQLService
  48791. * @deprecatedclass SuperMap.QueryBySQLService
  48792. * @category iServer Map QueryResults
  48793. * @classdesc SQL 查询服务类。在一个或多个指定的图层上查询符合 SQL 条件的空间地物信息。
  48794. * @extends {QueryServiceBase}
  48795. * @example
  48796. * var queryParam = new FilterParameter({
  48797. * name: "Countries@World.1",
  48798. * attributeFilter: "Pop_1994>1000000000 and SmArea>900"
  48799. * });
  48800. * var queryBySQLParams = new QueryBySQLParameters({
  48801. * queryParams: [queryParam]
  48802. * });
  48803. * var myQueryBySQLService = new QueryBySQLService(url, {eventListeners: {
  48804. * "processCompleted": queryCompleted,
  48805. * "processFailed": queryError
  48806. * }
  48807. * });
  48808. * queryBySQLService.processAsync(queryBySQLParams);
  48809. * function queryCompleted(object){//todo};
  48810. * function queryError(object){//todo};
  48811. * @param {string} url - 服务地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  48812. * @param {Object} options - 参数。
  48813. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  48814. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  48815. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  48816. * @param {Object} [options.headers] - 请求头。
  48817. * @usage
  48818. */
  48819. var QueryBySQLService = /*#__PURE__*/function (_QueryServiceBase) {
  48820. QueryBySQLService_inherits(QueryBySQLService, _QueryServiceBase);
  48821. var _super = QueryBySQLService_createSuper(QueryBySQLService);
  48822. function QueryBySQLService(url, options) {
  48823. var _this;
  48824. QueryBySQLService_classCallCheck(this, QueryBySQLService);
  48825. _this = _super.call(this, url, options);
  48826. _this.CLASS_NAME = "SuperMap.QueryBySQLService";
  48827. return _this;
  48828. }
  48829. /**
  48830. * @override
  48831. */
  48832. QueryBySQLService_createClass(QueryBySQLService, [{
  48833. key: "destroy",
  48834. value: function destroy() {
  48835. QueryBySQLService_get(QueryBySQLService_getPrototypeOf(QueryBySQLService.prototype), "destroy", this).call(this);
  48836. }
  48837. /**
  48838. * @function QueryBySQLService.prototype.getJsonParameters
  48839. * @description 将查询参数转化为 JSON 字符串。
  48840. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds等)。
  48841. * @param {QueryBySQLParameters} params - SQL 查询参数类。
  48842. * @returns {Object} 转化后的 JSON 字符串。
  48843. */
  48844. }, {
  48845. key: "getJsonParameters",
  48846. value: function getJsonParameters(params) {
  48847. if (!(params instanceof QueryBySQLParameters)) {
  48848. return;
  48849. }
  48850. var me = this,
  48851. jsonParameters = "",
  48852. qp = null;
  48853. qp = me.getQueryParameters(params);
  48854. jsonParameters += "'queryMode':'SqlQuery','queryParameters':";
  48855. jsonParameters += Util_Util.toJSON(qp);
  48856. jsonParameters = "{" + jsonParameters + "}";
  48857. return jsonParameters;
  48858. }
  48859. }]);
  48860. return QueryBySQLService;
  48861. }(QueryServiceBase);
  48862. ;// CONCATENATED MODULE: ./src/common/iServer/QueryService.js
  48863. function QueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48864. function QueryService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  48865. function QueryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  48866. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  48867. * This program are made available under the terms of the Apache License, Version 2.0
  48868. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48869. /**
  48870. * @class QueryService
  48871. * @category iServer Map QueryResults
  48872. * @classdesc 地图查询服务类。
  48873. * 提供:范围查询,SQL 查询,几何查询,距离查询。
  48874. * @extends {ServiceBase}
  48875. * @param {string} url - 服务地址。
  48876. * @param {Object} options - 参数。
  48877. * @param {string} [options.proxy] - 服务代理地址。
  48878. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  48879. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  48880. * @param {Object} [options.headers] - 请求头。
  48881. * @example
  48882. * new QueryService(url)
  48883. * .queryByBounds(param,function(result){
  48884. * //doSomething
  48885. * })
  48886. * @usage
  48887. */
  48888. var QueryService_QueryService = /*#__PURE__*/function () {
  48889. function QueryService(url, options) {
  48890. QueryService_classCallCheck(this, QueryService);
  48891. this.options = options || {};
  48892. this.url = url;
  48893. }
  48894. /**
  48895. * @function QueryService.prototype.queryByBounds
  48896. * @description Bounds 查询地图服务。
  48897. * @param {QueryByBoundsParameters} params - Bounds 查询参数类。
  48898. * @param {RequestCallback} callback - 回调函数。
  48899. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  48900. */
  48901. QueryService_createClass(QueryService, [{
  48902. key: "queryByBounds",
  48903. value: function queryByBounds(params, callback, resultFormat) {
  48904. var me = this;
  48905. var queryService = new QueryByBoundsService(me.url, {
  48906. proxy: me.options.proxy,
  48907. withCredentials: me.options.withCredentials,
  48908. crossOrigin: me.options.crossOrigin,
  48909. headers: me.options.headers,
  48910. eventListeners: {
  48911. scope: me,
  48912. processCompleted: callback,
  48913. processFailed: callback
  48914. },
  48915. format: me._processFormat(resultFormat)
  48916. });
  48917. queryService.processAsync(params);
  48918. }
  48919. /**
  48920. * @function QueryService.prototype.queryByDistance
  48921. * @description 地图距离查询服务。
  48922. * @param {QueryByDistanceParameters} params - Distance 查询参数类。
  48923. * @param {RequestCallback} callback - 回调函数。
  48924. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型
  48925. */
  48926. }, {
  48927. key: "queryByDistance",
  48928. value: function queryByDistance(params, callback, resultFormat) {
  48929. var me = this;
  48930. var queryByDistanceService = new QueryByDistanceService(me.url, {
  48931. proxy: me.options.proxy,
  48932. withCredentials: me.options.withCredentials,
  48933. crossOrigin: me.options.crossOrigin,
  48934. headers: me.options.headers,
  48935. eventListeners: {
  48936. scope: me,
  48937. processCompleted: callback,
  48938. processFailed: callback
  48939. },
  48940. format: resultFormat
  48941. });
  48942. queryByDistanceService.processAsync(params);
  48943. }
  48944. /**
  48945. * @function QueryService.prototype.queryBySQL
  48946. * @description 地图 SQL 查询服务。
  48947. * @param {QueryBySQLParameters} params - SQL 查询参数类。
  48948. * @param {RequestCallback} callback - 回调函数。
  48949. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  48950. */
  48951. }, {
  48952. key: "queryBySQL",
  48953. value: function queryBySQL(params, callback, resultFormat) {
  48954. var me = this;
  48955. var queryBySQLService = new QueryBySQLService(me.url, {
  48956. proxy: me.options.proxy,
  48957. withCredentials: me.options.withCredentials,
  48958. crossOrigin: me.options.crossOrigin,
  48959. headers: me.options.headers,
  48960. eventListeners: {
  48961. scope: me,
  48962. processCompleted: callback,
  48963. processFailed: callback
  48964. },
  48965. format: resultFormat
  48966. });
  48967. queryBySQLService.processAsync(params);
  48968. }
  48969. /**
  48970. * @function QueryService.prototype.queryByGeometry
  48971. * @description 地图几何查询服务。
  48972. * @param {QueryByGeometryParameters} params - Geometry 查询参数类。
  48973. * @param {RequestCallback} callback - 回调函数。
  48974. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  48975. */
  48976. }, {
  48977. key: "queryByGeometry",
  48978. value: function queryByGeometry(params, callback, resultFormat) {
  48979. var me = this;
  48980. var queryByGeometryService = new QueryByGeometryService(me.url, {
  48981. proxy: me.options.proxy,
  48982. withCredentials: me.options.withCredentials,
  48983. crossOrigin: me.options.crossOrigin,
  48984. headers: me.options.headers,
  48985. eventListeners: {
  48986. scope: me,
  48987. processCompleted: callback,
  48988. processFailed: callback
  48989. },
  48990. format: resultFormat
  48991. });
  48992. queryByGeometryService.processAsync(params);
  48993. }
  48994. }, {
  48995. key: "_processFormat",
  48996. value: function _processFormat(resultFormat) {
  48997. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  48998. }
  48999. }]);
  49000. return QueryService;
  49001. }();
  49002. ;// CONCATENATED MODULE: ./src/common/iServer/RouteCalculateMeasureParameters.js
  49003. function RouteCalculateMeasureParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49004. function RouteCalculateMeasureParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  49005. function RouteCalculateMeasureParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteCalculateMeasureParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteCalculateMeasureParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  49006. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  49007. * This program are made available under the terms of the Apache License, Version 2.0
  49008. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49009. /**
  49010. * @class RouteCalculateMeasureParameters
  49011. * @deprecatedclass SuperMap.RouteCalculateMeasureParameters
  49012. * @category iServer SpatialAnalyst RouteCalculateMeasure
  49013. * @classdesc 基于路由对象计算指定点 M 值操作的参数类。通过该类提供参数信息。
  49014. * @param {Object} options - 参数。
  49015. * @param {(Route|L.Polyline|ol.geom.LineString|GeoJSONObject)} options.sourceRoute - 路由对象。该对象可以是用户自己生成或在数据源中查询得到的符合标准的路由对象。
  49016. * @param {GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>} options.point - 二维地理坐标点对象,包含 x,y 坐标值属性的对象。
  49017. * @param {number} [options.tolerance] - 容限值。
  49018. * @param {boolean} [options.isIgnoreGap=false] - 是否忽略子对象之间的距离。
  49019. * @usage
  49020. */
  49021. var RouteCalculateMeasureParameters = /*#__PURE__*/function () {
  49022. function RouteCalculateMeasureParameters(options) {
  49023. RouteCalculateMeasureParameters_classCallCheck(this, RouteCalculateMeasureParameters);
  49024. if (!options) {
  49025. return this;
  49026. }
  49027. /**
  49028. * @member {(Route|L.Polyline|ol.geom.LineString|GeoJSONObject)} RouteCalculateMeasureParameters.prototype.sourceRoute
  49029. * @description 路由对象。该对象可以是用户自己生成或在数据源中查询得到的符合标准的路由对象。
  49030. */
  49031. this.sourceRoute = null;
  49032. /**
  49033. * @member {GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>} RouteCalculateMeasureParameters.prototype.point
  49034. * @description 二维地理坐标点对象,包含 x,y 坐标值属性的对象。
  49035. */
  49036. this.point = null;
  49037. /**
  49038. * @member {number} [RouteCalculateMeasureParameters.prototype.tolerance]
  49039. * @description 容限值。
  49040. */
  49041. this.tolerance = null;
  49042. /**
  49043. * @member {boolean} [RouteCalculateMeasureParameters.prototype.isIgnoreGap=false]
  49044. * @description 是否忽略子对象之间的距离。
  49045. */
  49046. this.isIgnoreGap = false;
  49047. Util_Util.extend(this, options);
  49048. this.CLASS_NAME = "SuperMap.RouteCalculateMeasureParameters";
  49049. }
  49050. /**
  49051. * @function RouteCalculateMeasureParameters.prototype.destroy
  49052. * @description 释放资源,将引用资源的属性置空。
  49053. */
  49054. RouteCalculateMeasureParameters_createClass(RouteCalculateMeasureParameters, [{
  49055. key: "destroy",
  49056. value: function destroy() {
  49057. var me = this;
  49058. me.sourceRoute = null;
  49059. me.point = null;
  49060. if (me.tolerance) {
  49061. me.tolerance = null;
  49062. }
  49063. if (me.isIgnoreGap) {
  49064. me.isIgnoreGap = false;
  49065. }
  49066. }
  49067. }]);
  49068. return RouteCalculateMeasureParameters;
  49069. }();
  49070. ;// CONCATENATED MODULE: ./src/common/iServer/RouteCalculateMeasureService.js
  49071. function RouteCalculateMeasureService_typeof(obj) { "@babel/helpers - typeof"; return RouteCalculateMeasureService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, RouteCalculateMeasureService_typeof(obj); }
  49072. function RouteCalculateMeasureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49073. function RouteCalculateMeasureService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  49074. function RouteCalculateMeasureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteCalculateMeasureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteCalculateMeasureService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  49075. function RouteCalculateMeasureService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { RouteCalculateMeasureService_get = Reflect.get.bind(); } else { RouteCalculateMeasureService_get = function _get(target, property, receiver) { var base = RouteCalculateMeasureService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return RouteCalculateMeasureService_get.apply(this, arguments); }
  49076. function RouteCalculateMeasureService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = RouteCalculateMeasureService_getPrototypeOf(object); if (object === null) break; } return object; }
  49077. function RouteCalculateMeasureService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) RouteCalculateMeasureService_setPrototypeOf(subClass, superClass); }
  49078. function RouteCalculateMeasureService_setPrototypeOf(o, p) { RouteCalculateMeasureService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RouteCalculateMeasureService_setPrototypeOf(o, p); }
  49079. function RouteCalculateMeasureService_createSuper(Derived) { var hasNativeReflectConstruct = RouteCalculateMeasureService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = RouteCalculateMeasureService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = RouteCalculateMeasureService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return RouteCalculateMeasureService_possibleConstructorReturn(this, result); }; }
  49080. function RouteCalculateMeasureService_possibleConstructorReturn(self, call) { if (call && (RouteCalculateMeasureService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return RouteCalculateMeasureService_assertThisInitialized(self); }
  49081. function RouteCalculateMeasureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  49082. function RouteCalculateMeasureService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  49083. function RouteCalculateMeasureService_getPrototypeOf(o) { RouteCalculateMeasureService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RouteCalculateMeasureService_getPrototypeOf(o); }
  49084. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  49085. * This program are made available under the terms of the Apache License, Version 2.0
  49086. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49087. /**
  49088. * @class RouteCalculateMeasureService
  49089. * @deprecatedclass SuperMap.RouteCalculateMeasureService
  49090. * @category iServer SpatialAnalyst RouteCalculateMeasure
  49091. * @classdesc 基于路由对象计算指定点 M 值操作的服务类。
  49092. * 该类负责将客户设置的计算指定点的 M 值参数传递给服务端,并接收服务端返回的
  49093. * 指定点的 M 值。通过该类支持的事件的监听函数参数获取。
  49094. * @extends {SpatialAnalystBase}
  49095. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst
  49096. * @param {Object} options - 参数。
  49097. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  49098. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  49099. * @param {Object} [options.headers] - 请求头。
  49100. * @example 实例化该类如下例所示:
  49101. * (start code)
  49102. * var parameters = new RouteCalculateMeasureParameters({
  49103. * "sourceRoute":{
  49104. * "type":"LINEM",
  49105. * "parts":[4],
  49106. * "points":[
  49107. * {
  49108. * "measure":0,
  49109. * "y":-6674.466867067764,
  49110. * "x":3817.3527876130133
  49111. * },
  49112. * {
  49113. * "measure":199.57954019411724,
  49114. * "y":-6670.830929417594,
  49115. * "x":3617.806369901496
  49116. * },
  49117. * {
  49118. * "measure":609.3656478634477,
  49119. * "y":-6877.837541432356,
  49120. * "x":3264.1498746678444
  49121. * },
  49122. * {
  49123. * "measure":936.0174126282958,
  49124. * "y":-7038.687780615184,
  49125. * "x":2979.846206068903
  49126. * }
  49127. * ]
  49128. * },
  49129. * "tolerance":1,
  49130. * "point":{
  49131. * "x":3330.7754269417,
  49132. * "y":-6838.8394457216
  49133. * },
  49134. * "isIgnoreGap":false
  49135. * });
  49136. *
  49137. * var routeCalculateMeasureService = new RouteCalculateMeasureService(spatialAnalystURL, {
  49138. * eventListeners:{
  49139. * processCompleted:calculateCompleted,
  49140. * processFailed:calculateFailded
  49141. * }
  49142. * );
  49143. * routeCalculateMeasureService.processAsync(parameters);
  49144. *
  49145. * //执行
  49146. * function calculateCompleted(){todo}
  49147. * function calculateFailded(){todo}
  49148. * (end)
  49149. * @usage
  49150. */
  49151. var RouteCalculateMeasureService = /*#__PURE__*/function (_SpatialAnalystBase) {
  49152. RouteCalculateMeasureService_inherits(RouteCalculateMeasureService, _SpatialAnalystBase);
  49153. var _super = RouteCalculateMeasureService_createSuper(RouteCalculateMeasureService);
  49154. function RouteCalculateMeasureService(url, options) {
  49155. var _this;
  49156. RouteCalculateMeasureService_classCallCheck(this, RouteCalculateMeasureService);
  49157. _this = _super.call(this, url, options);
  49158. _this.CLASS_NAME = "SuperMap.RouteCalculateMeasureService";
  49159. return _this;
  49160. }
  49161. /**
  49162. * @override
  49163. */
  49164. RouteCalculateMeasureService_createClass(RouteCalculateMeasureService, [{
  49165. key: "destroy",
  49166. value: function destroy() {
  49167. RouteCalculateMeasureService_get(RouteCalculateMeasureService_getPrototypeOf(RouteCalculateMeasureService.prototype), "destroy", this).call(this);
  49168. }
  49169. /**
  49170. * @function RouteCalculateMeasureService.prototype.processAsync
  49171. * @description 负责将客户端的基于路由对象计算指定点 M 值操作的参数传递到服务端。
  49172. * @param {RouteCalculateMeasureParameters} params - 基于路由对象计算指定点 M 值操作的参数类。
  49173. */
  49174. }, {
  49175. key: "processAsync",
  49176. value: function processAsync(params) {
  49177. if (!(params instanceof RouteCalculateMeasureParameters)) {
  49178. return;
  49179. }
  49180. var me = this,
  49181. jsonParameters;
  49182. jsonParameters = me.getJsonParameters(params);
  49183. me.request({
  49184. method: "POST",
  49185. data: jsonParameters,
  49186. scope: me,
  49187. success: me.serviceProcessCompleted,
  49188. failure: me.serviceProcessFailed
  49189. });
  49190. }
  49191. /**
  49192. * @function RouteCalculateMeasureService.prototype.getJsonParameters
  49193. * @description 将参数转化为 JSON 字符串。
  49194. * @param {RouteCalculateMeasureParameters} params - 基于路由对象计算指定点 M 值操作的参数类。
  49195. * @returns {Object} 转化后的 JSON 字符串。
  49196. */
  49197. }, {
  49198. key: "getJsonParameters",
  49199. value: function getJsonParameters(params) {
  49200. var jsonParameters,
  49201. jsonStr = "geometry/calculatemeasure",
  49202. me = this;
  49203. me.url = Util_Util.urlPathAppend(me.url, jsonStr);
  49204. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  49205. jsonParameters = Util_Util.toJSON(params);
  49206. return jsonParameters;
  49207. }
  49208. }]);
  49209. return RouteCalculateMeasureService;
  49210. }(SpatialAnalystBase);
  49211. ;// CONCATENATED MODULE: ./src/common/iServer/RouteLocatorParameters.js
  49212. function RouteLocatorParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49213. function RouteLocatorParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  49214. function RouteLocatorParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteLocatorParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteLocatorParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  49215. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  49216. * This program are made available under the terms of the Apache License, Version 2.0
  49217. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49218. /**
  49219. * @class RouteLocatorParameters
  49220. * @deprecatedclass SuperMap.RouteLocatorParameters
  49221. * @category iServer SpatialAnalyst RouteLocator
  49222. * @classdesc 路由对象定位空间对象的参数类。
  49223. * 参数有两种方式,分别为 Geometry 和 Dataset 两种,前者需要指定 sourceRoute 对象作为参数,后者需要 dataset,routeIDField,routeID 三个参数。如果用户两种参数均设置,优先选择 Dataset 方式。
  49224. * @param {Object} options - 参数。
  49225. * @param {(Route|L.Polyline|ol.geom.LineString|GeoJSONObject)} options.sourceRoute - 路由对象。
  49226. * @param {number} options.measure - 定位点的 M 值。只当路由对象定位点时有意义。
  49227. * @param {string} [options.type] - 类型:点 or 线。
  49228. * @param {number} [options.offset=0] - 定位点偏移量。只当路由对象定位点时有意义。
  49229. * @param {boolean} [options.isIgnoreGap=false] - 是否忽略子对象之间的距离。即不忽略子对象之间的距离。
  49230. * @param {number} [options.startMeasure] - 定位线的起始 M 值。只当路由对象定位线时有意义。
  49231. * @param {number} [options.endMeasure] - 定位线的终止 M 值。只当路由对象定位线时有意义。
  49232. * @usage
  49233. */
  49234. var RouteLocatorParameters = /*#__PURE__*/function () {
  49235. function RouteLocatorParameters(options) {
  49236. RouteLocatorParameters_classCallCheck(this, RouteLocatorParameters);
  49237. if (!options) {
  49238. return this;
  49239. }
  49240. /**
  49241. * @member {(Route|L.Polyline|ol.geom.LineString|GeoJSONObject)} RouteLocatorParameters.prototype.sourceRoute
  49242. * @description 路由对象。
  49243. */
  49244. this.sourceRoute = null;
  49245. /**
  49246. * @member {string} RouteLocatorParameters.prototype.dataset
  49247. * @description 要用来做缓冲区分析的数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示。
  49248. */
  49249. this.dataset = null;
  49250. /**
  49251. * @member {string} RouteLocatorParameters.prototype.routeIDField
  49252. * @description 路由对象所在的字段名称。
  49253. *
  49254. */
  49255. this.routeIDField = null;
  49256. /**
  49257. * @member {number} RouteLocatorParameters.prototype.routeID
  49258. * @description 路由对象标识。
  49259. *
  49260. */
  49261. this.routeID = null;
  49262. /**
  49263. * @member {string} [RouteLocatorParameters.prototype.type]
  49264. * @description 类型:点 or 线。
  49265. * 可选值为:
  49266. * LINE :根据起始 M 值及终止 M 值定位线对象。
  49267. * POINT : 根据 M 值定位点对象。
  49268. */
  49269. this.type = null;
  49270. /**
  49271. * @member {number} RouteLocatorParameters.prototype.measure
  49272. * @description 定位点的 M 值。只当路由对象定位点时有意义。
  49273. */
  49274. this.measure = null;
  49275. /**
  49276. * @member {number} [RouteLocatorParameters.prototype.offset=0]
  49277. * @description 定位点偏移量。只当路由对象定位点时有意义。
  49278. */
  49279. this.offset = 0;
  49280. /**
  49281. * @member {boolean} [RouteLocatorParameters.prototype.isIgnoreGap=false]
  49282. * @description 是否忽略子对象之间的距离。
  49283. */
  49284. this.isIgnoreGap = false;
  49285. /**
  49286. * @member {number} [RouteLocatorParameters.prototype.startMeasure]
  49287. * @description 定位线的起始 M 值。只当路由对象定位线时有意义。
  49288. */
  49289. this.startMeasure = null;
  49290. /**
  49291. * @member {number} [RouteLocatorParameters.prototype.endMeasure]
  49292. * @description 定位线的终止 M 值。只当路由对象定位线时有意义。
  49293. */
  49294. this.endMeasure = null;
  49295. var routeFromClient = options.sourceRoute;
  49296. var routeHandle = {};
  49297. if (routeFromClient && routeFromClient instanceof Geometry_Geometry && routeFromClient.components) {
  49298. routeHandle.type = routeFromClient.type;
  49299. routeHandle.parts = routeFromClient.parts;
  49300. var parts = [];
  49301. for (var i = 0, len = routeFromClient.components.length; i < len; i++) {
  49302. parts = parts.concat(routeFromClient.components[i].components);
  49303. }
  49304. routeHandle.points = parts;
  49305. options.sourceRoute = routeHandle;
  49306. }
  49307. Util_Util.extend(this, options);
  49308. this.CLASS_NAME = "SuperMap.RouteLocatorParameters";
  49309. }
  49310. /**
  49311. * @function RouteLocatorParameters.prototype.destroy
  49312. * @description 释放资源,将引用资源的属性置空。
  49313. */
  49314. RouteLocatorParameters_createClass(RouteLocatorParameters, [{
  49315. key: "destroy",
  49316. value: function destroy() {
  49317. var me = this;
  49318. me.sourceRoute = null;
  49319. me.type = null;
  49320. me.measure = null;
  49321. me.offset = 0;
  49322. me.isIgnoreGap = false;
  49323. me.startMeasure = null;
  49324. me.endMeasure = null;
  49325. me.dataset = null;
  49326. me.routeID = null;
  49327. me.routeIDField = null;
  49328. }
  49329. }]);
  49330. return RouteLocatorParameters;
  49331. }();
  49332. ;// CONCATENATED MODULE: ./src/common/iServer/RouteLocatorService.js
  49333. function RouteLocatorService_typeof(obj) { "@babel/helpers - typeof"; return RouteLocatorService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, RouteLocatorService_typeof(obj); }
  49334. function RouteLocatorService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49335. function RouteLocatorService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  49336. function RouteLocatorService_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteLocatorService_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteLocatorService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  49337. function RouteLocatorService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { RouteLocatorService_get = Reflect.get.bind(); } else { RouteLocatorService_get = function _get(target, property, receiver) { var base = RouteLocatorService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return RouteLocatorService_get.apply(this, arguments); }
  49338. function RouteLocatorService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = RouteLocatorService_getPrototypeOf(object); if (object === null) break; } return object; }
  49339. function RouteLocatorService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) RouteLocatorService_setPrototypeOf(subClass, superClass); }
  49340. function RouteLocatorService_setPrototypeOf(o, p) { RouteLocatorService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RouteLocatorService_setPrototypeOf(o, p); }
  49341. function RouteLocatorService_createSuper(Derived) { var hasNativeReflectConstruct = RouteLocatorService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = RouteLocatorService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = RouteLocatorService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return RouteLocatorService_possibleConstructorReturn(this, result); }; }
  49342. function RouteLocatorService_possibleConstructorReturn(self, call) { if (call && (RouteLocatorService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return RouteLocatorService_assertThisInitialized(self); }
  49343. function RouteLocatorService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  49344. function RouteLocatorService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  49345. function RouteLocatorService_getPrototypeOf(o) { RouteLocatorService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RouteLocatorService_getPrototypeOf(o); }
  49346. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  49347. * This program are made available under the terms of the Apache License, Version 2.0
  49348. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49349. /**
  49350. * @class RouteLocatorService
  49351. * @deprecatedclass SuperMap.RouteLocatorService
  49352. * @category iServer SpatialAnalyst RouteLocator
  49353. * @classdesc 路由对象定位空间对象的服务类。
  49354. * @extends {SpatialAnalystBase}
  49355. * @param {string} url -服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  49356. * @param {Object} options - 参数。
  49357. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  49358. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  49359. * @param {Object} [options.headers] - 请求头。
  49360. * @example 实例化该类如下例所示:
  49361. * (start code)
  49362. * var routeLocatorParameters_point = new RouteLocatorParameters({
  49363. * "sourceRoute":{
  49364. * "type":"LINEM",
  49365. * "parts":[4],
  49366. * "points":[
  49367. * {
  49368. * "measure":0,
  49369. * "y":-6674.466867067764,
  49370. * "x":3817.3527876130133
  49371. * },
  49372. * {
  49373. * "measure":199.57954019411724,
  49374. * "y":-6670.830929417594,
  49375. * "x":3617.806369901496
  49376. * },
  49377. * {
  49378. * "measure":609.3656478634477,
  49379. * "y":-6877.837541432356,
  49380. * "x":3264.1498746678444
  49381. * },
  49382. * {
  49383. * "measure":936.0174126282958,
  49384. * "y":-7038.687780615184,
  49385. * "x":2979.846206068903
  49386. * }
  49387. * ]
  49388. * },
  49389. * "type":"POINT",
  49390. * "measure":10,
  49391. * "offset":3,
  49392. * "isIgnoreGap":true
  49393. * });
  49394. * var routeLocatorService = new RouteLocatorService(spatialAnalystURL, {
  49395. * eventListeners:{
  49396. * processCompleted:routeLocatorCompleted,
  49397. * processFailed:routeLocatorFailded
  49398. * }
  49399. * );
  49400. * routeLocatorService.processAsync(routeLocatorParameters_point);
  49401. *
  49402. * //执行
  49403. * function routeLocatorCompleted(){todo}
  49404. * function routeLocatorFailded(){todo}
  49405. * (end)
  49406. * @usage
  49407. */
  49408. var RouteLocatorService = /*#__PURE__*/function (_SpatialAnalystBase) {
  49409. RouteLocatorService_inherits(RouteLocatorService, _SpatialAnalystBase);
  49410. var _super = RouteLocatorService_createSuper(RouteLocatorService);
  49411. function RouteLocatorService(url, options) {
  49412. var _this;
  49413. RouteLocatorService_classCallCheck(this, RouteLocatorService);
  49414. _this = _super.call(this, url, options);
  49415. _this.CLASS_NAME = "SuperMap.RouteLocatorService";
  49416. return _this;
  49417. }
  49418. /**
  49419. * @override
  49420. */
  49421. RouteLocatorService_createClass(RouteLocatorService, [{
  49422. key: "destroy",
  49423. value: function destroy() {
  49424. RouteLocatorService_get(RouteLocatorService_getPrototypeOf(RouteLocatorService.prototype), "destroy", this).call(this);
  49425. }
  49426. /**
  49427. * @function RouteLocatorService.prototype.processAsync
  49428. * @description 负责将客户端的基于路由对象计算指定点 M 值操作的参数传递到服务端。
  49429. * @param {RouteLocatorParameters} params - 路由对象定位空间对象的参数类。
  49430. */
  49431. }, {
  49432. key: "processAsync",
  49433. value: function processAsync(params) {
  49434. if (!(params instanceof RouteLocatorParameters)) {
  49435. return;
  49436. }
  49437. var me = this,
  49438. jsonParameters;
  49439. jsonParameters = me.getJsonParameters(params);
  49440. me.request({
  49441. method: "POST",
  49442. data: jsonParameters,
  49443. scope: me,
  49444. success: me.serviceProcessCompleted,
  49445. failure: me.serviceProcessFailed
  49446. });
  49447. }
  49448. /**
  49449. * @function RouteLocatorService.prototype.processAsync
  49450. * @description 将参数转化为 JSON 字符串。
  49451. * @param {RouteLocatorParameters} params - 路由对象定位空间对象的参数类。
  49452. * @returns {Object} 转化后的JSON字符串。
  49453. */
  49454. }, {
  49455. key: "getJsonParameters",
  49456. value: function getJsonParameters(params) {
  49457. var jsonParameters,
  49458. jsonStr = "geometry/routelocator",
  49459. me = this;
  49460. if (params.dataset) {
  49461. jsonStr = "datasets/" + params.dataset + "/linearreferencing/routelocator";
  49462. params.sourceRoute = null;
  49463. }
  49464. me.url = Util_Util.urlPathAppend(me.url, jsonStr);
  49465. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  49466. jsonParameters = Util_Util.toJSON(params);
  49467. return jsonParameters;
  49468. }
  49469. }]);
  49470. return RouteLocatorService;
  49471. }(SpatialAnalystBase);
  49472. ;// CONCATENATED MODULE: ./src/common/iServer/ServerFeature.js
  49473. function ServerFeature_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49474. function ServerFeature_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  49475. function ServerFeature_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerFeature_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerFeature_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  49476. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  49477. * This program are made available under the terms of the Apache License, Version 2.0
  49478. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49479. /**
  49480. * @class ServerFeature
  49481. * @deprecatedclass SuperMap.ServerFeature
  49482. * @category iServer Data Feature
  49483. * @classdesc 服务端矢量要素类。该类描述了服务端返回的矢量要素的相关信息,包括字段和几何信息。
  49484. * @param {ServerGeometry} geometry - 矢量要素的几何信息。
  49485. * @param {Object} options - 参数。
  49486. * @param {Array.<string>} [options.fieldNames] - 矢量要素的属性字段名集合。
  49487. * @param {Array.<string>} [options.fieldValues] - 矢量要素的属性字段值集合。
  49488. * @usage
  49489. */
  49490. var ServerFeature = /*#__PURE__*/function () {
  49491. function ServerFeature(options) {
  49492. ServerFeature_classCallCheck(this, ServerFeature);
  49493. /**
  49494. * @member {Array.<string>} [ServerFeature.prototype.fieldNames]
  49495. * @description 矢量要素的属性字段名集合。
  49496. */
  49497. this.fieldNames = null;
  49498. /**
  49499. * @member {Array.<string>} [ServerFeature.prototype.fieldValues]
  49500. * @description 矢量要素的属性字段值集合。
  49501. */
  49502. this.fieldValues = null;
  49503. /**
  49504. * @member {ServerGeometry} ServerFeature.prototype.geometry
  49505. * @description 矢量要素的几何信息。
  49506. */
  49507. this.geometry = null;
  49508. if (options) {
  49509. Util_Util.extend(this, options);
  49510. }
  49511. this.CLASS_NAME = "SuperMap.ServerFeature";
  49512. }
  49513. /**
  49514. * @function ServerFeature.prototype.destroy
  49515. * @description 释放资源,将引用资源的属性置空。
  49516. */
  49517. ServerFeature_createClass(ServerFeature, [{
  49518. key: "destroy",
  49519. value: function destroy() {
  49520. var me = this;
  49521. me.fieldNames = null;
  49522. me.fieldValues = null;
  49523. if (me.geometry) {
  49524. me.geometry.destroy();
  49525. me.geometry = null;
  49526. }
  49527. }
  49528. /**
  49529. * @function ServerFeature.prototype.toFeature
  49530. * @description 将服务端矢量要素 ServerFeature 转换为客户端矢量要素 Feature。
  49531. * @returns {Vector} 转换后的客户端矢量要素。
  49532. */
  49533. }, {
  49534. key: "toFeature",
  49535. value: function toFeature() {
  49536. var names,
  49537. values,
  49538. geo,
  49539. attr = {},
  49540. me = this,
  49541. feature;
  49542. names = me.fieldNames;
  49543. values = me.fieldValues;
  49544. for (var i in names) {
  49545. attr[names[i]] = values[i];
  49546. }
  49547. if (me.geometry) {
  49548. geo = me.geometry.toGeometry();
  49549. }
  49550. feature = new Vector(geo, attr);
  49551. if (me.geometry && me.geometry.id) {
  49552. feature.fid = me.geometry.id;
  49553. }
  49554. return feature;
  49555. }
  49556. /**
  49557. * @function ServerFeature.prototype.fromJson
  49558. * @description 将 JSON 对象表示服务端矢量要素转换为 ServerFeature。
  49559. * @param {Object} jsonObject - 要转换的 JSON 对象。
  49560. * @returns {ServerFeature} 转化后的 ServerFeature 对象。
  49561. */
  49562. }], [{
  49563. key: "fromJson",
  49564. value: function fromJson(jsonObject) {
  49565. var geo = null;
  49566. if (!jsonObject) {
  49567. return;
  49568. }
  49569. geo = jsonObject.geometry;
  49570. if (geo) {
  49571. geo = ServerGeometry.fromJson(geo);
  49572. }
  49573. return new ServerFeature({
  49574. fieldNames: jsonObject.fieldNames,
  49575. fieldValues: jsonObject.fieldValues,
  49576. geometry: geo
  49577. });
  49578. }
  49579. }]);
  49580. return ServerFeature;
  49581. }();
  49582. ;// CONCATENATED MODULE: ./src/common/iServer/SetDatasourceParameters.js
  49583. function SetDatasourceParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49584. function SetDatasourceParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  49585. function SetDatasourceParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetDatasourceParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetDatasourceParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  49586. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  49587. * This program are made available under the terms of the Apache License, Version 2.0
  49588. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49589. /**
  49590. * @class SetDatasourceParameters
  49591. * @deprecatedclass SuperMap.SetDatasourceParameters
  49592. * @category iServer Data Datasource
  49593. * @classdesc 设置数据源信息参数类。
  49594. * @param {Object} options - 参数。
  49595. * @param {string} options.datasourceName - 数据源名称。
  49596. * @param {string} options.description - 数据源描述信息。
  49597. * @param {string} options.coordUnit - 坐标单位。
  49598. * @param {string} options.distanceUnit - 距离单位。
  49599. * @usage
  49600. */
  49601. var SetDatasourceParameters = /*#__PURE__*/function () {
  49602. function SetDatasourceParameters(options) {
  49603. SetDatasourceParameters_classCallCheck(this, SetDatasourceParameters);
  49604. if (!options) {
  49605. return;
  49606. }
  49607. /**
  49608. * @member {string} SetDatasourceParameters.prototype.datasourceName
  49609. * @description 数据源名称。
  49610. */
  49611. this.datasourceName = null;
  49612. /**
  49613. * @member {string} SetDatasourceParameters.prototype.description
  49614. * @description 数据源描述信息。
  49615. */
  49616. this.description = null;
  49617. /**
  49618. * @member {string} SetDatasourceParameters.prototype.coordUnit
  49619. * @description 坐标单位。
  49620. */
  49621. this.coordUnit = null;
  49622. /**
  49623. * @member {string} SetDatasourceParameters.prototype.distanceUnit
  49624. * @description 距离单位。
  49625. */
  49626. this.distanceUnit = null;
  49627. if (options) {
  49628. Util_Util.extend(this, options);
  49629. }
  49630. this.CLASS_NAME = "SuperMap.SetDatasourceParameters";
  49631. }
  49632. /**
  49633. * @function SetDatasourceParameters.prototype.destroy
  49634. * @description 释放资源,将引用资源的属性置空。
  49635. */
  49636. SetDatasourceParameters_createClass(SetDatasourceParameters, [{
  49637. key: "destroy",
  49638. value: function destroy() {
  49639. var me = this;
  49640. me.datasourceName = null;
  49641. me.description = null;
  49642. me.coordUnit = null;
  49643. me.distanceUnit = null;
  49644. }
  49645. }]);
  49646. return SetDatasourceParameters;
  49647. }();
  49648. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerInfoParameters.js
  49649. function SetLayerInfoParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49650. function SetLayerInfoParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  49651. function SetLayerInfoParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerInfoParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerInfoParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  49652. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  49653. * This program are made available under the terms of the Apache License, Version 2.0
  49654. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49655. /**
  49656. * @class SetLayerInfoParameters
  49657. * @deprecatedclass SuperMap.SetLayerInfoParameters
  49658. * @category iServer Map TempLayersSet
  49659. * @classdesc 设置图层信息参数类。
  49660. * @param {Object} options - 参数。
  49661. * @param {string} options.resourceID - 临时图层的资源 ID。
  49662. * @param {string} options.tempLayerName - 临时图层下的子图层名。
  49663. * @param {string} options.layerInfo - 要更新的图层信息。
  49664. * @usage
  49665. */
  49666. var SetLayerInfoParameters = /*#__PURE__*/function () {
  49667. function SetLayerInfoParameters(options) {
  49668. SetLayerInfoParameters_classCallCheck(this, SetLayerInfoParameters);
  49669. options = options || {};
  49670. /**
  49671. * @member {string} SetLayerInfoParameters.prototype.resourceID
  49672. * @description 临时图层的资源 ID。
  49673. */
  49674. this.resourceID = null;
  49675. /**
  49676. * @member {string} SetLayerInfoParameters.prototype.tempLayerName
  49677. * @description 临时图层下子图层(或者其子图层)名,如:Countries@World.3@@World。
  49678. */
  49679. this.tempLayerName = null;
  49680. /**
  49681. * @member {Object} SetLayerInfoParameters.prototype.layerInfo
  49682. * @description 要更新的图层信息(包含修改和未修改的所有字段)。该参数可以通过图层信息服务获取,然后对返回值中 subLayers.layers[i] 图层信息属性进行修改。
  49683. */
  49684. this.layerInfo = null;
  49685. Util_Util.extend(this, options);
  49686. this.CLASS_NAME = "SuperMap.SetLayerInfoParameters";
  49687. }
  49688. /**
  49689. * @function SetLayerInfoParameters.prototype.destroy
  49690. * @description 释放资源,将引用资源的属性置空。
  49691. */
  49692. SetLayerInfoParameters_createClass(SetLayerInfoParameters, [{
  49693. key: "destroy",
  49694. value: function destroy() {
  49695. var me = this;
  49696. me.resourceID = null;
  49697. me.tempLayerName = null;
  49698. me.layerInfo = null;
  49699. }
  49700. }]);
  49701. return SetLayerInfoParameters;
  49702. }();
  49703. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerInfoService.js
  49704. function SetLayerInfoService_typeof(obj) { "@babel/helpers - typeof"; return SetLayerInfoService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SetLayerInfoService_typeof(obj); }
  49705. function SetLayerInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49706. function SetLayerInfoService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  49707. function SetLayerInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerInfoService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  49708. function SetLayerInfoService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SetLayerInfoService_get = Reflect.get.bind(); } else { SetLayerInfoService_get = function _get(target, property, receiver) { var base = SetLayerInfoService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SetLayerInfoService_get.apply(this, arguments); }
  49709. function SetLayerInfoService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SetLayerInfoService_getPrototypeOf(object); if (object === null) break; } return object; }
  49710. function SetLayerInfoService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SetLayerInfoService_setPrototypeOf(subClass, superClass); }
  49711. function SetLayerInfoService_setPrototypeOf(o, p) { SetLayerInfoService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SetLayerInfoService_setPrototypeOf(o, p); }
  49712. function SetLayerInfoService_createSuper(Derived) { var hasNativeReflectConstruct = SetLayerInfoService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SetLayerInfoService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SetLayerInfoService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SetLayerInfoService_possibleConstructorReturn(this, result); }; }
  49713. function SetLayerInfoService_possibleConstructorReturn(self, call) { if (call && (SetLayerInfoService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SetLayerInfoService_assertThisInitialized(self); }
  49714. function SetLayerInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  49715. function SetLayerInfoService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  49716. function SetLayerInfoService_getPrototypeOf(o) { SetLayerInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SetLayerInfoService_getPrototypeOf(o); }
  49717. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  49718. * This program are made available under the terms of the Apache License, Version 2.0
  49719. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49720. /**
  49721. * @class SetLayerInfoService
  49722. * @deprecatedclass SuperMap.SetLayerInfoService
  49723. * @category iServer Map TempLayersSet
  49724. * @classdesc 设置图层信息服务类。可以实现临时图层中子图层的修改
  49725. * 该类负责将图层设置参数传递到服务端,并获取服务端返回的结果信息。
  49726. * @extends {CommonServiceBase}
  49727. * @param {string} url - 服务地址。请求地图服务,URL 应为:
  49728. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名}/tempLayersSet/{tempLayerID}/Rivers@World@@World";
  49729. * @param {Object} options - 参数。
  49730. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  49731. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  49732. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  49733. * @param {Object} [options.headers] - 请求头。
  49734. * @usage
  49735. */
  49736. var SetLayerInfoService = /*#__PURE__*/function (_CommonServiceBase) {
  49737. SetLayerInfoService_inherits(SetLayerInfoService, _CommonServiceBase);
  49738. var _super = SetLayerInfoService_createSuper(SetLayerInfoService);
  49739. function SetLayerInfoService(url, options) {
  49740. var _this;
  49741. SetLayerInfoService_classCallCheck(this, SetLayerInfoService);
  49742. _this = _super.call(this, url, options);
  49743. if (options) {
  49744. Util_Util.extend(SetLayerInfoService_assertThisInitialized(_this), options);
  49745. }
  49746. _this.CLASS_NAME = "SuperMap.SetLayerInfoService";
  49747. return _this;
  49748. }
  49749. /**
  49750. * @override
  49751. */
  49752. SetLayerInfoService_createClass(SetLayerInfoService, [{
  49753. key: "destroy",
  49754. value: function destroy() {
  49755. SetLayerInfoService_get(SetLayerInfoService_getPrototypeOf(SetLayerInfoService.prototype), "destroy", this).call(this);
  49756. Util_Util.reset(this);
  49757. }
  49758. /**
  49759. * @function SetLayerInfoService.prototype.processAsync
  49760. * @description 负责将客户端的更新参数传递到服务端。
  49761. * @param {Object} params - 修改后的图层资源信息。
  49762. * 该参数可以使用获取图层信息服务<{@link GetLayersInfoService}>返回图层信息,解析结果result.subLayers.layers[i],然后对其属性进行修改来获取。
  49763. */
  49764. }, {
  49765. key: "processAsync",
  49766. value: function processAsync(params) {
  49767. if (!params) {
  49768. return;
  49769. }
  49770. var me = this;
  49771. var jsonParamsStr = Util_Util.toJSON(params);
  49772. me.request({
  49773. method: "PUT",
  49774. data: jsonParamsStr,
  49775. scope: me,
  49776. success: me.serviceProcessCompleted,
  49777. failure: me.serviceProcessFailed
  49778. });
  49779. }
  49780. }]);
  49781. return SetLayerInfoService;
  49782. }(CommonServiceBase);
  49783. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayersInfoParameters.js
  49784. function SetLayersInfoParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49785. function SetLayersInfoParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  49786. function SetLayersInfoParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayersInfoParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayersInfoParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  49787. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  49788. * This program are made available under the terms of the Apache License, Version 2.0
  49789. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49790. /**
  49791. * @class SetLayersInfoParameters
  49792. * @deprecatedclass SuperMap.SetLayersInfoParameters
  49793. * @category iServer Map TempLayersSet
  49794. * @classdesc 设置图层信息参数类。
  49795. * @param {Object} options - 参数。
  49796. * @param {boolean} [options.isTempLayers=false] - 是否是临时图层。
  49797. * @param {string} options.resourceID - 临时图层资源 ID。
  49798. * @param {Object} options.layersInfo - 要更新的图层信息。
  49799. * @usage
  49800. */
  49801. var SetLayersInfoParameters = /*#__PURE__*/function () {
  49802. function SetLayersInfoParameters(options) {
  49803. SetLayersInfoParameters_classCallCheck(this, SetLayersInfoParameters);
  49804. options = options || {};
  49805. /**
  49806. * @member {boolean} [SetLayersInfoParameters.prototype.isTempLayers=false]
  49807. * @description 是否是临时图层。
  49808. */
  49809. this.isTempLayers = null;
  49810. /**
  49811. * @member {string} SetLayersInfoParameters.prototype.resourceID
  49812. * @description 临时图层资源 ID。
  49813. */
  49814. this.resourceID = null;
  49815. /**
  49816. * @member {Object} SetLayersInfoParameters.prototype.layersInfo
  49817. * @description 要更新的图层信息(包含修改和未修改的所有字段)。该参数可以通过图层信息服务获取,然后对返回值中 subLayers.layers[i] 图层信息属性进行修改。
  49818. */
  49819. this.layersInfo = null;
  49820. Util_Util.extend(this, options);
  49821. this.CLASS_NAME = "SuperMap.SetLayersInfoParameters";
  49822. }
  49823. /**
  49824. * @function SetLayersInfoParameters.prototype.destroy
  49825. * @description 释放资源,将引用资源的属性置空。
  49826. */
  49827. SetLayersInfoParameters_createClass(SetLayersInfoParameters, [{
  49828. key: "destroy",
  49829. value: function destroy() {
  49830. var me = this;
  49831. me.isTempLayers = null;
  49832. me.resourceID = null;
  49833. me.layersInfo = null;
  49834. }
  49835. }]);
  49836. return SetLayersInfoParameters;
  49837. }();
  49838. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayersInfoService.js
  49839. function SetLayersInfoService_typeof(obj) { "@babel/helpers - typeof"; return SetLayersInfoService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SetLayersInfoService_typeof(obj); }
  49840. function SetLayersInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49841. function SetLayersInfoService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  49842. function SetLayersInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayersInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayersInfoService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  49843. function SetLayersInfoService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SetLayersInfoService_get = Reflect.get.bind(); } else { SetLayersInfoService_get = function _get(target, property, receiver) { var base = SetLayersInfoService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SetLayersInfoService_get.apply(this, arguments); }
  49844. function SetLayersInfoService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SetLayersInfoService_getPrototypeOf(object); if (object === null) break; } return object; }
  49845. function SetLayersInfoService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SetLayersInfoService_setPrototypeOf(subClass, superClass); }
  49846. function SetLayersInfoService_setPrototypeOf(o, p) { SetLayersInfoService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SetLayersInfoService_setPrototypeOf(o, p); }
  49847. function SetLayersInfoService_createSuper(Derived) { var hasNativeReflectConstruct = SetLayersInfoService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SetLayersInfoService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SetLayersInfoService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SetLayersInfoService_possibleConstructorReturn(this, result); }; }
  49848. function SetLayersInfoService_possibleConstructorReturn(self, call) { if (call && (SetLayersInfoService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SetLayersInfoService_assertThisInitialized(self); }
  49849. function SetLayersInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  49850. function SetLayersInfoService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  49851. function SetLayersInfoService_getPrototypeOf(o) { SetLayersInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SetLayersInfoService_getPrototypeOf(o); }
  49852. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  49853. * This program are made available under the terms of the Apache License, Version 2.0
  49854. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49855. /**
  49856. * @class SetLayersInfoService
  49857. * @deprecatedclass SuperMap.SetLayersInfoService
  49858. * @category iServer Map TempLayersSet
  49859. * @classdesc 设置图层信息服务类。可以实现创建新的临时图层和对现有临时图层的修改,
  49860. * 当 isTempLayers 为 false的时候执行创建临时图层。当 isTempLayers 为 ture 并且临时图层资源 resourceID 被设置有效时执行对临时图层的编辑。
  49861. * 该类负责将图层设置参数传递到服务端,并获取服务端返回的结果信息。
  49862. * @extends {CommonServiceBase}
  49863. * @param url - {string} 服务地址。请求地图服务,URL 应为:
  49864. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  49865. * @param {Object} options - 参数。
  49866. * @param {string} options.resourceID - 图层资源ID,临时图层的资源ID标记。
  49867. * @param {boolean} options.isTempLayers - 当前url对应的图层是否是临时图层。
  49868. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  49869. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  49870. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  49871. * @param {Object} [options.headers] - 请求头。
  49872. * @usage
  49873. */
  49874. var SetLayersInfoService = /*#__PURE__*/function (_CommonServiceBase) {
  49875. SetLayersInfoService_inherits(SetLayersInfoService, _CommonServiceBase);
  49876. var _super = SetLayersInfoService_createSuper(SetLayersInfoService);
  49877. function SetLayersInfoService(url, options) {
  49878. var _this;
  49879. SetLayersInfoService_classCallCheck(this, SetLayersInfoService);
  49880. _this = _super.call(this, url, options);
  49881. /**
  49882. * @member {string} SetLayersInfoService.prototype.resourceID
  49883. * @description 图层资源ID,临时图层的资源ID标记。
  49884. */
  49885. _this.resourceID = null;
  49886. /**
  49887. * @function {boolean} SetLayersInfoService.prototype.isTempLayers
  49888. * @description 当前url对应的图层是否是临时图层。
  49889. */
  49890. _this.isTempLayers = false;
  49891. if (options) {
  49892. Util_Util.extend(SetLayersInfoService_assertThisInitialized(_this), options);
  49893. }
  49894. _this.CLASS_NAME = "SuperMap.SetLayersInfoService";
  49895. return _this;
  49896. }
  49897. /**
  49898. * @override
  49899. */
  49900. SetLayersInfoService_createClass(SetLayersInfoService, [{
  49901. key: "destroy",
  49902. value: function destroy() {
  49903. SetLayersInfoService_get(SetLayersInfoService_getPrototypeOf(SetLayersInfoService.prototype), "destroy", this).call(this);
  49904. Util_Util.reset(this);
  49905. }
  49906. /**
  49907. * @function SetLayersInfoService.prototype.processAsync
  49908. * @description 负责将客户端的更新参数传递到服务端。
  49909. * @param {Object} params - 修改后的图层资源信息。该参数可以使用获取图层信息服务 <{@link GetLayersInfoService}>返回图层信息,然后对其属性进行修改来获取。
  49910. */
  49911. }, {
  49912. key: "processAsync",
  49913. value: function processAsync(params) {
  49914. if (!params) {
  49915. return;
  49916. }
  49917. var jsonParams,
  49918. subLayers = [],
  49919. me = this,
  49920. method = "";
  49921. //创建临时图层和设置修改临时图层信息对应不同的资源URL
  49922. if (me.isTempLayers) {
  49923. me.url = Util_Util.urlPathAppend(me.url, "tempLayersSet/" + me.resourceID);
  49924. method = "PUT";
  49925. } else {
  49926. me.url = Util_Util.urlPathAppend(me.url, "tempLayersSet");
  49927. method = "POST";
  49928. }
  49929. if (!params.subLayers) {
  49930. params.subLayers = {
  49931. layers: []
  49932. };
  49933. }
  49934. if (!params.subLayers.layers) {
  49935. params.subLayers.layers = [];
  49936. }
  49937. var layers = params.subLayers.layers,
  49938. len = layers.length;
  49939. for (var i in layers) {
  49940. if (layers[i].ugcLayerType === "GRID") {
  49941. var colorDictionary = {};
  49942. var colorDics = layers[i].colorDictionarys;
  49943. for (var j in colorDics) {
  49944. var key = colorDics[j].elevation;
  49945. colorDictionary[key] = colorDics[j].color;
  49946. }
  49947. }
  49948. layers[i].colorDictionary = colorDictionary;
  49949. delete layers[i].colorDictionarys;
  49950. }
  49951. for (var _i2 = 0; _i2 < len; _i2++) {
  49952. if (layers[_i2].toJsonObject) {
  49953. //将图层信息转换成服务端能识别的简单json对象
  49954. subLayers.push(layers[_i2].toJsonObject());
  49955. } else {
  49956. subLayers.push(layers[_i2]);
  49957. }
  49958. }
  49959. jsonParams = Util_Util.extend(jsonParams, params);
  49960. jsonParams.subLayers = {
  49961. "layers": subLayers
  49962. };
  49963. jsonParams.object = null;
  49964. var jsonParamsStr = Util_Util.toJSON([jsonParams]);
  49965. me.request({
  49966. method: method,
  49967. data: jsonParamsStr,
  49968. scope: me,
  49969. success: me.serviceProcessCompleted,
  49970. failure: me.serviceProcessFailed
  49971. });
  49972. }
  49973. }]);
  49974. return SetLayersInfoService;
  49975. }(CommonServiceBase);
  49976. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerStatusParameters.js
  49977. function SetLayerStatusParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49978. function SetLayerStatusParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  49979. function SetLayerStatusParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerStatusParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerStatusParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  49980. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  49981. * This program are made available under the terms of the Apache License, Version 2.0
  49982. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49983. /**
  49984. * @class SetLayerStatusParameters
  49985. * @deprecatedclass SuperMap.SetLayerStatusParameters
  49986. * @category iServer Map TempLayersSet
  49987. * @classdesc 子图层显示控制参数类,该类存储了各子图层是否可见的状态。
  49988. * 注意在 SuperMap iClient 系列产品中所说的图层与 SuperMap Deskpro 的地图对应,子图层与 SuperMap Deskpro 的图层对应。
  49989. * @param {Object} options - 参数。
  49990. * @param {Array.<LayerStatus>} options.layerStatusList - 获取或设置图层可见状态({@link LayerStatus})集合,
  49991. * 集合中的每个 {@link LayerStatus} 对象代表一个子图层的可视状态。
  49992. * @param {number} [options.holdTime=15] - 获取或设置资源在服务端保存的时间。
  49993. * @param {string} [options.resourceID] - 获取或设置资源服务 ID。
  49994. * @usage
  49995. */
  49996. var SetLayerStatusParameters = /*#__PURE__*/function () {
  49997. function SetLayerStatusParameters(options) {
  49998. SetLayerStatusParameters_classCallCheck(this, SetLayerStatusParameters);
  49999. /**
  50000. * @member {Array.<LayerStatus>} SetLayerStatusParameters.prototype.layerStatusList
  50001. * @description 获取或设置图层可见状态({@link LayerStatus})集合,集合中的每个 {@link LayerStatus} 对象代表一个子图层的可视状态。
  50002. */
  50003. this.layerStatusList = [];
  50004. /**
  50005. * @member {number} [SetLayerStatusParameters.prototype.holdTime=15]
  50006. * @description 获取或设置资源在服务端保存的时间。单位为分钟。
  50007. */
  50008. this.holdTime = 15;
  50009. /**
  50010. * @member {string} SetLayerStatusParameters.prototype.resourceID
  50011. * @description 获取或设置资源服务ID。如果设置该参数则会在指定的 TempLayer 中进行图层的显示控制;
  50012. * 如果不设置该参数,则会首先创建一个 TempLayer ,然后在新创建的 TempLayer 中进行图层的显示控制。
  50013. */
  50014. this.resourceID = null;
  50015. if (options) {
  50016. Util_Util.extend(this, options);
  50017. }
  50018. }
  50019. /**
  50020. * @function SetLayerStatusParameters.prototype.destroy
  50021. * @description 释放资源,将引用资源的属性置空。
  50022. */
  50023. SetLayerStatusParameters_createClass(SetLayerStatusParameters, [{
  50024. key: "destroy",
  50025. value: function destroy() {
  50026. var me = this;
  50027. me.layerStatusList = null;
  50028. me.holdTime = null;
  50029. me.resourceID = null;
  50030. }
  50031. /**
  50032. * @function SetLayerStatusParameters.prototype.toJSON
  50033. * @description 生成 JSON。
  50034. * @returns {Object} 对应的 JSON 对象。
  50035. */
  50036. }, {
  50037. key: "toJSON",
  50038. value: function toJSON() {
  50039. var json = '{';
  50040. json += '"layers":[';
  50041. var v = [];
  50042. for (var i = 0, len = this.layerStatusList.length; i < len; i++) {
  50043. v.push(this.layerStatusList[i].toJSON());
  50044. }
  50045. json += v;
  50046. json += ']';
  50047. json += '}';
  50048. return json;
  50049. }
  50050. }]);
  50051. return SetLayerStatusParameters;
  50052. }();
  50053. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerStatusService.js
  50054. function SetLayerStatusService_typeof(obj) { "@babel/helpers - typeof"; return SetLayerStatusService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SetLayerStatusService_typeof(obj); }
  50055. function SetLayerStatusService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50056. function SetLayerStatusService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  50057. function SetLayerStatusService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerStatusService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerStatusService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  50058. function SetLayerStatusService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SetLayerStatusService_get = Reflect.get.bind(); } else { SetLayerStatusService_get = function _get(target, property, receiver) { var base = SetLayerStatusService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SetLayerStatusService_get.apply(this, arguments); }
  50059. function SetLayerStatusService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SetLayerStatusService_getPrototypeOf(object); if (object === null) break; } return object; }
  50060. function SetLayerStatusService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SetLayerStatusService_setPrototypeOf(subClass, superClass); }
  50061. function SetLayerStatusService_setPrototypeOf(o, p) { SetLayerStatusService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SetLayerStatusService_setPrototypeOf(o, p); }
  50062. function SetLayerStatusService_createSuper(Derived) { var hasNativeReflectConstruct = SetLayerStatusService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SetLayerStatusService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SetLayerStatusService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SetLayerStatusService_possibleConstructorReturn(this, result); }; }
  50063. function SetLayerStatusService_possibleConstructorReturn(self, call) { if (call && (SetLayerStatusService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SetLayerStatusService_assertThisInitialized(self); }
  50064. function SetLayerStatusService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  50065. function SetLayerStatusService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  50066. function SetLayerStatusService_getPrototypeOf(o) { SetLayerStatusService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SetLayerStatusService_getPrototypeOf(o); }
  50067. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  50068. * This program are made available under the terms of the Apache License, Version 2.0
  50069. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50070. /**
  50071. * @class SetLayerStatusService
  50072. * @deprecatedclass SuperMap.SetLayerStatusService
  50073. * @category iServer Map TempLayersSet
  50074. * @classdesc 子图层显示控制服务类。该类负责将子图层显示控制参数传递到服务端,并获取服务端返回的图层显示状态。
  50075. * 用户获取服务端返回的各子图层显示状态有两种方式:
  50076. * 一种是通过监听 SetLayerEvent.PROCESS_COMPLETE 事件;
  50077. * 一种是使用 AsyncResponder 类实现异步处理。
  50078. * @extends {CommonServiceBase}
  50079. * @param {string} url - 服务地址。请求地图服务,URL 应为:
  50080. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  50081. * @param {Object} options - 参数。
  50082. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  50083. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  50084. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  50085. * @param {Object} [options.headers] - 请求头。
  50086. * @usage
  50087. */
  50088. var SetLayerStatusService = /*#__PURE__*/function (_CommonServiceBase) {
  50089. SetLayerStatusService_inherits(SetLayerStatusService, _CommonServiceBase);
  50090. var _super = SetLayerStatusService_createSuper(SetLayerStatusService);
  50091. function SetLayerStatusService(url, options) {
  50092. var _this;
  50093. SetLayerStatusService_classCallCheck(this, SetLayerStatusService);
  50094. _this = _super.call(this, url, options);
  50095. _this.lastparams = null;
  50096. _this.mapUrl = url;
  50097. if (options) {
  50098. Util_Util.extend(SetLayerStatusService_assertThisInitialized(_this), options);
  50099. }
  50100. _this.CLASS_NAME = "SuperMap.SetLayerStatusService";
  50101. return _this;
  50102. }
  50103. /**
  50104. * @override
  50105. */
  50106. SetLayerStatusService_createClass(SetLayerStatusService, [{
  50107. key: "destroy",
  50108. value: function destroy() {
  50109. SetLayerStatusService_get(SetLayerStatusService_getPrototypeOf(SetLayerStatusService.prototype), "destroy", this).call(this);
  50110. Util_Util.reset(this);
  50111. }
  50112. /**
  50113. * @function SetLayerStatusService.prototype.processAsync
  50114. * @description 负责将客户端的更新参数传递到服务端。
  50115. * @param {Object} params - 修改后的图层资源信息。该参数可以使用获取图层信息服务{@link SetLayerStatusParameters}
  50116. * 返回图层信息,然后对其属性进行修改来获取。
  50117. */
  50118. }, {
  50119. key: "processAsync",
  50120. value: function processAsync(params) {
  50121. if (!(params instanceof SetLayerStatusParameters)) {
  50122. return;
  50123. }
  50124. var me = this,
  50125. method = "POST";
  50126. me.url = me.mapUrl;
  50127. if (params.resourceID == null) {
  50128. me.url = Util_Util.urlPathAppend(me.url, 'tempLayersSet');
  50129. me.lastparams = params;
  50130. me.request({
  50131. method: method,
  50132. scope: me,
  50133. success: me.createTempLayerComplete,
  50134. failure: me.serviceProcessFailed
  50135. });
  50136. } else {
  50137. me.url = Util_Util.urlPathAppend(me.url, "tempLayersSet/" + params.resourceID);
  50138. me.url = Util_Util.urlAppend(me.url, "elementRemain=true&reference=" + params.resourceID + "&holdTime=" + params.holdTime.toString());
  50139. var jsonParameters = '[{';
  50140. jsonParameters += '"type":"UGC",';
  50141. if (params.layerStatusList != null && params.layerStatusList.length > 0) {
  50142. jsonParameters += '"subLayers":' + params.toJSON();
  50143. }
  50144. jsonParameters += ',"visible":' + true + ',';
  50145. jsonParameters += '"name":"' + this.getMapName(this.mapUrl) + '"';
  50146. jsonParameters += '}]';
  50147. me.request({
  50148. method: "PUT",
  50149. data: jsonParameters,
  50150. scope: me,
  50151. success: me.serviceProcessCompleted,
  50152. failure: me.serviceProcessFailed
  50153. });
  50154. }
  50155. }
  50156. /**
  50157. * @function SetLayerStatusService.prototype.createTempLayerComplete
  50158. * @description 设置完成,执行此方法。
  50159. * @param {Object} result - 服务器返回的结果对象,记录设置操作是否成功。
  50160. */
  50161. }, {
  50162. key: "createTempLayerComplete",
  50163. value: function createTempLayerComplete(result) {
  50164. var me = this;
  50165. result = Util_Util.transformResult(result);
  50166. if (result.succeed) {
  50167. me.lastparams.resourceID = result.newResourceID;
  50168. }
  50169. me.processAsync(me.lastparams);
  50170. }
  50171. /**
  50172. * @function SetLayerStatusService.prototype.getMapName
  50173. * @description 获取地图名称。
  50174. * @param {Object} url - 服务地址。
  50175. */
  50176. }, {
  50177. key: "getMapName",
  50178. value: function getMapName(url) {
  50179. var mapUrl = url;
  50180. if (mapUrl.charAt(mapUrl.length - 1) === "/") {
  50181. mapUrl = mapUrl.substr(0, mapUrl.length - 1);
  50182. }
  50183. var index = mapUrl.lastIndexOf("/");
  50184. var mapName = mapUrl.substring(index + 1, mapUrl.length);
  50185. return mapName;
  50186. }
  50187. /**
  50188. * @function SetLayerStatusService.prototype.setLayerCompleted
  50189. * @description 设置完成,执行此方法。
  50190. * @param {Object} result - 服务器返回的结果对象,记录设置操作是否成功。
  50191. */
  50192. }, {
  50193. key: "serviceProcessCompleted",
  50194. value: function serviceProcessCompleted(result, options) {
  50195. var me = this;
  50196. result = Util_Util.transformResult(result);
  50197. if (result != null && me.lastparams != null) {
  50198. result.newResourceID = me.lastparams.resourceID;
  50199. }
  50200. me.events.triggerEvent("processCompleted", {
  50201. result: result,
  50202. options: options
  50203. });
  50204. }
  50205. }]);
  50206. return SetLayerStatusService;
  50207. }(CommonServiceBase);
  50208. ;// CONCATENATED MODULE: ./src/common/iServer/SingleObjectQueryJobsParameter.js
  50209. function SingleObjectQueryJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50210. function SingleObjectQueryJobsParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  50211. function SingleObjectQueryJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SingleObjectQueryJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SingleObjectQueryJobsParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  50212. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  50213. * This program are made available under the terms of the Apache License, Version 2.0
  50214. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50215. /**
  50216. * @class SingleObjectQueryJobsParameter
  50217. * @deprecatedclass SuperMap.SingleObjectQueryJobsParameter
  50218. * @category iServer ProcessingService Query
  50219. * @classdesc 单对象空间查询分析任务参数类。
  50220. * @param {Object} options - 参数。
  50221. * @param {string} options.datasetName - 数据集名。
  50222. * @param {string} options.datasetQuery - 查询对象所在的数据集名称。
  50223. * @param {SpatialQueryMode} [options.mode=SpatialQueryMode.CONTAIN] - 空间查询模式。
  50224. * @param {OutputSetting} [options.output] - 输出参数设置。
  50225. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  50226. * @usage
  50227. */
  50228. var SingleObjectQueryJobsParameter = /*#__PURE__*/function () {
  50229. function SingleObjectQueryJobsParameter(options) {
  50230. SingleObjectQueryJobsParameter_classCallCheck(this, SingleObjectQueryJobsParameter);
  50231. if (!options) {
  50232. return;
  50233. }
  50234. /**
  50235. * @member {string} SingleObjectQueryJobsParameter.prototype.datasetName
  50236. * @description 数据集名。
  50237. */
  50238. this.datasetName = "";
  50239. /**
  50240. * @member {string} SingleObjectQueryJobsParameter.prototype.datasetQuery
  50241. * @description 查询对象所在的数据集名称。
  50242. */
  50243. this.datasetQuery = "";
  50244. /**
  50245. * @member {string} SingleObjectQueryJobsParameter.prototype.geometryQuery
  50246. * @description 查询对象所在的几何对象。
  50247. */
  50248. this.geometryQuery = "";
  50249. /**
  50250. * @member {SpatialQueryMode} [SingleObjectQueryJobsParameter.prototype.mode=SpatialQueryMode.CONTAIN]
  50251. * @description 空间查询模式 。
  50252. */
  50253. this.mode = SpatialQueryMode.CONTAIN;
  50254. /**
  50255. * @member {OutputSetting} [SingleObjectQueryJobsParameter.prototype.output]
  50256. * @description 输出参数设置类。
  50257. */
  50258. this.output = null;
  50259. /**
  50260. * @member {MappingParameters} [SingleObjectQueryJobsParameter.prototype.mappingParameters]
  50261. * @description 分析后结果可视化的参数类。
  50262. */
  50263. this.mappingParameters = null;
  50264. Util_Util.extend(this, options);
  50265. this.CLASS_NAME = "SuperMap.SingleObjectQueryJobsParameter";
  50266. }
  50267. /**
  50268. * @function SingleObjectQueryJobsParameter.prototype.destroy
  50269. * @description 释放资源,将引用资源的属性置空。
  50270. */
  50271. SingleObjectQueryJobsParameter_createClass(SingleObjectQueryJobsParameter, [{
  50272. key: "destroy",
  50273. value: function destroy() {
  50274. this.datasetName = null;
  50275. this.datasetQuery = null;
  50276. this.geometryQuery = null;
  50277. this.mode = null;
  50278. if (this.output instanceof OutputSetting) {
  50279. this.output.destroy();
  50280. this.output = null;
  50281. }
  50282. if (this.mappingParameters instanceof MappingParameters) {
  50283. this.mappingParameters.destroy();
  50284. this.mappingParameters = null;
  50285. }
  50286. }
  50287. /**
  50288. * @function SingleObjectQueryJobsParameter.toObject
  50289. * @param {Object} singleObjectQueryJobsParameter - 单对象空间查询分析任务参数。
  50290. * @param {Object} tempObj - 目标对象。
  50291. * @description 生成单对象空间查询分析任务对象。
  50292. */
  50293. }], [{
  50294. key: "toObject",
  50295. value: function toObject(singleObjectQueryJobsParameter, tempObj) {
  50296. for (var name in singleObjectQueryJobsParameter) {
  50297. if (name === "datasetName") {
  50298. tempObj['input'] = tempObj['input'] || {};
  50299. tempObj['input'][name] = singleObjectQueryJobsParameter[name];
  50300. continue;
  50301. }
  50302. if (name === "output") {
  50303. tempObj['output'] = tempObj['output'] || {};
  50304. tempObj['output'] = singleObjectQueryJobsParameter[name];
  50305. continue;
  50306. }
  50307. tempObj['analyst'] = tempObj['analyst'] || {};
  50308. tempObj['analyst'][name] = singleObjectQueryJobsParameter[name];
  50309. if (name === 'mappingParameters') {
  50310. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  50311. tempObj['analyst']['mappingParameters'] = singleObjectQueryJobsParameter[name];
  50312. }
  50313. }
  50314. }
  50315. }]);
  50316. return SingleObjectQueryJobsParameter;
  50317. }();
  50318. ;// CONCATENATED MODULE: ./src/common/iServer/SingleObjectQueryJobsService.js
  50319. function SingleObjectQueryJobsService_typeof(obj) { "@babel/helpers - typeof"; return SingleObjectQueryJobsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SingleObjectQueryJobsService_typeof(obj); }
  50320. function SingleObjectQueryJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50321. function SingleObjectQueryJobsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  50322. function SingleObjectQueryJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SingleObjectQueryJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SingleObjectQueryJobsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  50323. function SingleObjectQueryJobsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SingleObjectQueryJobsService_get = Reflect.get.bind(); } else { SingleObjectQueryJobsService_get = function _get(target, property, receiver) { var base = SingleObjectQueryJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SingleObjectQueryJobsService_get.apply(this, arguments); }
  50324. function SingleObjectQueryJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SingleObjectQueryJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  50325. function SingleObjectQueryJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SingleObjectQueryJobsService_setPrototypeOf(subClass, superClass); }
  50326. function SingleObjectQueryJobsService_setPrototypeOf(o, p) { SingleObjectQueryJobsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SingleObjectQueryJobsService_setPrototypeOf(o, p); }
  50327. function SingleObjectQueryJobsService_createSuper(Derived) { var hasNativeReflectConstruct = SingleObjectQueryJobsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SingleObjectQueryJobsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SingleObjectQueryJobsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SingleObjectQueryJobsService_possibleConstructorReturn(this, result); }; }
  50328. function SingleObjectQueryJobsService_possibleConstructorReturn(self, call) { if (call && (SingleObjectQueryJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SingleObjectQueryJobsService_assertThisInitialized(self); }
  50329. function SingleObjectQueryJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  50330. function SingleObjectQueryJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  50331. function SingleObjectQueryJobsService_getPrototypeOf(o) { SingleObjectQueryJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SingleObjectQueryJobsService_getPrototypeOf(o); }
  50332. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  50333. * This program are made available under the terms of the Apache License, Version 2.0
  50334. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50335. /**
  50336. * @class SingleObjectQueryJobsService
  50337. * @deprecatedclass SuperMap.SingleObjectQueryJobsService
  50338. * @category iServer ProcessingService Query
  50339. * @classdesc 单对象查询分析服务类
  50340. * @extends {ProcessingServiceBase}
  50341. * @param {string} url - 服务地址。
  50342. * @param {Object} options - 可选参数。
  50343. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  50344. * @param {Object} [options.headers] - 请求头。
  50345. * @usage
  50346. */
  50347. var SingleObjectQueryJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  50348. SingleObjectQueryJobsService_inherits(SingleObjectQueryJobsService, _ProcessingServiceBas);
  50349. var _super = SingleObjectQueryJobsService_createSuper(SingleObjectQueryJobsService);
  50350. function SingleObjectQueryJobsService(url, options) {
  50351. var _this;
  50352. SingleObjectQueryJobsService_classCallCheck(this, SingleObjectQueryJobsService);
  50353. _this = _super.call(this, url, options);
  50354. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/query');
  50355. _this.CLASS_NAME = 'SuperMap.SingleObjectQueryJobsService';
  50356. return _this;
  50357. }
  50358. /**
  50359. *@override
  50360. */
  50361. SingleObjectQueryJobsService_createClass(SingleObjectQueryJobsService, [{
  50362. key: "destroy",
  50363. value: function destroy() {
  50364. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "destroy", this).call(this);
  50365. }
  50366. /**
  50367. * @function SingleObjectQueryJobsService.protitype.getQueryJobs
  50368. * @description 获取单对象空间查询分析所有任务
  50369. */
  50370. }, {
  50371. key: "getQueryJobs",
  50372. value: function getQueryJobs() {
  50373. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "getJobs", this).call(this, this.url);
  50374. }
  50375. /**
  50376. * @function KernelDensityJobsService.protitype.getQueryJob
  50377. * @description 获取指定id的单对象空间查询分析服务
  50378. * @param {string} id - 指定要获取数据的id
  50379. */
  50380. }, {
  50381. key: "getQueryJob",
  50382. value: function getQueryJob(id) {
  50383. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  50384. }
  50385. /**
  50386. * @function SingleObjectQueryJobsService.protitype.addQueryJob
  50387. * @description 新建单对象空间查询分析服务
  50388. * @param {SingleObjectQueryJobsParameter} params - 创建一个空间分析的请求参数。
  50389. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  50390. */
  50391. }, {
  50392. key: "addQueryJob",
  50393. value: function addQueryJob(params, seconds) {
  50394. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "addJob", this).call(this, this.url, params, SingleObjectQueryJobsParameter, seconds);
  50395. }
  50396. }]);
  50397. return SingleObjectQueryJobsService;
  50398. }(ProcessingServiceBase);
  50399. ;// CONCATENATED MODULE: ./src/common/iServer/StopQueryParameters.js
  50400. function StopQueryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50401. function StopQueryParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  50402. function StopQueryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) StopQueryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) StopQueryParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  50403. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  50404. * This program are made available under the terms of the Apache License, Version 2.0
  50405. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50406. /**
  50407. * @class StopQueryParameters
  50408. * @deprecatedclass SuperMap.StopQueryParameters
  50409. * @category iServer TrafficTransferAnalyst TransferStops
  50410. * @classdesc 站点查询参数类。
  50411. * @param {Object} options - 参数。
  50412. * @param {string} options.keyWord - 站点名称关键字。
  50413. * @param {boolean} [options.returnPosition=false] - 是否返回站点坐标信息。
  50414. * @usage
  50415. */
  50416. var StopQueryParameters = /*#__PURE__*/function () {
  50417. function StopQueryParameters(options) {
  50418. StopQueryParameters_classCallCheck(this, StopQueryParameters);
  50419. options = options || {};
  50420. /**
  50421. * @member {string} StopQueryParameters.prototype.keyWord
  50422. * @description 站点名称关键字。
  50423. */
  50424. this.keyWord = null;
  50425. /**
  50426. * @member {boolean} [StopQueryParameters.prototype.returnPosition=false]
  50427. * @description 是否返回站点坐标信息。
  50428. */
  50429. this.returnPosition = false;
  50430. Util_Util.extend(this, options);
  50431. this.CLASS_NAME = "SuperMap.StopQueryParameters";
  50432. }
  50433. /**
  50434. * @function StopQueryParameters.prototype.destroy
  50435. * @description 释放资源,将引用资源的属性置空。
  50436. */
  50437. StopQueryParameters_createClass(StopQueryParameters, [{
  50438. key: "destroy",
  50439. value: function destroy() {
  50440. Util_Util.reset(this);
  50441. }
  50442. }]);
  50443. return StopQueryParameters;
  50444. }();
  50445. ;// CONCATENATED MODULE: ./src/common/iServer/StopQueryService.js
  50446. function StopQueryService_typeof(obj) { "@babel/helpers - typeof"; return StopQueryService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, StopQueryService_typeof(obj); }
  50447. function StopQueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50448. function StopQueryService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  50449. function StopQueryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) StopQueryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) StopQueryService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  50450. function StopQueryService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { StopQueryService_get = Reflect.get.bind(); } else { StopQueryService_get = function _get(target, property, receiver) { var base = StopQueryService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return StopQueryService_get.apply(this, arguments); }
  50451. function StopQueryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = StopQueryService_getPrototypeOf(object); if (object === null) break; } return object; }
  50452. function StopQueryService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) StopQueryService_setPrototypeOf(subClass, superClass); }
  50453. function StopQueryService_setPrototypeOf(o, p) { StopQueryService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return StopQueryService_setPrototypeOf(o, p); }
  50454. function StopQueryService_createSuper(Derived) { var hasNativeReflectConstruct = StopQueryService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = StopQueryService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = StopQueryService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return StopQueryService_possibleConstructorReturn(this, result); }; }
  50455. function StopQueryService_possibleConstructorReturn(self, call) { if (call && (StopQueryService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return StopQueryService_assertThisInitialized(self); }
  50456. function StopQueryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  50457. function StopQueryService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  50458. function StopQueryService_getPrototypeOf(o) { StopQueryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return StopQueryService_getPrototypeOf(o); }
  50459. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  50460. * This program are made available under the terms of the Apache License, Version 2.0
  50461. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50462. /**
  50463. * @class StopQueryService
  50464. * @deprecatedclass SuperMap.StopQueryService
  50465. * @category iServer TrafficTransferAnalyst TransferStops
  50466. * @classdesc 站点查询服务类。
  50467. * 返回结果通过该类支持的事件的监听函数参数获取
  50468. * @extends {CommonServiceBase}
  50469. * @param {string} url - 服务地址。
  50470. * 例如:</br>"http://localhost:8090/iserver/services/traffictransferanalyst-sample/restjsr/traffictransferanalyst/Traffic-Changchun"。
  50471. * @param {Object} options - 参数。
  50472. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  50473. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  50474. * @param {Object} [options.headers] - 请求头。
  50475. * @example 例如:
  50476. * (start code)
  50477. * var myService = new StopQueryService(url, {eventListeners: {
  50478. * "processCompleted": StopQueryCompleted,
  50479. * "processFailed": StopQueryError
  50480. * }
  50481. * };
  50482. * (end)
  50483. * @usage
  50484. *
  50485. */
  50486. var StopQueryService = /*#__PURE__*/function (_CommonServiceBase) {
  50487. StopQueryService_inherits(StopQueryService, _CommonServiceBase);
  50488. var _super = StopQueryService_createSuper(StopQueryService);
  50489. function StopQueryService(url, options) {
  50490. var _this;
  50491. StopQueryService_classCallCheck(this, StopQueryService);
  50492. _this = _super.call(this, url, options);
  50493. options = options || {};
  50494. Util_Util.extend(StopQueryService_assertThisInitialized(_this), options);
  50495. _this.CLASS_NAME = "SuperMap.StopQueryService";
  50496. return _this;
  50497. }
  50498. /**
  50499. *@override
  50500. */
  50501. StopQueryService_createClass(StopQueryService, [{
  50502. key: "destroy",
  50503. value: function destroy() {
  50504. StopQueryService_get(StopQueryService_getPrototypeOf(StopQueryService.prototype), "destroy", this).call(this);
  50505. Util_Util.reset(this);
  50506. }
  50507. /**
  50508. * @function StopQueryService.prototype.processAsync
  50509. * @description 负责将客户端的更新参数传递到服务端。
  50510. * @param {StopQueryParameters} params - 交通换乘参数。
  50511. */
  50512. }, {
  50513. key: "processAsync",
  50514. value: function processAsync(params) {
  50515. if (!(params instanceof StopQueryParameters)) {
  50516. return;
  50517. }
  50518. var me = this;
  50519. me.url = Util_Util.urlPathAppend(me.url, 'stops/keyword/' + params.keyWord);
  50520. me.request({
  50521. method: "GET",
  50522. params: {
  50523. returnPosition: params.returnPosition
  50524. },
  50525. scope: me,
  50526. success: me.serviceProcessCompleted,
  50527. failure: me.serviceProcessFailed
  50528. });
  50529. }
  50530. }]);
  50531. return StopQueryService;
  50532. }(CommonServiceBase);
  50533. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryAttributesJobsParameter.js
  50534. function SummaryAttributesJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50535. function SummaryAttributesJobsParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  50536. function SummaryAttributesJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryAttributesJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryAttributesJobsParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  50537. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  50538. * This program are made available under the terms of the Apache License, Version 2.0
  50539. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50540. /**
  50541. * @class SummaryAttributesJobsParameter
  50542. * @deprecatedclass SuperMap.SummaryAttributesJobsParameter
  50543. * @category iServer ProcessingService SummaryAttributes
  50544. * @classdesc 属性汇总分析任务参数类。
  50545. * @param {Object} options - 参数。
  50546. * @param {string} options.datasetName - 数据集名。
  50547. * @param {string} options.groupField - 分组字段。
  50548. * @param {string} options.attributeField - 属性字段。
  50549. * @param {string} options.statisticModes - 统计模式。
  50550. * @param {OutputSetting} [options.output] -输出参数设置。
  50551. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  50552. * @usage
  50553. */
  50554. var SummaryAttributesJobsParameter = /*#__PURE__*/function () {
  50555. function SummaryAttributesJobsParameter(options) {
  50556. SummaryAttributesJobsParameter_classCallCheck(this, SummaryAttributesJobsParameter);
  50557. if (!options) {
  50558. return;
  50559. }
  50560. /**
  50561. * @member {string} SummaryAttributesJobsParameter.prototype.datasetName
  50562. * @description 汇总数据集名称。
  50563. */
  50564. this.datasetName = "";
  50565. /**
  50566. * @member {string} SummaryAttributesJobsParameter.prototype.groupField
  50567. * @description 分组字段。
  50568. */
  50569. this.groupField = "";
  50570. /**
  50571. * @member {string} SummaryAttributesJobsParameter.prototype.attributeField
  50572. * @description 属性字段。
  50573. */
  50574. this.attributeField = "";
  50575. /**
  50576. * @member {string} SummaryAttributesJobsParameter.prototype.statisticModes
  50577. * @description 属性汇总统计模式。
  50578. */
  50579. this.statisticModes = "";
  50580. /**
  50581. * @member {OutputSetting} SummaryAttributesJobsParameter.prototype.output
  50582. * @description 输出参数设置类。
  50583. */
  50584. this.output = null;
  50585. /**
  50586. * @member {MappingParameters} [SummaryAttributesJobsParameter.prototype.mappingParameters]
  50587. * @description 分析后结果可视化的参数类。
  50588. */
  50589. this.mappingParameters = null;
  50590. Util_Util.extend(this, options);
  50591. this.CLASS_NAME = "SuperMap.SummaryAttributesJobsParameter";
  50592. }
  50593. /**
  50594. * @function SummaryAttributesJobsParameter.prototype.destroy
  50595. * @description 释放资源,将资源的属性置空。
  50596. */
  50597. SummaryAttributesJobsParameter_createClass(SummaryAttributesJobsParameter, [{
  50598. key: "destroy",
  50599. value: function destroy() {
  50600. this.datasetName = null;
  50601. this.groupField = null;
  50602. this.attributeField = null;
  50603. this.statisticModes = null;
  50604. if (this.output instanceof OutputSetting) {
  50605. this.output.destroy();
  50606. this.output = null;
  50607. }
  50608. if (this.mappingParameters instanceof MappingParameters) {
  50609. this.mappingParameters.destroy();
  50610. this.mappingParameters = null;
  50611. }
  50612. }
  50613. /**
  50614. * @function SummaryAttributesJobsParameter.toObject
  50615. * @param {Object} SummaryAttributesJobsParameter - 属性汇总任务参数。
  50616. * @param {Object} tempObj - 目标对象。
  50617. * @description 生成属性汇总分析任务对象。
  50618. */
  50619. }], [{
  50620. key: "toObject",
  50621. value: function toObject(_SummaryAttributesJobsParameter, tempObj) {
  50622. for (var name in _SummaryAttributesJobsParameter) {
  50623. if (name === "datasetName") {
  50624. tempObj['input'] = tempObj['input'] || {};
  50625. tempObj['input'][name] = _SummaryAttributesJobsParameter[name];
  50626. continue;
  50627. }
  50628. if (name === "output") {
  50629. tempObj['output'] = tempObj['output'] || {};
  50630. tempObj['output'] = _SummaryAttributesJobsParameter[name];
  50631. continue;
  50632. }
  50633. tempObj['analyst'] = tempObj['analyst'] || {};
  50634. tempObj['analyst'][name] = _SummaryAttributesJobsParameter[name];
  50635. if (name === 'mappingParameters') {
  50636. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  50637. tempObj['analyst']['mappingParameters'] = _SummaryAttributesJobsParameter[name];
  50638. }
  50639. }
  50640. }
  50641. }]);
  50642. return SummaryAttributesJobsParameter;
  50643. }();
  50644. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryAttributesJobsService.js
  50645. function SummaryAttributesJobsService_typeof(obj) { "@babel/helpers - typeof"; return SummaryAttributesJobsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SummaryAttributesJobsService_typeof(obj); }
  50646. function SummaryAttributesJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50647. function SummaryAttributesJobsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  50648. function SummaryAttributesJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryAttributesJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryAttributesJobsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  50649. function SummaryAttributesJobsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SummaryAttributesJobsService_get = Reflect.get.bind(); } else { SummaryAttributesJobsService_get = function _get(target, property, receiver) { var base = SummaryAttributesJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SummaryAttributesJobsService_get.apply(this, arguments); }
  50650. function SummaryAttributesJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryAttributesJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  50651. function SummaryAttributesJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SummaryAttributesJobsService_setPrototypeOf(subClass, superClass); }
  50652. function SummaryAttributesJobsService_setPrototypeOf(o, p) { SummaryAttributesJobsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SummaryAttributesJobsService_setPrototypeOf(o, p); }
  50653. function SummaryAttributesJobsService_createSuper(Derived) { var hasNativeReflectConstruct = SummaryAttributesJobsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SummaryAttributesJobsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SummaryAttributesJobsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SummaryAttributesJobsService_possibleConstructorReturn(this, result); }; }
  50654. function SummaryAttributesJobsService_possibleConstructorReturn(self, call) { if (call && (SummaryAttributesJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SummaryAttributesJobsService_assertThisInitialized(self); }
  50655. function SummaryAttributesJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  50656. function SummaryAttributesJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  50657. function SummaryAttributesJobsService_getPrototypeOf(o) { SummaryAttributesJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryAttributesJobsService_getPrototypeOf(o); }
  50658. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  50659. * This program are made available under the terms of the Apache License, Version 2.0
  50660. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50661. /**
  50662. * @class SummaryAttributesJobsService
  50663. * @deprecatedclass SuperMap.SummaryAttributesJobsService
  50664. * @category iServer ProcessingService SummaryAttributes
  50665. * @classdesc 属性汇总分析服务类
  50666. * @extends {ProcessingServiceBase}
  50667. * @param {string} url - 服务地址。
  50668. * @param {Object} options - 可选参数。
  50669. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  50670. * @param {Object} [options.headers] - 请求头。
  50671. * @usage
  50672. */
  50673. var SummaryAttributesJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  50674. SummaryAttributesJobsService_inherits(SummaryAttributesJobsService, _ProcessingServiceBas);
  50675. var _super = SummaryAttributesJobsService_createSuper(SummaryAttributesJobsService);
  50676. function SummaryAttributesJobsService(url, options) {
  50677. var _this;
  50678. SummaryAttributesJobsService_classCallCheck(this, SummaryAttributesJobsService);
  50679. _this = _super.call(this, url, options);
  50680. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/summaryattributes');
  50681. _this.CLASS_NAME = "SuperMap.SummaryAttributesJobsService";
  50682. return _this;
  50683. }
  50684. /**
  50685. *@override
  50686. */
  50687. SummaryAttributesJobsService_createClass(SummaryAttributesJobsService, [{
  50688. key: "destroy",
  50689. value: function destroy() {
  50690. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "destroy", this).call(this);
  50691. }
  50692. /**
  50693. * @function SummaryAttributesJobsService.protitype.getSummaryAttributesJobs
  50694. * @description 获取属性汇总分析所有任务
  50695. */
  50696. }, {
  50697. key: "getSummaryAttributesJobs",
  50698. value: function getSummaryAttributesJobs() {
  50699. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "getJobs", this).call(this, this.url);
  50700. }
  50701. /**
  50702. * @function SummaryAttributesJobsService.protitype.getSummaryAttributesJob
  50703. * @description 获取指定id的属性汇总分析服务
  50704. * @param {string} id - 指定要获取数据的id
  50705. */
  50706. }, {
  50707. key: "getSummaryAttributesJob",
  50708. value: function getSummaryAttributesJob(id) {
  50709. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  50710. }
  50711. /**
  50712. * @function SummaryAttributesJobsService.protitype.addSummaryAttributesJob
  50713. * @description 新建属性汇总分析服务
  50714. * @param {SummaryAttributesJobsParameter} params - 属性汇总分析任务参数类。
  50715. * @param {number} seconds - 创建成功结果的时间间隔。
  50716. */
  50717. }, {
  50718. key: "addSummaryAttributesJob",
  50719. value: function addSummaryAttributesJob(params, seconds) {
  50720. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryAttributesJobsParameter, seconds);
  50721. }
  50722. }]);
  50723. return SummaryAttributesJobsService;
  50724. }(ProcessingServiceBase);
  50725. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryMeshJobParameter.js
  50726. function SummaryMeshJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50727. function SummaryMeshJobParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  50728. function SummaryMeshJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryMeshJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryMeshJobParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  50729. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  50730. * This program are made available under the terms of the Apache License, Version 2.0
  50731. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50732. /**
  50733. * @class SummaryMeshJobParameter
  50734. * @deprecatedclass SuperMap.SummaryMeshJobParameter
  50735. * @category iServer ProcessingService AggregatePoints
  50736. * @classdesc 点聚合分析任务参数类。
  50737. * @param {Object} options - 参数。
  50738. * @param {string} options.datasetName - 数据集名。
  50739. * @param {string} [options.regionDataset ] - 聚合面数据集(聚合类型为多边形聚合时使用的参数)
  50740. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} [options.query] - 分析范围(默认为全图范围)。
  50741. * @param {number} options.fields - 权重索引。
  50742. * @param {number} [options.resolution=100] - 分辨率。
  50743. * @param {StatisticAnalystMode} [options.statisticModes=StatisticAnalystMode.AVERAGE] - 分析模式。
  50744. * @param {number} [options.meshType=0] - 分析类型。
  50745. * @param {SummaryType} [options.type=SummaryType.SUMMARYMESH] - 聚合类型。
  50746. * @param {OutputSetting} [options.output] - 输出参数设置。
  50747. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  50748. * @usage
  50749. */
  50750. var SummaryMeshJobParameter = /*#__PURE__*/function () {
  50751. function SummaryMeshJobParameter(options) {
  50752. SummaryMeshJobParameter_classCallCheck(this, SummaryMeshJobParameter);
  50753. if (!options) {
  50754. return;
  50755. }
  50756. /**
  50757. * @member {string} SummaryMeshJobParameter.prototype.datasetName
  50758. * @description 数据集名。
  50759. */
  50760. this.datasetName = "";
  50761. /**
  50762. * @member {string} SummaryMeshJobParameter.prototype.regionDataset
  50763. * @description 聚合面数据集(聚合类型为多边形聚合时使用的参数)。
  50764. */
  50765. this.regionDataset = "";
  50766. /**
  50767. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} SummaryMeshJobParameter.prototype.query
  50768. * @description 分析范围(聚合类型为网格面聚合时使用的参数)。
  50769. */
  50770. this.query = "";
  50771. /**
  50772. * @member {number} [SummaryMeshJobParameter.prototype.resolution=100]
  50773. * @description 分辨率(聚合类型为网格面聚合时使用的参数)。
  50774. */
  50775. this.resolution = 100;
  50776. /**
  50777. * @member {number} [SummaryMeshJobParameter.prototype.meshType=0]
  50778. * @description 网格面类型(聚合类型为网格面聚合时使用的参数),取值:0 或 1。
  50779. */
  50780. this.meshType = 0;
  50781. /**
  50782. * @member {StatisticAnalystMode} [SummaryMeshJobParameter.prototype.statisticModes=StatisticAnalystMode.AVERAGE]
  50783. * @description 统计模式。
  50784. */
  50785. this.statisticModes = StatisticAnalystMode.AVERAGE;
  50786. /**
  50787. * @member {number} SummaryMeshJobParameter.prototype.fields
  50788. * @description 权重字段。
  50789. */
  50790. this.fields = "";
  50791. /**
  50792. * @member {SummaryType} [SummaryMeshJobParameter.prototype.type=SummaryType.SUMMARYMESH]
  50793. * @description 聚合类型。
  50794. */
  50795. this.type = SummaryType.SUMMARYMESH;
  50796. /**
  50797. * @member {OutputSetting} [SummaryMeshJobParameter.prototype.output]
  50798. * @description 输出参数设置类。
  50799. */
  50800. this.output = null;
  50801. /**
  50802. * @member {MappingParameters} [SummaryMeshJobParameter.prototype.mappingParameters]
  50803. * @description 分析后结果可视化的参数类。
  50804. */
  50805. this.mappingParameters = null;
  50806. Util_Util.extend(this, options);
  50807. this.CLASS_NAME = "SuperMap.SummaryMeshJobParameter";
  50808. }
  50809. /**
  50810. * @function SummaryMeshJobParameter.prototype.destroy
  50811. * @description 释放资源,将资源的属性置空。
  50812. */
  50813. SummaryMeshJobParameter_createClass(SummaryMeshJobParameter, [{
  50814. key: "destroy",
  50815. value: function destroy() {
  50816. this.datasetName = null;
  50817. this.query = null;
  50818. this.resolution = null;
  50819. this.statisticModes = null;
  50820. this.meshType = null;
  50821. this.fields = null;
  50822. this.regionDataset = null;
  50823. this.type = null;
  50824. if (this.output instanceof OutputSetting) {
  50825. this.output.destroy();
  50826. this.output = null;
  50827. }
  50828. if (this.mappingParameters instanceof MappingParameters) {
  50829. this.mappingParameters.destroy();
  50830. this.mappingParameters = null;
  50831. }
  50832. }
  50833. /**
  50834. * @function SummaryMeshJobParameter.toObject
  50835. * @param {Object} summaryMeshJobParameter - 点聚合分析任务参数。
  50836. * @param {Object} tempObj - 目标对象。
  50837. * @description 生成点聚合分析任务对象。
  50838. */
  50839. }], [{
  50840. key: "toObject",
  50841. value: function toObject(summaryMeshJobParameter, tempObj) {
  50842. for (var name in summaryMeshJobParameter) {
  50843. if (name === "datasetName") {
  50844. tempObj['input'] = tempObj['input'] || {};
  50845. tempObj['input'][name] = summaryMeshJobParameter[name];
  50846. continue;
  50847. }
  50848. if (name === "type") {
  50849. tempObj['type'] = summaryMeshJobParameter[name];
  50850. continue;
  50851. }
  50852. if (name === "output") {
  50853. tempObj['output'] = tempObj['output'] || {};
  50854. tempObj['output'] = summaryMeshJobParameter[name];
  50855. continue;
  50856. }
  50857. if (summaryMeshJobParameter.type === 'SUMMARYMESH' && name !== 'regionDataset' || summaryMeshJobParameter.type === 'SUMMARYREGION' && !contains(['meshType', 'resolution', 'query'], name)) {
  50858. tempObj['analyst'] = tempObj['analyst'] || {};
  50859. if (name === 'query' && summaryMeshJobParameter[name]) {
  50860. tempObj['analyst'][name] = summaryMeshJobParameter[name].toBBOX();
  50861. } else {
  50862. tempObj['analyst'][name] = summaryMeshJobParameter[name];
  50863. }
  50864. if (name === 'mappingParameters') {
  50865. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  50866. tempObj['analyst']['mappingParameters'] = summaryMeshJobParameter[name];
  50867. }
  50868. }
  50869. }
  50870. function contains(arr, obj) {
  50871. var i = arr.length;
  50872. while (i--) {
  50873. if (arr[i] === obj) {
  50874. return true;
  50875. }
  50876. }
  50877. return false;
  50878. }
  50879. }
  50880. }]);
  50881. return SummaryMeshJobParameter;
  50882. }();
  50883. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryMeshJobsService.js
  50884. function SummaryMeshJobsService_typeof(obj) { "@babel/helpers - typeof"; return SummaryMeshJobsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SummaryMeshJobsService_typeof(obj); }
  50885. function SummaryMeshJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50886. function SummaryMeshJobsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  50887. function SummaryMeshJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryMeshJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryMeshJobsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  50888. function SummaryMeshJobsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SummaryMeshJobsService_get = Reflect.get.bind(); } else { SummaryMeshJobsService_get = function _get(target, property, receiver) { var base = SummaryMeshJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SummaryMeshJobsService_get.apply(this, arguments); }
  50889. function SummaryMeshJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryMeshJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  50890. function SummaryMeshJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SummaryMeshJobsService_setPrototypeOf(subClass, superClass); }
  50891. function SummaryMeshJobsService_setPrototypeOf(o, p) { SummaryMeshJobsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SummaryMeshJobsService_setPrototypeOf(o, p); }
  50892. function SummaryMeshJobsService_createSuper(Derived) { var hasNativeReflectConstruct = SummaryMeshJobsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SummaryMeshJobsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SummaryMeshJobsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SummaryMeshJobsService_possibleConstructorReturn(this, result); }; }
  50893. function SummaryMeshJobsService_possibleConstructorReturn(self, call) { if (call && (SummaryMeshJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SummaryMeshJobsService_assertThisInitialized(self); }
  50894. function SummaryMeshJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  50895. function SummaryMeshJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  50896. function SummaryMeshJobsService_getPrototypeOf(o) { SummaryMeshJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryMeshJobsService_getPrototypeOf(o); }
  50897. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  50898. * This program are made available under the terms of the Apache License, Version 2.0
  50899. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50900. /**
  50901. * @class SummaryMeshJobsService
  50902. * @deprecatedclass SuperMap.SummaryMeshJobsService
  50903. * @category iServer ProcessingService AggregatePoints
  50904. * @classdesc 点聚合分析任务类。
  50905. * @param {string} url - 服务地址。
  50906. * @param {Object} options - 参数。
  50907. * @param {Events} options.events - 处理所有事件的对象。
  50908. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  50909. * @param {number} options.index - 服务地址在数组中的位置。
  50910. * @param {number} options.length - 服务地址数组长度。
  50911. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  50912. * @param {Object} [options.headers] - 请求头。
  50913. * @usage
  50914. */
  50915. var SummaryMeshJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  50916. SummaryMeshJobsService_inherits(SummaryMeshJobsService, _ProcessingServiceBas);
  50917. var _super = SummaryMeshJobsService_createSuper(SummaryMeshJobsService);
  50918. function SummaryMeshJobsService(url, options) {
  50919. var _this;
  50920. SummaryMeshJobsService_classCallCheck(this, SummaryMeshJobsService);
  50921. _this = _super.call(this, url, options);
  50922. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/aggregatepoints');
  50923. _this.CLASS_NAME = 'SuperMap.SummaryMeshJobsService';
  50924. return _this;
  50925. }
  50926. /**
  50927. * @override
  50928. */
  50929. SummaryMeshJobsService_createClass(SummaryMeshJobsService, [{
  50930. key: "destroy",
  50931. value: function destroy() {
  50932. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "destroy", this).call(this);
  50933. }
  50934. /**
  50935. * @function SummaryMeshJobsService.prototype.getSummaryMeshJobs
  50936. * @description 获取点聚合分析任务
  50937. */
  50938. }, {
  50939. key: "getSummaryMeshJobs",
  50940. value: function getSummaryMeshJobs() {
  50941. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "getJobs", this).call(this, this.url);
  50942. }
  50943. /**
  50944. * @function SummaryMeshJobsService.prototype.getSummaryMeshJob
  50945. * @description 获取指定ip的点聚合分析任务
  50946. * @param {string} id - 指定要获取数据的id
  50947. */
  50948. }, {
  50949. key: "getSummaryMeshJob",
  50950. value: function getSummaryMeshJob(id) {
  50951. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  50952. }
  50953. /**
  50954. * @function SummaryMeshJobsService.prototype.addSummaryMeshJob
  50955. * @description 新建点聚合分析服务
  50956. * @param {SummaryMeshJobParameter} params - 创建一个空间分析的请求参数。
  50957. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  50958. */
  50959. }, {
  50960. key: "addSummaryMeshJob",
  50961. value: function addSummaryMeshJob(params, seconds) {
  50962. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryMeshJobParameter, seconds);
  50963. }
  50964. }]);
  50965. return SummaryMeshJobsService;
  50966. }(ProcessingServiceBase);
  50967. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryRegionJobParameter.js
  50968. function SummaryRegionJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50969. function SummaryRegionJobParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  50970. function SummaryRegionJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryRegionJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryRegionJobParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  50971. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  50972. * This program are made available under the terms of the Apache License, Version 2.0
  50973. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50974. /**
  50975. * @class SummaryRegionJobParameter
  50976. * @deprecatedclass SuperMap.SummaryRegionJobParameter
  50977. * @category iServer ProcessingService SummaryRegion
  50978. * @classdesc 区域汇总分析任务参数类。
  50979. * @param {Object} options - 参数。
  50980. * @param {string} options.datasetName - 数据集名。
  50981. * @param {string} [options.regionDataset] - 汇总数据源(多边形汇总时用到的参数)。
  50982. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} [options.query] - 分析范围(默认为全图范围)。
  50983. * @param {string} [options.standardFields] - 标准属性字段名称。
  50984. * @param {string} [options.weightedFields] - 权重字段名称。
  50985. * @param {StatisticAnalystMode} [options.standardStatisticModes] - 标准属性字段的统计模式。standardSummaryFields 为 true 时必填。
  50986. * @param {StatisticAnalystMode} [options.weightedStatisticModes] - 权重字段的统计模式。weightedSummaryFields 为 true 时必填。
  50987. * @param {boolean} [options.sumShape=true] - 是否统计长度或面积。
  50988. * @param {boolean} [options.standardSummaryFields=false] - 是否以标准属性字段统计。
  50989. * @param {boolean} [options.weightedSummaryFields=false] - 是否以权重字段统计。
  50990. * @param {number} [options.resolution=100] - 网格大小。
  50991. * @param {number} [options.meshType=0] - 网格面汇总类型。
  50992. * @param {AnalystSizeUnit} [options.meshSizeUnit=AnalystSizeUnit.METER] - 网格大小单位。
  50993. * @param {SummaryType} [options.type=SummaryType.SUMMARYMESH] - 汇总类型。
  50994. * @param {OutputSetting} [options.output] - 输出参数设置。
  50995. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  50996. * @usage
  50997. */
  50998. var SummaryRegionJobParameter = /*#__PURE__*/function () {
  50999. function SummaryRegionJobParameter(options) {
  51000. SummaryRegionJobParameter_classCallCheck(this, SummaryRegionJobParameter);
  51001. if (!options) {
  51002. return;
  51003. }
  51004. /**
  51005. * @member {string} SummaryRegionJobParameter.prototype.datasetName
  51006. * @description 数据集名。
  51007. */
  51008. this.datasetName = "";
  51009. /**
  51010. * @member {string} SummaryRegionJobParameter.prototype.regionDataset
  51011. * @description 汇总数据源(多边形汇总时用到的参数)。
  51012. */
  51013. this.regionDataset = "";
  51014. /**
  51015. * @member {boolean} [SummaryRegionJobParameter.prototype.sumShape=true]
  51016. * @description 是否统计长度或面积。
  51017. */
  51018. this.sumShape = true;
  51019. /**
  51020. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} SummaryRegionJobParameter.prototype.query
  51021. * @description 分析范围。
  51022. */
  51023. this.query = "";
  51024. /**
  51025. * @member {boolean} [SummaryRegionJobParameter.prototype.standardSummaryFields=false]
  51026. * @description 是否以标准属字段统计。
  51027. */
  51028. this.standardSummaryFields = false;
  51029. /**
  51030. * @member {string} SummaryRegionJobParameter.prototype.standardFields
  51031. * @description 标准属性字段名称。仅支持系统字段以外的整形、长整形、浮点型的字段的名称。standardSummaryFields 为 true 时必填。
  51032. */
  51033. this.standardFields = "";
  51034. /**
  51035. * @member {StatisticAnalystMode} SummaryRegionJobParameter.prototype.standardStatisticModes
  51036. * @description 标准属性字段的统计模式。standardSummaryFields 为 true 时必填。
  51037. */
  51038. this.standardStatisticModes = "";
  51039. /**
  51040. * @member {boolean} [SummaryRegionJobParameter.prototype.weightedSummaryFields=false]
  51041. * @description 是否以权重字段统计。
  51042. */
  51043. this.weightedSummaryFields = false;
  51044. /**
  51045. * @member {string} SummaryRegionJobParameter.prototype.weightedFields
  51046. * @description 权重字段名称。仅支持系统字段以外的整形、长整形、浮点型的字段的名称。weightedSummaryFields 为 true 时必填。
  51047. */
  51048. this.weightedFields = "";
  51049. /**
  51050. * @member {StatisticAnalystMode} SummaryRegionJobParameter.prototype.weightedStatisticModes
  51051. * @description 以权重字段统计的统计模式。权重字段的统计模式。weightedSummaryFields 为 true 时必填。
  51052. */
  51053. this.weightedStatisticModes = "";
  51054. /**
  51055. * @member {number} [SummaryRegionJobParameter.prototype.meshType=0]
  51056. * @description 网格面汇总类型。
  51057. */
  51058. this.meshType = 0;
  51059. /**
  51060. * @member {number} [SummaryRegionJobParameter.prototype.resolution=100]
  51061. * @description 网格大小。
  51062. */
  51063. this.resolution = 100;
  51064. /**
  51065. * @member {AnalystSizeUnit} [SummaryRegionJobParameter.prototype.meshSizeUnit=AnalystSizeUnit.METER]
  51066. * @description 网格大小单位。
  51067. */
  51068. this.meshSizeUnit = AnalystSizeUnit.METER;
  51069. /**
  51070. * @member {SummaryType} [SummaryRegionJobParameter.prototype.type=SummaryType.SUMMARYMESH]
  51071. * @description 汇总类型。
  51072. */
  51073. this.type = SummaryType.SUMMARYMESH;
  51074. /**
  51075. * @member {OutputSetting} SummaryRegionJobParameter.prototype.output
  51076. * @description 输出参数设置类。
  51077. */
  51078. this.output = null;
  51079. /**
  51080. * @member {MappingParameters} [SummaryRegionJobParameter.prototype.mappingParameters]
  51081. * @description 分析后结果可视化的参数类。
  51082. */
  51083. this.mappingParameters = null;
  51084. Util_Util.extend(this, options);
  51085. this.CLASS_NAME = "SuperMap.SummaryRegionJobParameter";
  51086. }
  51087. /**
  51088. * @function SummaryRegionJobParameter.prototype.destroy
  51089. * @description 释放资源,将引用资源的属性置空。
  51090. */
  51091. SummaryRegionJobParameter_createClass(SummaryRegionJobParameter, [{
  51092. key: "destroy",
  51093. value: function destroy() {
  51094. this.datasetName = null;
  51095. this.sumShape = null;
  51096. this.regionDataset = null;
  51097. this.query = null;
  51098. this.standardSummaryFields = null;
  51099. this.standardFields = null;
  51100. this.standardStatisticModes = null;
  51101. this.weightedSummaryFields = null;
  51102. this.weightedFields = null;
  51103. this.weightedStatisticModes = null;
  51104. this.meshType = null;
  51105. this.resolution = null;
  51106. this.meshSizeUnit = null;
  51107. this.type = null;
  51108. if (this.output instanceof OutputSetting) {
  51109. this.output.destroy();
  51110. this.output = null;
  51111. }
  51112. if (this.mappingParameters instanceof MappingParameters) {
  51113. this.mappingParameters.destroy();
  51114. this.mappingParameters = null;
  51115. }
  51116. }
  51117. /**
  51118. * @function SummaryRegionJobParameter.toObject
  51119. * @param {Object} summaryRegionJobParameter - 矢量裁剪分析任务参数。
  51120. * @param {Object} tempObj - 目标对象。
  51121. * @description 生成区域汇总分析服务对象。
  51122. */
  51123. }], [{
  51124. key: "toObject",
  51125. value: function toObject(summaryRegionJobParameter, tempObj) {
  51126. for (var name in summaryRegionJobParameter) {
  51127. if (name === "datasetName") {
  51128. tempObj['input'] = tempObj['input'] || {};
  51129. tempObj['input'][name] = summaryRegionJobParameter[name];
  51130. continue;
  51131. }
  51132. if (name === "type") {
  51133. tempObj['type'] = summaryRegionJobParameter[name];
  51134. continue;
  51135. }
  51136. if (name === "type") {
  51137. tempObj['type'] = summaryRegionJobParameter[name];
  51138. continue;
  51139. }
  51140. if (name === "output") {
  51141. tempObj['output'] = tempObj['output'] || {};
  51142. tempObj['output'] = summaryRegionJobParameter[name];
  51143. continue;
  51144. }
  51145. if (summaryRegionJobParameter.type === "SUMMARYREGION" || summaryRegionJobParameter.type === "SUMMARYMESH" && name !== "regionDataset") {
  51146. tempObj['analyst'] = tempObj['analyst'] || {};
  51147. if (name === 'query' && summaryRegionJobParameter[name]) {
  51148. tempObj['analyst'][name] = summaryRegionJobParameter[name].toBBOX();
  51149. } else {
  51150. tempObj['analyst'][name] = summaryRegionJobParameter[name];
  51151. }
  51152. if (name === 'mappingParameters') {
  51153. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  51154. tempObj['analyst']['mappingParameters'] = summaryRegionJobParameter[name];
  51155. }
  51156. }
  51157. }
  51158. }
  51159. }]);
  51160. return SummaryRegionJobParameter;
  51161. }();
  51162. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryRegionJobsService.js
  51163. function SummaryRegionJobsService_typeof(obj) { "@babel/helpers - typeof"; return SummaryRegionJobsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SummaryRegionJobsService_typeof(obj); }
  51164. function SummaryRegionJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51165. function SummaryRegionJobsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  51166. function SummaryRegionJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryRegionJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryRegionJobsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  51167. function SummaryRegionJobsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SummaryRegionJobsService_get = Reflect.get.bind(); } else { SummaryRegionJobsService_get = function _get(target, property, receiver) { var base = SummaryRegionJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SummaryRegionJobsService_get.apply(this, arguments); }
  51168. function SummaryRegionJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryRegionJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  51169. function SummaryRegionJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SummaryRegionJobsService_setPrototypeOf(subClass, superClass); }
  51170. function SummaryRegionJobsService_setPrototypeOf(o, p) { SummaryRegionJobsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SummaryRegionJobsService_setPrototypeOf(o, p); }
  51171. function SummaryRegionJobsService_createSuper(Derived) { var hasNativeReflectConstruct = SummaryRegionJobsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SummaryRegionJobsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SummaryRegionJobsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SummaryRegionJobsService_possibleConstructorReturn(this, result); }; }
  51172. function SummaryRegionJobsService_possibleConstructorReturn(self, call) { if (call && (SummaryRegionJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SummaryRegionJobsService_assertThisInitialized(self); }
  51173. function SummaryRegionJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  51174. function SummaryRegionJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  51175. function SummaryRegionJobsService_getPrototypeOf(o) { SummaryRegionJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryRegionJobsService_getPrototypeOf(o); }
  51176. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  51177. * This program are made available under the terms of the Apache License, Version 2.0
  51178. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51179. /**
  51180. * @class SummaryRegionJobsService
  51181. * @deprecatedclass SuperMap.SummaryRegionJobsService
  51182. * @category iServer ProcessingService SummaryRegion
  51183. * @classdesc 区域汇总分析服务类
  51184. * @extends {ProcessingServiceBase}
  51185. * @param {string} url - 服务地址。
  51186. * @param {Object} options - 可选参数。
  51187. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  51188. * @param {Object} [options.headers] - 请求头。
  51189. * @usage
  51190. */
  51191. var SummaryRegionJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  51192. SummaryRegionJobsService_inherits(SummaryRegionJobsService, _ProcessingServiceBas);
  51193. var _super = SummaryRegionJobsService_createSuper(SummaryRegionJobsService);
  51194. function SummaryRegionJobsService(url, options) {
  51195. var _this;
  51196. SummaryRegionJobsService_classCallCheck(this, SummaryRegionJobsService);
  51197. _this = _super.call(this, url, options);
  51198. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/summaryregion');
  51199. _this.CLASS_NAME = 'SuperMap.SummaryRegionJobsService';
  51200. return _this;
  51201. }
  51202. /**
  51203. *@override
  51204. */
  51205. SummaryRegionJobsService_createClass(SummaryRegionJobsService, [{
  51206. key: "destroy",
  51207. value: function destroy() {
  51208. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "destroy", this).call(this);
  51209. }
  51210. /**
  51211. * @function SummaryRegionJobsService.prototype.getSummaryRegionJobs
  51212. * @description 获取区域汇总分析任务集合。
  51213. */
  51214. }, {
  51215. key: "getSummaryRegionJobs",
  51216. value: function getSummaryRegionJobs() {
  51217. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "getJobs", this).call(this, this.url);
  51218. }
  51219. /**
  51220. * @function SummaryRegionJobsService.prototype.getSummaryRegionJob
  51221. * @description 获取指定id的区域汇总分析任务。
  51222. * @param {string} id -要获取区域汇总分析任务的id
  51223. */
  51224. }, {
  51225. key: "getSummaryRegionJob",
  51226. value: function getSummaryRegionJob(id) {
  51227. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  51228. }
  51229. /**
  51230. * @function SummaryRegionJobsService.prototype.addSummaryRegionJob
  51231. * @description 新建区域汇总任务。
  51232. * @param {SummaryRegionJobParameter} params - 区域汇总分析任务参数类。
  51233. * @param {number} seconds - 创建成功结果的时间间隔。
  51234. */
  51235. }, {
  51236. key: "addSummaryRegionJob",
  51237. value: function addSummaryRegionJob(params, seconds) {
  51238. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryRegionJobParameter, seconds);
  51239. }
  51240. }]);
  51241. return SummaryRegionJobsService;
  51242. }(ProcessingServiceBase);
  51243. ;// CONCATENATED MODULE: ./src/common/iServer/SupplyCenter.js
  51244. function SupplyCenter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51245. function SupplyCenter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  51246. function SupplyCenter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SupplyCenter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SupplyCenter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  51247. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  51248. * This program are made available under the terms of the Apache License, Version 2.0
  51249. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51250. /**
  51251. * @class SupplyCenter
  51252. * @deprecatedclass SuperMap.SupplyCenter
  51253. * @category iServer NetworkAnalyst Location
  51254. * @classdesc 资源供给中心类。在资源分配和选址分区分析两个功能中使用。
  51255. * @param {Object} options - 参数。
  51256. * @param {number} options.maxWeight - 最大耗费值。
  51257. * @param {number} options.nodeID - 结点 ID 号。资源供给中心必须是结点。
  51258. * @param {number} options.resourceValue - 能提供的最大服务量或商品数量。
  51259. * @param {SupplyCenterType} [options.type] - 资源供给中心点的类型常量。
  51260. * @usage
  51261. */
  51262. var SupplyCenter = /*#__PURE__*/function () {
  51263. function SupplyCenter(options) {
  51264. SupplyCenter_classCallCheck(this, SupplyCenter);
  51265. /**
  51266. * @member {number} SupplyCenter.prototype.maxWeight
  51267. * @description 资源供给中心的最大耗费值。中心点最大阻值设置越小,表示中心点所提供的资源可影响范围越大。
  51268. * 最大阻力值是用来限制需求点到中心点的花费。
  51269. * 如果需求点(弧段或结点)到此中心的花费大于最大阻力值,则该需求点不属于该资源供给中心提供资源的范围。
  51270. */
  51271. this.maxWeight = null;
  51272. /**
  51273. * @member {number} SupplyCenter.prototype.nodeID
  51274. * @description 资源供给中心点的结点 ID 号,资源供给中心必须是结点。
  51275. */
  51276. this.nodeID = null;
  51277. /**
  51278. * @member {number} SupplyCenter.prototype.resourceValue
  51279. * @description 资源供给中心能提供的最大服务量或商品数量。例如资源中心为学校,资源中心资源量表示该学校能够接纳多少学生。
  51280. */
  51281. this.resourceValue = null;
  51282. /**
  51283. * @member {SupplyCenterType} [SupplyCenter.prototype.type]
  51284. * @description 资源供给中心点的类型常量。资源供给中心点的类型包括非中心,固定中心和可选中心。
  51285. * 固定中心用于资源分配分析;固定中心和可选中心用于选址分析;非中心在两种网络分析时都不予考虑。
  51286. */
  51287. this.type = null;
  51288. if (options) {
  51289. Util_Util.extend(this, options);
  51290. }
  51291. this.CLASS_NAME = "SuperMap.SupplyCenter";
  51292. }
  51293. /**
  51294. * @function SupplyCenter.prototype.destroy
  51295. * @description 释放资源,将引用资源的属性置空。
  51296. */
  51297. SupplyCenter_createClass(SupplyCenter, [{
  51298. key: "destroy",
  51299. value: function destroy() {
  51300. var me = this;
  51301. me.maxWeight = null;
  51302. me.nodeID = null;
  51303. me.resourceValue = null;
  51304. me.type = null;
  51305. }
  51306. /**
  51307. * @function SupplyCenter.fromJson
  51308. * @description 将服务端 JSON 对象转换成当前客户端对象。
  51309. * @param {Object} jsonObject - 要转换的 JSON 对象。
  51310. * @returns {SupplyCenter} SupplyCenter 对象。
  51311. */
  51312. }], [{
  51313. key: "fromJson",
  51314. value: function fromJson(jsonObject) {
  51315. if (!jsonObject) {
  51316. return;
  51317. }
  51318. return new SupplyCenter({
  51319. maxWeight: jsonObject.maxWeight,
  51320. nodeID: jsonObject.nodeID,
  51321. resourceValue: jsonObject.resourceValue,
  51322. type: jsonObject.type
  51323. });
  51324. }
  51325. }]);
  51326. return SupplyCenter;
  51327. }();
  51328. ;// CONCATENATED MODULE: ./src/common/iServer/SurfaceAnalystService.js
  51329. function SurfaceAnalystService_typeof(obj) { "@babel/helpers - typeof"; return SurfaceAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SurfaceAnalystService_typeof(obj); }
  51330. function SurfaceAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51331. function SurfaceAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  51332. function SurfaceAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SurfaceAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SurfaceAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  51333. function SurfaceAnalystService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SurfaceAnalystService_get = Reflect.get.bind(); } else { SurfaceAnalystService_get = function _get(target, property, receiver) { var base = SurfaceAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SurfaceAnalystService_get.apply(this, arguments); }
  51334. function SurfaceAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SurfaceAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  51335. function SurfaceAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SurfaceAnalystService_setPrototypeOf(subClass, superClass); }
  51336. function SurfaceAnalystService_setPrototypeOf(o, p) { SurfaceAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SurfaceAnalystService_setPrototypeOf(o, p); }
  51337. function SurfaceAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = SurfaceAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SurfaceAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SurfaceAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SurfaceAnalystService_possibleConstructorReturn(this, result); }; }
  51338. function SurfaceAnalystService_possibleConstructorReturn(self, call) { if (call && (SurfaceAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SurfaceAnalystService_assertThisInitialized(self); }
  51339. function SurfaceAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  51340. function SurfaceAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  51341. function SurfaceAnalystService_getPrototypeOf(o) { SurfaceAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SurfaceAnalystService_getPrototypeOf(o); }
  51342. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  51343. * This program are made available under the terms of the Apache License, Version 2.0
  51344. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51345. /**
  51346. * @class SurfaceAnalystService
  51347. * @deprecatedclass SuperMap.SurfaceAnalystService
  51348. * @category iServer SpatialAnalyst SurfaceAnalyst
  51349. * @classdesc 表面分析服务类。
  51350. * 该类负责将客户设置的表面分析服务参数传递给服务端,并接收服务端返回的表面分析服务分析结果数据。
  51351. * 表面分析结果通过该类支持的事件的监听函数参数获取
  51352. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst
  51353. * @param {Object} options - 参数。
  51354. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  51355. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  51356. * @param {Object} [options.headers] - 请求头。
  51357. * @extends {SpatialAnalystBase}
  51358. * @example 例如:
  51359. * (start code)
  51360. * var mySurfaceAnalystService = new SurfaceAnalystService(url, {
  51361. * eventListeners: {
  51362. * "processCompleted": surfaceAnalysCompleted,
  51363. * "processFailed": surfaceAnalysFailed
  51364. * }
  51365. * });
  51366. * (end)
  51367. * @usage
  51368. */
  51369. var SurfaceAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  51370. SurfaceAnalystService_inherits(SurfaceAnalystService, _SpatialAnalystBase);
  51371. var _super = SurfaceAnalystService_createSuper(SurfaceAnalystService);
  51372. function SurfaceAnalystService(url, options) {
  51373. var _this;
  51374. SurfaceAnalystService_classCallCheck(this, SurfaceAnalystService);
  51375. _this = _super.call(this, url, options);
  51376. _this.CLASS_NAME = "SuperMap.SurfaceAnalystService";
  51377. return _this;
  51378. }
  51379. /**
  51380. * @function SurfaceAnalystService.prototype.destroy
  51381. * @description 释放资源,将引用的资源属性置空。
  51382. */
  51383. SurfaceAnalystService_createClass(SurfaceAnalystService, [{
  51384. key: "destroy",
  51385. value: function destroy() {
  51386. SurfaceAnalystService_get(SurfaceAnalystService_getPrototypeOf(SurfaceAnalystService.prototype), "destroy", this).call(this);
  51387. }
  51388. /**
  51389. * @function SurfaceAnalystService.prototype.processAsync
  51390. * @description 负责将客户端的表面分析服务参数传递到服务端。
  51391. * @param {SurfaceAnalystParameters} params - 表面分析提取操作参数类。
  51392. */
  51393. }, {
  51394. key: "processAsync",
  51395. value: function processAsync(params) {
  51396. if (!(params instanceof SurfaceAnalystParameters)) {
  51397. return;
  51398. }
  51399. var me = this,
  51400. jsonParameters;
  51401. jsonParameters = me.getJsonParameters(params);
  51402. me.request({
  51403. method: "POST",
  51404. data: jsonParameters,
  51405. scope: me,
  51406. success: me.serviceProcessCompleted,
  51407. failure: me.serviceProcessFailed
  51408. });
  51409. }
  51410. /**
  51411. * @function SurfaceAnalystService.prototype.getJsonParameters
  51412. * @description 将参数转化为 JSON 字符串。
  51413. * @param {SurfaceAnalystParameters} params - 表面分析提取操作参数类。
  51414. * @returns {Object} 转化后的JSON字符串。
  51415. */
  51416. }, {
  51417. key: "getJsonParameters",
  51418. value: function getJsonParameters(params) {
  51419. var jsonParameters = '';
  51420. var parameterObject = {};
  51421. var me = this;
  51422. if (params instanceof DatasetSurfaceAnalystParameters) {
  51423. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + params.dataset + '/' + params.surfaceAnalystMethod.toLowerCase());
  51424. DatasetSurfaceAnalystParameters.toObject(params, parameterObject);
  51425. jsonParameters = Util_Util.toJSON(parameterObject);
  51426. } else if (params instanceof GeometrySurfaceAnalystParameters) {
  51427. me.url = Util_Util.urlPathAppend(me.url, 'geometry/' + params.surfaceAnalystMethod.toLowerCase());
  51428. jsonParameters = Util_Util.toJSON(params);
  51429. } else {
  51430. return;
  51431. }
  51432. this.returnContent = true;
  51433. return jsonParameters;
  51434. }
  51435. }, {
  51436. key: "dataFormat",
  51437. value: function dataFormat() {
  51438. return [DataFormat.GEOJSON, DataFormat.ISERVER, DataFormat.FGB];
  51439. }
  51440. }]);
  51441. return SurfaceAnalystService;
  51442. }(SpatialAnalystBase);
  51443. ;// CONCATENATED MODULE: ./src/common/iServer/TerrainCurvatureCalculationParameters.js
  51444. function TerrainCurvatureCalculationParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51445. function TerrainCurvatureCalculationParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  51446. function TerrainCurvatureCalculationParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) TerrainCurvatureCalculationParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) TerrainCurvatureCalculationParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  51447. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  51448. * This program are made available under the terms of the Apache License, Version 2.0
  51449. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51450. /**
  51451. * @class TerrainCurvatureCalculationParameters
  51452. * @deprecatedclass SuperMap.TerrainCurvatureCalculationParameters
  51453. * @category iServer SpatialAnalyst TerrainCalculation
  51454. * @classdesc 地形曲率计算参数类。
  51455. * @param {Object} options - 参数。
  51456. * @param {string} options.dataset - 地形曲率计算数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示,例如:JingjinTerrain@Jingjin。
  51457. * @param {string} options.averageCurvatureName - 结果数据集:平均曲率数据集的名称。
  51458. * @param {string} options.profileCurvatureName - 结果数据集:剖面曲率数据集的名称。
  51459. * @param {string} options.planCurvatureName - 结果数据集:平面曲率数据集的名称。
  51460. * @param {number} [options.zFactor=1.0] - 指定的高程缩放系数。1.0 表示不缩放。
  51461. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  51462. * @usage
  51463. */
  51464. var TerrainCurvatureCalculationParameters = /*#__PURE__*/function () {
  51465. function TerrainCurvatureCalculationParameters(options) {
  51466. TerrainCurvatureCalculationParameters_classCallCheck(this, TerrainCurvatureCalculationParameters);
  51467. if (!options) {
  51468. return;
  51469. }
  51470. /**
  51471. * @member {string} TerrainCurvatureCalculationParameters.prototype.dataset
  51472. * @description 要用来做地形曲率计算数据源中数据集的名称。
  51473. * 该名称用形如"数据集名称@数据源别名"形式来表示,例如:JingjinTerrain@Jingjin。
  51474. * 注:地形曲率计算必须为栅格数据集。
  51475. */
  51476. this.dataset = null;
  51477. /**
  51478. * @member {number} [TerrainCurvatureCalculationParameters.prototype.zFactor=1.0]
  51479. * @description 指定的高程缩放系数。1.0 表示不缩放。
  51480. * 该值是指在 DEM 栅格数据中,栅格值( Z 坐标,即高程值)相对于 X 和 Y 坐标的单位变换系数。
  51481. * 通常有 X,Y,Z 都参加的计算中,需要将高程值乘以一个高程缩放系数,使得三者单位一致。
  51482. * 例如,X、Y 方向上的单位是米,而 Z 方向的单位是英尺,由于 1 英尺等于 0.3048 米,则需要指定缩放系数为 0.3048。
  51483. */
  51484. this.zFactor = 1.0;
  51485. /**
  51486. * @member {string} TerrainCurvatureCalculationParameters.prototype.averageCurvatureName
  51487. * @description 结果数据集:平均曲率数据集的名称。
  51488. */
  51489. this.averageCurvatureName = null;
  51490. /**
  51491. * @member {string} TerrainCurvatureCalculationParameters.prototype.profileCurvatureName
  51492. * @description 结果数据集:剖面曲率数据集的名称。
  51493. */
  51494. this.profileCurvatureName = "";
  51495. /**
  51496. * @member {string} TerrainCurvatureCalculationParameters.prototype.planCurvatureName
  51497. * @description 结果数据集:平面曲率数据集的名称。
  51498. */
  51499. this.planCurvatureName = "";
  51500. /**
  51501. * @member {boolean} [TerrainCurvatureCalculationParameters.prototype.deleteExistResultDataset=false]
  51502. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  51503. */
  51504. this.deleteExistResultDataset = false;
  51505. Util_Util.extend(this, options);
  51506. this.CLASS_NAME = "SuperMap.TerrainCurvatureCalculationParameters";
  51507. }
  51508. /**
  51509. * @function TerrainCurvatureCalculationParameters.prototype.destroy
  51510. * @description 释放资源,将引用资源的属性置空。
  51511. */
  51512. TerrainCurvatureCalculationParameters_createClass(TerrainCurvatureCalculationParameters, [{
  51513. key: "destroy",
  51514. value: function destroy() {
  51515. var me = this;
  51516. me.dataset = null;
  51517. me.zFactor = 1.0;
  51518. me.averageCurvatureName = null;
  51519. me.profileCurvatureName = null;
  51520. me.planCurvatureName = null;
  51521. me.deleteExistResultDataset = true;
  51522. }
  51523. /**
  51524. * @function TerrainCurvatureCalculationParameters.toObject
  51525. * @param {Object} derrainCurvatureCalculationParameters - 地形曲率计算参数。
  51526. * @param {Object} tempObj - 目标对象。
  51527. * @description 生成地形曲率计算对象。
  51528. */
  51529. }], [{
  51530. key: "toObject",
  51531. value: function toObject(derrainCurvatureCalculationParameters, tempObj) {
  51532. for (var name in derrainCurvatureCalculationParameters) {
  51533. if (name !== "dataset") {
  51534. tempObj[name] = derrainCurvatureCalculationParameters[name];
  51535. }
  51536. }
  51537. }
  51538. }]);
  51539. return TerrainCurvatureCalculationParameters;
  51540. }();
  51541. ;// CONCATENATED MODULE: ./src/common/iServer/TerrainCurvatureCalculationService.js
  51542. function TerrainCurvatureCalculationService_typeof(obj) { "@babel/helpers - typeof"; return TerrainCurvatureCalculationService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, TerrainCurvatureCalculationService_typeof(obj); }
  51543. function TerrainCurvatureCalculationService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51544. function TerrainCurvatureCalculationService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  51545. function TerrainCurvatureCalculationService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TerrainCurvatureCalculationService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TerrainCurvatureCalculationService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  51546. function TerrainCurvatureCalculationService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { TerrainCurvatureCalculationService_get = Reflect.get.bind(); } else { TerrainCurvatureCalculationService_get = function _get(target, property, receiver) { var base = TerrainCurvatureCalculationService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return TerrainCurvatureCalculationService_get.apply(this, arguments); }
  51547. function TerrainCurvatureCalculationService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TerrainCurvatureCalculationService_getPrototypeOf(object); if (object === null) break; } return object; }
  51548. function TerrainCurvatureCalculationService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) TerrainCurvatureCalculationService_setPrototypeOf(subClass, superClass); }
  51549. function TerrainCurvatureCalculationService_setPrototypeOf(o, p) { TerrainCurvatureCalculationService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TerrainCurvatureCalculationService_setPrototypeOf(o, p); }
  51550. function TerrainCurvatureCalculationService_createSuper(Derived) { var hasNativeReflectConstruct = TerrainCurvatureCalculationService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = TerrainCurvatureCalculationService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = TerrainCurvatureCalculationService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return TerrainCurvatureCalculationService_possibleConstructorReturn(this, result); }; }
  51551. function TerrainCurvatureCalculationService_possibleConstructorReturn(self, call) { if (call && (TerrainCurvatureCalculationService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return TerrainCurvatureCalculationService_assertThisInitialized(self); }
  51552. function TerrainCurvatureCalculationService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  51553. function TerrainCurvatureCalculationService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  51554. function TerrainCurvatureCalculationService_getPrototypeOf(o) { TerrainCurvatureCalculationService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TerrainCurvatureCalculationService_getPrototypeOf(o); }
  51555. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  51556. * This program are made available under the terms of the Apache License, Version 2.0
  51557. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51558. /**
  51559. * @class TerrainCurvatureCalculationService
  51560. * @deprecatedclass SuperMap.TerrainCurvatureCalculationService
  51561. * @category iServer SpatialAnalyst TerrainCalculation
  51562. * @classdesc 地形曲率计算服务类。
  51563. * @extends {SpatialAnalystBase}
  51564. * @param {Object} options - 参数。
  51565. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  51566. * @param {string} options.url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst 。
  51567. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  51568. * @param {Object} [options.headers] - 请求头。
  51569. * @example 例如:
  51570. * (start code)
  51571. * var myTerrainCurvatureCalculationService = new TerrainCurvatureCalculationService(url);
  51572. * myTerrainCurvatureCalculationService.on({
  51573. * "processCompleted": processCompleted,
  51574. * "processFailed": processFailed
  51575. * }
  51576. * );
  51577. * (end)
  51578. * @usage
  51579. */
  51580. var TerrainCurvatureCalculationService = /*#__PURE__*/function (_SpatialAnalystBase) {
  51581. TerrainCurvatureCalculationService_inherits(TerrainCurvatureCalculationService, _SpatialAnalystBase);
  51582. var _super = TerrainCurvatureCalculationService_createSuper(TerrainCurvatureCalculationService);
  51583. function TerrainCurvatureCalculationService(url, options) {
  51584. var _this;
  51585. TerrainCurvatureCalculationService_classCallCheck(this, TerrainCurvatureCalculationService);
  51586. _this = _super.call(this, url, options);
  51587. _this.CLASS_NAME = "SuperMap.TerrainCurvatureCalculationService";
  51588. return _this;
  51589. }
  51590. /**
  51591. *@override
  51592. */
  51593. TerrainCurvatureCalculationService_createClass(TerrainCurvatureCalculationService, [{
  51594. key: "destroy",
  51595. value: function destroy() {
  51596. TerrainCurvatureCalculationService_get(TerrainCurvatureCalculationService_getPrototypeOf(TerrainCurvatureCalculationService.prototype), "destroy", this).call(this);
  51597. }
  51598. /**
  51599. * @function TerrainCurvatureCalculationService.prototype.processAsync
  51600. * @description 负责将客户端的查询参数传递到服务端。
  51601. * @param {TerrainCurvatureCalculationParameters} parameter - 地形曲率计算参数类。
  51602. */
  51603. }, {
  51604. key: "processAsync",
  51605. value: function processAsync(parameter) {
  51606. var me = this;
  51607. var parameterObject = {};
  51608. if (parameter instanceof TerrainCurvatureCalculationParameters) {
  51609. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/terraincalculation/curvature');
  51610. }
  51611. TerrainCurvatureCalculationParameters.toObject(parameter, parameterObject);
  51612. var jsonParameters = Util_Util.toJSON(parameterObject);
  51613. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  51614. me.request({
  51615. method: "POST",
  51616. data: jsonParameters,
  51617. scope: me,
  51618. success: me.serviceProcessCompleted,
  51619. failure: me.serviceProcessFailed
  51620. });
  51621. }
  51622. }]);
  51623. return TerrainCurvatureCalculationService;
  51624. }(SpatialAnalystBase);
  51625. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeFlow.js
  51626. function ThemeFlow_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51627. function ThemeFlow_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  51628. function ThemeFlow_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeFlow_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeFlow_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  51629. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  51630. * This program are made available under the terms of the Apache License, Version 2.0
  51631. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51632. /**
  51633. * @class ThemeFlow
  51634. * @deprecatedclass SuperMap.ThemeFlow
  51635. * @private
  51636. * @category iServer Map Theme
  51637. * @classdesc 标签或符号流动显示和牵引线风格设置类。
  51638. * 通过该类可以设置专题图中符号是否流动显示、是否使用牵引线以及牵引线风格。
  51639. * @param {Object} options - 可选参数。
  51640. * @param {boolean} [options.flowEnabled=false] - 是否流动显示标签或符号。
  51641. * @param {boolean} [options.leaderLineDisplayed=false] - 是否显示标签或符号和它标注的对象之间的牵引线。
  51642. * @param {ServerStyle} [options.leaderLineStyle] - 标签或符号与其标注对象之间牵引线的风格。
  51643. * @usage
  51644. */
  51645. var ThemeFlow = /*#__PURE__*/function () {
  51646. function ThemeFlow(options) {
  51647. ThemeFlow_classCallCheck(this, ThemeFlow);
  51648. /**
  51649. * @member {boolean} [ThemeFlow.prototype.flowEnabled=false]
  51650. * @description 是否流动显示标签或符号。<br>
  51651. * 对于标签专题图而言,对于跨越比较大的区域和线条状的几何对象,在一个地图窗口中不能完全显示的情况下,如果其标签位置比较固定,
  51652. * 在当前地图窗口中该对象的标签不可见,则需要通过平移地图来查看对象的标签信息。如果采用了流动显示的效果,在当前地图窗口中,对象即使是部分显示,
  51653. * 其标签也会显示在当前地图窗口中。当平移地图时,对象的标签会随之移动,以保证在当前地图窗口中部分或全部显示的对象其标签都可见,从而可以方便地查看各要素的标签信息。
  51654. */
  51655. this.flowEnabled = false;
  51656. /**
  51657. * @member {boolean} [ThemeFlow.prototype.leaderLineDisplayed=false]
  51658. * @description 是否显示标签或符号和它标注的对象之间的牵引线。false表示不显示标签或符号和它标注的对象之间的牵引线。<br>
  51659. * 只有当 flowEnabled 为 true 时,牵引线才起作用。在当标签流动显示时,其位置不固定,由于牵引线始终指向要素的内点,
  51660. * 因而通过牵引线显示功能可以找到流动的标签或符号实际对应的要素。或者渲染符号偏移它所指向的对象时,图与对象之间可以采用牵引线进行连接。
  51661. */
  51662. this.leaderLineDisplayed = false;
  51663. /**
  51664. * @member {ServerStyle} ThemeFlow.prototype.leaderLineStyle
  51665. * @description 标签或符号与其标注对象之间牵引线的风格。
  51666. */
  51667. this.leaderLineStyle = new ServerStyle();
  51668. if (options) {
  51669. Util_Util.extend(this, options);
  51670. }
  51671. this.CLASS_NAME = "SuperMap.ThemeFlow";
  51672. }
  51673. /**
  51674. * @function ThemeFlow.prototype.destroy
  51675. * @description 释放资源,将引用资源的属性置空。
  51676. */
  51677. ThemeFlow_createClass(ThemeFlow, [{
  51678. key: "destroy",
  51679. value: function destroy() {
  51680. var me = this;
  51681. me.flowEnabled = null;
  51682. me.leaderLineDisplayed = null;
  51683. if (me.leaderLineStyle) {
  51684. me.leaderLineStyle.destroy();
  51685. me.leaderLineStyle = null;
  51686. }
  51687. }
  51688. /**
  51689. * @function ThemeFlow.fromObj
  51690. * @description 从传入对象获取标签或符号流动显示和牵引线风格设置类。
  51691. * @param {Object} obj - 传入对象。
  51692. * @returns {ThemeFlow} ThemeFlow 对象。
  51693. */
  51694. }], [{
  51695. key: "fromObj",
  51696. value: function fromObj(obj) {
  51697. if (!obj) {
  51698. return;
  51699. }
  51700. var res = new ThemeFlow();
  51701. Util_Util.copy(res, obj);
  51702. res.leaderLineStyle = ServerStyle.fromJson(obj.leaderLineStyle);
  51703. return res;
  51704. }
  51705. }]);
  51706. return ThemeFlow;
  51707. }();
  51708. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridRangeItem.js
  51709. function ThemeGridRangeItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51710. function ThemeGridRangeItem_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  51711. function ThemeGridRangeItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridRangeItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridRangeItem_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  51712. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  51713. * This program are made available under the terms of the Apache License, Version 2.0
  51714. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51715. /**
  51716. * @class ThemeGridRangeItem
  51717. * @deprecatedclass SuperMap.ThemeGridRangeItem
  51718. * @category iServer Map Theme
  51719. * @classdesc 栅格分段专题图子项类。在栅格分段专题图中,将栅格值按照某种分段模式被分成多个范围段。
  51720. * 本类用来设置每个范围段的分段起始值、终止值、名称和颜色等。每个分段所表示的范围为 [Start,End)。
  51721. * @param {Object} options - 参数。
  51722. * @param {ServerColor} options.color - 栅格分段专题图中每一个分段专题图子项的对应的颜色。
  51723. * @param {string} [options.caption] - 栅格分段专题图子项的标题。
  51724. * @param {number} [options.end=0] - 栅格分段专题图子项的终止值。
  51725. * @param {number} [options.start=0] - 栅格分段专题图子项的起始值。
  51726. * @param {boolean} [options.visible=true] - 栅格分段专题图子项是否可见。
  51727. * @usage
  51728. */
  51729. var ThemeGridRangeItem = /*#__PURE__*/function () {
  51730. function ThemeGridRangeItem(options) {
  51731. ThemeGridRangeItem_classCallCheck(this, ThemeGridRangeItem);
  51732. /**
  51733. * @member {string} [ThemeGridRangeItem.prototype.caption]
  51734. * @description 栅格分段专题图子项的标题。
  51735. */
  51736. this.caption = null;
  51737. /**
  51738. * @member {ServerColor} ThemeGridRangeItem.prototype.color
  51739. * @description 栅格分段专题图中每一个分段专题图子项的对应的颜色。
  51740. */
  51741. this.color = new ServerColor();
  51742. /**
  51743. * @member {number} [ThemeGridRangeItem.prototype.end=0]
  51744. * @description 栅格分段专题图子项的终止值,即该段专题值范围的最大值。
  51745. */
  51746. this.end = 0;
  51747. /**
  51748. * @member {number} [ThemeGridRangeItem.prototype.start=0]
  51749. * @description 栅格分段专题图子项的起始值,即该段专题值范围的最小值。
  51750. */
  51751. this.start = 0;
  51752. /**
  51753. * @member {boolean} [ThemeGridRangeItem.prototype.visible=true]
  51754. * @description 栅格分段专题图子项是否可见。
  51755. */
  51756. this.visible = true;
  51757. if (options) {
  51758. Util_Util.extend(this, options);
  51759. }
  51760. this.CLASS_NAME = "SuperMap.ThemeGridRangeItem";
  51761. }
  51762. /**
  51763. * @function ThemeGridRangeItem.prototype.destroy
  51764. * @description 释放资源,将引用资源的属性置空。
  51765. */
  51766. ThemeGridRangeItem_createClass(ThemeGridRangeItem, [{
  51767. key: "destroy",
  51768. value: function destroy() {
  51769. var me = this;
  51770. me.caption = null;
  51771. me.end = null;
  51772. me.start = null;
  51773. //需要验证是够存在destroy方法
  51774. if (me.color) {
  51775. me.color.destroy();
  51776. me.color = null;
  51777. }
  51778. me.visible = null;
  51779. }
  51780. /**
  51781. * @function ThemeGridRangeItem.prototype.toServerJSONObject
  51782. * @description 转换成对应的 JSON 格式对象。
  51783. * @returns {Object} 对应的 JSON 格式对象。
  51784. */
  51785. }, {
  51786. key: "toServerJSONObject",
  51787. value: function toServerJSONObject() {
  51788. var obj = {};
  51789. obj = Util_Util.copyAttributes(obj, this);
  51790. if (obj.color) {
  51791. if (obj.color.toServerJSONObject) {
  51792. obj.color = obj.color.toServerJSONObject();
  51793. }
  51794. }
  51795. return obj;
  51796. }
  51797. /**
  51798. * @function ThemeGridRangeItem.fromObj
  51799. * @description 从传入对象获取栅格分段专题图子项类。
  51800. * @param {Object} obj - 传入对象。
  51801. * @returns {ThemeGridRangeItem} ThemeGridRangeItem 对象。
  51802. */
  51803. }], [{
  51804. key: "fromObj",
  51805. value: function fromObj(obj) {
  51806. if (!obj) {
  51807. return;
  51808. }
  51809. var res = new ThemeGridRangeItem();
  51810. Util_Util.copy(res, obj);
  51811. res.color = ServerColor.fromJson(obj.color);
  51812. return res;
  51813. }
  51814. }]);
  51815. return ThemeGridRangeItem;
  51816. }();
  51817. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridRange.js
  51818. function ThemeGridRange_typeof(obj) { "@babel/helpers - typeof"; return ThemeGridRange_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ThemeGridRange_typeof(obj); }
  51819. function ThemeGridRange_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51820. function ThemeGridRange_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  51821. function ThemeGridRange_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridRange_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridRange_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  51822. function ThemeGridRange_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeGridRange_get = Reflect.get.bind(); } else { ThemeGridRange_get = function _get(target, property, receiver) { var base = ThemeGridRange_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ThemeGridRange_get.apply(this, arguments); }
  51823. function ThemeGridRange_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGridRange_getPrototypeOf(object); if (object === null) break; } return object; }
  51824. function ThemeGridRange_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ThemeGridRange_setPrototypeOf(subClass, superClass); }
  51825. function ThemeGridRange_setPrototypeOf(o, p) { ThemeGridRange_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGridRange_setPrototypeOf(o, p); }
  51826. function ThemeGridRange_createSuper(Derived) { var hasNativeReflectConstruct = ThemeGridRange_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThemeGridRange_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThemeGridRange_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThemeGridRange_possibleConstructorReturn(this, result); }; }
  51827. function ThemeGridRange_possibleConstructorReturn(self, call) { if (call && (ThemeGridRange_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ThemeGridRange_assertThisInitialized(self); }
  51828. function ThemeGridRange_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  51829. function ThemeGridRange_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  51830. function ThemeGridRange_getPrototypeOf(o) { ThemeGridRange_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGridRange_getPrototypeOf(o); }
  51831. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  51832. * This program are made available under the terms of the Apache License, Version 2.0
  51833. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51834. /**
  51835. * @class ThemeGridRange
  51836. * @deprecatedclass SuperMap.ThemeGridRange
  51837. * @category iServer Map Theme
  51838. * @classdesc 栅格分段专题图。栅格分段专题图,是将所有单元格的值按照某种分段方式分成多个范围段,值在同一个范围段中的单元格使用相同的颜色进行显示。一般用来反映连续分布现象的数量或程度特征。
  51839. * 比如某年的全国降水量分布图,将各气象站点的观测值经过内插之后生成的栅格数据进行分段显示。
  51840. * 该类类似于分段专题图类,不同点在于分段专题图的操作对象是矢量数据,而栅格分段专题图的操作对象是栅格数据。
  51841. * @extends {CommonTheme}
  51842. * @param {Object} options - 参数。
  51843. * @param {Array.<ThemeGridRangeItem>} options.items - 栅格分段专题图子项数组。
  51844. * @param {boolean} [options.reverseColor=false] - 是否对栅格分段专题图中分段的颜色风格进行反序显示。
  51845. * @param {RangeMode} [options.rangeMode=RangeMode.EQUALINTERVAL] - 分段专题图的分段模式。
  51846. * @param {number} [options.rangeParameter=0] - 分段参数。
  51847. * @param {ColorGradientType} [options.colorGradientType=ColorGradientType.YELLOW_RED] - 渐变颜色枚举类。
  51848. * @usage
  51849. */
  51850. var ThemeGridRange = /*#__PURE__*/function (_Theme) {
  51851. ThemeGridRange_inherits(ThemeGridRange, _Theme);
  51852. var _super = ThemeGridRange_createSuper(ThemeGridRange);
  51853. function ThemeGridRange(options) {
  51854. var _this;
  51855. ThemeGridRange_classCallCheck(this, ThemeGridRange);
  51856. _this = _super.call(this, "GRIDRANGE", options);
  51857. /**
  51858. * @member {Array.<ThemeGridRangeItem>} ThemeGridRange.prototype.items
  51859. * @description 栅格分段专题图子项数组。<br>
  51860. * 在栅格分段专题图中,将栅格值按照某种分段模式被分成多个范围段。
  51861. * 本类用来设置每个栅格范围段的分段起始值、终止值、名称和颜色等。每个分段所表示的范围为 [Start,End)。
  51862. */
  51863. _this.items = null;
  51864. /**
  51865. * @member {RangeMode} [ThemeGridRange.prototype.rangeMode=RangeMode.EQUALINTERVAL]
  51866. * @description 分段专题图的分段模式。<br>
  51867. * 在栅格分段专题图中,作为专题变量的字段或表达式的值按照某种分段方式被分成多个范围段。
  51868. * 目前 SuperMap 提供的分段方式包括:等距离分段法、平方根分段法、标准差分段法、对数分段法、等计数分段法和自定义距离法,
  51869. * 显然这些分段方法根据一定的距离进行分段,因而范围分段专题图所基于的专题变量必须为数值型。
  51870. */
  51871. _this.rangeMode = RangeMode.EQUALINTERVAL;
  51872. /**
  51873. * @member {number} [ThemeGridRange.prototype.rangeParameter=0]
  51874. * @description 分段参数。<br>
  51875. * 当分段模式为等距离分段法,平方根分段,对数分段法,等计数分段法其中一种模式时,该参数用于设置分段个数,必设;当分段模式为标准差分段法时,
  51876. * 该参数不起作用;当分段模式为自定义距离时,该参数用于设置自定义距离。
  51877. */
  51878. _this.rangeParameter = 0;
  51879. /**
  51880. * @member {ColorGradientType} [ThemeGridRange.prototype.colorGradientType=ColorGradientType.YELLOW_RED]
  51881. * @description 渐变颜色枚举类。
  51882. *
  51883. */
  51884. _this.colorGradientType = ColorGradientType.YELLOW_RED;
  51885. /**
  51886. * @member {boolean} ThemeGridRange.prototype.reverseColor
  51887. * @description 是否对栅格分段专题图中分段的颜色风格进行反序显示。
  51888. */
  51889. _this.reverseColor = false;
  51890. if (options) {
  51891. Util_Util.extend(ThemeGridRange_assertThisInitialized(_this), options);
  51892. }
  51893. _this.CLASS_NAME = "SuperMap.ThemeGridRange";
  51894. return _this;
  51895. }
  51896. /**
  51897. * @function ThemeGridRange.prototype.destroy
  51898. * @override
  51899. */
  51900. ThemeGridRange_createClass(ThemeGridRange, [{
  51901. key: "destroy",
  51902. value: function destroy() {
  51903. ThemeGridRange_get(ThemeGridRange_getPrototypeOf(ThemeGridRange.prototype), "destroy", this).call(this);
  51904. var me = this;
  51905. if (me.items) {
  51906. if (me.items.length > 0) {
  51907. for (var item in me.items) {
  51908. me.items[item].destroy();
  51909. me.items[item] = null;
  51910. }
  51911. }
  51912. me.items = null;
  51913. }
  51914. me.reverseColor = null;
  51915. me.rangeMode = null;
  51916. me.rangeParameter = null;
  51917. me.colorGradientType = null;
  51918. }
  51919. /**
  51920. * @function ThemeGridRange.fromObj
  51921. * @description 从传入对象获取栅格分段专题图。
  51922. * @param {Object} obj - 传入对象。
  51923. * @returns {ThemeGridRange} ThemeGridRange 对象。
  51924. */
  51925. }], [{
  51926. key: "fromObj",
  51927. value: function fromObj(obj) {
  51928. if (!obj) {
  51929. return;
  51930. }
  51931. var res = new ThemeGridRange();
  51932. Util_Util.copy(res, obj);
  51933. var itemsR = obj.items;
  51934. var len = itemsR ? itemsR.length : 0;
  51935. res.items = [];
  51936. for (var i = 0; i < len; i++) {
  51937. res.items.push(ThemeGridRangeItem.fromObj(itemsR[i]));
  51938. }
  51939. return res;
  51940. }
  51941. }]);
  51942. return ThemeGridRange;
  51943. }(Theme);
  51944. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridUniqueItem.js
  51945. function ThemeGridUniqueItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51946. function ThemeGridUniqueItem_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  51947. function ThemeGridUniqueItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridUniqueItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridUniqueItem_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  51948. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  51949. * This program are made available under the terms of the Apache License, Version 2.0
  51950. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51951. /**
  51952. * @class ThemeGridUniqueItem
  51953. * @deprecatedclass SuperMap.ThemeGridUniqueItem
  51954. * @category iServer Map Theme
  51955. * @classdesc 栅格单值专题图子项类。
  51956. * 栅格单值专题图是将值相同的单元格归为一类,每一类是一个专题图子项。
  51957. * @param {Object} options - 可选参数。
  51958. * @param {string} [options.caption] - 子项的名称。
  51959. * @param {ServerColor} [options.color] - 子项的显示颜色。
  51960. * @param {number} options.unique - 子项的专题值,即单元格的值,值相同的单元格位于一个子项内。
  51961. * @param {boolean} [options.visible=true] - 子项是否可见。
  51962. * @usage
  51963. */
  51964. var ThemeGridUniqueItem = /*#__PURE__*/function () {
  51965. function ThemeGridUniqueItem(options) {
  51966. ThemeGridUniqueItem_classCallCheck(this, ThemeGridUniqueItem);
  51967. /**
  51968. * @member {string} [ThemeGridUniqueItem.prototype.caption]
  51969. * @description 栅格单值专题图子项的名称。
  51970. */
  51971. this.caption = null;
  51972. /**
  51973. * @member {ServerColor} [ThemeGridUniqueItem.prototype.color]
  51974. * @description 栅格单值专题图子项的显示颜色。
  51975. */
  51976. this.color = new ServerColor();
  51977. /**
  51978. * @member {number} ThemeGridUniqueItem.prototype.unique
  51979. * @description 栅格单值专题图子项的专题值,即单元格的值,值相同的单元格位于一个子项内。
  51980. */
  51981. this.unique = null;
  51982. /**
  51983. * @member {boolean} [ThemeGridUniqueItem.prototype.visible=true]
  51984. * @description 栅格单值专题图子项是否可见。
  51985. */
  51986. this.visible = true;
  51987. if (options) {
  51988. Util_Util.extend(this, options);
  51989. }
  51990. this.CLASS_NAME = "SuperMap.ThemeGridUniqueItem";
  51991. }
  51992. /**
  51993. * @function ThemeGridUniqueItem.prototype.destroy
  51994. * @description 释放资源,将引用资源的属性置空。
  51995. */
  51996. ThemeGridUniqueItem_createClass(ThemeGridUniqueItem, [{
  51997. key: "destroy",
  51998. value: function destroy() {
  51999. var me = this;
  52000. me.caption = null;
  52001. me.unique = null;
  52002. if (me.color) {
  52003. me.color.destroy();
  52004. me.color = null;
  52005. }
  52006. me.visible = null;
  52007. }
  52008. /**
  52009. * @function ThemeGridUniqueItem.prototype.toServerJSONObject
  52010. * @description 转换成对应的 JSON 格式对象。
  52011. * @returns {Object} 对应的 JSON 格式对象。
  52012. */
  52013. }, {
  52014. key: "toServerJSONObject",
  52015. value: function toServerJSONObject() {
  52016. var obj = {};
  52017. obj = Util_Util.copyAttributes(obj, this);
  52018. if (obj.color) {
  52019. if (obj.color.toServerJSONObject) {
  52020. obj.color = obj.color.toServerJSONObject();
  52021. }
  52022. }
  52023. return obj;
  52024. }
  52025. /**
  52026. * @function ThemeGridUniqueItem.fromObj
  52027. * @description 从传入对象获取栅格单值专题图子项类。
  52028. * @param {Object} obj - 传入对象。
  52029. * @returns {ThemeGridUniqueItem} ThemeGridUniqueItem 对象。
  52030. */
  52031. }], [{
  52032. key: "fromObj",
  52033. value: function fromObj(obj) {
  52034. var res = new ThemeGridUniqueItem();
  52035. Util_Util.copy(res, obj);
  52036. res.color = ServerColor.fromJson(obj.color);
  52037. return res;
  52038. }
  52039. }]);
  52040. return ThemeGridUniqueItem;
  52041. }();
  52042. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridUnique.js
  52043. function ThemeGridUnique_typeof(obj) { "@babel/helpers - typeof"; return ThemeGridUnique_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ThemeGridUnique_typeof(obj); }
  52044. function ThemeGridUnique_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52045. function ThemeGridUnique_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  52046. function ThemeGridUnique_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridUnique_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridUnique_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  52047. function ThemeGridUnique_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeGridUnique_get = Reflect.get.bind(); } else { ThemeGridUnique_get = function _get(target, property, receiver) { var base = ThemeGridUnique_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ThemeGridUnique_get.apply(this, arguments); }
  52048. function ThemeGridUnique_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGridUnique_getPrototypeOf(object); if (object === null) break; } return object; }
  52049. function ThemeGridUnique_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ThemeGridUnique_setPrototypeOf(subClass, superClass); }
  52050. function ThemeGridUnique_setPrototypeOf(o, p) { ThemeGridUnique_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGridUnique_setPrototypeOf(o, p); }
  52051. function ThemeGridUnique_createSuper(Derived) { var hasNativeReflectConstruct = ThemeGridUnique_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThemeGridUnique_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThemeGridUnique_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThemeGridUnique_possibleConstructorReturn(this, result); }; }
  52052. function ThemeGridUnique_possibleConstructorReturn(self, call) { if (call && (ThemeGridUnique_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ThemeGridUnique_assertThisInitialized(self); }
  52053. function ThemeGridUnique_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  52054. function ThemeGridUnique_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  52055. function ThemeGridUnique_getPrototypeOf(o) { ThemeGridUnique_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGridUnique_getPrototypeOf(o); }
  52056. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  52057. * This program are made available under the terms of the Apache License, Version 2.0
  52058. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52059. /**
  52060. * @class ThemeGridUnique
  52061. * @deprecatedclass SuperMap.ThemeGridUnique
  52062. * @category iServer Map Theme
  52063. * @classdesc 栅格单值专题图类。栅格单值专题图是将单元格值相同的归为一类,为每一类设定一种颜色,从而用来区分不同的类别。
  52064. * 适用于离散栅格数据和部分连续栅格数据,对于单元格值各不相同的那些连续栅格数据,使用栅格单值专题图不具有任何意义。
  52065. * @extends {CommonTheme}
  52066. * @param {Object} options - 参数。
  52067. * @param {Array.<ThemeGridUniqueItem>} options.items - 栅格单值专题图子项数组。
  52068. * @param {ServerColor} [options.defaultcolor] - 栅格单值专题图的默认颜色。
  52069. * @usage
  52070. */
  52071. var ThemeGridUnique = /*#__PURE__*/function (_Theme) {
  52072. ThemeGridUnique_inherits(ThemeGridUnique, _Theme);
  52073. var _super = ThemeGridUnique_createSuper(ThemeGridUnique);
  52074. function ThemeGridUnique(options) {
  52075. var _this;
  52076. ThemeGridUnique_classCallCheck(this, ThemeGridUnique);
  52077. _this = _super.call(this, "GRIDUNIQUE", options);
  52078. /**
  52079. * @member {ServerColor} ThemeGridUnique.prototype.defaultcolor
  52080. * @description 栅格单值专题图的默认颜色。
  52081. * 对于那些未在格网单值专题图子项之列的要素使用该颜色显示。
  52082. */
  52083. _this.defaultcolor = new ServerColor();
  52084. /**
  52085. * @member {Array.<ThemeGridUniqueItem>} ThemeGridUnique.prototype.items
  52086. * @description 栅格单值专题图子项数组。
  52087. * 栅格单值专题图将值相同的单元格归为一类,每一类是一个专题图子项。
  52088. */
  52089. _this.items = null;
  52090. if (options) {
  52091. Util_Util.extend(ThemeGridUnique_assertThisInitialized(_this), options);
  52092. }
  52093. _this.CLASS_NAME = "SuperMap.ThemeGridUnique";
  52094. return _this;
  52095. }
  52096. /**
  52097. * @function ThemeGridUnique.prototype.destroy
  52098. * @override
  52099. */
  52100. ThemeGridUnique_createClass(ThemeGridUnique, [{
  52101. key: "destroy",
  52102. value: function destroy() {
  52103. ThemeGridUnique_get(ThemeGridUnique_getPrototypeOf(ThemeGridUnique.prototype), "destroy", this).call(this);
  52104. var me = this;
  52105. if (me.items) {
  52106. if (me.items.length > 0) {
  52107. for (var item in me.items) {
  52108. me.items[item].destroy();
  52109. me.items[item] = null;
  52110. }
  52111. }
  52112. me.items = null;
  52113. }
  52114. if (me.defaultcolor) {
  52115. me.defaultcolor.destroy();
  52116. me.defaultcolor = null;
  52117. }
  52118. }
  52119. /**
  52120. * @function ThemeGridUnique.prototype.toServerJSONObject
  52121. * @description 转换成对应的 JSON 格式对象。
  52122. * @returns {Object} 对应的 JSON 格式对象
  52123. */
  52124. }, {
  52125. key: "toServerJSONObject",
  52126. value: function toServerJSONObject() {
  52127. var obj = {};
  52128. obj = Util_Util.copyAttributes(obj, this);
  52129. if (obj.defaultcolor) {
  52130. if (obj.defaultcolor.toServerJSONObject) {
  52131. obj.defaultcolor = obj.defaultcolor.toServerJSONObject();
  52132. }
  52133. }
  52134. if (obj.items) {
  52135. var items = [],
  52136. len = obj.items.length;
  52137. for (var i = 0; i < len; i++) {
  52138. items.push(obj.items[i].toServerJSONObject());
  52139. }
  52140. obj.items = items;
  52141. }
  52142. return obj;
  52143. }
  52144. /**
  52145. * @function ThemeGridUnique.fromObj
  52146. * @description 从传入对象获取栅格单值专题图类。
  52147. * @param {Object} obj - 传入对象
  52148. * @returns {ThemeGridUnique} ThemeGridUnique 对象
  52149. */
  52150. }], [{
  52151. key: "fromObj",
  52152. value: function fromObj(obj) {
  52153. var res = new ThemeGridUnique();
  52154. var uItems = obj.items;
  52155. var len = uItems ? uItems.length : 0;
  52156. Util_Util.extend(res, obj);
  52157. res.items = [];
  52158. res.defaultcolor = ServerColor.fromJson(obj.defaultcolor);
  52159. for (var i = 0; i < len; i++) {
  52160. res.items.push(ThemeGridUniqueItem.fromObj(uItems[i]));
  52161. }
  52162. return res;
  52163. }
  52164. }]);
  52165. return ThemeGridUnique;
  52166. }(Theme);
  52167. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelUniqueItem.js
  52168. function ThemeLabelUniqueItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52169. function ThemeLabelUniqueItem_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  52170. function ThemeLabelUniqueItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelUniqueItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelUniqueItem_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  52171. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  52172. * This program are made available under the terms of the Apache License, Version 2.0
  52173. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52174. /**
  52175. * @class ThemeLabelUniqueItem
  52176. * @deprecatedclass SuperMap.ThemeLabelUniqueItem
  52177. * @category iServer Map Theme
  52178. * @classdesc 单值标签专题图的子项。标签专题图用专题值对点、线、面等对象做标注,值得注意的是,单值标签专题图允许用户通过 uniqueExpression
  52179. * 字段指定用于单值的字段,同一值的标签具有相同的显示风格,其中每一个值就是一个专题图子项,
  52180. * 每一个子项都具有其名称、风格、指定的单值、X 方向偏移量和 Y 方向偏移量。
  52181. * @param {Object} options - 参数。
  52182. * @param {string} options.unique - 子项的值,可以为数字、字符串等。
  52183. * @param {string} [options.caption] - 子项的名称。
  52184. * @param {number} [options.offsetX=0] - 标签在 X 方向偏移量。
  52185. * @param {number} [options.offsetY=0] - 标签在 Y 方向偏移量。
  52186. * @param {boolean} [options.visible=true] - 子项是否可见。
  52187. * @param {ServerTextStyle} [options.style] - 子项文本的显示风格。
  52188. * @usage
  52189. */
  52190. var ThemeLabelUniqueItem = /*#__PURE__*/function () {
  52191. function ThemeLabelUniqueItem(options) {
  52192. ThemeLabelUniqueItem_classCallCheck(this, ThemeLabelUniqueItem);
  52193. /**
  52194. * @member {string} [ThemeLabelUniqueItem.prototype.caption]
  52195. * @description 标签专题子项的标题。
  52196. */
  52197. this.caption = null;
  52198. /**
  52199. * @member {string} ThemeLabelUniqueItem.prototype.unique
  52200. * @description 单值专题图子项的值,可以为数字、字符串等。
  52201. */
  52202. this.unique = null;
  52203. /**
  52204. * @member {number} [ThemeLabelUniqueItem.prototype.offsetX=0]
  52205. * @description 标签在 X 方向偏移量。
  52206. */
  52207. this.offsetX = 0;
  52208. /**
  52209. * @member {number} [ThemeLabelUniqueItem.prototype.offsetY=0]
  52210. * @description 标签在 Y 方向偏移量。
  52211. */
  52212. this.offsetY = 0;
  52213. /**
  52214. * @member {boolean} [ThemeLabelUniqueItem.prototype.visible=true]
  52215. * @description 标签专题图子项是否可见。如果标签专题图子项可见,则为 true,否则为 false。
  52216. */
  52217. this.visible = true;
  52218. /**
  52219. * @member {ServerTextStyle} ThemeLabelUniqueItem.prototype.style
  52220. * @description 标签专题图子项文本的显示风格。各种风格的优先级从高到低为:<br>
  52221. * uniformMixedStyle(标签文本的复合风格),ThemeLabelUniqueItem.style(单值子项的文本风格),uniformStyle(统一文本风格)。
  52222. */
  52223. this.style = new ServerTextStyle();
  52224. if (options) {
  52225. Util_Util.extend(this, options);
  52226. }
  52227. this.CLASS_NAME = "SuperMap.ThemeLabelUniqueItem";
  52228. }
  52229. /**
  52230. * @function ThemeLabelUniqueItem.prototype.destroy
  52231. * @description 释放资源,将引用资源的属性置空。
  52232. */
  52233. ThemeLabelUniqueItem_createClass(ThemeLabelUniqueItem, [{
  52234. key: "destroy",
  52235. value: function destroy() {
  52236. var me = this;
  52237. me.unique = null;
  52238. me.caption = null;
  52239. me.offsetX = null;
  52240. me.offsetY = null;
  52241. if (me.style) {
  52242. me.style.destroy();
  52243. me.style = null;
  52244. }
  52245. me.visible = null;
  52246. }
  52247. /**
  52248. * @function ThemeLabelUniqueItem.fromObj
  52249. * @description 从传入对象获取单值标签专题图的子项类。
  52250. * @param {Object} obj - 传入对象。
  52251. * @returns {ThemeLabelUniqueItem} ThemeLabelUniqueItem 对象。
  52252. */
  52253. }], [{
  52254. key: "fromObj",
  52255. value: function fromObj(obj) {
  52256. if (!obj) {
  52257. return;
  52258. }
  52259. var t = new ThemeLabelUniqueItem();
  52260. Util_Util.copy(t, obj);
  52261. return t;
  52262. }
  52263. }]);
  52264. return ThemeLabelUniqueItem;
  52265. }();
  52266. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeMemoryData.js
  52267. function ThemeMemoryData_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52268. function ThemeMemoryData_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  52269. function ThemeMemoryData_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeMemoryData_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeMemoryData_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  52270. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  52271. * This program are made available under the terms of the Apache License, Version 2.0
  52272. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52273. /**
  52274. * @class ThemeMemoryData
  52275. * @deprecatedclass SuperMap.ThemeMemoryData
  52276. * @category iServer Map Theme
  52277. * @classdesc 专题图内存数据类。
  52278. * @param {Array} srcData - 原始值数组。
  52279. * @param {Array} targetData - 外部值数组。
  52280. * @usage
  52281. */
  52282. var ThemeMemoryData = /*#__PURE__*/function () {
  52283. function ThemeMemoryData(srcData, targetData) {
  52284. ThemeMemoryData_classCallCheck(this, ThemeMemoryData);
  52285. /**
  52286. * @member {Array} ThemeMemoryData.prototype.srcData
  52287. * @description 原始值数组,该属性值将被 targetData 属性所指定的值替换掉,然后制作专题图,但数据库中的值并不会改变。
  52288. */
  52289. this.srcData = srcData;
  52290. /**
  52291. * @member {Array} ThemeMemoryData.prototype.targetData
  52292. * @description 外部值数组,即用于制作专题图的内存数据,设定该属性值后,会将 srcData 属性所指定的原始值替换掉制作专题图,但数据库中的值并不会改变。
  52293. */
  52294. this.targetData = targetData;
  52295. this.CLASS_NAME = "SuperMap.ThemeMemoryData";
  52296. }
  52297. /**
  52298. * @function ThemeMemoryData.prototype.destroy
  52299. * @description 释放资源,将引用资源的属性置空。
  52300. */
  52301. ThemeMemoryData_createClass(ThemeMemoryData, [{
  52302. key: "destroy",
  52303. value: function destroy() {
  52304. var me = this;
  52305. me.srcData = null;
  52306. me.targetData = null;
  52307. }
  52308. /**
  52309. * @function ThemeMemoryData.prototype.toJSON
  52310. * @description 将 ThemeMemoryData 对象转化为 JSON 字符串。
  52311. * @returns {string} 返回转换后的 JSON 字符串。
  52312. */
  52313. }, {
  52314. key: "toJSON",
  52315. value: function toJSON() {
  52316. if (this.srcData && this.targetData) {
  52317. var memoryDataStr = "";
  52318. var count = Math.min(this.srcData.length, this.targetData.length);
  52319. for (var i = 0; i < count; i++) {
  52320. memoryDataStr += "\'" + this.srcData[i] + "\':\'" + this.targetData[i] + "\',";
  52321. }
  52322. //去除多余的逗号
  52323. if (i > 0) {
  52324. memoryDataStr = memoryDataStr.substring(0, memoryDataStr.length - 1);
  52325. }
  52326. return "{" + memoryDataStr + "}";
  52327. } else {
  52328. return null;
  52329. }
  52330. }
  52331. }]);
  52332. return ThemeMemoryData;
  52333. }();
  52334. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeParameters.js
  52335. function ThemeParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52336. function ThemeParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  52337. function ThemeParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  52338. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  52339. * This program are made available under the terms of the Apache License, Version 2.0
  52340. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52341. /**
  52342. * @class ThemeParameters
  52343. * @deprecatedclass SuperMap.ThemeParameters
  52344. * @category iServer Map Theme
  52345. * @classdesc 专题图参数类。
  52346. * 该类存储了制作专题所需的参数,包括数据源、数据集名称和专题图对象。
  52347. * @param {Object} options - 参数。
  52348. * @param {Array.<string>} options.datasetNames - 数据集数组。
  52349. * @param {Array.<string>} options.dataSourceNames - 数据源数组。
  52350. * @param {Array.<JoinItem>} [options.joinItems] - 专题图外部表的连接信息 JoinItem 数组。
  52351. * @param {Array.<CommonTheme>} options.themes - 专题图对象列表。
  52352. * @param {Array.<string>} [options.displayFilters] - 专题图属性过滤条件。
  52353. * @param {Array.<string>} [options.displayOrderBys] - 专题图对象生成符号叠加次序排序字段。
  52354. * @param {Object} [options.fieldValuesDisplayFilter] - 图层要素的显示和隐藏的过滤属性,其带有三个属性,分别是:values、fieldName、fieldValuesDisplayMode。
  52355. * @usage
  52356. */
  52357. var ThemeParameters = /*#__PURE__*/function () {
  52358. function ThemeParameters(options) {
  52359. ThemeParameters_classCallCheck(this, ThemeParameters);
  52360. /**
  52361. * @member {Array.<string>} ThemeParameters.prototype.datasetNames
  52362. * @description 要制作专题图的数据集数组。
  52363. */
  52364. this.datasetNames = null;
  52365. /**
  52366. * @member {Array.<string>} ThemeParameters.prototype.dataSourceNames
  52367. * @description 要制作专题图的数据集所在的数据源数组。
  52368. */
  52369. this.dataSourceNames = null;
  52370. /**
  52371. * @member {Array.<JoinItem>} [ThemeParameters.prototype.joinItems]
  52372. * @description 设置与外部表的连接信息 JoinItem 数组。
  52373. * 使用此属性可以制作与外部表连接的专题图。
  52374. */
  52375. this.joinItems = null;
  52376. /**
  52377. * @member {Array.<CommonTheme>} ThemeParameters.prototype.themes
  52378. * @description 专题图对象列表。
  52379. * 该参数为实例化的各类专题图对象的集合。
  52380. */
  52381. this.themes = null;
  52382. /**
  52383. * @member {Array.<string>} [ThemeParameters.prototype.displayFilters]
  52384. * @description 专题图属性过滤条件。
  52385. */
  52386. this.displayFilters = null;
  52387. /**
  52388. * @member {Array.<string>} [ThemeParameters.prototype.displayOrderBys]
  52389. * @description 专题图对象生成符号叠加次序排序字段。
  52390. */
  52391. this.displayOrderBys = null;
  52392. /**
  52393. * @member {Object} [ThemeParameters.prototype.fieldValuesDisplayFilter]
  52394. * @property {Array.<number>} values - 待过滤的值。
  52395. * @property {string} fieldName - 待过滤的字段名称只支持数字类型的字段。
  52396. * @property {string} fieldValuesDisplayMode - 目前为 DISPLAY/DISABLE。当为 DISPLAY 时,表示只显示以上设置的相应属性值的要素,否则表示不显示以上设置的相应属性值的要素。
  52397. */
  52398. this.fieldValuesDisplayFilter = null;
  52399. if (options) {
  52400. Util_Util.extend(this, options);
  52401. }
  52402. this.CLASS_NAME = "SuperMap.ThemeParameters";
  52403. }
  52404. /**
  52405. * @function ThemeParameters.prototype.destroy
  52406. * @description 释放资源,将引用资源的属性置空。
  52407. */
  52408. ThemeParameters_createClass(ThemeParameters, [{
  52409. key: "destroy",
  52410. value: function destroy() {
  52411. var me = this;
  52412. me.datasetNames = null;
  52413. me.dataSourceNames = null;
  52414. if (me.joinItems) {
  52415. for (var i = 0, joinItems = me.joinItems, len = joinItems.length; i < len; i++) {
  52416. joinItems[i].destroy();
  52417. }
  52418. me.joinItems = null;
  52419. }
  52420. if (me.themes) {
  52421. for (var _i2 = 0, themes = me.themes, _len2 = themes.length; _i2 < _len2; _i2++) {
  52422. themes[_i2].destroy();
  52423. }
  52424. me.themes = null;
  52425. }
  52426. }
  52427. }]);
  52428. return ThemeParameters;
  52429. }();
  52430. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeService.js
  52431. function ThemeService_typeof(obj) { "@babel/helpers - typeof"; return ThemeService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ThemeService_typeof(obj); }
  52432. function ThemeService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52433. function ThemeService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  52434. function ThemeService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  52435. function ThemeService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeService_get = Reflect.get.bind(); } else { ThemeService_get = function _get(target, property, receiver) { var base = ThemeService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ThemeService_get.apply(this, arguments); }
  52436. function ThemeService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeService_getPrototypeOf(object); if (object === null) break; } return object; }
  52437. function ThemeService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ThemeService_setPrototypeOf(subClass, superClass); }
  52438. function ThemeService_setPrototypeOf(o, p) { ThemeService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeService_setPrototypeOf(o, p); }
  52439. function ThemeService_createSuper(Derived) { var hasNativeReflectConstruct = ThemeService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThemeService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThemeService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThemeService_possibleConstructorReturn(this, result); }; }
  52440. function ThemeService_possibleConstructorReturn(self, call) { if (call && (ThemeService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ThemeService_assertThisInitialized(self); }
  52441. function ThemeService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  52442. function ThemeService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  52443. function ThemeService_getPrototypeOf(o) { ThemeService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeService_getPrototypeOf(o); }
  52444. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  52445. * This program are made available under the terms of the Apache License, Version 2.0
  52446. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52447. /**
  52448. * @class ThemeService
  52449. * @deprecatedclass SuperMap.ThemeService
  52450. * @category iServer Map Theme
  52451. * @classdesc 专题图服务类。
  52452. * @extends {CommonServiceBase}
  52453. * @example
  52454. * var myThemeService = new ThemeService(url, {
  52455. * eventListeners: {
  52456. * "processCompleted": themeCompleted,
  52457. * "processFailed": themeFailed
  52458. * }
  52459. * });
  52460. * @param {string} url - 服务地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
  52461. * @param {Object} options - 参数。
  52462. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  52463. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  52464. * @param {Object} [options.headers] - 请求头。
  52465. * @usage
  52466. */
  52467. var ThemeService_ThemeService = /*#__PURE__*/function (_CommonServiceBase) {
  52468. ThemeService_inherits(ThemeService, _CommonServiceBase);
  52469. var _super = ThemeService_createSuper(ThemeService);
  52470. function ThemeService(url, options) {
  52471. var _this;
  52472. ThemeService_classCallCheck(this, ThemeService);
  52473. _this = _super.call(this, url, options);
  52474. if (options) {
  52475. Util_Util.extend(ThemeService_assertThisInitialized(_this), options);
  52476. }
  52477. _this.eventCount = 0;
  52478. _this.url = Util_Util.urlPathAppend(_this.url, 'tempLayersSet');
  52479. _this.CLASS_NAME = 'SuperMap.ThemeService';
  52480. return _this;
  52481. }
  52482. /**
  52483. * @override
  52484. */
  52485. ThemeService_createClass(ThemeService, [{
  52486. key: "destroy",
  52487. value: function destroy() {
  52488. ThemeService_get(ThemeService_getPrototypeOf(ThemeService.prototype), "destroy", this).call(this);
  52489. }
  52490. /**
  52491. * @function ThemeService.prototype.processAsync
  52492. * @description 负责将客户端的专题图参数传递到服务端。
  52493. * @param {ThemeParameters} params - 专题图参数类。
  52494. */
  52495. }, {
  52496. key: "processAsync",
  52497. value: function processAsync(params, callback) {
  52498. if (!(params instanceof ThemeParameters)) {
  52499. return;
  52500. }
  52501. var me = this,
  52502. jsonParameters = null;
  52503. jsonParameters = me.getJsonParameters(params);
  52504. var eventId = ++this.eventCount;
  52505. var eventListeners = {
  52506. scope: this,
  52507. processCompleted: function processCompleted(result) {
  52508. if (eventId === result.result.eventId && callback) {
  52509. delete result.result.eventId;
  52510. callback(result);
  52511. this.events && this.events.un(eventListeners);
  52512. return false;
  52513. }
  52514. },
  52515. processFailed: function processFailed(result) {
  52516. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  52517. callback(result);
  52518. this.events && this.events.un(eventListeners);
  52519. return false;
  52520. }
  52521. }
  52522. };
  52523. this.events.on(eventListeners);
  52524. me.request({
  52525. method: "POST",
  52526. data: jsonParameters,
  52527. scope: me,
  52528. success: function success(result, options) {
  52529. result.eventId = eventId;
  52530. this.serviceProcessCompleted(result, options);
  52531. },
  52532. failure: function failure(result, options) {
  52533. if (result.error) {
  52534. result.error.eventId = eventId;
  52535. }
  52536. result.eventId = eventId;
  52537. this.serviceProcessFailed(result, options);
  52538. }
  52539. });
  52540. }
  52541. /**
  52542. * @function ThemeService.prototype.getJsonParameters
  52543. * @description 将专题图参数参数转化为 JSON 字符串。
  52544. * @param {ThemeParameters} parameter - 专题图参数类。
  52545. * @returns {Object} 转化后的JSON字符串。
  52546. */
  52547. }, {
  52548. key: "getJsonParameters",
  52549. value: function getJsonParameters(parameter) {
  52550. var jsonParameters = "",
  52551. themeObj = null,
  52552. filters = null,
  52553. orderBys = null,
  52554. fieldValuesDisplayFilter;
  52555. jsonParameters += "[{'type': 'UGC','subLayers': {'layers': [";
  52556. for (var i = 0; i < parameter.themes.length; i++) {
  52557. themeObj = parameter.themes[i];
  52558. var jsonTheme = Util_Util.toJSON(themeObj);
  52559. jsonTheme = jsonTheme.slice(0, -1);
  52560. jsonParameters += "{'theme': " + jsonTheme + "},'type': 'UGC','ugcLayerType': 'THEME',";
  52561. filters = parameter.displayFilters;
  52562. if (filters && filters.length > 0) {
  52563. if (filters.length === 1) {
  52564. jsonParameters += "'displayFilter':\"" + filters[0] + "\",";
  52565. } else {
  52566. jsonParameters += "'displayFilter':\"" + filters[i] + "\",";
  52567. }
  52568. }
  52569. orderBys = parameter.displayOrderBy;
  52570. if (orderBys && orderBys.length > 0) {
  52571. if (orderBys.length === 1) {
  52572. jsonParameters += "'displayOrderBy':'" + orderBys[0] + "',";
  52573. } else {
  52574. jsonParameters += "'displayOrderBy':'" + orderBys[i] + "',";
  52575. }
  52576. }
  52577. fieldValuesDisplayFilter = parameter.fieldValuesDisplayFilter;
  52578. if (fieldValuesDisplayFilter) {
  52579. jsonParameters += "'fieldValuesDisplayFilter':" + Util_Util.toJSON(fieldValuesDisplayFilter) + ",";
  52580. }
  52581. if (parameter.joinItems && parameter.joinItems.length > 0 && parameter.joinItems[i]) {
  52582. jsonParameters += "'joinItems':[" + Util_Util.toJSON(parameter.joinItems[i]) + "],";
  52583. }
  52584. if (parameter.datasetNames && parameter.dataSourceNames) {
  52585. var datasetID = parameter.datasetNames[i] ? i : parameter.datasetNames.length - 1;
  52586. var dataSourceID = parameter.dataSourceNames[i] ? i : parameter.dataSourceNames.length - 1;
  52587. jsonParameters += "'datasetInfo': {'name': '" + parameter.datasetNames[datasetID] + "','dataSourceName': '" + parameter.dataSourceNames[dataSourceID] + "'}},";
  52588. } else {
  52589. jsonParameters += "},";
  52590. }
  52591. }
  52592. //去除多余的逗号
  52593. if (parameter.themes && parameter.themes.length > 0) {
  52594. jsonParameters = jsonParameters.substring(0, jsonParameters.length - 1);
  52595. }
  52596. jsonParameters += "]},";
  52597. var urlArray = this.url.split("/");
  52598. var jsonMapName = urlArray[urlArray.length - 2];
  52599. jsonParameters += "'name': '" + jsonMapName + "'}]";
  52600. return jsonParameters;
  52601. }
  52602. }]);
  52603. return ThemeService;
  52604. }(CommonServiceBase);
  52605. ;// CONCATENATED MODULE: ./src/common/iServer/ThiessenAnalystService.js
  52606. function ThiessenAnalystService_typeof(obj) { "@babel/helpers - typeof"; return ThiessenAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ThiessenAnalystService_typeof(obj); }
  52607. function ThiessenAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52608. function ThiessenAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  52609. function ThiessenAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThiessenAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThiessenAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  52610. function ThiessenAnalystService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ThiessenAnalystService_get = Reflect.get.bind(); } else { ThiessenAnalystService_get = function _get(target, property, receiver) { var base = ThiessenAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ThiessenAnalystService_get.apply(this, arguments); }
  52611. function ThiessenAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThiessenAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  52612. function ThiessenAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ThiessenAnalystService_setPrototypeOf(subClass, superClass); }
  52613. function ThiessenAnalystService_setPrototypeOf(o, p) { ThiessenAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThiessenAnalystService_setPrototypeOf(o, p); }
  52614. function ThiessenAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = ThiessenAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThiessenAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThiessenAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThiessenAnalystService_possibleConstructorReturn(this, result); }; }
  52615. function ThiessenAnalystService_possibleConstructorReturn(self, call) { if (call && (ThiessenAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ThiessenAnalystService_assertThisInitialized(self); }
  52616. function ThiessenAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  52617. function ThiessenAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  52618. function ThiessenAnalystService_getPrototypeOf(o) { ThiessenAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThiessenAnalystService_getPrototypeOf(o); }
  52619. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  52620. * This program are made available under the terms of the Apache License, Version 2.0
  52621. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52622. /**
  52623. * @class ThiessenAnalystService
  52624. * @deprecatedclass SuperMap.ThiessenAnalystService
  52625. * @category iServer SpatialAnalyst ThiessenPolygonAnalyst
  52626. * @classdesc
  52627. * 泰森多边形分析服务类
  52628. * 该类负责将客户设置的泰森多边形分析参数传递给服务端,并接收服务端返回的分析结果数据。
  52629. * 泰森多边形分析结果通过该类支持的事件的监听函数参数获取
  52630. * 泰森多边形分析的参数支持两种,当参数为 {@link DatasetThiessenAnalystParameters} 类型
  52631. * 时,执行数据集泰森多边形分析,当参数为 {@link GeometryThiessenAnalystParameters} 类型时,
  52632. * 执行几何对象泰森多边形分析。
  52633. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  52634. * @param {Object} options - 参数。
  52635. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  52636. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  52637. * @param {Object} [options.headers] - 请求头。
  52638. * @extends {SpatialAnalystBase}
  52639. * @example 例如:
  52640. * (start code)
  52641. * var myThiessenAnalystService = new ThiessenAnalystService(url, {
  52642. * eventListeners: {
  52643. * "processCompleted": bufferCompleted,
  52644. * "processFailed": bufferFailed
  52645. * }
  52646. * });
  52647. * (end)
  52648. * @usage
  52649. */
  52650. var ThiessenAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  52651. ThiessenAnalystService_inherits(ThiessenAnalystService, _SpatialAnalystBase);
  52652. var _super = ThiessenAnalystService_createSuper(ThiessenAnalystService);
  52653. function ThiessenAnalystService(url, options) {
  52654. var _this;
  52655. ThiessenAnalystService_classCallCheck(this, ThiessenAnalystService);
  52656. _this = _super.call(this, url, options);
  52657. /**
  52658. * @member {string} ThiessenAnalystService.prototype.mode
  52659. * @description 缓冲区分析类型
  52660. */
  52661. _this.mode = null;
  52662. if (options) {
  52663. Util_Util.extend(ThiessenAnalystService_assertThisInitialized(_this), options);
  52664. }
  52665. _this.CLASS_NAME = "SuperMap.ThiessenAnalystService";
  52666. return _this;
  52667. }
  52668. /**
  52669. * @override
  52670. */
  52671. ThiessenAnalystService_createClass(ThiessenAnalystService, [{
  52672. key: "destroy",
  52673. value: function destroy() {
  52674. ThiessenAnalystService_get(ThiessenAnalystService_getPrototypeOf(ThiessenAnalystService.prototype), "destroy", this).call(this);
  52675. this.mode = null;
  52676. }
  52677. /**
  52678. * @function ThiessenAnalystService.prototype.processAsync
  52679. * @description 负责将客户端的查询参数传递到服务端。
  52680. * @param {DatasetThiessenAnalystParameters|GeometryThiessenAnalystParameters} parameter - 泰森多边形分析参数基类。
  52681. */
  52682. }, {
  52683. key: "processAsync",
  52684. value: function processAsync(parameter) {
  52685. var parameterObject = {};
  52686. var me = this;
  52687. if (parameter instanceof DatasetThiessenAnalystParameters) {
  52688. me.mode = "datasets";
  52689. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/thiessenpolygon');
  52690. DatasetThiessenAnalystParameters.toObject(parameter, parameterObject);
  52691. } else if (parameter instanceof GeometryThiessenAnalystParameters) {
  52692. me.mode = "geometry";
  52693. me.url = Util_Util.urlPathAppend(me.url, 'geometry/thiessenpolygon');
  52694. GeometryThiessenAnalystParameters.toObject(parameter, parameterObject);
  52695. }
  52696. var jsonParameters = Util_Util.toJSON(parameterObject);
  52697. this.returnContent = true;
  52698. me.request({
  52699. method: "POST",
  52700. data: jsonParameters,
  52701. scope: me,
  52702. success: me.serviceProcessCompleted,
  52703. failure: me.serviceProcessFailed
  52704. });
  52705. }
  52706. }, {
  52707. key: "dataFormat",
  52708. value: function dataFormat() {
  52709. return [DataFormat.GEOJSON, DataFormat.ISERVER, DataFormat.FGB];
  52710. }
  52711. }]);
  52712. return ThiessenAnalystService;
  52713. }(SpatialAnalystBase);
  52714. ;// CONCATENATED MODULE: ./src/common/iServer/GeometryBatchAnalystService.js
  52715. function GeometryBatchAnalystService_typeof(obj) { "@babel/helpers - typeof"; return GeometryBatchAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GeometryBatchAnalystService_typeof(obj); }
  52716. function GeometryBatchAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52717. function GeometryBatchAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  52718. function GeometryBatchAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryBatchAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryBatchAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  52719. function GeometryBatchAnalystService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { GeometryBatchAnalystService_get = Reflect.get.bind(); } else { GeometryBatchAnalystService_get = function _get(target, property, receiver) { var base = GeometryBatchAnalystService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return GeometryBatchAnalystService_get.apply(this, arguments); }
  52720. function GeometryBatchAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryBatchAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  52721. function GeometryBatchAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GeometryBatchAnalystService_setPrototypeOf(subClass, superClass); }
  52722. function GeometryBatchAnalystService_setPrototypeOf(o, p) { GeometryBatchAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryBatchAnalystService_setPrototypeOf(o, p); }
  52723. function GeometryBatchAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = GeometryBatchAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeometryBatchAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeometryBatchAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeometryBatchAnalystService_possibleConstructorReturn(this, result); }; }
  52724. function GeometryBatchAnalystService_possibleConstructorReturn(self, call) { if (call && (GeometryBatchAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GeometryBatchAnalystService_assertThisInitialized(self); }
  52725. function GeometryBatchAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  52726. function GeometryBatchAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  52727. function GeometryBatchAnalystService_getPrototypeOf(o) { GeometryBatchAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryBatchAnalystService_getPrototypeOf(o); }
  52728. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  52729. * This program are made available under the terms of the Apache License, Version 2.0
  52730. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52731. /**
  52732. * @class GeometryBatchAnalystService
  52733. * @deprecatedclass SuperMap.GeometryBatchAnalystService
  52734. * @category iServer SpatialAnalyst BatchAnalyst
  52735. * @classdesc 批量空间分析服务类
  52736. * @description 该类负责将客户设置的叠加分析参数传递给服务端,并接收服务端返回的叠加分析结果数据。
  52737. * 获取的结果数据包括 originResult 、result 两种,
  52738. * 其中,originResult 为服务端返回的用 JSON 对象表示的量算结果数据,result 为服务端返回的量算结果数据。
  52739. * @extends {SpatialAnalystBase}
  52740. * @param {string} url - 服务地址。如:http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  52741. * @param {Object} options - 参数。
  52742. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  52743. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  52744. * @param {Object} [options.headers] - 请求头。
  52745. * @example
  52746. * var myOverlayAnalystService = new GeometryBatchAnalystService(url, {
  52747. * eventListeners: {
  52748. * "processCompleted": OverlayCompleted,
  52749. * "processFailed": OverlayFailed
  52750. * }
  52751. * });
  52752. * @usage
  52753. */
  52754. var GeometryBatchAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  52755. GeometryBatchAnalystService_inherits(GeometryBatchAnalystService, _SpatialAnalystBase);
  52756. var _super = GeometryBatchAnalystService_createSuper(GeometryBatchAnalystService);
  52757. function GeometryBatchAnalystService(url, options) {
  52758. var _this;
  52759. GeometryBatchAnalystService_classCallCheck(this, GeometryBatchAnalystService);
  52760. _this = _super.call(this, url, options);
  52761. if (options) {
  52762. Util_Util.extend(GeometryBatchAnalystService_assertThisInitialized(_this), options);
  52763. }
  52764. _this.CLASS_NAME = "SuperMap.GeometryBatchAnalystService";
  52765. return _this;
  52766. }
  52767. /**
  52768. * @function GeometryBatchAnalystService.prototype.processAsync
  52769. * @description 负责将客户端的查询参数传递到服务端。
  52770. * @param {GeometryOverlayAnalystParameter} parameter - 批量几何对象叠加分析参数类
  52771. *
  52772. */
  52773. GeometryBatchAnalystService_createClass(GeometryBatchAnalystService, [{
  52774. key: "processAsync",
  52775. value: function processAsync(parameters) {
  52776. var me = this;
  52777. me.url = Util_Util.urlPathAppend(me.url, 'geometry/batchanalyst');
  52778. me.url = Util_Util.urlAppend(me.url, 'returnContent=true&ignoreAnalystParam=true');
  52779. var parameterObjects = me._processParams(parameters);
  52780. var jsonParameters = Util_Util.toJSON(parameterObjects);
  52781. me.request({
  52782. method: "POST",
  52783. data: jsonParameters,
  52784. scope: me,
  52785. success: me.serviceProcessCompleted,
  52786. failure: me.serviceProcessFailed
  52787. });
  52788. }
  52789. }, {
  52790. key: "_processParams",
  52791. value: function _processParams(parameters) {
  52792. var me = this;
  52793. if (!Util_Util.isArray(parameters)) {
  52794. return;
  52795. }
  52796. var processParams = [];
  52797. parameters.map(function (item) {
  52798. processParams.push(me._toJSON(item));
  52799. return item;
  52800. });
  52801. return processParams;
  52802. }
  52803. }, {
  52804. key: "_toJSON",
  52805. value: function _toJSON(parameter) {
  52806. var tempObj = {};
  52807. if (parameter.analystName === "buffer") {
  52808. tempObj.analystName = "buffer";
  52809. tempObj.param = {};
  52810. //几何对象的批量空间分析,
  52811. GeometryBufferAnalystParameters.toObject(parameter.param, tempObj.param);
  52812. } else if (parameter.analystName === "overlay") {
  52813. tempObj.analystName = "overlay";
  52814. tempObj.param = {};
  52815. GeometryOverlayAnalystParameters.toObject(parameter.param, tempObj.param);
  52816. } else if (parameter.analystName === "interpolationDensity") {
  52817. tempObj.analystName = "interpolationDensity";
  52818. tempObj.param = {};
  52819. InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  52820. } else if (parameter.analystName === "interpolationidw") {
  52821. tempObj.analystName = "interpolationidw";
  52822. tempObj.param = {};
  52823. InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  52824. } else if (parameter.analystName === "interpolationRBF") {
  52825. tempObj.analystName = "interpolationRBF";
  52826. tempObj.param = {};
  52827. InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  52828. } else if (parameter.analystName === "interpolationKriging") {
  52829. tempObj.analystName = "interpolationKriging";
  52830. tempObj.param = {};
  52831. InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  52832. } else if (parameter.analystName === "thiessenpolygon") {
  52833. tempObj.analystName = "thiessenpolygon";
  52834. tempObj.param = {};
  52835. GeometryThiessenAnalystParameters.toObject(parameter.param, tempObj.param);
  52836. } else {
  52837. //isoline; isoregion; calculatemeasure; routelocator 四种分析不需要再处理参数
  52838. return parameter;
  52839. }
  52840. return tempObj;
  52841. }
  52842. /**
  52843. * @override
  52844. */
  52845. }, {
  52846. key: "destroy",
  52847. value: function destroy() {
  52848. GeometryBatchAnalystService_get(GeometryBatchAnalystService_getPrototypeOf(GeometryBatchAnalystService.prototype), "destroy", this).call(this);
  52849. }
  52850. }]);
  52851. return GeometryBatchAnalystService;
  52852. }(SpatialAnalystBase);
  52853. ;// CONCATENATED MODULE: ./src/common/iServer/TilesetsService.js
  52854. function TilesetsService_typeof(obj) { "@babel/helpers - typeof"; return TilesetsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, TilesetsService_typeof(obj); }
  52855. function TilesetsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52856. function TilesetsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  52857. function TilesetsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TilesetsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TilesetsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  52858. function TilesetsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { TilesetsService_get = Reflect.get.bind(); } else { TilesetsService_get = function _get(target, property, receiver) { var base = TilesetsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return TilesetsService_get.apply(this, arguments); }
  52859. function TilesetsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TilesetsService_getPrototypeOf(object); if (object === null) break; } return object; }
  52860. function TilesetsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) TilesetsService_setPrototypeOf(subClass, superClass); }
  52861. function TilesetsService_setPrototypeOf(o, p) { TilesetsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TilesetsService_setPrototypeOf(o, p); }
  52862. function TilesetsService_createSuper(Derived) { var hasNativeReflectConstruct = TilesetsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = TilesetsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = TilesetsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return TilesetsService_possibleConstructorReturn(this, result); }; }
  52863. function TilesetsService_possibleConstructorReturn(self, call) { if (call && (TilesetsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return TilesetsService_assertThisInitialized(self); }
  52864. function TilesetsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  52865. function TilesetsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  52866. function TilesetsService_getPrototypeOf(o) { TilesetsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TilesetsService_getPrototypeOf(o); }
  52867. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  52868. * This program are made available under the terms of the Apache License, Version 2.0
  52869. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52870. /**
  52871. * @class TilesetsService
  52872. * @deprecatedclass SuperMap.TilesetsService
  52873. * @category iServer Map Tilesets
  52874. * @classdesc 切片列表信息查询服务类;即查询切片地图服务的切片列表,返回切片集名称、地图切片元数据信息、切片版本集信息。
  52875. * @extends {CommonServiceBase}
  52876. * @param {string} url - 服务地址。URL 应为:
  52877. * http://{服务器地址}:{服务端口号}/iserver/services/{服务名}/rest/maps/map;
  52878. * 例如: "http://localhost:8090/iserver/services/test/rest/maps/tianlocal"。
  52879. * @param {Object} options - 参数。
  52880. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  52881. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  52882. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  52883. * @param {Object} [options.headers] - 请求头。
  52884. * @usage
  52885. */
  52886. var TilesetsService = /*#__PURE__*/function (_CommonServiceBase) {
  52887. TilesetsService_inherits(TilesetsService, _CommonServiceBase);
  52888. var _super = TilesetsService_createSuper(TilesetsService);
  52889. function TilesetsService(url, options) {
  52890. var _this;
  52891. TilesetsService_classCallCheck(this, TilesetsService);
  52892. _this = _super.call(this, url, options);
  52893. _this.CLASS_NAME = "SuperMap.TilesetsService";
  52894. return _this;
  52895. }
  52896. /**
  52897. * @override
  52898. */
  52899. TilesetsService_createClass(TilesetsService, [{
  52900. key: "destroy",
  52901. value: function destroy() {
  52902. TilesetsService_get(TilesetsService_getPrototypeOf(TilesetsService.prototype), "destroy", this).call(this);
  52903. }
  52904. /**
  52905. * @function TilesetsService.prototype.processAsync
  52906. * @description 负责将客户端的查询参数传递到服务端。
  52907. */
  52908. }, {
  52909. key: "processAsync",
  52910. value: function processAsync() {
  52911. if (!this.url) {
  52912. return;
  52913. }
  52914. var me = this;
  52915. me.url = Util_Util.urlPathAppend(me.url, 'tilesets');
  52916. me.request({
  52917. method: "GET",
  52918. scope: me,
  52919. success: me.serviceProcessCompleted,
  52920. failure: me.serviceProcessFailed
  52921. });
  52922. }
  52923. }]);
  52924. return TilesetsService;
  52925. }(CommonServiceBase);
  52926. ;// CONCATENATED MODULE: ./src/common/iServer/TopologyValidatorJobsParameter.js
  52927. function TopologyValidatorJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52928. function TopologyValidatorJobsParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  52929. function TopologyValidatorJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) TopologyValidatorJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) TopologyValidatorJobsParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  52930. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  52931. * This program are made available under the terms of the Apache License, Version 2.0
  52932. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52933. /**
  52934. * @class TopologyValidatorJobsParameter
  52935. * @deprecatedclass SuperMap.TopologyValidatorJobsParameter
  52936. * @category iServer ProcessingService TopologyValidator
  52937. * @classdesc 拓扑检查分析任务参数类。
  52938. * @param {Object} options - 参数。
  52939. * @param {string} options.datasetName - 数据集名。
  52940. * @param {string} options.datasetTopology -检查对象所在的数据集名称。
  52941. * @param {TopologyValidatorRule} [options.rule=TopologyValidatorRule.REGIONNOOVERLAP] - 拓扑检查规则。
  52942. * @param {string} [options.tolerance] - 容限。
  52943. * @param {OutputSetting} [options.output] - 输出参数设置。
  52944. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  52945. * @usage
  52946. */
  52947. var TopologyValidatorJobsParameter = /*#__PURE__*/function () {
  52948. function TopologyValidatorJobsParameter(options) {
  52949. TopologyValidatorJobsParameter_classCallCheck(this, TopologyValidatorJobsParameter);
  52950. if (!options) {
  52951. return;
  52952. }
  52953. /**
  52954. * @member {string} TopologyValidatorJobsParameter.prototype.datasetName
  52955. * @description 数据集名。
  52956. */
  52957. this.datasetName = "";
  52958. /**
  52959. * @member {string} TopologyValidatorJobsParameter.prototype.datasetTopology
  52960. * @description 拓扑检查对象所在的数据集名称。
  52961. */
  52962. this.datasetTopology = "";
  52963. /**
  52964. * @member {string} [TopologyValidatorJobsParameter.prototype.tolerance]
  52965. * @description 容限,指定的拓扑错误检查时使用的容限。
  52966. */
  52967. this.tolerance = "";
  52968. /**
  52969. * @member {TopologyValidatorRule} [TopologyValidatorJobsParameter.prototype.rule=TopologyValidatorRule.REGIONNOOVERLAP]
  52970. * @description 拓扑检查模式。
  52971. */
  52972. this.rule = TopologyValidatorRule.REGIONNOOVERLAP;
  52973. /**
  52974. * @member {OutputSetting} [TopologyValidatorJobsParameter.prototype.output]
  52975. * @description 输出参数设置类。
  52976. */
  52977. this.output = null;
  52978. /**
  52979. * @member {MappingParameters} [TopologyValidatorJobsParameter.prototype.mappingParameters]
  52980. * @description 分析后结果可视化的参数类。
  52981. */
  52982. this.mappingParameters = null;
  52983. Util_Util.extend(this, options);
  52984. this.CLASS_NAME = "SuperMap.TopologyValidatorJobsParameter";
  52985. }
  52986. /**
  52987. * @function TopologyValidatorJobsParameter.prototype.destroy
  52988. * @description 释放资源,将引用资源的属性置空。
  52989. */
  52990. TopologyValidatorJobsParameter_createClass(TopologyValidatorJobsParameter, [{
  52991. key: "destroy",
  52992. value: function destroy() {
  52993. this.datasetName = null;
  52994. this.datasetTopology = null;
  52995. this.tolerance = null;
  52996. this.rule = null;
  52997. if (this.output instanceof OutputSetting) {
  52998. this.output.destroy();
  52999. this.output = null;
  53000. }
  53001. if (this.mappingParameters instanceof MappingParameters) {
  53002. this.mappingParameters.destroy();
  53003. this.mappingParameters = null;
  53004. }
  53005. }
  53006. /**
  53007. * @function TopologyValidatorJobsParameter.toObject
  53008. * @param {Object} TopologyValidatorJobsParameter -拓扑检查分析任务参数。
  53009. * @param {Object} tempObj - 目标对象。
  53010. * @description 生成拓扑检查分析任务对象。
  53011. */
  53012. }], [{
  53013. key: "toObject",
  53014. value: function toObject(_TopologyValidatorJobsParameter, tempObj) {
  53015. for (var name in _TopologyValidatorJobsParameter) {
  53016. if (name === "datasetName") {
  53017. tempObj['input'] = tempObj['input'] || {};
  53018. tempObj['input'][name] = _TopologyValidatorJobsParameter[name];
  53019. continue;
  53020. }
  53021. if (name === "output") {
  53022. tempObj['output'] = tempObj['output'] || {};
  53023. tempObj['output'] = _TopologyValidatorJobsParameter[name];
  53024. continue;
  53025. }
  53026. tempObj['analyst'] = tempObj['analyst'] || {};
  53027. tempObj['analyst'][name] = _TopologyValidatorJobsParameter[name];
  53028. if (name === 'mappingParameters') {
  53029. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  53030. tempObj['analyst']['mappingParameters'] = _TopologyValidatorJobsParameter[name];
  53031. }
  53032. }
  53033. }
  53034. }]);
  53035. return TopologyValidatorJobsParameter;
  53036. }();
  53037. ;// CONCATENATED MODULE: ./src/common/iServer/TopologyValidatorJobsService.js
  53038. function TopologyValidatorJobsService_typeof(obj) { "@babel/helpers - typeof"; return TopologyValidatorJobsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, TopologyValidatorJobsService_typeof(obj); }
  53039. function TopologyValidatorJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53040. function TopologyValidatorJobsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  53041. function TopologyValidatorJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TopologyValidatorJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TopologyValidatorJobsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  53042. function TopologyValidatorJobsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { TopologyValidatorJobsService_get = Reflect.get.bind(); } else { TopologyValidatorJobsService_get = function _get(target, property, receiver) { var base = TopologyValidatorJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return TopologyValidatorJobsService_get.apply(this, arguments); }
  53043. function TopologyValidatorJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TopologyValidatorJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  53044. function TopologyValidatorJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) TopologyValidatorJobsService_setPrototypeOf(subClass, superClass); }
  53045. function TopologyValidatorJobsService_setPrototypeOf(o, p) { TopologyValidatorJobsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TopologyValidatorJobsService_setPrototypeOf(o, p); }
  53046. function TopologyValidatorJobsService_createSuper(Derived) { var hasNativeReflectConstruct = TopologyValidatorJobsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = TopologyValidatorJobsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = TopologyValidatorJobsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return TopologyValidatorJobsService_possibleConstructorReturn(this, result); }; }
  53047. function TopologyValidatorJobsService_possibleConstructorReturn(self, call) { if (call && (TopologyValidatorJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return TopologyValidatorJobsService_assertThisInitialized(self); }
  53048. function TopologyValidatorJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  53049. function TopologyValidatorJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  53050. function TopologyValidatorJobsService_getPrototypeOf(o) { TopologyValidatorJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TopologyValidatorJobsService_getPrototypeOf(o); }
  53051. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53052. * This program are made available under the terms of the Apache License, Version 2.0
  53053. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53054. /**
  53055. * @class TopologyValidatorJobsService
  53056. * @deprecatedclass SuperMap.TopologyValidatorJobsService
  53057. * @category iServer ProcessingService TopologyValidator
  53058. * @classdesc 拓扑检查分析服务类
  53059. * @extends {ProcessingServiceBase}
  53060. * @param {string} url - 服务地址。
  53061. * @param {Object} options - 可选参数。
  53062. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  53063. * @param {Object} [options.headers] - 请求头。
  53064. * @usage
  53065. */
  53066. var TopologyValidatorJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  53067. TopologyValidatorJobsService_inherits(TopologyValidatorJobsService, _ProcessingServiceBas);
  53068. var _super = TopologyValidatorJobsService_createSuper(TopologyValidatorJobsService);
  53069. function TopologyValidatorJobsService(url, options) {
  53070. var _this;
  53071. TopologyValidatorJobsService_classCallCheck(this, TopologyValidatorJobsService);
  53072. _this = _super.call(this, url, options);
  53073. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/topologyvalidator');
  53074. _this.CLASS_NAME = "SuperMap.TopologyValidatorJobsService";
  53075. return _this;
  53076. }
  53077. /**
  53078. *@override
  53079. */
  53080. TopologyValidatorJobsService_createClass(TopologyValidatorJobsService, [{
  53081. key: "destroy",
  53082. value: function destroy() {
  53083. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "destroy", this).call(this);
  53084. }
  53085. /**
  53086. * @function TopologyValidatorJobsService.protitype.getTopologyValidatorJobs
  53087. * @description 获取拓扑检查分析所有任务
  53088. */
  53089. }, {
  53090. key: "getTopologyValidatorJobs",
  53091. value: function getTopologyValidatorJobs() {
  53092. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "getJobs", this).call(this, this.url);
  53093. }
  53094. /**
  53095. * @function TopologyValidatorJobsService.protitype.getTopologyValidatorJob
  53096. * @description 获取指定id的拓扑检查分析服务
  53097. * @param {string} id - 指定要获取数据的id
  53098. */
  53099. }, {
  53100. key: "getTopologyValidatorJob",
  53101. value: function getTopologyValidatorJob(id) {
  53102. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  53103. }
  53104. /**
  53105. * @function TopologyValidatorJobsService.protitype.addTopologyValidatorJob
  53106. * @description 新建拓扑检查分析服务
  53107. * @param {TopologyValidatorJobsParameter} params - 拓扑检查分析任务参数类。
  53108. * @param {number} seconds -创建成功结果的时间间隔。
  53109. */
  53110. }, {
  53111. key: "addTopologyValidatorJob",
  53112. value: function addTopologyValidatorJob(params, seconds) {
  53113. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "addJob", this).call(this, this.url, params, TopologyValidatorJobsParameter, seconds);
  53114. }
  53115. }]);
  53116. return TopologyValidatorJobsService;
  53117. }(ProcessingServiceBase);
  53118. ;// CONCATENATED MODULE: ./src/common/iServer/TransferLine.js
  53119. function TransferLine_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53120. function TransferLine_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  53121. function TransferLine_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferLine_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferLine_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  53122. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53123. * This program are made available under the terms of the Apache License, Version 2.0
  53124. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53125. /**
  53126. * @class TransferLine
  53127. * @deprecatedclass SuperMap.TransferLine
  53128. * @category iServer TrafficTransferAnalyst TransferPath
  53129. * @classdesc 换乘路线信息类。
  53130. * @param {Object} options - 参数。
  53131. * @param {number} options.lineID - 乘车路线 ID。
  53132. * @param {string} options.lineName - 乘车路线名称。
  53133. * @param {string} options.lineAliasName - 乘车路线别名。
  53134. * @param {number} options.startStopIndex - 上车站点在本公交路线中的索引。
  53135. * @param {string} options.startStopName - 上车站点名称。
  53136. * @param {string} options.startStopAliasName - 上车站点别名。
  53137. * @param {number} options.endStopIndex - 下车站点在本公交路线中的索引。
  53138. * @param {string} options.endStopName - 下车站点名称。
  53139. * @param {string} options.endStopAliasName - 下车站点别名。
  53140. * @usage
  53141. */
  53142. var TransferLine = /*#__PURE__*/function () {
  53143. function TransferLine(options) {
  53144. TransferLine_classCallCheck(this, TransferLine);
  53145. options = options || {};
  53146. /**
  53147. * @member {number} TransferLine.prototype.lineID
  53148. * @description 乘车路线 ID。
  53149. */
  53150. this.lineID = null;
  53151. /**
  53152. * @member {string} TransferLine.prototype.lineName
  53153. * @description 乘车路线名称。
  53154. */
  53155. this.lineName = null;
  53156. /**
  53157. * @member {string} TransferLine.prototype.lineAliasName
  53158. * @description 乘车路线别名。
  53159. */
  53160. this.lineAliasName = null;
  53161. /**
  53162. * @member {number} TransferLine.prototype.startStopIndex
  53163. * @description 上车站点在本公交路线中的索引。
  53164. */
  53165. this.startStopIndex = null;
  53166. /**
  53167. * @member {string} TransferLine.prototype.startStopName
  53168. * @description 上车站点名称。
  53169. */
  53170. this.startStopName = null;
  53171. /**
  53172. * @member {string} TransferLine.prototype.startStopAliasName
  53173. * @description 上车站点别名。
  53174. */
  53175. this.startStopAliasName = null;
  53176. /**
  53177. * @member {number} TransferLine.prototype.endStopIndex
  53178. * @description 下车站点在本公交路线中的索引。
  53179. */
  53180. this.endStopIndex = null;
  53181. /**
  53182. * @member {string} TransferLine.prototype.endStopName
  53183. * @description 下车站点名称。
  53184. */
  53185. this.endStopName = null;
  53186. /**
  53187. * @member {string} TransferLine.prototype.endStopAliasName
  53188. * @description 下车站点别名。
  53189. */
  53190. this.endStopAliasName = null;
  53191. Util_Util.extend(this, options);
  53192. this.CLASS_NAME = "SuperMap.TransferLine";
  53193. }
  53194. /**
  53195. * @function TransferLine.prototype.destroy
  53196. * @description 释放资源,将引用资源的属性置空。
  53197. */
  53198. TransferLine_createClass(TransferLine, [{
  53199. key: "destroy",
  53200. value: function destroy() {
  53201. Util_Util.reset(this);
  53202. }
  53203. /**
  53204. * @function TransferLine.fromJson
  53205. * @description 将返回结果转化为 {@link TransferLine} 对象。
  53206. * @param {Object} jsonObject - 新的返回结果。
  53207. * @returns {TransferLine} 转化后的 {@link TransferLine} 对象。
  53208. */
  53209. }], [{
  53210. key: "fromJson",
  53211. value: function fromJson(jsonObject) {
  53212. if (!jsonObject) {
  53213. return;
  53214. }
  53215. return new TransferLine({
  53216. lineID: jsonObject['lineID'],
  53217. lineName: jsonObject['lineName'],
  53218. lineAliasName: jsonObject['lineAliasName'],
  53219. startStopIndex: jsonObject['startStopIndex'],
  53220. startStopName: jsonObject['startStopName'],
  53221. startStopAliasName: jsonObject['startStopAliasName'],
  53222. endStopIndex: jsonObject['endStopIndex'],
  53223. endStopName: jsonObject['endStopName'],
  53224. endStopAliasName: jsonObject['endStopAliasName']
  53225. });
  53226. }
  53227. }]);
  53228. return TransferLine;
  53229. }();
  53230. ;// CONCATENATED MODULE: ./src/common/iServer/TransferPathParameters.js
  53231. function TransferPathParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53232. function TransferPathParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  53233. function TransferPathParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferPathParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferPathParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  53234. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53235. * This program are made available under the terms of the Apache License, Version 2.0
  53236. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53237. /**
  53238. * @class TransferPathParameters
  53239. * @deprecatedclass SuperMap.TransferPathParameters
  53240. * @category iServer TrafficTransferAnalyst TransferPath
  53241. * @classdesc 交通换乘线路查询参数类。
  53242. * @param {Object} options - 参数。
  53243. * @param {Array.<TransferLine>} options.transferLines - 本换乘分段内可乘车的路线集合。
  53244. * @param {Array.<GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|Array.<number>|number>} options.points - 两种查询方式:按照公交站点的起止 ID 进行查询和按照起止点的坐标进行查询。
  53245. * @usage
  53246. */
  53247. var TransferPathParameters = /*#__PURE__*/function () {
  53248. function TransferPathParameters(options) {
  53249. TransferPathParameters_classCallCheck(this, TransferPathParameters);
  53250. options = options || {};
  53251. /**
  53252. * @member {Array.<TransferLine>} TransferPathParameters.prototype.transferLines
  53253. * @description 本换乘分段内可乘车的路线集合,通过交通换乘方案查询得到。
  53254. */
  53255. this.transferLines = null;
  53256. /**
  53257. * @member {Array.<GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|Array.<number>|number>} TransferPathParameters.prototype.points
  53258. * @description 两种查询方式:<br>
  53259. * 1. 按照公交站点的起止ID进行查询,则 points 参数的类型为 int[],形如:[起点ID、终点ID],公交站点的 ID 对应服务提供者配置中的站点 ID 字段;
  53260. * 2. 按照起止点的坐标进行查询,则 points 参数的类型为 Point2D[],形如:[{"x":44,"y":39},{"x":45,"y":40}]。
  53261. */
  53262. this.points = null;
  53263. Util_Util.extend(this, options);
  53264. this.CLASS_NAME = "SuperMap.TransferPathParameters";
  53265. }
  53266. /**
  53267. * @function TransferPathParameters.prototype.destroy
  53268. * @description 释放资源,将引用资源的属性置空。
  53269. */
  53270. TransferPathParameters_createClass(TransferPathParameters, [{
  53271. key: "destroy",
  53272. value: function destroy() {
  53273. Util_Util.reset(this);
  53274. }
  53275. /**
  53276. * @function TransferPathParameters.toJson
  53277. * @description 将 {@link TransferPathParameters} 对象参数转换为 JSON 字符串。
  53278. * @param {TransferPathParameters} params - 交通换乘参数。
  53279. * @returns {string} 转化后的 JSON 字符串。
  53280. */
  53281. }], [{
  53282. key: "toJson",
  53283. value: function toJson(params) {
  53284. if (params) {
  53285. return Util_Util.toJSON(params);
  53286. }
  53287. }
  53288. }]);
  53289. return TransferPathParameters;
  53290. }();
  53291. ;// CONCATENATED MODULE: ./src/common/iServer/TransferPathService.js
  53292. function TransferPathService_typeof(obj) { "@babel/helpers - typeof"; return TransferPathService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, TransferPathService_typeof(obj); }
  53293. function TransferPathService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53294. function TransferPathService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  53295. function TransferPathService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferPathService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferPathService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  53296. function TransferPathService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { TransferPathService_get = Reflect.get.bind(); } else { TransferPathService_get = function _get(target, property, receiver) { var base = TransferPathService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return TransferPathService_get.apply(this, arguments); }
  53297. function TransferPathService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TransferPathService_getPrototypeOf(object); if (object === null) break; } return object; }
  53298. function TransferPathService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) TransferPathService_setPrototypeOf(subClass, superClass); }
  53299. function TransferPathService_setPrototypeOf(o, p) { TransferPathService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TransferPathService_setPrototypeOf(o, p); }
  53300. function TransferPathService_createSuper(Derived) { var hasNativeReflectConstruct = TransferPathService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = TransferPathService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = TransferPathService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return TransferPathService_possibleConstructorReturn(this, result); }; }
  53301. function TransferPathService_possibleConstructorReturn(self, call) { if (call && (TransferPathService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return TransferPathService_assertThisInitialized(self); }
  53302. function TransferPathService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  53303. function TransferPathService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  53304. function TransferPathService_getPrototypeOf(o) { TransferPathService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TransferPathService_getPrototypeOf(o); }
  53305. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53306. * This program are made available under the terms of the Apache License, Version 2.0
  53307. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53308. /**
  53309. * @class TransferPathService
  53310. * @deprecatedclass SuperMap.TransferPathService
  53311. * @category iServer TrafficTransferAnalyst TransferPath
  53312. * @classdesc 交通换乘线路查询服务类,根据交通换乘分析结果(TransferSolutionResult),获取某一条乘车路线的详细信息。
  53313. * 返回结果通过该类支持的事件的监听函数参数获取
  53314. * @extends {CommonServiceBase}
  53315. * @example 例如:
  53316. * var myService = new TransferPathService(url, {eventListeners: {
  53317. * "processCompleted": TrafficTransferCompleted,
  53318. * "processFailed": TrafficTransferError
  53319. * }
  53320. * };
  53321. * @param {string} url - 服务地址。
  53322. * 例如:</br>"http://localhost:8090/iserver/services/traffictransferanalyst-sample/restjsr/traffictransferanalyst/Traffic-Changchun"。
  53323. * @param {Object} options - 参数。
  53324. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  53325. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  53326. * @param {Object} [options.headers] - 请求头。
  53327. * @usage
  53328. */
  53329. var TransferPathService = /*#__PURE__*/function (_CommonServiceBase) {
  53330. TransferPathService_inherits(TransferPathService, _CommonServiceBase);
  53331. var _super = TransferPathService_createSuper(TransferPathService);
  53332. function TransferPathService(url, options) {
  53333. var _this;
  53334. TransferPathService_classCallCheck(this, TransferPathService);
  53335. _this = _super.call(this, url, options);
  53336. _this.CLASS_NAME = "SuperMap.TransferPathService";
  53337. return _this;
  53338. }
  53339. /**
  53340. * @override
  53341. */
  53342. TransferPathService_createClass(TransferPathService, [{
  53343. key: "destroy",
  53344. value: function destroy() {
  53345. TransferPathService_get(TransferPathService_getPrototypeOf(TransferPathService.prototype), "destroy", this).call(this);
  53346. }
  53347. /**
  53348. * @function TransferPathService.prototype.processAsync
  53349. * @description 负责将客户端的更新参数传递到服务端。
  53350. * @param {TransferPathParameters} params - 交通换乘参数。
  53351. */
  53352. }, {
  53353. key: "processAsync",
  53354. value: function processAsync(params) {
  53355. if (!(params instanceof TransferPathParameters)) {
  53356. return;
  53357. }
  53358. var me = this,
  53359. method = "GET",
  53360. jsonParameters;
  53361. me.url = Util_Util.urlPathAppend(me.url, 'path');
  53362. jsonParameters = {
  53363. points: Util_Util.toJSON(params.points),
  53364. transferLines: Util_Util.toJSON(params['transferLines'])
  53365. };
  53366. me.request({
  53367. method: method,
  53368. params: jsonParameters,
  53369. scope: me,
  53370. success: me.serviceProcessCompleted,
  53371. failure: me.serviceProcessFailed
  53372. });
  53373. }
  53374. }]);
  53375. return TransferPathService;
  53376. }(CommonServiceBase);
  53377. ;// CONCATENATED MODULE: ./src/common/iServer/TransferSolutionParameters.js
  53378. function TransferSolutionParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53379. function TransferSolutionParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  53380. function TransferSolutionParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferSolutionParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferSolutionParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  53381. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53382. * This program are made available under the terms of the Apache License, Version 2.0
  53383. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53384. /**
  53385. * @class TransferSolutionParameters
  53386. * @deprecatedclass SuperMap.TransferSolutionParameters
  53387. * @category iServer TrafficTransferAnalyst TransferSolutions
  53388. * @classdesc 交通换乘方案查询参数类。
  53389. * @param {Object} options - 参数。
  53390. * @param {Array.<GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|Array.<number>|number>} options.points - 两种查询方式:按照公交站点的起止ID进行查询和按照起止点的坐标进行查询。
  53391. * @param {number} [options.solutionCount=6] - 乘车方案的数量。
  53392. * @param {TransferTactic} [options.transferTactic=TransferTactic.LESS_TIME] - 交通换乘策略类型,包括时间最短、距离最短、最少换乘、最少步行四种选择。
  53393. * @param {TransferPreference} [options.transferPreference=TransferPreference.NONE] - 乘车偏好枚举。
  53394. * @param {number} [options.walkingRatio=10] - 步行与公交的消耗权重比。
  53395. * @param {Array.<number>} [options.evadeLines] - 避让路线的 ID。
  53396. * @param {Array.<number>} [options.evadeStops] - 避让站点的 ID。
  53397. * @param {Array.<number>} [options.priorLines] - 优先路线的 ID。
  53398. * @param {Array.<number>} [options.priorStops] - 优先站点的 ID。
  53399. * @param {string} [options.travelTime] - 出行的时间。
  53400. * @usage
  53401. */
  53402. var TransferSolutionParameters = /*#__PURE__*/function () {
  53403. function TransferSolutionParameters(options) {
  53404. TransferSolutionParameters_classCallCheck(this, TransferSolutionParameters);
  53405. options = options || {};
  53406. /**
  53407. * @member {number} [TransferSolutionParameters.prototype.solutionCount=6]
  53408. * @description 乘车方案的数量。
  53409. */
  53410. this.solutionCount = 6;
  53411. /**
  53412. * @member {TransferPreference} [TransferSolutionParameters.prototype.transferPreference=TransferPreference.NONE]
  53413. * @description 乘车偏好枚举。
  53414. */
  53415. this.transferPreference = TransferPreference.NONE;
  53416. /**
  53417. * @member {TransferTactic} [TransferSolutionParameters.prototype.transferTactic=TransferTactic|TransferTactic.LESS_TIME]
  53418. * @description 交通换乘策略类型,包括时间最短、距离最短、最少换乘、最少步行四种选择。
  53419. */
  53420. this.transferTactic = TransferTactic.LESS_TIME;
  53421. /**
  53422. * @member {number} [TransferSolutionParameters.prototype.walkingRatio=10]
  53423. * @description 步行与公交的消耗权重比。此值越大,则步行因素对于方案选择的影响越大。例如:</br>
  53424. * 例如现在有两种换乘方案(在仅考虑消耗因素的情况下):</br>
  53425. * 方案1:坐车 10 公里,走路 1 公里;</br>
  53426. * 方案2:坐车 15 公里,走路 0.5 公里;</br>
  53427. * 1. 假设权重比为 15:</br>
  53428. * •方案 1 的总消耗为:10 + 1*15 = 25</br>
  53429. * •方案 2 的总消耗为:15 + 0.5*15 = 22.5</br>
  53430. * 此时方案 2 消耗更低。</br>
  53431. * 2. 假设权重比为2:</br>
  53432. * •方案 1 的总消耗为:10+1*2 = 12</br>
  53433. * •方案 2 的总消耗为:15+0.5*2 = 17</br>
  53434. * 此时方案 1 消耗更低。</br>
  53435. */
  53436. this.walkingRatio = null;
  53437. /**
  53438. * @member {Array.<GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|Array.<number>|number>} TransferSolutionParameters.prototype.points
  53439. * @description 两种查询方式:</br>
  53440. * 1. 按照公交站点的起止 ID 进行查询,则 points 参数的类型为 int[],形如:[起点 ID、终点 ID],公交站点的 ID 对应服务提供者配置中的站点 ID 字段;
  53441. * 2. 按照起止点的坐标进行查询,则 points 参数的类型为 Point2D[],形如:[{"x":44,"y":39},{"x":45,"y":40}]。
  53442. */
  53443. this.points = false;
  53444. /**
  53445. * @member {Array.<number>} [TransferSolutionParameters.prototype.evadeLinesnull]
  53446. * @description 避让路线 ID。
  53447. * */
  53448. this.evadeLines = null;
  53449. /**
  53450. * @member {Array.<number>} [TransferSolutionParameters.prototype.evadeStops=TransferLine]
  53451. * @description 避让站点 ID。
  53452. * */
  53453. this.evadeStops = null;
  53454. /**
  53455. * @member {Array.<number>} [TransferSolutionParameters.prototype.priorLines]
  53456. * @description 优先路线 ID。
  53457. * */
  53458. this.priorLines = null;
  53459. /**
  53460. * @member {Array.<number>} [TransferSolutionParameters.prototype.priorStops]
  53461. * @description 优先站点 ID。
  53462. * */
  53463. this.priorStops = null;
  53464. /**
  53465. * @member {string} TransferSolutionParameters.prototype.travelTime
  53466. * @description 出行的时间;格式是:"小时:分钟",如:"08:30"。如果设置了该参数,在分析时,则会考虑线路的首末班车时间的限制,即在返回的结果中会提示公交的首末班发车时间。
  53467. */
  53468. this.travelTime = null;
  53469. Util_Util.extend(this, options);
  53470. this.CLASS_NAME = "SuperMap.TransferSolutionParameters";
  53471. }
  53472. /**
  53473. * @function TransferSolutionParameters.prototype.destroy
  53474. * @description 释放资源,将引用资源的属性置空。
  53475. */
  53476. TransferSolutionParameters_createClass(TransferSolutionParameters, [{
  53477. key: "destroy",
  53478. value: function destroy() {
  53479. Util_Util.reset(this);
  53480. }
  53481. /**
  53482. * @function TransferSolutionParameters.toJsonParameters
  53483. * @description 将 {@link TransferSolutionParameters} 对象参数转换为 JSON 字符串。
  53484. * @param {TransferSolutionParameters} params - 交通换乘参数。
  53485. * @returns {string} 转化后的 JSON 字符串。
  53486. */
  53487. }], [{
  53488. key: "toJson",
  53489. value: function toJson(params) {
  53490. if (params) {
  53491. return Util_Util.toJSON(params);
  53492. }
  53493. }
  53494. }]);
  53495. return TransferSolutionParameters;
  53496. }();
  53497. ;// CONCATENATED MODULE: ./src/common/iServer/TransferSolutionService.js
  53498. function TransferSolutionService_typeof(obj) { "@babel/helpers - typeof"; return TransferSolutionService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, TransferSolutionService_typeof(obj); }
  53499. function TransferSolutionService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53500. function TransferSolutionService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  53501. function TransferSolutionService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferSolutionService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferSolutionService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  53502. function TransferSolutionService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { TransferSolutionService_get = Reflect.get.bind(); } else { TransferSolutionService_get = function _get(target, property, receiver) { var base = TransferSolutionService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return TransferSolutionService_get.apply(this, arguments); }
  53503. function TransferSolutionService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TransferSolutionService_getPrototypeOf(object); if (object === null) break; } return object; }
  53504. function TransferSolutionService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) TransferSolutionService_setPrototypeOf(subClass, superClass); }
  53505. function TransferSolutionService_setPrototypeOf(o, p) { TransferSolutionService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TransferSolutionService_setPrototypeOf(o, p); }
  53506. function TransferSolutionService_createSuper(Derived) { var hasNativeReflectConstruct = TransferSolutionService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = TransferSolutionService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = TransferSolutionService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return TransferSolutionService_possibleConstructorReturn(this, result); }; }
  53507. function TransferSolutionService_possibleConstructorReturn(self, call) { if (call && (TransferSolutionService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return TransferSolutionService_assertThisInitialized(self); }
  53508. function TransferSolutionService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  53509. function TransferSolutionService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  53510. function TransferSolutionService_getPrototypeOf(o) { TransferSolutionService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TransferSolutionService_getPrototypeOf(o); }
  53511. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53512. * This program are made available under the terms of the Apache License, Version 2.0
  53513. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53514. /**
  53515. * @class TransferSolutionService
  53516. * @deprecatedclass SuperMap.TransferSolutionService
  53517. * @category iServer TrafficTransferAnalyst TransferSolutions
  53518. * @classdesc 交通换乘方案查询服务类。
  53519. * 返回结果通过该类支持的事件的监听函数参数获取。
  53520. * @param {string} url - 服务地址。
  53521. * 例如:</br>"http://localhost:8090/iserver/services/traffictransferanalyst-sample/restjsr/traffictransferanalyst/Traffic-Changchun"。
  53522. * @param {Object} options - 参数。</br>
  53523. * @param {Object} options.eventListeners - 需要被注册的监听器对象。</br>
  53524. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  53525. * @param {Object} [options.headers] - 请求头。
  53526. * @extends {CommonServiceBase}
  53527. * @example 例如:
  53528. * (start code)
  53529. * var myService = new TransferSolutionService(url, {eventListeners: {
  53530. * "processCompleted": trafficTransferCompleted,
  53531. * "processFailed": trafficTransferError
  53532. * }
  53533. * };
  53534. * (end)
  53535. * @usage
  53536. */
  53537. var TransferSolutionService = /*#__PURE__*/function (_CommonServiceBase) {
  53538. TransferSolutionService_inherits(TransferSolutionService, _CommonServiceBase);
  53539. var _super = TransferSolutionService_createSuper(TransferSolutionService);
  53540. function TransferSolutionService(url, options) {
  53541. var _this;
  53542. TransferSolutionService_classCallCheck(this, TransferSolutionService);
  53543. _this = _super.call(this, url, options);
  53544. _this.CLASS_NAME = "SuperMap.TransferSolutionService";
  53545. return _this;
  53546. }
  53547. /**
  53548. * @override
  53549. */
  53550. TransferSolutionService_createClass(TransferSolutionService, [{
  53551. key: "destroy",
  53552. value: function destroy() {
  53553. TransferSolutionService_get(TransferSolutionService_getPrototypeOf(TransferSolutionService.prototype), "destroy", this).call(this);
  53554. }
  53555. /**
  53556. * @function TransferSolutionService.prototype.processAsync
  53557. * @description 负责将客户端的更新参数传递到服务端。
  53558. * @param {TransferSolutionParameters} params - 交通换乘参数。
  53559. */
  53560. }, {
  53561. key: "processAsync",
  53562. value: function processAsync(params) {
  53563. if (!(params instanceof TransferSolutionParameters)) {
  53564. return;
  53565. }
  53566. var me = this,
  53567. method = "GET",
  53568. jsonParameters;
  53569. me.url = Util_Util.urlPathAppend(me.url, 'solutions');
  53570. jsonParameters = {
  53571. points: Util_Util.toJSON(params.points),
  53572. walkingRatio: params['walkingRatio'],
  53573. transferTactic: params['transferTactic'],
  53574. solutionCount: params['solutionCount'],
  53575. transferPreference: params["transferPreference"]
  53576. };
  53577. if (params.evadeLines) {
  53578. jsonParameters["evadeLines"] = Util_Util.toJSON(params.evadeLines);
  53579. }
  53580. if (params.evadeStops) {
  53581. jsonParameters["evadeStops"] = Util_Util.toJSON(params.evadeStops);
  53582. }
  53583. if (params.priorLines) {
  53584. jsonParameters["priorLines"] = Util_Util.toJSON(params.priorLines);
  53585. }
  53586. if (params.priorStops) {
  53587. jsonParameters["priorStops"] = Util_Util.toJSON(params.priorStops);
  53588. }
  53589. if (params.travelTime) {
  53590. jsonParameters["travelTime"] = params.travelTime;
  53591. }
  53592. me.request({
  53593. method: method,
  53594. params: jsonParameters,
  53595. scope: me,
  53596. success: me.serviceProcessCompleted,
  53597. failure: me.serviceProcessFailed
  53598. });
  53599. }
  53600. }]);
  53601. return TransferSolutionService;
  53602. }(CommonServiceBase);
  53603. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateEdgeWeightParameters.js
  53604. function UpdateEdgeWeightParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53605. function UpdateEdgeWeightParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  53606. function UpdateEdgeWeightParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateEdgeWeightParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateEdgeWeightParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  53607. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53608. * This program are made available under the terms of the Apache License, Version 2.0
  53609. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53610. /**
  53611. * @class UpdateEdgeWeightParameters
  53612. * @deprecatedclass SuperMap.UpdateEdgeWeightParameters
  53613. * @category iServer NetworkAnalyst EdgeWeight
  53614. * @classdesc 边的耗费权重更新服务参数类。
  53615. * @param {Object} options - 参数。
  53616. * @param {string} options.edgeId - 所在边的 ID。
  53617. * @param {string} options.fromNodeId - 起始转向点的 ID。
  53618. * @param {string} options.toNodeId - 终止转向点的 ID。
  53619. * @param {string} options.weightField - 边的耗费字段。
  53620. * @param {string} options.edgeWeight - 耗费权重。
  53621. * @usage
  53622. */
  53623. var UpdateEdgeWeightParameters = /*#__PURE__*/function () {
  53624. function UpdateEdgeWeightParameters(options) {
  53625. UpdateEdgeWeightParameters_classCallCheck(this, UpdateEdgeWeightParameters);
  53626. if (!options) {
  53627. return;
  53628. }
  53629. /**
  53630. * @member {string} UpdateEdgeWeightParameters.prototype.edgeId
  53631. * @description 所在边的 ID。
  53632. */
  53633. this.edgeId = "";
  53634. /**
  53635. * @member {string} UpdateEdgeWeightParameters.prototype.fromNodeId
  53636. * @description 起始转向点的 ID。
  53637. */
  53638. this.fromNodeId = "";
  53639. /**
  53640. * @member {string} UpdateEdgeWeightParameters.prototype.toNodeId
  53641. * @description 终止转向点的 ID。
  53642. */
  53643. this.toNodeId = "";
  53644. /**
  53645. * @member {string} UpdateEdgeWeightParameters.prototype.weightField
  53646. * @description 边的耗费字段。
  53647. */
  53648. this.weightField = "";
  53649. /**
  53650. * @member {string} UpdateEdgeWeightParameters.prototype.edgeWeight
  53651. * @description 耗费权重。
  53652. */
  53653. this.edgeWeight = "";
  53654. Util_Util.extend(this, options);
  53655. this.CLASS_NAME = "SuperMap.UpdateEdgeWeightParameters";
  53656. }
  53657. /**
  53658. * @function UpdateEdgeWeightParameters.prototype.destroy
  53659. * @description 释放资源,将引用资源的属性置空。
  53660. */
  53661. UpdateEdgeWeightParameters_createClass(UpdateEdgeWeightParameters, [{
  53662. key: "destroy",
  53663. value: function destroy() {
  53664. this.edgeId = null;
  53665. this.fromNodeId = null;
  53666. this.toNodeId = null;
  53667. this.weightField = null;
  53668. this.edgeWeight = null;
  53669. }
  53670. }]);
  53671. return UpdateEdgeWeightParameters;
  53672. }();
  53673. ;// CONCATENATED MODULE: ./src/common/iServer/CreateDatasetParameters.js
  53674. function CreateDatasetParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53675. function CreateDatasetParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  53676. function CreateDatasetParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) CreateDatasetParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) CreateDatasetParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  53677. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53678. * This program are made available under the terms of the Apache License, Version 2.0
  53679. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53680. /**
  53681. * @class CreateDatasetParameters
  53682. * @deprecatedclass SuperMap.CreateDatasetParameters
  53683. * @category iServer Data Dataset
  53684. * @classdesc 数据集创建参数类。
  53685. * @param {Object} options - 参数。
  53686. * @param {string} options.datasourceName - 数据源名称,此为必选参数。
  53687. * @param {string} options.datasetName - 数据集名称,此为必选参数。
  53688. * @param {string} options.datasetType - 数据集类型。目前支持创建的数据集类型有:点、线、面、文本、复合(CAD)和属性数据集。
  53689. * @usage
  53690. */
  53691. var CreateDatasetParameters = /*#__PURE__*/function () {
  53692. function CreateDatasetParameters(options) {
  53693. CreateDatasetParameters_classCallCheck(this, CreateDatasetParameters);
  53694. if (!options) {
  53695. return;
  53696. }
  53697. /**
  53698. * @member {string} CreateDatasetParameters.prototype.datasourceName
  53699. * @description 数据源名称,此为必选参数。
  53700. */
  53701. this.datasourceName = null;
  53702. /**
  53703. * @member {string} CreateDatasetParameters.prototype.datasetName
  53704. * @description 数据集名称,此为必选参数。
  53705. */
  53706. this.datasetName = null;
  53707. /**
  53708. * @member {string} CreateDatasetParameters.prototype.datasetType
  53709. * @description 数据集类型。目前支持创建的数据集类型有:点、线、面、文本、复合(CAD)和属性数据集。
  53710. */
  53711. this.datasetType = null;
  53712. if (options) {
  53713. Util_Util.extend(this, options);
  53714. }
  53715. this.CLASS_NAME = "SuperMap.CreateDatasetParameters";
  53716. }
  53717. /**
  53718. * @function CreateDatasetParameters.prototype.destroy
  53719. * @description 释放资源,将引用资源的属性置空。
  53720. */
  53721. CreateDatasetParameters_createClass(CreateDatasetParameters, [{
  53722. key: "destroy",
  53723. value: function destroy() {
  53724. var me = this;
  53725. me.datasourceName = null;
  53726. me.datasetName = null;
  53727. me.datasetType = null;
  53728. }
  53729. }]);
  53730. return CreateDatasetParameters;
  53731. }();
  53732. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateEdgeWeightService.js
  53733. function UpdateEdgeWeightService_typeof(obj) { "@babel/helpers - typeof"; return UpdateEdgeWeightService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, UpdateEdgeWeightService_typeof(obj); }
  53734. function UpdateEdgeWeightService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53735. function UpdateEdgeWeightService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  53736. function UpdateEdgeWeightService_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateEdgeWeightService_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateEdgeWeightService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  53737. function UpdateEdgeWeightService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { UpdateEdgeWeightService_get = Reflect.get.bind(); } else { UpdateEdgeWeightService_get = function _get(target, property, receiver) { var base = UpdateEdgeWeightService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return UpdateEdgeWeightService_get.apply(this, arguments); }
  53738. function UpdateEdgeWeightService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UpdateEdgeWeightService_getPrototypeOf(object); if (object === null) break; } return object; }
  53739. function UpdateEdgeWeightService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) UpdateEdgeWeightService_setPrototypeOf(subClass, superClass); }
  53740. function UpdateEdgeWeightService_setPrototypeOf(o, p) { UpdateEdgeWeightService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UpdateEdgeWeightService_setPrototypeOf(o, p); }
  53741. function UpdateEdgeWeightService_createSuper(Derived) { var hasNativeReflectConstruct = UpdateEdgeWeightService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = UpdateEdgeWeightService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = UpdateEdgeWeightService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return UpdateEdgeWeightService_possibleConstructorReturn(this, result); }; }
  53742. function UpdateEdgeWeightService_possibleConstructorReturn(self, call) { if (call && (UpdateEdgeWeightService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return UpdateEdgeWeightService_assertThisInitialized(self); }
  53743. function UpdateEdgeWeightService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  53744. function UpdateEdgeWeightService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  53745. function UpdateEdgeWeightService_getPrototypeOf(o) { UpdateEdgeWeightService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UpdateEdgeWeightService_getPrototypeOf(o); }
  53746. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53747. * This program are made available under the terms of the Apache License, Version 2.0
  53748. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53749. /**
  53750. * @class UpdateEdgeWeightService
  53751. * @deprecatedclass SuperMap.UpdateEdgeWeightService
  53752. * @category iServer NetworkAnalyst EdgeWeight
  53753. * @classdesc 更新边的边的耗费权重服务
  53754. * @extends {NetworkAnalystServiceBase}
  53755. * @example
  53756. *(start code)
  53757. * var updateEdgeWeightService = new UpdateEdgeWeightService(url, {
  53758. * eventListeners: {
  53759. * "processCompleted": UpdateEdgeWeightCompleted,
  53760. * "processFailed": UpdateEdgeWeightError
  53761. * }
  53762. * });
  53763. * (end)
  53764. * @param {string} url - 服务地址。如:http://localhost:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun 。
  53765. * @param {Object} options - 参数。
  53766. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  53767. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  53768. * @param {Object} [options.headers] - 请求头。
  53769. * @usage
  53770. */
  53771. var UpdateEdgeWeightService = /*#__PURE__*/function (_NetworkAnalystServic) {
  53772. UpdateEdgeWeightService_inherits(UpdateEdgeWeightService, _NetworkAnalystServic);
  53773. var _super = UpdateEdgeWeightService_createSuper(UpdateEdgeWeightService);
  53774. function UpdateEdgeWeightService(url, options) {
  53775. var _this;
  53776. UpdateEdgeWeightService_classCallCheck(this, UpdateEdgeWeightService);
  53777. _this = _super.call(this, url, options);
  53778. _this.CLASS_NAME = "SuperMap.UpdateEdgeWeightService";
  53779. return _this;
  53780. }
  53781. /**
  53782. * @override
  53783. */
  53784. UpdateEdgeWeightService_createClass(UpdateEdgeWeightService, [{
  53785. key: "destroy",
  53786. value: function destroy() {
  53787. UpdateEdgeWeightService_get(UpdateEdgeWeightService_getPrototypeOf(UpdateEdgeWeightService.prototype), "destroy", this).call(this);
  53788. }
  53789. /**
  53790. * @function UpdateEdgeWeightService.prototype.processAsync
  53791. * @description 开始异步执行边的边的耗费权重的更新
  53792. * @param {UpdateEdgeWeightParameters} params - 边的耗费权重更新服务参数类
  53793. * @example
  53794. * (code)
  53795. * var updateEdgeWeightParam=new SuperMapUpdateEdgeWeightParameters({
  53796. * edgeId:"20",
  53797. * fromNodeId:"26",
  53798. * toNodeId:"109",
  53799. * weightField:"time",
  53800. * edgeWeight:"25"
  53801. * });
  53802. * updateEdgeWeightService.processAsync(updateEdgeWeightParam);
  53803. * (end)
  53804. */
  53805. }, {
  53806. key: "processAsync",
  53807. value: function processAsync(params) {
  53808. if (!(params instanceof UpdateEdgeWeightParameters)) {
  53809. return;
  53810. }
  53811. var me = this;
  53812. var paramStr = me.parse(params);
  53813. me.url = Util_Util.urlPathAppend(me.url, paramStr);
  53814. var data = params.edgeWeight ? params.edgeWeight : null;
  53815. me.request({
  53816. method: "PUT",
  53817. scope: me,
  53818. data: data,
  53819. success: me.serviceProcessCompleted,
  53820. failure: me.serviceProcessFailed
  53821. });
  53822. }
  53823. /**
  53824. * @function UpdateEdgeWeightService.prototype.parse
  53825. * @description 将更新服务参数解析为用‘/’做分隔的字符串
  53826. */
  53827. }, {
  53828. key: "parse",
  53829. value: function parse(params) {
  53830. if (!params) {
  53831. return;
  53832. }
  53833. var paramStr = "";
  53834. for (var attr in params) {
  53835. if (params[attr] === "" || params[attr] === "edgeWeight") {
  53836. continue;
  53837. }
  53838. switch (attr) {
  53839. case "edgeId":
  53840. paramStr += "/edgeweight/" + params[attr];
  53841. break;
  53842. case "fromNodeId":
  53843. paramStr += "/fromnode/" + params[attr];
  53844. break;
  53845. case "toNodeId":
  53846. paramStr += "/tonode/" + params[attr];
  53847. break;
  53848. case "weightField":
  53849. paramStr += "/weightfield/" + params[attr];
  53850. break;
  53851. default:
  53852. break;
  53853. }
  53854. }
  53855. return paramStr;
  53856. }
  53857. }]);
  53858. return UpdateEdgeWeightService;
  53859. }(NetworkAnalystServiceBase);
  53860. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateTurnNodeWeightParameters.js
  53861. function UpdateTurnNodeWeightParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53862. function UpdateTurnNodeWeightParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  53863. function UpdateTurnNodeWeightParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateTurnNodeWeightParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateTurnNodeWeightParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  53864. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53865. * This program are made available under the terms of the Apache License, Version 2.0
  53866. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53867. /**
  53868. * @class UpdateTurnNodeWeightParameters
  53869. * @deprecatedclass SuperMap.UpdateTurnNodeWeightParameters
  53870. * @category iServer NetworkAnalyst TurnNodeWeight
  53871. * @classdesc 转向耗费权重更新服务参数类。
  53872. * @param {Object} options - 参数。
  53873. * @param {string} options.nodeId - 转向结点的 ID。
  53874. * @param {string} options.fromEdgeId - 起始边的 ID。
  53875. * @param {string} options.toEdgeId - 终止边的 ID。
  53876. * @param {string} options.weightField - 转向结点的耗费字段。
  53877. * @param {string} options.turnNodeWeight - 耗费权重。
  53878. * @usage
  53879. */
  53880. var UpdateTurnNodeWeightParameters = /*#__PURE__*/function () {
  53881. function UpdateTurnNodeWeightParameters(options) {
  53882. UpdateTurnNodeWeightParameters_classCallCheck(this, UpdateTurnNodeWeightParameters);
  53883. if (!options) {
  53884. return;
  53885. }
  53886. /**
  53887. * @member {string} UpdateTurnNodeWeightParameters.prototype.nodeId
  53888. * @description 转向结点的 ID。
  53889. */
  53890. this.nodeId = "";
  53891. /**
  53892. * @member {string} UpdateTurnNodeWeightParameters.prototype.fromEdgeId
  53893. * @description 起始边的 ID。
  53894. */
  53895. this.fromEdgeId = "";
  53896. /**
  53897. * @member {string} UpdateTurnNodeWeightParameters.prototype.toEdgeId
  53898. * @description 终止边的 ID。
  53899. */
  53900. this.toEdgeId = "";
  53901. /**
  53902. * @member {string} UpdateTurnNodeWeightParameters.prototype.weightField
  53903. * @description 转向结点的耗费字段。
  53904. */
  53905. this.weightField = "";
  53906. /**
  53907. * @member {string} UpdateTurnNodeWeightParameters.prototype.turnNodeWeight
  53908. * @description 耗费权重。
  53909. */
  53910. this.turnNodeWeight = "";
  53911. Util_Util.extend(this, options);
  53912. this.CLASS_NAME = "SuperMap.UpdateTurnNodeWeightParameters";
  53913. }
  53914. /**
  53915. * @function UpdateTurnNodeWeightParameters.prototype.destroy
  53916. * @description 释放资源,将引用资源的属性置空。
  53917. */
  53918. UpdateTurnNodeWeightParameters_createClass(UpdateTurnNodeWeightParameters, [{
  53919. key: "destroy",
  53920. value: function destroy() {
  53921. this.nodeId = null;
  53922. this.fromEdgeId = null;
  53923. this.toEdgeId = null;
  53924. this.weightField = null;
  53925. this.turnNodeWeight = null;
  53926. }
  53927. }]);
  53928. return UpdateTurnNodeWeightParameters;
  53929. }();
  53930. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateTurnNodeWeightService.js
  53931. function UpdateTurnNodeWeightService_typeof(obj) { "@babel/helpers - typeof"; return UpdateTurnNodeWeightService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, UpdateTurnNodeWeightService_typeof(obj); }
  53932. function UpdateTurnNodeWeightService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53933. function UpdateTurnNodeWeightService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  53934. function UpdateTurnNodeWeightService_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateTurnNodeWeightService_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateTurnNodeWeightService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  53935. function UpdateTurnNodeWeightService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { UpdateTurnNodeWeightService_get = Reflect.get.bind(); } else { UpdateTurnNodeWeightService_get = function _get(target, property, receiver) { var base = UpdateTurnNodeWeightService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return UpdateTurnNodeWeightService_get.apply(this, arguments); }
  53936. function UpdateTurnNodeWeightService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UpdateTurnNodeWeightService_getPrototypeOf(object); if (object === null) break; } return object; }
  53937. function UpdateTurnNodeWeightService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) UpdateTurnNodeWeightService_setPrototypeOf(subClass, superClass); }
  53938. function UpdateTurnNodeWeightService_setPrototypeOf(o, p) { UpdateTurnNodeWeightService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UpdateTurnNodeWeightService_setPrototypeOf(o, p); }
  53939. function UpdateTurnNodeWeightService_createSuper(Derived) { var hasNativeReflectConstruct = UpdateTurnNodeWeightService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = UpdateTurnNodeWeightService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = UpdateTurnNodeWeightService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return UpdateTurnNodeWeightService_possibleConstructorReturn(this, result); }; }
  53940. function UpdateTurnNodeWeightService_possibleConstructorReturn(self, call) { if (call && (UpdateTurnNodeWeightService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return UpdateTurnNodeWeightService_assertThisInitialized(self); }
  53941. function UpdateTurnNodeWeightService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  53942. function UpdateTurnNodeWeightService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  53943. function UpdateTurnNodeWeightService_getPrototypeOf(o) { UpdateTurnNodeWeightService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UpdateTurnNodeWeightService_getPrototypeOf(o); }
  53944. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53945. * This program are made available under the terms of the Apache License, Version 2.0
  53946. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53947. /**
  53948. * @class UpdateTurnNodeWeightService
  53949. * @deprecatedclass SuperMap.UpdateTurnNodeWeightService
  53950. * @category iServer NetworkAnalyst TurnNodeWeight
  53951. * @classdesc 转向耗费权重更新服务类
  53952. * @extends {NetworkAnalystServiceBase}
  53953. * @example
  53954. * var UpdateTurnNodeWeightService = new UpdateTurnNodeWeightService(url, {
  53955. * eventListeners: {
  53956. * "processCompleted": UpdateTurnNodeWeightCompleted,
  53957. * "processFailed": UpdateTurnNodeWeightError
  53958. * }
  53959. * });
  53960. * @param {string} url - 服务地址。如:
  53961. * http://localhost:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun 。
  53962. * @param {Object} options - 参数。
  53963. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  53964. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  53965. * @param {Object} [options.headers] - 请求头。
  53966. * @usage
  53967. */
  53968. var UpdateTurnNodeWeightService = /*#__PURE__*/function (_NetworkAnalystServic) {
  53969. UpdateTurnNodeWeightService_inherits(UpdateTurnNodeWeightService, _NetworkAnalystServic);
  53970. var _super = UpdateTurnNodeWeightService_createSuper(UpdateTurnNodeWeightService);
  53971. function UpdateTurnNodeWeightService(url, options) {
  53972. var _this;
  53973. UpdateTurnNodeWeightService_classCallCheck(this, UpdateTurnNodeWeightService);
  53974. _this = _super.call(this, url, options);
  53975. _this.CLASS_NAME = "SuperMap.UpdateTurnNodeWeightService";
  53976. return _this;
  53977. }
  53978. /**
  53979. * @override
  53980. */
  53981. UpdateTurnNodeWeightService_createClass(UpdateTurnNodeWeightService, [{
  53982. key: "destroy",
  53983. value: function destroy() {
  53984. UpdateTurnNodeWeightService_get(UpdateTurnNodeWeightService_getPrototypeOf(UpdateTurnNodeWeightService.prototype), "destroy", this).call(this);
  53985. }
  53986. /**
  53987. * @function UpdateTurnNodeWeightService.prototype.processAsync
  53988. * @description 开始异步执行转向耗费权重的更新
  53989. * @param {UpdateTurnNodeWeightParameters} params - 转向耗费权重更新服务参数类
  53990. * @example
  53991. * (code)
  53992. * var updateTurnNodeWeightParam=new UpdateTurnNodeWeightParameters({
  53993. * nodeId:"106",
  53994. * fromEdgeId:"6508",
  53995. * toEdgeId:"6504",
  53996. * weightField:"TurnCost",
  53997. * turnNodeWeight:"50"
  53998. * });
  53999. * updateTurnNodeWeightService.processAsync(updateTurnNodeWeightParam);
  54000. * (end)
  54001. **/
  54002. }, {
  54003. key: "processAsync",
  54004. value: function processAsync(params) {
  54005. if (!(params instanceof UpdateTurnNodeWeightParameters)) {
  54006. return;
  54007. }
  54008. var me = this;
  54009. var paramStr = me.parse(params);
  54010. me.url = Util_Util.urlPathAppend(me.url, paramStr);
  54011. var data = params.turnNodeWeight ? params.turnNodeWeight : null;
  54012. me.request({
  54013. method: "PUT",
  54014. scope: me,
  54015. data: data,
  54016. success: me.serviceProcessCompleted,
  54017. failure: me.serviceProcessFailed
  54018. });
  54019. }
  54020. /**
  54021. * @function UpdateTurnNodeWeightService.prototype.parse
  54022. * @description 将更新服务参数解析为用‘/’做分隔的字符串
  54023. */
  54024. }, {
  54025. key: "parse",
  54026. value: function parse(params) {
  54027. if (!params) {
  54028. return;
  54029. }
  54030. var paramStr = "";
  54031. for (var attr in params) {
  54032. if (params[attr] === "" || params[attr] === "turnNodeWeight") {
  54033. continue;
  54034. }
  54035. switch (attr) {
  54036. case "nodeId":
  54037. paramStr += "/turnnodeweight/" + params[attr];
  54038. break;
  54039. case "fromEdgeId":
  54040. paramStr += "/fromedge/" + params[attr];
  54041. break;
  54042. case "toEdgeId":
  54043. paramStr += "/toedge/" + params[attr];
  54044. break;
  54045. case "weightField":
  54046. paramStr += "/weightfield/" + params[attr];
  54047. break;
  54048. default:
  54049. break;
  54050. }
  54051. }
  54052. return paramStr;
  54053. }
  54054. }]);
  54055. return UpdateTurnNodeWeightService;
  54056. }(NetworkAnalystServiceBase);
  54057. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateDatasetParameters.js
  54058. function UpdateDatasetParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54059. function UpdateDatasetParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  54060. function UpdateDatasetParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateDatasetParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateDatasetParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  54061. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  54062. * This program are made available under the terms of the Apache License, Version 2.0
  54063. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54064. /**
  54065. * @class UpdateDatasetParameters
  54066. * @deprecatedclass SuperMap.UpdateDatasetParameters
  54067. * @category iServer Data Dataset
  54068. * @classdesc 数据集信息更改参数类。
  54069. * @param {Object} options - 参数。
  54070. * @param {string} options.datasourceName - 数据源名称。
  54071. * @param {string} options.datasetName - 数据集名称。
  54072. * @param {boolean} options.isFileCache - 是否使用文件形式的缓存。仅对数据库型数据源中的矢量数据集有效。
  54073. * @param {string} options.description - 数据集描述信息。
  54074. * @param {string} options.prjCoordSys - 投影坐标系。
  54075. * @param {Object} options.charset - 矢量数据集的字符集。当数据集类型为矢量数据集时,可以传递此参数。如果用户传递空值,则编码方式保持不变。
  54076. * @param {Array.<string>} options.palette - 影像数据的颜色调色板。当数据集类型为影像数据集时,可以传递此参数。
  54077. * @param {number} options.noValue - 栅格数据集中没有数据的像元的栅格值。当数据集类型为栅格数据集时,可以传递此参数。
  54078. * @usage
  54079. */
  54080. var UpdateDatasetParameters = /*#__PURE__*/function () {
  54081. function UpdateDatasetParameters(options) {
  54082. UpdateDatasetParameters_classCallCheck(this, UpdateDatasetParameters);
  54083. if (!options) {
  54084. return;
  54085. }
  54086. /**
  54087. * @member {string} UpdateDatasetParameters.prototype.datasourceName
  54088. * @description 数据源名称。
  54089. */
  54090. this.datasourceName = null;
  54091. /**
  54092. * @member {string} UpdateDatasetParameters.prototype.datasetName
  54093. * @description 数据集名称。
  54094. */
  54095. this.datasetName = null;
  54096. /**
  54097. * @member {boolean} UpdateDatasetParameters.prototype.isFileCache
  54098. * @description 是否使用文件形式的缓存。仅对数据库型数据源中的矢量数据集有效。
  54099. */
  54100. this.isFileCache = null;
  54101. /**
  54102. * @member {string} UpdateDatasetParameters.prototype.description
  54103. * @description 数据集描述信息。
  54104. */
  54105. this.description = null;
  54106. /**
  54107. * @member {string} UpdateDatasetParameters.prototype.prjCoordSys
  54108. * @description 投影坐标系。
  54109. */
  54110. this.prjCoordSys = null;
  54111. /**
  54112. * @member {Object} UpdateDatasetParameters.prototype.charset
  54113. * @description 矢量数据集的字符集。
  54114. */
  54115. this.charset = null;
  54116. /**
  54117. * @member {Array.<string>} UpdateDatasetParameters.prototype.palette
  54118. * @description 影像数据的颜色调色板。
  54119. */
  54120. this.palette = null;
  54121. /**
  54122. * @member {number} UpdateDatasetParameters.prototype.noValue
  54123. * @description 栅格数据集中没有数据的像元的栅格值。
  54124. */
  54125. this.noValue = null;
  54126. if (options) {
  54127. Util_Util.extend(this, options);
  54128. }
  54129. this.CLASS_NAME = "SuperMap.UpdateDatasetParameters";
  54130. }
  54131. /**
  54132. * @function UpdateDatasetParameters.prototype.destroy
  54133. * @description 释放资源,将引用资源的属性置空。
  54134. */
  54135. UpdateDatasetParameters_createClass(UpdateDatasetParameters, [{
  54136. key: "destroy",
  54137. value: function destroy() {
  54138. var me = this;
  54139. me.datasourceName = null;
  54140. me.datasetName = null;
  54141. me.isFileCache = null;
  54142. me.prjCoordSys = null;
  54143. me.charset = null;
  54144. me.palette = null;
  54145. me.noValue = null;
  54146. }
  54147. }]);
  54148. return UpdateDatasetParameters;
  54149. }();
  54150. ;// CONCATENATED MODULE: ./src/common/iServer/VectorClipJobsParameter.js
  54151. function VectorClipJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54152. function VectorClipJobsParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  54153. function VectorClipJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) VectorClipJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) VectorClipJobsParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  54154. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  54155. * This program are made available under the terms of the Apache License, Version 2.0
  54156. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54157. /**
  54158. * @class VectorClipJobsParameter
  54159. * @deprecatedclass SuperMap.VectorClipJobsParameter
  54160. * @category iServer ProcessingService VectorClip
  54161. * @classdesc 矢量裁剪分析任务参数类。
  54162. * @param {Object} options - 参数。
  54163. * @param {string} options.datasetName - 数据集名。
  54164. * @param {string} options.datasetOverlay - 裁剪对象数据集。
  54165. * @param {ClipAnalystMode} [options.mode=ClipAnalystMode.CLIP] - 裁剪分析模式。
  54166. * @param {string} [options.geometryClip] - 裁剪几何对象。
  54167. * @param {OutputSetting} [options.output] - 输出参数设置。
  54168. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  54169. * @usage
  54170. */
  54171. var VectorClipJobsParameter = /*#__PURE__*/function () {
  54172. function VectorClipJobsParameter(options) {
  54173. VectorClipJobsParameter_classCallCheck(this, VectorClipJobsParameter);
  54174. options = options || {};
  54175. /**
  54176. * @member {string} VectorClipJobsParameter.prototype.datasetName
  54177. * @description 数据集名。
  54178. */
  54179. this.datasetName = "";
  54180. /**
  54181. * @member {string} VectorClipJobsParameter.prototype.datasetOverlay
  54182. * @description 裁剪对象数据集。
  54183. */
  54184. this.datasetVectorClip = "";
  54185. /**
  54186. * @member {string} VectorClipJobsParameter.prototype.geometryClip
  54187. * @description 裁剪几何对象。
  54188. */
  54189. this.geometryClip = "";
  54190. /**
  54191. * @member {ClipAnalystMode} [VectorClipJobsParameter.prototype.mode=ClipAnalystMode.CLIP]
  54192. * @description 裁剪分析模式 。
  54193. */
  54194. this.mode = ClipAnalystMode.CLIP;
  54195. /**
  54196. * @member {OutputSetting} VectorClipJobsParameter.prototype.output
  54197. * @description 输出参数设置类。
  54198. */
  54199. this.output = null;
  54200. /**
  54201. * @member {MappingParameters} [VectorClipJobsParameter.prototype.mappingParameters]
  54202. * @description 分析后结果可视化的参数类。
  54203. */
  54204. this.mappingParameters = null;
  54205. Util_Util.extend(this, options);
  54206. this.CLASS_NAME = "SuperMap.VectorClipJobsParameter";
  54207. }
  54208. /**
  54209. * @function VectorClipJobsParameter.prototype.destroy
  54210. * @description 释放资源,将引用资源的属性置空。
  54211. */
  54212. VectorClipJobsParameter_createClass(VectorClipJobsParameter, [{
  54213. key: "destroy",
  54214. value: function destroy() {
  54215. this.datasetName = null;
  54216. this.datasetVectorClip = null;
  54217. this.geometryClip = null;
  54218. this.mode = null;
  54219. if (this.output instanceof OutputSetting) {
  54220. this.output.destroy();
  54221. this.output = null;
  54222. }
  54223. if (this.mappingParameters instanceof MappingParameters) {
  54224. this.mappingParameters.destroy();
  54225. this.mappingParameters = null;
  54226. }
  54227. }
  54228. /**
  54229. * @function VectorClipJobsParameter.toObject
  54230. * @param {Object} vectorClipJobsParameter - 区域汇总分析服务参数。
  54231. * @param {Object} tempObj - 目标对象。
  54232. * @description 矢量裁剪分析任务对象。
  54233. */
  54234. }], [{
  54235. key: "toObject",
  54236. value: function toObject(vectorClipJobsParameter, tempObj) {
  54237. for (var name in vectorClipJobsParameter) {
  54238. if (name === "datasetName") {
  54239. tempObj['input'] = tempObj['input'] || {};
  54240. tempObj['input'][name] = vectorClipJobsParameter[name];
  54241. continue;
  54242. }
  54243. if (name === "output") {
  54244. tempObj['output'] = tempObj['output'] || {};
  54245. tempObj['output'] = vectorClipJobsParameter[name];
  54246. continue;
  54247. }
  54248. tempObj['analyst'] = tempObj['analyst'] || {};
  54249. tempObj['analyst'][name] = vectorClipJobsParameter[name];
  54250. if (name === 'mappingParameters') {
  54251. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  54252. tempObj['analyst']['mappingParameters'] = vectorClipJobsParameter[name];
  54253. }
  54254. }
  54255. }
  54256. }]);
  54257. return VectorClipJobsParameter;
  54258. }();
  54259. ;// CONCATENATED MODULE: ./src/common/iServer/VectorClipJobsService.js
  54260. function VectorClipJobsService_typeof(obj) { "@babel/helpers - typeof"; return VectorClipJobsService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, VectorClipJobsService_typeof(obj); }
  54261. function VectorClipJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54262. function VectorClipJobsService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  54263. function VectorClipJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) VectorClipJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) VectorClipJobsService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  54264. function VectorClipJobsService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { VectorClipJobsService_get = Reflect.get.bind(); } else { VectorClipJobsService_get = function _get(target, property, receiver) { var base = VectorClipJobsService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return VectorClipJobsService_get.apply(this, arguments); }
  54265. function VectorClipJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = VectorClipJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  54266. function VectorClipJobsService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) VectorClipJobsService_setPrototypeOf(subClass, superClass); }
  54267. function VectorClipJobsService_setPrototypeOf(o, p) { VectorClipJobsService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return VectorClipJobsService_setPrototypeOf(o, p); }
  54268. function VectorClipJobsService_createSuper(Derived) { var hasNativeReflectConstruct = VectorClipJobsService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = VectorClipJobsService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = VectorClipJobsService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return VectorClipJobsService_possibleConstructorReturn(this, result); }; }
  54269. function VectorClipJobsService_possibleConstructorReturn(self, call) { if (call && (VectorClipJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return VectorClipJobsService_assertThisInitialized(self); }
  54270. function VectorClipJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  54271. function VectorClipJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  54272. function VectorClipJobsService_getPrototypeOf(o) { VectorClipJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return VectorClipJobsService_getPrototypeOf(o); }
  54273. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  54274. * This program are made available under the terms of the Apache License, Version 2.0
  54275. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54276. /**
  54277. * @class VectorClipJobsService
  54278. * @deprecatedclass SuperMap.VectorClipJobsService
  54279. * @category iServer ProcessingService VectorClip
  54280. * @classdesc 矢量裁剪分析服务类
  54281. * @extends {ProcessingServiceBase}
  54282. * @param {string} url -服务地址。
  54283. * @param {Object} options - 可选参数。
  54284. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  54285. * @param {Object} [options.headers] - 请求头。
  54286. * @usage
  54287. */
  54288. var VectorClipJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  54289. VectorClipJobsService_inherits(VectorClipJobsService, _ProcessingServiceBas);
  54290. var _super = VectorClipJobsService_createSuper(VectorClipJobsService);
  54291. function VectorClipJobsService(url, options) {
  54292. var _this;
  54293. VectorClipJobsService_classCallCheck(this, VectorClipJobsService);
  54294. _this = _super.call(this, url, options);
  54295. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/vectorclip');
  54296. _this.CLASS_NAME = 'SuperMap.VectorClipJobsService';
  54297. return _this;
  54298. }
  54299. /**
  54300. *@override
  54301. */
  54302. VectorClipJobsService_createClass(VectorClipJobsService, [{
  54303. key: "destroy",
  54304. value: function destroy() {
  54305. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "destroy", this).call(this);
  54306. }
  54307. /**
  54308. * @function VectorClipJobsService.protitype.getVectorClipJobs
  54309. * @description 获取矢量裁剪分析所有任务
  54310. */
  54311. }, {
  54312. key: "getVectorClipJobs",
  54313. value: function getVectorClipJobs() {
  54314. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "getJobs", this).call(this, this.url);
  54315. }
  54316. /**
  54317. * @function KernelDensityJobsService.protitype.getVectorClipJob
  54318. * @description 获取指定id的矢量裁剪分析服务
  54319. * @param {string} id - 指定要获取数据的id
  54320. */
  54321. }, {
  54322. key: "getVectorClipJob",
  54323. value: function getVectorClipJob(id) {
  54324. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  54325. }
  54326. /**
  54327. * @function VectorClipJobsService.protitype.addVectorClipJob
  54328. * @description 新建矢量裁剪分析服务
  54329. * @param {VectorClipJobsParameter} params - 创建一个空间分析的请求参数。
  54330. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  54331. */
  54332. }, {
  54333. key: "addVectorClipJob",
  54334. value: function addVectorClipJob(params, seconds) {
  54335. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "addJob", this).call(this, this.url, params, VectorClipJobsParameter, seconds);
  54336. }
  54337. }]);
  54338. return VectorClipJobsService;
  54339. }(ProcessingServiceBase);
  54340. ;// CONCATENATED MODULE: ./src/common/iServer/RasterFunctionParameter.js
  54341. function RasterFunctionParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54342. function RasterFunctionParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  54343. function RasterFunctionParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) RasterFunctionParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) RasterFunctionParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  54344. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  54345. * This program are made available under the terms of the Apache License, Version 2.0
  54346. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54347. /**
  54348. * @class RasterFunctionParameter
  54349. * @deprecatedclass SuperMap.RasterFunctionParameter
  54350. * @category iServer Map Tile
  54351. * @classdesc iServer 地图服务栅格分析参数基类。
  54352. * @param {Object} options - 参数。
  54353. * @param {RasterFunctionType} options.type - 栅格分析方法。
  54354. * @usage
  54355. */
  54356. var RasterFunctionParameter = /*#__PURE__*/function () {
  54357. function RasterFunctionParameter(options) {
  54358. RasterFunctionParameter_classCallCheck(this, RasterFunctionParameter);
  54359. options = options || {};
  54360. /**
  54361. * @member {RasterFunctionType} [RasterFunctionParameter.prototype.type]
  54362. * @description 栅格分析方法。
  54363. */
  54364. this.type = null;
  54365. Util_Util.extend(this, options);
  54366. this.CLASS_NAME = 'SuperMap.RasterFunctionParameter';
  54367. }
  54368. /**
  54369. * @function RasterFunctionParameter.prototype.destroy
  54370. * @description 释放资源,将资源的属性置空。
  54371. */
  54372. RasterFunctionParameter_createClass(RasterFunctionParameter, [{
  54373. key: "destroy",
  54374. value: function destroy() {
  54375. this.type = null;
  54376. }
  54377. }]);
  54378. return RasterFunctionParameter;
  54379. }();
  54380. ;// CONCATENATED MODULE: ./src/common/iServer/NDVIParameter.js
  54381. function NDVIParameter_typeof(obj) { "@babel/helpers - typeof"; return NDVIParameter_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, NDVIParameter_typeof(obj); }
  54382. function NDVIParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54383. function NDVIParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  54384. function NDVIParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) NDVIParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) NDVIParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  54385. function NDVIParameter_get() { if (typeof Reflect !== "undefined" && Reflect.get) { NDVIParameter_get = Reflect.get.bind(); } else { NDVIParameter_get = function _get(target, property, receiver) { var base = NDVIParameter_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return NDVIParameter_get.apply(this, arguments); }
  54386. function NDVIParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = NDVIParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  54387. function NDVIParameter_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) NDVIParameter_setPrototypeOf(subClass, superClass); }
  54388. function NDVIParameter_setPrototypeOf(o, p) { NDVIParameter_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NDVIParameter_setPrototypeOf(o, p); }
  54389. function NDVIParameter_createSuper(Derived) { var hasNativeReflectConstruct = NDVIParameter_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = NDVIParameter_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = NDVIParameter_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return NDVIParameter_possibleConstructorReturn(this, result); }; }
  54390. function NDVIParameter_possibleConstructorReturn(self, call) { if (call && (NDVIParameter_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return NDVIParameter_assertThisInitialized(self); }
  54391. function NDVIParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  54392. function NDVIParameter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  54393. function NDVIParameter_getPrototypeOf(o) { NDVIParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NDVIParameter_getPrototypeOf(o); }
  54394. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  54395. * This program are made available under the terms of the Apache License, Version 2.0
  54396. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54397. /**
  54398. * @class NDVIParameter
  54399. * @deprecatedclass SuperMap.NDVIParameter
  54400. * @category iServer Map Tile
  54401. * @classdesc 归一化植被指数参数类。
  54402. * @param {Object} options - 参数。
  54403. * @param {number} [options.redIndex=0] - 红光谱波段索引。
  54404. * @param {number} [options.nirIndex=1] - 近红外光谱波段索引。
  54405. * @param {string} [options.colorMap="0:ffffe5ff;0.1:f7fcb9ff;0.2:d9f0a3ff;0.3:addd8eff;0.4:78c679ff;0.5:41ab5dff;0.6:238443ff;0.7:006837ff;1:004529ff"] - 颜色表。由栅格的中断值和颜色停止之间的映射组成的,如0.3->d9f0a3ff 指的是[0,0.3)显示d9f0a3ff。仅单波段数据时设定。
  54406. * @extends {RasterFunctionParameter}
  54407. * @usage
  54408. */
  54409. var NDVIParameter = /*#__PURE__*/function (_RasterFunctionParame) {
  54410. NDVIParameter_inherits(NDVIParameter, _RasterFunctionParame);
  54411. var _super = NDVIParameter_createSuper(NDVIParameter);
  54412. function NDVIParameter(options) {
  54413. var _this;
  54414. NDVIParameter_classCallCheck(this, NDVIParameter);
  54415. _this = _super.call(this, options);
  54416. /**
  54417. * @member {number} [NDVIParameter.prototype.redIndex=0]
  54418. * @description 红光谱波段索引。
  54419. */
  54420. _this.redIndex = 0;
  54421. /**
  54422. * @member {number} [NDVIParameter.prototype.nirIndex=1]
  54423. * @description 近红外光谱波段索引。
  54424. */
  54425. _this.nirIndex = 1;
  54426. /**
  54427. * @member {string} [NDVIParameter.prototype.colorMap="0:ffffe5ff;0.1:f7fcb9ff;0.2:d9f0a3ff;0.3:addd8eff;0.4:78c679ff;0.5:41ab5dff;0.6:238443ff;0.7:006837ff;1:004529ff"]
  54428. * @description 颜色表。由栅格的中断值和颜色停止之间的映射组成的,如0.3->d9f0a3ff 指的是[0,0.3)显示d9f0a3ff。仅单波段数据时设定。
  54429. */
  54430. _this.colorMap = '0:ffffe5ff;0.1:f7fcb9ff;0.2:d9f0a3ff;0.3:addd8eff;0.4:78c679ff;0.5:41ab5dff;0.6:238443ff;0.7:006837ff;1:004529ff';
  54431. /**
  54432. * @member {RasterFunctionType} [NDVIParameter.prototype.type]
  54433. * @description 栅格分析方法。
  54434. */
  54435. _this.type = RasterFunctionType.NDVI;
  54436. Util_Util.extend(NDVIParameter_assertThisInitialized(_this), options);
  54437. _this.CLASS_NAME = 'SuperMap.NDVIParameter';
  54438. return _this;
  54439. }
  54440. /**
  54441. * @function NDVIParameter.prototype.destroy
  54442. * @override
  54443. */
  54444. NDVIParameter_createClass(NDVIParameter, [{
  54445. key: "destroy",
  54446. value: function destroy() {
  54447. NDVIParameter_get(NDVIParameter_getPrototypeOf(NDVIParameter.prototype), "destroy", this).call(this);
  54448. this.redIndex = null;
  54449. this.nirIndex = null;
  54450. this.colorMap = null;
  54451. }
  54452. /**
  54453. * @function NDVIParameter.prototype.toJSON
  54454. * @description 将 NDVIParameter 对象转化为 JSON 字符串。
  54455. * @returns {string} 返回转换后的 JSON 字符串。
  54456. */
  54457. }, {
  54458. key: "toJSON",
  54459. value: function toJSON() {
  54460. return {
  54461. redIndex: this.redIndex,
  54462. nirIndex: this.nirIndex,
  54463. colorMap: this.colorMap,
  54464. type: this.type
  54465. };
  54466. }
  54467. }]);
  54468. return NDVIParameter;
  54469. }(RasterFunctionParameter);
  54470. ;// CONCATENATED MODULE: ./src/common/iServer/HillshadeParameter.js
  54471. function HillshadeParameter_typeof(obj) { "@babel/helpers - typeof"; return HillshadeParameter_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, HillshadeParameter_typeof(obj); }
  54472. function HillshadeParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54473. function HillshadeParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  54474. function HillshadeParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) HillshadeParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) HillshadeParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  54475. function HillshadeParameter_get() { if (typeof Reflect !== "undefined" && Reflect.get) { HillshadeParameter_get = Reflect.get.bind(); } else { HillshadeParameter_get = function _get(target, property, receiver) { var base = HillshadeParameter_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return HillshadeParameter_get.apply(this, arguments); }
  54476. function HillshadeParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = HillshadeParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  54477. function HillshadeParameter_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) HillshadeParameter_setPrototypeOf(subClass, superClass); }
  54478. function HillshadeParameter_setPrototypeOf(o, p) { HillshadeParameter_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return HillshadeParameter_setPrototypeOf(o, p); }
  54479. function HillshadeParameter_createSuper(Derived) { var hasNativeReflectConstruct = HillshadeParameter_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = HillshadeParameter_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = HillshadeParameter_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return HillshadeParameter_possibleConstructorReturn(this, result); }; }
  54480. function HillshadeParameter_possibleConstructorReturn(self, call) { if (call && (HillshadeParameter_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return HillshadeParameter_assertThisInitialized(self); }
  54481. function HillshadeParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  54482. function HillshadeParameter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  54483. function HillshadeParameter_getPrototypeOf(o) { HillshadeParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return HillshadeParameter_getPrototypeOf(o); }
  54484. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  54485. * This program are made available under the terms of the Apache License, Version 2.0
  54486. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54487. /**
  54488. * @class HillshadeParameter
  54489. * @deprecatedclass SuperMap.HillshadeParameter
  54490. * @category iServer Map Tile
  54491. * @classdesc 阴影面分析参数类。
  54492. * @param {Object} options - 可选参数。
  54493. * @param {number} [options.altitude=45] - 高于地平线的光源高度角。高度角由正度数表示,0 度代表地平线,而 90 度代表头顶正上方。
  54494. * @param {number} [options.azimuth=315] - 光源的方位角。方位角由0到360度之间的正度数表示,以北为基准方向按顺时针进行测量。
  54495. * @param {number} [options.zFactor=1] - 一个表面 z 单位中地面 x,y 单位的数量。z 单位与输入表面的 x,y 单位不同时,可使用 z 因子调整 z 单位的测量单位。计算最终输出表面时,将用 z 因子乘以输入表面的 z 值。
  54496. * z 单位与输入表面的 x,y 单位不同时,可使用 z 因子调整 z 单位的测量单位。计算最终输出表面时,将用 z 因子乘以输入表面的 z 值。
  54497. * 如果 x,y 单位和 z 单位采用相同的测量单位,则 z 因子为 1。这是默认设置。
  54498. * 如果 x,y 单位和 z 单位采用不同的测量单位,则必须将 z 因子设置为适当的因子,否则会得到错误的结果。例如,如果 z 单位是英尺而 x,y 单位是米,则应使用 z 因子 0.3048 将 z 单位从英尺转换为米(1 英尺 = 0.3048 米)。
  54499. * 如果输入栅格位于球面坐标系中(如十进制度球面坐标系),则生成的山体阴影可能看起来很独特。这是因为水平地面单位与高程 z 单位之间的测量值存在差异。由于经度的长度随着纬度而变化,因此需要为该纬度指定一个适当的 z 因子。如果 x,y 单位是十进制度而 Z 单位是米,特定纬度的一些合适的 Z 因子为:
  54500. * Latitude Z-factor
  54501. * 0 0.00000898
  54502. * 10 0.00000912
  54503. * 20 0.00000956
  54504. * 30 0.00001036
  54505. * 40 0.00001171
  54506. * 50 0.00001395
  54507. * 60 0.00001792
  54508. * 70 0.00002619
  54509. * 80 0.00005156
  54510. * @extends {RasterFunctionParameter}
  54511. * @usage
  54512. */
  54513. var HillshadeParameter = /*#__PURE__*/function (_RasterFunctionParame) {
  54514. HillshadeParameter_inherits(HillshadeParameter, _RasterFunctionParame);
  54515. var _super = HillshadeParameter_createSuper(HillshadeParameter);
  54516. function HillshadeParameter(options) {
  54517. var _this;
  54518. HillshadeParameter_classCallCheck(this, HillshadeParameter);
  54519. _this = _super.call(this, options);
  54520. /**
  54521. * @member {number} [HillshadeParameter.prototype.altitude = 45]
  54522. * @description 高于地平线的光源高度角。高度角由正度数表示,0 度代表地平线,而 90 度代表头顶正上方。
  54523. */
  54524. _this.altitude = 45;
  54525. /**
  54526. * @member {number} [HillshadeParameter.prototype.azimuth = 315]
  54527. * @description 光源的方位角。方位角由0到360度之间的正度数表示,以北为基准方向按顺时针进行测量。
  54528. */
  54529. _this.azimuth = 315;
  54530. /**
  54531. * @member {number} [HillshadeParameter.prototype.zFactor = 1]
  54532. * @description 一个表面 z 单位中地面 x,y 单位的数量。z 单位与输入表面的 x,y 单位不同时,可使用 z 因子调整 z 单位的测量单位。计算最终输出表面时,将用 z 因子乘以输入表面的 z 值。
  54533. */
  54534. _this.zFactor = 1;
  54535. /**
  54536. * @member {RasterFunctionType} HillshadeParameter.prototype.type
  54537. * @description 栅格分析方法。
  54538. */
  54539. _this.type = RasterFunctionType.HILLSHADE;
  54540. Util_Util.extend(HillshadeParameter_assertThisInitialized(_this), options);
  54541. _this.CLASS_NAME = 'SuperMap.HillshadeParameter';
  54542. return _this;
  54543. }
  54544. /**
  54545. * @function HillshadeParameter.prototype.destroy
  54546. * @override
  54547. */
  54548. HillshadeParameter_createClass(HillshadeParameter, [{
  54549. key: "destroy",
  54550. value: function destroy() {
  54551. HillshadeParameter_get(HillshadeParameter_getPrototypeOf(HillshadeParameter.prototype), "destroy", this).call(this);
  54552. this.altitude = null;
  54553. this.azimuth = null;
  54554. this.zFactor = null;
  54555. }
  54556. /**
  54557. * @function HillshadeParameter.prototype.toJSON
  54558. * @description 将 HillshadeParameter 对象转化为 JSON 字符串。
  54559. * @returns {string} 返回转换后的 JSON 字符串。
  54560. */
  54561. }, {
  54562. key: "toJSON",
  54563. value: function toJSON() {
  54564. return {
  54565. altitude: this.altitude,
  54566. azimuth: this.azimuth,
  54567. zFactor: this.zFactor,
  54568. type: this.type
  54569. };
  54570. }
  54571. }]);
  54572. return HillshadeParameter;
  54573. }(RasterFunctionParameter);
  54574. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobCustomItems.js
  54575. function WebPrintingJobCustomItems_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54576. function WebPrintingJobCustomItems_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  54577. function WebPrintingJobCustomItems_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobCustomItems_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobCustomItems_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  54578. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  54579. * This program are made available under the terms of the Apache License, Version 2.0
  54580. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54581. /**
  54582. * @class WebPrintingJobCustomItems
  54583. * @deprecatedclass SuperMap.WebPrintingJobCustomItems
  54584. * @classdesc Web 打印图例元素参数类。
  54585. * @version 10.1.0
  54586. * @category iServer WebPrintingJob
  54587. * @param {Object} option - 参数。
  54588. * @param {string} option.name - 图例元素的名称。
  54589. * @param {string} option.picAsUrl - 图例元素 Base64 格式图片。
  54590. * @param {string} [option.picAsBase64] - 图例元素图片的获取地址。如果已填了 URL 参数,此参数可不传。
  54591. * @usage
  54592. */
  54593. var WebPrintingJobCustomItems = /*#__PURE__*/function () {
  54594. function WebPrintingJobCustomItems(option) {
  54595. WebPrintingJobCustomItems_classCallCheck(this, WebPrintingJobCustomItems);
  54596. /**
  54597. * @member {string} WebPrintingJobCustomItems.prototype.name
  54598. * @description 图例元素的名称。
  54599. */
  54600. this.name = null;
  54601. /**
  54602. * @member {string} [WebPrintingJobCustomItems.prototype.picAsUrl]
  54603. * @description 图例元素 Base64 格式图片。
  54604. */
  54605. this.picAsUrl = null;
  54606. /**
  54607. * @member {string} [WebPrintingJobCustomItems.prototype.picAsBase64]
  54608. * @description 图例元素图片的获取地址。
  54609. */
  54610. this.picAsBase64 = null;
  54611. this.CLASS_NAME = 'SuperMap.WebPrintingJobCustomItems';
  54612. Util_Util.extend(this, option);
  54613. }
  54614. /**
  54615. * @function WebPrintingJobCustomItems.prototype.destroy
  54616. * @description 释放资源,将引用资源的属性置空。
  54617. */
  54618. WebPrintingJobCustomItems_createClass(WebPrintingJobCustomItems, [{
  54619. key: "destroy",
  54620. value: function destroy() {
  54621. var me = this;
  54622. me.name = null;
  54623. me.picAsUrl = null;
  54624. me.picAsBase64 = null;
  54625. }
  54626. /**
  54627. * @function WebPrintingJobCustomItems.prototype.toJSON
  54628. * @description 将 WebPrintingJobCustomItems 对象转化为 JSON 字符串。
  54629. * @returns {string} 转换后的 JSON 字符串。
  54630. */
  54631. }, {
  54632. key: "toJSON",
  54633. value: function toJSON() {
  54634. var params = {
  54635. name: this.name
  54636. };
  54637. if (this.title) {
  54638. params.title = this.title;
  54639. }
  54640. if (this.picAsUrl) {
  54641. params.picAsUrl = this.picAsUrl;
  54642. } else if (this.picAsBase64) {
  54643. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  54644. }
  54645. return Util_Util.toJSON(params);
  54646. }
  54647. }]);
  54648. return WebPrintingJobCustomItems;
  54649. }();
  54650. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobImage.js
  54651. function WebPrintingJobImage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54652. function WebPrintingJobImage_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  54653. function WebPrintingJobImage_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobImage_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobImage_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  54654. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  54655. * This program are made available under the terms of the Apache License, Version 2.0
  54656. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54657. /**
  54658. * @class WebPrintingJobImage
  54659. * @deprecatedclass SuperMap.WebPrintingJobImage
  54660. * @classdesc 表达小地图的静态图片参数类。
  54661. * @version 10.1.0
  54662. * @category iServer WebPrintingJob
  54663. * @param {Object} option - 参数。
  54664. * @param {string} option.picAsUrl - 小地图的图片 URL 地址。
  54665. * @param {string} [option.picAsBase64] - 小地图的base64位图片信息。如果已填了 URL 参数,此参数可不传。
  54666. * @usage
  54667. */
  54668. var WebPrintingJobImage = /*#__PURE__*/function () {
  54669. function WebPrintingJobImage(option) {
  54670. WebPrintingJobImage_classCallCheck(this, WebPrintingJobImage);
  54671. /**
  54672. * @member {string} [WebPrintingJobImage.prototype.picAsUrl]
  54673. * @description 小地图的图片 URL 地址。
  54674. */
  54675. this.picAsUrl = null;
  54676. /**
  54677. * @member {string} [WebPrintingJobImage.prototype.picAsBase64]
  54678. * @description 小地图的base64位图片信息。
  54679. */
  54680. this.picAsBase64 = null;
  54681. this.CLASS_NAME = 'SuperMap.WebPrintingJobImage';
  54682. Util_Util.extend(this, option);
  54683. }
  54684. /**
  54685. * @function WebPrintingJobImage.prototype.destroy
  54686. * @description 释放资源,将引用资源的属性置空。
  54687. */
  54688. WebPrintingJobImage_createClass(WebPrintingJobImage, [{
  54689. key: "destroy",
  54690. value: function destroy() {
  54691. this.picAsUrl = null;
  54692. this.picAsBase64 = null;
  54693. }
  54694. /**
  54695. * @function WebPrintingJobImage.prototype.toJSON
  54696. * @description 将 WebPrintingJobImage 对象转化为 JSON 字符串。
  54697. * @returns {string} 转换后的 JSON 字符串。
  54698. */
  54699. }, {
  54700. key: "toJSON",
  54701. value: function toJSON() {
  54702. var params = {};
  54703. if (this.picAsUrl) {
  54704. params.picAsUrl = this.picAsUrl;
  54705. }
  54706. if (this.picAsBase64) {
  54707. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  54708. }
  54709. return Util_Util.toJSON(params);
  54710. }
  54711. }]);
  54712. return WebPrintingJobImage;
  54713. }();
  54714. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLayers.js
  54715. function WebPrintingJobLayers_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54716. function WebPrintingJobLayers_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  54717. function WebPrintingJobLayers_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLayers_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLayers_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  54718. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  54719. * This program are made available under the terms of the Apache License, Version 2.0
  54720. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54721. /**
  54722. * @class WebPrintingJobLayers
  54723. * @deprecatedclass SuperMap.WebPrintingJobLayers
  54724. * @classdesc 将图例添加到布局的业务图层参数类。
  54725. * @version 10.1.0
  54726. * @category iServer WebPrintingJob
  54727. * @param {Object} option - 参数。
  54728. * @param {string} option.name - 图层 name 的字符串。此 name 必须唯一,并且必须与定义业务图层的 LegendOptions_layers 元素中的图层 name 匹配。
  54729. * @usage
  54730. */
  54731. var WebPrintingJobLayers = /*#__PURE__*/function () {
  54732. function WebPrintingJobLayers(option) {
  54733. WebPrintingJobLayers_classCallCheck(this, WebPrintingJobLayers);
  54734. /**
  54735. * @member {string} WebPrintingJobLayers.prototype.name
  54736. * @description 图层 name。
  54737. */
  54738. this.name = null;
  54739. /**
  54740. * @member {string} WebPrintingJobLayers.prototype.layerType
  54741. * @description 图层 type。
  54742. */
  54743. this.layerType = null;
  54744. /**
  54745. * @member {string} WebPrintingJobLayers.prototype.url
  54746. * @description 图层 URL。
  54747. */
  54748. this.url = null;
  54749. this.CLASS_NAME = 'SuperMap.WebPrintingJobLayers';
  54750. Util_Util.extend(this, option);
  54751. }
  54752. /**
  54753. * @function WebPrintingJobLayers.prototype.destroy
  54754. * @description 释放资源,将引用资源的属性置空。
  54755. */
  54756. WebPrintingJobLayers_createClass(WebPrintingJobLayers, [{
  54757. key: "destroy",
  54758. value: function destroy() {
  54759. this.name = null;
  54760. this.layerType = null;
  54761. this.url = null;
  54762. }
  54763. }]);
  54764. return WebPrintingJobLayers;
  54765. }();
  54766. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLegendOptions.js
  54767. function WebPrintingJobLegendOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54768. function WebPrintingJobLegendOptions_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  54769. function WebPrintingJobLegendOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLegendOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLegendOptions_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  54770. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  54771. * This program are made available under the terms of the Apache License, Version 2.0
  54772. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54773. /**
  54774. * @class WebPrintingJobLegendOptions
  54775. * @deprecatedclass SuperMap.WebPrintingJobLegendOptions
  54776. * @classdesc Web 打印图例参数类。
  54777. * @version 10.1.0
  54778. * @category iServer WebPrintingJob
  54779. * @param {Object} option - 参数。
  54780. * @param {string} [option.title] - 图例名称。
  54781. * @param {string} [option.picAsUrl] - 图例的图片 URL 地址。
  54782. * @param {string} [option.picAsBase64] - 图例的 base64 位图片信息。
  54783. * @param {WebPrintingJobLayers} [option.layers] - 图例的布局业务图层参数类。
  54784. * @param {WebPrintingJobCustomItems} [option.customItems] - 自定义图例元素参数类。
  54785. * @usage
  54786. */
  54787. var WebPrintingJobLegendOptions = /*#__PURE__*/function () {
  54788. function WebPrintingJobLegendOptions(option) {
  54789. WebPrintingJobLegendOptions_classCallCheck(this, WebPrintingJobLegendOptions);
  54790. /**
  54791. * @member {string} WebPrintingJobLegendOptions.prototype.title
  54792. * @description 图例名称。
  54793. */
  54794. this.title = null;
  54795. /**
  54796. * @member {string} [WebPrintingJobLegendOptions.prototype.picAsUrl]
  54797. * @description 图例的图片 URL 地址。
  54798. */
  54799. this.picAsUrl = null;
  54800. /**
  54801. * @member {string} [WebPrintingJobLegendOptions.prototype.picAsBase64]
  54802. * @description 图例的 base64 位图片信息。
  54803. */
  54804. this.picAsBase64 = null;
  54805. /**
  54806. * @member {WebPrintingJobLayers} [WebPrintingJobLegendOptions.prototype.layers]
  54807. * @description 图例的布局业务图层参数类。
  54808. */
  54809. this.layers = null;
  54810. /**
  54811. * @member {WebPrintingJobCustomItems} [WebPrintingJobLegendOptions.prototype.customItems]
  54812. * @description 自定义图例元素参数类。
  54813. */
  54814. this.customItems = null;
  54815. this.CLASS_NAME = 'SuperMap.WebPrintingJobLegendOptions';
  54816. Util_Util.extend(this, option);
  54817. }
  54818. /**
  54819. * @function WebPrintingJobLegendOptions.prototype.destroy
  54820. * @description 释放资源,将引用资源的属性置空。
  54821. */
  54822. WebPrintingJobLegendOptions_createClass(WebPrintingJobLegendOptions, [{
  54823. key: "destroy",
  54824. value: function destroy() {
  54825. this.title = null;
  54826. this.picAsUrl = null;
  54827. this.picAsBase64 = null;
  54828. if (this.layers instanceof WebPrintingJobLayers) {
  54829. this.layers.destroy();
  54830. this.layers = null;
  54831. }
  54832. if (this.customItems instanceof WebPrintingJobCustomItems) {
  54833. this.customItems.destroy();
  54834. this.customItems = null;
  54835. }
  54836. }
  54837. /**
  54838. * @function WebPrintingJobLegendOptions.prototype.toJSON
  54839. * @description 将 WebPrintingJobLegendOptions 对象转化为 JSON 字符串。
  54840. * @returns {string} 转换后的 JSON 字符串。
  54841. */
  54842. }, {
  54843. key: "toJSON",
  54844. value: function toJSON() {
  54845. var params = {
  54846. title: this.title || ""
  54847. };
  54848. if (this.picAsUrl) {
  54849. params.picAsUrl = this.picAsUrl;
  54850. } else if (this.picAsBase64) {
  54851. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  54852. } else if (this.customItems) {
  54853. params.customItems = this.customItems;
  54854. }
  54855. return Util_Util.toJSON(params);
  54856. }
  54857. }]);
  54858. return WebPrintingJobLegendOptions;
  54859. }();
  54860. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLittleMapOptions.js
  54861. function WebPrintingJobLittleMapOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54862. function WebPrintingJobLittleMapOptions_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  54863. function WebPrintingJobLittleMapOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLittleMapOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLittleMapOptions_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  54864. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  54865. * This program are made available under the terms of the Apache License, Version 2.0
  54866. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54867. /**
  54868. * @class WebPrintingJobLittleMapOptions
  54869. * @deprecatedclass SuperMap.WebPrintingJobLittleMapOptions
  54870. * @classdesc Web 打印小地图参数类。
  54871. * @version 10.1.0
  54872. * @category iServer WebPrintingJob
  54873. * @param {Object} option - 参数。
  54874. * @param {GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} option.center - 小地图的中心点。
  54875. * @param {number} [option.scale] - 小地图的比例尺。
  54876. * @param {Array.<string>} [option.layerNames] - 指定 WebMap中图层名称的列表,用于渲染小地图。
  54877. * @param {WebPrintingJobImage} [option.image] - 表达小地图的静态图类。
  54878. * @param {WebPrintingJobLayers} [option.layers] - 指定 WebMap 中的 layers 图层类。
  54879. * @usage
  54880. */
  54881. var WebPrintingJobLittleMapOptions = /*#__PURE__*/function () {
  54882. function WebPrintingJobLittleMapOptions(option) {
  54883. WebPrintingJobLittleMapOptions_classCallCheck(this, WebPrintingJobLittleMapOptions);
  54884. /**
  54885. * @member {GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} WebPrintingJobLittleMapOptions.prototype.center
  54886. * @description 小地图的中心点。
  54887. */
  54888. this.center = null;
  54889. /**
  54890. * @member {number} [WebPrintingJobLittleMapOptions.prototype.scale]
  54891. * @description 小地图的比例尺。
  54892. */
  54893. this.scale = null;
  54894. /**
  54895. * @member {Array.<string>} WebPrintingJobLittleMapOptions.prototype.layerNames
  54896. * @description 指定 WebMap中图层名称的列表,用于渲染小地图。
  54897. */
  54898. this.layerNames = null;
  54899. /**
  54900. * @member {WebPrintingJobImage} [WebPrintingJobLittleMapOptions.prototype.image]
  54901. * @description 表达小地图的静态图类。暂不支持。
  54902. */
  54903. this.image = null;
  54904. /**
  54905. * @member {WebPrintingJobLayers} [WebPrintingJobLittleMapOptions.prototype.layers]
  54906. * @description 指定 WebMap 中的 layers 图层类。
  54907. */
  54908. this.layers = null;
  54909. this.CLASS_NAME = 'SuperMap.WebPrintingJobLittleMapOptions';
  54910. Util_Util.extend(this, option);
  54911. }
  54912. /**
  54913. * @function WebPrintingJobLittleMapOptions.prototype.destroy
  54914. * @description 释放资源,将引用资源的属性置空。
  54915. */
  54916. WebPrintingJobLittleMapOptions_createClass(WebPrintingJobLittleMapOptions, [{
  54917. key: "destroy",
  54918. value: function destroy() {
  54919. this.center = null;
  54920. this.scale = null;
  54921. this.layerNames = null;
  54922. if (this.image instanceof WebPrintingJobImage) {
  54923. this.image.destroy();
  54924. this.image = null;
  54925. }
  54926. if (this.layers instanceof WebPrintingJobLayers) {
  54927. this.layers.destroy();
  54928. this.layers = null;
  54929. }
  54930. }
  54931. /**
  54932. * @function WebPrintingJobLittleMapOptions.prototype.toJSON
  54933. * @description 将 WebPrintingJobLittleMapOptions 对象转化为 JSON 字符串。
  54934. * @returns {string} 转换后的 JSON 字符串。
  54935. */
  54936. }, {
  54937. key: "toJSON",
  54938. value: function toJSON() {
  54939. var params = {
  54940. scale: this.scale,
  54941. center: this.center
  54942. };
  54943. if (this.layerNames) {
  54944. params.layerNames = this.layerNames;
  54945. } else if (this.layers) {
  54946. params.layers = this.layers;
  54947. }
  54948. if (this.image) {
  54949. params.image = this.image;
  54950. }
  54951. return Util_Util.toJSON(params);
  54952. }
  54953. }]);
  54954. return WebPrintingJobLittleMapOptions;
  54955. }();
  54956. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobNorthArrowOptions.js
  54957. function WebPrintingJobNorthArrowOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54958. function WebPrintingJobNorthArrowOptions_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  54959. function WebPrintingJobNorthArrowOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobNorthArrowOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobNorthArrowOptions_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  54960. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  54961. * This program are made available under the terms of the Apache License, Version 2.0
  54962. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54963. /**
  54964. * @class WebPrintingJobNorthArrowOptions
  54965. * @deprecatedclass SuperMap.WebPrintingJobNorthArrowOptions
  54966. * @classdesc Web 打印地图指北针参数类。
  54967. * @version 10.1.0
  54968. * @category iServer WebPrintingJob
  54969. * @param {Object} option - 参数。
  54970. * @param {string} option.picAsUrl - 指北针的图片 URL 地址。
  54971. * @param {string} [option.picAsBase64] - 指北针的base64位图片信息。
  54972. * @usage
  54973. */
  54974. var WebPrintingJobNorthArrowOptions = /*#__PURE__*/function () {
  54975. function WebPrintingJobNorthArrowOptions(option) {
  54976. WebPrintingJobNorthArrowOptions_classCallCheck(this, WebPrintingJobNorthArrowOptions);
  54977. /**
  54978. * @member {string} WebPrintingJobNorthArrowOptions.prototype.picAsUrl
  54979. * @description 指北针的图片 URL 地址。
  54980. */
  54981. this.picAsUrl = null;
  54982. /**
  54983. * @member {string} [WebPrintingJobNorthArrowOptions.prototype.picAsBase64]
  54984. * @description 指北针的base64位图片信息。
  54985. */
  54986. this.picAsBase64 = null;
  54987. this.CLASS_NAME = 'SuperMap.WebPrintingJobNorthArrowOptions';
  54988. Util_Util.extend(this, option);
  54989. }
  54990. /**
  54991. * @function WebPrintingJobNorthArrowOptions.prototype.destroy
  54992. * @description 释放资源,将引用资源的属性置空。
  54993. */
  54994. WebPrintingJobNorthArrowOptions_createClass(WebPrintingJobNorthArrowOptions, [{
  54995. key: "destroy",
  54996. value: function destroy() {
  54997. this.picAsUrl = null;
  54998. this.picAsBase64 = null;
  54999. }
  55000. /**
  55001. * @function WebPrintingJobNorthArrowOptions.prototype.toJSON
  55002. * @description 将 WebPrintingJobNorthArrowOptions 对象转化为 JSON 字符串。
  55003. * @returns {string} 转换后的 JSON 字符串。
  55004. */
  55005. }, {
  55006. key: "toJSON",
  55007. value: function toJSON() {
  55008. var params = {};
  55009. if (this.picAsUrl) {
  55010. params.picAsUrl = this.picAsUrl;
  55011. } else if (this.picAsBase64) {
  55012. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  55013. }
  55014. return Util_Util.toJSON(params);
  55015. }
  55016. }]);
  55017. return WebPrintingJobNorthArrowOptions;
  55018. }();
  55019. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobScaleBarOptions.js
  55020. function WebPrintingJobScaleBarOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55021. function WebPrintingJobScaleBarOptions_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  55022. function WebPrintingJobScaleBarOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobScaleBarOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobScaleBarOptions_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  55023. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  55024. * This program are made available under the terms of the Apache License, Version 2.0
  55025. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55026. /**
  55027. * @class WebPrintingJobScaleBarOptions
  55028. * @deprecatedclass SuperMap.WebPrintingJobScaleBarOptions
  55029. * @classdesc Web 打印比例尺参数类。
  55030. * @category iServer WebPrintingJob
  55031. * @version 10.1.0
  55032. * @param {Object} option - 参数。
  55033. * @param {string} [option.scaleText] - 比例尺文本信息。例如:1:1000000。
  55034. * @param {WebScaleOrientationType} [option.orientation] - 比例尺的方位样式。
  55035. * @param {WebScaleType} [option.type] - 比例尺的样式。
  55036. * @param {number} [option.intervals] - 比例尺条的段数。
  55037. * @param {WebScaleUnit} [option.unit] - 比例尺的单位制。
  55038. * @usage
  55039. */
  55040. var WebPrintingJobScaleBarOptions = /*#__PURE__*/function () {
  55041. function WebPrintingJobScaleBarOptions(option) {
  55042. WebPrintingJobScaleBarOptions_classCallCheck(this, WebPrintingJobScaleBarOptions);
  55043. /**
  55044. * @member {string} WebPrintingJobScaleBarOptions.prototype.scaleText
  55045. * @description 比例尺文本信息。
  55046. */
  55047. this.scaleText = null;
  55048. /**
  55049. * @member {WebScaleOrientationType} [WebPrintingJobScaleBarOptions.prototype.orientation]
  55050. * @description 比例尺的方位样式。
  55051. */
  55052. this.orientation = null;
  55053. /**
  55054. * @member {WebScaleType} [WebPrintingJobScaleBarOptions.prototype.type]
  55055. * @description 比例尺的样式。
  55056. */
  55057. this.type = null;
  55058. /**
  55059. * @member {Object} [WebPrintingJobScaleBarOptions.prototype.intervals]
  55060. * @description 比例尺条的段数。
  55061. */
  55062. this.intervals = null;
  55063. /**
  55064. * @member {WebScaleUnit} [WebPrintingJobScaleBarOptions.prototype.unit]
  55065. * @description 比例尺的单位制。
  55066. */
  55067. this.unit = null;
  55068. this.CLASS_NAME = 'SuperMap.WebPrintingJobScaleBarOptions';
  55069. Util_Util.extend(this, option);
  55070. }
  55071. /**
  55072. * @function WebPrintingJobScaleBarOptions.prototype.destroy
  55073. * @description 释放资源,将引用资源的属性置空。
  55074. */
  55075. WebPrintingJobScaleBarOptions_createClass(WebPrintingJobScaleBarOptions, [{
  55076. key: "destroy",
  55077. value: function destroy() {
  55078. this.scaleText = null;
  55079. this.orientation = null;
  55080. this.type = null;
  55081. this.intervals = null;
  55082. this.unit = null;
  55083. }
  55084. /**
  55085. * @function WebPrintingJobScaleBarOptions.prototype.toJSON
  55086. * @description 将 WebPrintingJobScaleBarOptions 对象转化为 JSON 字符串。
  55087. * @returns {string} 转换后的 JSON 字符串。
  55088. */
  55089. }, {
  55090. key: "toJSON",
  55091. value: function toJSON() {
  55092. var params = {
  55093. scaleText: this.scaleText || "",
  55094. type: this.type || "BAR",
  55095. intervals: this.intervals || "",
  55096. unit: this.unit || "METER"
  55097. };
  55098. if (this.orientation) {
  55099. params.orientation = this.orientation;
  55100. }
  55101. return Util_Util.toJSON(params);
  55102. }
  55103. }]);
  55104. return WebPrintingJobScaleBarOptions;
  55105. }();
  55106. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobContent.js
  55107. function WebPrintingJobContent_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55108. function WebPrintingJobContent_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  55109. function WebPrintingJobContent_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobContent_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobContent_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  55110. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  55111. * This program are made available under the terms of the Apache License, Version 2.0
  55112. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55113. /**
  55114. * @class WebPrintingJobContent
  55115. * @deprecatedclass SuperMap.WebPrintingJobContent
  55116. * @classdesc Web 打印内容参数类。
  55117. * @version 10.1.0
  55118. * @category iServer WebPrintingJob
  55119. * @param {Object} option - 参数。
  55120. * @param {string} option.type - Web 打印内容支持的类型。目前支持的类型:WEBMAP。
  55121. * @param {string} [option.url] - 待打印的 SuperMap iPortal WebMap 的 URL 地址。例如:http://supermapiportal:8190/iportal/web/maps/{mapid}/map.rjson 。
  55122. * @param {string} [option.token] - 如果待打印的是 SuperMap iPortal 用户私有的 WebMap,需要提供 SuperMap iPortal 用户的 token。
  55123. * @param {WebMapSummaryObject} [option.value] - 传递的是一个符合 SuperMap WebMap 规范的 WebMap 的 JSON 表达,也可以是一个完整的 SuperMap iPortal 数据上图制作的 WebMap 的 JSON 表达。如果已填了 URL 参数,此参数可不传。
  55124. * @usage
  55125. */
  55126. var WebPrintingJobContent = /*#__PURE__*/function () {
  55127. function WebPrintingJobContent(option) {
  55128. WebPrintingJobContent_classCallCheck(this, WebPrintingJobContent);
  55129. /**
  55130. * @member {string} WebPrintingJobContent.prototype.type
  55131. * @description Web 打印内容支持的类型。
  55132. */
  55133. this.type = null;
  55134. /**
  55135. * @member {string} [WebPrintingJobContent.prototype.url]
  55136. * @description 待打印的 SuperMap iPortal WebMap 的 URL 地址。
  55137. */
  55138. this.url = null;
  55139. /**
  55140. * @member {string} [WebPrintingJobContent.prototype.token]
  55141. * @description 如果待打印的是 SuperMap iPortal 用户私有的 WebMap,需要提供 SuperMap iPortal 用户的 token。
  55142. */
  55143. this.token = null;
  55144. /**
  55145. * @member {WebMapSummaryObject} [WebPrintingJobContent.prototype.value]
  55146. * @description 传递的是一个符合 SuperMap WebMap 规范的 WebMap 的 JSON 表达,也可以是一个完整的 SuperMap iPortal 数据上图制作的 WebMap 的 JSON 表达。
  55147. */
  55148. this.value = null;
  55149. this.CLASS_NAME = 'SuperMap.WebPrintingJobContent';
  55150. Util_Util.extend(this, option);
  55151. }
  55152. /**
  55153. * @function WebPrintingJobContent.prototype.destroy
  55154. * @description 释放资源,将引用资源的属性置空。
  55155. */
  55156. WebPrintingJobContent_createClass(WebPrintingJobContent, [{
  55157. key: "destroy",
  55158. value: function destroy() {
  55159. this.type = false || "WEBMAP";
  55160. this.url = null;
  55161. this.token = null;
  55162. this.value = null;
  55163. }
  55164. /**
  55165. * @function WebPrintingJobContent.prototype.toJSON
  55166. * @description 将 WebPrintingJobContent 对象转化为 JSON 字符串。
  55167. * @returns {string} 转换后的 JSON 字符串。
  55168. */
  55169. }, {
  55170. key: "toJSON",
  55171. value: function toJSON() {
  55172. var params = {
  55173. type: this.type
  55174. };
  55175. if (this.token) {
  55176. params.token = this.token;
  55177. }
  55178. if (this.url) {
  55179. params.url = this.url;
  55180. } else if (this.value) {
  55181. params.value = this.value;
  55182. }
  55183. return Util_Util.toJSON(params);
  55184. }
  55185. }]);
  55186. return WebPrintingJobContent;
  55187. }();
  55188. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLayoutOptions.js
  55189. function WebPrintingJobLayoutOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55190. function WebPrintingJobLayoutOptions_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  55191. function WebPrintingJobLayoutOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLayoutOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLayoutOptions_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  55192. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  55193. * This program are made available under the terms of the Apache License, Version 2.0
  55194. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55195. /**
  55196. * @class WebPrintingJobLayoutOptions
  55197. * @deprecatedclass SuperMap.WebPrintingJobLayoutOptions
  55198. * @classdesc Web 打印的布局参数类。
  55199. * @version 10.1.0
  55200. * @category iServer WebPrintingJob
  55201. * @param {Object} option - 参数。
  55202. * @param {string} option.templateName - 布局模板的名称。
  55203. * @param {string} option.title - 地图主标题名称。
  55204. * @param {string} option.subTitle - 地图副标题名称。
  55205. * @param {string} option.author - 作者名称。
  55206. * @param {string} option.copyright - 版权信息。
  55207. * @param {WebPrintingJobLittleMapOptions} option.littleMapOptions - 小地图参数类。
  55208. * @param {WebPrintingJobLegendOptions} option.legendOptions - 图例参数类。
  55209. * @param {WebPrintingJobScaleBarOptions} [option.scaleBarOptions] - 地图比例尺参数类。
  55210. * @param {WebPrintingJobNorthArrowOptions} [option.northArrowOptions] - 地图指北针参数类。
  55211. * @usage
  55212. */
  55213. var WebPrintingJobLayoutOptions = /*#__PURE__*/function () {
  55214. function WebPrintingJobLayoutOptions(option) {
  55215. WebPrintingJobLayoutOptions_classCallCheck(this, WebPrintingJobLayoutOptions);
  55216. /**
  55217. * @member {string} WebPrintingJobLayoutOptions.prototype.templateName
  55218. * @description 布局模板的名称。
  55219. */
  55220. this.templateName = null;
  55221. /**
  55222. * @member {string} WebPrintingJobLayoutOptions.prototype.title
  55223. * @description 地图主标题名称。
  55224. */
  55225. this.title = null;
  55226. /**
  55227. * @member {string} WebPrintingJobLayoutOptions.prototype.subTitle
  55228. * @description 地图副标题名称。
  55229. */
  55230. this.subTitle = null;
  55231. /**
  55232. * @member {string} WebPrintingJobLayoutOptions.prototype.author
  55233. * @description 地图作者名称。
  55234. */
  55235. this.author = null;
  55236. /**
  55237. * @member {string} WebPrintingJobLayoutOptions.prototype.copyright
  55238. * @description 地图版权信息。
  55239. */
  55240. this.copyright = null;
  55241. /**
  55242. * @member {WebPrintingJobScaleBarOptions} [WebPrintingJobLayoutOptions.prototype.scaleBarOptions]
  55243. * @description 地图比例尺参数类。
  55244. */
  55245. this.scaleBarOptions = null;
  55246. /**
  55247. * @member {WebPrintingJobNorthArrowOptions} [WebPrintingJobLayoutOptions.prototype.northArrowOptions]
  55248. * @description 地图指北针参数类。
  55249. */
  55250. this.northArrowOptions = null;
  55251. /**
  55252. * @member {WebPrintingJobLittleMapOptions} WebPrintingJobLayoutOptions.prototype.littleMapOptions
  55253. * @description 小地图参数类。
  55254. */
  55255. this.littleMapOptions = null;
  55256. /**
  55257. * @member {WebPrintingJobLegendOptions} WebPrintingJobLayoutOptions.prototype.legendOptions
  55258. * @description 图例参数类。
  55259. */
  55260. this.legendOptions = null;
  55261. this.CLASS_NAME = 'SuperMap.WebPrintingJobLayoutOptions';
  55262. Util_Util.extend(this, option);
  55263. }
  55264. /**
  55265. * @function WebPrintingJobLayoutOptions.prototype.destroy
  55266. * @description 释放资源,将引用资源的属性置空。
  55267. */
  55268. WebPrintingJobLayoutOptions_createClass(WebPrintingJobLayoutOptions, [{
  55269. key: "destroy",
  55270. value: function destroy() {
  55271. this.templateName = null;
  55272. this.title = null;
  55273. this.subTitle = null;
  55274. this.author = null;
  55275. this.copyright = null;
  55276. if (this.scaleBarOptions instanceof WebPrintingJobScaleBarOptions) {
  55277. this.scaleBarOptions.destroy();
  55278. this.scaleBarOptions = null;
  55279. }
  55280. if (this.northArrowOptions instanceof WebPrintingJobNorthArrowOptions) {
  55281. this.northArrowOptions.destroy();
  55282. this.northArrowOptions = null;
  55283. }
  55284. if (this.littleMapOptions instanceof WebPrintingJobLittleMapOptions) {
  55285. this.littleMapOptions.destroy();
  55286. this.littleMapOptions = null;
  55287. }
  55288. if (this.legendOptions instanceof WebPrintingJobLegendOptions) {
  55289. this.legendOptions.destroy();
  55290. this.legendOptions = null;
  55291. }
  55292. }
  55293. /**
  55294. * @function WebPrintingJobLayoutOptions.prototype.toJSON
  55295. * @description 将 WebPrintingJobLayoutOptions 对象转化为 JSON 字符串。
  55296. * @returns {string} 转换后的 JSON 字符串。
  55297. */
  55298. }, {
  55299. key: "toJSON",
  55300. value: function toJSON() {
  55301. var params = {
  55302. templateName: this.templateName,
  55303. title: this.title,
  55304. subTitle: this.subTitle,
  55305. author: this.author,
  55306. copyright: this.copyright
  55307. };
  55308. if (this.scaleBarOptions) {
  55309. params.scaleBarOptions = this.scaleBarOptions;
  55310. }
  55311. if (this.northArrowOptions) {
  55312. params.northArrowOptions = this.northArrowOptions;
  55313. }
  55314. if (this.littleMapOptions) {
  55315. params.littleMapOptions = this.littleMapOptions;
  55316. }
  55317. if (this.legendOptions) {
  55318. params.legendOptions = this.legendOptions;
  55319. }
  55320. return Util_Util.toJSON(params);
  55321. }
  55322. }]);
  55323. return WebPrintingJobLayoutOptions;
  55324. }();
  55325. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobExportOptions.js
  55326. function WebPrintingJobExportOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55327. function WebPrintingJobExportOptions_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  55328. function WebPrintingJobExportOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobExportOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobExportOptions_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  55329. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  55330. * This program are made available under the terms of the Apache License, Version 2.0
  55331. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55332. /**
  55333. * @class WebPrintingJobExportOptions
  55334. * @deprecatedclass SuperMap.WebPrintingJobExportOptions
  55335. * @classdesc Web 打印的输出参数类。
  55336. * @version 10.1.0
  55337. * @category iServer WebPrintingJob
  55338. * @param {Object} option - 参数。
  55339. * @param {WebExportFormatType} option.format - Web 打印输出的格式,目前支持:PNG、PDF。
  55340. * @param {number} [option.dpi=96] - Web 打印输出的分辨率,单位为每英寸点数。默认值为 96 DPI。
  55341. * @param {number} [option.scale] - Web 打印输出的地图比例尺。
  55342. * @param {number} [option.rotation] - Web 打印输出的地图角度。
  55343. * @param {GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} [option.center] - Web 打印输出的地图中心点。
  55344. * @usage
  55345. */
  55346. var WebPrintingJobExportOptions = /*#__PURE__*/function () {
  55347. function WebPrintingJobExportOptions(option) {
  55348. WebPrintingJobExportOptions_classCallCheck(this, WebPrintingJobExportOptions);
  55349. /**
  55350. * @member {WebExportFormatType} WebPrintingJobExportOptions.prototype.format
  55351. * @description Web 打印输出的格式。
  55352. */
  55353. this.format = null;
  55354. /**
  55355. * @member {number} [WebPrintingJobExportOptions.prototype.dpi=96]
  55356. * @description Web 打印输出的分辨率,单位为每英寸点数。
  55357. */
  55358. this.dpi = 96;
  55359. /**
  55360. * @member {number} [WebPrintingJobExportOptions.prototype.scale]
  55361. * @description Web 打印输出的地图比例尺。
  55362. */
  55363. this.scale = null;
  55364. /**
  55365. * @member {number} [WebPrintingJobExportOptions.prototype.rotation]
  55366. * @description Web 打印输出的地图角度。
  55367. */
  55368. this.rotation = null;
  55369. /**
  55370. * @member {GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} [WebPrintingJobExportOptions.prototype.center]
  55371. * @description Web 打印输出的地图中心点。
  55372. */
  55373. this.center = null;
  55374. this.CLASS_NAME = 'SuperMap.WebPrintingJobExportOptions';
  55375. Util_Util.extend(this, option);
  55376. }
  55377. /**
  55378. * @function WebPrintingJobExportOptions.prototype.destroy
  55379. * @description 释放资源,将引用资源的属性置空。
  55380. */
  55381. WebPrintingJobExportOptions_createClass(WebPrintingJobExportOptions, [{
  55382. key: "destroy",
  55383. value: function destroy() {
  55384. this.format = null;
  55385. this.dpi = null;
  55386. this.scale = null;
  55387. this.rotation = null;
  55388. this.center = null;
  55389. this.outputSize = null;
  55390. }
  55391. /**
  55392. * @function WebPrintingJobExportOptions.prototype.toJSON
  55393. * @description 将 WebPrintingJobExportOptions 对象转化为 JSON 字符串。
  55394. * @returns {string} 转换后的 JSON 字符串。
  55395. */
  55396. }, {
  55397. key: "toJSON",
  55398. value: function toJSON() {
  55399. var params = {
  55400. format: this.format || "PDF",
  55401. dpi: this.dpi,
  55402. scale: this.scale,
  55403. center: this.center
  55404. };
  55405. if (this.rotation) {
  55406. params.rotation = this.rotation;
  55407. }
  55408. if (this.outputSize) {
  55409. params.outputSize = this.outputSize;
  55410. }
  55411. return Util_Util.toJSON(params);
  55412. }
  55413. }]);
  55414. return WebPrintingJobExportOptions;
  55415. }();
  55416. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobParameters.js
  55417. function WebPrintingJobParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55418. function WebPrintingJobParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  55419. function WebPrintingJobParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  55420. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  55421. * This program are made available under the terms of the Apache License, Version 2.0
  55422. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55423. /**
  55424. * @class WebPrintingJobParameters
  55425. * @deprecatedclass SuperMap.WebPrintingJobParameters
  55426. * @category iServer WebPrintingJob
  55427. * @version 10.1.0
  55428. * @classdesc Web 打印参数类。
  55429. * @param {Object} options - 参数。
  55430. * @param {WebPrintingJobContent} options.content - Web 打印的内容类。
  55431. * @param {WebPrintingJobLayoutOptions} options.layoutOptions - Web 打印的布局类,包含各种布局元素的设置。
  55432. * @param {WebPrintingJobExportOptions} options.exportOptions - Web 打印的输出类,包含 DPI、页面大小等。
  55433. * @usage
  55434. */
  55435. var WebPrintingJobParameters = /*#__PURE__*/function () {
  55436. function WebPrintingJobParameters(options) {
  55437. WebPrintingJobParameters_classCallCheck(this, WebPrintingJobParameters);
  55438. if (!options) {
  55439. return;
  55440. }
  55441. /**
  55442. * @member {WebPrintingJobContent} WebPrintingJobParameters.prototype.content
  55443. * @description Web 打印的内容类。
  55444. */
  55445. this.content = null;
  55446. /**
  55447. * @member {WebPrintingJobLayoutOptions} WebPrintingJobParameters.prototype.layoutOptions
  55448. * @description Web 打印的布局类,包含各种布局元素的设置。
  55449. */
  55450. this.layoutOptions = null;
  55451. /**
  55452. * @member {WebPrintingJobExportOptions} WebPrintingJobParameters.prototype.exportOptions
  55453. * @description Web 打印的输出类,包含 DPI、页面大小等。
  55454. */
  55455. this.exportOptions = null;
  55456. Util_Util.extend(this, options);
  55457. this.CLASS_NAME = 'SuperMap.WebPrintingJobParameters';
  55458. }
  55459. /**
  55460. * @function WebPrintingJobParameters.prototype.destroy
  55461. * @description 释放资源,将引用资源的属性置空。
  55462. */
  55463. WebPrintingJobParameters_createClass(WebPrintingJobParameters, [{
  55464. key: "destroy",
  55465. value: function destroy() {
  55466. if (this.content instanceof WebPrintingJobContent) {
  55467. this.content.destroy();
  55468. this.content = null;
  55469. }
  55470. if (this.layoutOptions instanceof WebPrintingJobLayoutOptions) {
  55471. this.layoutOptions.destroy();
  55472. this.layoutOptions = null;
  55473. }
  55474. if (this.exportOptions instanceof WebPrintingJobExportOptions) {
  55475. this.exportOptions.destroy();
  55476. this.exportOptions = null;
  55477. }
  55478. }
  55479. }]);
  55480. return WebPrintingJobParameters;
  55481. }();
  55482. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingService.js
  55483. function WebPrintingService_typeof(obj) { "@babel/helpers - typeof"; return WebPrintingService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, WebPrintingService_typeof(obj); }
  55484. function WebPrintingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55485. function WebPrintingService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  55486. function WebPrintingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  55487. function WebPrintingService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { WebPrintingService_get = Reflect.get.bind(); } else { WebPrintingService_get = function _get(target, property, receiver) { var base = WebPrintingService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return WebPrintingService_get.apply(this, arguments); }
  55488. function WebPrintingService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = WebPrintingService_getPrototypeOf(object); if (object === null) break; } return object; }
  55489. function WebPrintingService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) WebPrintingService_setPrototypeOf(subClass, superClass); }
  55490. function WebPrintingService_setPrototypeOf(o, p) { WebPrintingService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return WebPrintingService_setPrototypeOf(o, p); }
  55491. function WebPrintingService_createSuper(Derived) { var hasNativeReflectConstruct = WebPrintingService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = WebPrintingService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = WebPrintingService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return WebPrintingService_possibleConstructorReturn(this, result); }; }
  55492. function WebPrintingService_possibleConstructorReturn(self, call) { if (call && (WebPrintingService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return WebPrintingService_assertThisInitialized(self); }
  55493. function WebPrintingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  55494. function WebPrintingService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  55495. function WebPrintingService_getPrototypeOf(o) { WebPrintingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WebPrintingService_getPrototypeOf(o); }
  55496. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  55497. * This program are made available under the terms of the Apache License, Version 2.0
  55498. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55499. /**
  55500. * @class WebPrintingService
  55501. * @deprecatedclass SuperMap.WebPrintingService
  55502. * @category iServer WebPrintingJob
  55503. * @version 10.1.0
  55504. * @classdesc 打印地图服务基类。
  55505. * @extends {CommonServiceBase}
  55506. * @param {string} url - 服务地址。请求打印地图服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/webprinting/rest/webprinting/v1。
  55507. * @param {Object} options - 参数。
  55508. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  55509. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  55510. * @param {Object} [options.headers] - 请求头。
  55511. * @usage
  55512. */
  55513. var WebPrintingService = /*#__PURE__*/function (_CommonServiceBase) {
  55514. WebPrintingService_inherits(WebPrintingService, _CommonServiceBase);
  55515. var _super = WebPrintingService_createSuper(WebPrintingService);
  55516. function WebPrintingService(url, options) {
  55517. var _this;
  55518. WebPrintingService_classCallCheck(this, WebPrintingService);
  55519. _this = _super.call(this, url, options);
  55520. if (options) {
  55521. Util_Util.extend(WebPrintingService_assertThisInitialized(_this), options);
  55522. }
  55523. _this.eventCount = 0;
  55524. _this.CLASS_NAME = 'SuperMap.WebPrintingService';
  55525. if (!_this.url) {
  55526. return WebPrintingService_possibleConstructorReturn(_this);
  55527. }
  55528. return _this;
  55529. }
  55530. /**
  55531. * @function WebPrintingService.prototype.destroy
  55532. * @description 释放资源,将引用资源的属性置空。
  55533. */
  55534. WebPrintingService_createClass(WebPrintingService, [{
  55535. key: "destroy",
  55536. value: function destroy() {
  55537. WebPrintingService_get(WebPrintingService_getPrototypeOf(WebPrintingService.prototype), "destroy", this).call(this);
  55538. }
  55539. /**
  55540. * @function WebPrintingService.prototype.createWebPrintingJob
  55541. * @description 创建 Web 打印任务。
  55542. * @param {WebPrintingJobParameters} params - Web 打印的请求参数。
  55543. */
  55544. }, {
  55545. key: "createWebPrintingJob",
  55546. value: function createWebPrintingJob(params, callback) {
  55547. if (!params) {
  55548. return;
  55549. }
  55550. if (params.layoutOptions) {
  55551. if (params.layoutOptions.legendOptions) {
  55552. !params.layoutOptions.legendOptions.title && (params.layoutOptions.legendOptions.title = '');
  55553. params.layoutOptions.legendOptions.picAsBase64 = params.layoutOptions.legendOptions.picAsBase64 && params.layoutOptions.legendOptions.picAsBase64.replace(/^data:.+;base64,/, '');
  55554. if (params.layoutOptions.legendOptions.customItems && params.layoutOptions.legendOptions.customItems.hasOwnProperty('picAsBase64')) {
  55555. params.layoutOptions.legendOptions.customItems.picAsBase64 = params.layoutOptions.legendOptions.customItems.picAsBase64.replace(/^data:.+;base64,/, '');
  55556. }
  55557. }
  55558. }
  55559. this.processAsync('jobs', 'POST', callback, params);
  55560. }
  55561. /**
  55562. * @function WebPrintingService.prototype.getPrintingJob
  55563. * @description 获取 Web 打印输出文档任务。
  55564. * @param {string} jobId - Web 打印任务 ID
  55565. */
  55566. }, {
  55567. key: "getPrintingJob",
  55568. value: function getPrintingJob(jobId, callback) {
  55569. var me = this;
  55570. me.processAsync("jobs/".concat(jobId), 'GET', function (result) {
  55571. me.rollingProcess(result, me._processUrl("jobs/".concat(jobId)), callback);
  55572. });
  55573. }
  55574. /**
  55575. * @function WebPrintingService.prototype.getPrintingJobResult
  55576. * @description 获取 Web 打印任务的输出文档。
  55577. * @param {string} jobId - Web 打印输入文档任务 ID。
  55578. */
  55579. }, {
  55580. key: "getPrintingJobResult",
  55581. value: function getPrintingJobResult(jobId, callback) {
  55582. this.processAsync("jobs/".concat(jobId, "/result"), 'GET', callback);
  55583. }
  55584. /**
  55585. * @function WebPrintingService.prototype.getLayoutTemplates
  55586. * @description 查询 Web 打印服务所有可用的模板信息。
  55587. */
  55588. }, {
  55589. key: "getLayoutTemplates",
  55590. value: function getLayoutTemplates(callback) {
  55591. this.processAsync('layouts', 'GET', callback);
  55592. }
  55593. /**
  55594. * @function WebPrintingService.prototype.rollingProcess
  55595. * @description 轮询查询 Web 打印任务。
  55596. * @param {Object} result - 服务器返回的结果对象。
  55597. */
  55598. }, {
  55599. key: "rollingProcess",
  55600. value: function rollingProcess(result, url, callback) {
  55601. var me = this;
  55602. if (!result) {
  55603. return;
  55604. }
  55605. var id = setInterval(function () {
  55606. var eventId = ++me.eventCount;
  55607. var eventListeners = {
  55608. scope: this,
  55609. processCompleted: function processCompleted(result) {
  55610. if (eventId === result.result.eventId && callback) {
  55611. delete result.result.eventId;
  55612. callback(result);
  55613. me.events.un(eventListeners);
  55614. return false;
  55615. }
  55616. },
  55617. processFailed: function processFailed(result) {
  55618. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  55619. callback(result);
  55620. me.events.un(eventListeners);
  55621. return false;
  55622. }
  55623. }
  55624. };
  55625. me.events.on(eventListeners);
  55626. me.request({
  55627. url: url,
  55628. method: 'GET',
  55629. scope: me,
  55630. success: function success(result, options) {
  55631. result.eventId = eventId;
  55632. switch (result.status) {
  55633. case 'FINISHED':
  55634. clearInterval(id);
  55635. me.serviceProcessCompleted(result, options);
  55636. break;
  55637. case 'ERROR':
  55638. clearInterval(id);
  55639. me.serviceProcessFailed(result, options);
  55640. break;
  55641. case 'RUNNING':
  55642. me.events.triggerEvent('processRunning', result);
  55643. break;
  55644. }
  55645. },
  55646. failure: me.serviceProcessFailed
  55647. });
  55648. }, 1000);
  55649. }
  55650. }, {
  55651. key: "processAsync",
  55652. value: function processAsync(url, method, callback, params) {
  55653. var eventId = ++this.eventCount;
  55654. var eventListeners = {
  55655. scope: this,
  55656. processCompleted: function processCompleted(result) {
  55657. if (eventId === result.result.eventId && callback) {
  55658. delete result.result.eventId;
  55659. callback(result);
  55660. this.events && this.events.un(eventListeners);
  55661. return false;
  55662. }
  55663. },
  55664. processFailed: function processFailed(result) {
  55665. if (eventId === result.error.eventId || eventId === result.eventId) {
  55666. callback(result);
  55667. this.events && this.events.un(eventListeners);
  55668. return false;
  55669. }
  55670. }
  55671. };
  55672. this.events.on(eventListeners);
  55673. var me = this;
  55674. var requestConfig = {
  55675. url: me._processUrl(url),
  55676. method: method,
  55677. scope: me,
  55678. success: function success(result, options) {
  55679. result.eventId = eventId;
  55680. this.serviceProcessCompleted(result, options);
  55681. },
  55682. failure: function failure(result, options) {
  55683. if (result.error) {
  55684. result.error.eventId = eventId;
  55685. }
  55686. result.eventId = eventId;
  55687. this.serviceProcessFailed(result, options);
  55688. }
  55689. };
  55690. params && (requestConfig.data = Util_Util.toJSON(params));
  55691. me.request(requestConfig);
  55692. }
  55693. }, {
  55694. key: "_processUrl",
  55695. value: function _processUrl(appendContent) {
  55696. if (appendContent) {
  55697. return Util_Util.urlPathAppend(this.url, appendContent);
  55698. }
  55699. return this.url;
  55700. }
  55701. }]);
  55702. return WebPrintingService;
  55703. }(CommonServiceBase);
  55704. ;// CONCATENATED MODULE: ./src/common/iServer/ImageCollectionService.js
  55705. function ImageCollectionService_typeof(obj) { "@babel/helpers - typeof"; return ImageCollectionService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ImageCollectionService_typeof(obj); }
  55706. function ImageCollectionService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55707. function ImageCollectionService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  55708. function ImageCollectionService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ImageCollectionService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ImageCollectionService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  55709. function ImageCollectionService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ImageCollectionService_get = Reflect.get.bind(); } else { ImageCollectionService_get = function _get(target, property, receiver) { var base = ImageCollectionService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ImageCollectionService_get.apply(this, arguments); }
  55710. function ImageCollectionService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ImageCollectionService_getPrototypeOf(object); if (object === null) break; } return object; }
  55711. function ImageCollectionService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ImageCollectionService_setPrototypeOf(subClass, superClass); }
  55712. function ImageCollectionService_setPrototypeOf(o, p) { ImageCollectionService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ImageCollectionService_setPrototypeOf(o, p); }
  55713. function ImageCollectionService_createSuper(Derived) { var hasNativeReflectConstruct = ImageCollectionService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ImageCollectionService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ImageCollectionService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ImageCollectionService_possibleConstructorReturn(this, result); }; }
  55714. function ImageCollectionService_possibleConstructorReturn(self, call) { if (call && (ImageCollectionService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ImageCollectionService_assertThisInitialized(self); }
  55715. function ImageCollectionService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  55716. function ImageCollectionService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  55717. function ImageCollectionService_getPrototypeOf(o) { ImageCollectionService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ImageCollectionService_getPrototypeOf(o); }
  55718. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  55719. * This program are made available under the terms of the Apache License, Version 2.0
  55720. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55721. /**
  55722. * @class ImageCollectionService
  55723. * @deprecatedclass SuperMap.ImageCollectionService
  55724. * @classdesc 影像集合服务类。
  55725. * @version 10.2.0
  55726. * @category iServer Image
  55727. * @param {string} url - 服务地址。例如: http://{ip}:{port}/iserver/{imageservice-imageserviceName}/restjsr/
  55728. * @param {Object} options - 参数。
  55729. * @param {string} options.collectionId 影像集合(Collection)的ID,在一个影像服务中唯一标识影像集合。
  55730. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  55731. * @param {Object} [options.headers] - 请求头。
  55732. * @extends {CommonServiceBase}
  55733. * @usage
  55734. */
  55735. var ImageCollectionService_ImageCollectionService = /*#__PURE__*/function (_CommonServiceBase) {
  55736. ImageCollectionService_inherits(ImageCollectionService, _CommonServiceBase);
  55737. var _super = ImageCollectionService_createSuper(ImageCollectionService);
  55738. function ImageCollectionService(url, options) {
  55739. var _this;
  55740. ImageCollectionService_classCallCheck(this, ImageCollectionService);
  55741. _this = _super.call(this, url, options);
  55742. _this.options = options || {};
  55743. if (options) {
  55744. Util_Util.extend(ImageCollectionService_assertThisInitialized(_this), options);
  55745. }
  55746. _this.eventCount = 0;
  55747. _this.CLASS_NAME = 'SuperMap.ImageCollectionService';
  55748. return _this;
  55749. }
  55750. /**
  55751. * @function ImageCollectionService.prototype.destroy
  55752. * @override
  55753. */
  55754. ImageCollectionService_createClass(ImageCollectionService, [{
  55755. key: "destroy",
  55756. value: function destroy() {
  55757. ImageCollectionService_get(ImageCollectionService_getPrototypeOf(ImageCollectionService.prototype), "destroy", this).call(this);
  55758. }
  55759. /**
  55760. * @function ImageCollectionService.prototype.getLegend
  55761. * @description 返回当前影像集合的图例信息。默认为服务发布所配置的风格,支持根据风格参数生成新的图例。
  55762. * @param {Object} queryParams query参数。
  55763. * @param {ImageRenderingRule} [queryParams.renderingRule] renderingRule 对象,用来指定影像的渲染风格,从而确定图例内容。影像的渲染风格包含拉伸显示方式、颜色表、波段组合以及应用栅格函数进行快速处理等。该参数未设置时,将使用发布服务时所配置的风格。
  55764. */
  55765. }, {
  55766. key: "getLegend",
  55767. value: function getLegend(queryParams, callback) {
  55768. var me = this;
  55769. var pathParams = {
  55770. collectionId: me.options.collectionId
  55771. };
  55772. var path = Util_Util.convertPath('/collections/{collectionId}/legend', pathParams);
  55773. var url = Util_Util.urlPathAppend(me.url, path);
  55774. this._processAsync({
  55775. url: url,
  55776. method: 'GET',
  55777. params: queryParams,
  55778. callback: callback
  55779. });
  55780. }
  55781. /**
  55782. * @function ImageCollectionService.prototype.getStatistics
  55783. * @description 返回当前影像集合的统计信息。包括文件数量,文件大小等信息。
  55784. */
  55785. }, {
  55786. key: "getStatistics",
  55787. value: function getStatistics(callback) {
  55788. var me = this;
  55789. var pathParams = {
  55790. collectionId: me.options.collectionId
  55791. };
  55792. var path = Util_Util.convertPath('/collections/{collectionId}/statistics', pathParams);
  55793. var url = Util_Util.urlPathAppend(me.url, path);
  55794. this._processAsync({
  55795. url: url,
  55796. method: 'GET',
  55797. callback: callback
  55798. });
  55799. }
  55800. /**
  55801. * @function ImageCollectionService.prototype.getTileInfo
  55802. * @description 返回影像集合所提供的服务瓦片的信息,包括:每层瓦片的分辨率,比例尺等信息,方便前端进行图层叠加。
  55803. */
  55804. }, {
  55805. key: "getTileInfo",
  55806. value: function getTileInfo(callback) {
  55807. var me = this;
  55808. var pathParams = {
  55809. collectionId: me.options.collectionId
  55810. };
  55811. var path = Util_Util.convertPath('/collections/{collectionId}/tileInfo', pathParams);
  55812. var url = Util_Util.urlPathAppend(me.url, path);
  55813. this._processAsync({
  55814. url: url,
  55815. method: 'GET',
  55816. callback: callback
  55817. });
  55818. }
  55819. /**
  55820. * @function ImageCollectionService.prototype.deleteItemByID
  55821. * @description 删除影像集合中指定 ID 的 Item,即从影像集合中删除指定的影像。
  55822. * @param {string} featureId Feature 的本地标识符。
  55823. */
  55824. }, {
  55825. key: "deleteItemByID",
  55826. value: function deleteItemByID(featureId, callback) {
  55827. var me = this;
  55828. var pathParams = {
  55829. collectionId: me.options.collectionId,
  55830. featureId: featureId
  55831. };
  55832. var path = Util_Util.convertPath('/collections/{collectionId}/items/{featureId}', pathParams);
  55833. var url = Util_Util.urlPathAppend(me.url, path);
  55834. this._processAsync({
  55835. url: url,
  55836. method: 'DELETE',
  55837. callback: callback
  55838. });
  55839. }
  55840. /**
  55841. * @function ImageCollectionService.prototype.getItemByID
  55842. * @description 返回指定ID(`collectionId`)的影像集合中的指定ID(`featureId`)的Item对象,即返回影像集合中指定的影像。
  55843. * @param {string} featureId Feature 的本地标识符。
  55844. */
  55845. }, {
  55846. key: "getItemByID",
  55847. value: function getItemByID(featureId, callback) {
  55848. var me = this;
  55849. var pathParams = {
  55850. collectionId: me.options.collectionId,
  55851. featureId: featureId
  55852. };
  55853. var path = Util_Util.convertPath('/collections/{collectionId}/items/{featureId}', pathParams);
  55854. var url = Util_Util.urlPathAppend(me.url, path);
  55855. this._processAsync({
  55856. url: url,
  55857. method: 'GET',
  55858. callback: callback
  55859. });
  55860. }
  55861. }, {
  55862. key: "_processAsync",
  55863. value: function _processAsync(_ref) {
  55864. var url = _ref.url,
  55865. method = _ref.method,
  55866. callback = _ref.callback,
  55867. params = _ref.params;
  55868. var eventId = ++this.eventCount;
  55869. var eventListeners = {
  55870. scope: this,
  55871. processCompleted: function processCompleted(result) {
  55872. if (eventId === result.result.eventId && callback) {
  55873. delete result.result.eventId;
  55874. callback(result);
  55875. this.events && this.events.un(eventListeners);
  55876. return false;
  55877. }
  55878. },
  55879. processFailed: function processFailed(result) {
  55880. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  55881. callback(result);
  55882. this.events && this.events.un(eventListeners);
  55883. return false;
  55884. }
  55885. }
  55886. };
  55887. this.events.on(eventListeners);
  55888. this.request({
  55889. method: method || 'GET',
  55890. url: url,
  55891. params: params,
  55892. scope: this,
  55893. success: function success(result, options) {
  55894. result.eventId = eventId;
  55895. this.serviceProcessCompleted(result, options);
  55896. },
  55897. failure: function failure(result, options) {
  55898. if (result.error) {
  55899. result.error.eventId = eventId;
  55900. }
  55901. result.eventId = eventId;
  55902. this.serviceProcessFailed(result, options);
  55903. }
  55904. });
  55905. }
  55906. }]);
  55907. return ImageCollectionService;
  55908. }(CommonServiceBase);
  55909. ;// CONCATENATED MODULE: ./src/common/iServer/ImageService.js
  55910. function ImageService_typeof(obj) { "@babel/helpers - typeof"; return ImageService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ImageService_typeof(obj); }
  55911. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  55912. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  55913. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  55914. function ImageService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55915. function ImageService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  55916. function ImageService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ImageService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ImageService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  55917. function ImageService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ImageService_get = Reflect.get.bind(); } else { ImageService_get = function _get(target, property, receiver) { var base = ImageService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ImageService_get.apply(this, arguments); }
  55918. function ImageService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ImageService_getPrototypeOf(object); if (object === null) break; } return object; }
  55919. function ImageService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ImageService_setPrototypeOf(subClass, superClass); }
  55920. function ImageService_setPrototypeOf(o, p) { ImageService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ImageService_setPrototypeOf(o, p); }
  55921. function ImageService_createSuper(Derived) { var hasNativeReflectConstruct = ImageService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ImageService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ImageService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ImageService_possibleConstructorReturn(this, result); }; }
  55922. function ImageService_possibleConstructorReturn(self, call) { if (call && (ImageService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ImageService_assertThisInitialized(self); }
  55923. function ImageService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  55924. function ImageService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  55925. function ImageService_getPrototypeOf(o) { ImageService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ImageService_getPrototypeOf(o); }
  55926. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  55927. * This program are made available under the terms of the Apache License, Version 2.0
  55928. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55929. /**
  55930. * @class ImageService
  55931. * @deprecatedclass SuperMap.ImageService
  55932. * @classdesc 影像服务类。
  55933. * @version 10.2.0
  55934. * @category iServer Image
  55935. * @param {string} url - 服务地址。例如: http://{ip}:{port}/iserver/{imageservice-imageserviceName}/restjsr/
  55936. * @param {Object} options - 可选参数。
  55937. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  55938. * @param {Object} [options.headers] - 请求头。
  55939. * @extends {CommonServiceBase}
  55940. * @usage
  55941. */
  55942. var ImageService_ImageService = /*#__PURE__*/function (_CommonServiceBase) {
  55943. ImageService_inherits(ImageService, _CommonServiceBase);
  55944. var _super = ImageService_createSuper(ImageService);
  55945. function ImageService(url, options) {
  55946. var _this;
  55947. ImageService_classCallCheck(this, ImageService);
  55948. _this = _super.call(this, url, options);
  55949. _this.options = options || {};
  55950. if (options) {
  55951. Util_Util.extend(ImageService_assertThisInitialized(_this), options);
  55952. }
  55953. _this.eventCount = 0;
  55954. _this.CLASS_NAME = 'SuperMap.ImageService';
  55955. return _this;
  55956. }
  55957. /**
  55958. * @function ImageService.prototype.destroy
  55959. * @override
  55960. */
  55961. ImageService_createClass(ImageService, [{
  55962. key: "destroy",
  55963. value: function destroy() {
  55964. ImageService_get(ImageService_getPrototypeOf(ImageService.prototype), "destroy", this).call(this);
  55965. }
  55966. /**
  55967. * @function ImageService.prototype.getCollections
  55968. * @description 返回当前影像服务中的影像集合列表(Collections)。
  55969. */
  55970. }, {
  55971. key: "getCollections",
  55972. value: function getCollections(callback) {
  55973. var me = this;
  55974. var path = Util_Util.convertPath('/collections');
  55975. var url = Util_Util.urlPathAppend(me.url, path);
  55976. this._processAsync({
  55977. url: url,
  55978. mehtod: 'GET',
  55979. callback: callback
  55980. });
  55981. }
  55982. /**
  55983. * @function ImageService.prototype.getCollectionByID
  55984. * @description ID值等于`collectionId`参数值的影像集合(Collection)。ID值用于在服务中唯一标识该影像集合。
  55985. * @param {string} collectionId 影像集合(Collection)的ID,在一个影像服务中唯一标识影像集合。
  55986. */
  55987. }, {
  55988. key: "getCollectionByID",
  55989. value: function getCollectionByID(collectionId, callback) {
  55990. var pathParams = {
  55991. collectionId: collectionId
  55992. };
  55993. var me = this;
  55994. var path = Util_Util.convertPath('/collections/{collectionId}', pathParams);
  55995. var url = Util_Util.urlPathAppend(me.url, path);
  55996. this._processAsync({
  55997. url: url,
  55998. mehtod: 'GET',
  55999. callback: callback
  56000. });
  56001. }
  56002. /**
  56003. * @function ImageSearchService.prototype.search
  56004. * @description 查询与过滤条件匹配的影像数据。
  56005. * @param {ImageSearchParameter} [imageSearchParameter] 查询参数。
  56006. */
  56007. }, {
  56008. key: "search",
  56009. value: function search(imageSearchParameter, callback) {
  56010. var postBody = _objectSpread({}, imageSearchParameter || {});
  56011. var me = this;
  56012. var path = Util_Util.convertPath('/search');
  56013. var url = Util_Util.urlPathAppend(me.url, path);
  56014. this._processAsync({
  56015. url: url,
  56016. method: 'POST',
  56017. data: postBody,
  56018. callback: callback
  56019. });
  56020. }
  56021. }, {
  56022. key: "_processAsync",
  56023. value: function _processAsync(_ref) {
  56024. var url = _ref.url,
  56025. method = _ref.method,
  56026. callback = _ref.callback,
  56027. data = _ref.data;
  56028. var eventId = ++this.eventCount;
  56029. var me = this;
  56030. var eventListeners = {
  56031. scope: this,
  56032. processCompleted: function processCompleted(result) {
  56033. if (eventId === result.result.eventId && callback) {
  56034. delete result.result.eventId;
  56035. callback(result);
  56036. this.events && this.events.un(eventListeners);
  56037. return false;
  56038. }
  56039. },
  56040. processFailed: function processFailed(result) {
  56041. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  56042. callback(result);
  56043. this.events && this.events.un(eventListeners);
  56044. return false;
  56045. }
  56046. }
  56047. };
  56048. this.events.on(eventListeners);
  56049. this.request({
  56050. method: method || 'GET',
  56051. url: url,
  56052. data: data,
  56053. scope: this,
  56054. success: function success(result, options) {
  56055. result.eventId = eventId;
  56056. me.serviceProcessCompleted(result, options);
  56057. },
  56058. failure: function failure(result, options) {
  56059. if (result.error) {
  56060. result.error.eventId = eventId;
  56061. }
  56062. result.eventId = eventId;
  56063. me.serviceProcessFailed(result, options);
  56064. }
  56065. });
  56066. }
  56067. }]);
  56068. return ImageService;
  56069. }(CommonServiceBase);
  56070. ;// CONCATENATED MODULE: ./src/common/iServer/FieldsFilter.js
  56071. function FieldsFilter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56072. function FieldsFilter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  56073. function FieldsFilter_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldsFilter_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldsFilter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  56074. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  56075. * This program are made available under the terms of the Apache License, Version 2.0
  56076. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56077. /**
  56078. * @class FieldsFilter
  56079. * @deprecatedclass SuperMap.FieldsFilter
  56080. * @category iServer Data Field
  56081. * @classdesc 指定返回的用于描述 Feature 的字段。
  56082. * @param {Object} options - 可选参数。
  56083. * @param {Array.<string>} [options.include] 对返回的字段内容进行过滤,需保留的字段列表。
  56084. * @param {Array.<string>} [options.exclude] 对返回的字段内容进行过滤,需排除的字段列表。
  56085. * @usage
  56086. */
  56087. var FieldsFilter = /*#__PURE__*/function () {
  56088. function FieldsFilter(options) {
  56089. FieldsFilter_classCallCheck(this, FieldsFilter);
  56090. /**
  56091. * @description 对返回的字段内容进行过滤,需保留的字段列表。
  56092. * @member {Array.<string>} FieldsFilter.prototype.include
  56093. */
  56094. this.include = undefined;
  56095. /**
  56096. * @description 对返回的字段内容进行过滤,需排除的字段列表。
  56097. * @member {Array.<string>} FieldsFilter.prototype.exclude
  56098. */
  56099. this.exclude = undefined;
  56100. this.CLASS_NAME = 'SuperMap.FieldsFilter';
  56101. Util_Util.extend(this, options);
  56102. }
  56103. /**
  56104. * @function FieldsFilter.prototype.destroy
  56105. * @description 释放资源,将引用资源的属性置空。
  56106. */
  56107. FieldsFilter_createClass(FieldsFilter, [{
  56108. key: "destroy",
  56109. value: function destroy() {
  56110. var me = this;
  56111. me.include = undefined;
  56112. me.exclude = undefined;
  56113. }
  56114. /**
  56115. * @function FieldsFilter.prototype.constructFromObject
  56116. * @description 目标对象新增该类的可选参数。
  56117. * @param {Object} data 要转换的数据。
  56118. * @param {FieldsFilter} obj 返回的模型。
  56119. * @return {FieldsFilter} 返回结果。
  56120. */
  56121. }], [{
  56122. key: "constructFromObject",
  56123. value: function constructFromObject(data, obj) {
  56124. if (data) {
  56125. obj = obj || new FieldsFilter();
  56126. if (data.hasOwnProperty('include')) {
  56127. obj.include = data.include;
  56128. }
  56129. if (data.hasOwnProperty('exclude')) {
  56130. obj.exclude = data.exclude;
  56131. }
  56132. }
  56133. return obj;
  56134. }
  56135. }]);
  56136. return FieldsFilter;
  56137. }();
  56138. ;// CONCATENATED MODULE: ./src/common/iServer/Sortby.js
  56139. function Sortby_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56140. function Sortby_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  56141. function Sortby_createClass(Constructor, protoProps, staticProps) { if (protoProps) Sortby_defineProperties(Constructor.prototype, protoProps); if (staticProps) Sortby_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  56142. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  56143. * This program are made available under the terms of the Apache License, Version 2.0
  56144. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56145. /**
  56146. * @class Sortby
  56147. * @deprecatedclass SuperMap.Sortby
  56148. * @classdesc 通过指定字段进行排序的方法类。
  56149. * @category BaseTypes Util
  56150. * @param {Object} options - 参数。
  56151. * @param {string} options.field 属性名称。
  56152. * @param {Sortby.Direction} options.direction 排序规则,默认升序。
  56153. * @usage
  56154. */
  56155. var Sortby = /*#__PURE__*/function () {
  56156. function Sortby(options) {
  56157. Sortby_classCallCheck(this, Sortby);
  56158. /**
  56159. * @description 属性名称。
  56160. * @member {string} Sortby.prototype.field
  56161. */
  56162. this.field = undefined;
  56163. /**
  56164. * @description 排序规则。
  56165. * @member {Sortby.Direction} Sortby.prototype.direction
  56166. * @default Sortby.Direction.ASC
  56167. */
  56168. this.direction = Sortby.Direction.ASC;
  56169. this.CLASS_NAME = 'SuperMap.Sortby';
  56170. Util_Util.extend(this, options);
  56171. }
  56172. /**
  56173. * @function Sortby.prototype.destroy
  56174. * @description 释放资源,将引用资源的属性置空。
  56175. */
  56176. Sortby_createClass(Sortby, [{
  56177. key: "destroy",
  56178. value: function destroy() {
  56179. var me = this;
  56180. me.field = undefined;
  56181. me.direction = 'ASC';
  56182. }
  56183. /**
  56184. * @function Sortby.prototype.constructFromObject
  56185. * @description 目标对象新增该类的可选参数。
  56186. * @param {Object} data 要转换的数据。
  56187. * @param {Sortby} obj 返回的模型。
  56188. * @return {Sortby} 返回结果。
  56189. */
  56190. }], [{
  56191. key: "constructFromObject",
  56192. value: function constructFromObject(data, obj) {
  56193. if (data) {
  56194. obj = obj || new Sortby();
  56195. if (data.hasOwnProperty('field')) {
  56196. obj.field = data.field;
  56197. }
  56198. if (data.hasOwnProperty('direction')) {
  56199. obj.direction = data.direction;
  56200. }
  56201. }
  56202. return obj;
  56203. }
  56204. }]);
  56205. return Sortby;
  56206. }();
  56207. /**
  56208. * @enum Direction
  56209. * @description 排序的类型枚举。
  56210. * @memberOf Sortby
  56211. * @readonly
  56212. * @type {string}
  56213. */
  56214. Sortby.Direction = {
  56215. /** 升序。 */
  56216. ASC: 'ASC',
  56217. /** 降序。 */
  56218. DESC: 'DESC'
  56219. };
  56220. ;// CONCATENATED MODULE: ./src/common/iServer/ImageSearchParameter.js
  56221. function ImageSearchParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56222. function ImageSearchParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  56223. function ImageSearchParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) ImageSearchParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) ImageSearchParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  56224. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  56225. * This program are made available under the terms of the Apache License, Version 2.0
  56226. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56227. /**
  56228. * @class ImageSearchParameter
  56229. * @deprecatedclass SuperMap.ImageSearchParameter
  56230. * @classdesc 影像服务查询参数类。
  56231. * @category iServer Image
  56232. * @param {Object} options - 可选参数。
  56233. * @param {Array.<number>} [options.bbox] 指定查询范围。只有具有几何对象(geometry)属性的Features,并且该几何对象与该参数指定的范围相交的 Features 才会被选择出来。该参数可以包含4个数值或者6个数值,这取决于使用的坐标参考系统是否包含高程值: * 左下角坐标轴 1 的值 * 左下角坐标轴 2 的值 * 坐标轴 3 的最小值(可选) * 右上角坐标轴 1 的值 * 右上角坐标轴 2 的值 * 坐标轴 3 的最大值(可选) 坐标参考系统为 WGS 84 经度/纬度 (http://www.opengis.net/def/crs/OGC/1.3/CRS84)。对于 “WGS 84 经度/纬度” 坐标参考系统,该参数值的格式通常为:最小经度,最小纬度,最大经度,最大纬度。如果包含了高程值,该参数的格式为:最小经度,最小纬度,最小高程值,最大经度,最大纬度,最大高程值。如果一个 Feature 具有多个空间几何对象(geometry)属性,由服务器决定是否使用单一的空间几何对象属性,还是使用所有相关的几何对象作为最终的查询空间范围。
  56234. * @param {Array.<string>} [options.collections] 影像集合的ID数组,将在该指定的Collection中搜索Items。
  56235. * @param {Array.<string>} [options.ids] 只返回指定 Item 的 ID 数组中的Item。返回的 Item 的 ID 值数组。设置了该参数,所有其他过滤器参数(除了next和limit)将被忽略。
  56236. * @param {number} [options.limit] 返回的最大结果数,即响应文档包含的 Item 的数目。
  56237. * @param {FieldsFilter} [options.fields] 通过‘include’和‘exclude’属性分别指定哪些字段包含在查询结果的 Feature 描述中,哪些需要排除。返回结果中的stac_version,id,bbox,assets,links,geometry,type,properties这些字段为必须字段,若要返回结果中不含这种字段信息,需要显示地进行排除设置,如:排除geometry和bbox字段;在POST请求中,则需要将这些字段添加到“exclude”字段中,例如: "fields": { "exclude": ["geometry","bbox"] } } 。而对于返回的“properties”对象中的扩展字段内容,可以将字段前添加到‘include’字段中,如: "fields": { "include": ["properties.SmFileName","properties.SmHighPS"] } ,表示properties.SmFileName和properties.SmHighPS 属性都包含在查询结果中。
  56238. * @param {Object} [options.query] 定义查询哪些属性,查询运算符将应用于这些属性。运算符包括:eq、neq、gt、lt、gte、lte、startsWith、endsWith、contains、in。其中in是Array.<string>类型,例如:{ "SmFileName": { "eq":"B49C001002.tif" }}
  56239. * @param {Array.<Sortby>} [options.sortby] 由包含属性名称和排序规则的对象构成的数组。
  56240. * @usage
  56241. */
  56242. var ImageSearchParameter = /*#__PURE__*/function () {
  56243. function ImageSearchParameter(options) {
  56244. ImageSearchParameter_classCallCheck(this, ImageSearchParameter);
  56245. /**
  56246. * @description 指定查询范围。只有具有几何对象(geometry)属性的Features,并且该几何对象与该参数指定的范围相交的 Features 才会被选择出来该参数可以包含4个数值或者6个数值,这取决于使用的坐标参考系统是否包含高程值: * 左下角坐标轴 1 的值 * 左下角坐标轴 2 的值 * 坐标轴 3 的最小值(可选) * 右上角坐标轴 1 的值 * 右上角坐标轴 2 的值 * 坐标轴 3 的最大值(可选) 坐标参考系统为 WGS 84 经度/纬度 (http://www.opengis.net/def/crs/OGC/1.3/CRS84). 对于 “WGS 84 经度/纬度” 坐标参考系统,该参数值的格式通常为:最小经度,最小纬度,最大经度,最大纬度。如果包含了高程值,该参数的格式为:最小经度,最小纬度,最小高程值,最大经度,最大纬度,最大高程值。如果一个 Feature 具有多个空间几何对象(geometry)属性,由服务器决定是否使用单一的空间几何对象属性,还是使用所有相关的几何对象作为最终的查询空间范围。
  56247. * @member {Array.<number>} ImageSearchParameter.prototype.bbox
  56248. */
  56249. this.bbox = undefined;
  56250. /**
  56251. * @description 影像集合的ID数组,将在该指定的Collection中搜索Items。
  56252. * @member {Array.<string>} ImageSearchParameter.prototype.collections
  56253. */
  56254. this.collections = undefined;
  56255. /**
  56256. * @description 返回的 Item 的 ID 值数组。设置了该参数,所有其他过滤器参数(除了next和limit)将被忽略。
  56257. * @member {Array.<string>} ImageSearchParameter.prototype.ids
  56258. */
  56259. this.ids = undefined;
  56260. /**
  56261. * @description 单页返回的最大结果数。最小值为1,最大值为10000。
  56262. * @member {number} ImageSearchParameter.prototype.limit
  56263. */
  56264. this.limit = undefined;
  56265. /**
  56266. * @description 通过‘include’和‘exclude’属性分别指定哪些字段包含在查询结果的 Feature 描述中,哪些需要排除。返回结果中的stac_version,id,bbox,assets,links,geometry,type,properties这些字段为必须字段,若要返回结果中不含这种字段信息,需要显示地进行排除设置,如:排除geometry和bbox字段;在POST请求中,则需要将这些字段添加到“exclude”字段中,例如: "fields": { "exclude": ["geometry","bbox"] } } 。而对于返回的“properties”对象中的扩展字段内容,可以将字段前添加到‘include’字段中,如: "fields": { "include": ["properties.SmFileName","properties.SmHighPS"] } } ,表示properties.SmFileName和properties.SmHighPS 属性都包含在查询结果中。
  56267. * @member {FieldsFilter} ImageSearchParameter.prototype.fields
  56268. */
  56269. this.fields = undefined;
  56270. /**
  56271. * @description 定义查询哪些属性,查询运算符将应用于这些属性。
  56272. * @member {Object} ImageSearchParameter.prototype.query
  56273. */
  56274. this.query = undefined;
  56275. /**
  56276. * @description 由包含属性名称和排序规则的对象构成的数组。
  56277. * @member {Array.<Sortby>} ImageSearchParameter.prototype.sortby
  56278. */
  56279. this.sortby = undefined;
  56280. this.CLASS_NAME = 'SuperMap.ImageSearchParameter';
  56281. Util_Util.extend(this, options);
  56282. }
  56283. /**
  56284. * @function ImageSearchParameter.prototype.destroy
  56285. * @description 释放资源,将引用资源的属性置空。
  56286. */
  56287. ImageSearchParameter_createClass(ImageSearchParameter, [{
  56288. key: "destroy",
  56289. value: function destroy() {
  56290. var me = this;
  56291. me.bbox = undefined;
  56292. me.collections = undefined;
  56293. me.ids = undefined;
  56294. me.limit = undefined;
  56295. me.fields = undefined;
  56296. me.query = undefined;
  56297. me.sortby = undefined;
  56298. }
  56299. /**
  56300. * @function ImageSearchParameter.prototype.constructFromObject
  56301. * @description 目标对象新增该类的可选参数。
  56302. * @param {Object} data 要转换的数据。
  56303. * @param {ImageSearchParameter} obj 返回的模型。
  56304. * @return {ImageSearchParameter} 返回结果。
  56305. */
  56306. }], [{
  56307. key: "constructFromObject",
  56308. value: function constructFromObject(data, obj) {
  56309. if (data) {
  56310. obj = obj || new ImageSearchParameter();
  56311. if (data.hasOwnProperty('bbox')) {
  56312. obj.bbox = data.bbox;
  56313. }
  56314. if (data.hasOwnProperty('collections')) {
  56315. obj.collections = data.collections;
  56316. }
  56317. if (data.hasOwnProperty('ids')) {
  56318. obj.ids = data.ids;
  56319. }
  56320. if (data.hasOwnProperty('limit')) {
  56321. obj.limit = data.limit;
  56322. }
  56323. if (data.hasOwnProperty('fields')) {
  56324. obj.fields = FieldsFilter.constructFromObject && FieldsFilter.constructFromObject(data.fields, {}) || data.fields;
  56325. }
  56326. if (data.hasOwnProperty('query')) {
  56327. obj.query = data.query;
  56328. }
  56329. if (data.hasOwnProperty('sortby')) {
  56330. obj.sortby = data.sortby;
  56331. if (data.sortby) {
  56332. obj.sortby = data.sortby.map(function (item) {
  56333. return Sortby.constructFromObject && Sortby.constructFromObject(item, {}) || item;
  56334. });
  56335. }
  56336. }
  56337. }
  56338. return obj;
  56339. }
  56340. }]);
  56341. return ImageSearchParameter;
  56342. }();
  56343. ;// CONCATENATED MODULE: ./src/common/iServer/ImageStretchOption.js
  56344. function ImageStretchOption_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56345. function ImageStretchOption_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  56346. function ImageStretchOption_createClass(Constructor, protoProps, staticProps) { if (protoProps) ImageStretchOption_defineProperties(Constructor.prototype, protoProps); if (staticProps) ImageStretchOption_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  56347. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  56348. * This program are made available under the terms of the Apache License, Version 2.0
  56349. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56350. /**
  56351. * @class ImageStretchOption
  56352. * @deprecatedclass SuperMap.ImageStretchOption
  56353. * @classdesc 影像拉伸类。
  56354. * @category iServer Image
  56355. * @param {Object} options - 可选参数。
  56356. * @param {ImageStretchOption.StretchType} [options.stretchType] 影像拉伸类型。该属性的值有以下几种情况:NONE,无拉伸;GAUSSIAN,高斯拉伸;PERCENTCLIP,百分比截断拉伸;MINIMUMMAXIMUM,最值拉伸;STANDARDDEVIATION,标准差拉伸。
  56357. * @param {number} [options.stdevCoefficient] 标准差系数。
  56358. * @param {number} [options.gaussianCoefficient] 高斯系数。
  56359. * @param {boolean} [options.useMedianValue] 高斯拉伸时,是否使用中间值,若该属性值为true,表示使用中间值;false,表示使用平均值。
  56360. * @param {number} [options.minPercent] 使用百分比截断拉伸时,排除影像直方图最低值区域的像元,该参数值为这部分像元占总像元百分比。
  56361. * @param {number} [options.maxPercent] 使用百分比截断拉伸时,排除影像直方图最高值区域的像元,该参数值为这部分像元占总像元百分比。
  56362. * @usage
  56363. */
  56364. var ImageStretchOption = /*#__PURE__*/function () {
  56365. function ImageStretchOption(options) {
  56366. ImageStretchOption_classCallCheck(this, ImageStretchOption);
  56367. /**
  56368. * @description 影像拉伸类型。该属性的值有以下几种情况:NONE,无拉伸;GAUSSIAN,高斯拉伸;PERCENTCLIP,百分比截断拉伸;MINIMUMMAXIMUM,最值拉伸;STANDARDDEVIATION,标准差拉伸。
  56369. * @member {ImageStretchOption.StretchType} ImageStretchOption.prototype.stretchType
  56370. */
  56371. this.stretchType = undefined;
  56372. /**
  56373. * @description 标准差系数。
  56374. * @member {number} ImageStretchOption.prototype.stdevCoefficient
  56375. */
  56376. this.stdevCoefficient = undefined;
  56377. /**
  56378. * @description 高斯系数。
  56379. * @member {number} ImageStretchOption.prototype.gaussianCoefficient
  56380. */
  56381. this.gaussianCoefficient = undefined;
  56382. /**
  56383. * @description 高斯拉伸时,是否使用中间值,若该属性值为true,表示使用中间值;false,表示使用平均值。
  56384. * @member {boolean} ImageStretchOption.prototype.useMedianValue
  56385. */
  56386. this.useMedianValue = undefined;
  56387. /**
  56388. * @description 使用百分比截断拉伸时,排除影像直方图最低值区域的像元,该参数值为这部分像元占总像元百分比。
  56389. * @member {number} ImageStretchOption.prototype.minPercent
  56390. */
  56391. this.minPercent = undefined;
  56392. /**
  56393. * @description 使用百分比截断拉伸时,排除影像直方图最高值区域的像元,该参数值为这部分像元占总像元百分比。
  56394. * @member {number} ImageStretchOption.prototype.maxPercent
  56395. */
  56396. this.maxPercent = undefined;
  56397. this.CLASS_NAME = 'SuperMap.ImageStretchOption';
  56398. Util_Util.extend(this, options);
  56399. }
  56400. /**
  56401. * @function ImageStretchOption.prototype.destroy
  56402. * @description 释放资源,将引用资源的属性置空。
  56403. */
  56404. ImageStretchOption_createClass(ImageStretchOption, [{
  56405. key: "destroy",
  56406. value: function destroy() {
  56407. var me = this;
  56408. me.stretchType = undefined;
  56409. me.stdevCoefficient = undefined;
  56410. me.gaussianCoefficient = undefined;
  56411. me.useMedianValue = undefined;
  56412. me.minPercent = undefined;
  56413. me.maxPercent = undefined;
  56414. }
  56415. /**
  56416. * @function ImageStretchOption.prototype.constructFromObject
  56417. * @description 目标对象新增该类的可选参数。
  56418. * @param {Object} data 要转换的数据。
  56419. * @param {ImageStretchOption} obj 返回的模型。
  56420. * @return {ImageStretchOption} 返回结果。
  56421. */
  56422. }], [{
  56423. key: "constructFromObject",
  56424. value: function constructFromObject(data, obj) {
  56425. if (data) {
  56426. obj = obj || new ImageStretchOption();
  56427. if (data.hasOwnProperty('stretchType')) {
  56428. obj.stretchType = data.stretchType;
  56429. }
  56430. if (data.hasOwnProperty('stdevCoefficient')) {
  56431. obj.stdevCoefficient = data.stdevCoefficient;
  56432. }
  56433. if (data.hasOwnProperty('gaussianCoefficient')) {
  56434. obj.gaussianCoefficient = data.gaussianCoefficient;
  56435. }
  56436. if (data.hasOwnProperty('useMedianValue')) {
  56437. obj.useMedianValue = data.useMedianValue;
  56438. }
  56439. if (data.hasOwnProperty('minPercent')) {
  56440. obj.minPercent = data.minPercent;
  56441. }
  56442. if (data.hasOwnProperty('maxPercent')) {
  56443. obj.maxPercent = data.maxPercent;
  56444. }
  56445. }
  56446. return obj;
  56447. }
  56448. }]);
  56449. return ImageStretchOption;
  56450. }();
  56451. /**
  56452. * @enum StretchType
  56453. * @description 影像拉伸类型枚举。
  56454. * @memberOf ImageStretchOption
  56455. * @readonly
  56456. * @type {string}
  56457. */
  56458. ImageStretchOption.StretchType = {
  56459. /** 无拉伸。 */
  56460. NONE: 'NONE',
  56461. /** 高斯拉伸。 */
  56462. GAUSSIAN: 'GAUSSIAN',
  56463. /** 百分比截断拉伸。 */
  56464. PERCENTCLIP: 'PERCENTCLIP',
  56465. /** 最值拉伸。 */
  56466. MINIMUMMAXIMUM: 'MINIMUMMAXIMUM',
  56467. /** 标准差拉伸。 */
  56468. STANDARDDEVIATION: 'STANDARDDEVIATION'
  56469. };
  56470. ;// CONCATENATED MODULE: ./src/common/iServer/ImageRenderingRule.js
  56471. function ImageRenderingRule_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56472. function ImageRenderingRule_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  56473. function ImageRenderingRule_createClass(Constructor, protoProps, staticProps) { if (protoProps) ImageRenderingRule_defineProperties(Constructor.prototype, protoProps); if (staticProps) ImageRenderingRule_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  56474. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  56475. * This program are made available under the terms of the Apache License, Version 2.0
  56476. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56477. /**
  56478. * @class ImageRenderingRule
  56479. * @deprecatedclass SuperMap.ImageRenderingRule
  56480. * @classdesc 定义请求的影像如何进行渲染或者处理,如:影像的拉伸显示方式、颜色表、波段组合以及应用栅格函数进行快速处理等。
  56481. * @category iServer Image
  56482. * @param {Object} options - 可选参数。
  56483. * @param {ImageRenderingRule.DisplayMode} [options.displayMode] 影像显示模式,其中:Composite表示多波段组合显示;Stretched表示单波段拉伸显示。
  56484. * @param {string} [options.displayBands] 影像显示的波段或者波段组合。若影像的显示模式为STRETCHED,该属性指定一个波段的索引号(波段索引号从0开始计数);若影像的显示模式为COMPOSITE,该属性为组合的波段索引号,例如:属性值3,2,1表示采用4波段、3波段、2波段分别对应 R、G、B颜色通道进行组合显示。
  56485. * @param {ImageStretchOption} [options.stretchOption] 影像的拉伸参数。
  56486. * @param {ImageRenderingRule.InterpolationMode} [options.interpolationMode] 影像显示时使用的插值算法。
  56487. * @param {Array.<string>} [options.colorScheme] 影像拉伸显示的颜色方案。颜色方案为RGBA颜色数组。RGBA是代表Red(红色)Green(绿色)Blue(蓝色)和Alpha的色彩空间。Alpha值可以省略不写,表示完全不透明。Alpha通道表示不透明度参数,若该值为0表示完全透明。例如:"255,0,0","0,255,0","0,0,255" 表示由红色、绿色、蓝色三种颜色构成的色带。
  56488. * @param {Array.<string>} [options.colorTable] 影像的颜色表。颜色表为栅格值与RGBA颜色值的对照表。RGBA是代表Red(红色)Green(绿色)Blue(蓝色)和Alpha的色彩空间。Alpha值可以省略不写,表示完全不透明。Alpha通道表示不透明度参数,若该值为0表示完全透明。以下示例表示该颜色对照表由三组构成,第一组高程值为500,对应的颜色为红色;第二组高程值为700,对应的颜色为绿色;第三组高程值为700,对应的颜色为蓝色。示例:"500: 255,0,0", "700: 0,255,0" , "900: 0,0,255"。
  56489. * @param {number} [options.brightness] 影像显示的亮度。数值范围为-100到100,增加亮度为正,降低亮度为负。
  56490. * @param {number} [options.contrast] 影像显示的对比度。数值范围为-100到100,增加对比度为正,降低对比度为负。
  56491. * @param {string} [options.noData] 影像的无值。影像为多波段时,通过逗号分隔 R,G,B 颜色通道对应波段的无值。
  56492. * @param {string} [options.noDataColor] 影像的无值的显示颜色,支持RGB颜色,例如:255,0,0(红色),那么无值将以指定的红色显示。
  56493. * @param {boolean} [options.noDataTransparent] 无值是否透明显示,true表示透明显示无值;否则为false。
  56494. * @param {string} [options.backgroundValue] 影像的背景值。影像为多波段时,通过逗号分隔 R,G,B 颜色通道对应波段的背景值。
  56495. * @param {string} [options.backgroundColor] 指定背景值的颜色。支持指定RGB颜色,例如:255,0,0(红色),那么背景值将以指定的红色显示。
  56496. * @param {boolean} [options.backgroundTransparent] 背景值是否透明显示,true表示透明显示背景值;否则为false。
  56497. * @param {Array.<ImageGFHillShade|ImageGFSlope|ImageGFAspect|ImageGFOrtho>} [options.gridFunctions] 栅格函数链。
  56498. * @usage
  56499. */
  56500. var ImageRenderingRule = /*#__PURE__*/function () {
  56501. function ImageRenderingRule(options) {
  56502. ImageRenderingRule_classCallCheck(this, ImageRenderingRule);
  56503. /**
  56504. * @description 影像显示模式,其中:Composite表示多波段组合显示;Stretched表示单波段拉伸显示。
  56505. * @member {ImageRenderingRule.DisplayMode} ImageRenderingRule.prototype.displayMode
  56506. */
  56507. this.displayMode = undefined;
  56508. /**
  56509. * @description 影像显示的波段或者波段组合。该参数为一个数组,数组元素为波段索引号。若影像的显示模式为Stretched,该属性指定一个显示的波段;若影像的显示模式为Composite,该属性为组合的波段索引号,例如:属性值4,3,2表示采用4波段、3波段、2波段分别对应 R、G、B颜色通道进行组合显示。
  56510. * @member {string} ImageRenderingRule.prototype.displayBands
  56511. */
  56512. this.displayBands = undefined;
  56513. /**
  56514. * @description 影像的拉伸参数。
  56515. * @member {ImageStretchOption} ImageRenderingRule.prototype.stretchOption
  56516. */
  56517. this.stretchOption = undefined;
  56518. /**
  56519. * @description 影像显示时使用的插值算法。
  56520. * @member {ImageRenderingRule.InterpolationMode} ImageRenderingRule.prototype.interpolationMode
  56521. */
  56522. this.interpolationMode = undefined;
  56523. /**
  56524. * @description 影像拉伸显示的颜色方案。颜色方案为RGBA颜色数组。RGBA是代表Red(红色)Green(绿色)Blue(蓝色)和Alpha的色彩空间。Alpha值可以省略不写,表示完全不透明。Alpha通道表示不透明度参数,若该值为0表示完全透明。例如:"255,0,0","0,255,0","0,0,255" 表示由红色、绿色、蓝色三种颜色构成的色带。
  56525. * @member {Array.<string>} ImageRenderingRule.prototype.colorScheme
  56526. */
  56527. this.colorScheme = undefined;
  56528. /**
  56529. * @description 影像的颜色表。颜色表为栅格值与RGBA颜色值的对照表。RGBA是代表Red(红色)Green(绿色)Blue(蓝色)和Alpha的色彩空间。Alpha值可以省略不写,表示完全不透明。Alpha通道表示不透明度参数,若该值为0表示完全透明。以下示例表示该颜色对照表由三组构成,第一组高程值为500,对应的颜色为红色;第二组高程值为700,对应的颜色为绿色;第三组高程值为700,对应的颜色为蓝色。示例:"500: 255,0,0", "700: 0,255,0" , "900: 0,0,255"
  56530. * @member {Array.<string>} ImageRenderingRule.prototype.colorTable
  56531. */
  56532. this.colorTable = undefined;
  56533. /**
  56534. * @description 影像显示的亮度。数值范围为-100到100,增加亮度为正,降低亮度为负。
  56535. * @member {number} ImageRenderingRule.prototype.brightness
  56536. */
  56537. this.brightness = undefined;
  56538. /**
  56539. * @description 影像显示的对比度。数值范围为-100到100,增加对比度为正,降低对比度为负。
  56540. * @member {number} ImageRenderingRule.prototype.contrast
  56541. */
  56542. this.contrast = undefined;
  56543. /**
  56544. * @description 影像的无值。影像为多波段时,通过逗号分隔 R,G,B 颜色通道对应波段的无值。
  56545. * @member {string} ImageRenderingRule.prototype.noData
  56546. */
  56547. this.noData = undefined;
  56548. /**
  56549. * @description 影像的无值的显示颜色,支持RGB颜色,例如:255,0,0(红色),那么无值将以指定的红色显示。
  56550. * @member {string} ImageRenderingRule.prototype.noDataColor
  56551. */
  56552. this.noDataColor = undefined;
  56553. /**
  56554. * @description 无值是否透明显示,true表示透明显示无值;否则为false。
  56555. * @member {boolean} ImageRenderingRule.prototype.noDataTransparent
  56556. */
  56557. this.noDataTransparent = undefined;
  56558. /**
  56559. * @description 影像的背景值。影像为多波段时,通过逗号分隔 R,G,B 颜色通道对应波段的背景值。
  56560. * @member {string} ImageRenderingRule.prototype.backgroundValue
  56561. */
  56562. this.backgroundValue = undefined;
  56563. /**
  56564. * @description 指定背景值的颜色。支持指定RGB颜色,例如:255,0,0(红色),那么背景值将以指定的红色显示。
  56565. * @member {string} ImageRenderingRule.prototype.backgroundColor
  56566. */
  56567. this.backgroundColor = undefined;
  56568. /**
  56569. * @description 背景值是否透明显示,true表示透明显示背景值;否则为false。
  56570. * @member {boolean} ImageRenderingRule.prototype.backgroundTransparent
  56571. */
  56572. this.backgroundTransparent = undefined;
  56573. /**
  56574. * @description 栅格函数选项,通过应用栅格函数,可以对影像进行快速显示处理。
  56575. * @member {Array.<ImageGFHillShade|ImageGFSlope|ImageGFAspect|ImageGFOrtho>} ImageRenderingRule.prototype.gridFunctions
  56576. */
  56577. this.gridFunctions = undefined;
  56578. this.CLASS_NAME = 'SuperMap.ImageRenderingRule';
  56579. Util_Util.extend(this, options);
  56580. }
  56581. /**
  56582. * @function ImageRenderingRule.prototype.destroy
  56583. * @description 释放资源,将引用资源的属性置空。
  56584. */
  56585. ImageRenderingRule_createClass(ImageRenderingRule, [{
  56586. key: "destroy",
  56587. value: function destroy() {
  56588. var me = this;
  56589. me.displayMode = undefined;
  56590. me.displayBands = undefined;
  56591. me.stretchOption = undefined;
  56592. me.interpolationMode = undefined;
  56593. me.colorScheme = undefined;
  56594. me.colorTable = undefined;
  56595. me.brightness = undefined;
  56596. me.contrast = undefined;
  56597. me.noData = undefined;
  56598. me.noDataColor = undefined;
  56599. me.noDataTransparent = undefined;
  56600. me.backgroundValue = undefined;
  56601. me.backgroundColor = undefined;
  56602. me.backgroundTransparent = undefined;
  56603. me.gridFuncOptions = undefined;
  56604. }
  56605. /**
  56606. * @function ImageRenderingRule.prototype.constructFromObject
  56607. * @description 目标对象新增该类的可选参数。
  56608. * @param {Object} data 要转换的数据。
  56609. * @param {ImageRenderingRule} obj 返回的模型。
  56610. * @return {ImageRenderingRule} 返回结果。
  56611. */
  56612. }], [{
  56613. key: "constructFromObject",
  56614. value: function constructFromObject(data, obj) {
  56615. if (data) {
  56616. obj = obj || new ImageRenderingRule();
  56617. if (data.hasOwnProperty('displayMode')) {
  56618. obj.displayMode = data.displayMode;
  56619. }
  56620. if (data.hasOwnProperty('displayBands')) {
  56621. obj.displayBands = data.displayBands;
  56622. }
  56623. if (data.hasOwnProperty('stretchOption')) {
  56624. obj.stretchOption = ImageStretchOption.constructFromObject && ImageStretchOption.constructFromObject(data.stretchOption, {}) || data.stretchOption;
  56625. }
  56626. if (data.hasOwnProperty('interpolationMode')) {
  56627. obj.interpolationMode = data.interpolationMode;
  56628. }
  56629. if (data.hasOwnProperty('colorScheme')) {
  56630. obj.colorScheme = data.colorScheme;
  56631. }
  56632. if (data.hasOwnProperty('colorTable')) {
  56633. obj.colorTable = data.colorTable;
  56634. }
  56635. if (data.hasOwnProperty('brightness')) {
  56636. obj.brightness = data.brightness;
  56637. }
  56638. if (data.hasOwnProperty('contrast')) {
  56639. obj.contrast = data.contrast;
  56640. }
  56641. if (data.hasOwnProperty('noData')) {
  56642. obj.noData = data.noData;
  56643. }
  56644. if (data.hasOwnProperty('noDataColor')) {
  56645. obj.noDataColor = data.noDataColor;
  56646. }
  56647. if (data.hasOwnProperty('backgroundValue')) {
  56648. obj.backgroundValue = data.backgroundValue;
  56649. }
  56650. if (data.hasOwnProperty('noDataTransparent')) {
  56651. obj.noDataTransparent = data.noDataTransparent;
  56652. }
  56653. if (data.hasOwnProperty('backgroundColor')) {
  56654. obj.backgroundColor = data.backgroundColor;
  56655. }
  56656. if (data.hasOwnProperty('backgroundTransparent')) {
  56657. obj.backgroundTransparent = data.backgroundTransparent;
  56658. }
  56659. if (data.hasOwnProperty('gridFunctions')) {
  56660. obj.gridFunctions = data.gridFunctions;
  56661. }
  56662. }
  56663. return obj;
  56664. }
  56665. }]);
  56666. return ImageRenderingRule;
  56667. }();
  56668. /**
  56669. * @enum DisplayMode
  56670. * @description 影像显示模式。
  56671. * @memberOf ImageRenderingRule
  56672. * @readonly
  56673. * @type {string}
  56674. */
  56675. ImageRenderingRule.DisplayMode = {
  56676. COMPOSITE: 'COMPOSITE',
  56677. STRETCHED: 'Stretched'
  56678. };
  56679. /**
  56680. * @enum InterpolationMode
  56681. * @description 影像显示时使用的插值算法枚举。
  56682. * @memberOf ImageRenderingRule
  56683. * @readonly
  56684. * @type {string}
  56685. */
  56686. ImageRenderingRule.InterpolationMode = {
  56687. /** 最邻近插值模式。 */
  56688. NEARESTNEIGHBOR: 'NEARESTNEIGHBOR',
  56689. /** 高质量的双线性插值模式。 */
  56690. HIGHQUALITYBILINEAR: 'HIGHQUALITYBILINEAR',
  56691. /** 默认插值模式。 */
  56692. DEFAULT: 'DEFAULT'
  56693. };
  56694. ;// CONCATENATED MODULE: ./src/common/iServer/ImageGFHillShade.js
  56695. function ImageGFHillShade_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56696. function ImageGFHillShade_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  56697. function ImageGFHillShade_createClass(Constructor, protoProps, staticProps) { if (protoProps) ImageGFHillShade_defineProperties(Constructor.prototype, protoProps); if (staticProps) ImageGFHillShade_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  56698. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  56699. * This program are made available under the terms of the Apache License, Version 2.0
  56700. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56701. /**
  56702. * @class ImageGFHillShade
  56703. * @deprecatedclass SuperMap.ImageGFHillShade
  56704. * @classdesc 栅格函数对象:对DEM数据生成三维晕渲图。
  56705. * @category iServer Image
  56706. * @param {Object} options - 可选参数。
  56707. * @param {string} [options.girdFuncName='GFHillShade'] 栅格函数名称,参数值为:GFHillShade。
  56708. * @param {number} [options.Azimuth = 315] 光源方位角。用于确定光源的方向,是从光源所在位置的正北方向线起,依顺时针方向到光源与目标方向线的夹角,范围为 0-360 度,以正北方向为 0 度,依顺时针方向递增。默认值为:315。
  56709. * @param {number} [options.Altitude = 45] 光源高度角。用于确定光源照射的倾斜角度,是光源与目标的方向线与水平面间的夹角,范围为 0-90 度。当光源高度角为 90 度时,光源正射地表。默认值为:45。
  56710. * @param {number} [options.ZFactor = 1] 高程缩放系数。如果设置为 1.0,表示不缩放。默认值为:1。
  56711. * @usage
  56712. */
  56713. var ImageGFHillShade = /*#__PURE__*/function () {
  56714. function ImageGFHillShade(options) {
  56715. ImageGFHillShade_classCallCheck(this, ImageGFHillShade);
  56716. /**
  56717. * @description 栅格函数名称,参数值为:GFHillShade。
  56718. * @member {string} ImageGFHillShade.prototype.girdFuncName
  56719. * @default 'GFHillShade'
  56720. */
  56721. this.girdFuncName = 'GFHillShade';
  56722. /**
  56723. * @description 光源方位角。用于确定光源的方向,是从光源所在位置的正北方向线起,依顺时针方向到光源与目标方向线的夹角,范围为 0-360 度,以正北方向为 0 度,依顺时针方向递增。默认值为:315。
  56724. * @member {number} ImageGFHillShade.prototype.Azimuth
  56725. */
  56726. this.Azimuth = 315;
  56727. /**
  56728. * @description 光源高度角。用于确定光源照射的倾斜角度,是光源与目标的方向线与水平面间的夹角,范围为 0-90 度。当光源高度角为 90 度时,光源正射地表。默认值为:45。
  56729. * @member {number} ImageGFHillShade.prototype.Altitude
  56730. */
  56731. this.Altitude = 45;
  56732. /**
  56733. * @description 高程缩放系数。如果设置为 1.0,表示不缩放。默认值为:1。
  56734. * @member {number} ImageGFHillShade.prototype.ZFactor
  56735. */
  56736. this.ZFactor = 1;
  56737. this.CLASS_NAME = 'SuperMap.ImageGFHillShade';
  56738. Util_Util.extend(this, options);
  56739. }
  56740. /**
  56741. * @function ImageGFHillShade.prototype.destroy
  56742. * @description 释放资源,将引用资源的属性置空。
  56743. */
  56744. ImageGFHillShade_createClass(ImageGFHillShade, [{
  56745. key: "destroy",
  56746. value: function destroy() {
  56747. var me = this;
  56748. me.girdFuncName = 'GFHillShade';
  56749. me.Azimuth = 315;
  56750. me.Altitude = 45;
  56751. me.ZFactor = 1;
  56752. }
  56753. /**
  56754. * @function ImageGFHillShade.prototype.constructFromObject
  56755. * @description 目标对象新增该类的可选参数。
  56756. * @param {Object} data 要转换的数据。
  56757. * @param {ImageGFHillShade} obj 返回的模型。
  56758. * @return {ImageGFHillShade} 返回结果。
  56759. */
  56760. }], [{
  56761. key: "constructFromObject",
  56762. value: function constructFromObject(data, obj) {
  56763. if (data) {
  56764. obj = obj || new ImageGFHillShade();
  56765. if (data.hasOwnProperty('girdFuncName')) {
  56766. obj.girdFuncName = data.girdFuncName;
  56767. }
  56768. if (data.hasOwnProperty('Azimuth')) {
  56769. obj.Azimuth = data.Azimuth;
  56770. }
  56771. if (data.hasOwnProperty('Altitude')) {
  56772. obj.Altitude = data.Altitude;
  56773. }
  56774. if (data.hasOwnProperty('ZFactor')) {
  56775. obj.ZFactor = data.ZFactor;
  56776. }
  56777. }
  56778. return obj;
  56779. }
  56780. }]);
  56781. return ImageGFHillShade;
  56782. }();
  56783. ;// CONCATENATED MODULE: ./src/common/iServer/ImageGFAspect.js
  56784. function ImageGFAspect_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56785. function ImageGFAspect_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  56786. function ImageGFAspect_createClass(Constructor, protoProps, staticProps) { if (protoProps) ImageGFAspect_defineProperties(Constructor.prototype, protoProps); if (staticProps) ImageGFAspect_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  56787. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  56788. * This program are made available under the terms of the Apache License, Version 2.0
  56789. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56790. /**
  56791. * @class ImageGFAspect
  56792. * @deprecatedclass SuperMap.ImageGFAspect
  56793. * @classdesc 栅格函数对象:对DEM数据生成坡向渲图。
  56794. * @category iServer Image
  56795. * @param {Object} options -可选参数。
  56796. * @param {string} [options.girdFuncName='GFAspect'] 栅格函数名称,参数值为:GFAspect。
  56797. * @param {number} [options.Azimuth] 光源方位角,固定为360度。
  56798. * @usage
  56799. */
  56800. var ImageGFAspect = /*#__PURE__*/function () {
  56801. function ImageGFAspect(options) {
  56802. ImageGFAspect_classCallCheck(this, ImageGFAspect);
  56803. /**
  56804. * @description 栅格函数名称,参数值为:GFAspect。
  56805. * @member {string} ImageGFAspect.prototype.girdFuncName
  56806. * @default 'GFAspect'
  56807. */
  56808. this.girdFuncName = 'GFAspect';
  56809. /**
  56810. * @description 光源方位角,固定为360度。
  56811. * @member {number} ImageGFAspect.prototype.Azimuth
  56812. */
  56813. this.Azimuth = undefined;
  56814. this.CLASS_NAME = 'SuperMap.ImageGFAspect';
  56815. Util_Util.extend(this, options);
  56816. }
  56817. /**
  56818. * @function ImageGFAspect.prototype.destroy
  56819. * @description 释放资源,将引用资源的属性置空。
  56820. */
  56821. ImageGFAspect_createClass(ImageGFAspect, [{
  56822. key: "destroy",
  56823. value: function destroy() {
  56824. var me = this;
  56825. me.girdFuncName = 'GFAspect';
  56826. me.Azimuth = undefined;
  56827. }
  56828. /**
  56829. * @function ImageGFAspect.prototype.constructFromObject
  56830. * @description 目标对象新增该类的可选参数。
  56831. * @param {Object} data 要转换的数据。
  56832. * @param {ImageGFAspect} obj 返回的模型。
  56833. * @return {ImageGFAspect} 返回结果。
  56834. */
  56835. }], [{
  56836. key: "constructFromObject",
  56837. value: function constructFromObject(data, obj) {
  56838. if (data) {
  56839. obj = obj || new ImageGFAspect();
  56840. if (data.hasOwnProperty('girdFuncName')) {
  56841. obj.girdFuncName = data.girdFuncName;
  56842. }
  56843. if (data.hasOwnProperty('Azimuth')) {
  56844. obj.Azimuth = data.Azimuth;
  56845. }
  56846. }
  56847. return obj;
  56848. }
  56849. }]);
  56850. return ImageGFAspect;
  56851. }();
  56852. ;// CONCATENATED MODULE: ./src/common/iServer/ImageGFOrtho.js
  56853. function ImageGFOrtho_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56854. function ImageGFOrtho_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  56855. function ImageGFOrtho_createClass(Constructor, protoProps, staticProps) { if (protoProps) ImageGFOrtho_defineProperties(Constructor.prototype, protoProps); if (staticProps) ImageGFOrtho_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  56856. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  56857. * This program are made available under the terms of the Apache License, Version 2.0
  56858. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56859. /**
  56860. * @class ImageGFOrtho
  56861. * @deprecatedclass SuperMap.ImageGFOrtho
  56862. * @classdesc 栅格函数对象:对DEM数据生成三维晕渲图。该栅格函数不需要输入参数,采用系统默认设置。
  56863. * @category iServer Image
  56864. * @param {Object} options - 可选参数。
  56865. * @param {string} [options.girdFuncName='GFOrtho'] 栅格函数名称,参数值为:GFOrtho。
  56866. * @usage
  56867. */
  56868. var ImageGFOrtho = /*#__PURE__*/function () {
  56869. function ImageGFOrtho(options) {
  56870. ImageGFOrtho_classCallCheck(this, ImageGFOrtho);
  56871. /**
  56872. * @description 栅格函数名称,参数值为:GFOrtho。
  56873. * @member {string} ImageGFOrtho.prototype.girdFuncName
  56874. * @default 'GFOrtho'
  56875. */
  56876. this.girdFuncName = 'GFOrtho';
  56877. this.CLASS_NAME = 'SuperMap.ImageGFOrtho';
  56878. Util_Util.extend(this, options);
  56879. }
  56880. /**
  56881. * @function ImageGFOrtho.prototype.destroy
  56882. * @description 释放资源,将引用资源的属性置空。
  56883. */
  56884. ImageGFOrtho_createClass(ImageGFOrtho, [{
  56885. key: "destroy",
  56886. value: function destroy() {
  56887. var me = this;
  56888. me.girdFuncName = 'GFOrtho';
  56889. }
  56890. /**
  56891. * @function ImageGFOrtho.prototype.constructFromObject
  56892. * @description 目标对象新增该类的可选参数。
  56893. * @param {Object} data 要转换的数据。
  56894. * @param {ImageGFOrtho} obj 返回的模型。
  56895. * @return {ImageGFOrtho} 返回结果。
  56896. */
  56897. }], [{
  56898. key: "constructFromObject",
  56899. value: function constructFromObject(data, obj) {
  56900. if (data) {
  56901. obj = obj || new ImageGFOrtho();
  56902. if (data.hasOwnProperty('girdFuncName')) {
  56903. obj.girdFuncName = data.girdFuncName;
  56904. }
  56905. }
  56906. return obj;
  56907. }
  56908. }]);
  56909. return ImageGFOrtho;
  56910. }();
  56911. ;// CONCATENATED MODULE: ./src/common/iServer/ImageGFSlope.js
  56912. function ImageGFSlope_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56913. function ImageGFSlope_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  56914. function ImageGFSlope_createClass(Constructor, protoProps, staticProps) { if (protoProps) ImageGFSlope_defineProperties(Constructor.prototype, protoProps); if (staticProps) ImageGFSlope_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  56915. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  56916. * This program are made available under the terms of the Apache License, Version 2.0
  56917. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56918. /**
  56919. * @class ImageGFSlope
  56920. * @deprecatedclass SuperMap.ImageGFSlope
  56921. * @classdesc 栅格函数对象:对DEM数据生成坡度图。
  56922. * @category iServer Image
  56923. * @param {Object} options - 可选参数。
  56924. * @param {string} [options.girdFuncName='GFSlope'] 栅格函数名称,参数值为:GFSlope。
  56925. * @param {number} [options.Altitude = 45] 光源高度角。用于确定光源照射的倾斜角度,是光源与目标的方向线与水平面间的夹角,范围为 0-90 度。当光源高度角为 90 度时,光源正射地表。默认值为:45。
  56926. * @param {number} [options.ZFactor = 1] 高程缩放系数。如果设置为 1.0,表示不缩放。默认值为:1。
  56927. * @usage
  56928. */
  56929. var ImageGFSlope = /*#__PURE__*/function () {
  56930. function ImageGFSlope(options) {
  56931. ImageGFSlope_classCallCheck(this, ImageGFSlope);
  56932. /**
  56933. * @description 栅格函数名称,参数值为:GFSlope。
  56934. * @member {string} ImageGFSlope.prototype.girdFuncName
  56935. * @default 'GFSlope'
  56936. */
  56937. this.girdFuncName = 'GFSlope';
  56938. /**
  56939. * @description 光源高度角。用于确定光源照射的倾斜角度,是光源与目标的方向线与水平面间的夹角,范围为 0-90 度。当光源高度角为 90 度时,光源正射地表。默认值为:45。
  56940. * @member {number} ImageGFSlope.prototype.Altitude
  56941. */
  56942. this.Altitude = 45;
  56943. /**
  56944. * @description 高程缩放系数。如果设置为 1.0,表示不缩放。默认值为:1。
  56945. * @member {number} ImageGFSlope.prototype.ZFactor
  56946. */
  56947. this.ZFactor = 1;
  56948. this.CLASS_NAME = 'SuperMap.ImageGFSlope';
  56949. Util_Util.extend(this, options);
  56950. }
  56951. /**
  56952. * @function ImageGFSlope.prototype.destroy
  56953. * @description 释放资源,将引用资源的属性置空。
  56954. */
  56955. ImageGFSlope_createClass(ImageGFSlope, [{
  56956. key: "destroy",
  56957. value: function destroy() {
  56958. var me = this;
  56959. me.girdFuncName = 'GFSlope';
  56960. me.Altitude = 45;
  56961. me.ZFactor = 1;
  56962. }
  56963. /**
  56964. * @function ImageGFSlope.prototype.constructFromObject
  56965. * @description 目标对象新增该类的可选参数。
  56966. * @param {Object} data 要转换的数据。
  56967. * @param {ImageGFSlope} obj 返回的模型。
  56968. * @return {ImageGFSlope} 返回结果。
  56969. */
  56970. }], [{
  56971. key: "constructFromObject",
  56972. value: function constructFromObject(data, obj) {
  56973. if (data) {
  56974. obj = obj || new ImageGFSlope();
  56975. if (data.hasOwnProperty('girdFuncName')) {
  56976. obj.girdFuncName = data.girdFuncName;
  56977. }
  56978. if (data.hasOwnProperty('Altitude')) {
  56979. obj.Altitude = data.Altitude;
  56980. }
  56981. if (data.hasOwnProperty('ZFactor')) {
  56982. obj.ZFactor = data.ZFactor;
  56983. }
  56984. }
  56985. return obj;
  56986. }
  56987. }]);
  56988. return ImageGFSlope;
  56989. }();
  56990. ;// CONCATENATED MODULE: ./src/common/iServer/KnowledgeGraphNodeParameter.js
  56991. function KnowledgeGraphNodeParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56992. function KnowledgeGraphNodeParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  56993. function KnowledgeGraphNodeParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) KnowledgeGraphNodeParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) KnowledgeGraphNodeParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  56994. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  56995. * This program are made available under the terms of the Apache License, Version 2.0
  56996. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56997. /**
  56998. * @private
  56999. * @class KnowledgeGraphNodeParameter
  57000. * @deprecatedclass SuperMap.KnowledgeGraphNodeParameter
  57001. * @classdesc 知识图谱实体的参数设置。
  57002. * @category iServer KnowledgeGraph
  57003. * @version 11.1.0
  57004. * @param {Object} options - 参数。
  57005. * @param {string} options.id - 实体id。
  57006. * @param {Array.<string>} [options.labels] - 实体分类。
  57007. * @param {Object} [options.properties] - 属性。
  57008. * @usage
  57009. */
  57010. // {
  57011. // "id": 5348024557502471,
  57012. // "properties": {
  57013. // "server": "test1",
  57014. // "_labelfieldname": "FEATUREGUID",
  57015. // "_entityname": "院落",
  57016. // "_bindfindid": "院落@ST_YARDA@1",
  57017. // "FEATUREGUID": "{409E615B-A545-4E07-872D-B12EDA0B4A1A}",
  57018. // "_findid": 1,
  57019. // "ENTITYNAME": "公共管理与公共服务"
  57020. // },
  57021. // "labels": ["院落"]
  57022. // }
  57023. var KnowledgeGraphNodeParameter = /*#__PURE__*/(/* unused pure expression or super */ null && (function () {
  57024. function KnowledgeGraphNodeParameter(options) {
  57025. KnowledgeGraphNodeParameter_classCallCheck(this, KnowledgeGraphNodeParameter);
  57026. /**
  57027. * @member {string} KnowledgeGraphNodeParameter.prototype.id
  57028. * @description 实体ID。
  57029. */
  57030. this.id = null;
  57031. /**
  57032. * @member {Array.<string>} KnowledgeGraphNodeParameter.prototype.labels
  57033. * @description 实体分类。
  57034. */
  57035. this.labels = null;
  57036. /**
  57037. * @member {Object} KnowledgeGraphNodeParameter.prototype.properties
  57038. * @description 实体属性。
  57039. */
  57040. this.properties = null;
  57041. this.CLASS_NAME = 'SuperMap.KnowledgeGraphNodeParameter';
  57042. Util.extend(this, options);
  57043. }
  57044. KnowledgeGraphNodeParameter_createClass(KnowledgeGraphNodeParameter, [{
  57045. key: "destroy",
  57046. value: function destroy() {
  57047. var me = this;
  57048. me.id = null;
  57049. me.labels = null;
  57050. me.properties = null;
  57051. }
  57052. }]);
  57053. return KnowledgeGraphNodeParameter;
  57054. }()));
  57055. ;// CONCATENATED MODULE: ./src/common/iServer/KnowledgeGraphEdgeParameter.js
  57056. function KnowledgeGraphEdgeParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  57057. function KnowledgeGraphEdgeParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  57058. function KnowledgeGraphEdgeParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) KnowledgeGraphEdgeParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) KnowledgeGraphEdgeParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  57059. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  57060. * This program are made available under the terms of the Apache License, Version 2.0
  57061. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  57062. /**
  57063. * @private
  57064. * @class KnowledgeGraphEdgeParameter
  57065. * @deprecatedclass SuperMap.KnowledgeGraphEdgeParameter
  57066. * @classdesc 知识图谱关系的参数设置。
  57067. * @category iServer KnowledgeGraph
  57068. * @version 11.1.0
  57069. * @param {Object} options - 参数。
  57070. * @param {string} options.id - 边id。
  57071. * @param {string} options.start - 开始实体id。
  57072. * @param {string} options.end - 结束实体id。
  57073. * @param {string} [options.type] - 标签,关系。
  57074. * @param {Object} [options.properties] - 属性。
  57075. * @usage
  57076. */
  57077. var KnowledgeGraphEdgeParameter = /*#__PURE__*/(/* unused pure expression or super */ null && (function () {
  57078. function KnowledgeGraphEdgeParameter(options) {
  57079. KnowledgeGraphEdgeParameter_classCallCheck(this, KnowledgeGraphEdgeParameter);
  57080. /**
  57081. * @member {string} KnowledgeGraphEdgeParameter.prototype.id
  57082. * @description 边id。
  57083. */
  57084. this.id = null;
  57085. /**
  57086. * @member {string} KnowledgeGraphEdgeParameter.prototype.start
  57087. * @description 开始实体id。
  57088. */
  57089. this.start = null;
  57090. /**
  57091. * @member {string} KnowledgeGraphEdgeParameter.prototype.end
  57092. * @description 结束实体id。
  57093. */
  57094. this.end = null;
  57095. /**
  57096. * @member {string} KnowledgeGraphEdgeParameter.prototype.type
  57097. * @description 标签,关系。
  57098. */
  57099. this.type = null;
  57100. /**
  57101. * @member {Object} KnowledgeGraphEdgeParameter.prototype.properties
  57102. * @description 实体属性。
  57103. */
  57104. this.properties = null;
  57105. this.CLASS_NAME = 'SuperMap.KnowledgeGraphEdgeParameter';
  57106. Util.extend(this, options);
  57107. }
  57108. KnowledgeGraphEdgeParameter_createClass(KnowledgeGraphEdgeParameter, [{
  57109. key: "destroy",
  57110. value: function destroy() {
  57111. var me = this;
  57112. me.id = null;
  57113. me.start = null;
  57114. me.end = null;
  57115. me.type = null;
  57116. me.properties = null;
  57117. }
  57118. }]);
  57119. return KnowledgeGraphEdgeParameter;
  57120. }()));
  57121. ;// CONCATENATED MODULE: ./src/common/iServer/KnowledgeGraphService.js
  57122. function KnowledgeGraphService_typeof(obj) { "@babel/helpers - typeof"; return KnowledgeGraphService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, KnowledgeGraphService_typeof(obj); }
  57123. function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == KnowledgeGraphService_typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
  57124. function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
  57125. function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  57126. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  57127. function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
  57128. function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
  57129. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  57130. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
  57131. function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
  57132. function KnowledgeGraphService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  57133. function KnowledgeGraphService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  57134. function KnowledgeGraphService_createClass(Constructor, protoProps, staticProps) { if (protoProps) KnowledgeGraphService_defineProperties(Constructor.prototype, protoProps); if (staticProps) KnowledgeGraphService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  57135. function KnowledgeGraphService_get() { if (typeof Reflect !== "undefined" && Reflect.get) { KnowledgeGraphService_get = Reflect.get.bind(); } else { KnowledgeGraphService_get = function _get(target, property, receiver) { var base = KnowledgeGraphService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return KnowledgeGraphService_get.apply(this, arguments); }
  57136. function KnowledgeGraphService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = KnowledgeGraphService_getPrototypeOf(object); if (object === null) break; } return object; }
  57137. function KnowledgeGraphService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) KnowledgeGraphService_setPrototypeOf(subClass, superClass); }
  57138. function KnowledgeGraphService_setPrototypeOf(o, p) { KnowledgeGraphService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return KnowledgeGraphService_setPrototypeOf(o, p); }
  57139. function KnowledgeGraphService_createSuper(Derived) { var hasNativeReflectConstruct = KnowledgeGraphService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = KnowledgeGraphService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = KnowledgeGraphService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return KnowledgeGraphService_possibleConstructorReturn(this, result); }; }
  57140. function KnowledgeGraphService_possibleConstructorReturn(self, call) { if (call && (KnowledgeGraphService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return KnowledgeGraphService_assertThisInitialized(self); }
  57141. function KnowledgeGraphService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  57142. function KnowledgeGraphService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  57143. function KnowledgeGraphService_getPrototypeOf(o) { KnowledgeGraphService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return KnowledgeGraphService_getPrototypeOf(o); }
  57144. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  57145. * This program are made available under the terms of the Apache License, Version 2.0
  57146. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  57147. /**
  57148. * @class KnowledgeGraphService
  57149. * @category iServer KnowledgeGraph
  57150. * @classdesc 知识图谱服务类
  57151. * @version 11.1.0
  57152. * @extends {ProcessingServiceBase}
  57153. * @param {string} url - 服务地址。
  57154. * @param {Object} options - 可选参数。
  57155. * @param {string} [options.proxy] - 服务代理地址。
  57156. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  57157. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  57158. * @param {Object} [options.headers] - 请求头。
  57159. * @usage
  57160. */
  57161. var KnowledgeGraphService_KnowledgeGraphService = /*#__PURE__*/function (_CommonServiceBase) {
  57162. KnowledgeGraphService_inherits(KnowledgeGraphService, _CommonServiceBase);
  57163. var _super = KnowledgeGraphService_createSuper(KnowledgeGraphService);
  57164. function KnowledgeGraphService(url, options) {
  57165. var _this;
  57166. KnowledgeGraphService_classCallCheck(this, KnowledgeGraphService);
  57167. _this = _super.call(this, url, options);
  57168. _this.options = options || {};
  57169. _this.eventCount = 0;
  57170. _this.CLASS_NAME = 'SuperMap.KnowledgeGraphService';
  57171. return _this;
  57172. }
  57173. /**
  57174. * @function KnowledgeGraphService.prototype.destroy
  57175. * @override
  57176. */
  57177. KnowledgeGraphService_createClass(KnowledgeGraphService, [{
  57178. key: "destroy",
  57179. value: function destroy() {
  57180. KnowledgeGraphService_get(KnowledgeGraphService_getPrototypeOf(KnowledgeGraphService.prototype), "destroy", this).call(this);
  57181. }
  57182. /**
  57183. * @function KnowledgeGraphService.prototype.query
  57184. * @description 通过查询语句查询知识图谱数据。
  57185. * @param {string} params - 查询条件。
  57186. * @param {RequestCallback} callback 回调函数。
  57187. */
  57188. }, {
  57189. key: "query",
  57190. value: function query(params, callback) {
  57191. var paramKey = 'cypherQuery';
  57192. var url = Util_Util.urlAppend(this.url + '/query.json', "".concat(paramKey, "=").concat(params));
  57193. this.processAsync({
  57194. url: url,
  57195. method: 'GET',
  57196. callback: callback
  57197. });
  57198. }
  57199. // /**
  57200. // * @function KnowledgeGraphService.prototype.queryById
  57201. // * @description 根据实体id查询关联节点。
  57202. // * @param {string} id - 实体id。
  57203. // * @param {RequestCallback} callback 回调函数。
  57204. // */
  57205. // queryById(id, callback) {
  57206. // const paramKey = 'cypherQuery';
  57207. // const url = Util.urlAppend(this.url + '/query.json', `${paramKey}=match p=(n)-[]-(m) where id(n)=${id} return p;`);
  57208. // this.processAsync({ url, method: 'GET', callback });
  57209. // }
  57210. // /**
  57211. // * @function KnowledgeGraphService.prototype.getMetaData
  57212. // * @description 获取元信息(展示所有实体类型和关系类型。)
  57213. // * @param {RequestCallback} callback 回调函数。
  57214. // */
  57215. // getMetaData(callback) {
  57216. // const url = this.url + 'management/metadata.json';
  57217. // this.processAsync({ url, method: 'GET', callback });
  57218. // }
  57219. /**
  57220. * @function KnowledgeGraphService.prototype.getGraphMaps
  57221. * @description 获取图谱列表
  57222. * @param {RequestCallback} callback 回调函数。
  57223. */
  57224. }, {
  57225. key: "getGraphMaps",
  57226. value: function getGraphMaps(callback) {
  57227. var url = this.url + '/graphmaps.json';
  57228. this.processAsync({
  57229. url: url,
  57230. method: 'GET',
  57231. callback: callback
  57232. });
  57233. }
  57234. /**
  57235. * @function KnowledgeGraphService.prototype.getGraphMap
  57236. * @description 获取图谱图序列化数据
  57237. * @param {string} graphMapName 图谱名称
  57238. * @param {RequestCallback} callback 回调函数
  57239. */
  57240. }, {
  57241. key: "getGraphMap",
  57242. value: function getGraphMap(graphMapName, callback) {
  57243. var url = this.url + "/graphmaps/".concat(graphMapName, ".json");
  57244. this.processAsync({
  57245. url: url,
  57246. method: 'GET',
  57247. callback: callback
  57248. });
  57249. }
  57250. /**
  57251. * @function KnowledgeGraphService.prototype.getGraphMapData
  57252. * @description 将iServer GraphMap服务的数据格式转换为KnowledgeGraph的数据格式。
  57253. * @param {string} graphMapName - 图谱名称
  57254. * @returns {Promise} Promise 对象。
  57255. */
  57256. }, {
  57257. key: "getGraphMapData",
  57258. value: function () {
  57259. var _getGraphMapData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(graphMapName) {
  57260. var data, graphMap, query, queries, expandQueries, _queries, j, cypherQuery, res;
  57261. return _regeneratorRuntime().wrap(function _callee$(_context) {
  57262. while (1) switch (_context.prev = _context.next) {
  57263. case 0:
  57264. data = [];
  57265. _context.next = 3;
  57266. return this._getGraphMapData(graphMapName);
  57267. case 3:
  57268. graphMap = _context.sent;
  57269. if (graphMap) {
  57270. _context.next = 6;
  57271. break;
  57272. }
  57273. return _context.abrupt("return");
  57274. case 6:
  57275. query = graphMap.dataContent.queries && graphMap.dataContent.queries.query || [];
  57276. queries = [];
  57277. if (typeof query === 'string') {
  57278. queries = [query];
  57279. } else {
  57280. queries = query;
  57281. }
  57282. expandQueries = this._getGraphMapExpandQuery(graphMap);
  57283. if (expandQueries.length) {
  57284. (_queries = queries).push.apply(_queries, _toConsumableArray(expandQueries));
  57285. }
  57286. j = 0;
  57287. case 12:
  57288. if (!(j < queries.length)) {
  57289. _context.next = 21;
  57290. break;
  57291. }
  57292. cypherQuery = queries[j];
  57293. _context.next = 16;
  57294. return this._queryDataBySql(cypherQuery);
  57295. case 16:
  57296. res = _context.sent;
  57297. data = data.concat([], res);
  57298. case 18:
  57299. j++;
  57300. _context.next = 12;
  57301. break;
  57302. case 21:
  57303. return _context.abrupt("return", {
  57304. data: data,
  57305. graphMap: graphMap
  57306. });
  57307. case 22:
  57308. case "end":
  57309. return _context.stop();
  57310. }
  57311. }, _callee, this);
  57312. }));
  57313. function getGraphMapData(_x) {
  57314. return _getGraphMapData2.apply(this, arguments);
  57315. }
  57316. return getGraphMapData;
  57317. }()
  57318. /**
  57319. * @private
  57320. * @function KnowledgeGraphService.prototype._getGraphMapExpandQuery
  57321. * @description 获取graphMap图谱展开节点的query条件
  57322. * @param {Object} graphMap -将iServer GraphMap图谱服务的数据
  57323. * @param {Array.<string>} 查询条件
  57324. */
  57325. }, {
  57326. key: "_getGraphMapExpandQuery",
  57327. value: function _getGraphMapExpandQuery(graphMap) {
  57328. var queries = [];
  57329. var expandIds = graphMap.dataContent.expand && JSON.parse(graphMap.dataContent.expand) || [];
  57330. expandIds.forEach(function (id) {
  57331. queries.push("match p=(n)-[]-(m) where id(n)=".concat(id, " return p;"));
  57332. });
  57333. return queries;
  57334. }
  57335. // /**
  57336. // * @private
  57337. // * @function KnowledgeGraphService.prototype.getEntities
  57338. // * @description 获取实体。
  57339. // * @param {Object} params - 查询条件。{type:'院落', count:1}
  57340. // * @param {number} [params.count] - 返回个数
  57341. // * @param {RequestCallback} callback 回调函数
  57342. // */
  57343. // getEntities(params, callback) {
  57344. // const url = Util.urlAppend(this.url + '/entities.json', params);
  57345. // this.processAsync({ url, params, method: 'GET', callback });
  57346. // }
  57347. // /**
  57348. // * @private
  57349. // * @function KnowledgeGraphService.prototype.getEdges
  57350. // * @description 获取实体。
  57351. // * @param {Object} params - 查询条件。{type:'院落', count:1}
  57352. // * @param {number} [params.count] - 返回个数
  57353. // * @param {RequestCallback} callback 回调函数
  57354. // */
  57355. // getEdges(params, callback) {
  57356. // const url = Util.urlAppend(this.url + '/edges.json', params);
  57357. // this.processAsync({ url, params, method: 'GET', callback });
  57358. // }
  57359. // /**
  57360. // * @private
  57361. // * @function KnowledgeGraphService.prototype.getEntities
  57362. // * @description 获取实体。
  57363. // * @param {number} id - 查询条件。{type:'院落', count:1}
  57364. // * @param {RequestCallback} callback 回调函数
  57365. // */
  57366. // deleteEntitiy(id, callback) {
  57367. // const url = Util.urlAppend(this.url + '/entities.json', `id=${id}`);
  57368. // this.processAsync({ url, method: 'DELETE', callback });
  57369. // }
  57370. // /**
  57371. // * @private
  57372. // * @function KnowledgeGraphService.prototype.addNode
  57373. // * @description 获取实体。
  57374. // * @param {Object} params - 查询条件
  57375. // * @param {number} [params.count] - 返回个数
  57376. // * @param {RequestCallback} callback 回调函数
  57377. // */
  57378. // addNode(params, callback) {
  57379. // if (!(params instanceof KnowledgeGraphNodeParameter)) {
  57380. // return;
  57381. // }
  57382. // const url = Util.urlAppend(this.url + '/entities.json', params);
  57383. // this.processAsync({ url, params, method: 'PUT', callback });
  57384. // }
  57385. // /**
  57386. // * @private
  57387. // * @function KnowledgeGraphService.prototype.addEdge
  57388. // * @description 获取实体。
  57389. // * @param {Object} params - 查询条件
  57390. // * @param {number} [params.count] - 返回个数
  57391. // * @param {RequestCallback} callback 回调函数
  57392. // */
  57393. // addEdge(params, callback) {
  57394. // if (!(params instanceof KnowledgeGraphEdgeParameter)) {
  57395. // return;
  57396. // }
  57397. // const url = Util.urlAppend(this.url + '/edges.json', params);
  57398. // this.processAsync({ url, params, method: 'PUT', callback });
  57399. // }
  57400. /**
  57401. * @function KnowledgeGraphService.prototype.processAsync
  57402. * @description 负责将客户端的动态分段服务参数传递到服务端。
  57403. * @param {string} url - 服务地址
  57404. * @param {Object} params - 参数
  57405. */
  57406. }, {
  57407. key: "processAsync",
  57408. value: function processAsync(_ref) {
  57409. var url = _ref.url,
  57410. params = _ref.params,
  57411. method = _ref.method,
  57412. callback = _ref.callback;
  57413. var eventId = ++this.eventCount;
  57414. var eventListeners = {
  57415. scope: this,
  57416. processCompleted: function processCompleted(result) {
  57417. if (eventId === result.result.eventId && callback) {
  57418. delete result.result.eventId;
  57419. callback(result);
  57420. this.events && this.events.un(eventListeners);
  57421. return false;
  57422. }
  57423. },
  57424. processFailed: function processFailed(result) {
  57425. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  57426. delete result.eventId;
  57427. callback(result);
  57428. this.events && this.events.un(eventListeners);
  57429. return false;
  57430. }
  57431. }
  57432. };
  57433. this.events.on(eventListeners);
  57434. var requestParams = {
  57435. method: method,
  57436. url: url,
  57437. scope: this,
  57438. success: function success(result, options) {
  57439. result.eventId = eventId;
  57440. this.serviceProcessCompleted(result, options);
  57441. },
  57442. failure: function failure(result, options) {
  57443. result.eventId = eventId;
  57444. this.serviceProcessFailed(result, options);
  57445. }
  57446. };
  57447. if (params) {
  57448. requestParams.params = params;
  57449. }
  57450. this.request(requestParams);
  57451. }
  57452. /**
  57453. * @private
  57454. * @function _getGraphMapData
  57455. * @description 获取图谱信息
  57456. * @param {string} graphMapName - 图谱名称
  57457. * @returns {Promise} Promise 对象
  57458. */
  57459. }, {
  57460. key: "_getGraphMapData",
  57461. value: function _getGraphMapData(graphMapName) {
  57462. var _this2 = this;
  57463. return new Promise(function (resolve, reject) {
  57464. _this2.getGraphMap(graphMapName, function (res) {
  57465. if (res.type === 'processFailed') {
  57466. reject(res.error);
  57467. } else {
  57468. if (res.result.data === '') {
  57469. reject('无数据');
  57470. } else {
  57471. resolve(res.result.graphMap);
  57472. }
  57473. }
  57474. });
  57475. });
  57476. }
  57477. /**
  57478. * @private
  57479. * @function _queryDataBySql
  57480. * @description 查询实体和关系数据。
  57481. * @param {string} cypherQuery - 查询语句
  57482. * @returns {Promise} Promise 对象。
  57483. */
  57484. }, {
  57485. key: "_queryDataBySql",
  57486. value: function _queryDataBySql(cypherQuery) {
  57487. var _this3 = this;
  57488. return new Promise(function (resolve, reject) {
  57489. _this3.query(cypherQuery, function (res) {
  57490. if (res.type === 'processFailed') {
  57491. reject(res.error);
  57492. } else {
  57493. resolve(res.result);
  57494. }
  57495. });
  57496. });
  57497. }
  57498. }]);
  57499. return KnowledgeGraphService;
  57500. }(CommonServiceBase);
  57501. ;// CONCATENATED MODULE: ./src/common/iServer/index.js
  57502. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  57503. * This program are made available under the terms of the Apache License, Version 2.0
  57504. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  57505. ;// CONCATENATED MODULE: ./src/common/online/OnlineResources.js
  57506. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  57507. * This program are made available under the terms of the Apache License, Version 2.0
  57508. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  57509. /**
  57510. * @enum ServiceStatus
  57511. * @category BaseTypes Constant
  57512. * @description 服务发布状态。
  57513. * @usage
  57514. * ```
  57515. * // 浏览器
  57516. * <script type="text/javascript" src="{cdn}"></script>
  57517. * <script>
  57518. * const result = {namespace}.ServiceStatus.DOES_NOT_INVOLVE;
  57519. *
  57520. * </script>
  57521. * // ES6 Import
  57522. * import { ServiceStatus } from '{npm}';
  57523. *
  57524. * const result = ServiceStatus.DOES_NOT_INVOLVE;
  57525. * ```
  57526. */
  57527. var ServiceStatus = {
  57528. /** 不涉及,不可发布。 */
  57529. DOES_NOT_INVOLVE: "DOES_NOT_INVOLVE",
  57530. /** 发布失败。 */
  57531. PUBLISH_FAILED: "PUBLISH_FAILED",
  57532. /** 已发布。 */
  57533. PUBLISHED: "PUBLISHED",
  57534. /** 正在发布。 */
  57535. PUBLISHING: "PUBLISHING",
  57536. /** 未发布。 */
  57537. UNPUBLISHED: "UNPUBLISHED",
  57538. /** 取消服务失败。 */
  57539. UNPUBLISHED_FAILED: "UNPUBLISHED_FAILED"
  57540. };
  57541. /**
  57542. * @enum DataItemOrderBy
  57543. * @category BaseTypes Constant
  57544. * @description 数据排序字段。
  57545. * @usage
  57546. * ```
  57547. * // 浏览器
  57548. * <script type="text/javascript" src="{cdn}"></script>
  57549. * <script>
  57550. * const result = {namespace}.DataItemOrderBy.FILENAME;
  57551. *
  57552. * </script>
  57553. * // ES6 Import
  57554. * import { DataItemOrderBy } from '{npm}';
  57555. *
  57556. * const result = DataItemOrderBy.FILENAME;
  57557. * ```
  57558. */
  57559. var DataItemOrderBy = {
  57560. /** 文件名。 */
  57561. FILENAME: "FILENAME",
  57562. /** ID。 */
  57563. ID: "ID",
  57564. /** 最后修改时间。 */
  57565. LASTMODIFIEDTIME: "LASTMODIFIEDTIME",
  57566. /** 作者昵称。 */
  57567. NICKNAME: "NICKNAME",
  57568. /** SERVICESTATUS。 */
  57569. SERVICESTATUS: "SERVICESTATUS",
  57570. /** 大小。 */
  57571. SIZE: "SIZE",
  57572. /** 状态。 */
  57573. STATUS: "STATUS",
  57574. /** 类型。 */
  57575. TYPE: "TYPE",
  57576. /** 更新时间。 */
  57577. UPDATETIME: "UPDATETIME",
  57578. /** 作者名。 */
  57579. USERNAME: "USERNAME"
  57580. };
  57581. /**
  57582. * @enum FilterField {number}
  57583. * @category BaseTypes Constant
  57584. * @description 关键字查询时的过滤字段。
  57585. * @usage
  57586. * ```
  57587. * // 浏览器
  57588. * <script type="text/javascript" src="{cdn}"></script>
  57589. * <script>
  57590. * const result = {namespace}.FilterField.LINKPAGE;
  57591. *
  57592. * </script>
  57593. * // ES6 Import
  57594. * import { FilterField } from '{npm}';
  57595. *
  57596. * const result = FilterField.LINKPAGE;
  57597. * ```
  57598. */
  57599. var FilterField = {
  57600. /** 服务地址。 */
  57601. LINKPAGE: "LINKPAGE",
  57602. /** 服务中包含的地图的名称。 */
  57603. MAPTITLE: "MAPTITLE",
  57604. /** 服务创建者昵称。 */
  57605. NICKNAME: "NICKNAME",
  57606. /** 服务名称。 */
  57607. RESTITLE: "RESTITLE",
  57608. /** 服务创建者用户名。 */
  57609. USERNAME: "USERNAME"
  57610. };
  57611. ;// CONCATENATED MODULE: ./src/common/online/OnlineServiceBase.js
  57612. function OnlineServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  57613. function OnlineServiceBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  57614. function OnlineServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) OnlineServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) OnlineServiceBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  57615. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  57616. * This program are made available under the terms of the Apache License, Version 2.0
  57617. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  57618. /**
  57619. * @class OnlineServiceBase
  57620. * @deprecatedclass SuperMap.OnlineServiceBase
  57621. * @classdesc Online 服务基类(使用 key 作为权限限制的类需要实现此类)。
  57622. * @category iPortal/Online Core
  57623. * @param {Object} options - 可选参数。
  57624. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  57625. * @param {Object} [options.headers] - 请求头。
  57626. * @usage
  57627. */
  57628. var OnlineServiceBase = /*#__PURE__*/function () {
  57629. function OnlineServiceBase(options) {
  57630. OnlineServiceBase_classCallCheck(this, OnlineServiceBase);
  57631. options = options || {};
  57632. Util_Util.extend(this, options);
  57633. this.CLASS_NAME = "SuperMap.OnlineServiceBase";
  57634. }
  57635. /**
  57636. * @function OnlineServiceBase.prototype.request
  57637. * @description 请求 online 服务
  57638. * @param {string} [method='GET'] - 请求方式, 'GET', 'PUT', 'POST', 'DELETE'。
  57639. * @param {string} url - 服务地址。
  57640. * @param {Object} param - URL 查询参数。
  57641. * @param {Object} [requestOptions] - http 请求参数, 比如请求头,超时时间等。
  57642. * @returns {Promise} 包含请求结果的 Promise 对象。
  57643. */
  57644. OnlineServiceBase_createClass(OnlineServiceBase, [{
  57645. key: "request",
  57646. value: function request(method, url, param) {
  57647. var requestOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  57648. url = SecurityManager.appendCredential(url);
  57649. requestOptions['crossOrigin'] = this.options.crossOrigin;
  57650. requestOptions['headers'] = this.options.headers;
  57651. return FetchRequest.commit(method, url, param, requestOptions).then(function (response) {
  57652. return response.json();
  57653. });
  57654. }
  57655. }]);
  57656. return OnlineServiceBase;
  57657. }();
  57658. ;// CONCATENATED MODULE: ./src/common/online/OnlineData.js
  57659. function OnlineData_typeof(obj) { "@babel/helpers - typeof"; return OnlineData_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, OnlineData_typeof(obj); }
  57660. function OnlineData_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  57661. function OnlineData_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  57662. function OnlineData_createClass(Constructor, protoProps, staticProps) { if (protoProps) OnlineData_defineProperties(Constructor.prototype, protoProps); if (staticProps) OnlineData_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  57663. function OnlineData_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) OnlineData_setPrototypeOf(subClass, superClass); }
  57664. function OnlineData_setPrototypeOf(o, p) { OnlineData_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return OnlineData_setPrototypeOf(o, p); }
  57665. function OnlineData_createSuper(Derived) { var hasNativeReflectConstruct = OnlineData_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = OnlineData_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = OnlineData_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return OnlineData_possibleConstructorReturn(this, result); }; }
  57666. function OnlineData_possibleConstructorReturn(self, call) { if (call && (OnlineData_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return OnlineData_assertThisInitialized(self); }
  57667. function OnlineData_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  57668. function OnlineData_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  57669. function OnlineData_getPrototypeOf(o) { OnlineData_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return OnlineData_getPrototypeOf(o); }
  57670. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  57671. * This program are made available under the terms of the Apache License, Version 2.0
  57672. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  57673. /**
  57674. * @class OnlineData
  57675. * @deprecatedclass SuperMap.OnlineData
  57676. * @classdesc Online myData 服务。
  57677. * @category iPortal/Online Resources Data
  57678. * @param {string} serviceRootUrl - 服务地址。
  57679. * @param {Object} options - 可选参数。
  57680. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  57681. * @param {Object} [options.headers] - 请求头。
  57682. * @usage
  57683. * @extends OnlineServiceBase
  57684. */
  57685. var OnlineData = /*#__PURE__*/function (_OnlineServiceBase) {
  57686. OnlineData_inherits(OnlineData, _OnlineServiceBase);
  57687. var _super = OnlineData_createSuper(OnlineData);
  57688. //TODO 目前并没有对接服务支持的所有操作,日后需要补充完整
  57689. function OnlineData(serviceRootUrl, options) {
  57690. var _this;
  57691. OnlineData_classCallCheck(this, OnlineData);
  57692. _this = _super.call(this, serviceRootUrl);
  57693. options = options || {};
  57694. //MD5
  57695. _this.MD5 = null;
  57696. //文件类型。
  57697. _this.type = null;
  57698. //数据上传者名称。
  57699. _this.userName = null;
  57700. //文件名称。
  57701. _this.fileName = null;
  57702. //文件大小,单位为 B 。
  57703. _this.size = null;
  57704. //服务发布状态。
  57705. _this.serviceStatus = null;
  57706. //服务 id 。
  57707. _this.serviceId = null;
  57708. //数据项 id 。
  57709. _this.id = null;
  57710. //最后修改时间。
  57711. _this.lastModfiedTime = null;
  57712. //文件状态。
  57713. _this.status = null;
  57714. //数据文件存储 id 。
  57715. _this.storageId = null;
  57716. //数据的发布信息。
  57717. _this.publishInfo = null;
  57718. //数据的权限信息。
  57719. _this.authorizeSetting = null;
  57720. //用户的昵称。
  57721. _this.nickname = null;
  57722. //数据的标签。
  57723. _this.tags = [];
  57724. //数据的描述信息。
  57725. _this.description = null;
  57726. //数据发布的服务信息集合。
  57727. _this.dataItemServices = null;
  57728. //数据坐标类型。
  57729. _this.coordType = null;
  57730. //数据审核信息
  57731. _this.dataCheckResult = null;
  57732. //数据元数据信息
  57733. _this.dataMetaInfo = null;
  57734. //数据的缩略图路径。
  57735. _this.thumbnail = null;
  57736. Util_Util.extend(OnlineData_assertThisInitialized(_this), options);
  57737. if (_this.id) {
  57738. _this.serviceUrl = serviceRootUrl + "/" + _this.id;
  57739. }
  57740. _this.CLASS_NAME = "SuperMap.OnlineData";
  57741. return _this;
  57742. }
  57743. /**
  57744. * @function OnlineData.prototype.load
  57745. * @description 通过 URL 请求获取该服务完整信息。
  57746. * @returns {Promise} 不包含请求结果的 Promise 对象,请求返回结果自动填充到该类属性中。
  57747. */
  57748. OnlineData_createClass(OnlineData, [{
  57749. key: "load",
  57750. value: function load() {
  57751. if (!this.serviceUrl) {
  57752. return;
  57753. }
  57754. var me = this;
  57755. return me.request("GET", this.serviceUrl).then(function (result) {
  57756. Util_Util.extend(me, result);
  57757. });
  57758. }
  57759. /**
  57760. * @function OnlineData.prototype.getPublishedServices
  57761. * @description 获取数据发布的所有服务。
  57762. * @returns {Object} 数据发布的所有服务。
  57763. */
  57764. }, {
  57765. key: "getPublishedServices",
  57766. value: function getPublishedServices() {
  57767. return this.dataItemServices;
  57768. }
  57769. /**
  57770. * @function OnlineData.prototype.getAuthorizeSetting
  57771. * @description 获取数据的权限信息。
  57772. * @returns {Object} 权限信息。
  57773. */
  57774. }, {
  57775. key: "getAuthorizeSetting",
  57776. value: function getAuthorizeSetting() {
  57777. return this.authorizeSetting;
  57778. }
  57779. }]);
  57780. return OnlineData;
  57781. }(OnlineServiceBase);
  57782. ;// CONCATENATED MODULE: ./src/common/online/Online.js
  57783. function Online_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  57784. function Online_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  57785. function Online_createClass(Constructor, protoProps, staticProps) { if (protoProps) Online_defineProperties(Constructor.prototype, protoProps); if (staticProps) Online_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  57786. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  57787. * This program are made available under the terms of the Apache License, Version 2.0
  57788. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  57789. /**
  57790. * @class Online
  57791. * @deprecatedclass SuperMap.Online
  57792. * @classdesc 对接 SuperMap Online 所有基础服务。
  57793. * @category iPortal/Online Resources
  57794. * @modulecategory Services
  57795. * @example
  57796. * var online=new Online();
  57797. * var services = online.queryDatas(param);
  57798. * service.then(function(services){
  57799. * var service= services[0];
  57800. * service.updateDataInfo();
  57801. * })
  57802. * @usage
  57803. */
  57804. var Online = /*#__PURE__*/function () {
  57805. //TODO 目前并没有对接Online的所有操作,需要补充完整
  57806. //所有查询返回的是一个Promise,在外部使用的时候通过Promise的then方法获取异步结果
  57807. function Online() {
  57808. Online_classCallCheck(this, Online);
  57809. this.rootUrl = "https://www.supermapol.com";
  57810. this.webUrl = this.rootUrl + "/web";
  57811. var mContentUrl = this.webUrl + "/mycontent";
  57812. this.mDatasUrl = mContentUrl + "/datas";
  57813. this.CLASS_NAME = "SuperMap.Online";
  57814. }
  57815. /**
  57816. * @function Online.prototype.load
  57817. * @description 加载 online,验证 online 是否可用。
  57818. * @returns {Promise} 包含网络请求结果的 Promise 对象。
  57819. */
  57820. Online_createClass(Online, [{
  57821. key: "load",
  57822. value: function load() {
  57823. return FetchRequest.get(this.rootUrl).then(function (response) {
  57824. return response;
  57825. });
  57826. }
  57827. /**
  57828. * @function Online.prototype.login
  57829. * @description 登录Online
  57830. */
  57831. }, {
  57832. key: "login",
  57833. value: function login() {
  57834. SecurityManager.loginOnline(this.rootUrl, true);
  57835. }
  57836. /**
  57837. * @function Online.prototype.queryDatas
  57838. * @description 查询 Online “我的内容” 下 “我的数据” 服务(需要登录状态获取),并返回可操作的服务对象。
  57839. * @param {OnlineQueryDatasParameter} parameter - myDatas 服务资源查询参数。
  57840. * @returns {Promise} 包含所有数据服务信息的 Promise 对象。
  57841. */
  57842. }, {
  57843. key: "queryDatas",
  57844. value: function queryDatas(parameter) {
  57845. var me = this,
  57846. url = me.mDatasUrl;
  57847. if (parameter) {
  57848. parameter = parameter.toJSON();
  57849. }
  57850. return FetchRequest.get(url, parameter).then(function (json) {
  57851. if (!json || !json.content || json.content.length < 1) {
  57852. return;
  57853. }
  57854. var services = [],
  57855. contents = json.content,
  57856. len = contents.length;
  57857. for (var i = 0; i < len; i++) {
  57858. var content = contents[i];
  57859. var service = new OnlineData(me.mDatasUrl, content);
  57860. services.push(service);
  57861. }
  57862. return services;
  57863. });
  57864. }
  57865. }]);
  57866. return Online;
  57867. }();
  57868. ;// CONCATENATED MODULE: ./src/common/online/OnlineQueryDatasParameter.js
  57869. function OnlineQueryDatasParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  57870. function OnlineQueryDatasParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  57871. function OnlineQueryDatasParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) OnlineQueryDatasParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) OnlineQueryDatasParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  57872. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  57873. * This program are made available under the terms of the Apache License, Version 2.0
  57874. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  57875. /**
  57876. * @class OnlineQueryDatasParameter
  57877. * @deprecatedclass SuperMap.OnlineQueryDatasParameter
  57878. * @classdesc myDatas 服务资源查询参数。
  57879. * @category iPortal/Online Resources Data
  57880. * @param {Object} options - 参数。
  57881. * @usage
  57882. */
  57883. var OnlineQueryDatasParameter = /*#__PURE__*/function () {
  57884. function OnlineQueryDatasParameter(options) {
  57885. OnlineQueryDatasParameter_classCallCheck(this, OnlineQueryDatasParameter);
  57886. options = options || {};
  57887. /**
  57888. * @member {Array.<string>} OnlineQueryDatasParameter.prototype.userNames
  57889. * @description 数据作者名。可以根据数据作者名查询,默认查询全部。
  57890. */
  57891. this.userNames = null;
  57892. /**
  57893. * @member {Array.<Object>} OnlineQueryDatasParameter.prototype.types
  57894. * @description 数据类型。
  57895. */
  57896. this.types = null;
  57897. /**
  57898. * @member {string} OnlineQueryDatasParameter.prototype.fileName
  57899. * @description 文件名称。
  57900. */
  57901. this.fileName = null;
  57902. /**
  57903. * @member {string} OnlineQueryDatasParameter.prototype.serviceStatuses
  57904. * @description 服务发布状态。
  57905. */
  57906. this.serviceStatuses = null;
  57907. /**
  57908. * @member {string} OnlineQueryDatasParameter.prototype.serviceId
  57909. * @description 服务 ID。
  57910. */
  57911. this.serviceId = null;
  57912. /**
  57913. * @member {Array.<number>} OnlineQueryDatasParameter.prototype.ids
  57914. * @description 由数据项 ID 组成的整型数组。
  57915. */
  57916. this.ids = null;
  57917. /**
  57918. * @member {Array.<string>} OnlineQueryDatasParameter.prototype.keywords
  57919. * @description 关键字。
  57920. */
  57921. this.keywords = null;
  57922. /**
  57923. * @member {string} OnlineQueryDatasParameter.prototype.orderBy
  57924. * @description 排序字段。
  57925. */
  57926. this.orderBy = null;
  57927. /**
  57928. * @member {Array.<string>} OnlineQueryDatasParameter.prototype.tags
  57929. * @description 数据的标签。
  57930. */
  57931. this.tags = null;
  57932. /**
  57933. * @member {Array.<string>} OnlineQueryDatasParameter.prototype.filterFields
  57934. * @description 用于关键字查询时的过滤字段。
  57935. */
  57936. this.filterFields = null;
  57937. Util_Util.extend(this, options);
  57938. this.CLASS_NAME = "SuperMap.OnlineQueryDatasParameter";
  57939. }
  57940. /**
  57941. * @function OnlineQueryDatasParameter.prototype.toJSON
  57942. * @description 返回对应的 JSON 对象。
  57943. * @returns {Object} 对应的 JSON 对象。
  57944. */
  57945. OnlineQueryDatasParameter_createClass(OnlineQueryDatasParameter, [{
  57946. key: "toJSON",
  57947. value: function toJSON() {
  57948. var me = this;
  57949. var jsonObj = {
  57950. "types": me.types,
  57951. "fileName": me.fileName,
  57952. "serviceStatuses": me.serviceStatuses,
  57953. "serviceId": me.serviceId,
  57954. "ids": me.ids,
  57955. "keywords": me.keywords,
  57956. "orderBy": me.orderBy,
  57957. "tags": me.tags,
  57958. "filterFields": me.filterFields
  57959. };
  57960. for (var key in jsonObj) {
  57961. if (jsonObj[key] == null) {
  57962. delete jsonObj[key];
  57963. }
  57964. }
  57965. return jsonObj;
  57966. }
  57967. }]);
  57968. return OnlineQueryDatasParameter;
  57969. }();
  57970. ;// CONCATENATED MODULE: ./src/common/online/index.js
  57971. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  57972. * This program are made available under the terms of the Apache License, Version 2.0
  57973. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  57974. ;// CONCATENATED MODULE: ./src/common/security/KeyServiceParameter.js
  57975. function KeyServiceParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  57976. function KeyServiceParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  57977. function KeyServiceParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) KeyServiceParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) KeyServiceParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  57978. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  57979. * This program are made available under the terms of the Apache License, Version 2.0
  57980. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  57981. /**
  57982. * @class KeyServiceParameter
  57983. * @deprecatedclass SuperMap.KeyServiceParameter
  57984. * @classdesc key申请参数
  57985. * @category Security
  57986. * @param {Object} options - 参数。
  57987. * @param {string} options.name - 申请服务名称。
  57988. * @param {number} options.serviceIds - 服务 ID。
  57989. * @param {ClientType} [options.clientType=ClientType.SERVER] - 服务端类型。
  57990. * @param {number} options.limitation - 有效期
  57991. * @usage
  57992. */
  57993. var KeyServiceParameter = /*#__PURE__*/function () {
  57994. function KeyServiceParameter(options) {
  57995. KeyServiceParameter_classCallCheck(this, KeyServiceParameter);
  57996. this.name = null;
  57997. this.serviceIds = null;
  57998. this.clientType = ClientType.SERVER;
  57999. this.limitation = null;
  58000. Util_Util.extend(this, options);
  58001. this.CLASS_NAME = "SuperMap.KeyServiceParameter";
  58002. }
  58003. /**
  58004. * @function KeyServiceParameter.prototype.toJSON
  58005. * @description 转换成 JSON 对象
  58006. * @returns {Object} 参数的 JSON 对象
  58007. */
  58008. KeyServiceParameter_createClass(KeyServiceParameter, [{
  58009. key: "toJSON",
  58010. value: function toJSON() {
  58011. return {
  58012. name: this.name,
  58013. serviceIds: this.serviceIds,
  58014. clientType: this.clientType,
  58015. limitation: this.limitation
  58016. };
  58017. }
  58018. }]);
  58019. return KeyServiceParameter;
  58020. }();
  58021. ;// CONCATENATED MODULE: ./src/common/security/ServerInfo.js
  58022. function ServerInfo_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  58023. function ServerInfo_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerInfo_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerInfo_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  58024. function ServerInfo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  58025. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  58026. * This program are made available under the terms of the Apache License, Version 2.0
  58027. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  58028. /**
  58029. * @class ServerInfo
  58030. * @deprecatedclass SuperMap.ServerInfo
  58031. * @classdesc 服务器信息(安全相关),包含服务器类型,服务地址,token服务地址等。
  58032. * @category Security
  58033. * @param {string} type - 服务器类型。
  58034. * @param {Object} options - 参数。
  58035. * @param {string} options.server - 服务器地址,如:http://supermapiserver:8090/iserver。
  58036. * @param {string} [options.tokenServiceUrl] - 如:http://supermapiserver:8090/iserver/services/security/tokens.json。
  58037. * @param {string} [options.keyServiceUrl] - 如:http://supermapiserver:8092/web/mycontent/keys/register.json。
  58038. * @usage
  58039. */
  58040. var ServerInfo = /*#__PURE__*/ServerInfo_createClass(function ServerInfo(type, options) {
  58041. ServerInfo_classCallCheck(this, ServerInfo);
  58042. /**
  58043. * @member {ServerType} ServerInfo.prototype.type
  58044. * @description 服务器类型。
  58045. */
  58046. this.type = type;
  58047. /**
  58048. * @member {string} ServerInfo.prototype.server
  58049. * @description 服务器地址。
  58050. */
  58051. this.server = null;
  58052. /**
  58053. * @member {string} [ServerInfo.prototype.tokenServiceUrl]
  58054. * @description 如:http://supermapiserver:8090/iserver/services/security/tokens.json。
  58055. */
  58056. this.tokenServiceUrl = null;
  58057. /**
  58058. * @member {string} [ServerInfo.prototype.keyServiceUrl]
  58059. * @description 如:http://supermapiserver:8092/web/mycontent/keys/register.json。
  58060. */
  58061. this.keyServiceUrl = null;
  58062. Util_Util.extend(this, options);
  58063. this.CLASS_NAME = "SuperMap.ServerInfo";
  58064. this.type = this.type || ServerType.ISERVER;
  58065. if (!this.server) {
  58066. console.error('server url require is not undefined');
  58067. }
  58068. // var patten = /http:\/\/([^\/]+)/i;
  58069. //this.server = this.server.match(patten)[0];
  58070. var tokenServiceSuffix = "/services/security/tokens";
  58071. if (this.type === ServerType.ISERVER && this.server.indexOf("iserver") < 0) {
  58072. tokenServiceSuffix = "/iserver" + tokenServiceSuffix;
  58073. }
  58074. if (!this.tokenServiceUrl) {
  58075. this.tokenServiceUrl = Util_Util.urlPathAppend(this.server, tokenServiceSuffix);
  58076. }
  58077. if (!this.keyServiceUrl) {
  58078. if (this.type === ServerType.IPORTAL) {
  58079. this.keyServiceUrl = Util_Util.urlPathAppend(this.server, "/web/mycontent/keys/register");
  58080. } else if (this.type === ServerType.ONLINE) {
  58081. this.keyServiceUrl = Util_Util.urlPathAppend(this.server, "/web/mycontent/keys");
  58082. }
  58083. }
  58084. });
  58085. ;// CONCATENATED MODULE: ./src/common/security/TokenServiceParameter.js
  58086. function TokenServiceParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  58087. function TokenServiceParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  58088. function TokenServiceParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) TokenServiceParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) TokenServiceParameter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  58089. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  58090. * This program are made available under the terms of the Apache License, Version 2.0
  58091. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  58092. /**
  58093. * @class TokenServiceParameter
  58094. * @deprecatedclass SuperMap.TokenServiceParameter
  58095. * @classdesc token 申请参数。
  58096. * @category Security
  58097. * @param {Object} options - 参数。
  58098. * @param {string} options.username - 用户名。
  58099. * @param {string} options.password - 密码。
  58100. * @param {ClientType} [options.clientType='ClientType.NONE'] - token 申请的客户端标识类型。
  58101. * @param {string} [options.ip] - clientType=IP 时,此为必选参数。
  58102. * @param {string} [options.referer] -clientType=Referer 时,此为必选参数。如果按照指定 URL 的方式申请令牌,则设置相应的 URL。
  58103. * @param {number} [options.expiration=60] - 申请令牌的有效期,从发布令牌的时间开始计算,单位为分钟。
  58104. * @usage
  58105. *
  58106. */
  58107. var TokenServiceParameter = /*#__PURE__*/function () {
  58108. function TokenServiceParameter(options) {
  58109. TokenServiceParameter_classCallCheck(this, TokenServiceParameter);
  58110. /**
  58111. * @member {string} TokenServiceParameter.prototype.userName
  58112. * @description 用户名。
  58113. */
  58114. this.userName = null;
  58115. /**
  58116. * @member {string} TokenServiceParameter.prototype.password
  58117. * @description 密码。
  58118. */
  58119. this.password = null;
  58120. /**
  58121. * @member {ClientType} TokenServiceParameter.prototype.clientType
  58122. * @description token 申请的客户端标识类型。
  58123. */
  58124. this.clientType = ClientType.NONE;
  58125. /**
  58126. * @member {string} [TokenServiceParameter.prototype.ip]
  58127. * @description clientType=IP 时,此为必选参数。
  58128. */
  58129. this.ip = null;
  58130. /**
  58131. * @member {string} [TokenServiceParameter.prototype.referer]
  58132. * @description clientType=Referer 时,此为必选参数。如果按照指定 URL 的方式申请令牌,则设置相应的 URL。
  58133. */
  58134. this.referer = null;
  58135. /**
  58136. * @member {number} TokenServiceParameter.prototype.expiration
  58137. * @description 申请令牌的有效期,从发布令牌的时间开始计算,单位为分钟。
  58138. */
  58139. this.expiration = 60;
  58140. Util_Util.extend(this, options);
  58141. this.CLASS_NAME = "SuperMap.TokenServiceParameter";
  58142. }
  58143. /**
  58144. * @function TokenServiceParameter.prototype.toJSON
  58145. * @description 将所有信息转成 JSON 字符串。
  58146. * @returns {string} 参数的 JSON 字符串。
  58147. */
  58148. TokenServiceParameter_createClass(TokenServiceParameter, [{
  58149. key: "toJSON",
  58150. value: function toJSON() {
  58151. return {
  58152. userName: this.userName,
  58153. password: this.password,
  58154. clientType: this.clientType,
  58155. ip: this.ip,
  58156. referer: this.referer,
  58157. expiration: this.expiration
  58158. };
  58159. }
  58160. }]);
  58161. return TokenServiceParameter;
  58162. }();
  58163. ;// CONCATENATED MODULE: ./src/common/security/index.js
  58164. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  58165. * This program are made available under the terms of the Apache License, Version 2.0
  58166. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  58167. ;// CONCATENATED MODULE: external "function(){try{return elasticsearch}catch(e){return {}}}()"
  58168. var external_function_try_return_elasticsearch_catch_e_return_namespaceObject = function(){try{return elasticsearch}catch(e){return {}}}();
  58169. var external_function_try_return_elasticsearch_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_elasticsearch_catch_e_return_namespaceObject);
  58170. ;// CONCATENATED MODULE: ./src/common/thirdparty/elasticsearch/ElasticSearch.js
  58171. function ElasticSearch_toConsumableArray(arr) { return ElasticSearch_arrayWithoutHoles(arr) || ElasticSearch_iterableToArray(arr) || ElasticSearch_unsupportedIterableToArray(arr) || ElasticSearch_nonIterableSpread(); }
  58172. function ElasticSearch_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  58173. function ElasticSearch_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return ElasticSearch_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ElasticSearch_arrayLikeToArray(o, minLen); }
  58174. function ElasticSearch_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
  58175. function ElasticSearch_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return ElasticSearch_arrayLikeToArray(arr); }
  58176. function ElasticSearch_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  58177. function ElasticSearch_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  58178. function ElasticSearch_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  58179. function ElasticSearch_createClass(Constructor, protoProps, staticProps) { if (protoProps) ElasticSearch_defineProperties(Constructor.prototype, protoProps); if (staticProps) ElasticSearch_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  58180. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  58181. * This program are made available under the terms of the Apache License, Version 2.0
  58182. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  58183. /**
  58184. * @class ElasticSearch
  58185. * @deprecatedclass SuperMap.ElasticSearch
  58186. * @classdesc ElasticSearch服务类。
  58187. * @category ElasticSearch
  58188. * @modulecategory Services
  58189. * @param {string} url - ElasticSearch服务地址。
  58190. * @param {Object} options - 参数。
  58191. * @param {function} [options.change] - 服务器返回数据后执行的函数。废弃,不建议使用。使用search或msearch方法。
  58192. * @param {boolean} [options.openGeoFence=false] - 是否开启地理围栏验证,默认为不开启。
  58193. * @param {function} [options.outOfGeoFence] - 数据超出地理围栏后执行的函数。
  58194. * @param {Object} [options.geoFence] - 地理围栏。
  58195. * @description
  58196. * <h3 style="font-size: 20px;margin-top: 20px;margin-bottom: 10px;">11.1.0</h3>
  58197. * 该功能依赖<a href="https://github.com/elastic/elasticsearch">@elastic/elasticsearch</a>, webpack5或其他不包含Node.js Polyfills的打包工具,需要加入相关配置,以webpack为例:<br/>
  58198. <p style="margin-top:10px;">首先安装相关Polyfills</p><pre><code>npm i stream-http https-browserify stream-browserify tty-browserify browserify-zlib os-browserify buffer url assert process -D</code></pre>
  58199. 然后配置webpack<pre><code>module.exports: {
  58200. resolve: {
  58201. alias: {
  58202. process: 'process/browser',
  58203. },
  58204. mainFields: ['browser', 'main'],
  58205. fallback: {
  58206. fs: false,
  58207. http: require.resolve('stream-http'),
  58208. https: require.resolve('https-browserify'),
  58209. os: require.resolve('os-browserify/browser'),
  58210. stream: require.resolve('stream-browserify'),
  58211. tty: require.resolve('tty-browserify'),
  58212. zlib: require.resolve('browserify-zlib')
  58213. }
  58214. }
  58215. plugins: [
  58216. new webpack.ProvidePlugin({
  58217. process: 'process/browser',
  58218. Buffer: ['buffer', 'Buffer']
  58219. }),
  58220. ]
  58221. }</code></pre>
  58222. * @usage
  58223. */
  58224. var ElasticSearch = /*#__PURE__*/function () {
  58225. function ElasticSearch(url, options) {
  58226. ElasticSearch_classCallCheck(this, ElasticSearch);
  58227. options = options || {};
  58228. /**
  58229. * @member {string} ElasticSearch.prototype.url
  58230. * @description ElasticSearch服务地址。
  58231. */
  58232. this.url = url;
  58233. /**
  58234. * @member {Object} ElasticSearch.prototype.client
  58235. * @description client ES客户端。
  58236. */
  58237. try {
  58238. // 老版本
  58239. this.client = new (external_function_try_return_elasticsearch_catch_e_return_default()).Client({
  58240. host: this.url
  58241. });
  58242. } catch (e) {
  58243. // 新版本
  58244. this.client = new (external_function_try_return_elasticsearch_catch_e_return_default()).Client({
  58245. node: {
  58246. url: new URL(this.url)
  58247. }
  58248. });
  58249. }
  58250. /**
  58251. * @deprecated
  58252. * @member {function} [ElasticSearch.prototype.change]
  58253. * @description 服务器返回数据后执行的函数。废弃,不建议使用。使用search或msearch方法。
  58254. */
  58255. this.change = null;
  58256. /**
  58257. * @member {boolean} [ElasticSearch.prototype.openGeoFence=false]
  58258. * @description 是否开启地理围栏验证,默认为不开启。
  58259. */
  58260. this.openGeoFence = false;
  58261. /**
  58262. * @member {function} [ElasticSearch.prototype.outOfGeoFence]
  58263. * @description 数据超出地理围栏后执行的函数。
  58264. */
  58265. this.outOfGeoFence = null;
  58266. /**
  58267. * @member {Object} [ElasticSearch.prototype.geoFence]
  58268. * @description 地理围栏。
  58269. * @example {
  58270. * radius: 1000,//单位是m
  58271. * center: [104.40, 30.43],
  58272. * unit: 'meter|degree'
  58273. * }
  58274. */
  58275. this.geoFence = null;
  58276. /*
  58277. * Constant: EVENT_TYPES
  58278. * {Array.<String>}
  58279. * 此类支持的事件类型。
  58280. *
  58281. */
  58282. this.EVENT_TYPES = ['change', 'error', 'outOfGeoFence'];
  58283. /**
  58284. * @member {Events} ElasticSearch.prototype.events
  58285. * @description 事件。
  58286. */
  58287. this.events = new Events(this, null, this.EVENT_TYPES);
  58288. /**
  58289. * @member {Object} ElasticSearch.prototype.eventListeners
  58290. * @description 监听器对象,在构造函数中设置此参数(可选),对 MapService 支持的两个事件 processCompleted 、processFailed 进行监听,
  58291. * 相当于调用 Events.on(eventListeners)。
  58292. */
  58293. this.eventListeners = null;
  58294. Util_Util.extend(this, options);
  58295. if (this.eventListeners instanceof Object) {
  58296. this.events.on(this.eventListeners);
  58297. }
  58298. }
  58299. /**
  58300. * @function ElasticSearch.prototype.setGeoFence
  58301. * @description 设置地理围栏,openGeoFence参数为true的时候,设置的地理围栏才生效。
  58302. * @param {Geometry} geoFence - 地理围栏。
  58303. */
  58304. ElasticSearch_createClass(ElasticSearch, [{
  58305. key: "setGeoFence",
  58306. value: function setGeoFence(geoFence) {
  58307. this.geoFence = geoFence;
  58308. }
  58309. /**
  58310. * @function ElasticSearch.prototype.bulk
  58311. * @description 批量操作API,允许执行多个索引/删除操作。
  58312. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-bulk}</br>
  58313. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html}</br>
  58314. * @param {Object} params - 参数。
  58315. * @param {function} callback - 回调函数。
  58316. */
  58317. }, {
  58318. key: "bulk",
  58319. value: function bulk(params, callback) {
  58320. return this.client.bulk(params, this._handleCallback(callback));
  58321. }
  58322. /**
  58323. * @function ElasticSearch.prototype.clearScroll
  58324. * @description 通过指定scroll参数进行查询来清除已经创建的scroll请求。
  58325. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-clearscroll}</br>
  58326. *更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html}</br>
  58327. * @param {Object} params - 参数。
  58328. * @param {function} callback - 回调函数。
  58329. */
  58330. }, {
  58331. key: "clearScroll",
  58332. value: function clearScroll(params, callback) {
  58333. return this.client.clearScroll(params, this._handleCallback(callback));
  58334. }
  58335. /**
  58336. * @function ElasticSearch.prototype.count
  58337. * @description 获取集群、索引、类型或查询的文档个数。
  58338. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-count}</br>
  58339. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-count.html}</br>
  58340. * @param {Object} params - 参数。
  58341. * @param {function} callback - 回调函数。
  58342. */
  58343. }, {
  58344. key: "count",
  58345. value: function count(params, callback) {
  58346. return this.client.count(params, this._handleCallback(callback));
  58347. }
  58348. /**
  58349. * @function ElasticSearch.prototype.create
  58350. * @description 在特定索引中添加一个类型化的JSON文档,使其可搜索。如果具有相同index,type且ID已经存在的文档将发生错误。</br>
  58351. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-create}
  58352. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html}
  58353. * @param {Object} params - 参数。
  58354. * @param {function} callback - 回调函数。
  58355. */
  58356. }, {
  58357. key: "create",
  58358. value: function create(params, callback) {
  58359. return this.client.create(params, this._handleCallback(callback));
  58360. }
  58361. /**
  58362. * @function ElasticSearch.prototype.delete
  58363. * @description 根据其ID从特定索引中删除键入的JSON文档。
  58364. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-delete}</br>
  58365. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html}</br>
  58366. * @param {Object} params - 参数。
  58367. * @param {function} callback - 回调函数。
  58368. */
  58369. }, {
  58370. key: "delete",
  58371. value: function _delete(params, callback) {
  58372. return this.client["delete"](params, this._handleCallback(callback));
  58373. }
  58374. /**
  58375. * @function ElasticSearch.prototype.deleteByQuery
  58376. * @description 根据其ID从特定索引中删除键入的JSON文档。
  58377. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletebyquery}</br>
  58378. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html}</br>
  58379. * @param {Object} params - 参数。
  58380. * @param {function} callback - 回调函数。
  58381. */
  58382. }, {
  58383. key: "deleteByQuery",
  58384. value: function deleteByQuery(params, callback) {
  58385. return this.client.deleteByQuery(params, this._handleCallback(callback));
  58386. }
  58387. /**
  58388. * @function ElasticSearch.prototype.deleteScript
  58389. * @description 根据其ID删除脚本。</br>
  58390. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletescript}</br>
  58391. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  58392. * @param {Object} params - 参数。
  58393. * @param {function} callback - 回调函数。
  58394. */
  58395. }, {
  58396. key: "deleteScript",
  58397. value: function deleteScript(params, callback) {
  58398. return this.client.deleteScript(params, this._handleCallback(callback));
  58399. }
  58400. /**
  58401. * @function ElasticSearch.prototype.deleteTemplate
  58402. * @description 根据其ID删除模板。</br>
  58403. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletetemplate}</br>
  58404. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  58405. * @param {Object} params - 参数。
  58406. * @param {function} callback - 回调函数。
  58407. */
  58408. }, {
  58409. key: "deleteTemplate",
  58410. value: function deleteTemplate(params, callback) {
  58411. return this.client.deleteTemplate(params, this._handleCallback(callback));
  58412. }
  58413. /**
  58414. * @function ElasticSearch.prototype.exists
  58415. * @description 检查给定文档是否存在。</br>
  58416. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-exists}</br>
  58417. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  58418. * @param {Object} params - 参数。
  58419. * @param {function} callback - 回调函数。
  58420. */
  58421. }, {
  58422. key: "exists",
  58423. value: function exists(params, callback) {
  58424. return this.client.exists(params, this._handleCallback(callback));
  58425. }
  58426. /**
  58427. * @function ElasticSearch.prototype.existsSource
  58428. * @description 检查资源是否存在。</br>
  58429. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-existssource}</br>
  58430. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  58431. * @param {Object} params - 参数。
  58432. * @param {function} callback - 回调函数。
  58433. */
  58434. }, {
  58435. key: "existsSource",
  58436. value: function existsSource(params, callback) {
  58437. return this.client.existsSource(params, this._handleCallback(callback));
  58438. }
  58439. /**
  58440. * @function ElasticSearch.prototype.explain
  58441. * @description 提供与特定查询相关的特定文档分数的详细信息。它还会告诉您文档是否与指定的查询匹配。</br>
  58442. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-explain}</br>
  58443. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-explain.html}</br>
  58444. * @param {Object} params - 参数。
  58445. * @param {function} callback - 回调函数。
  58446. */
  58447. }, {
  58448. key: "explain",
  58449. value: function explain(params, callback) {
  58450. return this.client.explain(params, this._handleCallback(callback));
  58451. }
  58452. /**
  58453. * @function ElasticSearch.prototype.fieldCaps
  58454. * @description 允许检索多个索引之间的字段的功能。(实验性API,可能会在未来版本中删除)</br>
  58455. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-fieldcaps}</br>
  58456. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-field-caps.html}</br>
  58457. * @param {Object} params - 参数。
  58458. * @param {function} callback - 回调函数。
  58459. */
  58460. }, {
  58461. key: "fieldCaps",
  58462. value: function fieldCaps(params, callback) {
  58463. return this.client.fieldCaps(params, this._handleCallback(callback));
  58464. }
  58465. /**
  58466. * @function ElasticSearch.prototype.get
  58467. * @description 从索引获取一个基于其ID的类型的JSON文档。</br>
  58468. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-get}</br>
  58469. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  58470. * @param {Object} params - 参数。
  58471. * @param {function} callback - 回调函数。
  58472. */
  58473. }, {
  58474. key: "get",
  58475. value: function get(params, callback) {
  58476. return this.client.get(params, this._handleCallback(callback));
  58477. }
  58478. /**
  58479. * @function ElasticSearch.prototype.getScript
  58480. * @description 获取脚本。</br>
  58481. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-getscript}</br>
  58482. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  58483. * @param {Object} params - 参数。
  58484. * @param {function} callback - 回调函数。
  58485. */
  58486. }, {
  58487. key: "getScript",
  58488. value: function getScript(params, callback) {
  58489. return this.client.getScript(params, this._handleCallback(callback));
  58490. }
  58491. /**
  58492. * @function ElasticSearch.prototype.getSource
  58493. * @description 通过索引,类型和ID获取文档的源。</br>
  58494. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-getsource}</br>
  58495. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  58496. * @param {Object} params - 参数。
  58497. * @param {function} callback - 回调函数。
  58498. */
  58499. }, {
  58500. key: "getSource",
  58501. value: function getSource(params, callback) {
  58502. return this.client.getSource(params, this._handleCallback(callback));
  58503. }
  58504. /**
  58505. * @function ElasticSearch.prototype.getTemplate
  58506. * @description 获取模板。</br>
  58507. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-gettemplate}</br>
  58508. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  58509. * @param {Object} params - 参数。
  58510. * @param {function} callback - 回调函数。
  58511. */
  58512. }, {
  58513. key: "getTemplate",
  58514. value: function getTemplate(params, callback) {
  58515. return this.client.getTemplate(params, this._handleCallback(callback));
  58516. }
  58517. /**
  58518. * @function ElasticSearch.prototype.index
  58519. * @description 在索引中存储一个键入的JSON文档,使其可搜索。</br>
  58520. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-index}</br>
  58521. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html}</br>
  58522. * @param {Object} params - 参数。
  58523. * @param {function} callback - 回调函数。
  58524. */
  58525. }, {
  58526. key: "index",
  58527. value: function index(params, callback) {
  58528. return this.client.index(params, this._handleCallback(callback));
  58529. }
  58530. /**
  58531. * @function ElasticSearch.prototype.info
  58532. * @description 从当前集群获取基本信息。</br>
  58533. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-info}</br>
  58534. * 更多信息参考 {@link https://www.elastic.co/guide/index.html}</br>
  58535. * @param {Object} params - 参数。
  58536. * @param {function} callback - 回调函数。
  58537. */
  58538. }, {
  58539. key: "info",
  58540. value: function info(params, callback) {
  58541. return this.client.info(params, this._handleCallback(callback));
  58542. }
  58543. /**
  58544. * @function ElasticSearch.prototype.mget
  58545. * @description 根据索引,类型(可选)和ids来获取多个文档。mget所需的主体可以采用两种形式:文档位置数组或文档ID数组。</br>
  58546. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-mget}</br>
  58547. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html}</br>
  58548. * @param {Object} params - 参数。
  58549. * @param {function} callback - 回调函数。
  58550. */
  58551. }, {
  58552. key: "mget",
  58553. value: function mget(params, callback) {
  58554. return this.client.mget(params, this._handleCallback(callback));
  58555. }
  58556. /**
  58557. * @function ElasticSearch.prototype.msearch
  58558. * @description 在同一请求中执行多个搜索请求。</br>
  58559. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-msearch}</br>
  58560. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html}</br>
  58561. * @param {Object} params - 参数。
  58562. * @param {function} callback - 请求返回的回调函数。也可以使用then表达式获取返回结果。
  58563. * 回调参数:error,response,结果存储在response.responses中。
  58564. */
  58565. }, {
  58566. key: "msearch",
  58567. value: function msearch(params, callback) {
  58568. var me = this;
  58569. return me.client.msearch(params).then(function (resp) {
  58570. resp = resp.body || resp;
  58571. me._update(resp.responses, callback);
  58572. return resp;
  58573. }, function (err) {
  58574. callback(err);
  58575. me.events.triggerEvent('error', {
  58576. error: err
  58577. });
  58578. return err;
  58579. });
  58580. }
  58581. /**
  58582. * @function ElasticSearch.prototype.msearchTemplate
  58583. * @description 在同一请求中执行多个搜索模板请求。</br>
  58584. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-msearchtemplate}</br>
  58585. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  58586. * @param {Object} params - 参数。
  58587. * @param {function} callback - 回调函数。
  58588. */
  58589. }, {
  58590. key: "msearchTemplate",
  58591. value: function msearchTemplate(params, callback) {
  58592. return this.client.msearchTemplate(params, this._handleCallback(callback));
  58593. }
  58594. /**
  58595. * @function ElasticSearch.prototype.mtermvectors
  58596. * @description 多termvectors API允许一次获得多个termvectors。</br>
  58597. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-mtermvectors}</br>
  58598. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-termvectors.html}</br>
  58599. * @param {Object} params - 参数。
  58600. * @param {function} callback - 回调函数。
  58601. */
  58602. }, {
  58603. key: "mtermvectors",
  58604. value: function mtermvectors(params, callback) {
  58605. return this.client.mtermvectors(params, this._handleCallback(callback));
  58606. }
  58607. /**
  58608. * @function ElasticSearch.prototype.ping
  58609. * @description 测试连接。</br>
  58610. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-ping}</br>
  58611. * 更多信息参考 {@link https://www.elastic.co/guide/index.html}</br>
  58612. * @param {Object} params - 参数。
  58613. * @param {function} callback - 回调函数。
  58614. */
  58615. }, {
  58616. key: "ping",
  58617. value: function ping(params, callback) {
  58618. return this.client.ping(params, this._handleCallback(callback));
  58619. }
  58620. /**
  58621. * @function ElasticSearch.prototype.putScript
  58622. * @description 添加脚本。</br>
  58623. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-putscript}</br>
  58624. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  58625. * @param {Object} params - 参数。
  58626. * @param {function} callback - 回调函数。
  58627. */
  58628. }, {
  58629. key: "putScript",
  58630. value: function putScript(params, callback) {
  58631. return this.client.putScript(params, this._handleCallback(callback));
  58632. }
  58633. /**
  58634. * @function ElasticSearch.prototype.putTemplate
  58635. * @description 添加模板。</br>
  58636. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-puttemplate}</br>
  58637. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  58638. * @param {Object} params - 参数。
  58639. * @param {function} callback - 回调函数。
  58640. */
  58641. }, {
  58642. key: "putTemplate",
  58643. value: function putTemplate(params, callback) {
  58644. return this.client.putTemplate(params, this._handleCallback(callback));
  58645. }
  58646. /**
  58647. * @function ElasticSearch.prototype.reindex
  58648. * @description 重新索引。</br>
  58649. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-reindex}</br>
  58650. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html}</br>
  58651. * @param {Object} params - 参数。
  58652. * @param {function} callback - 回调函数。
  58653. */
  58654. }, {
  58655. key: "reindex",
  58656. value: function reindex(params, callback) {
  58657. return this.client.reindex(params, this._handleCallback(callback));
  58658. }
  58659. /**
  58660. * @function ElasticSearch.prototype.reindexRessrottle
  58661. * @description 重新索引。</br>
  58662. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-reindexrethrottle}</br>
  58663. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html}</br>
  58664. * @param {Object} params - 参数。
  58665. * @param {function} callback - 回调函数。
  58666. */
  58667. }, {
  58668. key: "reindexRessrottle",
  58669. value: function reindexRessrottle(params, callback) {
  58670. return this.client.reindexRessrottle(params, this._handleCallback(callback));
  58671. }
  58672. /**
  58673. * @function ElasticSearch.prototype.renderSearchTemplate
  58674. * @description 搜索模板。</br>
  58675. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-rendersearchtemplate}</br>
  58676. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  58677. * @param {Object} params - 参数。
  58678. * @param {function} callback - 回调函数。
  58679. */
  58680. }, {
  58681. key: "renderSearchTemplate",
  58682. value: function renderSearchTemplate(params, callback) {
  58683. return this.client.renderSearchTemplate(params, this._handleCallback(callback));
  58684. }
  58685. /**
  58686. * @function ElasticSearch.prototype.scroll
  58687. * @description 在search()调用中指定滚动参数之后,滚动搜索请求(检索下一组结果)。</br>
  58688. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-scroll}</br>
  58689. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html}</br>
  58690. * @param {Object} params - 参数。
  58691. * @param {function} callback - 回调函数。
  58692. */
  58693. }, {
  58694. key: "scroll",
  58695. value: function scroll(params, callback) {
  58696. return this.client.scroll(params, this._handleCallback(callback));
  58697. }
  58698. /**
  58699. * @function ElasticSearch.prototype.search
  58700. * @description 在search()调用中指定滚动参数之后,滚动搜索请求(检索下一组结果)。
  58701. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-search}</br>
  58702. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html}</br>
  58703. * @param {Object} params - 参数。
  58704. * @param {function} callback - 请求返回的回调函数。也可以使用then表达式获取返回结果。
  58705. * 回调参数:error,response,结果存储在response.responses中。
  58706. */
  58707. }, {
  58708. key: "search",
  58709. value: function search(params, callback) {
  58710. var me = this;
  58711. return me.client.search(params).then(function (resp) {
  58712. resp = resp.body || resp;
  58713. me._update(resp, callback);
  58714. return resp;
  58715. }, function (err) {
  58716. callback && callback(err);
  58717. me.events.triggerEvent('error', {
  58718. error: err
  58719. });
  58720. return err;
  58721. });
  58722. }
  58723. /**
  58724. * @function ElasticSearch.prototype.searchShards
  58725. * @description 返回要执行搜索请求的索引和分片。
  58726. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-searchshards}</br>
  58727. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-shards.html}</br>
  58728. * @param {Object} params - 参数。
  58729. * @param {function} callback - 回调函数。
  58730. */
  58731. }, {
  58732. key: "searchShards",
  58733. value: function searchShards(params, callback) {
  58734. return this.client.searchShards(params, this._handleCallback(callback));
  58735. }
  58736. /**
  58737. * @function ElasticSearch.prototype.searchTemplate
  58738. * @description 搜索模板。
  58739. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-searchtemplate}</br>
  58740. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html}</br>
  58741. * @param {Object} params - 参数。
  58742. * @param {function} callback - 回调函数。
  58743. */
  58744. }, {
  58745. key: "searchTemplate",
  58746. value: function searchTemplate(params, callback) {
  58747. return this.client.searchTemplate(params, this._handleCallback(callback));
  58748. }
  58749. /**
  58750. * @function ElasticSearch.prototype.suggest
  58751. * @description 该建议功能通过使用特定的建议者,基于所提供的文本来建议类似的术语。
  58752. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-suggest}</br>
  58753. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html}</br>
  58754. * @param {Object} params - 参数。
  58755. * @param {function} callback - 回调函数。
  58756. */
  58757. }, {
  58758. key: "suggest",
  58759. value: function suggest(params, callback) {
  58760. return this.client.suggest(params, this._handleCallback(callback));
  58761. }
  58762. /**
  58763. * @function ElasticSearch.prototype.termvectors
  58764. * @description 返回有关特定文档字段中的术语的信息和统计信息。
  58765. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-termvectors}</br>
  58766. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-termvectors.html}</br>
  58767. * @param {Object} params - 参数。
  58768. * @param {function} callback - 回调函数。
  58769. */
  58770. }, {
  58771. key: "termvectors",
  58772. value: function termvectors(params, callback) {
  58773. return this.client.termvectors(params, this._handleCallback(callback));
  58774. }
  58775. /**
  58776. * @function ElasticSearch.prototype.update
  58777. * @description 更新文档的部分。
  58778. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-update}</br>
  58779. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html}</br>
  58780. * @param {Object} params - 参数。
  58781. * @param {function} callback - 回调函数。
  58782. */
  58783. }, {
  58784. key: "update",
  58785. value: function update(params, callback) {
  58786. return this.client.update(params, this._handleCallback(callback));
  58787. }
  58788. /**
  58789. * @function ElasticSearch.prototype.updateByQuery
  58790. * @description 通过查询API来更新文档。
  58791. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-updatebyquery}</br>
  58792. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html}</br>
  58793. * @param {Object} params - 参数。
  58794. * @param {function} callback - 回调函数。
  58795. */
  58796. }, {
  58797. key: "updateByQuery",
  58798. value: function updateByQuery(params, callback) {
  58799. return this.client.updateByQuery(params, this._handleCallback(callback));
  58800. }
  58801. /**
  58802. * @function ElasticSearch.prototype._handleCallback
  58803. * @description 处理ElasticSearch 16.x和5.x的callback兼容。 5.x的回调参数多包了一层body
  58804. * @param {function} callback - 回调函数。
  58805. * @private
  58806. */
  58807. }, {
  58808. key: "_handleCallback",
  58809. value: function _handleCallback(callback) {
  58810. return function () {
  58811. var args = Array.from(arguments);
  58812. var error = args.shift();
  58813. var resp = args.shift();
  58814. var body = resp && resp.body;
  58815. if (body) {
  58816. var _resp2 = resp,
  58817. statusCode = _resp2.statusCode,
  58818. headers = _resp2.headers;
  58819. args = [statusCode, headers];
  58820. resp = body;
  58821. }
  58822. callback.call.apply(callback, [this, error, resp].concat(ElasticSearch_toConsumableArray(args)));
  58823. };
  58824. }
  58825. }, {
  58826. key: "_update",
  58827. value: function _update(data, callback) {
  58828. var me = this;
  58829. if (!data) {
  58830. return;
  58831. }
  58832. me.data = data;
  58833. if (me.openGeoFence && me.geoFence) {
  58834. me._validateDatas(data);
  58835. }
  58836. me.events.triggerEvent('change', {
  58837. data: me.data
  58838. });
  58839. //change方法已废弃,不建议使用。建议使用search方法的第二个参数传入请求成功的回调
  58840. if (me.change) {
  58841. me.change && me.change(data);
  58842. } else {
  58843. //加responses是为了保持跟原来es自身的数据结构一致
  58844. callback && callback(undefined, {
  58845. responses: data
  58846. });
  58847. }
  58848. }
  58849. }, {
  58850. key: "_validateDatas",
  58851. value: function _validateDatas(datas) {
  58852. if (!datas) {
  58853. return;
  58854. }
  58855. if (!(datas instanceof Array)) {
  58856. datas = [datas];
  58857. }
  58858. var i,
  58859. len = datas.length;
  58860. for (i = 0; i < len; i++) {
  58861. this._validateData(datas[i]);
  58862. }
  58863. }
  58864. }, {
  58865. key: "_validateData",
  58866. value: function _validateData(data) {
  58867. var me = this;
  58868. data.hits.hits.map(function (source) {
  58869. var content = source._source;
  58870. var meterUnit = me._getMeterPerMapUnit(me.geoFence.unit);
  58871. var geoFenceCX = me.geoFence.center[0] * meterUnit;
  58872. var geoFenceCY = me.geoFence.center[1] * meterUnit;
  58873. var contentX = content.x * meterUnit;
  58874. var contentY = content.y * meterUnit;
  58875. var distance = me._distance(contentX, contentY, geoFenceCX, geoFenceCY);
  58876. var radius = me.geoFence.radius;
  58877. if (distance > radius) {
  58878. me.outOfGeoFence && me.outOfGeoFence(data);
  58879. me.events.triggerEvent('outOfGeoFence', {
  58880. data: data
  58881. });
  58882. }
  58883. return source;
  58884. });
  58885. }
  58886. }, {
  58887. key: "_distance",
  58888. value: function _distance(x1, y1, x2, y2) {
  58889. return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
  58890. }
  58891. }, {
  58892. key: "_getMeterPerMapUnit",
  58893. value: function _getMeterPerMapUnit(mapUnit) {
  58894. var earchRadiusInMeters = 6378137;
  58895. var meterPerMapUnit;
  58896. if (mapUnit === 'meter') {
  58897. meterPerMapUnit = 1;
  58898. } else if (mapUnit === 'degree') {
  58899. // 每度表示多少米。
  58900. meterPerMapUnit = Math.PI * 2 * earchRadiusInMeters / 360;
  58901. }
  58902. return meterPerMapUnit;
  58903. }
  58904. }]);
  58905. return ElasticSearch;
  58906. }();
  58907. ;// CONCATENATED MODULE: ./src/common/thirdparty/elasticsearch/index.js
  58908. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  58909. * This program are made available under the terms of the Apache License, Version 2.0
  58910. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  58911. ;// CONCATENATED MODULE: ./src/common/thirdparty/index.js
  58912. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  58913. * This program are made available under the terms of the Apache License, Version 2.0
  58914. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  58915. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Util.js
  58916. function Util_typeof(obj) { "@babel/helpers - typeof"; return Util_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Util_typeof(obj); }
  58917. function Util_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  58918. function Util_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  58919. function Util_createClass(Constructor, protoProps, staticProps) { if (protoProps) Util_defineProperties(Constructor.prototype, protoProps); if (staticProps) Util_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  58920. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  58921. * This program are made available under the terms of the Apache License, Version 2.0
  58922. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  58923. /**
  58924. * @private
  58925. * @class LevelRenderer.Tool.Util
  58926. * @category Visualization Theme
  58927. * LevelRenderer 基础工具类
  58928. *
  58929. */
  58930. var levelRenderer_Util_Util = /*#__PURE__*/function () {
  58931. function Util() {
  58932. Util_classCallCheck(this, Util);
  58933. /**
  58934. * @member {Object} LevelRenderer.Tool.Util.prototype.BUILTIN_OBJECT
  58935. * @description 用于处理merge时无法遍历Date等对象的问题
  58936. */
  58937. this.BUILTIN_OBJECT = {
  58938. '[object Function]': 1,
  58939. '[object RegExp]': 1,
  58940. '[object Date]': 1,
  58941. '[object Error]': 1,
  58942. '[object CanvasGradient]': 1
  58943. };
  58944. /**
  58945. * @member {Object} LevelRenderer.Tool.Util.prototype._ctx
  58946. */
  58947. this._ctx = null;
  58948. /**
  58949. * Property: _canvas
  58950. * {Object}
  58951. */
  58952. this._canvas = null;
  58953. /**
  58954. * Property: _pixelCtx
  58955. * {Object}
  58956. */
  58957. this._pixelCtx = null;
  58958. /**
  58959. * Property: _width
  58960. * {Object}
  58961. */
  58962. this._width = null;
  58963. /**
  58964. * Property: _height
  58965. * {Object}
  58966. */
  58967. this._height = null;
  58968. /**
  58969. * Property: _offsetX
  58970. * {Object}
  58971. */
  58972. this._offsetX = 0;
  58973. /**
  58974. * Property: _offsetY
  58975. * {Object}
  58976. */
  58977. this._offsetY = 0;
  58978. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Util";
  58979. }
  58980. /**
  58981. * @function LevelRenderer.Tool.Util.prototype.clone
  58982. * @description 对一个object进行深度拷贝。
  58983. *
  58984. * @param {Object} source - 需要进行拷贝的对象。
  58985. * @return {Object} 拷贝后的新对象。
  58986. */
  58987. Util_createClass(Util, [{
  58988. key: "clone",
  58989. value: function clone(source) {
  58990. var BUILTIN_OBJECT = this.BUILTIN_OBJECT;
  58991. if (Util_typeof(source) == 'object' && source !== null) {
  58992. var result = source;
  58993. if (source instanceof Array) {
  58994. result = [];
  58995. for (var i = 0, len = source.length; i < len; i++) {
  58996. result[i] = this.clone(source[i]);
  58997. }
  58998. } else if (!BUILTIN_OBJECT[Object.prototype.toString.call(source)]) {
  58999. result = {};
  59000. for (var key in source) {
  59001. if (source.hasOwnProperty(key)) {
  59002. result[key] = this.clone(source[key]);
  59003. }
  59004. }
  59005. }
  59006. return result;
  59007. }
  59008. return source;
  59009. }
  59010. /**
  59011. * @function LevelRenderer.Tool.Util.prototype.mergeItem
  59012. * @description 合并源对象的单个属性到目标对象。
  59013. *
  59014. * @param {Object} target - 目标对象。
  59015. * @param {Object} source - 源对象。
  59016. * @param {string} key - 键。
  59017. * @param {boolean} overwrite - 是否覆盖。
  59018. * @return {Object} 目标对象
  59019. */
  59020. }, {
  59021. key: "mergeItem",
  59022. value: function mergeItem(target, source, key, overwrite) {
  59023. var BUILTIN_OBJECT = this.BUILTIN_OBJECT;
  59024. if (source.hasOwnProperty(key)) {
  59025. if (Util_typeof(target[key]) == 'object' && !BUILTIN_OBJECT[Object.prototype.toString.call(target[key])]) {
  59026. // 如果需要递归覆盖,就递归调用merge
  59027. this.merge(target[key], source[key], overwrite);
  59028. } else if (overwrite || !(key in target)) {
  59029. // 否则只处理overwrite为true,或者在目标对象中没有此属性的情况
  59030. target[key] = source[key];
  59031. }
  59032. }
  59033. }
  59034. /**
  59035. * @function LevelRenderer.Tool.Util.prototype.merge
  59036. * @description 合并源对象的属性到目标对象。
  59037. *
  59038. * @param {Object} target - 目标对象。
  59039. * @param {Object} source - 源对象。
  59040. * @param {boolean} overwrite - 是否覆盖。
  59041. * @return {Object} 目标对象。
  59042. */
  59043. }, {
  59044. key: "merge",
  59045. value: function merge(target, source, overwrite) {
  59046. for (var i in source) {
  59047. this.mergeItem(target, source, i, overwrite);
  59048. }
  59049. return target;
  59050. }
  59051. /**
  59052. * @function LevelRenderer.Tool.Util.prototype.getContext
  59053. * @description 获取 Canvas 上下文。
  59054. * @return {Object} 上下文。
  59055. */
  59056. }, {
  59057. key: "getContext",
  59058. value: function getContext() {
  59059. if (!this._ctx) {
  59060. this._ctx = document.createElement('canvas').getContext('2d');
  59061. }
  59062. return this._ctx;
  59063. }
  59064. /**
  59065. * @function LevelRenderer.Tool.Util.prototype.getPixelContext
  59066. * @description 获取像素拾取专用的上下文。
  59067. * @return {Object} 像素拾取专用的上下文。
  59068. */
  59069. }, {
  59070. key: "getPixelContext",
  59071. value: function getPixelContext() {
  59072. if (!this._pixelCtx) {
  59073. this._canvas = document.createElement('canvas');
  59074. this._width = this._canvas.width;
  59075. this._height = this._canvas.height;
  59076. this._pixelCtx = this._canvas.getContext('2d');
  59077. }
  59078. return this._pixelCtx;
  59079. }
  59080. /**
  59081. * @function LevelRenderer.Tool.Util.prototype.adjustCanvasSize
  59082. * @description 如果坐标处在_canvas外部,改变_canvas的大小,修改canvas的大小 需要重新设置translate
  59083. *
  59084. * @param {number} x - 横坐标。
  59085. * @param {number} y - 纵坐标。
  59086. *
  59087. */
  59088. }, {
  59089. key: "adjustCanvasSize",
  59090. value: function adjustCanvasSize(x, y) {
  59091. var _canvas = this._canvas;
  59092. var _pixelCtx = this._pixelCtx;
  59093. var _width = this._width;
  59094. var _height = this._height;
  59095. var _offsetX = this._offsetX;
  59096. var _offsetY = this._offsetY;
  59097. // 每次加的长度
  59098. var _v = 100;
  59099. var _flag;
  59100. if (x + _offsetX > _width) {
  59101. _width = x + _offsetX + _v;
  59102. _canvas.width = _width;
  59103. _flag = true;
  59104. }
  59105. if (y + _offsetY > _height) {
  59106. _height = y + _offsetY + _v;
  59107. _canvas.height = _height;
  59108. _flag = true;
  59109. }
  59110. if (x < -_offsetX) {
  59111. _offsetX = Math.ceil(-x / _v) * _v;
  59112. _width += _offsetX;
  59113. _canvas.width = _width;
  59114. _flag = true;
  59115. }
  59116. if (y < -_offsetY) {
  59117. _offsetY = Math.ceil(-y / _v) * _v;
  59118. _height += _offsetY;
  59119. _canvas.height = _height;
  59120. _flag = true;
  59121. }
  59122. if (_flag) {
  59123. _pixelCtx.translate(_offsetX, _offsetY);
  59124. }
  59125. }
  59126. /**
  59127. * @function LevelRenderer.Tool.Util.prototype.getPixelOffset
  59128. * @description 获取像素canvas的偏移量。
  59129. * @return {Object} 偏移量。
  59130. */
  59131. }, {
  59132. key: "getPixelOffset",
  59133. value: function getPixelOffset() {
  59134. return {
  59135. x: this._offsetX,
  59136. y: this._offsetY
  59137. };
  59138. }
  59139. /**
  59140. * @function LevelRenderer.Tool.Util.prototype.indexOf
  59141. * @description 查询数组中元素的index
  59142. * @return {Object} 偏移量。
  59143. */
  59144. }, {
  59145. key: "indexOf",
  59146. value: function indexOf(array, value) {
  59147. if (array.indexOf) {
  59148. return array.indexOf(value);
  59149. }
  59150. for (var i = 0, len = array.length; i < len; i++) {
  59151. if (array[i] === value) {
  59152. return i;
  59153. }
  59154. }
  59155. return -1;
  59156. }
  59157. /**
  59158. * @function LevelRenderer.Tool.Util.prototype.inherits
  59159. * @description 构造类继承关系
  59160. *
  59161. * @param {function} clazz - 源类。
  59162. * @param {function} baseClazz - 基类。
  59163. * @return {Object} 偏移量。
  59164. */
  59165. }, {
  59166. key: "inherits",
  59167. value: function inherits(clazz, baseClazz) {
  59168. var clazzPrototype = clazz.prototype;
  59169. function F() {}
  59170. F.prototype = baseClazz.prototype;
  59171. clazz.prototype = new F();
  59172. for (var prop in clazzPrototype) {
  59173. clazz.prototype[prop] = clazzPrototype[prop];
  59174. }
  59175. clazz.constructor = clazz;
  59176. }
  59177. }]);
  59178. return Util;
  59179. }();
  59180. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Color.js
  59181. function Color_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  59182. function Color_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  59183. function Color_createClass(Constructor, protoProps, staticProps) { if (protoProps) Color_defineProperties(Constructor.prototype, protoProps); if (staticProps) Color_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  59184. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  59185. * This program are made available under the terms of the Apache License, Version 2.0
  59186. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  59187. /**
  59188. * @class LevelRenderer.Tool.Color
  59189. * @category Visualization Theme
  59190. * @classdesc LevelRenderer 工具-颜色辅助类
  59191. * @private
  59192. */
  59193. var Color = /*#__PURE__*/function () {
  59194. function Color() {
  59195. Color_classCallCheck(this, Color);
  59196. /**
  59197. * @member {LevelRenderer.Tool.Util} LevelRenderer.Tool.Color.prototype.util
  59198. * @description LevelRenderer 基础工具对象。
  59199. */
  59200. this.util = new levelRenderer_Util_Util();
  59201. /**
  59202. * @member {Object} LevelRenderer.Tool.Color.prototype._ctx
  59203. * @description _ctx。
  59204. */
  59205. this._ctx = null;
  59206. /**
  59207. * @member {Array.<string>} LevelRenderer.Tool.Color.prototype.palette
  59208. * @description 默认色板。色板是一个包含图表默认颜色系列的数组,当色板中所有颜色被使用过后,又将从新回到色板中的第一个颜色。
  59209. */
  59210. this.palette = ['#ff9277', ' #dddd00', ' #ffc877', ' #bbe3ff', ' #d5ffbb', '#bbbbff', ' #ddb000', ' #b0dd00', ' #e2bbff', ' #ffbbe3', '#ff7777', ' #ff9900', ' #83dd00', ' #77e3ff', ' #778fff', '#c877ff', ' #ff77ab', ' #ff6600', ' #aa8800', ' #77c7ff', '#ad77ff', ' #ff77ff', ' #dd0083', ' #777700', ' #00aa00', '#0088aa', ' #8400dd', ' #aa0088', ' #dd0000', ' #772e00'];
  59211. /**
  59212. * @member {Array.<string>} LevelRenderer.Tool.Color.prototype._palette
  59213. * @description 复位色板,用于复位 palette
  59214. */
  59215. this._palette = this.palette;
  59216. /**
  59217. * @member {string} LevelRenderer.Tool.Color.prototype.highlightColor
  59218. * @description 高亮色
  59219. */
  59220. this.highlightColor = 'rgba(0,0,255,1)';
  59221. /**
  59222. * @member {string} LevelRenderer.Tool.Color.prototype._highlightColor
  59223. * @description 复位高亮色
  59224. */
  59225. this._highlightColor = this.highlightColor;
  59226. /**
  59227. * @member {string} LevelRenderer.Tool.Color.prototype.colorRegExp
  59228. * @description 颜色格式,正则表达式。
  59229. */
  59230. this.colorRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i;
  59231. /**
  59232. * @member {string} LevelRenderer.Tool.Color.prototype._nameColors
  59233. * @description 颜色名。
  59234. */
  59235. this._nameColors = {
  59236. aliceblue: '#f0f8ff',
  59237. antiquewhite: '#faebd7',
  59238. aqua: '#0ff',
  59239. aquamarine: '#7fffd4',
  59240. azure: '#f0ffff',
  59241. beige: '#f5f5dc',
  59242. bisque: '#ffe4c4',
  59243. black: '#000',
  59244. blanchedalmond: '#ffebcd',
  59245. blue: '#00f',
  59246. blueviolet: '#8a2be2',
  59247. brown: '#a52a2a',
  59248. burlywood: '#deb887',
  59249. cadetblue: '#5f9ea0',
  59250. chartreuse: '#7fff00',
  59251. chocolate: '#d2691e',
  59252. coral: '#ff7f50',
  59253. cornflowerblue: '#6495ed',
  59254. cornsilk: '#fff8dc',
  59255. crimson: '#dc143c',
  59256. cyan: '#0ff',
  59257. darkblue: '#00008b',
  59258. darkcyan: '#008b8b',
  59259. darkgoldenrod: '#b8860b',
  59260. darkgray: '#a9a9a9',
  59261. darkgrey: '#a9a9a9',
  59262. darkgreen: '#006400',
  59263. darkkhaki: '#bdb76b',
  59264. darkmagenta: '#8b008b',
  59265. darkolivegreen: '#556b2f',
  59266. darkorange: '#ff8c00',
  59267. darkorchid: '#9932cc',
  59268. darkred: '#8b0000',
  59269. darksalmon: '#e9967a',
  59270. darkseagreen: '#8fbc8f',
  59271. darkslateblue: '#483d8b',
  59272. darkslategray: '#2f4f4f',
  59273. darkslategrey: '#2f4f4f',
  59274. darkturquoise: '#00ced1',
  59275. darkviolet: '#9400d3',
  59276. deeppink: '#ff1493',
  59277. deepskyblue: '#00bfff',
  59278. dimgray: '#696969',
  59279. dimgrey: '#696969',
  59280. dodgerblue: '#1e90ff',
  59281. firebrick: '#b22222',
  59282. floralwhite: '#fffaf0',
  59283. forestgreen: '#228b22',
  59284. fuchsia: '#f0f',
  59285. gainsboro: '#dcdcdc',
  59286. ghostwhite: '#f8f8ff',
  59287. gold: '#ffd700',
  59288. goldenrod: '#daa520',
  59289. gray: '#808080',
  59290. grey: '#808080',
  59291. green: '#008000',
  59292. greenyellow: '#adff2f',
  59293. honeydew: '#f0fff0',
  59294. hotpink: '#ff69b4',
  59295. indianred: '#cd5c5c',
  59296. indigo: '#4b0082',
  59297. ivory: '#fffff0',
  59298. khaki: '#f0e68c',
  59299. lavender: '#e6e6fa',
  59300. lavenderblush: '#fff0f5',
  59301. lawngreen: '#7cfc00',
  59302. lemonchiffon: '#fffacd',
  59303. lightblue: '#add8e6',
  59304. lightcoral: '#f08080',
  59305. lightcyan: '#e0ffff',
  59306. lightgoldenrodyellow: '#fafad2',
  59307. lightgray: '#d3d3d3',
  59308. lightgrey: '#d3d3d3',
  59309. lightgreen: '#90ee90',
  59310. lightpink: '#ffb6c1',
  59311. lightsalmon: '#ffa07a',
  59312. lightseagreen: '#20b2aa',
  59313. lightskyblue: '#87cefa',
  59314. lightslategray: '#789',
  59315. lightslategrey: '#789',
  59316. lightsteelblue: '#b0c4de',
  59317. lightyellow: '#ffffe0',
  59318. lime: '#0f0',
  59319. limegreen: '#32cd32',
  59320. linen: '#faf0e6',
  59321. magenta: '#f0f',
  59322. maroon: '#800000',
  59323. mediumaquamarine: '#66cdaa',
  59324. mediumblue: '#0000cd',
  59325. mediumorchid: '#ba55d3',
  59326. mediumpurple: '#9370d8',
  59327. mediumseagreen: '#3cb371',
  59328. mediumslateblue: '#7b68ee',
  59329. mediumspringgreen: '#00fa9a',
  59330. mediumturquoise: '#48d1cc',
  59331. mediumvioletred: '#c71585',
  59332. midnightblue: '#191970',
  59333. mintcream: '#f5fffa',
  59334. mistyrose: '#ffe4e1',
  59335. moccasin: '#ffe4b5',
  59336. navajowhite: '#ffdead',
  59337. navy: '#000080',
  59338. oldlace: '#fdf5e6',
  59339. olive: '#808000',
  59340. olivedrab: '#6b8e23',
  59341. orange: '#ffa500',
  59342. orangered: '#ff4500',
  59343. orchid: '#da70d6',
  59344. palegoldenrod: '#eee8aa',
  59345. palegreen: '#98fb98',
  59346. paleturquoise: '#afeeee',
  59347. palevioletred: '#d87093',
  59348. papayawhip: '#ffefd5',
  59349. peachpuff: '#ffdab9',
  59350. peru: '#cd853f',
  59351. pink: '#ffc0cb',
  59352. plum: '#dda0dd',
  59353. powderblue: '#b0e0e6',
  59354. purple: '#800080',
  59355. red: '#f00',
  59356. rosybrown: '#bc8f8f',
  59357. royalblue: '#4169e1',
  59358. saddlebrown: '#8b4513',
  59359. salmon: '#fa8072',
  59360. sandybrown: '#f4a460',
  59361. seagreen: '#2e8b57',
  59362. seashell: '#fff5ee',
  59363. sienna: '#a0522d',
  59364. silver: '#c0c0c0',
  59365. skyblue: '#87ceeb',
  59366. slateblue: '#6a5acd',
  59367. slategray: '#708090',
  59368. slategrey: '#708090',
  59369. snow: '#fffafa',
  59370. springgreen: '#00ff7f',
  59371. steelblue: '#4682b4',
  59372. tan: '#d2b48c',
  59373. teal: '#008080',
  59374. thistle: '#d8bfd8',
  59375. tomato: '#ff6347',
  59376. turquoise: '#40e0d0',
  59377. violet: '#ee82ee',
  59378. wheat: '#f5deb3',
  59379. white: '#fff',
  59380. whitesmoke: '#f5f5f5',
  59381. yellow: '#ff0',
  59382. yellowgreen: '#9acd32'
  59383. };
  59384. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Color";
  59385. }
  59386. /**
  59387. * @function LevelRenderer.Tool.Color.prototype.customPalette
  59388. * @description 自定义调色板。
  59389. * @param {Array.<string>} userPalete - 颜色板。
  59390. */
  59391. Color_createClass(Color, [{
  59392. key: "customPalette",
  59393. value: function customPalette(userPalete) {
  59394. this.palette = userPalete;
  59395. }
  59396. /**
  59397. * @function LevelRenderer.Tool.Color.prototype.resetPalette
  59398. * @description 复位默认色板。
  59399. */
  59400. }, {
  59401. key: "resetPalette",
  59402. value: function resetPalette() {
  59403. this.palette = this._palette;
  59404. }
  59405. /**
  59406. * @function LevelRenderer.Tool.Color.prototype.getColor
  59407. * @description 获取色板颜色。
  59408. * @param {number} idx - 色板位置。
  59409. * @param {Array.<string>} userPalete - 色板。
  59410. * @returns {string} 颜色值。
  59411. */
  59412. }, {
  59413. key: "getColor",
  59414. value: function getColor(idx, userPalete) {
  59415. idx = idx | 0;
  59416. userPalete = userPalete || this.palette;
  59417. return userPalete[idx % userPalete.length];
  59418. }
  59419. /**
  59420. * @function LevelRenderer.Tool.Color.prototype.customHighlight
  59421. * @description 自定义默认高亮颜色。
  59422. * @param {string} userHighlightColor - 自定义高亮色。
  59423. */
  59424. }, {
  59425. key: "customHighlight",
  59426. value: function customHighlight(userHighlightColor) {
  59427. this.highlightColor = userHighlightColor;
  59428. }
  59429. /**
  59430. * @function LevelRenderer.Tool.Color.prototype.resetHighlight
  59431. * @description 重置默认高亮颜色。将当前的高亮色作为默认高亮颜色
  59432. */
  59433. }, {
  59434. key: "resetHighlight",
  59435. value: function resetHighlight() {
  59436. this.highlightColor = this._highlightColor;
  59437. }
  59438. /**
  59439. * @function LevelRenderer.Tool.Color.prototype.getHighlightColor
  59440. * @description 获取默认高亮颜色
  59441. * @returns {string} 颜色值。
  59442. */
  59443. }, {
  59444. key: "getHighlightColor",
  59445. value: function getHighlightColor() {
  59446. return this.highlightColor;
  59447. }
  59448. /**
  59449. * @function LevelRenderer.Tool.Color.prototype.getRadialGradient
  59450. * @description 径向渐变。
  59451. * @param {number} x0 - 渐变起点横坐标。
  59452. * @param {number} y0 - 渐变起点纵坐标。
  59453. * @param {number} r0 - 半径
  59454. * @param {number} x1 - 渐变终点横坐标。
  59455. * @param {number} y1 - 渐变终点纵坐标。
  59456. * @param {number} r1 - 半径
  59457. * @param {Array} colorList - 颜色列表。
  59458. * @returns {CanvasGradient} Cavans 渐变颜色。
  59459. */
  59460. }, {
  59461. key: "getRadialGradient",
  59462. value: function getRadialGradient(x0, y0, r0, x1, y1, r1, colorList) {
  59463. var util = this.util;
  59464. if (!this._ctx) {
  59465. this._ctx = util.getContext();
  59466. }
  59467. var gradient = this._ctx.createRadialGradient(x0, y0, r0, x1, y1, r1);
  59468. for (var i = 0, l = colorList.length; i < l; i++) {
  59469. gradient.addColorStop(colorList[i][0], colorList[i][1]);
  59470. }
  59471. gradient.__nonRecursion = true;
  59472. return gradient;
  59473. }
  59474. /**
  59475. * @function LevelRenderer.Tool.Color.prototype.getLinearGradient
  59476. * @description 线性渐变。
  59477. * @param {number} x0 - 渐变起点横坐标。
  59478. * @param {number} y0 - 渐变起点纵坐标。
  59479. * @param {number} x1 - 渐变终点横坐标。
  59480. * @param {number} y1 - 渐变终点纵坐标。
  59481. * @param {Array} colorList - 颜色列表。
  59482. * @returns {CanvasGradient} Cavans 渐变颜色。
  59483. */
  59484. }, {
  59485. key: "getLinearGradient",
  59486. value: function getLinearGradient(x0, y0, x1, y1, colorList) {
  59487. var util = this.util;
  59488. if (!this._ctx) {
  59489. this._ctx = util.getContext();
  59490. }
  59491. var gradient = this._ctx.createLinearGradient(x0, y0, x1, y1);
  59492. for (var i = 0, l = colorList.length; i < l; i++) {
  59493. gradient.addColorStop(colorList[i][0], colorList[i][1]);
  59494. }
  59495. gradient.__nonRecursion = true;
  59496. return gradient;
  59497. }
  59498. /**
  59499. * @function LevelRenderer.Tool.Color.prototype.getStepColors
  59500. * @description 获取两种颜色之间渐变颜色数组。
  59501. * @param {Object} start - 起始颜色对象。
  59502. * @param {Object} end - 结束颜色对象。
  59503. * @param {number} step - 渐变级数。
  59504. * @returns {Array} 颜色数组。
  59505. */
  59506. }, {
  59507. key: "getStepColors",
  59508. value: function getStepColors(start, end, step) {
  59509. start = this.toRGBA(start);
  59510. end = this.toRGBA(end);
  59511. start = this.getData(start);
  59512. end = this.getData(end);
  59513. var colors = [];
  59514. var stepR = (end[0] - start[0]) / step;
  59515. var stepG = (end[1] - start[1]) / step;
  59516. var stepB = (end[2] - start[2]) / step;
  59517. var stepA = (end[3] - start[3]) / step;
  59518. // 生成颜色集合
  59519. // fix by linfeng 颜色堆积
  59520. for (var i = 0, r = start[0], g = start[1], b = start[2], a = start[3]; i < step; i++) {
  59521. colors[i] = this.toColor([this.adjust(Math.floor(r), [0, 255]), this.adjust(Math.floor(g), [0, 255]), this.adjust(Math.floor(b), [0, 255]), a.toFixed(4) - 0], 'rgba');
  59522. r += stepR;
  59523. g += stepG;
  59524. b += stepB;
  59525. a += stepA;
  59526. }
  59527. r = end[0];
  59528. g = end[1];
  59529. b = end[2];
  59530. a = end[3];
  59531. colors[i] = this.toColor([r, g, b, a], 'rgba');
  59532. return colors;
  59533. }
  59534. /**
  59535. * @function LevelRenderer.Tool.Color.prototype.getGradientColors
  59536. * @description 获取指定级数的渐变颜色数组。
  59537. * @param {Array.<string>} colors - 颜色数组。
  59538. * @param {number} [step=20] - 渐变级数。
  59539. * @returns {Array.<string>} 颜色数组。
  59540. */
  59541. }, {
  59542. key: "getGradientColors",
  59543. value: function getGradientColors(colors, step) {
  59544. var ret = [];
  59545. var len = colors.length;
  59546. if (step === undefined) {
  59547. step = 20;
  59548. }
  59549. if (len === 1) {
  59550. ret = this.getStepColors(colors[0], colors[0], step);
  59551. } else if (len > 1) {
  59552. for (var i = 0, n = len - 1; i < n; i++) {
  59553. var steps = this.getStepColors(colors[i], colors[i + 1], step);
  59554. if (i < n - 1) {
  59555. steps.pop();
  59556. }
  59557. ret = ret.concat(steps);
  59558. }
  59559. }
  59560. return ret;
  59561. }
  59562. /**
  59563. * @function LevelRenderer.Tool.Color.prototype.toColor
  59564. * @description 颜色值数组转为指定格式颜色。
  59565. * @param {Array} data - 颜色值数组。
  59566. * @param {string} format - 格式,默认'rgb'
  59567. * @returns {string} 颜色。
  59568. */
  59569. }, {
  59570. key: "toColor",
  59571. value: function toColor(data, format) {
  59572. format = format || 'rgb';
  59573. if (data && (data.length === 3 || data.length === 4)) {
  59574. data = this.map(data, function (c) {
  59575. return c > 1 ? Math.ceil(c) : c;
  59576. });
  59577. if (format.indexOf('hex') > -1) {
  59578. return '#' + ((1 << 24) + (data[0] << 16) + (data[1] << 8) + +data[2]).toString(16).slice(1);
  59579. } else if (format.indexOf('hs') > -1) {
  59580. var sx = this.map(data.slice(1, 3), function (c) {
  59581. return c + '%';
  59582. });
  59583. data[1] = sx[0];
  59584. data[2] = sx[1];
  59585. }
  59586. if (format.indexOf('a') > -1) {
  59587. if (data.length === 3) {
  59588. data.push(1);
  59589. }
  59590. data[3] = this.adjust(data[3], [0, 1]);
  59591. return format + '(' + data.slice(0, 4).join(',') + ')';
  59592. }
  59593. return format + '(' + data.slice(0, 3).join(',') + ')';
  59594. }
  59595. }
  59596. /**
  59597. * @function LevelRenderer.Tool.Color.prototype.toArray
  59598. * @description 颜色字符串转换为rgba数组。
  59599. * @param {string} color - 颜色。
  59600. * @returns {Array.<number>} 颜色值数组。
  59601. */
  59602. }, {
  59603. key: "toArray",
  59604. value: function toArray(color) {
  59605. color = this.trim(color);
  59606. if (color.indexOf('rgba') < 0) {
  59607. color = this.toRGBA(color);
  59608. }
  59609. var data = [];
  59610. var i = 0;
  59611. color.replace(/[\d.]+/g, function (n) {
  59612. if (i < 3) {
  59613. n = n | 0;
  59614. } else {
  59615. // Alpha
  59616. n = +n;
  59617. }
  59618. data[i++] = n;
  59619. });
  59620. return data;
  59621. }
  59622. /**
  59623. * @function LevelRenderer.Tool.Color.prototype.convert
  59624. * @description 颜色格式转化。
  59625. * @param {Array} data - 颜色值数组。
  59626. * @param {string} format - 格式,默认'rgb'
  59627. * @returns {string} 颜色。
  59628. */
  59629. }, {
  59630. key: "convert",
  59631. value: function convert(color, format) {
  59632. if (!this.isCalculableColor(color)) {
  59633. return color;
  59634. }
  59635. var data = this.getData(color);
  59636. var alpha = data[3];
  59637. if (typeof alpha === 'undefined') {
  59638. alpha = 1;
  59639. }
  59640. if (color.indexOf('hsb') > -1) {
  59641. data = this._HSV_2_RGB(data);
  59642. } else if (color.indexOf('hsl') > -1) {
  59643. data = this._HSL_2_RGB(data);
  59644. }
  59645. if (format.indexOf('hsb') > -1 || format.indexOf('hsv') > -1) {
  59646. data = this._RGB_2_HSB(data);
  59647. } else if (format.indexOf('hsl') > -1) {
  59648. data = this._RGB_2_HSL(data);
  59649. }
  59650. data[3] = alpha;
  59651. return this.toColor(data, format);
  59652. }
  59653. /**
  59654. * @function LevelRenderer.Tool.Color.prototype.toRGBA
  59655. * @description 转换为rgba格式的颜色。
  59656. * @param {string} color - 颜色。
  59657. * @returns {string} 颜色。
  59658. */
  59659. }, {
  59660. key: "toRGBA",
  59661. value: function toRGBA(color) {
  59662. return this.convert(color, 'rgba');
  59663. }
  59664. /**
  59665. * @function LevelRenderer.Tool.Color.prototype.toRGB
  59666. * @description 转换为rgb数字格式的颜色。
  59667. * @param {string} color - 颜色。
  59668. * @returns {string} 颜色。
  59669. */
  59670. }, {
  59671. key: "toRGB",
  59672. value: function toRGB(color) {
  59673. return this.convert(color, 'rgb');
  59674. }
  59675. /**
  59676. * @function LevelRenderer.Tool.Color.prototype.toHex
  59677. * @description 转换为16进制颜色。
  59678. * @param {string} color - 颜色。
  59679. * @returns {string} 16进制颜色,#rrggbb格式
  59680. */
  59681. }, {
  59682. key: "toHex",
  59683. value: function toHex(color) {
  59684. return this.convert(color, 'hex');
  59685. }
  59686. /**
  59687. * @function LevelRenderer.Tool.Color.prototype.toHSVA
  59688. * @description 转换为HSV颜色。
  59689. * @param {string} color - 颜色。
  59690. * @returns {string} HSVA颜色,hsva(h,s,v,a)
  59691. */
  59692. }, {
  59693. key: "toHSVA",
  59694. value: function toHSVA(color) {
  59695. return this.convert(color, 'hsva');
  59696. }
  59697. /**
  59698. * @function LevelRenderer.Tool.Color.prototype.toHSV
  59699. * @description 转换为HSV颜色。
  59700. * @param {string} color - 颜色。
  59701. * @returns {string} HSV颜色,hsv(h,s,v)
  59702. */
  59703. }, {
  59704. key: "toHSV",
  59705. value: function toHSV(color) {
  59706. return this.convert(color, 'hsv');
  59707. }
  59708. /**
  59709. * @function LevelRenderer.Tool.Color.prototype.toHSBA
  59710. * @description 转换为HSBA颜色。
  59711. * @param {string} color - 颜色。
  59712. * @returns {string} HSBA颜色,hsba(h,s,b,a)
  59713. */
  59714. }, {
  59715. key: "toHSBA",
  59716. value: function toHSBA(color) {
  59717. return this.convert(color, 'hsba');
  59718. }
  59719. /**
  59720. * @function LevelRenderer.Tool.Color.prototype.toHSB
  59721. * @description 转换为HSB颜色。
  59722. * @param {string} color - 颜色。
  59723. * @returns {string} HSB颜色,hsb(h,s,b)
  59724. */
  59725. }, {
  59726. key: "toHSB",
  59727. value: function toHSB(color) {
  59728. return this.convert(color, 'hsb');
  59729. }
  59730. /**
  59731. * @function LevelRenderer.Tool.Color.prototype.toHSLA
  59732. * @description 转换为HSLA颜色。
  59733. * @param {string} color - 颜色。
  59734. * @returns {string} HSLA颜色,hsla(h,s,l,a)
  59735. */
  59736. }, {
  59737. key: "toHSLA",
  59738. value: function toHSLA(color) {
  59739. return this.convert(color, 'hsla');
  59740. }
  59741. /**
  59742. * @function LevelRenderer.Tool.Color.prototype.toHSL
  59743. * @description 转换为HSL颜色。
  59744. * @param {string} color - 颜色。
  59745. * @returns {string} HSL颜色,hsl(h,s,l)
  59746. */
  59747. }, {
  59748. key: "toHSL",
  59749. value: function toHSL(color) {
  59750. return this.convert(color, 'hsl');
  59751. }
  59752. /**
  59753. * @function LevelRenderer.Tool.Color.prototype.toName
  59754. * @description 转换颜色名。
  59755. * @param {string} color - 颜色。
  59756. * @returns {string} 颜色名
  59757. */
  59758. }, {
  59759. key: "toName",
  59760. value: function toName(color) {
  59761. for (var key in this._nameColors) {
  59762. if (this.toHex(this._nameColors[key]) === this.toHex(color)) {
  59763. return key;
  59764. }
  59765. }
  59766. return null;
  59767. }
  59768. /**
  59769. * @function LevelRenderer.Tool.Color.prototype.trim
  59770. * @description 移除颜色中多余空格。
  59771. * @param {string} color - 颜色。
  59772. * @returns {string} 无空格颜色
  59773. */
  59774. }, {
  59775. key: "trim",
  59776. value: function trim(color) {
  59777. return String(color).replace(/\s+/g, '');
  59778. }
  59779. /**
  59780. * @function LevelRenderer.Tool.Color.prototype.normalize
  59781. * @description 颜色规范化。
  59782. * @param {string} color - 颜色。
  59783. * @returns {string} 规范化后的颜色
  59784. */
  59785. }, {
  59786. key: "normalize",
  59787. value: function normalize(color) {
  59788. // 颜色名
  59789. if (this._nameColors[color]) {
  59790. color = this._nameColors[color];
  59791. }
  59792. // 去掉空格
  59793. color = this.trim(color);
  59794. // hsv与hsb等价
  59795. color = color.replace(/hsv/i, 'hsb');
  59796. // rgb转为rrggbb
  59797. if (/^#[\da-f]{3}$/i.test(color)) {
  59798. color = parseInt(color.slice(1), 16);
  59799. var r = (color & 0xf00) << 8;
  59800. var g = (color & 0xf0) << 4;
  59801. var b = color & 0xf;
  59802. color = '#' + ((1 << 24) + (r << 4) + r + (g << 4) + g + (b << 4) + b).toString(16).slice(1);
  59803. }
  59804. // 或者使用以下正则替换,不过 chrome 下性能相对差点
  59805. // color = color.replace(/^#([\da-f])([\da-f])([\da-f])$/i, '#$1$1$2$2$3$3');
  59806. return color;
  59807. }
  59808. /**
  59809. * @function LevelRenderer.Tool.Color.prototype.lift
  59810. * @description 颜色加深或减淡,当level>0加深,当level<0减淡。
  59811. * @param {string} color - 颜色。
  59812. * @param {number} level - 升降程度,取值区间[-1,1]。
  59813. * @returns {string} 加深或减淡后颜色值
  59814. */
  59815. }, {
  59816. key: "lift",
  59817. value: function lift(color, level) {
  59818. if (!this.isCalculableColor(color)) {
  59819. return color;
  59820. }
  59821. var direct = level > 0 ? 1 : -1;
  59822. if (typeof level === 'undefined') {
  59823. level = 0;
  59824. }
  59825. level = Math.abs(level) > 1 ? 1 : Math.abs(level);
  59826. color = this.toRGB(color);
  59827. var data = this.getData(color);
  59828. for (var i = 0; i < 3; i++) {
  59829. if (direct === 1) {
  59830. data[i] = data[i] * (1 - level) | 0;
  59831. } else {
  59832. data[i] = (255 - data[i]) * level + data[i] | 0;
  59833. }
  59834. }
  59835. return 'rgb(' + data.join(',') + ')';
  59836. }
  59837. /**
  59838. * @function LevelRenderer.Tool.Color.prototype.reverse
  59839. * @description 颜色翻转。[255-r,255-g,255-b,1-a]
  59840. * @param {string} color - 颜色。
  59841. * @returns {string} 翻转颜色
  59842. */
  59843. }, {
  59844. key: "reverse",
  59845. value: function reverse(color) {
  59846. if (!this.isCalculableColor(color)) {
  59847. return color;
  59848. }
  59849. var data = this.getData(this.toRGBA(color));
  59850. data = this.map(data, function (c) {
  59851. return 255 - c;
  59852. });
  59853. return this.toColor(data, 'rgb');
  59854. }
  59855. /**
  59856. * @function LevelRenderer.Tool.Color.prototype.mix
  59857. * @description 简单两种颜色混合
  59858. * @param {string} color1 - 第一种颜色。
  59859. * @param {string} color2 - 第二种颜色。
  59860. * @param {number} weight - 混合权重[0-1]。
  59861. * @returns {string} 结果色。rgb(r,g,b)或rgba(r,g,b,a)
  59862. */
  59863. }, {
  59864. key: "mix",
  59865. value: function mix(color1, color2, weight) {
  59866. if (!this.isCalculableColor(color1) || !this.isCalculableColor(color2)) {
  59867. return color1;
  59868. }
  59869. if (typeof weight === 'undefined') {
  59870. weight = 0.5;
  59871. }
  59872. weight = 1 - this.adjust(weight, [0, 1]);
  59873. var w = weight * 2 - 1;
  59874. var data1 = this.getData(this.toRGBA(color1));
  59875. var data2 = this.getData(this.toRGBA(color2));
  59876. var d = data1[3] - data2[3];
  59877. var weight1 = ((w * d === -1 ? w : (w + d) / (1 + w * d)) + 1) / 2;
  59878. var weight2 = 1 - weight1;
  59879. var data = [];
  59880. for (var i = 0; i < 3; i++) {
  59881. data[i] = data1[i] * weight1 + data2[i] * weight2;
  59882. }
  59883. var alpha = data1[3] * weight + data2[3] * (1 - weight);
  59884. alpha = Math.max(0, Math.min(1, alpha));
  59885. if (data1[3] === 1 && data2[3] === 1) {
  59886. // 不考虑透明度
  59887. return this.toColor(data, 'rgb');
  59888. }
  59889. data[3] = alpha;
  59890. return this.toColor(data, 'rgba');
  59891. }
  59892. /**
  59893. * @function LevelRenderer.Tool.Color.prototype.random
  59894. * @description 随机颜色
  59895. * @returns {string} 颜色值,#rrggbb格式
  59896. */
  59897. }, {
  59898. key: "random",
  59899. value: function random() {
  59900. return '#' + Math.random().toString(16).slice(2, 8);
  59901. }
  59902. /**
  59903. * @function LevelRenderer.Tool.Color.prototype.getData
  59904. * @description 获取颜色值数组,返回值范围。
  59905. * RGB 范围[0-255]
  59906. * HSL/HSV/HSB 范围[0-1]
  59907. * A透明度范围[0-1]
  59908. * 支持格式:
  59909. * #rgb
  59910. * #rrggbb
  59911. * rgb(r,g,b)
  59912. * rgb(r%,g%,b%)
  59913. * rgba(r,g,b,a)
  59914. * hsb(h,s,b) // hsv与hsb等价
  59915. * hsb(h%,s%,b%)
  59916. * hsba(h,s,b,a)
  59917. * hsl(h,s,l)
  59918. * hsl(h%,s%,l%)
  59919. * hsla(h,s,l,a)
  59920. * @param {string} color - 颜色。
  59921. * @returns {Array.<number>} 颜色值数组或null
  59922. */
  59923. }, {
  59924. key: "getData",
  59925. value: function getData(color) {
  59926. color = this.normalize(color);
  59927. var r = color.match(this.colorRegExp);
  59928. if (r === null) {
  59929. throw new Error('The color format error'); // 颜色格式错误
  59930. }
  59931. var d;
  59932. var a;
  59933. var data = [];
  59934. var rgb;
  59935. if (r[2]) {
  59936. // #rrggbb
  59937. d = r[2].replace('#', '').split('');
  59938. rgb = [d[0] + d[1], d[2] + d[3], d[4] + d[5]];
  59939. data = this.map(rgb, function (c) {
  59940. return Color.prototype.adjust.call(this, parseInt(c, 16), [0, 255]);
  59941. });
  59942. } else if (r[4]) {
  59943. // rgb rgba
  59944. var rgba = r[4].split(',');
  59945. a = rgba[3];
  59946. rgb = rgba.slice(0, 3);
  59947. data = this.map(rgb, function (c) {
  59948. c = Math.floor(c.indexOf('%') > 0 ? parseInt(c, 0) * 2.55 : c);
  59949. return Color.prototype.adjust.call(this, c, [0, 255]);
  59950. });
  59951. if (typeof a !== 'undefined') {
  59952. data.push(this.adjust(parseFloat(a), [0, 1]));
  59953. }
  59954. } else if (r[5] || r[6]) {
  59955. // hsb hsba hsl hsla
  59956. var hsxa = (r[5] || r[6]).split(',');
  59957. var h = parseInt(hsxa[0], 0) / 360;
  59958. var s = hsxa[1];
  59959. var x = hsxa[2];
  59960. a = hsxa[3];
  59961. data = this.map([s, x], function (c) {
  59962. return Color.prototype.adjust.call(this, parseFloat(c) / 100, [0, 1]);
  59963. });
  59964. data.unshift(h);
  59965. if (typeof a !== 'undefined') {
  59966. data.push(this.adjust(parseFloat(a), [0, 1]));
  59967. }
  59968. }
  59969. return data;
  59970. }
  59971. /**
  59972. * @function LevelRenderer.Tool.Color.prototype.alpha
  59973. * @description 设置颜色透明度
  59974. * @param {string} color - 颜色。
  59975. * @param {number} a - 透明度,区间[0,1]。
  59976. * @returns {string} rgba颜色值
  59977. */
  59978. }, {
  59979. key: "alpha",
  59980. value: function alpha(color, a) {
  59981. if (!this.isCalculableColor(color)) {
  59982. return color;
  59983. }
  59984. if (a === null) {
  59985. a = 1;
  59986. }
  59987. var data = this.getData(this.toRGBA(color));
  59988. data[3] = this.adjust(Number(a).toFixed(4), [0, 1]);
  59989. return this.toColor(data, 'rgba');
  59990. }
  59991. /**
  59992. * @function LevelRenderer.Tool.Color.prototype.map
  59993. * @description 数组映射
  59994. * @param {Array} array - 数组。
  59995. * @param {function} fun - 函数。
  59996. * @returns {string} 数组映射结果
  59997. */
  59998. }, {
  59999. key: "map",
  60000. value: function map(array, fun) {
  60001. if (typeof fun !== 'function') {
  60002. throw new TypeError();
  60003. }
  60004. var len = array ? array.length : 0;
  60005. for (var i = 0; i < len; i++) {
  60006. array[i] = fun(array[i]);
  60007. }
  60008. return array;
  60009. }
  60010. /**
  60011. * @function LevelRenderer.Tool.Color.prototype.adjust
  60012. * @description 调整值区间
  60013. * @param {Array.<number>} value - 数组。
  60014. * @param {Array.<number>} region - 区间。
  60015. * @returns {number} 调整后的值
  60016. */
  60017. }, {
  60018. key: "adjust",
  60019. value: function adjust(value, region) {
  60020. // < to <= & > to >=
  60021. // modify by linzhifeng 2014-05-25 because -0 == 0
  60022. if (value <= region[0]) {
  60023. value = region[0];
  60024. } else if (value >= region[1]) {
  60025. value = region[1];
  60026. }
  60027. return value;
  60028. }
  60029. /**
  60030. * @function LevelRenderer.Tool.Color.prototype.isCalculableColor
  60031. * @description 判断是否是可计算的颜色
  60032. * @param {string} color - 颜色。
  60033. * @returns {boolean} 是否是可计算的颜色
  60034. */
  60035. }, {
  60036. key: "isCalculableColor",
  60037. value: function isCalculableColor(color) {
  60038. return color instanceof Array || typeof color === 'string';
  60039. }
  60040. /**
  60041. * @function LevelRenderer.Tool.Color.prototype._HSV_2_RGB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  60042. */
  60043. }, {
  60044. key: "_HSV_2_RGB",
  60045. value: function _HSV_2_RGB(data) {
  60046. var H = data[0];
  60047. var S = data[1];
  60048. var V = data[2];
  60049. // HSV from 0 to 1
  60050. var R;
  60051. var G;
  60052. var B;
  60053. if (S === 0) {
  60054. R = V * 255;
  60055. G = V * 255;
  60056. B = V * 255;
  60057. } else {
  60058. var h = H * 6;
  60059. if (h === 6) {
  60060. h = 0;
  60061. }
  60062. var i = h | 0;
  60063. var v1 = V * (1 - S);
  60064. var v2 = V * (1 - S * (h - i));
  60065. var v3 = V * (1 - S * (1 - (h - i)));
  60066. var r = 0;
  60067. var g = 0;
  60068. var b = 0;
  60069. if (i === 0) {
  60070. r = V;
  60071. g = v3;
  60072. b = v1;
  60073. } else if (i === 1) {
  60074. r = v2;
  60075. g = V;
  60076. b = v1;
  60077. } else if (i === 2) {
  60078. r = v1;
  60079. g = V;
  60080. b = v3;
  60081. } else if (i === 3) {
  60082. r = v1;
  60083. g = v2;
  60084. b = V;
  60085. } else if (i === 4) {
  60086. r = v3;
  60087. g = v1;
  60088. b = V;
  60089. } else {
  60090. r = V;
  60091. g = v1;
  60092. b = v2;
  60093. }
  60094. // RGB results from 0 to 255
  60095. R = r * 255;
  60096. G = g * 255;
  60097. B = b * 255;
  60098. }
  60099. return [R, G, B];
  60100. }
  60101. /**
  60102. * @function LevelRenderer.Tool.Color.prototype._HSL_2_RGB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  60103. */
  60104. }, {
  60105. key: "_HSL_2_RGB",
  60106. value: function _HSL_2_RGB(data) {
  60107. var H = data[0];
  60108. var S = data[1];
  60109. var L = data[2];
  60110. // HSL from 0 to 1
  60111. var R;
  60112. var G;
  60113. var B;
  60114. if (S === 0) {
  60115. R = L * 255;
  60116. G = L * 255;
  60117. B = L * 255;
  60118. } else {
  60119. var v2;
  60120. if (L < 0.5) {
  60121. v2 = L * (1 + S);
  60122. } else {
  60123. v2 = L + S - S * L;
  60124. }
  60125. var v1 = 2 * L - v2;
  60126. R = 255 * this._HUE_2_RGB(v1, v2, H + 1 / 3);
  60127. G = 255 * this._HUE_2_RGB(v1, v2, H);
  60128. B = 255 * this._HUE_2_RGB(v1, v2, H - 1 / 3);
  60129. }
  60130. return [R, G, B];
  60131. }
  60132. /**
  60133. * @function LevelRenderer.Tool.Color.prototype._HUE_2_RGB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  60134. */
  60135. }, {
  60136. key: "_HUE_2_RGB",
  60137. value: function _HUE_2_RGB(v1, v2, vH) {
  60138. if (vH < 0) {
  60139. vH += 1;
  60140. }
  60141. if (vH > 1) {
  60142. vH -= 1;
  60143. }
  60144. if (6 * vH < 1) {
  60145. return v1 + (v2 - v1) * 6 * vH;
  60146. }
  60147. if (2 * vH < 1) {
  60148. return v2;
  60149. }
  60150. if (3 * vH < 2) {
  60151. return v1 + (v2 - v1) * (2 / 3 - vH) * 6;
  60152. }
  60153. return v1;
  60154. }
  60155. /**
  60156. * @function LevelRenderer.Tool.Color.prototype._RGB_2_HSB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  60157. */
  60158. }, {
  60159. key: "_RGB_2_HSB",
  60160. value: function _RGB_2_HSB(data) {
  60161. // RGB from 0 to 255
  60162. var R = data[0] / 255;
  60163. var G = data[1] / 255;
  60164. var B = data[2] / 255;
  60165. var vMin = Math.min(R, G, B); // Min. value of RGB
  60166. var vMax = Math.max(R, G, B); // Max. value of RGB
  60167. var delta = vMax - vMin; // Delta RGB value
  60168. var V = vMax;
  60169. var H;
  60170. var S;
  60171. // HSV results from 0 to 1
  60172. if (delta === 0) {
  60173. H = 0;
  60174. S = 0;
  60175. } else {
  60176. S = delta / vMax;
  60177. var deltaR = ((vMax - R) / 6 + delta / 2) / delta;
  60178. var deltaG = ((vMax - G) / 6 + delta / 2) / delta;
  60179. var deltaB = ((vMax - B) / 6 + delta / 2) / delta;
  60180. if (R === vMax) {
  60181. H = deltaB - deltaG;
  60182. } else if (G === vMax) {
  60183. H = 1 / 3 + deltaR - deltaB;
  60184. } else if (B === vMax) {
  60185. H = 2 / 3 + deltaG - deltaR;
  60186. }
  60187. if (H < 0) {
  60188. H += 1;
  60189. }
  60190. if (H > 1) {
  60191. H -= 1;
  60192. }
  60193. }
  60194. H = H * 360;
  60195. S = S * 100;
  60196. V = V * 100;
  60197. return [H, S, V];
  60198. }
  60199. /**
  60200. * @function LevelRenderer.Tool.Color.prototype._RGB_2_HSL。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  60201. */
  60202. }, {
  60203. key: "_RGB_2_HSL",
  60204. value: function _RGB_2_HSL(data) {
  60205. // RGB from 0 to 255
  60206. var R = data[0] / 255;
  60207. var G = data[1] / 255;
  60208. var B = data[2] / 255;
  60209. var vMin = Math.min(R, G, B); // Min. value of RGB
  60210. var vMax = Math.max(R, G, B); // Max. value of RGB
  60211. var delta = vMax - vMin; // Delta RGB value
  60212. var L = (vMax + vMin) / 2;
  60213. var H;
  60214. var S;
  60215. // HSL results from 0 to 1
  60216. if (delta === 0) {
  60217. H = 0;
  60218. S = 0;
  60219. } else {
  60220. if (L < 0.5) {
  60221. S = delta / (vMax + vMin);
  60222. } else {
  60223. S = delta / (2 - vMax - vMin);
  60224. }
  60225. var deltaR = ((vMax - R) / 6 + delta / 2) / delta;
  60226. var deltaG = ((vMax - G) / 6 + delta / 2) / delta;
  60227. var deltaB = ((vMax - B) / 6 + delta / 2) / delta;
  60228. if (R === vMax) {
  60229. H = deltaB - deltaG;
  60230. } else if (G === vMax) {
  60231. H = 1 / 3 + deltaR - deltaB;
  60232. } else if (B === vMax) {
  60233. H = 2 / 3 + deltaG - deltaR;
  60234. }
  60235. if (H < 0) {
  60236. H += 1;
  60237. }
  60238. if (H > 1) {
  60239. H -= 1;
  60240. }
  60241. }
  60242. H = H * 360;
  60243. S = S * 100;
  60244. L = L * 100;
  60245. return [H, S, L];
  60246. }
  60247. }]);
  60248. return Color;
  60249. }();
  60250. ;// CONCATENATED MODULE: ./src/common/util/ColorsPickerUtil.js
  60251. function ColorsPickerUtil_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  60252. function ColorsPickerUtil_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  60253. function ColorsPickerUtil_createClass(Constructor, protoProps, staticProps) { if (protoProps) ColorsPickerUtil_defineProperties(Constructor.prototype, protoProps); if (staticProps) ColorsPickerUtil_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  60254. var ColorRender = new Color();
  60255. // let "http://www.qzu.zj.cn": "#bd10e0"
  60256. // "www.qzct.net": "#7ed321" = new LevelRenderer.Tool.Color();
  60257. /**
  60258. * @name ColorsPickerUtil
  60259. * @namespace
  60260. * @category BaseTypes Util
  60261. * @classdesc 色带选择器工具类。用于1、创建canvas对象,2、从几种颜色中获取一定数量的渐变色。
  60262. * @usage
  60263. * ```
  60264. * // 浏览器
  60265. * <script type="text/javascript" src="{cdn}"></script>
  60266. * <script>
  60267. * const result = {namespace}.ColorsPickerUtil.createCanvas();
  60268. *
  60269. * // 弃用的写法
  60270. * const result = SuperMap.ColorsPickerUtil.createCanvas();
  60271. *
  60272. * </script>
  60273. *
  60274. * // ES6 Import
  60275. * import { ColorsPickerUtil } from '{npm}';
  60276. *
  60277. * const result = ColorsPickerUtil.createCanvas();
  60278. * ```
  60279. */
  60280. var ColorsPickerUtil = /*#__PURE__*/function () {
  60281. function ColorsPickerUtil() {
  60282. ColorsPickerUtil_classCallCheck(this, ColorsPickerUtil);
  60283. }
  60284. ColorsPickerUtil_createClass(ColorsPickerUtil, null, [{
  60285. key: "createCanvas",
  60286. value:
  60287. /**
  60288. * @function ColorsPickerUtil.createCanvas
  60289. * @description 创建DOM canvas。
  60290. * @param {number} height - canvas 高度。
  60291. * @param {number} width - canvas 宽度。
  60292. */
  60293. function createCanvas(height, width) {
  60294. var canvas = document.createElement("canvas");
  60295. canvas.height = height;
  60296. canvas.width = width;
  60297. return canvas.getContext("2d");
  60298. }
  60299. /**
  60300. * @function ColorsPickerUtil.getLinearGradient
  60301. * @description 线性渐变。
  60302. * @param {number} x0 - 渐变起点 x 坐标。
  60303. * @param {number} y0 - 渐变起点 y 坐标。
  60304. * @param {number} x1 - 渐变终点 x 坐标。
  60305. * @param {number} y1 - 渐变终点 y 坐标。
  60306. * @param {Array} colorList 颜色列表。
  60307. * @returns {CanvasGradient} Cavans 渐变颜色。
  60308. */
  60309. }, {
  60310. key: "getLinearGradient",
  60311. value: function getLinearGradient(x0, y0, x1, y1, colorList) {
  60312. if (!this._ctx) {
  60313. this._ctx = this.getContext();
  60314. }
  60315. var gradient = this._ctx.createLinearGradient(x0, y0, x1, y1);
  60316. var leng = colorList.length;
  60317. var add = 1 / (leng - 1);
  60318. var offset = 0;
  60319. for (var i = 0; i < leng; i++) {
  60320. gradient.addColorStop(offset, colorList[i]);
  60321. offset += add;
  60322. }
  60323. gradient.__nonRecursion = true;
  60324. return gradient;
  60325. }
  60326. /**
  60327. * @function ColorsPickerUtil.getContext
  60328. * @description 获取 Cavans 上下文。
  60329. * @returns {Object} Cavans 上下文。
  60330. */
  60331. }, {
  60332. key: "getContext",
  60333. value: function getContext() {
  60334. if (!this._ctx) {
  60335. this._ctx = document.createElement('canvas').getContext('2d');
  60336. }
  60337. return this._ctx;
  60338. }
  60339. /**
  60340. * @function ColorsPickerUtil.getStepColors
  60341. * @description 获取两种颜色之间渐变颜色数组。
  60342. * @param {string} start - 起始颜色。
  60343. * @param {string} end - 结束颜色。
  60344. * @param {number} step - 渐变级数。
  60345. * @returns {Array} 颜色数组。
  60346. */
  60347. }, {
  60348. key: "getStepColors",
  60349. value: function getStepColors(start, end, step) {
  60350. start = ColorRender.toRGBA(start);
  60351. end = ColorRender.toRGBA(end);
  60352. start = ColorRender.getData(start);
  60353. end = ColorRender.getData(end);
  60354. var colors = [];
  60355. var stepR = (end[0] - start[0]) / step;
  60356. var stepG = (end[1] - start[1]) / step;
  60357. var stepB = (end[2] - start[2]) / step;
  60358. var stepA = (end[3] - start[3]) / step;
  60359. // 生成颜色集合
  60360. // fix by linfeng 颜色堆积
  60361. for (var i = 0, r = start[0], g = start[1], b = start[2], a = start[3]; i < step; i++) {
  60362. colors[i] = ColorRender.toColor([ColorRender.adjust(Math.floor(r), [0, 255]), ColorRender.adjust(Math.floor(g), [0, 255]), ColorRender.adjust(Math.floor(b), [0, 255]), a.toFixed(4) - 0], 'hex');
  60363. r += stepR;
  60364. g += stepG;
  60365. b += stepB;
  60366. a += stepA;
  60367. }
  60368. r = end[0];
  60369. g = end[1];
  60370. b = end[2];
  60371. a = end[3];
  60372. colors[i] = ColorRender.toColor([r, g, b, a], 'hex');
  60373. return colors;
  60374. }
  60375. /**
  60376. * @function ColorsPickerUtil.getGradientColors
  60377. * @description 获取指定级数的渐变颜色数组。
  60378. * @param {Array.<string>} colors - 颜色组。
  60379. * @param {number} total - 颜色总数。
  60380. * @param {string} themeType - 专题类型。
  60381. * @returns {Array.<string>} 颜色数组。
  60382. */
  60383. }, {
  60384. key: "getGradientColors",
  60385. value: function getGradientColors(colors, total, themeType) {
  60386. var ret = [],
  60387. step;
  60388. var i,
  60389. n,
  60390. len = colors.length;
  60391. if (total === undefined) {
  60392. return;
  60393. }
  60394. if (len >= total) {
  60395. if (themeType === 'RANGE') {
  60396. for (i = 0; i < total; i++) {
  60397. ret.push(colors[i]);
  60398. }
  60399. } else {
  60400. //1/2前后取色
  60401. for (i = 0; i < total; i++) {
  60402. var ii = Math.floor(i / 2);
  60403. if (i % 2 === 0) {
  60404. ret.push(colors[ii]);
  60405. } else {
  60406. var _index = colors.length - 1 - ii;
  60407. ret.push(colors[_index]);
  60408. }
  60409. }
  60410. }
  60411. } else {
  60412. step = Math.ceil(total / (len - 1));
  60413. for (i = 0, n = len - 1; i < n; i++) {
  60414. var steps = this.getStepColors(colors[i], colors[i + 1], step);
  60415. if (i < n - 1) {
  60416. steps.pop();
  60417. }
  60418. ret = ret.concat(steps);
  60419. }
  60420. //删除多余元素
  60421. var nouse = ret.length - total;
  60422. for (var j = 0, index = 0; j < nouse; j++) {
  60423. ret.splice(index + 2, 1);
  60424. }
  60425. }
  60426. return ret;
  60427. }
  60428. }]);
  60429. return ColorsPickerUtil;
  60430. }();
  60431. ;// CONCATENATED MODULE: ./src/common/util/ArrayStatistic.js
  60432. function ArrayStatistic_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  60433. function ArrayStatistic_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  60434. function ArrayStatistic_createClass(Constructor, protoProps, staticProps) { if (protoProps) ArrayStatistic_defineProperties(Constructor.prototype, protoProps); if (staticProps) ArrayStatistic_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  60435. /**
  60436. * @name ArrayStatistic
  60437. * @namespace
  60438. * @category BaseTypes Util
  60439. * @classdesc 处理数组。
  60440. * @usage
  60441. * ```
  60442. * // 浏览器
  60443. * <script type="text/javascript" src="{cdn}"></script>
  60444. * <script>
  60445. * const result = {namespace}.ArrayStatistic.newInstance();
  60446. *
  60447. * // 弃用的写法
  60448. * const result = SuperMap.ArrayStatistic.newInstance();
  60449. *
  60450. * </script>
  60451. *
  60452. * // ES6 Import
  60453. * import { ArrayStatistic } from '{npm}';
  60454. *
  60455. * const result = ArrayStatistic.newInstance();
  60456. * ```
  60457. */
  60458. var ArrayStatistic = /*#__PURE__*/function () {
  60459. function ArrayStatistic() {
  60460. ArrayStatistic_classCallCheck(this, ArrayStatistic);
  60461. }
  60462. ArrayStatistic_createClass(ArrayStatistic, null, [{
  60463. key: "newInstance",
  60464. value:
  60465. // geostatsInstance: null,
  60466. /**
  60467. * @function ArrayStatistic.newInstance
  60468. * @description 初始化插件实例。
  60469. */
  60470. function newInstance() {
  60471. // if(!this.geostatsInstance) {
  60472. // // this.geostatsInstance = new geostats();
  60473. // // }
  60474. // window.dataList = [];
  60475. if (!this.geostatsInstance) {
  60476. this.geostatsInstance = new window.geostats();
  60477. }
  60478. return this.geostatsInstance;
  60479. }
  60480. /**
  60481. * @function ArrayStatistic.getInstance
  60482. * @description 设置需要被处理的数组。
  60483. * @param {Array} array - 数组。
  60484. */
  60485. }, {
  60486. key: "getInstance",
  60487. value: function getInstance(array) {
  60488. var instance = this.newInstance();
  60489. instance.setSerie(array);
  60490. return instance;
  60491. }
  60492. /**
  60493. * @function ArrayStatistic.getArrayStatistic
  60494. * @description 获取数组统计的值。
  60495. * @param {Array.<number>} array - 需要统计的数组。
  60496. * @param {string} type - 统计方法。
  60497. */
  60498. }, {
  60499. key: "getArrayStatistic",
  60500. value: function getArrayStatistic(array, type) {
  60501. if (!array.length) {
  60502. return 0;
  60503. }
  60504. if (type === "Sum" || type === "求和") {
  60505. return this.getSum(array);
  60506. } else if (type === "Maximum" || type === "最大值") {
  60507. return this.getMax(array);
  60508. } else if (type === "Minimum" || type === "最小值") {
  60509. return this.getMin(array);
  60510. } else if (type === "Average" || type === "平均值") {
  60511. return this.getMean(array);
  60512. } else if (type === "Median" || type === "中位数") {
  60513. return this.getMedian(array);
  60514. } else if (type === "times" || type === "计数") {
  60515. return this.getTimes(array);
  60516. }
  60517. }
  60518. /**
  60519. * @function ArrayStatistic.getArraySegments
  60520. * @description 获取数组分段后的数值。
  60521. * @param {Array.<number>} array - 需要分段的数组。
  60522. * @param {string} type - 分段方法。
  60523. * @param {number} segNum - 分段个数。
  60524. */
  60525. }, {
  60526. key: "getArraySegments",
  60527. value: function getArraySegments(array, type, segNum) {
  60528. if (type === "offset") {
  60529. return this.getEqInterval(array, segNum);
  60530. } else if (type === "jenks") {
  60531. return this.getJenks(array, segNum);
  60532. } else if (type === "square") {
  60533. // 数据都必须 >= 0
  60534. var minValue = this.getMin(array);
  60535. if (minValue >= 0) {
  60536. return this.getSqrtInterval(array, segNum);
  60537. } else {
  60538. //console.log('数据都必须 >= 0');
  60539. // Util.showMessage(Language.hasNegValue + Language.noSupportRange, 'ERROR');
  60540. return false;
  60541. }
  60542. } else if (type === "logarithm") {
  60543. // 数据都必须 > 0
  60544. var _minValue = this.getMin(array);
  60545. if (_minValue > 0) {
  60546. return this.getGeometricProgression(array, segNum);
  60547. } else {
  60548. //console.log('数据都必须 > 0');
  60549. // Util.showMessage(Language.hasZeroNegValue + Language.noSupportRange, 'ERROR');
  60550. return false;
  60551. }
  60552. }
  60553. }
  60554. /**
  60555. * @function ArrayStatistic.getSum
  60556. * @description 求和。
  60557. * @param {Array.<number>} array 需要求和的参数。
  60558. * @returns {number} 返回求和结果。
  60559. */
  60560. }, {
  60561. key: "getSum",
  60562. value: function getSum(array) {
  60563. return this.getInstance(array).sum();
  60564. }
  60565. /**
  60566. * @function ArrayStatistic.getMax
  60567. * @description 最大值。
  60568. * @param {Array.<number>} array 需要求最大值的参数。
  60569. * @returns {number} 返回最大值。
  60570. */
  60571. }, {
  60572. key: "getMax",
  60573. value: function getMax(array) {
  60574. return this.getInstance(array).max();
  60575. }
  60576. /**
  60577. * @function ArrayStatistic.getMin
  60578. * @description 最小值。
  60579. * @param {Array.<number>} array 需要求最小值的参数。
  60580. * @returns {number} 返回最小值。
  60581. */
  60582. }, {
  60583. key: "getMin",
  60584. value: function getMin(array) {
  60585. return this.getInstance(array).min();
  60586. }
  60587. /**
  60588. * @function ArrayStatistic.getMean
  60589. * @description 求平均数。
  60590. * @param {Array.<number>} array 需要求平均数的参数。
  60591. * @returns {number} 返回平均数。
  60592. */
  60593. }, {
  60594. key: "getMean",
  60595. value: function getMean(array) {
  60596. return this.getInstance(array).mean();
  60597. }
  60598. /**
  60599. * @function ArrayStatistic.getMedian
  60600. * @description 求中位数。
  60601. * @param {Array.<number>} array 需要求中位数的参数。
  60602. * @returns {number} 返回中位数。
  60603. */
  60604. }, {
  60605. key: "getMedian",
  60606. value: function getMedian(array) {
  60607. return this.getInstance(array).median();
  60608. }
  60609. /**
  60610. * @function ArrayStatistic.getTimes
  60611. * @description 计数。
  60612. * @param {Array.<number>} array 需要计数的参数。
  60613. * @returns {number} 返回计数结果。
  60614. */
  60615. }, {
  60616. key: "getTimes",
  60617. value: function getTimes(array) {
  60618. return array.length;
  60619. }
  60620. /**
  60621. * @function ArrayStatistic.getEqInterval
  60622. * @description 等距分段法。
  60623. * @param {Array} array 需要进行等距分段的数组。
  60624. * @param {number} segNum 分段个数。
  60625. */
  60626. }, {
  60627. key: "getEqInterval",
  60628. value: function getEqInterval(array, segNum) {
  60629. return this.getInstance(array).getClassEqInterval(segNum);
  60630. }
  60631. /**
  60632. * @function ArrayStatistic.getJenks
  60633. * @description 自然断裂法。
  60634. * @param {Array} array 需要进行自然断裂的参数。
  60635. * @param {number} segNum 分段个数。
  60636. */
  60637. }, {
  60638. key: "getJenks",
  60639. value: function getJenks(array, segNum) {
  60640. return this.getInstance(array).getClassJenks(segNum);
  60641. }
  60642. /**
  60643. * @function ArrayStatistic.getSqrtInterval
  60644. * @description 平方根分段法。
  60645. * @param {Array} array 需要进行平方根分段的参数。
  60646. * @param {number} segNum 分段个数。
  60647. */
  60648. }, {
  60649. key: "getSqrtInterval",
  60650. value: function getSqrtInterval(array, segNum) {
  60651. array = array.map(function (value) {
  60652. return Math.sqrt(value);
  60653. });
  60654. var breaks = this.getInstance(array).getClassEqInterval(segNum);
  60655. return breaks.map(function (value) {
  60656. return value * value;
  60657. });
  60658. }
  60659. /**
  60660. * @function ArrayStatistic.getGeometricProgression
  60661. * @description 对数分段法。
  60662. * @param {Array} array 需要进行对数分段的参数。
  60663. * @param {number} segNum 分段个数。
  60664. */
  60665. }, {
  60666. key: "getGeometricProgression",
  60667. value: function getGeometricProgression(array, segNum) {
  60668. return this.getInstance(array).getClassGeometricProgression(segNum);
  60669. }
  60670. }]);
  60671. return ArrayStatistic;
  60672. }();
  60673. ;// CONCATENATED MODULE: ./src/common/util/MapCalculateUtil.js
  60674. /**
  60675. * @function getMeterPerMapUnit
  60676. * @description 单位换算,把米|度|千米|英寸|英尺换成米。
  60677. * @category BaseTypes Util
  60678. * @param {string} mapUnit 地图单位。
  60679. * @returns {number} 返回地图的距离单位。
  60680. * @usage
  60681. * ```
  60682. * // 浏览器
  60683. * <script type="text/javascript" src="{cdn}"></script>
  60684. * <script>
  60685. * const result = {namespace}.getMeterPerMapUnit(mapUnit);
  60686. *
  60687. * </script>
  60688. *
  60689. * // ES6 Import
  60690. * import { getMeterPerMapUnit } from '{npm}';
  60691. *
  60692. * const result = getMeterPerMapUnit(mapUnit);
  60693. * ```
  60694. */
  60695. var getMeterPerMapUnit = function getMeterPerMapUnit(mapUnit) {
  60696. var earchRadiusInMeters = 6378137;
  60697. var meterPerMapUnit;
  60698. if (mapUnit === Unit.METER) {
  60699. meterPerMapUnit = 1;
  60700. } else if (mapUnit === Unit.DEGREE) {
  60701. // 每度表示多少米。
  60702. meterPerMapUnit = Math.PI * 2 * earchRadiusInMeters / 360;
  60703. } else if (mapUnit === Unit.KILOMETER) {
  60704. meterPerMapUnit = 1.0e-3;
  60705. } else if (mapUnit === Unit.INCH) {
  60706. meterPerMapUnit = 1 / 2.5399999918e-2;
  60707. } else if (mapUnit === Unit.FOOT) {
  60708. meterPerMapUnit = 0.3048;
  60709. } else {
  60710. return meterPerMapUnit;
  60711. }
  60712. return meterPerMapUnit;
  60713. };
  60714. /**
  60715. * @function getWrapNum
  60716. * @description 获取该坐标系的经纬度范围的经度或纬度。
  60717. * @category BaseTypes Util
  60718. * @param {number} x 经度或纬度。
  60719. * @param {boolean} includeMax 是否获取经度或纬度的最大值。
  60720. * @param {boolean} includeMin 是否获取经度或纬度的最小值。
  60721. * @param {number} range 坐标系的经纬度范围。
  60722. * @returns {number} 返回经度或纬度的值。
  60723. * @usage
  60724. * ```
  60725. * // 浏览器
  60726. * <script type="text/javascript" src="{cdn}"></script>
  60727. * <script>
  60728. * const result = {namespace}.getWrapNum(x, includeMax, includeMin, range);
  60729. *
  60730. * </script>
  60731. *
  60732. * // ES6 Import
  60733. * import { getWrapNum } from '{npm}';
  60734. *
  60735. * const result = getWrapNum(x, includeMax, includeMin, range);
  60736. * ```
  60737. */
  60738. function getWrapNum(x) {
  60739. var includeMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  60740. var includeMin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  60741. var range = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [-180, 180];
  60742. var max = range[1],
  60743. min = range[0],
  60744. d = max - min;
  60745. if (x === max && includeMax) {
  60746. return x;
  60747. }
  60748. if (x === min && includeMin) {
  60749. return x;
  60750. }
  60751. var tmp = ((x - min) % d + d) % d;
  60752. if (tmp === 0 && includeMax) {
  60753. return max;
  60754. }
  60755. return ((x - min) % d + d) % d + min;
  60756. }
  60757. /**
  60758. * @function conversionDegree
  60759. * @description 转换经纬度。
  60760. * @category BaseTypes Util
  60761. * @param {number} degrees 经度或纬度。
  60762. * @returns {string} 返回度分秒。
  60763. * @usage
  60764. * ```
  60765. * // 浏览器
  60766. * <script type="text/javascript" src="{cdn}"></script>
  60767. * <script>
  60768. * const result = {namespace}.conversionDegree(degrees);
  60769. *
  60770. * </script>
  60771. *
  60772. * // ES6 Import
  60773. * import { conversionDegree } from '{npm}';
  60774. *
  60775. * const result = conversionDegree(degrees);
  60776. * ```
  60777. */
  60778. function conversionDegree(degrees) {
  60779. var degree = parseInt(degrees);
  60780. var fraction = parseInt((degrees - degree) * 60);
  60781. var second = parseInt(((degrees - degree) * 60 - fraction) * 60);
  60782. fraction = parseInt(fraction / 10) === 0 ? "0".concat(fraction) : fraction;
  60783. second = parseInt(second / 10) === 0 ? "0".concat(second) : second;
  60784. return "".concat(degree, "\xB0").concat(fraction, "'").concat(second);
  60785. }
  60786. /**
  60787. * @function scalesToResolutions
  60788. * @description 通过比例尺数组计算分辨率数组,没有传入比例尺数组时通过地图范围与地图最大级别进行计算。
  60789. * @version 11.0.1
  60790. * @param {Array} scales - 比例尺数组。
  60791. * @param {Object} bounds - 地图范围。
  60792. * @param {number} dpi - 屏幕分辨率。
  60793. * @param {string} mapUnit - 地图单位。
  60794. * @param {number} [level=22] - 地图最大级别。
  60795. * @returns {number} 分辨率。
  60796. * @usage
  60797. * ```
  60798. * // 浏览器
  60799. * <script type="text/javascript" src="{cdn}"></script>
  60800. * <script>
  60801. * const result = {namespace}.scalesToResolutions(scales, bounds, dpi, mapUnit);
  60802. *
  60803. * </script>
  60804. *
  60805. * // ES6 Import
  60806. * import { scalesToResolutions } from '{npm}';
  60807. *
  60808. * const result = scalesToResolutions(scales, bounds, dpi, mapUnit);
  60809. * ```
  60810. */
  60811. function MapCalculateUtil_scalesToResolutions(scales, bounds, dpi, mapUnit) {
  60812. var level = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 22;
  60813. var resolutions = [];
  60814. if (scales && scales.length > 0) {
  60815. for (var i = 0; i < scales.length; i++) {
  60816. resolutions.push(scaleToResolution(scales[i], dpi, mapUnit));
  60817. }
  60818. } else {
  60819. var maxReolution = Math.abs(bounds.left - bounds.right) / 256;
  60820. for (var _i2 = 0; _i2 < level; _i2++) {
  60821. resolutions.push(maxReolution / Math.pow(2, _i2));
  60822. }
  60823. }
  60824. return resolutions.sort(function (a, b) {
  60825. return b - a;
  60826. });
  60827. }
  60828. /**
  60829. * @function getZoomByResolution
  60830. * @description 通过分辨率获取地图级别。
  60831. * @version 11.0.1
  60832. * @param {number} resolution - 分辨率。
  60833. * @param {Array} resolutions - 分辨率数组。
  60834. * @returns {number} 地图级别。
  60835. * @usage
  60836. * ```
  60837. * // 浏览器
  60838. * <script type="text/javascript" src="{cdn}"></script>
  60839. * <script>
  60840. * const result = {namespace}.getZoomByResolution(resolution, resolutions);
  60841. *
  60842. * </script>
  60843. *
  60844. * // ES6 Import
  60845. * import { getZoomByResolution } from '{npm}';
  60846. *
  60847. * const result = getZoomByResolution(resolution, resolutions);
  60848. * ```
  60849. */
  60850. function MapCalculateUtil_getZoomByResolution(resolution, resolutions) {
  60851. var zoom = 0;
  60852. var minDistance;
  60853. for (var i = 0; i < resolutions.length; i++) {
  60854. if (i === 0) {
  60855. minDistance = Math.abs(resolution - resolutions[i]);
  60856. }
  60857. if (minDistance > Math.abs(resolution - resolutions[i])) {
  60858. minDistance = Math.abs(resolution - resolutions[i]);
  60859. zoom = i;
  60860. }
  60861. }
  60862. return zoom;
  60863. }
  60864. /**
  60865. * @function scaleToResolution
  60866. * @description 通过比例尺计算分辨率。
  60867. * @version 11.0.1
  60868. * @param {number} scale - 比例尺。
  60869. * @param {number} dpi - 屏幕分辨率。
  60870. * @param {string} mapUnit - 地图单位。
  60871. * @returns {number} 分辨率。
  60872. * @usage
  60873. * ```
  60874. * // 浏览器
  60875. * <script type="text/javascript" src="{cdn}"></script>
  60876. * <script>
  60877. * const result = {namespace}.scaleToResolution(scale, dpi, mapUnit);
  60878. *
  60879. * </script>
  60880. *
  60881. * // ES6 Import
  60882. * import { scaleToResolution } from '{npm}';
  60883. *
  60884. * const result = scaleToResolution(scale, dpi, mapUnit);
  60885. * ```
  60886. */
  60887. function scaleToResolution(scale, dpi, mapUnit) {
  60888. var inchPerMeter = 1 / 0.0254;
  60889. var meterPerMapUnitValue = getMeterPerMapUnit(mapUnit);
  60890. var resolution = 1 / (scale * dpi * inchPerMeter * meterPerMapUnitValue);
  60891. return resolution;
  60892. }
  60893. /**
  60894. * 范围是否相交
  60895. * @param {Array} extent1 范围1
  60896. * @param {Array} extent2 范围2
  60897. * @return {boolean} 范围是否相交。
  60898. */
  60899. function intersects(extent1, extent2) {
  60900. return extent1[0] <= extent2[2] && extent1[2] >= extent2[0] && extent1[1] <= extent2[3] && extent1[3] >= extent2[1];
  60901. }
  60902. /**
  60903. * 获取两个范围的交集
  60904. * @param {Array} extent1 Extent 1
  60905. * @param {Array} extent2 Extent 2
  60906. * @return {Array} 相交范围数组.
  60907. * @api
  60908. */
  60909. function getIntersection(extent1, extent2) {
  60910. var intersection = [];
  60911. if (intersects(extent1, extent2)) {
  60912. if (extent1[0] > extent2[0]) {
  60913. intersection[0] = extent1[0];
  60914. } else {
  60915. intersection[0] = extent2[0];
  60916. }
  60917. if (extent1[1] > extent2[1]) {
  60918. intersection[1] = extent1[1];
  60919. } else {
  60920. intersection[1] = extent2[1];
  60921. }
  60922. if (extent1[2] < extent2[2]) {
  60923. intersection[2] = extent1[2];
  60924. } else {
  60925. intersection[2] = extent2[2];
  60926. }
  60927. if (extent1[3] < extent2[3]) {
  60928. intersection[3] = extent1[3];
  60929. } else {
  60930. intersection[3] = extent2[3];
  60931. }
  60932. }
  60933. return intersection;
  60934. }
  60935. ;// CONCATENATED MODULE: ./src/common/util/index.js
  60936. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  60937. * This program are made available under the terms of the Apache License, Version 2.0
  60938. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  60939. function toSuperMapGeometry(geoJSON) {
  60940. if (geoJSON && geoJSON.type) {
  60941. var format = new GeoJSONFormat();
  60942. var result = format.read(geoJSON, "FeatureCollection");
  60943. return result[0].geometry;
  60944. }
  60945. }
  60946. function toSuperMapPolygon(lnglatBounds) {
  60947. var west = lnglatBounds.getWest();
  60948. var east = lnglatBounds.getEast();
  60949. var sourth = lnglatBounds.getSouth();
  60950. var north = lnglatBounds.getNorth();
  60951. return new Polygon([new LinearRing([new GeometryPoint(west, sourth), new GeometryPoint(east, sourth), new GeometryPoint(east, north), new GeometryPoint(west, north)])]);
  60952. }
  60953. /**
  60954. * @function Util.extend
  60955. * @description 对象拷贝赋值。
  60956. * @param {Object} dest - 目标对象。
  60957. * @param {Object} arguments - 待拷贝的对象。
  60958. * @returns {Object} 赋值后的目标对象。
  60959. */
  60960. function extend(dest) {
  60961. for (var index = 0; index < Object.getOwnPropertyNames(arguments).length; index++) {
  60962. var arg = Object.getOwnPropertyNames(arguments)[index];
  60963. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  60964. continue;
  60965. }
  60966. var obj = arguments[arg];
  60967. if (obj) {
  60968. for (var j = 0; j < Object.getOwnPropertyNames(obj).length; j++) {
  60969. var key = Object.getOwnPropertyNames(obj)[j];
  60970. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  60971. continue;
  60972. }
  60973. dest[key] = obj[key];
  60974. }
  60975. }
  60976. }
  60977. return dest;
  60978. }
  60979. // EXTERNAL MODULE: ./node_modules/lodash.topairs/index.js
  60980. var lodash_topairs = __webpack_require__(7820);
  60981. var lodash_topairs_default = /*#__PURE__*/__webpack_require__.n(lodash_topairs);
  60982. ;// CONCATENATED MODULE: ./src/common/style/CartoCSS.js
  60983. function CartoCSS_typeof(obj) { "@babel/helpers - typeof"; return CartoCSS_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, CartoCSS_typeof(obj); }
  60984. function CartoCSS_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  60985. function CartoCSS_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  60986. function CartoCSS_createClass(Constructor, protoProps, staticProps) { if (protoProps) CartoCSS_defineProperties(Constructor.prototype, protoProps); if (staticProps) CartoCSS_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  60987. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  60988. * This program are made available under the terms of the Apache License, Version 2.0
  60989. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  60990. /**
  60991. * @class CartoCSS
  60992. * @deprecatedclass SuperMap.CartoCSS
  60993. * @classdesc CartoCSS 解析类,其主要功能为将 CartoCSS 字符串解析为 CartoCSS 的 shader 属性风格对象。
  60994. * @category BaseTypes Style
  60995. * @param {string} cartoStr - 样式表字符串。
  60996. * @example
  60997. * var cartocss = "@provinceLineColor:#ddd;
  60998. * #China_Provinces_L___China400{
  60999. * line-dasharray:10,10;
  61000. * line-color:@provinceLineColor;
  61001. * line-width:1;
  61002. * }";
  61003. * new CartoCSS(cartocss);
  61004. * @usage
  61005. */
  61006. /*eslint no-useless-escape: "off"*/
  61007. var CartoCSS = /*#__PURE__*/function () {
  61008. function CartoCSS(cartoStr) {
  61009. CartoCSS_classCallCheck(this, CartoCSS);
  61010. this.env = null;
  61011. /**
  61012. * @member CartoCSS.prototype.parser
  61013. * @description 解析器。
  61014. */
  61015. this.parser = null;
  61016. /**
  61017. * @member CartoCSS.prototype.ruleSet
  61018. * @description CartoCSS 规则对象。
  61019. */
  61020. this.ruleSet = null;
  61021. /**
  61022. * @member CartoCSS.prototype.cartoStr
  61023. * @description CartoCSS 样式表字符串。
  61024. */
  61025. this.cartoStr = "";
  61026. /**
  61027. * @member CartoCSS.prototype.shaders
  61028. * @description Carto 着色器集。
  61029. */
  61030. this.shaders = null;
  61031. if (typeof cartoStr === "string") {
  61032. this.cartoStr = cartoStr;
  61033. this.env = {
  61034. frames: [],
  61035. errors: [],
  61036. error: function error(obj) {
  61037. this.errors.push(obj);
  61038. }
  61039. };
  61040. this.parser = this.getParser(this.env);
  61041. this.parse(cartoStr);
  61042. this.shaders = this.toShaders();
  61043. }
  61044. }
  61045. /**
  61046. * @function CartoCSS.prototype.getParser
  61047. * @description 获取 CartoCSS 解析器。
  61048. */
  61049. CartoCSS_createClass(CartoCSS, [{
  61050. key: "getParser",
  61051. value: function getParser(env) {
  61052. var input,
  61053. // LeSS input string
  61054. i,
  61055. // current index in `input`
  61056. j,
  61057. // current chunk
  61058. temp,
  61059. // temporarily holds a chunk's state, for backtracking
  61060. memo,
  61061. // temporarily holds `i`, when backtracking
  61062. furthest,
  61063. // furthest index the parser has gone to
  61064. chunks,
  61065. // chunkified input
  61066. current,
  61067. // index of current chunk, in `input`
  61068. parser;
  61069. var that = this;
  61070. // This function is called after all files
  61071. // have been imported through `@import`.
  61072. var finish = function finish() {//NOSONAR
  61073. //所有文件导入完成之后调用
  61074. };
  61075. function save() {
  61076. temp = chunks[j];
  61077. memo = i;
  61078. current = i;
  61079. }
  61080. function restore() {
  61081. chunks[j] = temp;
  61082. i = memo;
  61083. current = i;
  61084. }
  61085. function sync() {
  61086. if (i > current) {
  61087. chunks[j] = chunks[j].slice(i - current);
  61088. current = i;
  61089. }
  61090. }
  61091. //
  61092. // Parse from a token, regexp or string, and move forward if match
  61093. //
  61094. function _match(tok) {
  61095. var match, length, c, endIndex;
  61096. // Non-terminal
  61097. if (tok instanceof Function) {
  61098. return tok.call(parser.parsers);
  61099. // Terminal
  61100. // Either match a single character in the input,
  61101. // or match a regexp in the current chunk (chunk[j]).
  61102. } else if (typeof tok === 'string') {
  61103. match = input.charAt(i) === tok ? tok : null;
  61104. length = 1;
  61105. sync();
  61106. } else {
  61107. sync();
  61108. match = tok.exec(chunks[j]);
  61109. if (match) {
  61110. length = match[0].length;
  61111. } else {
  61112. return null;
  61113. }
  61114. }
  61115. // The match is confirmed, add the match length to `i`,
  61116. // and consume any extra white-space characters (' ' || '\n')
  61117. // which come after that. The reason for this is that LeSS's
  61118. // grammar is mostly white-space insensitive.
  61119. if (match) {
  61120. var mem = i += length;
  61121. endIndex = i + chunks[j].length - length;
  61122. while (i < endIndex) {
  61123. c = input.charCodeAt(i);
  61124. if (!(c === 32 || c === 10 || c === 9)) {
  61125. break;
  61126. }
  61127. i++;
  61128. }
  61129. chunks[j] = chunks[j].slice(length + (i - mem));
  61130. current = i;
  61131. if (chunks[j].length === 0 && j < chunks.length - 1) {
  61132. j++;
  61133. }
  61134. if (typeof match === 'string') {
  61135. return match;
  61136. } else {
  61137. return match.length === 1 ? match[0] : match;
  61138. }
  61139. }
  61140. }
  61141. // Same as _match(), but don't change the state of the parser,
  61142. // just return the match.
  61143. function peek(tok) {
  61144. if (typeof tok === 'string') {
  61145. return input.charAt(i) === tok;
  61146. } else {
  61147. return !!tok.test(chunks[j]);
  61148. }
  61149. }
  61150. // Make an error object from a passed set of properties.
  61151. // Accepted properties:
  61152. // - `message`: Text of the error message.
  61153. // - `filename`: Filename where the error occurred.
  61154. // - `index`: Char. index where the error occurred.
  61155. function makeError(err) {
  61156. var einput;
  61157. var defautls = {
  61158. index: furthest,
  61159. filename: env.filename,
  61160. message: 'Parse error.',
  61161. line: 0,
  61162. column: -1
  61163. };
  61164. for (var prop in defautls) {
  61165. if (err[prop] === 0) {
  61166. err[prop] = defautls[prop];
  61167. }
  61168. }
  61169. if (err.filename && that.env.inputs && that.env.inputs[err.filename]) {
  61170. einput = that.env.inputs[err.filename];
  61171. } else {
  61172. einput = input;
  61173. }
  61174. err.line = (einput.slice(0, err.index).match(/\n/g) || '').length + 1;
  61175. for (var n = err.index; n >= 0 && einput.charAt(n) !== '\n'; n--) {
  61176. err.column++;
  61177. }
  61178. return new Error([err.filename, err.line, err.column, err.message].join(";"));
  61179. }
  61180. this.env = env = env || {};
  61181. this.env.filename = this.env.filename || null;
  61182. this.env.inputs = this.env.inputs || {};
  61183. // The Parser
  61184. parser = {
  61185. // Parse an input string into an abstract syntax tree.
  61186. // Throws an error on parse errors.
  61187. parse: function parse(str) {
  61188. var root,
  61189. error = null;
  61190. i = j = current = furthest = 0;
  61191. chunks = [];
  61192. input = str.replace(/\r\n/g, '\n');
  61193. if (env.filename) {
  61194. that.env.inputs[env.filename] = input;
  61195. }
  61196. // Split the input into chunks.
  61197. chunks = function (chunks) {
  61198. var j = 0,
  61199. skip = /(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,
  61200. comment = /\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,
  61201. string = /"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,
  61202. level = 0,
  61203. match,
  61204. chunk = chunks[0],
  61205. inParam;
  61206. for (var i = 0, c, cc; i < input.length;) {
  61207. skip.lastIndex = i;
  61208. if (match = skip.exec(input)) {
  61209. if (match.index === i) {
  61210. i += match[0].length;
  61211. chunk.push(match[0]);
  61212. }
  61213. }
  61214. c = input.charAt(i);
  61215. comment.lastIndex = string.lastIndex = i;
  61216. if (match = string.exec(input)) {
  61217. if (match.index === i) {
  61218. i += match[0].length;
  61219. chunk.push(match[0]);
  61220. continue;
  61221. }
  61222. }
  61223. if (!inParam && c === '/') {
  61224. cc = input.charAt(i + 1);
  61225. if (cc === '/' || cc === '*') {
  61226. if (match = comment.exec(input)) {
  61227. if (match.index === i) {
  61228. i += match[0].length;
  61229. chunk.push(match[0]);
  61230. continue;
  61231. }
  61232. }
  61233. }
  61234. }
  61235. switch (c) {
  61236. case '{':
  61237. //NOSONAR
  61238. if (!inParam) {
  61239. level++;
  61240. chunk.push(c);
  61241. break;
  61242. }
  61243. case '}':
  61244. //NOSONAR
  61245. if (!inParam) {
  61246. level--;
  61247. chunk.push(c);
  61248. chunks[++j] = chunk = [];
  61249. break;
  61250. }
  61251. case '(':
  61252. //NOSONAR
  61253. if (!inParam) {
  61254. inParam = true;
  61255. chunk.push(c);
  61256. break;
  61257. }
  61258. case ')':
  61259. //NOSONAR
  61260. if (inParam) {
  61261. inParam = false;
  61262. chunk.push(c);
  61263. break;
  61264. }
  61265. default:
  61266. chunk.push(c);
  61267. break;
  61268. }
  61269. i++;
  61270. }
  61271. if (level !== 0) {
  61272. error = {
  61273. index: i - 1,
  61274. type: 'Parse',
  61275. message: level > 0 ? "missing closing `}`" : "missing opening `{`"
  61276. };
  61277. }
  61278. return chunks.map(function (c) {
  61279. return c.join('');
  61280. });
  61281. }([[]]);
  61282. if (error) {
  61283. throw makeError(error);
  61284. }
  61285. // Sort rules by specificity: this function expects selectors to be
  61286. // split already.
  61287. //
  61288. // Written to be used as a .sort(Function);
  61289. // argument.
  61290. //
  61291. // [1, 0, 0, 467] > [0, 0, 1, 520]
  61292. var specificitySort = function specificitySort(a, b) {
  61293. var as = a.specificity;
  61294. var bs = b.specificity;
  61295. if (as[0] != bs[0]) {
  61296. return bs[0] - as[0];
  61297. }
  61298. if (as[1] != bs[1]) {
  61299. return bs[1] - as[1];
  61300. }
  61301. if (as[2] != bs[2]) {
  61302. return bs[2] - as[2];
  61303. }
  61304. return bs[3] - as[3];
  61305. };
  61306. // Start with the primary rule.
  61307. // The whole syntax tree is held under a Ruleset node,
  61308. // with the `root` property set to true, so no `{}` are
  61309. // output.
  61310. root = new CartoCSS.Tree.Ruleset([], _match(this.parsers.primary));
  61311. root.root = true;
  61312. // Get an array of Ruleset objects, flattened
  61313. // and sorted according to specificitySort
  61314. root.toList = function () {
  61315. return function (env) {
  61316. env.error = function (e) {
  61317. if (!env.errors) {
  61318. env.errors = new Error('');
  61319. }
  61320. if (env.errors.message) {
  61321. env.errors.message += '\n' + makeError(e).message;
  61322. } else {
  61323. env.errors.message = makeError(e).message;
  61324. }
  61325. };
  61326. env.frames = env.frames || [];
  61327. // call populates Invalid-caused errors
  61328. var definitions = this.flatten([], [], env);
  61329. definitions.sort(specificitySort);
  61330. return definitions;
  61331. };
  61332. }();
  61333. return root;
  61334. },
  61335. // Here in, the parsing rules/functions
  61336. //
  61337. // The basic structure of the syntax tree generated is as follows:
  61338. //
  61339. // Ruleset -> Rule -> Value -> Expression -> Entity
  61340. //
  61341. // In general, most rules will try to parse a token with the `_match()` function, and if the return
  61342. // value is truly, will return a new node, of the relevant type. Sometimes, we need to check
  61343. // first, before parsing, that's when we use `peek()`.
  61344. parsers: {
  61345. // The `primary` rule is the *entry* and *exit* point of the parser.
  61346. // The rules here can appear at any level of the parse tree.
  61347. //
  61348. // The recursive nature of the grammar is an interplay between the `block`
  61349. // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule,
  61350. // as represented by this simplified grammar:
  61351. //
  61352. // primary → (ruleset | rule)+
  61353. // ruleset → selector+ block
  61354. // block → '{' primary '}'
  61355. //
  61356. // Only at one point is the primary rule not called from the
  61357. // block rule: at the root level.
  61358. primary: function primary() {
  61359. var node,
  61360. root = [];
  61361. while ((node = _match(this.rule) || _match(this.ruleset) || _match(this.comment)) || _match(/^[\s\n]+/) || (node = _match(this.invalid))) {
  61362. if (node) {
  61363. root.push(node);
  61364. }
  61365. }
  61366. return root;
  61367. },
  61368. invalid: function invalid() {
  61369. var chunk = _match(/^[^;\n]*[;\n]/);
  61370. // To fail gracefully, match everything until a semicolon or linebreak.
  61371. if (chunk) {
  61372. return new CartoCSS.Tree.Invalid(chunk, memo);
  61373. }
  61374. },
  61375. // We create a Comment node for CSS comments `/* */`,
  61376. // but keep the LeSS comments `//` silent, by just skipping
  61377. // over them.
  61378. comment: function comment() {
  61379. var comment;
  61380. if (input.charAt(i) !== '/') {
  61381. return;
  61382. }
  61383. if (input.charAt(i + 1) === '/') {
  61384. return new CartoCSS.Tree.Comment(_match(/^\/\/.*/), true);
  61385. } else if (comment = _match(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/)) {
  61386. return new CartoCSS.Tree.Comment(comment);
  61387. }
  61388. },
  61389. // Entities are tokens which can be found inside an Expression
  61390. entities: {
  61391. // A string, which supports escaping " and ' "milky way" 'he\'s the one!'
  61392. quoted: function quoted() {
  61393. if (input.charAt(i) !== '"' && input.charAt(i) !== "'") {
  61394. return;
  61395. }
  61396. var str = _match(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/);
  61397. if (str) {
  61398. return new CartoCSS.Tree.Quoted(str[1] || str[2]);
  61399. }
  61400. },
  61401. // A reference to a Mapnik field, like [NAME]
  61402. // Behind the scenes, this has the same representation, but Carto
  61403. // needs to be careful to warn when unsupported operations are used.
  61404. field: function field() {
  61405. var l = '[',
  61406. r = ']';
  61407. if (!_match(l)) {
  61408. return;
  61409. }
  61410. var field_name = _match(/(^[^\]]+)/);
  61411. if (!_match(r)) {
  61412. return;
  61413. }
  61414. if (field_name) {
  61415. return new CartoCSS.Tree.Field(field_name[1]);
  61416. }
  61417. },
  61418. // This is a comparison operator
  61419. comparison: function comparison() {
  61420. var str = _match(/^=~|=|!=|<=|>=|<|>/);
  61421. if (str) {
  61422. return str;
  61423. }
  61424. },
  61425. // A catch-all word, such as: hard-light
  61426. // These can start with either a letter or a dash (-),
  61427. // and then contain numbers, underscores, and letters.
  61428. keyword: function keyword() {
  61429. var k = _match(/^[A-Za-z\u4e00-\u9fa5-]+[A-Za-z-0-9\u4e00-\u9fa5_]*/);
  61430. if (k) {
  61431. return new CartoCSS.Tree.Keyword(k);
  61432. }
  61433. },
  61434. // A function call like rgb(255, 0, 255)
  61435. // The arguments are parsed with the `entities.arguments` parser.
  61436. call: function call() {
  61437. var name, args;
  61438. if (!(name = /^([\w\-]+|%)\(/.exec(chunks[j]))) {
  61439. return;
  61440. }
  61441. name = name[1];
  61442. if (name === 'url') {
  61443. // url() is handled by the url parser instead
  61444. return null;
  61445. } else {
  61446. i += name.length;
  61447. }
  61448. var l = '(',
  61449. r = ')';
  61450. _match(l); // Parse the '(' and consume whitespace.
  61451. args = _match(this.entities['arguments']);
  61452. if (!_match(r)) {
  61453. return;
  61454. }
  61455. if (name) {
  61456. return new CartoCSS.Tree.Call(name, args, i);
  61457. }
  61458. },
  61459. // Arguments are comma-separated expressions
  61460. 'arguments': function _arguments() {
  61461. var args = [],
  61462. arg;
  61463. while (arg = _match(this.expression)) {
  61464. args.push(arg);
  61465. var q = ',';
  61466. if (!_match(q)) {
  61467. break;
  61468. }
  61469. }
  61470. return args;
  61471. },
  61472. literal: function literal() {
  61473. return _match(this.entities.dimension) || _match(this.entities.keywordcolor) || _match(this.entities.hexcolor) || _match(this.entities.quoted);
  61474. },
  61475. // Parse url() tokens
  61476. //
  61477. // We use a specific rule for urls, because they don't really behave like
  61478. // standard function calls. The difference is that the argument doesn't have
  61479. // to be enclosed within a string, so it can't be parsed as an Expression.
  61480. url: function url() {
  61481. var value;
  61482. if (input.charAt(i) !== 'u' || !_match(/^url\(/)) {
  61483. return;
  61484. }
  61485. value = _match(this.entities.quoted) || _match(this.entities.variable) || _match(/^[\-\w%@_match\/.&=:;#+?~]+/) || '';
  61486. var r = ')';
  61487. if (!_match(r)) {
  61488. return new CartoCSS.Tree.Invalid(value, memo, 'Missing closing ) in URL.');
  61489. } else {
  61490. return new CartoCSS.Tree.URL(typeof value.value !== 'undefined' || value instanceof CartoCSS.Tree.Variable ? value : new CartoCSS.Tree.Quoted(value));
  61491. }
  61492. },
  61493. // A Variable entity, such as `@fink`, in
  61494. //
  61495. // width: @fink + 2px
  61496. //
  61497. // We use a different parser for variable definitions,
  61498. // see `parsers.variable`.
  61499. variable: function variable() {
  61500. var name,
  61501. index = i;
  61502. if (input.charAt(i) === '@' && (name = _match(/^@[\w-]+/))) {
  61503. return new CartoCSS.Tree.Variable(name, index, env.filename);
  61504. }
  61505. },
  61506. hexcolor: function hexcolor() {
  61507. var rgb;
  61508. if (input.charAt(i) === '#' && (rgb = _match(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/))) {
  61509. return new CartoCSS.Tree.Color(rgb[1]);
  61510. }
  61511. },
  61512. keywordcolor: function keywordcolor() {
  61513. var rgb = chunks[j].match(/^[a-z]+/);
  61514. if (rgb && rgb[0] in CartoCSS.Tree.Reference.data.colors) {
  61515. return new CartoCSS.Tree.Color(CartoCSS.Tree.Reference.data.colors[_match(/^[a-z]+/)]);
  61516. }
  61517. },
  61518. // A Dimension, that is, a number and a unit. The only
  61519. // unit that has an effect is %
  61520. dimension: function dimension() {
  61521. var c = input.charCodeAt(i);
  61522. if (c > 57 || c < 45 || c === 47) {
  61523. return;
  61524. }
  61525. var value = _match(/^(-?\d*\.?\d+(?:[eE][-+]?\d+)?)(\%|\w+)?/);
  61526. if (value) {
  61527. return new CartoCSS.Tree.Dimension(value[1], value[2], memo);
  61528. }
  61529. }
  61530. },
  61531. // The variable part of a variable definition.
  61532. // Used in the `rule` parser. Like @fink:
  61533. variable: function variable() {
  61534. var name;
  61535. if (input.charAt(i) === '@' && (name = _match(/^(@[\w-]+)\s*:/))) {
  61536. return name[1];
  61537. }
  61538. },
  61539. // Entities are the smallest recognized token,
  61540. // and can be found inside a rule's value.
  61541. entity: function entity() {
  61542. var property1 = _match(this.entities.call) || _match(this.entities.literal);
  61543. var property2 = _match(this.entities.field) || _match(this.entities.variable);
  61544. var property3 = _match(this.entities.url) || _match(this.entities.keyword);
  61545. return property1 || property2 || property3;
  61546. },
  61547. // A Rule terminator. Note that we use `peek()` to check for '}',
  61548. // because the `block` rule will be expecting it, but we still need to make sure
  61549. // it's there, if ';' was ommitted.
  61550. end: function end() {
  61551. var q = ';';
  61552. return _match(q) || peek('}');
  61553. },
  61554. // Elements are the building blocks for Selectors. They consist of
  61555. // an element name, such as a tag a class, or `*`.
  61556. //增加对中文的支持,[\u4e00-\u9fa5]
  61557. element: function element() {
  61558. var e = _match(/^(?:[.#][\w\u4e00-\u9fa5\-]+|\*|Map)/);
  61559. if (e) {
  61560. return new CartoCSS.Tree.Element(e);
  61561. }
  61562. },
  61563. // Attachments allow adding multiple lines, polygons etc. to an
  61564. // object. There can only be one attachment per selector.
  61565. attachment: function attachment() {
  61566. var s = _match(/^::([\w\-]+(?:\/[\w\-]+)*)/);
  61567. if (s) {
  61568. return s[1];
  61569. }
  61570. },
  61571. // Selectors are made out of one or more Elements, see above.
  61572. selector: function selector() {
  61573. var a,
  61574. attachment,
  61575. e,
  61576. elements = [],
  61577. f,
  61578. filters = new CartoCSS.Tree.Filterset(),
  61579. z,
  61580. zooms = [],
  61581. segments = 0,
  61582. conditions = 0;
  61583. while ((e = _match(this.element)) || (z = _match(this.zoom)) || (f = _match(this.filter)) || (a = _match(this.attachment))) {
  61584. segments++;
  61585. if (e) {
  61586. elements.push(e);
  61587. } else if (z) {
  61588. zooms.push(z);
  61589. conditions++;
  61590. } else if (f) {
  61591. var err = filters.add(f);
  61592. if (err) {
  61593. throw makeError({
  61594. message: err,
  61595. index: i - 1
  61596. });
  61597. }
  61598. conditions++;
  61599. } else if (attachment) {
  61600. throw makeError({
  61601. message: 'Encountered second attachment name.',
  61602. index: i - 1
  61603. });
  61604. } else {
  61605. attachment = a;
  61606. }
  61607. var c = input.charAt(i);
  61608. if (c === '{' || c === '}' || c === ';' || c === ',') {
  61609. break;
  61610. }
  61611. }
  61612. if (segments) {
  61613. return new CartoCSS.Tree.Selector(filters, zooms, elements, attachment, conditions, memo);
  61614. }
  61615. },
  61616. filter: function filter() {
  61617. save();
  61618. var key,
  61619. op,
  61620. val,
  61621. l = '[',
  61622. r = ']';
  61623. if (!_match(l)) {
  61624. return;
  61625. }
  61626. if (key = _match(/^[a-zA-Z0-9\-_]+/) || _match(this.entities.quoted) || _match(this.entities.variable) || _match(this.entities.keyword) || _match(this.entities.field)) {
  61627. if (key instanceof CartoCSS.Tree.Quoted) {
  61628. key = new CartoCSS.Tree.Field(key.toString());
  61629. }
  61630. if ((op = _match(this.entities.comparison)) && (val = _match(this.entities.quoted) || _match(this.entities.variable) || _match(this.entities.dimension) || _match(this.entities.keyword) || _match(this.entities.field))) {
  61631. if (!_match(r)) {
  61632. throw makeError({
  61633. message: 'Missing closing ] of filter.',
  61634. index: memo - 1
  61635. });
  61636. }
  61637. if (!key.is) {
  61638. key = new CartoCSS.Tree.Field(key);
  61639. }
  61640. return new CartoCSS.Tree.Filter(key, op, val, memo, env.filename);
  61641. }
  61642. }
  61643. },
  61644. zoom: function zoom() {
  61645. save();
  61646. var op,
  61647. val,
  61648. r = ']';
  61649. if (_match(/^\[\s*zoom/g) && (op = _match(this.entities.comparison)) && (val = _match(this.entities.variable) || _match(this.entities.dimension)) && _match(r)) {
  61650. return new CartoCSS.Tree.Zoom(op, val, memo);
  61651. } else {
  61652. // backtrack
  61653. restore();
  61654. }
  61655. },
  61656. // The `block` rule is used by `ruleset`
  61657. // It's a wrapper around the `primary` rule, with added `{}`.
  61658. block: function block() {
  61659. var content,
  61660. l = '{',
  61661. r = '}';
  61662. if (_match(l) && (content = _match(this.primary)) && _match(r)) {
  61663. return content;
  61664. }
  61665. },
  61666. // div, .class, body > p {...}
  61667. ruleset: function ruleset() {
  61668. var selectors = [],
  61669. s,
  61670. rules,
  61671. q = ',';
  61672. save();
  61673. while (s = _match(this.selector)) {
  61674. selectors.push(s);
  61675. while (_match(this.comment)) {//NOSONAR
  61676. }
  61677. if (!_match(q)) {
  61678. break;
  61679. }
  61680. while (_match(this.comment)) {//NOSONAR
  61681. }
  61682. }
  61683. if (s) {
  61684. while (_match(this.comment)) {//NOSONAR
  61685. }
  61686. }
  61687. if (selectors.length > 0 && (rules = _match(this.block))) {
  61688. if (selectors.length === 1 && selectors[0].elements.length && selectors[0].elements[0].value === 'Map') {
  61689. var rs = new CartoCSS.Tree.Ruleset(selectors, rules);
  61690. rs.isMap = true;
  61691. return rs;
  61692. }
  61693. return new CartoCSS.Tree.Ruleset(selectors, rules);
  61694. } else {
  61695. // Backtrack
  61696. restore();
  61697. }
  61698. },
  61699. rule: function rule() {
  61700. var name,
  61701. value,
  61702. c = input.charAt(i);
  61703. save();
  61704. if (c === '.' || c === '#') {
  61705. return;
  61706. }
  61707. if (name = _match(this.variable) || _match(this.property)) {
  61708. value = _match(this.value);
  61709. if (value && _match(this.end)) {
  61710. return new CartoCSS.Tree.Rule(name, value, memo, env.filename);
  61711. } else {
  61712. furthest = i;
  61713. restore();
  61714. }
  61715. }
  61716. },
  61717. font: function font() {
  61718. var value = [],
  61719. expression = [],
  61720. e,
  61721. q = ',';
  61722. while (e = _match(this.entity)) {
  61723. expression.push(e);
  61724. }
  61725. value.push(new CartoCSS.Tree.Expression(expression));
  61726. if (_match(q)) {
  61727. while (e = _match(this.expression)) {
  61728. value.push(e);
  61729. if (!_match(q)) {
  61730. break;
  61731. }
  61732. }
  61733. }
  61734. return new CartoCSS.Tree.Value(value);
  61735. },
  61736. // A Value is a comma-delimited list of Expressions
  61737. // In a Rule, a Value represents everything after the `:`,
  61738. // and before the `;`.
  61739. value: function value() {
  61740. var e,
  61741. expressions = [],
  61742. q = ',';
  61743. while (e = _match(this.expression)) {
  61744. expressions.push(e);
  61745. if (!_match(q)) {
  61746. break;
  61747. }
  61748. }
  61749. if (expressions.length > 1) {
  61750. return new CartoCSS.Tree.Value(expressions.map(function (e) {
  61751. return e.value[0];
  61752. }));
  61753. } else if (expressions.length === 1) {
  61754. return new CartoCSS.Tree.Value(expressions);
  61755. }
  61756. },
  61757. // A sub-expression, contained by parenthensis
  61758. sub: function sub() {
  61759. var e,
  61760. l = '(',
  61761. r = ")";
  61762. if (_match(l) && (e = _match(this.expression)) && _match(r)) {
  61763. return e;
  61764. }
  61765. },
  61766. // This is a misnomer because it actually handles multiplication
  61767. // and division.
  61768. multiplication: function multiplication() {
  61769. var m,
  61770. a,
  61771. op,
  61772. operation,
  61773. q = '/';
  61774. if (m = _match(this.operand)) {
  61775. while ((op = _match(q) || _match('*') || _match('%')) && (a = _match(this.operand))) {
  61776. operation = new CartoCSS.Tree.Operation(op, [operation || m, a], memo);
  61777. }
  61778. return operation || m;
  61779. }
  61780. },
  61781. addition: function addition() {
  61782. var m,
  61783. a,
  61784. op,
  61785. operation,
  61786. plus = '+';
  61787. if (m = _match(this.multiplication)) {
  61788. while ((op = _match(/^[-+]\s+/) || input.charAt(i - 1) != ' ' && (_match(plus) || _match('-'))) && (a = _match(this.multiplication))) {
  61789. operation = new CartoCSS.Tree.Operation(op, [operation || m, a], memo);
  61790. }
  61791. return operation || m;
  61792. }
  61793. },
  61794. // An operand is anything that can be part of an operation,
  61795. // such as a Color, or a Variable
  61796. operand: function operand() {
  61797. return _match(this.sub) || _match(this.entity);
  61798. },
  61799. // Expressions either represent mathematical operations,
  61800. // or white-space delimited Entities. @var * 2
  61801. expression: function expression() {
  61802. var e,
  61803. entities = [];
  61804. while (e = _match(this.addition) || _match(this.entity)) {
  61805. entities.push(e);
  61806. }
  61807. if (entities.length > 0) {
  61808. return new CartoCSS.Tree.Expression(entities);
  61809. }
  61810. },
  61811. property: function property() {
  61812. var name = _match(/^(([a-z][-a-z_0-9]*\/)?\*?-?[-a-z_0-9]+)\s*:/);
  61813. if (name) {
  61814. return name[1];
  61815. }
  61816. }
  61817. }
  61818. };
  61819. return parser;
  61820. }
  61821. /**
  61822. * @function CartoCSS.prototype.parse
  61823. * @description 利用CartoCSS解析器里面的parse方法,将CartoCSS样式表字符串转化为CartoCSS规则集。
  61824. * @returns {Object} CartoCSS规则集。
  61825. */
  61826. }, {
  61827. key: "parse",
  61828. value: function parse(str) {
  61829. var parser = this.parser;
  61830. var ruleSet = this.ruleSet = parser.parse(str);
  61831. return ruleSet;
  61832. }
  61833. /**
  61834. * @function CartoCSS.prototype.toShaders
  61835. * @description 将CartoCSS规则集转化为着色器。
  61836. * @returns {Array} CartoCSS着色器集。
  61837. */
  61838. }, {
  61839. key: "toShaders",
  61840. value: function toShaders() {
  61841. if (this.ruleSet) {
  61842. var ruleset = this.ruleSet;
  61843. if (ruleset) {
  61844. var defs = ruleset.toList(this.env);
  61845. defs.reverse();
  61846. var shaders = {};
  61847. var keys = [];
  61848. this._toShaders(shaders, keys, defs);
  61849. var ordered_shaders = [];
  61850. var done = {};
  61851. for (var i = 0, len0 = defs.length; i < len0; ++i) {
  61852. var def = defs[i];
  61853. var k = def.attachment;
  61854. var shader = shaders[keys[i]];
  61855. var shaderArray = [];
  61856. if (!done[k]) {
  61857. var j = 0;
  61858. for (var prop in shader) {
  61859. if (prop !== 'zoom' && prop !== 'frames' && prop !== "attachment" && prop != "elements") {
  61860. //对layer-index作特殊处理以实现图层的控制
  61861. if (prop === "layer-index") {
  61862. /*var getLayerIndex = Function("attributes", "zoom", "var _value = null;" + shader[prop].join('\n') + "; return _value; ");*/
  61863. var getLayerIndex = function getLayerIndex(attributes, zoom) {
  61864. //NOSONAR
  61865. var _value = null;
  61866. shader[prop].join('\n');
  61867. return _value;
  61868. };
  61869. var layerIndex = getLayerIndex();
  61870. Object.defineProperty(shaderArray, "layerIndex", {
  61871. configurable: true,
  61872. enumerable: false,
  61873. value: layerIndex
  61874. });
  61875. } else {
  61876. shaderArray[j++] = function (ops, shaderArray) {
  61877. //NOSONAR
  61878. if (!Array.isArray(ops)) {
  61879. return ops;
  61880. }
  61881. var body = ops.join('\n');
  61882. var myKeyword = 'attributes["FEATUREID"]&&attributes["FEATUREID"]';
  61883. var index = body.indexOf(myKeyword);
  61884. if (index >= 0) {
  61885. //对featureID作一些特殊处理,以将featureID提取出来
  61886. if (!shaderArray.featureFilter) {
  61887. var featureFilterStart = index + myKeyword.length;
  61888. var featureFilterEnd = body.indexOf(")", featureFilterStart + 1);
  61889. var featureFilterStr = "featureId&&(featureId" + body.substring(featureFilterStart, featureFilterEnd) + ")";
  61890. /*var featureFilter = Function("featureId", "if(" + featureFilterStr + "){return true;}return false;");*/
  61891. var featureFilter = function featureFilter(featureId) {
  61892. if (featureFilterStr) {
  61893. return true;
  61894. }
  61895. return false;
  61896. };
  61897. Object.defineProperty(shaderArray, "featureFilter", {
  61898. configurable: true,
  61899. enumerable: false,
  61900. value: featureFilter
  61901. });
  61902. }
  61903. return {
  61904. "property": prop,
  61905. "getValue": Function("attributes", "zoom", "seftFilter", "var _value = null; var isExcute=typeof seftFilter=='function'?sefgFilter():seftFilter;if(isExcute){" + body + ";} return _value; ") //NOSONAR
  61906. };
  61907. } else {
  61908. return {
  61909. "property": prop,
  61910. "getValue": Function("attributes", "zoom", "var _value = null;" + body + "; return _value; ") //NOSONAR
  61911. };
  61912. }
  61913. }(shader[prop], shaderArray);
  61914. }
  61915. }
  61916. }
  61917. Object.defineProperty(shaderArray, "attachment", {
  61918. configurable: true,
  61919. enumerable: false,
  61920. value: k
  61921. });
  61922. Object.defineProperty(shaderArray, "elements", {
  61923. configurable: true,
  61924. enumerable: false,
  61925. value: def.elements
  61926. });
  61927. ordered_shaders.push(shaderArray);
  61928. done[keys[i]] = true;
  61929. }
  61930. Object.defineProperty(shaderArray, "zoom", {
  61931. configurable: true,
  61932. enumerable: false,
  61933. value: def.zoom
  61934. });
  61935. //shader.frames.push(def.frame_offset);
  61936. }
  61937. return ordered_shaders;
  61938. }
  61939. }
  61940. return null;
  61941. }
  61942. }, {
  61943. key: "_toShaders",
  61944. value: function _toShaders(shaders, keys, defs) {
  61945. for (var i = 0, len0 = defs.length; i < len0; ++i) {
  61946. var def = defs[i];
  61947. var element_str = [];
  61948. for (var j = 0, len1 = def.elements.length; j < len1; j++) {
  61949. element_str.push(def.elements[j]);
  61950. }
  61951. var filters = def.filters.filters;
  61952. var filterStr = [];
  61953. for (var attr in filters) {
  61954. filterStr.push(filters[attr].id);
  61955. }
  61956. var key = element_str.join("/") + "::" + def.attachment + "_" + filterStr.join("_");
  61957. keys.push(key);
  61958. var shader = shaders[key] = shaders[key] || {};
  61959. //shader.frames = [];
  61960. shader.zoom = CartoCSS.Tree.Zoom.all;
  61961. var props = def.toJS(this.env);
  61962. for (var v in props) {
  61963. (shader[v] = shader[v] || []).push(props[v].join('\n'));
  61964. }
  61965. }
  61966. }
  61967. /**
  61968. * @function CartoCSS.prototype.getShaders
  61969. * @description 获取CartoCSS着色器。
  61970. * @returns {Array} 着色器集。
  61971. * @example
  61972. * //shaders的结构大概如下:
  61973. * var shaders=[
  61974. * {
  61975. * attachment:"one",
  61976. * elements:[],
  61977. * zoom:23,
  61978. * length:2,
  61979. * 0:{property:"line-color",value:function(attribute,zoom){var _value=null;if(zoom){_value="#123456"}return _vlaue;}},
  61980. * 1:{preoperty:"line-width",value:function(attribute,zoom){var _value=null;if(zoom){_value=3}return _vlaue;}}
  61981. * },
  61982. * {
  61983. * attachment:"two",
  61984. * elements:[],
  61985. * zoom:23,
  61986. * length:2,
  61987. * 0:{property:"polygon-color",value:function(attribute,zoom){var _value=null;if(zoom){_value="#123456"}return _vlaue;}},
  61988. * 1:{property:"line-width",value:function(attribute,zoom){var _value=null;if(zoom){_value=3}return _vlaue;}}
  61989. * }
  61990. * ];
  61991. */
  61992. }, {
  61993. key: "getShaders",
  61994. value: function getShaders() {
  61995. return this.shaders;
  61996. }
  61997. /**
  61998. * @function CartoCSS.prototype.destroy
  61999. * @description CartoCSS解析对象的析构函数,用于销毁CartoCSS解析对象。
  62000. */
  62001. }, {
  62002. key: "destroy",
  62003. value: function destroy() {
  62004. this.cartoStr = null;
  62005. this.env = null;
  62006. this.ruleSet = null;
  62007. this.parser = null;
  62008. this.shaders = null;
  62009. }
  62010. }]);
  62011. return CartoCSS;
  62012. }();
  62013. var _mapnik_reference_latest = {
  62014. "version": "2.1.1",
  62015. "style": {
  62016. "filter-mode": {
  62017. "type": ["all", "first"],
  62018. "doc": "Control the processing behavior of Rule filters within a Style. If 'all' is used then all Rules are processed sequentially independent of whether any previous filters matched. If 'first' is used then it means processing ends after the first match (a positive filter evaluation) and no further Rules in the Style are processed ('first' is usually the default for CSS implementations on top of Mapnik to simplify translation from CSS to Mapnik XML)",
  62019. "default-value": "all",
  62020. "default-meaning": "All Rules in a Style are processed whether they have filters or not and whether or not the filter conditions evaluate to true."
  62021. },
  62022. "image-filters": {
  62023. "css": "image-filters",
  62024. "default-value": "none",
  62025. "default-meaning": "no filters",
  62026. "type": "functions",
  62027. "functions": [["agg-stack-blur", 2], ["emboss", 0], ["blur", 0], ["gray", 0], ["sobel", 0], ["edge-detect", 0], ["x-gradient", 0], ["y-gradient", 0], ["invert", 0], ["sharpen", 0]],
  62028. "doc": "A list of image filters."
  62029. },
  62030. "comp-op": {
  62031. "css": "comp-op",
  62032. "default-value": "src-over",
  62033. "default-meaning": "add the current layer on top of other layers",
  62034. "doc": "Composite operation. This defines how this layer should behave relative to layers atop or below it.",
  62035. "type": ["clear", "src", "dst", "src-over", "dst-over", "src-in", "dst-in", "src-out", "dst-out", "src-atop", "dst-atop", "xor", "plus", "minus", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "contrast", "invert", "invert-rgb", "grain-merge", "grain-extract", "hue", "saturation", "color", "value"]
  62036. },
  62037. "opacity": {
  62038. "css": "opacity",
  62039. "type": "float",
  62040. "doc": "An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer)",
  62041. "default-value": 1,
  62042. "default-meaning": "no separate buffer will be used and no alpha will be applied to the style after rendering"
  62043. }
  62044. },
  62045. "layer": {
  62046. "name": {
  62047. "default-value": "",
  62048. "type": "string",
  62049. "required": true,
  62050. "default-meaning": "No layer name has been provided",
  62051. "doc": "The name of a layer. Can be anything you wish and is not strictly validated, but ideally unique in the map"
  62052. },
  62053. "srs": {
  62054. "default-value": "",
  62055. "type": "string",
  62056. "default-meaning": "No srs value is provided and the value will be inherited from the Map's srs",
  62057. "doc": "The spatial reference system definition for the layer, aka the projection. Can either be a proj4 literal string like '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' or, if the proper proj4 epsg/nad/etc identifier files are installed, a string that uses an id like: '+init=epsg:4326'"
  62058. },
  62059. "status": {
  62060. "default-value": true,
  62061. "type": "boolean",
  62062. "default-meaning": "This layer will be marked as active and available for processing",
  62063. "doc": "A property that can be set to false to disable this layer from being processed"
  62064. },
  62065. "minzoom": {
  62066. "default-value": "0",
  62067. "type": "float",
  62068. "default-meaning": "The layer will be visible at the minimum possible scale",
  62069. "doc": "The minimum scale denominator that this layer will be visible at. A layer's visibility is determined by whether its status is true and if the Map scale >= minzoom - 1e-6 and scale < maxzoom + 1e-6"
  62070. },
  62071. "maxzoom": {
  62072. "default-value": "1.79769e+308",
  62073. "type": "float",
  62074. "default-meaning": "The layer will be visible at the maximum possible scale",
  62075. "doc": "The maximum scale denominator that this layer will be visible at. The default is the numeric limit of the C++ double type, which may vary slightly by system, but is likely a massive number like 1.79769e+308 and ensures that this layer will always be visible unless the value is reduced. A layer's visibility is determined by whether its status is true and if the Map scale >= minzoom - 1e-6 and scale < maxzoom + 1e-6"
  62076. },
  62077. "queryable": {
  62078. "default-value": false,
  62079. "type": "boolean",
  62080. "default-meaning": "The layer will not be available for the direct querying of data values",
  62081. "doc": "This property was added for GetFeatureInfo/WMS compatibility and is rarely used. It is off by default meaning that in a WMS context the layer will not be able to be queried unless the property is explicitly set to true"
  62082. },
  62083. "clear-label-cache": {
  62084. "default-value": false,
  62085. "type": "boolean",
  62086. "default-meaning": "The renderer's collision detector cache (used for avoiding duplicate labels and overlapping markers) will not be cleared immediately before processing this layer",
  62087. "doc": "This property, by default off, can be enabled to allow a user to clear the collision detector cache before a given layer is processed. This may be desirable to ensure that a given layers data shows up on the map even if it normally would not because of collisions with previously rendered labels or markers"
  62088. },
  62089. "group-by": {
  62090. "default-value": "",
  62091. "type": "string",
  62092. "default-meaning": "No special layer grouping will be used during rendering",
  62093. "doc": "https://github.com/mapnik/mapnik/wiki/Grouped-rendering"
  62094. },
  62095. "buffer-size": {
  62096. "default-value": "0",
  62097. "type": "float",
  62098. "default-meaning": "No buffer will be used",
  62099. "doc": "Extra tolerance around the Layer extent (in pixels) used to when querying and (potentially) clipping the layer data during rendering"
  62100. },
  62101. "maximum-extent": {
  62102. "default-value": "none",
  62103. "type": "bbox",
  62104. "default-meaning": "No clipping extent will be used",
  62105. "doc": "An extent to be used to limit the bounds used to query this specific layer data during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Layer."
  62106. }
  62107. },
  62108. "symbolizers": {
  62109. "*": {
  62110. "image-filters": {
  62111. "css": "image-filters",
  62112. "default-value": "none",
  62113. "default-meaning": "no filters",
  62114. "type": "functions",
  62115. "functions": [["agg-stack-blur", 2], ["emboss", 0], ["blur", 0], ["gray", 0], ["sobel", 0], ["edge-detect", 0], ["x-gradient", 0], ["y-gradient", 0], ["invert", 0], ["sharpen", 0]],
  62116. "doc": "A list of image filters."
  62117. },
  62118. "comp-op": {
  62119. "css": "comp-op",
  62120. "default-value": "src-over",
  62121. "default-meaning": "add the current layer on top of other layers",
  62122. "doc": "Composite operation. This defines how this layer should behave relative to layers atop or below it.",
  62123. "type": ["clear", "src", "dst", "src-over", "dst-over", "src-in", "dst-in", "src-out", "dst-out", "src-atop", "dst-atop", "xor", "plus", "minus", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "contrast", "invert", "invert-rgb", "grain-merge", "grain-extract", "hue", "saturation", "color", "value"]
  62124. },
  62125. "opacity": {
  62126. "css": "opacity",
  62127. "type": "float",
  62128. "doc": "An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer)",
  62129. "default-value": 1,
  62130. "default-meaning": "no separate buffer will be used and no alpha will be applied to the style after rendering"
  62131. }
  62132. },
  62133. "map": {
  62134. "background-color": {
  62135. "css": "background-color",
  62136. "default-value": "none",
  62137. "default-meaning": "transparent",
  62138. "type": "color",
  62139. "doc": "Map Background color"
  62140. },
  62141. "background-image": {
  62142. "css": "background-image",
  62143. "type": "uri",
  62144. "default-value": "",
  62145. "default-meaning": "transparent",
  62146. "doc": "An image that is repeated below all features on a map as a background.",
  62147. "description": "Map Background image"
  62148. },
  62149. "srs": {
  62150. "css": "srs",
  62151. "type": "string",
  62152. "default-value": "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs",
  62153. "default-meaning": "The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space",
  62154. "doc": "Map spatial reference (proj4 string)"
  62155. },
  62156. "buffer-size": {
  62157. "css": "buffer-size",
  62158. "default-value": "0",
  62159. "type": "float",
  62160. "default-meaning": "No buffer will be used",
  62161. "doc": "Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with \"avoid-edges\"."
  62162. },
  62163. "maximum-extent": {
  62164. "css": "",
  62165. "default-value": "none",
  62166. "type": "bbox",
  62167. "default-meaning": "No clipping extent will be used",
  62168. "doc": "An extent to be used to limit the bounds used to query all layers during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Map."
  62169. },
  62170. "base": {
  62171. "css": "base",
  62172. "default-value": "",
  62173. "default-meaning": "This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.",
  62174. "type": "string",
  62175. "doc": "Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet."
  62176. },
  62177. "paths-from-xml": {
  62178. "css": "",
  62179. "default-value": true,
  62180. "default-meaning": "Paths read from XML will be interpreted from the location of the XML",
  62181. "type": "boolean",
  62182. "doc": "value to control whether paths in the XML will be interpreted from the location of the XML or from the working directory of the program that calls load_map()"
  62183. },
  62184. "minimum-version": {
  62185. "css": "",
  62186. "default-value": "none",
  62187. "default-meaning": "Mapnik version will not be detected and no error will be thrown about compatibility",
  62188. "type": "string",
  62189. "doc": "The minumum Mapnik version (e.g. 0.7.2) needed to use certain functionality in the stylesheet"
  62190. },
  62191. "font-directory": {
  62192. "css": "font-directory",
  62193. "type": "uri",
  62194. "default-value": "none",
  62195. "default-meaning": "No map-specific fonts will be registered",
  62196. "doc": "Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered)."
  62197. }
  62198. },
  62199. "polygon": {
  62200. "fill": {
  62201. "css": "polygon-fill",
  62202. "type": "color",
  62203. "default-value": "rgba(128,128,128,1)",
  62204. "default-meaning": "gray and fully opaque (alpha = 1), same as rgb(128,128,128)",
  62205. "doc": "Fill color to assign to a polygon"
  62206. },
  62207. "fill-opacity": {
  62208. "css": "polygon-opacity",
  62209. "type": "float",
  62210. "doc": "The opacity of the polygon",
  62211. "default-value": 1,
  62212. "default-meaning": "opaque"
  62213. },
  62214. "gamma": {
  62215. "css": "polygon-gamma",
  62216. "type": "float",
  62217. "default-value": 1,
  62218. "default-meaning": "fully antialiased",
  62219. "range": "0-1",
  62220. "doc": "Level of antialiasing of polygon edges"
  62221. },
  62222. "gamma-method": {
  62223. "css": "polygon-gamma-method",
  62224. "type": ["power", "linear", "none", "threshold", "multiply"],
  62225. "default-value": "power",
  62226. "default-meaning": "pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",
  62227. "doc": "An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"
  62228. },
  62229. "clip": {
  62230. "css": "polygon-clip",
  62231. "type": "boolean",
  62232. "default-value": true,
  62233. "default-meaning": "geometry will be clipped to map bounds before rendering",
  62234. "doc": "geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."
  62235. },
  62236. "smooth": {
  62237. "css": "polygon-smooth",
  62238. "type": "float",
  62239. "default-value": 0,
  62240. "default-meaning": "no smoothing",
  62241. "range": "0-1",
  62242. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  62243. },
  62244. "geometry-transform": {
  62245. "css": "polygon-geometry-transform",
  62246. "type": "functions",
  62247. "default-value": "none",
  62248. "default-meaning": "geometry will not be transformed",
  62249. "doc": "Allows transformation functions to be applied to the geometry.",
  62250. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  62251. },
  62252. "comp-op": {
  62253. "css": "polygon-comp-op",
  62254. "default-value": "src-over",
  62255. "default-meaning": "add the current symbolizer on top of other symbolizer",
  62256. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  62257. "type": ["clear", "src", "dst", "src-over", "dst-over", "src-in", "dst-in", "src-out", "dst-out", "src-atop", "dst-atop", "xor", "plus", "minus", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "contrast", "invert", "invert-rgb", "grain-merge", "grain-extract", "hue", "saturation", "color", "value"]
  62258. }
  62259. },
  62260. "line": {
  62261. "stroke": {
  62262. "css": "line-color",
  62263. "default-value": "rgba(0,0,0,1)",
  62264. "type": "color",
  62265. "default-meaning": "black and fully opaque (alpha = 1), same as rgb(0,0,0)",
  62266. "doc": "The color of a drawn line"
  62267. },
  62268. "stroke-width": {
  62269. "css": "line-width",
  62270. "default-value": 1,
  62271. "type": "float",
  62272. "doc": "The width of a line in pixels"
  62273. },
  62274. "stroke-opacity": {
  62275. "css": "line-opacity",
  62276. "default-value": 1,
  62277. "type": "float",
  62278. "default-meaning": "opaque",
  62279. "doc": "The opacity of a line"
  62280. },
  62281. "stroke-linejoin": {
  62282. "css": "line-join",
  62283. "default-value": "miter",
  62284. "type": ["miter", "round", "bevel"],
  62285. "doc": "The behavior of lines when joining"
  62286. },
  62287. "stroke-linecap": {
  62288. "css": "line-cap",
  62289. "default-value": "butt",
  62290. "type": ["butt", "round", "square"],
  62291. "doc": "The display of line endings"
  62292. },
  62293. "stroke-gamma": {
  62294. "css": "line-gamma",
  62295. "type": "float",
  62296. "default-value": 1,
  62297. "default-meaning": "fully antialiased",
  62298. "range": "0-1",
  62299. "doc": "Level of antialiasing of stroke line"
  62300. },
  62301. "stroke-gamma-method": {
  62302. "css": "line-gamma-method",
  62303. "type": ["power", "linear", "none", "threshold", "multiply"],
  62304. "default-value": "power",
  62305. "default-meaning": "pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",
  62306. "doc": "An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"
  62307. },
  62308. "stroke-dasharray": {
  62309. "css": "line-dasharray",
  62310. "type": "numbers",
  62311. "doc": "A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns.",
  62312. "default-value": "none",
  62313. "default-meaning": "solid line"
  62314. },
  62315. "stroke-dashoffset": {
  62316. "css": "line-dash-offset",
  62317. "type": "numbers",
  62318. "doc": "valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled)",
  62319. "default-value": "none",
  62320. "default-meaning": "solid line"
  62321. },
  62322. "stroke-miterlimit": {
  62323. "css": "line-miterlimit",
  62324. "type": "float",
  62325. "doc": "The limit on the ratio of the miter length to the stroke-width. Used to automatically convert miter joins to bevel joins for sharp angles to avoid the miter extending beyond the thickness of the stroking path. Normally will not need to be set, but a larger value can sometimes help avoid jaggy artifacts.",
  62326. "default-value": 4.0,
  62327. "default-meaning": "Will auto-convert miters to bevel line joins when theta is less than 29 degrees as per the SVG spec: 'miterLength / stroke-width = 1 / sin ( theta / 2 )'"
  62328. },
  62329. "clip": {
  62330. "css": "line-clip",
  62331. "type": "boolean",
  62332. "default-value": true,
  62333. "default-meaning": "geometry will be clipped to map bounds before rendering",
  62334. "doc": "geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."
  62335. },
  62336. "smooth": {
  62337. "css": "line-smooth",
  62338. "type": "float",
  62339. "default-value": 0,
  62340. "default-meaning": "no smoothing",
  62341. "range": "0-1",
  62342. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  62343. },
  62344. "offset": {
  62345. "css": "line-offset",
  62346. "type": "float",
  62347. "default-value": 0,
  62348. "default-meaning": "no offset",
  62349. "doc": "Offsets a line a number of pixels parallel to its actual path. Postive values move the line left, negative values move it right (relative to the directionality of the line)."
  62350. },
  62351. "rasterizer": {
  62352. "css": "line-rasterizer",
  62353. "type": ["full", "fast"],
  62354. "default-value": "full",
  62355. "doc": "Exposes an alternate AGG rendering method that sacrifices some accuracy for speed."
  62356. },
  62357. "geometry-transform": {
  62358. "css": "line-geometry-transform",
  62359. "type": "functions",
  62360. "default-value": "none",
  62361. "default-meaning": "geometry will not be transformed",
  62362. "doc": "Allows transformation functions to be applied to the geometry.",
  62363. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  62364. },
  62365. "comp-op": {
  62366. "css": "line-comp-op",
  62367. "default-value": "src-over",
  62368. "default-meaning": "add the current symbolizer on top of other symbolizer",
  62369. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  62370. "type": ["clear", "src", "dst", "src-over", "dst-over", "src-in", "dst-in", "src-out", "dst-out", "src-atop", "dst-atop", "xor", "plus", "minus", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "contrast", "invert", "invert-rgb", "grain-merge", "grain-extract", "hue", "saturation", "color", "value"]
  62371. }
  62372. },
  62373. "markers": {
  62374. "file": {
  62375. "css": "marker-file",
  62376. "doc": "An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse.",
  62377. "default-value": "",
  62378. "default-meaning": "An ellipse or circle, if width equals height",
  62379. "type": "uri"
  62380. },
  62381. "opacity": {
  62382. "css": "marker-opacity",
  62383. "doc": "The overall opacity of the marker, if set, overrides both the opacity of both the fill and stroke",
  62384. "default-value": 1,
  62385. "default-meaning": "The stroke-opacity and fill-opacity will be used",
  62386. "type": "float"
  62387. },
  62388. "fill-opacity": {
  62389. "css": "marker-fill-opacity",
  62390. "doc": "The fill opacity of the marker",
  62391. "default-value": 1,
  62392. "default-meaning": "opaque",
  62393. "type": "float"
  62394. },
  62395. "stroke": {
  62396. "css": "marker-line-color",
  62397. "doc": "The color of the stroke around a marker shape.",
  62398. "default-value": "black",
  62399. "type": "color"
  62400. },
  62401. "stroke-width": {
  62402. "css": "marker-line-width",
  62403. "doc": "The width of the stroke around a marker shape, in pixels. This is positioned on the boundary, so high values can cover the area itself.",
  62404. "type": "float"
  62405. },
  62406. "stroke-opacity": {
  62407. "css": "marker-line-opacity",
  62408. "default-value": 1,
  62409. "default-meaning": "opaque",
  62410. "doc": "The opacity of a line",
  62411. "type": "float"
  62412. },
  62413. "placement": {
  62414. "css": "marker-placement",
  62415. "type": ["point", "line", "interior"],
  62416. "default-value": "point",
  62417. "default-meaning": "Place markers at the center point (centroid) of the geometry",
  62418. "doc": "Attempt to place markers on a point, in the center of a polygon, or if markers-placement:line, then multiple times along a line. 'interior' placement can be used to ensure that points placed on polygons are forced to be inside the polygon interior"
  62419. },
  62420. "multi-policy": {
  62421. "css": "marker-multi-policy",
  62422. "type": ["each", "whole", "largest"],
  62423. "default-value": "each",
  62424. "default-meaning": "If a feature contains multiple geometries and the placement type is either point or interior then a marker will be rendered for each",
  62425. "doc": "A special setting to allow the user to control rendering behavior for 'multi-geometries' (when a feature contains multiple geometries). This setting does not apply to markers placed along lines. The 'each' policy is default and means all geometries will get a marker. The 'whole' policy means that the aggregate centroid between all geometries will be used. The 'largest' policy means that only the largest (by bounding box areas) feature will get a rendered marker (this is how text labeling behaves by default)."
  62426. },
  62427. "marker-type": {
  62428. "css": "marker-type",
  62429. "type": ["arrow", "ellipse"],
  62430. "default-value": "ellipse",
  62431. "doc": "The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width)"
  62432. },
  62433. "width": {
  62434. "css": "marker-width",
  62435. "default-value": 10,
  62436. "doc": "The width of the marker, if using one of the default types.",
  62437. "type": "expression"
  62438. },
  62439. "height": {
  62440. "css": "marker-height",
  62441. "default-value": 10,
  62442. "doc": "The height of the marker, if using one of the default types.",
  62443. "type": "expression"
  62444. },
  62445. "fill": {
  62446. "css": "marker-fill",
  62447. "default-value": "blue",
  62448. "doc": "The color of the area of the marker.",
  62449. "type": "color"
  62450. },
  62451. "allow-overlap": {
  62452. "css": "marker-allow-overlap",
  62453. "type": "boolean",
  62454. "default-value": false,
  62455. "doc": "Control whether overlapping markers are shown or hidden.",
  62456. "default-meaning": "Do not allow makers to overlap with each other - overlapping markers will not be shown."
  62457. },
  62458. "ignore-placement": {
  62459. "css": "marker-ignore-placement",
  62460. "type": "boolean",
  62461. "default-value": false,
  62462. "default-meaning": "do not store the bbox of this geometry in the collision detector cache",
  62463. "doc": "value to control whether the placement of the feature will prevent the placement of other features"
  62464. },
  62465. "spacing": {
  62466. "css": "marker-spacing",
  62467. "doc": "Space between repeated labels",
  62468. "default-value": 100,
  62469. "type": "float"
  62470. },
  62471. "max-error": {
  62472. "css": "marker-max-error",
  62473. "type": "float",
  62474. "default-value": 0.2,
  62475. "doc": "The maximum difference between actual marker placement and the marker-spacing parameter. Setting a high value can allow the renderer to try to resolve placement conflicts with other symbolizers."
  62476. },
  62477. "transform": {
  62478. "css": "marker-transform",
  62479. "type": "functions",
  62480. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]],
  62481. "default-value": "",
  62482. "default-meaning": "No transformation",
  62483. "doc": "SVG transformation definition"
  62484. },
  62485. "clip": {
  62486. "css": "marker-clip",
  62487. "type": "boolean",
  62488. "default-value": true,
  62489. "default-meaning": "geometry will be clipped to map bounds before rendering",
  62490. "doc": "geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."
  62491. },
  62492. "smooth": {
  62493. "css": "marker-smooth",
  62494. "type": "float",
  62495. "default-value": 0,
  62496. "default-meaning": "no smoothing",
  62497. "range": "0-1",
  62498. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  62499. },
  62500. "geometry-transform": {
  62501. "css": "marker-geometry-transform",
  62502. "type": "functions",
  62503. "default-value": "none",
  62504. "default-meaning": "geometry will not be transformed",
  62505. "doc": "Allows transformation functions to be applied to the geometry.",
  62506. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  62507. },
  62508. "comp-op": {
  62509. "css": "marker-comp-op",
  62510. "default-value": "src-over",
  62511. "default-meaning": "add the current symbolizer on top of other symbolizer",
  62512. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  62513. "type": ["clear", "src", "dst", "src-over", "dst-over", "src-in", "dst-in", "src-out", "dst-out", "src-atop", "dst-atop", "xor", "plus", "minus", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "contrast", "invert", "invert-rgb", "grain-merge", "grain-extract", "hue", "saturation", "color", "value"]
  62514. }
  62515. },
  62516. "shield": {
  62517. "name": {
  62518. "css": "shield-name",
  62519. "type": "expression",
  62520. "serialization": "content",
  62521. "doc": "Value to use for a shield\"s text label. Data columns are specified using brackets like [column_name]"
  62522. },
  62523. "file": {
  62524. "css": "shield-file",
  62525. "required": true,
  62526. "type": "uri",
  62527. "default-value": "none",
  62528. "doc": "Image file to render behind the shield text"
  62529. },
  62530. "face-name": {
  62531. "css": "shield-face-name",
  62532. "type": "string",
  62533. "validate": "font",
  62534. "doc": "Font name and style to use for the shield text",
  62535. "default-value": "",
  62536. "required": true
  62537. },
  62538. "unlock-image": {
  62539. "css": "shield-unlock-image",
  62540. "type": "boolean",
  62541. "doc": "This parameter should be set to true if you are trying to position text beside rather than on top of the shield image",
  62542. "default-value": false,
  62543. "default-meaning": "text alignment relative to the shield image uses the center of the image as the anchor for text positioning."
  62544. },
  62545. "size": {
  62546. "css": "shield-size",
  62547. "type": "float",
  62548. "doc": "The size of the shield text in pixels"
  62549. },
  62550. "fill": {
  62551. "css": "shield-fill",
  62552. "type": "color",
  62553. "doc": "The color of the shield text"
  62554. },
  62555. "placement": {
  62556. "css": "shield-placement",
  62557. "type": ["point", "line", "vertex", "interior"],
  62558. "default-value": "point",
  62559. "doc": "How this shield should be placed. Point placement attempts to place it on top of points, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of polygons."
  62560. },
  62561. "avoid-edges": {
  62562. "css": "shield-avoid-edges",
  62563. "doc": "Tell positioning algorithm to avoid labeling near intersection edges.",
  62564. "type": "boolean",
  62565. "default-value": false
  62566. },
  62567. "allow-overlap": {
  62568. "css": "shield-allow-overlap",
  62569. "type": "boolean",
  62570. "default-value": false,
  62571. "doc": "Control whether overlapping shields are shown or hidden.",
  62572. "default-meaning": "Do not allow shields to overlap with other map elements already placed."
  62573. },
  62574. "minimum-distance": {
  62575. "css": "shield-min-distance",
  62576. "type": "float",
  62577. "default-value": 0,
  62578. "doc": "Minimum distance to the next shield symbol, not necessarily the same shield."
  62579. },
  62580. "spacing": {
  62581. "css": "shield-spacing",
  62582. "type": "float",
  62583. "default-value": 0,
  62584. "doc": "The spacing between repeated occurrences of the same shield on a line"
  62585. },
  62586. "minimum-padding": {
  62587. "css": "shield-min-padding",
  62588. "default-value": 0,
  62589. "doc": "Determines the minimum amount of padding that a shield gets relative to other shields",
  62590. "type": "float"
  62591. },
  62592. "wrap-width": {
  62593. "css": "shield-wrap-width",
  62594. "type": "unsigned",
  62595. "default-value": 0,
  62596. "doc": "Length of a chunk of text in characters before wrapping text"
  62597. },
  62598. "wrap-before": {
  62599. "css": "shield-wrap-before",
  62600. "type": "boolean",
  62601. "default-value": false,
  62602. "doc": "Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."
  62603. },
  62604. "wrap-character": {
  62605. "css": "shield-wrap-character",
  62606. "type": "string",
  62607. "default-value": " ",
  62608. "doc": "Use this character instead of a space to wrap long names."
  62609. },
  62610. "halo-fill": {
  62611. "css": "shield-halo-fill",
  62612. "type": "color",
  62613. "default-value": "#FFFFFF",
  62614. "default-meaning": "white",
  62615. "doc": "Specifies the color of the halo around the text."
  62616. },
  62617. "halo-radius": {
  62618. "css": "shield-halo-radius",
  62619. "doc": "Specify the radius of the halo in pixels",
  62620. "default-value": 0,
  62621. "default-meaning": "no halo",
  62622. "type": "float"
  62623. },
  62624. "character-spacing": {
  62625. "css": "shield-character-spacing",
  62626. "type": "unsigned",
  62627. "default-value": 0,
  62628. "doc": "Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement."
  62629. },
  62630. "line-spacing": {
  62631. "css": "shield-line-spacing",
  62632. "doc": "Vertical spacing between lines of multiline labels (in pixels)",
  62633. "type": "unsigned"
  62634. },
  62635. "dx": {
  62636. "css": "shield-text-dx",
  62637. "type": "float",
  62638. "doc": "Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right",
  62639. "default-value": 0
  62640. },
  62641. "dy": {
  62642. "css": "shield-text-dy",
  62643. "type": "float",
  62644. "doc": "Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down",
  62645. "default-value": 0
  62646. },
  62647. "shield-dx": {
  62648. "css": "shield-dx",
  62649. "type": "float",
  62650. "doc": "Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right",
  62651. "default-value": 0
  62652. },
  62653. "shield-dy": {
  62654. "css": "shield-dy",
  62655. "type": "float",
  62656. "doc": "Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down",
  62657. "default-value": 0
  62658. },
  62659. "opacity": {
  62660. "css": "shield-opacity",
  62661. "type": "float",
  62662. "doc": "(Default 1.0) - opacity of the image used for the shield",
  62663. "default-value": 1
  62664. },
  62665. "text-opacity": {
  62666. "css": "shield-text-opacity",
  62667. "type": "float",
  62668. "doc": "(Default 1.0) - opacity of the text placed on top of the shield",
  62669. "default-value": 1
  62670. },
  62671. "horizontal-alignment": {
  62672. "css": "shield-horizontal-alignment",
  62673. "type": ["left", "middle", "right", "auto"],
  62674. "doc": "The shield's horizontal alignment from its centerpoint",
  62675. "default-value": "auto"
  62676. },
  62677. "vertical-alignment": {
  62678. "css": "shield-vertical-alignment",
  62679. "type": ["top", "middle", "bottom", "auto"],
  62680. "doc": "The shield's vertical alignment from its centerpoint",
  62681. "default-value": "middle"
  62682. },
  62683. "text-transform": {
  62684. "css": "shield-text-transform",
  62685. "type": ["none", "uppercase", "lowercase", "capitalize"],
  62686. "doc": "Transform the case of the characters",
  62687. "default-value": "none"
  62688. },
  62689. "justify-alignment": {
  62690. "css": "shield-justify-alignment",
  62691. "type": ["left", "center", "right", "auto"],
  62692. "doc": "Define how text in a shield's label is justified",
  62693. "default-value": "auto"
  62694. },
  62695. "clip": {
  62696. "css": "shield-clip",
  62697. "type": "boolean",
  62698. "default-value": true,
  62699. "default-meaning": "geometry will be clipped to map bounds before rendering",
  62700. "doc": "geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."
  62701. },
  62702. "comp-op": {
  62703. "css": "shield-comp-op",
  62704. "default-value": "src-over",
  62705. "default-meaning": "add the current symbolizer on top of other symbolizer",
  62706. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  62707. "type": ["clear", "src", "dst", "src-over", "dst-over", "src-in", "dst-in", "src-out", "dst-out", "src-atop", "dst-atop", "xor", "plus", "minus", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "contrast", "invert", "invert-rgb", "grain-merge", "grain-extract", "hue", "saturation", "color", "value"]
  62708. }
  62709. },
  62710. "line-pattern": {
  62711. "file": {
  62712. "css": "line-pattern-file",
  62713. "type": "uri",
  62714. "default-value": "none",
  62715. "required": true,
  62716. "doc": "An image file to be repeated and warped along a line"
  62717. },
  62718. "clip": {
  62719. "css": "line-pattern-clip",
  62720. "type": "boolean",
  62721. "default-value": true,
  62722. "default-meaning": "geometry will be clipped to map bounds before rendering",
  62723. "doc": "geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."
  62724. },
  62725. "smooth": {
  62726. "css": "line-pattern-smooth",
  62727. "type": "float",
  62728. "default-value": 0,
  62729. "default-meaning": "no smoothing",
  62730. "range": "0-1",
  62731. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  62732. },
  62733. "geometry-transform": {
  62734. "css": "line-pattern-geometry-transform",
  62735. "type": "functions",
  62736. "default-value": "none",
  62737. "default-meaning": "geometry will not be transformed",
  62738. "doc": "Allows transformation functions to be applied to the geometry.",
  62739. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  62740. },
  62741. "comp-op": {
  62742. "css": "line-pattern-comp-op",
  62743. "default-value": "src-over",
  62744. "default-meaning": "add the current symbolizer on top of other symbolizer",
  62745. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  62746. "type": ["clear", "src", "dst", "src-over", "dst-over", "src-in", "dst-in", "src-out", "dst-out", "src-atop", "dst-atop", "xor", "plus", "minus", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "contrast", "invert", "invert-rgb", "grain-merge", "grain-extract", "hue", "saturation", "color", "value"]
  62747. }
  62748. },
  62749. "polygon-pattern": {
  62750. "file": {
  62751. "css": "polygon-pattern-file",
  62752. "type": "uri",
  62753. "default-value": "none",
  62754. "required": true,
  62755. "doc": "Image to use as a repeated pattern fill within a polygon"
  62756. },
  62757. "alignment": {
  62758. "css": "polygon-pattern-alignment",
  62759. "type": ["local", "global"],
  62760. "default-value": "local",
  62761. "doc": "Specify whether to align pattern fills to the layer or to the map."
  62762. },
  62763. "gamma": {
  62764. "css": "polygon-pattern-gamma",
  62765. "type": "float",
  62766. "default-value": 1,
  62767. "default-meaning": "fully antialiased",
  62768. "range": "0-1",
  62769. "doc": "Level of antialiasing of polygon pattern edges"
  62770. },
  62771. "opacity": {
  62772. "css": "polygon-pattern-opacity",
  62773. "type": "float",
  62774. "doc": "(Default 1.0) - Apply an opacity level to the image used for the pattern",
  62775. "default-value": 1,
  62776. "default-meaning": "The image is rendered without modifications"
  62777. },
  62778. "clip": {
  62779. "css": "polygon-pattern-clip",
  62780. "type": "boolean",
  62781. "default-value": true,
  62782. "default-meaning": "geometry will be clipped to map bounds before rendering",
  62783. "doc": "geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."
  62784. },
  62785. "smooth": {
  62786. "css": "polygon-pattern-smooth",
  62787. "type": "float",
  62788. "default-value": 0,
  62789. "default-meaning": "no smoothing",
  62790. "range": "0-1",
  62791. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  62792. },
  62793. "geometry-transform": {
  62794. "css": "polygon-pattern-geometry-transform",
  62795. "type": "functions",
  62796. "default-value": "none",
  62797. "default-meaning": "geometry will not be transformed",
  62798. "doc": "Allows transformation functions to be applied to the geometry.",
  62799. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  62800. },
  62801. "comp-op": {
  62802. "css": "polygon-pattern-comp-op",
  62803. "default-value": "src-over",
  62804. "default-meaning": "add the current symbolizer on top of other symbolizer",
  62805. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  62806. "type": ["clear", "src", "dst", "src-over", "dst-over", "src-in", "dst-in", "src-out", "dst-out", "src-atop", "dst-atop", "xor", "plus", "minus", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "contrast", "invert", "invert-rgb", "grain-merge", "grain-extract", "hue", "saturation", "color", "value"]
  62807. }
  62808. },
  62809. "raster": {
  62810. "opacity": {
  62811. "css": "raster-opacity",
  62812. "default-value": 1,
  62813. "default-meaning": "opaque",
  62814. "type": "float",
  62815. "doc": "The opacity of the raster symbolizer on top of other symbolizers."
  62816. },
  62817. "filter-factor": {
  62818. "css": "raster-filter-factor",
  62819. "default-value": -1,
  62820. "default-meaning": "Allow the datasource to choose appropriate downscaling.",
  62821. "type": "float",
  62822. "doc": "This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed."
  62823. },
  62824. "scaling": {
  62825. "css": "raster-scaling",
  62826. "type": ["near", "fast", "bilinear", "bilinear8", "bicubic", "spline16", "spline36", "hanning", "hamming", "hermite", "kaiser", "quadric", "catrom", "gaussian", "bessel", "mitchell", "sinc", "lanczos", "blackman"],
  62827. "default-value": "near",
  62828. "doc": "The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality."
  62829. },
  62830. "mesh-size": {
  62831. "css": "raster-mesh-size",
  62832. "default-value": 16,
  62833. "default-meaning": "Reprojection mesh will be 1/16 of the resolution of the source image",
  62834. "type": "unsigned",
  62835. "doc": "A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion."
  62836. },
  62837. "comp-op": {
  62838. "css": "raster-comp-op",
  62839. "default-value": "src-over",
  62840. "default-meaning": "add the current symbolizer on top of other symbolizer",
  62841. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  62842. "type": ["clear", "src", "dst", "src-over", "dst-over", "src-in", "dst-in", "src-out", "dst-out", "src-atop", "dst-atop", "xor", "plus", "minus", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "contrast", "invert", "invert-rgb", "grain-merge", "grain-extract", "hue", "saturation", "color", "value"]
  62843. }
  62844. },
  62845. "point": {
  62846. "file": {
  62847. "css": "point-file",
  62848. "type": "uri",
  62849. "required": false,
  62850. "default-value": "none",
  62851. "doc": "Image file to represent a point"
  62852. },
  62853. "allow-overlap": {
  62854. "css": "point-allow-overlap",
  62855. "type": "boolean",
  62856. "default-value": false,
  62857. "doc": "Control whether overlapping points are shown or hidden.",
  62858. "default-meaning": "Do not allow points to overlap with each other - overlapping markers will not be shown."
  62859. },
  62860. "ignore-placement": {
  62861. "css": "point-ignore-placement",
  62862. "type": "boolean",
  62863. "default-value": false,
  62864. "default-meaning": "do not store the bbox of this geometry in the collision detector cache",
  62865. "doc": "value to control whether the placement of the feature will prevent the placement of other features"
  62866. },
  62867. "opacity": {
  62868. "css": "point-opacity",
  62869. "type": "float",
  62870. "default-value": 1.0,
  62871. "default-meaning": "Fully opaque",
  62872. "doc": "A value from 0 to 1 to control the opacity of the point"
  62873. },
  62874. "placement": {
  62875. "css": "point-placement",
  62876. "type": ["centroid", "interior"],
  62877. "doc": "How this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon.",
  62878. "default-value": "centroid"
  62879. },
  62880. "transform": {
  62881. "css": "point-transform",
  62882. "type": "functions",
  62883. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]],
  62884. "default-value": "",
  62885. "default-meaning": "No transformation",
  62886. "doc": "SVG transformation definition"
  62887. },
  62888. "comp-op": {
  62889. "css": "point-comp-op",
  62890. "default-value": "src-over",
  62891. "default-meaning": "add the current symbolizer on top of other symbolizer",
  62892. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  62893. "type": ["clear", "src", "dst", "src-over", "dst-over", "src-in", "dst-in", "src-out", "dst-out", "src-atop", "dst-atop", "xor", "plus", "minus", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "contrast", "invert", "invert-rgb", "grain-merge", "grain-extract", "hue", "saturation", "color", "value"]
  62894. }
  62895. },
  62896. "text": {
  62897. "name": {
  62898. "css": "text-name",
  62899. "type": "expression",
  62900. "required": true,
  62901. "default-value": "",
  62902. "serialization": "content",
  62903. "doc": "Value to use for a text label. Data columns are specified using brackets like [column_name]"
  62904. },
  62905. "face-name": {
  62906. "css": "text-face-name",
  62907. "type": "string",
  62908. "validate": "font",
  62909. "doc": "Font name and style to render a label in",
  62910. "required": true
  62911. },
  62912. "size": {
  62913. "css": "text-size",
  62914. "type": "float",
  62915. "default-value": 10,
  62916. "doc": "Text size in pixels"
  62917. },
  62918. "text-ratio": {
  62919. "css": "text-ratio",
  62920. "doc": "Define the amount of text (of the total) present on successive lines when wrapping occurs",
  62921. "default-value": 0,
  62922. "type": "unsigned"
  62923. },
  62924. "wrap-width": {
  62925. "css": "text-wrap-width",
  62926. "doc": "Length of a chunk of text in characters before wrapping text",
  62927. "default-value": 0,
  62928. "type": "unsigned"
  62929. },
  62930. "wrap-before": {
  62931. "css": "text-wrap-before",
  62932. "type": "boolean",
  62933. "default-value": false,
  62934. "doc": "Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."
  62935. },
  62936. "wrap-character": {
  62937. "css": "text-wrap-character",
  62938. "type": "string",
  62939. "default-value": " ",
  62940. "doc": "Use this character instead of a space to wrap long text."
  62941. },
  62942. "spacing": {
  62943. "css": "text-spacing",
  62944. "type": "unsigned",
  62945. "doc": "Distance between repeated text labels on a line (aka. label-spacing)"
  62946. },
  62947. "character-spacing": {
  62948. "css": "text-character-spacing",
  62949. "type": "float",
  62950. "default-value": 0,
  62951. "doc": "Horizontal spacing adjustment between characters in pixels"
  62952. },
  62953. "line-spacing": {
  62954. "css": "text-line-spacing",
  62955. "default-value": 0,
  62956. "type": "unsigned",
  62957. "doc": "Vertical spacing adjustment between lines in pixels"
  62958. },
  62959. "label-position-tolerance": {
  62960. "css": "text-label-position-tolerance",
  62961. "default-value": 0,
  62962. "type": "unsigned",
  62963. "doc": "Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line)"
  62964. },
  62965. "max-char-angle-delta": {
  62966. "css": "text-max-char-angle-delta",
  62967. "type": "float",
  62968. "default-value": "22.5",
  62969. "doc": "The maximum angle change, in degrees, allowed between adjacent characters in a label. This value internally is converted to radians to the default is 22.5*math.pi/180.0. The higher the value the fewer labels will be placed around around sharp corners."
  62970. },
  62971. "fill": {
  62972. "css": "text-fill",
  62973. "doc": "Specifies the color for the text",
  62974. "default-value": "#000000",
  62975. "type": "color"
  62976. },
  62977. "opacity": {
  62978. "css": "text-opacity",
  62979. "doc": "A number from 0 to 1 specifying the opacity for the text",
  62980. "default-value": 1.0,
  62981. "default-meaning": "Fully opaque",
  62982. "type": "float"
  62983. },
  62984. "halo-fill": {
  62985. "css": "text-halo-fill",
  62986. "type": "color",
  62987. "default-value": "#FFFFFF",
  62988. "default-meaning": "white",
  62989. "doc": "Specifies the color of the halo around the text."
  62990. },
  62991. "halo-radius": {
  62992. "css": "text-halo-radius",
  62993. "doc": "Specify the radius of the halo in pixels",
  62994. "default-value": 0,
  62995. "default-meaning": "no halo",
  62996. "type": "float"
  62997. },
  62998. "dx": {
  62999. "css": "text-dx",
  63000. "type": "float",
  63001. "doc": "Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right",
  63002. "default-value": 0
  63003. },
  63004. "dy": {
  63005. "css": "text-dy",
  63006. "type": "float",
  63007. "doc": "Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down",
  63008. "default-value": 0
  63009. },
  63010. "vertical-alignment": {
  63011. "css": "text-vertical-alignment",
  63012. "type": ["top", "middle", "bottom", "auto"],
  63013. "doc": "Position of label relative to point position.",
  63014. "default-value": "auto",
  63015. "default-meaning": "Default affected by value of dy; \"bottom\" for dy>0, \"top\" for dy<0."
  63016. },
  63017. "avoid-edges": {
  63018. "css": "text-avoid-edges",
  63019. "doc": "Tell positioning algorithm to avoid labeling near intersection edges.",
  63020. "default-value": false,
  63021. "type": "boolean"
  63022. },
  63023. "minimum-distance": {
  63024. "css": "text-min-distance",
  63025. "doc": "Minimum permitted distance to the next text symbolizer.",
  63026. "type": "float"
  63027. },
  63028. "minimum-padding": {
  63029. "css": "text-min-padding",
  63030. "doc": "Determines the minimum amount of padding that a text symbolizer gets relative to other text",
  63031. "type": "float"
  63032. },
  63033. "minimum-path-length": {
  63034. "css": "text-min-path-length",
  63035. "type": "float",
  63036. "default-value": 0,
  63037. "default-meaning": "place labels on all paths",
  63038. "doc": "Place labels only on paths longer than this value."
  63039. },
  63040. "allow-overlap": {
  63041. "css": "text-allow-overlap",
  63042. "type": "boolean",
  63043. "default-value": false,
  63044. "doc": "Control whether overlapping text is shown or hidden.",
  63045. "default-meaning": "Do not allow text to overlap with other text - overlapping markers will not be shown."
  63046. },
  63047. "orientation": {
  63048. "css": "text-orientation",
  63049. "type": "expression",
  63050. "doc": "Rotate the text."
  63051. },
  63052. "placement": {
  63053. "css": "text-placement",
  63054. "type": ["point", "line", "vertex", "interior"],
  63055. "default-value": "point",
  63056. "doc": "Control the style of placement of a point versus the geometry it is attached to."
  63057. },
  63058. "placement-type": {
  63059. "css": "text-placement-type",
  63060. "doc": "Re-position and/or re-size text to avoid overlaps. \"simple\" for basic algorithm (using text-placements string,) \"dummy\" to turn this feature off.",
  63061. "type": ["dummy", "simple"],
  63062. "default-value": "dummy"
  63063. },
  63064. "placements": {
  63065. "css": "text-placements",
  63066. "type": "string",
  63067. "default-value": "",
  63068. "doc": "If \"placement-type\" is set to \"simple\", use this \"POSITIONS,[SIZES]\" string. An example is `text-placements: \"E,NE,SE,W,NW,SW\";` "
  63069. },
  63070. "text-transform": {
  63071. "css": "text-transform",
  63072. "type": ["none", "uppercase", "lowercase", "capitalize"],
  63073. "doc": "Transform the case of the characters",
  63074. "default-value": "none"
  63075. },
  63076. "horizontal-alignment": {
  63077. "css": "text-horizontal-alignment",
  63078. "type": ["left", "middle", "right", "auto"],
  63079. "doc": "The text's horizontal alignment from its centerpoint",
  63080. "default-value": "auto"
  63081. },
  63082. "justify-alignment": {
  63083. "css": "text-align",
  63084. "type": ["left", "right", "center", "auto"],
  63085. "doc": "Define how text is justified",
  63086. "default-value": "auto",
  63087. "default-meaning": "Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives"
  63088. },
  63089. "clip": {
  63090. "css": "text-clip",
  63091. "type": "boolean",
  63092. "default-value": true,
  63093. "default-meaning": "geometry will be clipped to map bounds before rendering",
  63094. "doc": "geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."
  63095. },
  63096. "comp-op": {
  63097. "css": "text-comp-op",
  63098. "default-value": "src-over",
  63099. "default-meaning": "add the current symbolizer on top of other symbolizer",
  63100. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  63101. "type": ["clear", "src", "dst", "src-over", "dst-over", "src-in", "dst-in", "src-out", "dst-out", "src-atop", "dst-atop", "xor", "plus", "minus", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "contrast", "invert", "invert-rgb", "grain-merge", "grain-extract", "hue", "saturation", "color", "value"]
  63102. }
  63103. },
  63104. "building": {
  63105. "fill": {
  63106. "css": "building-fill",
  63107. "default-value": "#FFFFFF",
  63108. "doc": "The color of the buildings walls.",
  63109. "type": "color"
  63110. },
  63111. "fill-opacity": {
  63112. "css": "building-fill-opacity",
  63113. "type": "float",
  63114. "doc": "The opacity of the building as a whole, including all walls.",
  63115. "default-value": 1
  63116. },
  63117. "height": {
  63118. "css": "building-height",
  63119. "doc": "The height of the building in pixels.",
  63120. "type": "expression",
  63121. "default-value": "0"
  63122. }
  63123. }
  63124. },
  63125. "colors": {
  63126. "aliceblue": [240, 248, 255],
  63127. "antiquewhite": [250, 235, 215],
  63128. "aqua": [0, 255, 255],
  63129. "aquamarine": [127, 255, 212],
  63130. "azure": [240, 255, 255],
  63131. "beige": [245, 245, 220],
  63132. "bisque": [255, 228, 196],
  63133. "black": [0, 0, 0],
  63134. "blanchedalmond": [255, 235, 205],
  63135. "blue": [0, 0, 255],
  63136. "blueviolet": [138, 43, 226],
  63137. "brown": [165, 42, 42],
  63138. "burlywood": [222, 184, 135],
  63139. "cadetblue": [95, 158, 160],
  63140. "chartreuse": [127, 255, 0],
  63141. "chocolate": [210, 105, 30],
  63142. "coral": [255, 127, 80],
  63143. "cornflowerblue": [100, 149, 237],
  63144. "cornsilk": [255, 248, 220],
  63145. "crimson": [220, 20, 60],
  63146. "cyan": [0, 255, 255],
  63147. "darkblue": [0, 0, 139],
  63148. "darkcyan": [0, 139, 139],
  63149. "darkgoldenrod": [184, 134, 11],
  63150. "darkgray": [169, 169, 169],
  63151. "darkgreen": [0, 100, 0],
  63152. "darkgrey": [169, 169, 169],
  63153. "darkkhaki": [189, 183, 107],
  63154. "darkmagenta": [139, 0, 139],
  63155. "darkolivegreen": [85, 107, 47],
  63156. "darkorange": [255, 140, 0],
  63157. "darkorchid": [153, 50, 204],
  63158. "darkred": [139, 0, 0],
  63159. "darksalmon": [233, 150, 122],
  63160. "darkseagreen": [143, 188, 143],
  63161. "darkslateblue": [72, 61, 139],
  63162. "darkslategrey": [47, 79, 79],
  63163. "darkturquoise": [0, 206, 209],
  63164. "darkviolet": [148, 0, 211],
  63165. "deeppink": [255, 20, 147],
  63166. "deepskyblue": [0, 191, 255],
  63167. "dimgray": [105, 105, 105],
  63168. "dimgrey": [105, 105, 105],
  63169. "dodgerblue": [30, 144, 255],
  63170. "firebrick": [178, 34, 34],
  63171. "floralwhite": [255, 250, 240],
  63172. "forestgreen": [34, 139, 34],
  63173. "fuchsia": [255, 0, 255],
  63174. "gainsboro": [220, 220, 220],
  63175. "ghostwhite": [248, 248, 255],
  63176. "gold": [255, 215, 0],
  63177. "goldenrod": [218, 165, 32],
  63178. "gray": [128, 128, 128],
  63179. "grey": [128, 128, 128],
  63180. "green": [0, 128, 0],
  63181. "greenyellow": [173, 255, 47],
  63182. "honeydew": [240, 255, 240],
  63183. "hotpink": [255, 105, 180],
  63184. "indianred": [205, 92, 92],
  63185. "indigo": [75, 0, 130],
  63186. "ivory": [255, 255, 240],
  63187. "khaki": [240, 230, 140],
  63188. "lavender": [230, 230, 250],
  63189. "lavenderblush": [255, 240, 245],
  63190. "lawngreen": [124, 252, 0],
  63191. "lemonchiffon": [255, 250, 205],
  63192. "lightblue": [173, 216, 230],
  63193. "lightcoral": [240, 128, 128],
  63194. "lightcyan": [224, 255, 255],
  63195. "lightgoldenrodyellow": [250, 250, 210],
  63196. "lightgray": [211, 211, 211],
  63197. "lightgreen": [144, 238, 144],
  63198. "lightgrey": [211, 211, 211],
  63199. "lightpink": [255, 182, 193],
  63200. "lightsalmon": [255, 160, 122],
  63201. "lightseagreen": [32, 178, 170],
  63202. "lightskyblue": [135, 206, 250],
  63203. "lightslategray": [119, 136, 153],
  63204. "lightslategrey": [119, 136, 153],
  63205. "lightsteelblue": [176, 196, 222],
  63206. "lightyellow": [255, 255, 224],
  63207. "lime": [0, 255, 0],
  63208. "limegreen": [50, 205, 50],
  63209. "linen": [250, 240, 230],
  63210. "magenta": [255, 0, 255],
  63211. "maroon": [128, 0, 0],
  63212. "mediumaquamarine": [102, 205, 170],
  63213. "mediumblue": [0, 0, 205],
  63214. "mediumorchid": [186, 85, 211],
  63215. "mediumpurple": [147, 112, 219],
  63216. "mediumseagreen": [60, 179, 113],
  63217. "mediumslateblue": [123, 104, 238],
  63218. "mediumspringgreen": [0, 250, 154],
  63219. "mediumturquoise": [72, 209, 204],
  63220. "mediumvioletred": [199, 21, 133],
  63221. "midnightblue": [25, 25, 112],
  63222. "mintcream": [245, 255, 250],
  63223. "mistyrose": [255, 228, 225],
  63224. "moccasin": [255, 228, 181],
  63225. "navajowhite": [255, 222, 173],
  63226. "navy": [0, 0, 128],
  63227. "oldlace": [253, 245, 230],
  63228. "olive": [128, 128, 0],
  63229. "olivedrab": [107, 142, 35],
  63230. "orange": [255, 165, 0],
  63231. "orangered": [255, 69, 0],
  63232. "orchid": [218, 112, 214],
  63233. "palegoldenrod": [238, 232, 170],
  63234. "palegreen": [152, 251, 152],
  63235. "paleturquoise": [175, 238, 238],
  63236. "palevioletred": [219, 112, 147],
  63237. "papayawhip": [255, 239, 213],
  63238. "peachpuff": [255, 218, 185],
  63239. "peru": [205, 133, 63],
  63240. "pink": [255, 192, 203],
  63241. "plum": [221, 160, 221],
  63242. "powderblue": [176, 224, 230],
  63243. "purple": [128, 0, 128],
  63244. "red": [255, 0, 0],
  63245. "rosybrown": [188, 143, 143],
  63246. "royalblue": [65, 105, 225],
  63247. "saddlebrown": [139, 69, 19],
  63248. "salmon": [250, 128, 114],
  63249. "sandybrown": [244, 164, 96],
  63250. "seagreen": [46, 139, 87],
  63251. "seashell": [255, 245, 238],
  63252. "sienna": [160, 82, 45],
  63253. "silver": [192, 192, 192],
  63254. "skyblue": [135, 206, 235],
  63255. "slateblue": [106, 90, 205],
  63256. "slategray": [112, 128, 144],
  63257. "slategrey": [112, 128, 144],
  63258. "snow": [255, 250, 250],
  63259. "springgreen": [0, 255, 127],
  63260. "steelblue": [70, 130, 180],
  63261. "tan": [210, 180, 140],
  63262. "teal": [0, 128, 128],
  63263. "thistle": [216, 191, 216],
  63264. "tomato": [255, 99, 71],
  63265. "turquoise": [64, 224, 208],
  63266. "violet": [238, 130, 238],
  63267. "wheat": [245, 222, 179],
  63268. "white": [255, 255, 255],
  63269. "whitesmoke": [245, 245, 245],
  63270. "yellow": [255, 255, 0],
  63271. "yellowgreen": [154, 205, 50],
  63272. "transparent": [0, 0, 0, 0]
  63273. },
  63274. "filter": {
  63275. "value": ["true", "false", "null", "point", "linestring", "polygon", "collection"]
  63276. }
  63277. };
  63278. CartoCSS['mapnik_reference'] = {
  63279. version: {
  63280. latest: _mapnik_reference_latest,
  63281. '2.1.1': _mapnik_reference_latest
  63282. }
  63283. };
  63284. CartoCSS.Tree = {};
  63285. CartoCSS.Tree.operate = function (op, a, b) {
  63286. switch (op) {
  63287. case '+':
  63288. return a + b;
  63289. case '-':
  63290. return a - b;
  63291. case '*':
  63292. return a * b;
  63293. case '%':
  63294. return a % b;
  63295. case '/':
  63296. return a / b;
  63297. }
  63298. };
  63299. CartoCSS.Tree.functions = {
  63300. rgb: function rgb(r, g, b) {
  63301. return this.rgba(r, g, b, 1.0);
  63302. },
  63303. rgba: function rgba(r, g, b, a) {
  63304. var me = this;
  63305. var rgb = [r, g, b].map(function (c) {
  63306. return me.number(c);
  63307. });
  63308. a = me.number(a);
  63309. if (rgb.some(isNaN) || isNaN(a)) {
  63310. return null;
  63311. }
  63312. return new CartoCSS.Tree.Color(rgb, a);
  63313. },
  63314. // Only require val
  63315. stop: function stop(val) {
  63316. var color, mode;
  63317. if (arguments.length > 1) {
  63318. color = arguments[1];
  63319. }
  63320. if (arguments.length > 2) {
  63321. mode = arguments[2];
  63322. }
  63323. return {
  63324. is: 'tag',
  63325. val: val,
  63326. color: color,
  63327. mode: mode,
  63328. toString: function toString(env) {
  63329. return '\n\t<stop value="' + val.ev(env) + '"' + (color ? ' color="' + color.ev(env) + '" ' : '') + (mode ? ' mode="' + mode.ev(env) + '" ' : '') + '/>';
  63330. }
  63331. };
  63332. },
  63333. hsl: function hsl(h, s, l) {
  63334. return this.hsla(h, s, l, 1.0);
  63335. },
  63336. hsla: function hsla(h, s, l, a) {
  63337. h = this.number(h) % 360 / 360;
  63338. s = this.number(s);
  63339. l = this.number(l);
  63340. a = this.number(a);
  63341. if ([h, s, l, a].some(isNaN)) {
  63342. return null;
  63343. }
  63344. var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s,
  63345. m1 = l * 2 - m2;
  63346. return this.rgba(hue(h + 1 / 3) * 255, hue(h) * 255, hue(h - 1 / 3) * 255, a);
  63347. function hue(h) {
  63348. h = h < 0 ? h + 1 : h > 1 ? h - 1 : h;
  63349. if (h * 6 < 1) {
  63350. return m1 + (m2 - m1) * h * 6;
  63351. } else if (h * 2 < 1) {
  63352. return m2;
  63353. } else if (h * 3 < 2) {
  63354. return m1 + (m2 - m1) * (2 / 3 - h) * 6;
  63355. } else {
  63356. return m1;
  63357. }
  63358. }
  63359. },
  63360. hue: function hue(color) {
  63361. if (!('toHSL' in color)) {
  63362. return null;
  63363. }
  63364. return new CartoCSS.Tree.Dimension(Math.round(color.toHSL().h));
  63365. },
  63366. saturation: function saturation(color) {
  63367. if (!('toHSL' in color)) {
  63368. return null;
  63369. }
  63370. return new CartoCSS.Tree.Dimension(Math.round(color.toHSL().s * 100), '%');
  63371. },
  63372. lightness: function lightness(color) {
  63373. if (!('toHSL' in color)) {
  63374. return null;
  63375. }
  63376. return new CartoCSS.Tree.Dimension(Math.round(color.toHSL().l * 100), '%');
  63377. },
  63378. alpha: function alpha(color) {
  63379. if (!('toHSL' in color)) {
  63380. return null;
  63381. }
  63382. return new CartoCSS.Tree.Dimension(color.toHSL().a);
  63383. },
  63384. saturate: function saturate(color, amount) {
  63385. if (!('toHSL' in color)) {
  63386. return null;
  63387. }
  63388. var hsl = color.toHSL();
  63389. hsl.s += amount.value / 100;
  63390. hsl.s = this.clamp(hsl.s);
  63391. return this.hsla_simple(hsl);
  63392. },
  63393. desaturate: function desaturate(color, amount) {
  63394. if (!('toHSL' in color)) {
  63395. return null;
  63396. }
  63397. var hsl = color.toHSL();
  63398. hsl.s -= amount.value / 100;
  63399. hsl.s = this.clamp(hsl.s);
  63400. return this.hsla_simple(hsl);
  63401. },
  63402. lighten: function lighten(color, amount) {
  63403. if (!('toHSL' in color)) {
  63404. return null;
  63405. }
  63406. var hsl = color.toHSL();
  63407. hsl.l += amount.value / 100;
  63408. hsl.l = this.clamp(hsl.l);
  63409. return this.hsla_simple(hsl);
  63410. },
  63411. darken: function darken(color, amount) {
  63412. if (!('toHSL' in color)) {
  63413. return null;
  63414. }
  63415. var hsl = color.toHSL();
  63416. hsl.l -= amount.value / 100;
  63417. hsl.l = this.clamp(hsl.l);
  63418. return this.hsla_simple(hsl);
  63419. },
  63420. fadein: function fadein(color, amount) {
  63421. if (!('toHSL' in color)) {
  63422. return null;
  63423. }
  63424. var hsl = color.toHSL();
  63425. hsl.a += amount.value / 100;
  63426. hsl.a = this.clamp(hsl.a);
  63427. return this.hsla_simple(hsl);
  63428. },
  63429. fadeout: function fadeout(color, amount) {
  63430. if (!('toHSL' in color)) {
  63431. return null;
  63432. }
  63433. var hsl = color.toHSL();
  63434. hsl.a -= amount.value / 100;
  63435. hsl.a = this.clamp(hsl.a);
  63436. return this.hsla_simple(hsl);
  63437. },
  63438. spin: function spin(color, amount) {
  63439. if (!('toHSL' in color)) {
  63440. return null;
  63441. }
  63442. var hsl = color.toHSL();
  63443. var hue = (hsl.h + amount.value) % 360;
  63444. hsl.h = hue < 0 ? 360 + hue : hue;
  63445. return this.hsla_simple(hsl);
  63446. },
  63447. replace: function replace(entity, a, b) {
  63448. if (entity.is === 'field') {
  63449. return entity.toString + '.replace(' + a.toString() + ', ' + b.toString() + ')';
  63450. } else {
  63451. return entity.replace(a, b);
  63452. }
  63453. },
  63454. //
  63455. // Copyright (c) 2006-2009 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein
  63456. // http://sass-lang.com
  63457. //
  63458. mix: function mix(color1, color2, weight) {
  63459. var p = weight.value / 100.0;
  63460. var w = p * 2 - 1;
  63461. var a = color1.toHSL().a - color2.toHSL().a;
  63462. var w1 = ((w * a == -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
  63463. var w2 = 1 - w1;
  63464. var rgb = [color1.rgb[0] * w1 + color2.rgb[0] * w2, color1.rgb[1] * w1 + color2.rgb[1] * w2, color1.rgb[2] * w1 + color2.rgb[2] * w2];
  63465. var alpha = color1.alpha * p + color2.alpha * (1 - p);
  63466. return new CartoCSS.Tree.Color(rgb, alpha);
  63467. },
  63468. greyscale: function greyscale(color) {
  63469. return this.desaturate(color, new CartoCSS.Tree.Dimension(100));
  63470. },
  63471. '%': function _(quoted /* arg, arg, ...*/) {
  63472. var args = Array.prototype.slice.call(arguments, 1),
  63473. str = quoted.value;
  63474. for (var i = 0; i < args.length; i++) {
  63475. str = str.replace(/%s/, args[i].value).replace(/%[da]/, args[i].toString());
  63476. }
  63477. str = str.replace(/%%/g, '%');
  63478. return new CartoCSS.Tree.Quoted(str);
  63479. },
  63480. hsla_simple: function hsla_simple(h) {
  63481. return this.hsla(h.h, h.s, h.l, h.a);
  63482. },
  63483. number: function number(n) {
  63484. if (n instanceof CartoCSS.Tree.Dimension) {
  63485. return parseFloat(n.unit === '%' ? n.value / 100 : n.value);
  63486. } else if (typeof n === 'number') {
  63487. return n;
  63488. } else {
  63489. return NaN;
  63490. }
  63491. },
  63492. clamp: function clamp(val) {
  63493. return Math.min(1, Math.max(0, val));
  63494. }
  63495. };
  63496. CartoCSS.Tree.Call = /*#__PURE__*/function () {
  63497. function Call(name, args, index) {
  63498. CartoCSS_classCallCheck(this, Call);
  63499. this.is = 'call';
  63500. this.name = name;
  63501. this.args = args;
  63502. this.index = index;
  63503. }
  63504. // When evuating a function call,
  63505. // we either find the function in `tree.functions` [1],
  63506. // in which case we call it, passing the evaluated arguments,
  63507. // or we simply print it out as it appeared originally [2].
  63508. // The *functions.js* file contains the built-in functions.
  63509. // The reason why we evaluate the arguments, is in the case where
  63510. // we try to pass a variable to a function, like: `saturate(@color)`.
  63511. // The function should receive the value, not the variable.
  63512. CartoCSS_createClass(Call, [{
  63513. key: 'ev',
  63514. value: function ev(env) {
  63515. var args = this.args.map(function (a) {
  63516. return a.ev(env);
  63517. });
  63518. for (var i = 0; i < args.length; i++) {
  63519. if (args[i].is === 'undefined') {
  63520. return {
  63521. is: 'undefined',
  63522. value: 'undefined'
  63523. };
  63524. }
  63525. }
  63526. if (this.name in CartoCSS.Tree.functions) {
  63527. if (CartoCSS.Tree.functions[this.name].length <= args.length) {
  63528. var val = CartoCSS.Tree.functions[this.name].apply(CartoCSS.Tree.functions, args);
  63529. if (val === null) {
  63530. env.error({
  63531. message: 'incorrect arguments given to ' + this.name + '()',
  63532. index: this.index,
  63533. type: 'runtime',
  63534. filename: this.filename
  63535. });
  63536. return {
  63537. is: 'undefined',
  63538. value: 'undefined'
  63539. };
  63540. }
  63541. return val;
  63542. } else {
  63543. env.error({
  63544. message: 'incorrect number of arguments for ' + this.name + '(). ' + CartoCSS.Tree.functions[this.name].length + ' expected.',
  63545. index: this.index,
  63546. type: 'runtime',
  63547. filename: this.filename
  63548. });
  63549. return {
  63550. is: 'undefined',
  63551. value: 'undefined'
  63552. };
  63553. }
  63554. } else {
  63555. var fn = CartoCSS.Tree.Reference.mapnikFunctions[this.name];
  63556. if (fn === undefined) {
  63557. var functions = lodash_topairs_default()(CartoCSS.Tree.Reference.mapnikFunctions);
  63558. // cheap closest, needs improvement.
  63559. var name = this.name;
  63560. var mean = functions.map(function (f) {
  63561. return [f[0], CartoCSS.Tree.Reference.editDistance(name, f[0]), f[1]];
  63562. }).sort(function (a, b) {
  63563. return a[1] - b[1];
  63564. });
  63565. env.error({
  63566. message: 'unknown function ' + this.name + '(), did you mean ' + mean[0][0] + '(' + mean[0][2] + ')',
  63567. index: this.index,
  63568. type: 'runtime',
  63569. filename: this.filename
  63570. });
  63571. return {
  63572. is: 'undefined',
  63573. value: 'undefined'
  63574. };
  63575. }
  63576. if (fn !== args.length &&
  63577. // support variable-arg functions like `colorize-alpha`
  63578. fn !== -1) {
  63579. env.error({
  63580. message: 'function ' + this.name + '() takes ' + fn + ' arguments and was given ' + args.length,
  63581. index: this.index,
  63582. type: 'runtime',
  63583. filename: this.filename
  63584. });
  63585. return {
  63586. is: 'undefined',
  63587. value: 'undefined'
  63588. };
  63589. } else {
  63590. // Save the evaluated versions of arguments
  63591. this.args = args;
  63592. return this;
  63593. }
  63594. }
  63595. }
  63596. }, {
  63597. key: "toString",
  63598. value: function toString(env, format) {
  63599. if (this.args.length) {
  63600. return this.name + '(' + this.args.join(',') + ')';
  63601. } else {
  63602. return this.name;
  63603. }
  63604. }
  63605. }]);
  63606. return Call;
  63607. }();
  63608. CartoCSS.Tree.Color = /*#__PURE__*/function () {
  63609. function Color(rgb, a) {
  63610. CartoCSS_classCallCheck(this, Color);
  63611. this.is = 'color';
  63612. // The end goal here, is to parse the arguments
  63613. // into an integer triplet, such as `128, 255, 0`
  63614. //
  63615. // This facilitates operations and conversions.
  63616. if (Array.isArray(rgb)) {
  63617. this.rgb = rgb.slice(0, 3);
  63618. } else if (rgb.length == 6) {
  63619. this.rgb = rgb.match(/.{2}/g).map(function (c) {
  63620. return parseInt(c, 16);
  63621. });
  63622. } else {
  63623. this.rgb = rgb.split('').map(function (c) {
  63624. return parseInt(c + c, 16);
  63625. });
  63626. }
  63627. if (typeof a === 'number') {
  63628. this.alpha = a;
  63629. } else if (rgb.length === 4) {
  63630. this.alpha = rgb[3];
  63631. } else {
  63632. this.alpha = 1;
  63633. }
  63634. }
  63635. CartoCSS_createClass(Color, [{
  63636. key: 'ev',
  63637. value: function ev() {
  63638. return this;
  63639. }
  63640. // If we have some transparency, the only way to represent it
  63641. // is via `rgba`. Otherwise, we use the hex representation,
  63642. // which has better compatibility with older browsers.
  63643. // Values are capped between `0` and `255`, rounded and zero-padded.
  63644. }, {
  63645. key: "toString",
  63646. value: function toString() {
  63647. /* if (this.alpha < 1.0) {*/
  63648. return 'rgba(' + this.rgb.map(function (c) {
  63649. return Math.round(c);
  63650. }).concat(this.alpha).join(', ') + ')';
  63651. /*} else {
  63652. return '#' + this.rgb.map(function(i) {
  63653. i = Math.round(i);
  63654. i = (i > 255 ? 255 : (i < 0 ? 0 : i)).toString(16);
  63655. return i.length === 1 ? '0' + i : i;
  63656. }).join('');
  63657. }*/
  63658. }
  63659. // Operations have to be done per-channel, if not,
  63660. // channels will spill onto each other. Once we have
  63661. // our result, in the form of an integer triplet,
  63662. // we create a new Color node to hold the result.
  63663. }, {
  63664. key: "operate",
  63665. value: function operate(env, op, other) {
  63666. var result = [];
  63667. if (!(other instanceof CartoCSS.Tree.Color)) {
  63668. other = other.toColor();
  63669. }
  63670. for (var c = 0; c < 3; c++) {
  63671. result[c] = CartoCSS.Tree.operate(op, this.rgb[c], other.rgb[c]);
  63672. }
  63673. return new CartoCSS.Tree.Color(result);
  63674. }
  63675. }, {
  63676. key: "toHSL",
  63677. value: function toHSL() {
  63678. var r = this.rgb[0] / 255,
  63679. g = this.rgb[1] / 255,
  63680. b = this.rgb[2] / 255,
  63681. a = this.alpha;
  63682. var max = Math.max(r, g, b),
  63683. min = Math.min(r, g, b);
  63684. var h,
  63685. s,
  63686. l = (max + min) / 2,
  63687. d = max - min;
  63688. if (max === min) {
  63689. h = s = 0;
  63690. } else {
  63691. s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
  63692. switch (max) {
  63693. case r:
  63694. h = (g - b) / d + (g < b ? 6 : 0);
  63695. break;
  63696. case g:
  63697. h = (b - r) / d + 2;
  63698. break;
  63699. case b:
  63700. h = (r - g) / d + 4;
  63701. break;
  63702. default:
  63703. break;
  63704. }
  63705. h /= 6;
  63706. }
  63707. return {
  63708. h: h * 360,
  63709. s: s,
  63710. l: l,
  63711. a: a
  63712. };
  63713. }
  63714. }]);
  63715. return Color;
  63716. }();
  63717. CartoCSS.Tree.Comment = /*#__PURE__*/function () {
  63718. function Comment(value, silent) {
  63719. CartoCSS_classCallCheck(this, Comment);
  63720. this.value = value;
  63721. this.silent = !!silent;
  63722. }
  63723. CartoCSS_createClass(Comment, [{
  63724. key: "toString",
  63725. value: function toString(env) {
  63726. return '<!--' + this.value + '-->';
  63727. }
  63728. }, {
  63729. key: 'ev',
  63730. value: function ev() {
  63731. return this;
  63732. }
  63733. }]);
  63734. return Comment;
  63735. }();
  63736. CartoCSS.Tree.Definition = /*#__PURE__*/function () {
  63737. function Definition(selector, rules) {
  63738. CartoCSS_classCallCheck(this, Definition);
  63739. this.elements = selector.elements;
  63740. //assert.ok(selector.filters instanceof CartoCSS.Tree.Filterset);
  63741. this.rules = rules;
  63742. this.ruleIndex = {};
  63743. for (var i = 0; i < this.rules.length; i++) {
  63744. if ('zoom' in this.rules[i]) {
  63745. this.rules[i] = this.rules[i].clone();
  63746. }
  63747. this.rules[i].zoom = selector.zoom;
  63748. this.ruleIndex[this.rules[i].updateID()] = true;
  63749. }
  63750. this.filters = selector.filters;
  63751. this.zoom = selector.zoom;
  63752. this.attachment = selector.attachment || '__default__';
  63753. this.specificity = selector.specificity();
  63754. }
  63755. CartoCSS_createClass(Definition, [{
  63756. key: "toString",
  63757. value: function toString() {
  63758. var str = this.filters.toString();
  63759. for (var i = 0; i < this.rules.length; i++) {
  63760. str += '\n ' + this.rules[i];
  63761. }
  63762. return str;
  63763. }
  63764. }, {
  63765. key: "toJS",
  63766. value: function toJS(env) {
  63767. var shaderAttrs = {};
  63768. // merge conditions from filters with zoom condition of the
  63769. // definition
  63770. var zoom = this.zoom;
  63771. //var frame_offset = this.frame_offset;
  63772. var _if = this.filters.toJS(env);
  63773. var filters = [zoom];
  63774. if (_if) {
  63775. filters.push(_if);
  63776. }
  63777. //if(frame_offset) filters.push('ctx["frame-offset"] === ' + frame_offset);
  63778. _if = filters.join(" && ");
  63779. function eachRule(rule) {
  63780. if (rule instanceof CartoCSS.Tree.Rule) {
  63781. shaderAttrs[rule.name] = shaderAttrs[rule.name] || [];
  63782. if (_if) {
  63783. shaderAttrs[rule.name].push("if(" + _if + "){" + rule.value.toJS(env) + "}");
  63784. } else {
  63785. shaderAttrs[rule.name].push(rule.value.toJS(env));
  63786. }
  63787. } else {
  63788. if (rule instanceof CartoCSS.Tree.Ruleset) {
  63789. var sh = rule.toJS(env);
  63790. for (var v in sh) {
  63791. shaderAttrs[v] = shaderAttrs[v] || [];
  63792. for (var attr in sh[v]) {
  63793. shaderAttrs[v].push(sh[v][attr]);
  63794. }
  63795. }
  63796. }
  63797. }
  63798. }
  63799. for (var id in this.rules) {
  63800. eachRule(this.rules[id]);
  63801. }
  63802. return shaderAttrs;
  63803. }
  63804. }]);
  63805. return Definition;
  63806. }();
  63807. CartoCSS.Tree.Dimension = /*#__PURE__*/function () {
  63808. function Dimension(value, unit, index) {
  63809. CartoCSS_classCallCheck(this, Dimension);
  63810. this.is = 'float';
  63811. this.physical_units = ['m', 'cm', 'in', 'mm', 'pt', 'pc'];
  63812. this.screen_units = ['px', '%'];
  63813. this.all_units = ['m', 'cm', 'in', 'mm', 'pt', 'pc', 'px', '%'];
  63814. this.densities = {
  63815. m: 0.0254,
  63816. mm: 25.4,
  63817. cm: 2.54,
  63818. pt: 72,
  63819. pc: 6
  63820. };
  63821. this.value = parseFloat(value);
  63822. this.unit = unit || null;
  63823. this.index = index;
  63824. }
  63825. CartoCSS_createClass(Dimension, [{
  63826. key: "ev",
  63827. value: function ev(env) {
  63828. if (this.unit && this.all_units.indexOf(this.unit) < 0) {
  63829. env.error({
  63830. message: "Invalid unit: '" + this.unit + "'",
  63831. index: this.index
  63832. });
  63833. return {
  63834. is: 'undefined',
  63835. value: 'undefined'
  63836. };
  63837. }
  63838. // normalize units which are not px or %
  63839. if (this.unit && this.physical_units.indexOf(this.unit) >= 0) {
  63840. if (!env.ppi) {
  63841. env.error({
  63842. message: "ppi is not set, so metric units can't be used",
  63843. index: this.index
  63844. });
  63845. return {
  63846. is: 'undefined',
  63847. value: 'undefined'
  63848. };
  63849. }
  63850. // convert all units to inch
  63851. // convert inch to px using ppi
  63852. this.value = this.value / this.densities[this.unit] * env.ppi;
  63853. this.unit = 'px';
  63854. }
  63855. return this;
  63856. }
  63857. }, {
  63858. key: "toColor",
  63859. value: function toColor() {
  63860. return new CartoCSS.Tree.Color([this.value, this.value, this.value]);
  63861. }
  63862. }, {
  63863. key: "round",
  63864. value: function round() {
  63865. this.value = Math.round(this.value);
  63866. return this;
  63867. }
  63868. }, {
  63869. key: "toString",
  63870. value: function toString() {
  63871. return this.value.toString();
  63872. }
  63873. }, {
  63874. key: "operate",
  63875. value: function operate(env, op, other) {
  63876. if (this.unit === '%' && other.unit !== '%') {
  63877. env.error({
  63878. message: 'If two operands differ, the first must not be %',
  63879. index: this.index
  63880. });
  63881. return {
  63882. is: 'undefined',
  63883. value: 'undefined'
  63884. };
  63885. }
  63886. if (this.unit !== '%' && other.unit === '%') {
  63887. if (op === '*' || op === '/' || op === '%') {
  63888. env.error({
  63889. message: 'Percent values can only be added or subtracted from other values',
  63890. index: this.index
  63891. });
  63892. return {
  63893. is: 'undefined',
  63894. value: 'undefined'
  63895. };
  63896. }
  63897. return new CartoCSS.Tree.Dimension(CartoCSS.Tree.operate(op, this.value, this.value * other.value * 0.01), this.unit);
  63898. }
  63899. //here the operands are either the same (% or undefined or px), or one is undefined and the other is px
  63900. return new CartoCSS.Tree.Dimension(CartoCSS.Tree.operate(op, this.value, other.value), this.unit || other.unit);
  63901. }
  63902. }]);
  63903. return Dimension;
  63904. }();
  63905. CartoCSS.Tree.Element = /*#__PURE__*/function () {
  63906. function Element(value) {
  63907. CartoCSS_classCallCheck(this, Element);
  63908. this.value = value.trim();
  63909. if (this.value[0] === '#') {
  63910. this.type = 'id';
  63911. this.clean = this.value.replace(/^#/, '');
  63912. }
  63913. if (this.value[0] === '.') {
  63914. this.type = 'class';
  63915. this.clean = this.value.replace(/^\./, '');
  63916. }
  63917. if (this.value.indexOf('*') !== -1) {
  63918. this.type = 'wildcard';
  63919. }
  63920. }
  63921. CartoCSS_createClass(Element, [{
  63922. key: "specificity",
  63923. value: function specificity() {
  63924. return [this.type === 'id' ? 1 : 0,
  63925. // a
  63926. this.type === 'class' ? 1 : 0 // b
  63927. ];
  63928. }
  63929. }, {
  63930. key: "toString",
  63931. value: function toString() {
  63932. return this.value;
  63933. }
  63934. }]);
  63935. return Element;
  63936. }();
  63937. CartoCSS.Tree.Expression = /*#__PURE__*/function () {
  63938. function Expression(value) {
  63939. CartoCSS_classCallCheck(this, Expression);
  63940. this.is = 'expression';
  63941. this.value = value;
  63942. }
  63943. CartoCSS_createClass(Expression, [{
  63944. key: "ev",
  63945. value: function ev(env) {
  63946. if (this.value.length > 1) {
  63947. return new CartoCSS.Tree.Expression(this.value.map(function (e) {
  63948. return e.ev(env);
  63949. }));
  63950. } else {
  63951. return this.value[0].ev(env);
  63952. }
  63953. }
  63954. }, {
  63955. key: "toString",
  63956. value: function toString(env) {
  63957. return this.value.map(function (e) {
  63958. return e.toString(env);
  63959. }).join(' ');
  63960. }
  63961. }]);
  63962. return Expression;
  63963. }();
  63964. CartoCSS.Tree.Field = /*#__PURE__*/function () {
  63965. function Field(content) {
  63966. CartoCSS_classCallCheck(this, Field);
  63967. this.is = 'field';
  63968. this.value = content || '';
  63969. }
  63970. CartoCSS_createClass(Field, [{
  63971. key: "toString",
  63972. value: function toString() {
  63973. return '["' + this.value.toUpperCase() + '"]';
  63974. }
  63975. }, {
  63976. key: 'ev',
  63977. value: function ev() {
  63978. return this;
  63979. }
  63980. }]);
  63981. return Field;
  63982. }();
  63983. CartoCSS.Tree.Filter = /*#__PURE__*/function () {
  63984. function Filter(key, op, val, index, filename) {
  63985. CartoCSS_classCallCheck(this, Filter);
  63986. this.ops = {
  63987. '<': [' &lt; ', 'numeric'],
  63988. '>': [' &gt; ', 'numeric'],
  63989. '=': [' = ', 'both'],
  63990. '!=': [' != ', 'both'],
  63991. '<=': [' &lt;= ', 'numeric'],
  63992. '>=': [' &gt;= ', 'numeric'],
  63993. '=~': ['.match(', 'string', ')']
  63994. };
  63995. this.key = key;
  63996. this.op = op;
  63997. this.val = val;
  63998. this.index = index;
  63999. this.filename = filename;
  64000. this.id = this.key + this.op + this.val;
  64001. }
  64002. CartoCSS_createClass(Filter, [{
  64003. key: "ev",
  64004. value: function ev(env) {
  64005. this.key = this.key.ev(env);
  64006. this.val = this.val.ev(env);
  64007. return this;
  64008. }
  64009. }, {
  64010. key: "toString",
  64011. value: function toString() {
  64012. return '[' + this.id + ']';
  64013. }
  64014. }]);
  64015. return Filter;
  64016. }();
  64017. CartoCSS.Tree.Filterset = /*#__PURE__*/function () {
  64018. function Filterset() {
  64019. CartoCSS_classCallCheck(this, Filterset);
  64020. this.filters = {};
  64021. }
  64022. CartoCSS_createClass(Filterset, [{
  64023. key: "toJS",
  64024. value: function toJS(env) {
  64025. function eachFilter(filter) {
  64026. var op = filter.op;
  64027. if (op === "=") {
  64028. op = "==";
  64029. }
  64030. var val = filter.val;
  64031. if (filter._val !== undefined) {
  64032. val = filter._val.toString(true);
  64033. }
  64034. //对scale进行特殊处理,将值转换成数值
  64035. if (filter.key && filter.key.value === 'scale') {
  64036. val = +val;
  64037. } else if (typeof val === 'string' || CartoCSS_typeof(val) === 'object') {
  64038. val = "'" + val + "'";
  64039. }
  64040. var attrs = "attributes";
  64041. return attrs + "&&" + attrs + filter.key + "&&" + attrs + filter.key + " " + op + val;
  64042. }
  64043. var results = [];
  64044. for (var id in this.filters) {
  64045. results.push(eachFilter(this.filters[id]));
  64046. }
  64047. return results.join(' && ');
  64048. }
  64049. }, {
  64050. key: "toString",
  64051. value: function toString() {
  64052. var arr = [];
  64053. for (var id in this.filters) {
  64054. arr.push(this.filters[id].id);
  64055. }
  64056. return arr.sort().join('\t');
  64057. }
  64058. }, {
  64059. key: "ev",
  64060. value: function ev(env) {
  64061. for (var i in this.filters) {
  64062. this.filters[i].ev(env);
  64063. }
  64064. return this;
  64065. }
  64066. }, {
  64067. key: "clone",
  64068. value: function clone() {
  64069. var clone = new CartoCSS.Tree.Filterset();
  64070. for (var id in this.filters) {
  64071. clone.filters[id] = this.filters[id];
  64072. }
  64073. return clone;
  64074. }
  64075. }, {
  64076. key: "cloneWith",
  64077. value: function cloneWith(other) {
  64078. var additions = [];
  64079. for (var id in other.filters) {
  64080. var status = this.addable(other.filters[id]);
  64081. // status is true, false or null. if it's null we don't fail this
  64082. // clone nor do we add the filter.
  64083. if (status === false) {
  64084. return false;
  64085. }
  64086. if (status === true) {
  64087. // Adding the filter will override another value.
  64088. additions.push(other.filters[id]);
  64089. }
  64090. }
  64091. // Adding the other filters doesn't make this filterset invalid, but it
  64092. // doesn't add anything to it either.
  64093. if (!additions.length) {
  64094. return null;
  64095. }
  64096. // We can successfully add all filters. Now clone the filterset and add the
  64097. // new rules.
  64098. var clone = new CartoCSS.Tree.Filterset();
  64099. // We can add the rules that are already present without going through the
  64100. // add function as a Filterset is always in it's simplest canonical form.
  64101. for (id in this.filters) {
  64102. clone.filters[id] = this.filters[id];
  64103. }
  64104. // Only add new filters that actually change the filter.
  64105. while (id = additions.shift()) {
  64106. clone.add(id);
  64107. }
  64108. return clone;
  64109. }
  64110. }, {
  64111. key: "addable",
  64112. value: function addable(filter) {
  64113. var key = filter.key.toString(),
  64114. value = filter.val.toString();
  64115. if (value.match(/^[0-9]+(\.[0-9]*)?_match/)) {
  64116. value = parseFloat(value);
  64117. }
  64118. switch (filter.op) {
  64119. case '=':
  64120. // if there is already foo= and we're adding foo=
  64121. if (this.filters[key + '='] !== undefined) {
  64122. if (this.filters[key + '='].val.toString() != value) {
  64123. return false;
  64124. } else {
  64125. return null;
  64126. }
  64127. }
  64128. if (this.filters[key + '!=' + value] !== undefined) {
  64129. return false;
  64130. }
  64131. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  64132. return false;
  64133. }
  64134. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  64135. return false;
  64136. }
  64137. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  64138. return false;
  64139. }
  64140. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  64141. return false;
  64142. }
  64143. return true;
  64144. case '=~':
  64145. return true;
  64146. case '!=':
  64147. if (this.filters[key + '='] !== undefined) {
  64148. return this.filters[key + '='].val === value ? false : null;
  64149. }
  64150. if (this.filters[key + '!=' + value] !== undefined) {
  64151. return null;
  64152. }
  64153. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  64154. return null;
  64155. }
  64156. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  64157. return null;
  64158. }
  64159. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  64160. return null;
  64161. }
  64162. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  64163. return null;
  64164. }
  64165. return true;
  64166. case '>':
  64167. if (key + '=' in this.filters) {
  64168. if (this.filters[key + '='].val <= value) {
  64169. return false;
  64170. } else {
  64171. return null;
  64172. }
  64173. }
  64174. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  64175. return false;
  64176. }
  64177. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val <= value) {
  64178. return false;
  64179. }
  64180. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  64181. return null;
  64182. }
  64183. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  64184. return null;
  64185. }
  64186. return true;
  64187. case '>=':
  64188. if (this.filters[key + '='] !== undefined) {
  64189. return this.filters[key + '='].val < value ? false : null;
  64190. }
  64191. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  64192. return false;
  64193. }
  64194. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  64195. return false;
  64196. }
  64197. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  64198. return null;
  64199. }
  64200. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val >= value) {
  64201. return null;
  64202. }
  64203. return true;
  64204. case '<':
  64205. if (this.filters[key + '='] !== undefined) {
  64206. return this.filters[key + '='].val >= value ? false : null;
  64207. }
  64208. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  64209. return false;
  64210. }
  64211. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val >= value) {
  64212. return false;
  64213. }
  64214. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  64215. return null;
  64216. }
  64217. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  64218. return null;
  64219. }
  64220. return true;
  64221. case '<=':
  64222. if (this.filters[key + '='] !== undefined) {
  64223. return this.filters[key + '='].val > value ? false : null;
  64224. }
  64225. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  64226. return false;
  64227. }
  64228. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  64229. return false;
  64230. }
  64231. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  64232. return null;
  64233. }
  64234. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val <= value) {
  64235. return null;
  64236. }
  64237. return true;
  64238. default:
  64239. break;
  64240. }
  64241. }
  64242. }, {
  64243. key: "conflict",
  64244. value: function conflict(filter) {
  64245. var key = filter.key.toString(),
  64246. value = filter.val.toString();
  64247. if (!isNaN(parseFloat(value))) {
  64248. value = parseFloat(value);
  64249. }
  64250. // if (a=b) && (a=c)
  64251. // if (a=b) && (a!=b)
  64252. // or (a!=b) && (a=b)
  64253. if (filter.op === '=' && this.filters[key + '='] !== undefined && value != this.filters[key + '='].val.toString() || filter.op === '!=' && this.filters[key + '='] !== undefined && value == this.filters[key + '='].val.toString() || filter.op === '=' && this.filters[key + '!='] !== undefined && value === this.filters[key + '!='].val.toString()) {
  64254. return filter.toString() + ' added to ' + this.toString() + ' produces an invalid filter';
  64255. }
  64256. return false;
  64257. }
  64258. }, {
  64259. key: "add",
  64260. value: function add(filter, env) {
  64261. var key = filter.key.toString(),
  64262. op = filter.op,
  64263. conflict = this.conflict(filter),
  64264. numval;
  64265. if (conflict) {
  64266. return conflict;
  64267. }
  64268. if (op === '=') {
  64269. for (var i in this.filters) {
  64270. if (this.filters[i].key === key) {
  64271. delete this.filters[i];
  64272. }
  64273. }
  64274. this.filters[key + '='] = filter;
  64275. } else if (op === '!=') {
  64276. this.filters[key + '!=' + filter.val] = filter;
  64277. } else if (op === '=~') {
  64278. this.filters[key + '=~' + filter.val] = filter;
  64279. } else if (op === '>') {
  64280. // If there are other filters that are also >
  64281. // but are less than this one, they don't matter, so
  64282. // remove them.
  64283. for (var j in this.filters) {
  64284. if (this.filters[j].key === key && this.filters[j].val <= filter.val) {
  64285. delete this.filters[j];
  64286. }
  64287. }
  64288. this.filters[key + '>'] = filter;
  64289. } else if (op === '>=') {
  64290. for (var k in this.filters) {
  64291. numval = +this.filters[k].val.toString();
  64292. if (this.filters[k].key === key && numval < filter.val) {
  64293. delete this.filters[k];
  64294. }
  64295. }
  64296. if (this.filters[key + '!=' + filter.val] !== undefined) {
  64297. delete this.filters[key + '!=' + filter.val];
  64298. filter.op = '>';
  64299. this.filters[key + '>'] = filter;
  64300. } else {
  64301. this.filters[key + '>='] = filter;
  64302. }
  64303. } else if (op === '<') {
  64304. for (var l in this.filters) {
  64305. numval = +this.filters[l].val.toString();
  64306. if (this.filters[l].key === key && numval >= filter.val) {
  64307. delete this.filters[l];
  64308. }
  64309. }
  64310. this.filters[key + '<'] = filter;
  64311. } else if (op === '<=') {
  64312. for (var m in this.filters) {
  64313. numval = +this.filters[m].val.toString();
  64314. if (this.filters[m].key === key && numval > filter.val) {
  64315. delete this.filters[m];
  64316. }
  64317. }
  64318. if (this.filters[key + '!=' + filter.val] !== undefined) {
  64319. delete this.filters[key + '!=' + filter.val];
  64320. filter.op = '<';
  64321. this.filters[key + '<'] = filter;
  64322. } else {
  64323. this.filters[key + '<='] = filter;
  64324. }
  64325. }
  64326. }
  64327. }]);
  64328. return Filterset;
  64329. }();
  64330. CartoCSS.Tree.Fontset = /*#__PURE__*/CartoCSS_createClass(function Fontset(env, fonts) {
  64331. CartoCSS_classCallCheck(this, Fontset);
  64332. this.fonts = fonts;
  64333. this.name = 'fontset-' + env.effects.length;
  64334. });
  64335. CartoCSS.Tree.Invalid = /*#__PURE__*/function () {
  64336. function Invalid(chunk, index, message) {
  64337. CartoCSS_classCallCheck(this, Invalid);
  64338. this.is = 'invalid';
  64339. this.chunk = chunk;
  64340. this.index = index;
  64341. this.type = 'syntax';
  64342. this.message = message || "Invalid code: " + this.chunk;
  64343. }
  64344. CartoCSS_createClass(Invalid, [{
  64345. key: "ev",
  64346. value: function ev(env) {
  64347. env.error({
  64348. chunk: this.chunk,
  64349. index: this.index,
  64350. type: 'syntax',
  64351. message: this.message || "Invalid code: " + this.chunk
  64352. });
  64353. return {
  64354. is: 'undefined'
  64355. };
  64356. }
  64357. }]);
  64358. return Invalid;
  64359. }();
  64360. CartoCSS.Tree.Keyword = /*#__PURE__*/function () {
  64361. function Keyword(value) {
  64362. CartoCSS_classCallCheck(this, Keyword);
  64363. this.value = value;
  64364. var special = {
  64365. 'transparent': 'color',
  64366. 'true': 'boolean',
  64367. 'false': 'boolean'
  64368. };
  64369. this.is = special[value] ? special[value] : 'keyword';
  64370. }
  64371. CartoCSS_createClass(Keyword, [{
  64372. key: "ev",
  64373. value: function ev() {
  64374. return this;
  64375. }
  64376. }, {
  64377. key: "toString",
  64378. value: function toString() {
  64379. return this.value;
  64380. }
  64381. }]);
  64382. return Keyword;
  64383. }();
  64384. /*Layer:class Invalid ),*/
  64385. CartoCSS.Tree.Literal = /*#__PURE__*/function () {
  64386. function Literal(content) {
  64387. CartoCSS_classCallCheck(this, Literal);
  64388. this.value = content || '';
  64389. this.is = 'field';
  64390. }
  64391. CartoCSS_createClass(Literal, [{
  64392. key: "toString",
  64393. value: function toString() {
  64394. return this.value;
  64395. }
  64396. }, {
  64397. key: 'ev',
  64398. value: function ev() {
  64399. return this;
  64400. }
  64401. }]);
  64402. return Literal;
  64403. }();
  64404. CartoCSS.Tree.Operation = /*#__PURE__*/function () {
  64405. function Operation(op, operands, index) {
  64406. CartoCSS_classCallCheck(this, Operation);
  64407. this.is = 'operation';
  64408. this.op = op.trim();
  64409. this.operands = operands;
  64410. this.index = index;
  64411. }
  64412. CartoCSS_createClass(Operation, [{
  64413. key: "ev",
  64414. value: function ev(env) {
  64415. var a = this.operands[0].ev(env),
  64416. b = this.operands[1].ev(env),
  64417. temp;
  64418. if (a.is === 'undefined' || b.is === 'undefined') {
  64419. return {
  64420. is: 'undefined',
  64421. value: 'undefined'
  64422. };
  64423. }
  64424. if (a instanceof CartoCSS.Tree.Dimension && b instanceof CartoCSS.Tree.Color) {
  64425. if (this.op === '*' || this.op === '+') {
  64426. temp = b;
  64427. b = a;
  64428. a = temp;
  64429. } else {
  64430. env.error({
  64431. name: "OperationError",
  64432. message: "Can't substract or divide a color from a number",
  64433. index: this.index
  64434. });
  64435. }
  64436. }
  64437. // Only concatenate plain strings, because this is easily
  64438. // pre-processed
  64439. if (a instanceof CartoCSS.Tree.Quoted && b instanceof CartoCSS.Tree.Quoted && this.op !== '+') {
  64440. env.error({
  64441. message: "Can't subtract, divide, or multiply strings.",
  64442. index: this.index,
  64443. type: 'runtime',
  64444. filename: this.filename
  64445. });
  64446. return {
  64447. is: 'undefined',
  64448. value: 'undefined'
  64449. };
  64450. }
  64451. // Fields, literals, dimensions, and quoted strings can be combined.
  64452. if (a instanceof CartoCSS.Tree.Field || b instanceof CartoCSS.Tree.Field || a instanceof CartoCSS.Tree.Literal || b instanceof CartoCSS.Tree.Literal) {
  64453. if (a.is === 'color' || b.is === 'color') {
  64454. env.error({
  64455. message: "Can't subtract, divide, or multiply colors in expressions.",
  64456. index: this.index,
  64457. type: 'runtime',
  64458. filename: this.filename
  64459. });
  64460. return {
  64461. is: 'undefined',
  64462. value: 'undefined'
  64463. };
  64464. } else {
  64465. return new CartoCSS.Tree.Literal(a.ev(env).toString(true) + this.op + b.ev(env).toString(true));
  64466. }
  64467. }
  64468. if (a.operate === undefined) {
  64469. env.error({
  64470. message: 'Cannot do math with type ' + a.is + '.',
  64471. index: this.index,
  64472. type: 'runtime',
  64473. filename: this.filename
  64474. });
  64475. return {
  64476. is: 'undefined',
  64477. value: 'undefined'
  64478. };
  64479. }
  64480. return a.operate(env, this.op, b);
  64481. }
  64482. }]);
  64483. return Operation;
  64484. }();
  64485. CartoCSS.Tree.Quoted = /*#__PURE__*/function () {
  64486. function Quoted(content) {
  64487. CartoCSS_classCallCheck(this, Quoted);
  64488. this.is = 'string';
  64489. this.value = content || '';
  64490. }
  64491. CartoCSS_createClass(Quoted, [{
  64492. key: "toString",
  64493. value: function toString(quotes) {
  64494. var escapedValue = this.value.replace(/&/g, '&amp;');
  64495. var xmlvalue = escapedValue.replace(/\'/g, '\\\'').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/\>/g, '&gt;');
  64496. return quotes === true ? "'" + xmlvalue + "'" : escapedValue;
  64497. }
  64498. }, {
  64499. key: "ev",
  64500. value: function ev() {
  64501. return this;
  64502. }
  64503. }, {
  64504. key: "operate",
  64505. value: function operate(env, op, other) {
  64506. return new CartoCSS.Tree.Quoted(CartoCSS.Tree.operate(op, this.toString(), other.toString(this.contains_field)));
  64507. }
  64508. }]);
  64509. return Quoted;
  64510. }();
  64511. CartoCSS.Tree.Reference = {
  64512. _validateValue: {
  64513. 'font': function font(env, value) {
  64514. if (env.validation_data && env.validation_data.fonts) {
  64515. return env.validation_data.fonts.indexOf(value) != -1;
  64516. } else {
  64517. return true;
  64518. }
  64519. }
  64520. },
  64521. setData: function setData(data) {
  64522. this.data = data;
  64523. this.selector_cache = generateSelectorCache(data);
  64524. this.mapnikFunctions = generateMapnikFunctions(data);
  64525. this.required_cache = generateRequiredProperties(data);
  64526. function generateSelectorCache(data) {
  64527. var index = {};
  64528. for (var i in data.symbolizers) {
  64529. for (var j in data.symbolizers[i]) {
  64530. if (data.symbolizers[i][j].hasOwnProperty('css')) {
  64531. index[data.symbolizers[i][j].css] = [data.symbolizers[i][j], i, j];
  64532. }
  64533. }
  64534. }
  64535. return index;
  64536. }
  64537. function generateMapnikFunctions(data) {
  64538. var functions = {};
  64539. for (var i in data.symbolizers) {
  64540. for (var j in data.symbolizers[i]) {
  64541. if (data.symbolizers[i][j].type === 'functions') {
  64542. for (var k = 0; k < data.symbolizers[i][j].functions.length; k++) {
  64543. var fn = data.symbolizers[i][j].functions[k];
  64544. functions[fn[0]] = fn[1];
  64545. }
  64546. }
  64547. }
  64548. }
  64549. return functions;
  64550. }
  64551. function generateRequiredProperties(data) {
  64552. var cache = {};
  64553. for (var symbolizer_name in data.symbolizers) {
  64554. cache[symbolizer_name] = [];
  64555. for (var j in data.symbolizers[symbolizer_name]) {
  64556. if (data.symbolizers[symbolizer_name][j].required) {
  64557. cache[symbolizer_name].push(data.symbolizers[symbolizer_name][j].css);
  64558. }
  64559. }
  64560. }
  64561. return cache;
  64562. }
  64563. },
  64564. setVersion: function setVersion(version) {
  64565. if (CartoCSS.mapnik_reference.version.hasOwnProperty(version)) {
  64566. this.setData(CartoCSS.mapnik_reference.version[version]);
  64567. return true;
  64568. }
  64569. return false;
  64570. },
  64571. selectorData: function selectorData(selector, i) {
  64572. if (this.selector_cache && this.selector_cache[selector]) {
  64573. return this.selector_cache[selector][i];
  64574. }
  64575. },
  64576. validSelector: function validSelector(selector) {
  64577. return !!this.selector_cache[selector];
  64578. },
  64579. selectorName: function selectorName(selector) {
  64580. return this.selectorData(selector, 2);
  64581. },
  64582. selector: function selector(_selector) {
  64583. return this.selectorData(_selector, 0);
  64584. },
  64585. symbolizer: function symbolizer(selector) {
  64586. return this.selectorData(selector, 1);
  64587. },
  64588. requiredProperties: function requiredProperties(symbolizer_name, rules) {
  64589. var req = this.required_cache[symbolizer_name];
  64590. for (var i in req) {
  64591. if (!(req[i] in rules)) {
  64592. return 'Property ' + req[i] + ' required for defining ' + symbolizer_name + ' styles.';
  64593. }
  64594. }
  64595. },
  64596. isFont: function isFont(selector) {
  64597. return this.selector(selector).validate === 'font';
  64598. },
  64599. editDistance: function editDistance(a, b) {
  64600. if (a.length === 0) {
  64601. return b.length;
  64602. }
  64603. if (b.length === 0) {
  64604. return a.length;
  64605. }
  64606. var matrix = [];
  64607. for (var i = 0; i <= b.length; i++) {
  64608. matrix[i] = [i];
  64609. }
  64610. for (var j = 0; j <= a.length; j++) {
  64611. matrix[0][j] = j;
  64612. }
  64613. for (i = 1; i <= b.length; i++) {
  64614. for (j = 1; j <= a.length; j++) {
  64615. if (b.charAt(i - 1) === a.charAt(j - 1)) {
  64616. matrix[i][j] = matrix[i - 1][j - 1];
  64617. } else {
  64618. matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1,
  64619. // substitution
  64620. Math.min(matrix[i][j - 1] + 1,
  64621. // insertion
  64622. matrix[i - 1][j] + 1)); // deletion
  64623. }
  64624. }
  64625. }
  64626. return matrix[b.length][a.length];
  64627. },
  64628. validValue: function validValue(env, selector, value) {
  64629. function validateFunctions(value, selector) {
  64630. if (value.value[0].is === 'string') {
  64631. return true;
  64632. }
  64633. for (var i in value.value) {
  64634. for (var j in value.value[i].value) {
  64635. if (value.value[i].value[j].is !== 'call') {
  64636. return false;
  64637. }
  64638. var f = find(this.selector(selector).functions, function (x) {
  64639. //NOSONAR
  64640. return x[0] === value.value[i].value[j].name;
  64641. });
  64642. if (!(f && f[1] === -1)) {
  64643. // This filter is unknown or given an incorrect number of arguments
  64644. if (!f || f[1] !== value.value[i].value[j].args.length) {
  64645. return false;
  64646. }
  64647. }
  64648. }
  64649. }
  64650. return true;
  64651. }
  64652. function validateKeyword(value, selector) {
  64653. if (CartoCSS_typeof(this.selector(selector).type) === 'object') {
  64654. return this.selector(selector).type.indexOf(value.value[0].value) !== -1;
  64655. } else {
  64656. // allow unquoted keywords as strings
  64657. return this.selector(selector).type === 'string';
  64658. }
  64659. }
  64660. var i;
  64661. if (!this.selector(selector)) {
  64662. return false;
  64663. } else if (value.value[0].is === 'keyword') {
  64664. return validateKeyword(value, selector);
  64665. } else if (value.value[0].is === 'undefined') {
  64666. // caught earlier in the chain - ignore here so that
  64667. // error is not overridden
  64668. return true;
  64669. } else if (this.selector(selector).type === 'numbers') {
  64670. for (i in value.value) {
  64671. if (value.value[i].is !== 'float') {
  64672. return false;
  64673. }
  64674. }
  64675. return true;
  64676. } else if (this.selector(selector).type === 'tags') {
  64677. if (!value.value) {
  64678. return false;
  64679. }
  64680. if (!value.value[0].value) {
  64681. return value.value[0].is === 'tag';
  64682. }
  64683. for (i = 0; i < value.value[0].value.length; i++) {
  64684. if (value.value[0].value[i].is !== 'tag') {
  64685. return false;
  64686. }
  64687. }
  64688. return true;
  64689. } else if (this.selector(selector).type == 'functions') {
  64690. // For backwards compatibility, you can specify a string for `functions`-compatible
  64691. // values, though they will not be validated.
  64692. return validateFunctions(value, selector);
  64693. } else if (this.selector(selector).type === 'expression') {
  64694. return true;
  64695. } else if (this.selector(selector).type === 'unsigned') {
  64696. if (value.value[0].is === 'float') {
  64697. value.value[0].round();
  64698. return true;
  64699. } else {
  64700. return false;
  64701. }
  64702. } else {
  64703. if (this.selector(selector).validate) {
  64704. var valid = false;
  64705. for (i = 0; i < value.value.length; i++) {
  64706. if (this.selector(selector).type === value.value[i].is && this._validateValue[this.selector(selector).validate](env, value.value[i].value)) {
  64707. return true;
  64708. }
  64709. }
  64710. return valid;
  64711. } else {
  64712. return this.selector(selector).type === value.value[0].is;
  64713. }
  64714. }
  64715. }
  64716. };
  64717. CartoCSS.Tree.Reference.setVersion("latest");
  64718. CartoCSS.Tree.Rule = /*#__PURE__*/function () {
  64719. function Rule(name, value, index, filename) {
  64720. CartoCSS_classCallCheck(this, Rule);
  64721. this.is = 'rule';
  64722. var parts = name.split('/');
  64723. this.name = parts.pop();
  64724. this.instance = parts.length ? parts[0] : '__default__';
  64725. this.value = value instanceof CartoCSS.Tree.Value ? value : new CartoCSS.Tree.Value([value]);
  64726. this.index = index;
  64727. this.symbolizer = CartoCSS.Tree.Reference.symbolizer(this.name);
  64728. this.filename = filename;
  64729. this.variable = name.charAt(0) === '@';
  64730. }
  64731. CartoCSS_createClass(Rule, [{
  64732. key: "clone",
  64733. value: function clone() {
  64734. var clone = Object.create(CartoCSS.Tree.Rule.prototype);
  64735. clone.name = this.name;
  64736. clone.value = this.value;
  64737. clone.index = this.index;
  64738. clone.instance = this.instance;
  64739. clone.symbolizer = this.symbolizer;
  64740. clone.filename = this.filename;
  64741. clone.variable = this.variable;
  64742. return clone;
  64743. }
  64744. }, {
  64745. key: "updateID",
  64746. value: function updateID() {
  64747. return this.id = this.zoom + '#' + this.instance + '#' + this.name;
  64748. }
  64749. }, {
  64750. key: "toString",
  64751. value: function toString() {
  64752. return '[' + CartoCSS.Tree.Zoom.toString(this.zoom) + '] ' + this.name + ': ' + this.value;
  64753. }
  64754. }, {
  64755. key: "ev",
  64756. value: function ev(context) {
  64757. return new CartoCSS.Tree.Rule(this.name, this.value.ev(context), this.index, this.filename);
  64758. }
  64759. }]);
  64760. return Rule;
  64761. }();
  64762. CartoCSS.Tree.Ruleset = /*#__PURE__*/function () {
  64763. function Ruleset(selectors, rules) {
  64764. CartoCSS_classCallCheck(this, Ruleset);
  64765. this.is = 'ruleset';
  64766. this.selectors = selectors;
  64767. this.rules = rules;
  64768. // static cache of find() function
  64769. this._lookups = {};
  64770. }
  64771. CartoCSS_createClass(Ruleset, [{
  64772. key: "ev",
  64773. value: function ev(env) {
  64774. var i,
  64775. rule,
  64776. ruleset = new CartoCSS.Tree.Ruleset(this.selectors, this.rules.slice(0));
  64777. ruleset.root = this.root;
  64778. // push the current ruleset to the frames stack
  64779. env.frames.unshift(ruleset);
  64780. // Evaluate everything else
  64781. for (i = 0, rule; i < ruleset.rules.length; i++) {
  64782. rule = ruleset.rules[i];
  64783. ruleset.rules[i] = rule.ev ? rule.ev(env) : rule;
  64784. }
  64785. // Pop the stack
  64786. env.frames.shift();
  64787. return ruleset;
  64788. }
  64789. }, {
  64790. key: "match",
  64791. value: function match(args) {
  64792. return !args || args.length === 0;
  64793. }
  64794. }, {
  64795. key: "variables",
  64796. value: function variables() {
  64797. if (this._variables) {
  64798. return this._variables;
  64799. } else {
  64800. return this._variables = this.rules.reduce(function (hash, r) {
  64801. if (r instanceof CartoCSS.Tree.Rule && r.variable === true) {
  64802. hash[r.name] = r;
  64803. }
  64804. return hash;
  64805. }, {});
  64806. }
  64807. }
  64808. }, {
  64809. key: "variable",
  64810. value: function variable(name) {
  64811. return this.variables()[name];
  64812. }
  64813. }, {
  64814. key: "rulesets",
  64815. value: function rulesets() {
  64816. if (this._rulesets) {
  64817. return this._rulesets;
  64818. } else {
  64819. return this._rulesets = this.rules.filter(function (r) {
  64820. return r instanceof CartoCSS.Tree.Ruleset;
  64821. });
  64822. }
  64823. }
  64824. }, {
  64825. key: "find",
  64826. value: function find(selector, self) {
  64827. self = self || this;
  64828. var rules = [],
  64829. match,
  64830. key = selector.toString();
  64831. if (key in this._lookups) {
  64832. return this._lookups[key];
  64833. }
  64834. this.rulesets().forEach(function (rule) {
  64835. if (rule !== self) {
  64836. for (var j = 0; j < rule.selectors.length; j++) {
  64837. match = selector.match(rule.selectors[j]);
  64838. if (match) {
  64839. if (selector.elements.length > 1) {
  64840. Array.prototype.push.apply(rules, rule.find(new CartoCSS.Tree.Selector(null, null, selector.elements.slice(1)), self));
  64841. } else {
  64842. rules.push(rule);
  64843. }
  64844. break;
  64845. }
  64846. }
  64847. }
  64848. });
  64849. return this._lookups[key] = rules;
  64850. }
  64851. // Zooms can use variables. This replaces CartoCSS.Tree.Zoom objects on selectors
  64852. // with simple bit-arrays that we can compare easily.
  64853. }, {
  64854. key: "evZooms",
  64855. value: function evZooms(env) {
  64856. for (var i = 0; i < this.selectors.length; i++) {
  64857. var zval = CartoCSS.Tree.Zoom.all;
  64858. for (var z = 0; z < this.selectors[i].zoom.length; z++) {
  64859. zval = this.selectors[i].zoom[z].ev(env).zoom;
  64860. }
  64861. this.selectors[i].zoom = zval;
  64862. }
  64863. }
  64864. }, {
  64865. key: "flatten",
  64866. value: function flatten(result, parents, env) {
  64867. var selectors = [],
  64868. i,
  64869. j;
  64870. if (this.selectors.length === 0) {
  64871. env.frames = env.frames.concat(this.rules);
  64872. }
  64873. // evaluate zoom variables on this object.
  64874. this.evZooms(env);
  64875. for (i = 0; i < this.selectors.length; i++) {
  64876. var child = this.selectors[i];
  64877. if (!child.filters) {
  64878. // This is an invalid filterset.
  64879. continue;
  64880. }
  64881. if (parents.length) {
  64882. for (j = 0; j < parents.length; j++) {
  64883. var parent = parents[j];
  64884. var mergedFilters = parent.filters.cloneWith(child.filters);
  64885. if (mergedFilters === null) {
  64886. // Filters could be added, but they didn't change the
  64887. // filters. This means that we only have to clone when
  64888. // the zoom levels or the attachment is different too.
  64889. if (parent.zoom === child.zoom && parent.attachment === child.attachment && parent.elements.join() === child.elements.join()) {
  64890. selectors.push(parent);
  64891. continue;
  64892. } else {
  64893. mergedFilters = parent.filters;
  64894. }
  64895. } else if (!mergedFilters) {
  64896. // The merged filters are invalid, that means we don't
  64897. // have to clone.
  64898. continue;
  64899. }
  64900. var clone = Object.create(CartoCSS.Tree.Selector.prototype);
  64901. clone.filters = mergedFilters;
  64902. clone.zoom = child.zoom;
  64903. clone.elements = parent.elements.concat(child.elements);
  64904. if (parent.attachment && child.attachment) {
  64905. clone.attachment = parent.attachment + '/' + child.attachment;
  64906. } else {
  64907. clone.attachment = child.attachment || parent.attachment;
  64908. }
  64909. clone.conditions = parent.conditions + child.conditions;
  64910. clone.index = child.index;
  64911. selectors.push(clone);
  64912. }
  64913. } else {
  64914. selectors.push(child);
  64915. }
  64916. }
  64917. var rules = [];
  64918. for (i = 0; i < this.rules.length; i++) {
  64919. var rule = this.rules[i];
  64920. // Recursively flatten any nested rulesets
  64921. if (rule instanceof CartoCSS.Tree.Ruleset) {
  64922. rule.flatten(result, selectors, env);
  64923. } else if (rule instanceof CartoCSS.Tree.Rule) {
  64924. rules.push(rule);
  64925. } else if (rule instanceof CartoCSS.Tree.Invalid) {
  64926. env.error(rule);
  64927. }
  64928. }
  64929. var index = rules.length ? rules[0].index : false;
  64930. for (i = 0; i < selectors.length; i++) {
  64931. // For specificity sort, use the position of the first rule to allow
  64932. // defining attachments that are under current element as a descendant
  64933. // selector.
  64934. if (index !== false) {
  64935. selectors[i].index = index;
  64936. }
  64937. result.push(new CartoCSS.Tree.Definition(selectors[i], rules.slice()));
  64938. }
  64939. return result;
  64940. }
  64941. }]);
  64942. return Ruleset;
  64943. }();
  64944. CartoCSS.Tree.Selector = /*#__PURE__*/function () {
  64945. function Selector(filters, zoom, elements, attachment, conditions, index) {
  64946. CartoCSS_classCallCheck(this, Selector);
  64947. this.elements = elements || [];
  64948. this.attachment = attachment;
  64949. this.filters = filters || {};
  64950. this.zoom = typeof zoom !== 'undefined' ? zoom : CartoCSS.Tree.Zoom.all;
  64951. this.conditions = conditions;
  64952. this.index = index;
  64953. }
  64954. CartoCSS_createClass(Selector, [{
  64955. key: "specificity",
  64956. value: function specificity() {
  64957. return this.elements.reduce(function (memo, e) {
  64958. var spec = e.specificity();
  64959. memo[0] += spec[0];
  64960. memo[1] += spec[1];
  64961. return memo;
  64962. }, [0, 0, this.conditions, this.index]);
  64963. }
  64964. }]);
  64965. return Selector;
  64966. }();
  64967. /*style:class Invalid ),*/
  64968. CartoCSS.Tree.URL = /*#__PURE__*/function () {
  64969. function URL(val, paths) {
  64970. CartoCSS_classCallCheck(this, URL);
  64971. this.is = 'uri';
  64972. this.value = val;
  64973. this.paths = paths;
  64974. }
  64975. CartoCSS_createClass(URL, [{
  64976. key: "toString",
  64977. value: function toString() {
  64978. return this.value.toString();
  64979. }
  64980. }, {
  64981. key: "ev",
  64982. value: function ev(ctx) {
  64983. return new CartoCSS.Tree.URL(this.value.ev(ctx), this.paths);
  64984. }
  64985. }]);
  64986. return URL;
  64987. }();
  64988. CartoCSS.Tree.Value = /*#__PURE__*/function () {
  64989. function Value(value) {
  64990. CartoCSS_classCallCheck(this, Value);
  64991. this.is = 'value';
  64992. this.value = value;
  64993. }
  64994. CartoCSS_createClass(Value, [{
  64995. key: "ev",
  64996. value: function ev(env) {
  64997. if (this.value.length === 1) {
  64998. return this.value[0].ev(env);
  64999. } else {
  65000. return new CartoCSS.Tree.Value(this.value.map(function (v) {
  65001. return v.ev(env);
  65002. }));
  65003. }
  65004. }
  65005. }, {
  65006. key: "toJS",
  65007. value: function toJS(env) {
  65008. //var v = this.value[0].value[0];
  65009. var val = this.ev(env);
  65010. var v = val.toString();
  65011. if (val.is === "color" || val.is === 'uri' || val.is === 'string' || val.is === 'keyword') {
  65012. v = "'" + v + "'";
  65013. } else if (val.is === 'field') {
  65014. // replace [varuable] by ctx['variable']
  65015. v = v.replace(/\[(.*)\]/g, "attributes['\_match1']");
  65016. } else if (val.value && CartoCSS_typeof(val.value) === "object") {
  65017. v = "[" + v + "]";
  65018. }
  65019. return "_value = " + v + ";";
  65020. }
  65021. }, {
  65022. key: "toString",
  65023. value: function toString(env, selector, sep, format) {
  65024. return this.value.map(function (e) {
  65025. return e.toString(env, format);
  65026. }).join(sep || ', ');
  65027. }
  65028. }, {
  65029. key: "clone",
  65030. value: function clone() {
  65031. var obj = Object.create(CartoCSS.Tree.Value.prototype);
  65032. if (Array.isArray(obj)) {
  65033. obj.value = this.value.slice();
  65034. } else {
  65035. obj.value = this.value;
  65036. }
  65037. obj.is = this.is;
  65038. return obj;
  65039. }
  65040. }]);
  65041. return Value;
  65042. }();
  65043. CartoCSS.Tree.Variable = /*#__PURE__*/function () {
  65044. function Variable(name, index, filename) {
  65045. CartoCSS_classCallCheck(this, Variable);
  65046. this.is = 'variable';
  65047. this.name = name;
  65048. this.index = index;
  65049. this.filename = filename;
  65050. }
  65051. CartoCSS_createClass(Variable, [{
  65052. key: "toString",
  65053. value: function toString() {
  65054. return this.name;
  65055. }
  65056. }, {
  65057. key: "ev",
  65058. value: function ev(env) {
  65059. if (this._css) {
  65060. return this._css;
  65061. }
  65062. var thisframe = env.frames.filter(function (f) {
  65063. return f.name === this.name;
  65064. }.bind(this));
  65065. if (thisframe.length) {
  65066. return thisframe[0].value.ev(env);
  65067. } else {
  65068. env.error({
  65069. message: 'variable ' + this.name + ' is undefined',
  65070. index: this.index,
  65071. type: 'runtime',
  65072. filename: this.filename
  65073. });
  65074. return {
  65075. is: 'undefined',
  65076. value: 'undefined'
  65077. };
  65078. }
  65079. }
  65080. }]);
  65081. return Variable;
  65082. }();
  65083. CartoCSS.Tree.Zoom = /*#__PURE__*/function () {
  65084. function Zoom(op, value, index) {
  65085. CartoCSS_classCallCheck(this, Zoom);
  65086. this.op = op;
  65087. this.value = value;
  65088. this.index = index;
  65089. }
  65090. CartoCSS_createClass(Zoom, [{
  65091. key: "setZoom",
  65092. value: function setZoom(zoom) {
  65093. this.zoom = zoom;
  65094. return this;
  65095. }
  65096. }, {
  65097. key: "ev",
  65098. value: function ev(env) {
  65099. var value = parseInt(this.value.ev(env).toString(), 10);
  65100. if (value > CartoCSS.Tree.Zoom.maxZoom || value < 0) {
  65101. env.error({
  65102. message: 'Only zoom levels between 0 and ' + CartoCSS.Tree.Zoom.maxZoom + ' supported.',
  65103. index: this.index
  65104. });
  65105. }
  65106. switch (this.op) {
  65107. case '=':
  65108. this.zoom = "zoom && zoom === " + value;
  65109. return this;
  65110. case '>':
  65111. this.zoom = "zoom && zoom > " + value;
  65112. break;
  65113. case '>=':
  65114. this.zoom = "zoom && zoom >= " + value;
  65115. break;
  65116. case '<':
  65117. this.zoom = "zoom && zoom < " + value;
  65118. break;
  65119. case '<=':
  65120. this.zoom = "zoom && zoom <= " + value;
  65121. break;
  65122. default:
  65123. break;
  65124. }
  65125. /*
  65126. for (var i = 0; i <= CartoCSS.Tree.Zoom.maxZoom; i++) {
  65127. if (i >= start && i <= end) {
  65128. zoom |= (1 << i);
  65129. }
  65130. }
  65131. this.zoom = zoom;
  65132. this.zoom=value+this.op+"zoom";*/
  65133. return this;
  65134. }
  65135. }, {
  65136. key: "toString",
  65137. value: function toString() {
  65138. var str = '';
  65139. for (var i = 0; i <= CartoCSS.Tree.Zoom.maxZoom; i++) {
  65140. str += this.zoom & 1 << i ? 'X' : '.';
  65141. }
  65142. return str;
  65143. }
  65144. }]);
  65145. return Zoom;
  65146. }();
  65147. // Covers all zoomlevels from 0 to 22
  65148. CartoCSS.Tree.Zoom.all = 23;
  65149. CartoCSS.Tree.Zoom.maxZoom = 22;
  65150. CartoCSS.Tree.Zoom.ranges = {
  65151. 0: 1000000000,
  65152. 1: 500000000,
  65153. 2: 200000000,
  65154. 3: 100000000,
  65155. 4: 50000000,
  65156. 5: 25000000,
  65157. 6: 12500000,
  65158. 7: 6500000,
  65159. 8: 3000000,
  65160. 9: 1500000,
  65161. 10: 750000,
  65162. 11: 400000,
  65163. 12: 200000,
  65164. 13: 100000,
  65165. 14: 50000,
  65166. 15: 25000,
  65167. 16: 12500,
  65168. 17: 5000,
  65169. 18: 2500,
  65170. 19: 1500,
  65171. 20: 750,
  65172. 21: 500,
  65173. 22: 250,
  65174. 23: 100
  65175. };
  65176. ;// CONCATENATED MODULE: ./src/common/style/ThemeStyle.js
  65177. function ThemeStyle_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  65178. function ThemeStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeStyle_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  65179. function ThemeStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65180. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65181. * This program are made available under the terms of the Apache License, Version 2.0
  65182. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65183. /**
  65184. * @class ThemeStyle
  65185. * @deprecatedclass SuperMap.ThemeStyle
  65186. * @classdesc 客户端专题图风格类。
  65187. * @modulecategory Overlay
  65188. * @category Visualization Theme
  65189. * @param {Object} options - 可选参数。
  65190. * @param {boolean} [options.fill=true] - 是否填充,不需要填充则设置为 false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  65191. * @param {string} [options.fillColor='#000000'] - 十六进制填充颜色。
  65192. * @param {number} [options.fillOpacity=1] - 填充不透明度。取值范围[0, 1]。
  65193. * @param {boolean} [options.stroke=false] - 是否描边,不需要描边则设置为false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  65194. * @param {string} [options.strokeColor='#000000'] - 十六进制描边颜色。
  65195. * @param {number} [options.strokeOpacity=1] - 描边的不透明度。取值范围[0, 1]。
  65196. * @param {number} [options.strokeWidth=1] - 线宽度/描边宽度。
  65197. * @param {string} [options.strokeLinecap='butt'] - 线帽样式。strokeLinecap 有三种类型 “butt", "round", "square"。
  65198. * @param {string} [options.strokeLineJoin='iter'] - 线段连接样式。strokeLineJoin 有三种类型 “miter", "round", "bevel"。
  65199. * @param {string} [options.strokeDashstyle='solid'] - 虚线类型。strokeDashstyle 有八种类型 “dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted"。solid 表示实线。
  65200. * @param {number} [options.pointRadius=6] - 点半径,单位为像素。
  65201. * @param {number} [options.shadowBlur=0] - 阴影模糊度,(大于 0 有效)。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  65202. * @param {string} [options.shadowColor='#000000'] - 阴影颜色。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  65203. * @param {number} [options.shadowOffsetX=0] - 阴影 X 方向偏移值。
  65204. * @param {number} [options.shadowOffsetY=0] - 阴影 Y 方向偏移值。
  65205. * @param {string} options.label - 专题要素附加文本标签内容。
  65206. * @param {string} [options.fontColor] - 附加文本字体颜色。
  65207. * @param {number} [options.fontSize=12] - 附加文本字体大小,单位是像素。
  65208. * @param {string} [options.fontStyle='normal'] - 附加文本字体样式。可设值:"normal", "italic", "oblique"。
  65209. * @param {string} [options.fontVariant='normal'] - 附加文本字体变体。可设值:"normal", "small-caps"。
  65210. * @param {string} [options.fontWeight='normal'] - 附加文本字体粗细。可设值:"normal", "bold", "bolder", "lighter"。
  65211. * @param {string} [options.fontFamily='arial,sans-serif'] - 附加文本字体系列。fontFamily 值是字体族名称或/及类族名称的一个优先表,每个值逗号分割,
  65212. * 浏览器会使用它可识别的第一个可以使用具体的字体名称("times"、"courier"、"arial")或字体系列名称
  65213. * ("serif"、"sans-serif"、"cursive"、"fantasy"、"monospace")。
  65214. * @param {string} [options.labelPosition='top'] - 附加文本位置,可以是 'inside', 'left', 'right', 'top', 'bottom'。
  65215. * @param {string} [options.labelAlign='center'] - 附加文本水平对齐。可以是 'left', 'right', 'center'。
  65216. * @param {string} [options.labelBaseline='middle'] - 附加文本垂直对齐。可以是 'top', 'bottom', 'middle' 。
  65217. * @param {number} [options.labelXOffset=0] - 附加文本在x轴方向的偏移量。
  65218. * @param {number} [options.labelYOffset=0] - 附加文本在y轴方向的偏移量。
  65219. * @usage
  65220. */
  65221. var ThemeStyle = /*#__PURE__*/ThemeStyle_createClass(function ThemeStyle(options) {
  65222. ThemeStyle_classCallCheck(this, ThemeStyle);
  65223. options = options || {};
  65224. /**
  65225. * @member {boolean} [ThemeStyle.prototype.fill=true]
  65226. * @description 是否填充,不需要填充则设置为 false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  65227. */
  65228. this.fill = true;
  65229. /**
  65230. * @member {string} [ThemeStyle.prototype.fillColor="#000000"]
  65231. * @description 十六进制填充颜色。
  65232. */
  65233. this.fillColor = "#000000";
  65234. /**
  65235. * @member {number} [ThemeStyle.prototype.fillOpacity=1]
  65236. * @description 填充不透明度。取值范围[0, 1]。
  65237. */
  65238. this.fillOpacity = 1;
  65239. /**
  65240. * @member {boolean} [ThemeStyle.prototype.stroke=false]
  65241. * @description 是否描边,不需要描边则设置为false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  65242. */
  65243. this.stroke = false;
  65244. /**
  65245. * @member {string} [ThemeStyle.prototype.strokeColor="#000000"]
  65246. * @description 十六进制描边颜色。
  65247. */
  65248. this.strokeColor = "#000000";
  65249. /**
  65250. * @member {number} [ThemeStyle.prototype.strokeOpacity=1]
  65251. * @description 描边的不透明度。取值范围[0, 1]。
  65252. */
  65253. this.strokeOpacity = 1;
  65254. /**
  65255. * @member {number} [ThemeStyle.prototype.strokeWidth=1]
  65256. * @description 线宽度/描边宽度。
  65257. */
  65258. this.strokeWidth = 1;
  65259. /**
  65260. * @member {string} [ThemeStyle.prototype.strokeLinecap="butt"]
  65261. * @description 线帽样式;strokeLinecap 有三种类型 “butt", "round", "square" 。
  65262. */
  65263. this.strokeLinecap = "butt";
  65264. /**
  65265. * @member {string} [ThemeStyle.prototype.strokeLineJoin="miter"]
  65266. * @description 线段连接样式;strokeLineJoin 有三种类型 “miter", "round", "bevel"。
  65267. */
  65268. this.strokeLineJoin = "miter";
  65269. /**
  65270. * @member {string} [ThemeStyle.prototype.strokeDashstyle="solid"]
  65271. * @description 虚线类型;strokeDashstyle 有八种类型 “dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted";
  65272. * solid 表示实线。
  65273. */
  65274. this.strokeDashstyle = "solid";
  65275. /**
  65276. * @member {number} [ThemeStyle.prototype.pointRadius=6]
  65277. * @description 点半径。单位为像素。
  65278. */
  65279. this.pointRadius = 6;
  65280. /**
  65281. * @member {number} [ThemeStyle.prototype.shadowBlur=0]
  65282. * @description 阴影模糊度,(大于 0 有效)。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  65283. */
  65284. this.shadowBlur = 0;
  65285. /**
  65286. * @member {string} [ThemeStyle.prototype.shadowColor='#000000']
  65287. * @description 阴影颜色。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  65288. */
  65289. this.shadowColor = "#000000";
  65290. /**
  65291. * @member {number} [ThemeStyle.prototype.shadowOffsetX=0]
  65292. * @description 阴影 X 方向偏移值。
  65293. */
  65294. this.shadowOffsetX = 0;
  65295. /**
  65296. * @member {number} ThemeStyle.prototype.shadowOffsetY
  65297. * @description Y 方向偏移值。
  65298. */
  65299. this.shadowOffsetY = 0;
  65300. /**
  65301. * @member {string} [ThemeStyle.prototype.label]
  65302. * @description 专题要素附加文本标签内容。
  65303. */
  65304. this.label = "";
  65305. /**
  65306. * @member {boolean} [ThemeStyle.prototype.labelRect=false]
  65307. * @description 是否显示文本标签矩形背景。
  65308. */
  65309. this.labelRect = false;
  65310. /**
  65311. * @member {string} [ThemeStyle.prototype.fontColor]
  65312. * @description 附加文本字体颜色。
  65313. */
  65314. this.fontColor = "";
  65315. /**
  65316. * @member {number} [ThemeStyle.prototype.fontSize=12]
  65317. * @description 附加文本字体大小,单位是像素。
  65318. */
  65319. this.fontSize = 12;
  65320. /**
  65321. * @member {string} [ThemeStyle.prototype.fontStyle="normal"]
  65322. * @description 附加文本字体样式。可设值:"normal", "italic", "oblique"。
  65323. */
  65324. this.fontStyle = "normal";
  65325. /**
  65326. * @member {string} [ThemeStyle.prototype.fontVariant="normal"]
  65327. * @description 附加文本字体变体。可设值:"normal", "small-caps"。
  65328. */
  65329. this.fontVariant = "normal";
  65330. /**
  65331. * @member {string} [ThemeStyle.prototype.fontWeight="normal"]
  65332. * @description 附加文本字体粗细。可设值:"normal", "bold", "bolder", "lighter"。
  65333. */
  65334. this.fontWeight = "normal";
  65335. /**
  65336. * @member {string} [ThemeStyle.prototype.fontFamily="arial,sans-serif"]
  65337. * @description 附加文本字体系列。fontFamily 值是字体族名称或/及类族名称的一个优先表,每个值逗号分割,浏览器会使用它可识别的第一个
  65338. * 可以使用具体的字体名称("times"、"courier"、"arial")或字体系列名称("serif"、"sans-serif"、"cursive"、"fantasy"、"monospace")。
  65339. */
  65340. this.fontFamily = "arial,sans-serif";
  65341. /**
  65342. * @member {string} [ThemeStyle.prototype.labelPosition='top']
  65343. * @description 附加文本位置,可以是 'inside', 'left', 'right', 'top', 'bottom'。
  65344. */
  65345. this.labelPosition = "top";
  65346. /**
  65347. * @member {string} [ThemeStyle.prototype.labelAlign='center']
  65348. * @description 附加文本水平对齐。可以是 'left', 'right', 'center'。
  65349. */
  65350. this.labelAlign = "center";
  65351. /**
  65352. * @member {string} [ThemeStyle.prototype.labelBaseline='middle']
  65353. * @description 附加文本垂直对齐。可以是 'top', 'bottom', 'middle'。
  65354. */
  65355. this.labelBaseline = "middle";
  65356. /**
  65357. * @member {number} [ThemeStyle.prototype.labelXOffset=0]
  65358. * @description 附加文本在 X 轴方向的偏移量。
  65359. */
  65360. this.labelXOffset = 0;
  65361. /**
  65362. * @member {number} [ThemeStyle.prototype.labelYOffset=0]
  65363. * @description 附加文本在 Y 轴方向的偏移量。
  65364. */
  65365. this.labelYOffset = 0;
  65366. Util_Util.extend(this, options);
  65367. });
  65368. ;// CONCATENATED MODULE: ./src/common/style/index.js
  65369. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65370. * This program are made available under the terms of the Apache License, Version 2.0
  65371. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65372. ;// CONCATENATED MODULE: ./src/common/overlay/feature/ShapeParameters.js
  65373. function ShapeParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65374. function ShapeParameters_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  65375. function ShapeParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ShapeParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ShapeParameters_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  65376. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65377. * This program are made available under the terms of the Apache License, Version 2.0
  65378. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65379. /**
  65380. * @class ShapeParameters
  65381. * @aliasclass Feature.ShapeParameters
  65382. * @deprecatedclass SuperMap.Feature.ShapeParameters
  65383. * @category Visualization Theme
  65384. * @classdesc 图形参数基类
  65385. * @usage
  65386. */
  65387. var ShapeParameters = /*#__PURE__*/function () {
  65388. function ShapeParameters() {
  65389. ShapeParameters_classCallCheck(this, ShapeParameters);
  65390. /**
  65391. * @member {Array.<number>} [ShapeParameters.prototype.refOriginalPosition=[0,0]]
  65392. * @description 图形参考原点位置,图形的参考中心位置。
  65393. * refOriginalPosition 是长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  65394. * refOriginalPosition 表示图形的参考中心,通常情况下,图形是使用 canvas 的原点位置作为位置参考,
  65395. * 但 refOriginalPosition 可以改变图形的参考位置,例如: refOriginalPosition = [80, 80],
  65396. * 图形圆的 style.x = 20, style.y = 20,那么圆在 canvas 中的实际位置是 [100, 100]。
  65397. * 图形(Shape)的所有位置相关属性都是以 refOriginalPosition 为参考中心,
  65398. * 也就是说图形的所有位置信息在 canvas 中都是以 refOriginalPosition 为参考的相对位置,只有
  65399. * refOriginalPosition 的值为 [0, 0] 时,图形的位置信息才是 canvas 绝对位置。
  65400. * 图形的位置信息通常有:style.pointList,style.x,style.y。
  65401. */
  65402. this.refOriginalPosition = [0, 0];
  65403. /**
  65404. * @member {string} ShapeParameters.prototype.refDataID
  65405. * @description 图形所关联数据的 ID(<{@link FeatureVector}> 的 ID)。
  65406. */
  65407. this.refDataID = null;
  65408. /**
  65409. * @member {boolean} ShapeParameters.prototype.isHoverByRefDataID
  65410. * @description 是否根据 refDataID 进行高亮。用于同时高亮所有 refDataID 相同的图形。
  65411. */
  65412. this.isHoverByRefDataID = false;
  65413. /**
  65414. * @member {string} ShapeParameters.prototype.refDataHoverGroup
  65415. * @description 高亮图形组的组名。此属性在 refDataID 有效且 isHoverByRefDataID 为 true 时生效。
  65416. * 一旦设置此属性,且属性值有效,只有关联同一个数据的图形且此属性相同的图形才会高亮。
  65417. */
  65418. this.refDataHoverGroup = null;
  65419. /**
  65420. * @member {Object} ShapeParameters.prototype.dataInfo
  65421. * @description 图形携带的附加数据。
  65422. */
  65423. this.dataInfo = null;
  65424. /**
  65425. * @member {boolean} ShapeParameters.prototype.clickable
  65426. * @description 是否可点击。
  65427. */
  65428. this.clickable = true;
  65429. /**
  65430. * @member {boolean} ShapeParameters.prototype.hoverable
  65431. * @description 是否可点击。
  65432. */
  65433. this.hoverable = true;
  65434. /**
  65435. * @member {Object} ShapeParameters.prototype.style
  65436. * @description 图形样式对象,可设样式属性在子类中确定。
  65437. */
  65438. this.style = null;
  65439. /**
  65440. * @member {Object} ShapeParameters.prototype.highlightStyle
  65441. * @description 高亮样式对象,可设样式属性与 style 的可设样式属性相同。
  65442. */
  65443. this.highlightStyle = {};
  65444. this.CLASS_NAME = "SuperMap.Feature.ShapeParameters";
  65445. }
  65446. /**
  65447. * @function ShapeParameters.prototype.destroy
  65448. * @description 销毁对象。
  65449. */
  65450. ShapeParameters_createClass(ShapeParameters, [{
  65451. key: "destroy",
  65452. value: function destroy() {
  65453. this.refOriginalPosition = null;
  65454. this.refDataID = null;
  65455. this.isHoverByRefDataID = null;
  65456. this.refDataHoverGroup = null;
  65457. this.dataInfo = null;
  65458. this.clickable = null;
  65459. this.hoverable = null;
  65460. this.style = null;
  65461. this.highlightStyle = null;
  65462. }
  65463. }]);
  65464. return ShapeParameters;
  65465. }();
  65466. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Point.js
  65467. function feature_Point_typeof(obj) { "@babel/helpers - typeof"; return feature_Point_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, feature_Point_typeof(obj); }
  65468. function feature_Point_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65469. function feature_Point_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  65470. function feature_Point_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Point_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Point_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  65471. function feature_Point_get() { if (typeof Reflect !== "undefined" && Reflect.get) { feature_Point_get = Reflect.get.bind(); } else { feature_Point_get = function _get(target, property, receiver) { var base = feature_Point_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return feature_Point_get.apply(this, arguments); }
  65472. function feature_Point_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Point_getPrototypeOf(object); if (object === null) break; } return object; }
  65473. function feature_Point_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) feature_Point_setPrototypeOf(subClass, superClass); }
  65474. function feature_Point_setPrototypeOf(o, p) { feature_Point_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return feature_Point_setPrototypeOf(o, p); }
  65475. function feature_Point_createSuper(Derived) { var hasNativeReflectConstruct = feature_Point_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = feature_Point_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = feature_Point_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return feature_Point_possibleConstructorReturn(this, result); }; }
  65476. function feature_Point_possibleConstructorReturn(self, call) { if (call && (feature_Point_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return feature_Point_assertThisInitialized(self); }
  65477. function feature_Point_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  65478. function feature_Point_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  65479. function feature_Point_getPrototypeOf(o) { feature_Point_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return feature_Point_getPrototypeOf(o); }
  65480. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65481. * This program are made available under the terms of the Apache License, Version 2.0
  65482. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65483. /**
  65484. * @class ShapeParametersPoint
  65485. * @aliasclass Feature.ShapeParameters.Point
  65486. * @deprecatedclass SuperMap.Feature.ShapeParameters.Point
  65487. * @category Visualization Theme
  65488. * @classdesc 点参数对象。
  65489. * @extends {ShapeParameters}
  65490. * @param {number} x - 点 x 坐标。
  65491. * @param {number} y - 点 y 坐标。
  65492. * @usage
  65493. */
  65494. var Point_Point = /*#__PURE__*/function (_ShapeParameters) {
  65495. feature_Point_inherits(Point, _ShapeParameters);
  65496. var _super = feature_Point_createSuper(Point);
  65497. function Point(x, y) {
  65498. var _this;
  65499. feature_Point_classCallCheck(this, Point);
  65500. _this = _super.call(this, x, y);
  65501. /**
  65502. * @member {number} ShapeParametersPoint.prototype.x
  65503. * @description 点 x 坐标。
  65504. */
  65505. _this.x = !isNaN(x) ? x : 0;
  65506. /**
  65507. * @member {number} ShapeParametersPoint.prototype.y
  65508. * @description 点 y 坐标。
  65509. */
  65510. _this.y = !isNaN(y) ? y : 0;
  65511. /**
  65512. * @member {number} ShapeParametersPoint.prototype.r
  65513. * @description 点的半径。
  65514. */
  65515. _this.r = 6;
  65516. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Point";
  65517. return _this;
  65518. }
  65519. /**
  65520. * @function ShapeParametersPoint.prototype.destroy
  65521. * @description 销毁对象。
  65522. */
  65523. feature_Point_createClass(Point, [{
  65524. key: "destroy",
  65525. value: function destroy() {
  65526. this.x = null;
  65527. this.y = null;
  65528. this.r = null;
  65529. feature_Point_get(feature_Point_getPrototypeOf(Point.prototype), "destroy", this).call(this);
  65530. }
  65531. }]);
  65532. return Point;
  65533. }(ShapeParameters);
  65534. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Line.js
  65535. function Line_typeof(obj) { "@babel/helpers - typeof"; return Line_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Line_typeof(obj); }
  65536. function Line_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65537. function Line_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  65538. function Line_createClass(Constructor, protoProps, staticProps) { if (protoProps) Line_defineProperties(Constructor.prototype, protoProps); if (staticProps) Line_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  65539. function Line_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Line_get = Reflect.get.bind(); } else { Line_get = function _get(target, property, receiver) { var base = Line_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Line_get.apply(this, arguments); }
  65540. function Line_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Line_getPrototypeOf(object); if (object === null) break; } return object; }
  65541. function Line_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Line_setPrototypeOf(subClass, superClass); }
  65542. function Line_setPrototypeOf(o, p) { Line_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Line_setPrototypeOf(o, p); }
  65543. function Line_createSuper(Derived) { var hasNativeReflectConstruct = Line_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Line_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Line_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Line_possibleConstructorReturn(this, result); }; }
  65544. function Line_possibleConstructorReturn(self, call) { if (call && (Line_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Line_assertThisInitialized(self); }
  65545. function Line_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  65546. function Line_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  65547. function Line_getPrototypeOf(o) { Line_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Line_getPrototypeOf(o); }
  65548. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65549. * This program are made available under the terms of the Apache License, Version 2.0
  65550. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65551. /**
  65552. * @class ShapeParametersLine
  65553. * @aliasclass Feature.ShapeParameters.Line
  65554. * @deprecatedclass SuperMap.Feature.ShapeParameters.Line
  65555. * @category Visualization Theme
  65556. * @classdesc 线参数对象。
  65557. * @extends {ShapeParameters}
  65558. * @param {Array} pointList - 线要素节点数组,二维数组。
  65559. * @usage
  65560. */
  65561. var Line_Line = /*#__PURE__*/function (_ShapeParameters) {
  65562. Line_inherits(Line, _ShapeParameters);
  65563. var _super = Line_createSuper(Line);
  65564. function Line(pointList) {
  65565. var _this;
  65566. Line_classCallCheck(this, Line);
  65567. _this = _super.call(this, pointList);
  65568. /**
  65569. * @member {Array} ShapeParametersLine.prototype.pointList
  65570. * @description 线要素节点数组,二维数组。
  65571. * 数组形如:
  65572. * (start code)
  65573. * [
  65574. * [10, 20], //节点
  65575. * [30, 40],
  65576. * [25, 30] //最后一个节点和第一个节点不必相同,绘制时自动封闭
  65577. * ]
  65578. * (end)
  65579. */
  65580. _this.pointList = pointList;
  65581. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Line";
  65582. return _this;
  65583. }
  65584. /**
  65585. * @function ShapeParametersLine.prototype.destroy
  65586. * @description 销毁对象。
  65587. */
  65588. Line_createClass(Line, [{
  65589. key: "destroy",
  65590. value: function destroy() {
  65591. this.pointList = null;
  65592. Line_get(Line_getPrototypeOf(Line.prototype), "destroy", this).call(this);
  65593. }
  65594. }]);
  65595. return Line;
  65596. }(ShapeParameters);
  65597. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Polygon.js
  65598. function feature_Polygon_typeof(obj) { "@babel/helpers - typeof"; return feature_Polygon_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, feature_Polygon_typeof(obj); }
  65599. function feature_Polygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65600. function feature_Polygon_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  65601. function feature_Polygon_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Polygon_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Polygon_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  65602. function Polygon_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Polygon_get = Reflect.get.bind(); } else { Polygon_get = function _get(target, property, receiver) { var base = Polygon_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Polygon_get.apply(this, arguments); }
  65603. function Polygon_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Polygon_getPrototypeOf(object); if (object === null) break; } return object; }
  65604. function feature_Polygon_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) feature_Polygon_setPrototypeOf(subClass, superClass); }
  65605. function feature_Polygon_setPrototypeOf(o, p) { feature_Polygon_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return feature_Polygon_setPrototypeOf(o, p); }
  65606. function feature_Polygon_createSuper(Derived) { var hasNativeReflectConstruct = feature_Polygon_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = feature_Polygon_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = feature_Polygon_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return feature_Polygon_possibleConstructorReturn(this, result); }; }
  65607. function feature_Polygon_possibleConstructorReturn(self, call) { if (call && (feature_Polygon_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return feature_Polygon_assertThisInitialized(self); }
  65608. function feature_Polygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  65609. function feature_Polygon_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  65610. function feature_Polygon_getPrototypeOf(o) { feature_Polygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return feature_Polygon_getPrototypeOf(o); }
  65611. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65612. * This program are made available under the terms of the Apache License, Version 2.0
  65613. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65614. /**
  65615. * @class ShapeParametersPolygon
  65616. * @aliasclass Feature.ShapeParameters.Polygon
  65617. * @deprecatedclass SuperMap.Feature.ShapeParameters.Polygon
  65618. * @category Visualization Theme
  65619. * @classdesc 面参数对象。
  65620. * @extends {ShapeParameters}
  65621. * @param {Array} pointList - 横坐标。
  65622. * @usage
  65623. */
  65624. var feature_Polygon_Polygon = /*#__PURE__*/function (_ShapeParameters) {
  65625. feature_Polygon_inherits(Polygon, _ShapeParameters);
  65626. var _super = feature_Polygon_createSuper(Polygon);
  65627. function Polygon(pointList) {
  65628. var _this;
  65629. feature_Polygon_classCallCheck(this, Polygon);
  65630. _this = _super.call(this, pointList);
  65631. /**
  65632. * @member {Array} ShapeParametersPolygon.prototype.pointList
  65633. * @description 面要素节点数组,二维数组。
  65634. * 数组形如:
  65635. * (start code)
  65636. * [
  65637. * [10, 20], //节点
  65638. * [30, 40],
  65639. * [25, 30] //最后一个节点和第一个节点不必相同,绘制时自动封闭
  65640. * ]
  65641. * (end)
  65642. */
  65643. _this.pointList = pointList;
  65644. /**
  65645. * @member {Array} ShapeParametersPolygon.prototype.holePolygonPointLists
  65646. * @description 岛洞面多边形顶点数组(三维数组)
  65647. */
  65648. _this.holePolygonPointLists = null;
  65649. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Polygon";
  65650. return _this;
  65651. }
  65652. /**
  65653. * @function ShapeParametersPolygon.prototype.destroy
  65654. * @description 销毁对象。
  65655. */
  65656. feature_Polygon_createClass(Polygon, [{
  65657. key: "destroy",
  65658. value: function destroy() {
  65659. this.pointList = null;
  65660. this.holePolygonPointLists = null;
  65661. Polygon_get(feature_Polygon_getPrototypeOf(Polygon.prototype), "destroy", this).call(this);
  65662. }
  65663. }]);
  65664. return Polygon;
  65665. }(ShapeParameters);
  65666. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Rectangle.js
  65667. function feature_Rectangle_typeof(obj) { "@babel/helpers - typeof"; return feature_Rectangle_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, feature_Rectangle_typeof(obj); }
  65668. function feature_Rectangle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65669. function feature_Rectangle_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  65670. function feature_Rectangle_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Rectangle_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Rectangle_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  65671. function Rectangle_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Rectangle_get = Reflect.get.bind(); } else { Rectangle_get = function _get(target, property, receiver) { var base = Rectangle_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Rectangle_get.apply(this, arguments); }
  65672. function Rectangle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Rectangle_getPrototypeOf(object); if (object === null) break; } return object; }
  65673. function feature_Rectangle_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) feature_Rectangle_setPrototypeOf(subClass, superClass); }
  65674. function feature_Rectangle_setPrototypeOf(o, p) { feature_Rectangle_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return feature_Rectangle_setPrototypeOf(o, p); }
  65675. function feature_Rectangle_createSuper(Derived) { var hasNativeReflectConstruct = feature_Rectangle_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = feature_Rectangle_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = feature_Rectangle_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return feature_Rectangle_possibleConstructorReturn(this, result); }; }
  65676. function feature_Rectangle_possibleConstructorReturn(self, call) { if (call && (feature_Rectangle_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return feature_Rectangle_assertThisInitialized(self); }
  65677. function feature_Rectangle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  65678. function feature_Rectangle_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  65679. function feature_Rectangle_getPrototypeOf(o) { feature_Rectangle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return feature_Rectangle_getPrototypeOf(o); }
  65680. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65681. * This program are made available under the terms of the Apache License, Version 2.0
  65682. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65683. /**
  65684. * @class ShapeParametersRectangle
  65685. * @aliasclass Feature.ShapeParameters.Rectangle
  65686. * @deprecatedclass SuperMap.Feature.ShapeParameters.Rectangle
  65687. * @category Visualization Theme
  65688. * @classdesc 矩形参数对象。
  65689. * @extends {ShapeParameters}
  65690. * @param {number} x - 矩形 x 坐标。
  65691. * @param {number} y - 矩形 y 坐标。
  65692. * @param {number} width - 矩形 width 宽度。
  65693. * @param {number} height - 矩形 height 高度。
  65694. * @usage
  65695. */
  65696. var Rectangle_Rectangle = /*#__PURE__*/function (_ShapeParameters) {
  65697. feature_Rectangle_inherits(Rectangle, _ShapeParameters);
  65698. var _super = feature_Rectangle_createSuper(Rectangle);
  65699. function Rectangle(x, y, width, height) {
  65700. var _this;
  65701. feature_Rectangle_classCallCheck(this, Rectangle);
  65702. _this = _super.call(this, x, y, width, height);
  65703. /**
  65704. * @member {number} ShapeParametersRectangle.prototype.x
  65705. * @description 左上角 x 坐标。
  65706. */
  65707. _this.x = !isNaN(x) ? x : 0;
  65708. /**
  65709. * @member {number} ShapeParametersRectangle.prototype.y
  65710. * @description 左上角 y 坐标。
  65711. */
  65712. _this.y = !isNaN(x) ? y : 0;
  65713. /**
  65714. * @member {number} ShapeParametersRectangle.prototype.width
  65715. * @description 宽度。
  65716. */
  65717. _this.width = !isNaN(width) ? width : 0;
  65718. /**
  65719. * @member {number} ShapeParametersRectangle.prototype.height
  65720. * @description 高度。
  65721. */
  65722. _this.height = !isNaN(height) ? height : 0;
  65723. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Rectangle";
  65724. return _this;
  65725. }
  65726. /**
  65727. * @function ShapeParametersRectangle.prototype.destroy
  65728. * @description 销毁对象。
  65729. */
  65730. feature_Rectangle_createClass(Rectangle, [{
  65731. key: "destroy",
  65732. value: function destroy() {
  65733. this.x = null;
  65734. this.y = null;
  65735. this.width = null;
  65736. this.height = null;
  65737. Rectangle_get(feature_Rectangle_getPrototypeOf(Rectangle.prototype), "destroy", this).call(this);
  65738. }
  65739. }]);
  65740. return Rectangle;
  65741. }(ShapeParameters);
  65742. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Sector.js
  65743. function Sector_typeof(obj) { "@babel/helpers - typeof"; return Sector_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Sector_typeof(obj); }
  65744. function Sector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65745. function Sector_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  65746. function Sector_createClass(Constructor, protoProps, staticProps) { if (protoProps) Sector_defineProperties(Constructor.prototype, protoProps); if (staticProps) Sector_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  65747. function Sector_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Sector_get = Reflect.get.bind(); } else { Sector_get = function _get(target, property, receiver) { var base = Sector_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Sector_get.apply(this, arguments); }
  65748. function Sector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Sector_getPrototypeOf(object); if (object === null) break; } return object; }
  65749. function Sector_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Sector_setPrototypeOf(subClass, superClass); }
  65750. function Sector_setPrototypeOf(o, p) { Sector_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Sector_setPrototypeOf(o, p); }
  65751. function Sector_createSuper(Derived) { var hasNativeReflectConstruct = Sector_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Sector_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Sector_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Sector_possibleConstructorReturn(this, result); }; }
  65752. function Sector_possibleConstructorReturn(self, call) { if (call && (Sector_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Sector_assertThisInitialized(self); }
  65753. function Sector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  65754. function Sector_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  65755. function Sector_getPrototypeOf(o) { Sector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Sector_getPrototypeOf(o); }
  65756. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65757. * This program are made available under the terms of the Apache License, Version 2.0
  65758. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65759. /**
  65760. * @class ShapeParametersSector
  65761. * @aliasclass Feature.ShapeParameters.Sector
  65762. * @deprecatedclass SuperMap.Feature.ShapeParameters.Sector
  65763. * @category Visualization Theme
  65764. * @classdesc 扇形参数对象。
  65765. * @extends {ShapeParameters}
  65766. * @param {number} x - 圆心 x 坐标。
  65767. * @param {number} y - 圆心 y 坐标。
  65768. * @param {number} r - 外圆半径。
  65769. * @param {number} startAngle - 起始角度。取值范围[0, 360)。
  65770. * @param {number} endAngle - 结束角度。取值范围(0, 360]。
  65771. * @param {number} [r0=0] - 内圆半径,指定后将出现内弧,同时扇边长度为'r - r0'。取值范围[0, r)。
  65772. * @usage
  65773. */
  65774. var Sector = /*#__PURE__*/function (_ShapeParameters) {
  65775. Sector_inherits(Sector, _ShapeParameters);
  65776. var _super = Sector_createSuper(Sector);
  65777. function Sector(x, y, r, startAngle, endAngle, r0, clockWise) {
  65778. var _this;
  65779. Sector_classCallCheck(this, Sector);
  65780. _this = _super.call(this, x, y, r, startAngle, endAngle, r0, clockWise);
  65781. /**
  65782. * @member {number} ShapeParametersSector.prototype.x
  65783. * @description 圆心 x 坐标。
  65784. */
  65785. _this.x = !isNaN(x) ? x : 0;
  65786. /**
  65787. * @member {number} ShapeParametersSector.prototype.Y
  65788. * @description 圆心 Y 坐标。
  65789. */
  65790. _this.y = !isNaN(y) ? y : 0;
  65791. /**
  65792. * @member {number} ShapeParametersSector.prototype.r
  65793. * @description 外圆半径。
  65794. */
  65795. _this.r = !isNaN(r) ? r : 0;
  65796. /**
  65797. * @member {number} ShapeParametersSector.prototype.startAngle
  65798. * @description 起始角度。取值范围[0, 360),默认值:null。
  65799. */
  65800. _this.startAngle = !isNaN(startAngle) ? startAngle : 0;
  65801. /**
  65802. * @member {number} ShapeParametersSector.prototype.endAngle
  65803. * @description 结束角度。取值范围(0, 360],默认值:null。
  65804. */
  65805. _this.endAngle = !isNaN(endAngle) ? endAngle : 0;
  65806. /**
  65807. * @member {number} [ShapeParametersSector.prototype.r0=0]
  65808. * @description 内圆半径,指定后将出现内弧,同时扇边长度为 r 减 r0。取值范围[0, r)。
  65809. */
  65810. _this.r0 = !isNaN(r0) ? r0 : 0;
  65811. /**
  65812. * @member {number} [ShapeParametersSector.prototype.clockWise=false]
  65813. * @description 是否是顺时针。默认值:false。
  65814. */
  65815. _this.clockWise = clockWise;
  65816. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Sector";
  65817. return _this;
  65818. }
  65819. /**
  65820. * @function ShapeParametersSector.prototype.destroy
  65821. * @description 销毁对象。
  65822. */
  65823. Sector_createClass(Sector, [{
  65824. key: "destroy",
  65825. value: function destroy() {
  65826. this.x = null;
  65827. this.y = null;
  65828. this.r = null;
  65829. this.startAngle = null;
  65830. this.endAngle = null;
  65831. this.r0 = null;
  65832. this.clockWise = null;
  65833. Sector_get(Sector_getPrototypeOf(Sector.prototype), "destroy", this).call(this);
  65834. }
  65835. }]);
  65836. return Sector;
  65837. }(ShapeParameters);
  65838. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Label.js
  65839. function Label_typeof(obj) { "@babel/helpers - typeof"; return Label_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Label_typeof(obj); }
  65840. function Label_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65841. function Label_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  65842. function Label_createClass(Constructor, protoProps, staticProps) { if (protoProps) Label_defineProperties(Constructor.prototype, protoProps); if (staticProps) Label_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  65843. function Label_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Label_get = Reflect.get.bind(); } else { Label_get = function _get(target, property, receiver) { var base = Label_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Label_get.apply(this, arguments); }
  65844. function Label_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Label_getPrototypeOf(object); if (object === null) break; } return object; }
  65845. function Label_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Label_setPrototypeOf(subClass, superClass); }
  65846. function Label_setPrototypeOf(o, p) { Label_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Label_setPrototypeOf(o, p); }
  65847. function Label_createSuper(Derived) { var hasNativeReflectConstruct = Label_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Label_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Label_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Label_possibleConstructorReturn(this, result); }; }
  65848. function Label_possibleConstructorReturn(self, call) { if (call && (Label_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Label_assertThisInitialized(self); }
  65849. function Label_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  65850. function Label_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  65851. function Label_getPrototypeOf(o) { Label_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Label_getPrototypeOf(o); }
  65852. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65853. * This program are made available under the terms of the Apache License, Version 2.0
  65854. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65855. /**
  65856. * @class ShapeParametersLabel
  65857. * @aliasclass Feature.ShapeParameters.Label
  65858. * @deprecatedclass SuperMap.Feature.ShapeParameters.Label
  65859. * @category Visualization Theme
  65860. * @classdesc 标签参数对象。
  65861. * @extends {ShapeParameters}
  65862. * @param {number} x - 横坐标。
  65863. * @param {number} y - 纵坐标。
  65864. * @param {string} text - 图形中的附加文本。
  65865. * @usage
  65866. * ```
  65867. * // 浏览器
  65868. * <script type="text/javascript" src="{cdn}"></script>
  65869. * <script>
  65870. * new {namespace}.Feature.ShapeParameters.Label(x, y, text);
  65871. *
  65872. * // 弃用的写法
  65873. * new SuperMap.Feature.ShapeParameters.Label(x, y, text);
  65874. *
  65875. * </script>
  65876. * // ES6 Import
  65877. * import { ShapeParametersLabel } from '{npm}';
  65878. * new ShapeParametersLabel(x, y, text);
  65879. *
  65880. * // 弃用的写法
  65881. * import { Label } from '{npm}';
  65882. * new Label(x, y, text);
  65883. *
  65884. * ```
  65885. */
  65886. var Label = /*#__PURE__*/function (_ShapeParameters) {
  65887. Label_inherits(Label, _ShapeParameters);
  65888. var _super = Label_createSuper(Label);
  65889. function Label(x, y, text) {
  65890. var _this;
  65891. Label_classCallCheck(this, Label);
  65892. _this = _super.call(this, x, y, text);
  65893. /**
  65894. * @member {number} ShapeParametersLabel.prototype.x
  65895. * @description 标签 x 坐标。
  65896. */
  65897. _this.x = x;
  65898. /**
  65899. * @member {number} ShapeParametersLabel.prototype.y
  65900. * @description 标签 y 坐标。
  65901. */
  65902. _this.y = y;
  65903. /**
  65904. * @member {number} ShapeParametersLabel.prototype.text
  65905. * @description 标签的文本内容。
  65906. */
  65907. _this.text = text;
  65908. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Label";
  65909. return _this;
  65910. }
  65911. /**
  65912. * @function ShapeParametersLabel.prototype.destroy
  65913. * @description 销毁对象。
  65914. */
  65915. Label_createClass(Label, [{
  65916. key: "destroy",
  65917. value: function destroy() {
  65918. this.x = null;
  65919. this.y = null;
  65920. this.text = null;
  65921. Label_get(Label_getPrototypeOf(Label.prototype), "destroy", this).call(this);
  65922. }
  65923. }]);
  65924. return Label;
  65925. }(ShapeParameters);
  65926. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Image.js
  65927. function feature_Image_typeof(obj) { "@babel/helpers - typeof"; return feature_Image_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, feature_Image_typeof(obj); }
  65928. function feature_Image_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65929. function feature_Image_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  65930. function feature_Image_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Image_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Image_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  65931. function feature_Image_get() { if (typeof Reflect !== "undefined" && Reflect.get) { feature_Image_get = Reflect.get.bind(); } else { feature_Image_get = function _get(target, property, receiver) { var base = feature_Image_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return feature_Image_get.apply(this, arguments); }
  65932. function feature_Image_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Image_getPrototypeOf(object); if (object === null) break; } return object; }
  65933. function feature_Image_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) feature_Image_setPrototypeOf(subClass, superClass); }
  65934. function feature_Image_setPrototypeOf(o, p) { feature_Image_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return feature_Image_setPrototypeOf(o, p); }
  65935. function feature_Image_createSuper(Derived) { var hasNativeReflectConstruct = feature_Image_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = feature_Image_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = feature_Image_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return feature_Image_possibleConstructorReturn(this, result); }; }
  65936. function feature_Image_possibleConstructorReturn(self, call) { if (call && (feature_Image_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return feature_Image_assertThisInitialized(self); }
  65937. function feature_Image_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  65938. function feature_Image_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  65939. function feature_Image_getPrototypeOf(o) { feature_Image_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return feature_Image_getPrototypeOf(o); }
  65940. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65941. * This program are made available under the terms of the Apache License, Version 2.0
  65942. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65943. /**
  65944. * @class ShapeParametersImage
  65945. * @aliasclass Feature.ShapeParameters.Image
  65946. * @deprecatedclass SuperMap.Feature.ShapeParameters.Image
  65947. * @category Visualization Theme
  65948. * @classdesc 图片参数对象。
  65949. * @extends {ShapeParameters}
  65950. * @param {number} x - 左上角横坐标。
  65951. * @param {number} y - 左上角纵坐标。
  65952. * @param {(string|Object)} image - 图片地址或Cavans对象。
  65953. * @param {number} width - 绘制到画布上的宽度,默认为图片高度。
  65954. * @param {number} height - 绘制到画布上的高度,默认为图片高度。
  65955. * @param {number} sx - 从图片中裁剪的左上角横坐标。
  65956. * @param {number} sy - 从图片中裁剪的左上角纵坐标。
  65957. * @param {number} sWidth - 从图片中裁剪的宽度,默认为图片高度。
  65958. * @param {number} sHeight - 绘制到画布上的高度,默认为图片高度。
  65959. * @usage
  65960. */
  65961. var Image_Image = /*#__PURE__*/function (_ShapeParameters) {
  65962. feature_Image_inherits(Image, _ShapeParameters);
  65963. var _super = feature_Image_createSuper(Image);
  65964. function Image(x, y, image, width, height, sx, sy, sWidth, sHeight) {
  65965. var _this;
  65966. feature_Image_classCallCheck(this, Image);
  65967. _this = _super.call(this, x, y, image, width, height, sx, sy, sWidth, sHeight);
  65968. /**
  65969. * @member {number} ShapeParametersImage.prototype.x
  65970. * @description 左上角横坐标,必设参数。
  65971. */
  65972. _this.x = x;
  65973. /**
  65974. * @member {number} ShapeParametersImage.prototype.y
  65975. * @description 左上角纵坐标,必设参数。
  65976. */
  65977. _this.y = y;
  65978. /**
  65979. * @member {(string|Object)} ShapeParametersImage.prototype.image
  65980. * @description 图片地址。
  65981. */
  65982. _this.image = image;
  65983. /**
  65984. * @member {number} ShapeParametersImage.prototype.width
  65985. * @description 绘制到画布上的宽度,默认为图片高度。
  65986. */
  65987. _this.width = width;
  65988. /**
  65989. * @member {number} ShapeParametersImage.prototype.height
  65990. * @description 绘制到画布上的高度,默认为图片高度。
  65991. */
  65992. _this.height = height;
  65993. /**
  65994. * @member {number} ShapeParametersImage.prototype.sx
  65995. * @description 从图片中裁剪的左上角横坐标。
  65996. */
  65997. _this.sx = sx;
  65998. /**
  65999. * @member {number} ShapeParametersImage.prototype.sy
  66000. * @description 从图片中裁剪的左上角纵坐标。
  66001. */
  66002. _this.sy = sy;
  66003. /**
  66004. * @member {number} ShapeParametersImage.prototype.sWidth
  66005. * @description 从图片中裁剪的宽度,默认为图片高度。
  66006. */
  66007. _this.sWidth = sWidth;
  66008. /**
  66009. * @member {number} ShapeParametersImage.prototype.sHeight
  66010. * @description 绘制到画布上的高度,默认为图片高度。
  66011. */
  66012. _this.sHeight = sHeight;
  66013. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Image";
  66014. return _this;
  66015. }
  66016. /**
  66017. * @function ShapeParametersImage.prototype.destroy
  66018. * @description 销毁对象。
  66019. */
  66020. feature_Image_createClass(Image, [{
  66021. key: "destroy",
  66022. value: function destroy() {
  66023. this.x = null;
  66024. this.y = null;
  66025. this.image = null;
  66026. this.width = null;
  66027. this.height = null;
  66028. this.sx = null;
  66029. this.sy = null;
  66030. this.sWidth = null;
  66031. this.sHeight = null;
  66032. feature_Image_get(feature_Image_getPrototypeOf(Image.prototype), "destroy", this).call(this);
  66033. }
  66034. }]);
  66035. return Image;
  66036. }(ShapeParameters);
  66037. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Circle.js
  66038. function Circle_typeof(obj) { "@babel/helpers - typeof"; return Circle_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Circle_typeof(obj); }
  66039. function Circle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  66040. function Circle_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  66041. function Circle_createClass(Constructor, protoProps, staticProps) { if (protoProps) Circle_defineProperties(Constructor.prototype, protoProps); if (staticProps) Circle_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  66042. function Circle_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Circle_get = Reflect.get.bind(); } else { Circle_get = function _get(target, property, receiver) { var base = Circle_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Circle_get.apply(this, arguments); }
  66043. function Circle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Circle_getPrototypeOf(object); if (object === null) break; } return object; }
  66044. function Circle_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Circle_setPrototypeOf(subClass, superClass); }
  66045. function Circle_setPrototypeOf(o, p) { Circle_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Circle_setPrototypeOf(o, p); }
  66046. function Circle_createSuper(Derived) { var hasNativeReflectConstruct = Circle_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Circle_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Circle_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Circle_possibleConstructorReturn(this, result); }; }
  66047. function Circle_possibleConstructorReturn(self, call) { if (call && (Circle_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Circle_assertThisInitialized(self); }
  66048. function Circle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  66049. function Circle_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  66050. function Circle_getPrototypeOf(o) { Circle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Circle_getPrototypeOf(o); }
  66051. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  66052. * This program are made available under the terms of the Apache License, Version 2.0
  66053. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66054. /**
  66055. * @class ShapeParametersCircle
  66056. * @aliasclass Feature.ShapeParameters.Circle
  66057. * @deprecatedclass SuperMap.Feature.ShapeParameters.Circle
  66058. * @classdesc 圆形参数对象。
  66059. * @category Visualization Theme
  66060. * @extends {ShapeParameters}
  66061. * @param {number} x - 圆心 x 坐标。
  66062. * @param {number} y - 圆心 y 坐标。
  66063. * @param {number} r - 圆半径。
  66064. * @usage
  66065. */
  66066. var Circle_Circle = /*#__PURE__*/function (_ShapeParameters) {
  66067. Circle_inherits(Circle, _ShapeParameters);
  66068. var _super = Circle_createSuper(Circle);
  66069. function Circle(x, y, r) {
  66070. var _this;
  66071. Circle_classCallCheck(this, Circle);
  66072. _this = _super.call(this, x, y, r);
  66073. /**
  66074. * @member {number} ShapeParametersCircle.prototype.x
  66075. * @description 圆心 x 坐标。
  66076. */
  66077. _this.x = !isNaN(x) ? x : 0;
  66078. /**
  66079. * @member {number} ShapeParametersCircle.prototype.y
  66080. * @description 圆心 y 坐标。
  66081. */
  66082. _this.y = !isNaN(y) ? y : 0;
  66083. /**
  66084. * @member {number} ShapeParametersCircle.prototype.r
  66085. * @description 圆半径。
  66086. */
  66087. _this.r = !isNaN(r) ? r : 0;
  66088. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Circle";
  66089. return _this;
  66090. }
  66091. /**
  66092. * @function ShapeParametersCircle.prototype.destroy
  66093. * @description 销毁对象。
  66094. */
  66095. Circle_createClass(Circle, [{
  66096. key: "destroy",
  66097. value: function destroy() {
  66098. this.x = null;
  66099. this.y = null;
  66100. this.r = null;
  66101. Circle_get(Circle_getPrototypeOf(Circle.prototype), "destroy", this).call(this);
  66102. }
  66103. }]);
  66104. return Circle;
  66105. }(ShapeParameters);
  66106. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Eventful.js
  66107. function Eventful_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  66108. function Eventful_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  66109. function Eventful_createClass(Constructor, protoProps, staticProps) { if (protoProps) Eventful_defineProperties(Constructor.prototype, protoProps); if (staticProps) Eventful_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  66110. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  66111. * This program are made available under the terms of the Apache License, Version 2.0
  66112. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66113. /**
  66114. * @class LevelRenderer.Eventful
  66115. * @category Visualization Theme
  66116. * @classdesc 事件分发器超类,所有支持事件处理的类均是此类的子类。
  66117. * 此类不可实例化。
  66118. * 支持的事件:
  66119. * Symbolizer properties:
  66120. * onclick - {function} 默认值:null。
  66121. * onmouseover - {function} 默认值:null。
  66122. * onmouseout - {function} 默认值:null。
  66123. * onmousemove - {function} 默认值:null。
  66124. * onmousewheel - {function} 默认值:null。
  66125. * onmousedown - {function} 默认值:null。
  66126. * onmouseup - {function} 默认值:null。
  66127. * ondragstart - {function} 默认值:null。
  66128. * ondragend - {function} 默认值:null。
  66129. * ondragenter - {function} 默认值:null。
  66130. * ondragleave - {function} 默认值:null。
  66131. * ondragover - {function} 默认值:null。
  66132. * ondrop - {function} 默认值:null。
  66133. * @private
  66134. */
  66135. var Eventful = /*#__PURE__*/function () {
  66136. function Eventful() {
  66137. Eventful_classCallCheck(this, Eventful);
  66138. /**
  66139. * @member {Object} LevelRenderer.Eventful.prototype._handlers
  66140. * @description 事件处理对象(事件分发器)。
  66141. */
  66142. this._handlers = {};
  66143. this.CLASS_NAME = "SuperMap.LevelRenderer.Eventful";
  66144. }
  66145. /**
  66146. * @function {Object} LevelRenderer.Eventful.prototype.destroy
  66147. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  66148. */
  66149. Eventful_createClass(Eventful, [{
  66150. key: "destroy",
  66151. value: function destroy() {
  66152. this._handlers = null;
  66153. }
  66154. /**
  66155. * @function LevelRenderer.Eventful.prototype.one
  66156. * @description 单次触发绑定,dispatch后销毁。
  66157. * @param {string} event - 事件名。
  66158. * @param {boolean} handler - 响应函数。
  66159. * @param {Object} context - context。
  66160. * @returns {LevelRenderer.Eventful} this
  66161. */
  66162. }, {
  66163. key: "one",
  66164. value: function one(event, handler, context) {
  66165. var _h = this._handlers;
  66166. if (!handler || !event) {
  66167. return this;
  66168. }
  66169. if (!_h[event]) {
  66170. _h[event] = [];
  66171. }
  66172. _h[event].push({
  66173. h: handler,
  66174. one: true,
  66175. ctx: context || this
  66176. });
  66177. return this;
  66178. }
  66179. /**
  66180. * @function LevelRenderer.Eventful.prototype.bind
  66181. * @description 绑定事件。
  66182. * @param {string} event - 事件名。
  66183. * @param {boolean} handler - 响应函数。
  66184. * @param {Object} context - context。
  66185. * @returns {LevelRenderer.Eventful} this
  66186. */
  66187. }, {
  66188. key: "bind",
  66189. value: function bind(event, handler, context) {
  66190. var _h = this._handlers;
  66191. if (!handler || !event) {
  66192. return this;
  66193. }
  66194. if (!_h[event]) {
  66195. _h[event] = [];
  66196. }
  66197. _h[event].push({
  66198. h: handler,
  66199. one: false,
  66200. ctx: context || this
  66201. });
  66202. return this;
  66203. }
  66204. /**
  66205. * @function LevelRenderer.Eventful.prototype.unbind
  66206. * @description 解绑事件。
  66207. * @param {string} event - 事件名。
  66208. * @param {boolean} handler - 响应函数。
  66209. * @returns {LevelRenderer.Eventful} this
  66210. */
  66211. }, {
  66212. key: "unbind",
  66213. value: function unbind(event, handler) {
  66214. var _h = this._handlers;
  66215. if (!event) {
  66216. this._handlers = {};
  66217. return this;
  66218. }
  66219. if (handler) {
  66220. if (_h[event]) {
  66221. var newList = [];
  66222. for (var i = 0, l = _h[event].length; i < l; i++) {
  66223. if (_h[event][i]['h'] != handler) {
  66224. newList.push(_h[event][i]);
  66225. }
  66226. }
  66227. _h[event] = newList;
  66228. }
  66229. if (_h[event] && _h[event].length === 0) {
  66230. delete _h[event];
  66231. }
  66232. } else {
  66233. delete _h[event];
  66234. }
  66235. return this;
  66236. }
  66237. /**
  66238. * @function LevelRenderer.Eventful.prototype.dispatch
  66239. * @description 事件分发。
  66240. * @param {string} type - 事件类型。
  66241. * @returns {LevelRenderer.Eventful} this
  66242. */
  66243. }, {
  66244. key: "dispatch",
  66245. value: function dispatch(type) {
  66246. if (this._handlers[type]) {
  66247. var args = arguments;
  66248. var argLen = args.length;
  66249. if (argLen > 3) {
  66250. args = Array.prototype.slice.call(args, 1);
  66251. }
  66252. var _h = this._handlers[type];
  66253. var len = _h.length;
  66254. for (var i = 0; i < len;) {
  66255. // Optimize advise from backbone
  66256. switch (argLen) {
  66257. case 1:
  66258. _h[i]['h'].call(_h[i]['ctx']);
  66259. break;
  66260. case 2:
  66261. _h[i]['h'].call(_h[i]['ctx'], args[1]);
  66262. break;
  66263. case 3:
  66264. _h[i]['h'].call(_h[i]['ctx'], args[1], args[2]);
  66265. break;
  66266. default:
  66267. // have more than 2 given arguments
  66268. _h[i]['h'].apply(_h[i]['ctx'], args);
  66269. break;
  66270. }
  66271. if (_h[i]['one']) {
  66272. _h.splice(i, 1);
  66273. len--;
  66274. } else {
  66275. i++;
  66276. }
  66277. }
  66278. }
  66279. return this;
  66280. }
  66281. /**
  66282. * @function LevelRenderer.Eventful.prototype.dispatchWithContext
  66283. * @description 带有context的事件分发,最后一个参数是事件回调的 context。
  66284. * @param {string} type - 事件类型。
  66285. * @returns {LevelRenderer.Eventful} this
  66286. */
  66287. }, {
  66288. key: "dispatchWithContext",
  66289. value: function dispatchWithContext(type) {
  66290. if (this._handlers[type]) {
  66291. var args = arguments;
  66292. var argLen = args.length;
  66293. if (argLen > 4) {
  66294. args = Array.prototype.slice.call(args, 1, args.length - 1);
  66295. }
  66296. var ctx = args[args.length - 1];
  66297. var _h = this._handlers[type];
  66298. var len = _h.length;
  66299. for (var i = 0; i < len;) {
  66300. // Optimize advise from backbone
  66301. switch (argLen) {
  66302. case 1:
  66303. _h[i]['h'].call(ctx);
  66304. break;
  66305. case 2:
  66306. _h[i]['h'].call(ctx, args[1]);
  66307. break;
  66308. case 3:
  66309. _h[i]['h'].call(ctx, args[1], args[2]);
  66310. break;
  66311. default:
  66312. // have more than 2 given arguments
  66313. _h[i]['h'].apply(ctx, args);
  66314. break;
  66315. }
  66316. if (_h[i]['one']) {
  66317. _h.splice(i, 1);
  66318. len--;
  66319. } else {
  66320. i++;
  66321. }
  66322. }
  66323. }
  66324. return this;
  66325. }
  66326. }]);
  66327. return Eventful;
  66328. }();
  66329. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Vector.js
  66330. function levelRenderer_Vector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  66331. function levelRenderer_Vector_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  66332. function levelRenderer_Vector_createClass(Constructor, protoProps, staticProps) { if (protoProps) levelRenderer_Vector_defineProperties(Constructor.prototype, protoProps); if (staticProps) levelRenderer_Vector_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  66333. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  66334. * This program are made available under the terms of the Apache License, Version 2.0
  66335. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66336. /**
  66337. * @private
  66338. * @class LevelRenderer.Tool.Vector
  66339. * @category Visualization Theme
  66340. * @classdesc LevelRenderer 二维向量类
  66341. *
  66342. */
  66343. var levelRenderer_Vector_Vector = /*#__PURE__*/function () {
  66344. function Vector() {
  66345. levelRenderer_Vector_classCallCheck(this, Vector);
  66346. this.ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array;
  66347. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Vector";
  66348. }
  66349. /**
  66350. * @function LevelRenderer.Tool.Vector.prototype.create
  66351. * @description 创建一个向量。
  66352. *
  66353. * @param {number} x - x坐标
  66354. * @param {number} y - Y坐标
  66355. * @return {Vector2} 向量。
  66356. */
  66357. levelRenderer_Vector_createClass(Vector, [{
  66358. key: "create",
  66359. value: function create(x, y) {
  66360. var ArrayCtor = this.ArrayCtor;
  66361. var out = new ArrayCtor(2);
  66362. out[0] = x || 0;
  66363. out[1] = y || 0;
  66364. return out;
  66365. }
  66366. /**
  66367. * @function LevelRenderer.Tool.Vector.prototype.copy
  66368. * @description 复制一个向量。
  66369. *
  66370. * @param {Vector2} out - 基础向量。
  66371. * @param {Vector2} v - 向量。
  66372. * @return {Vector2} 克隆向量。
  66373. */
  66374. }, {
  66375. key: "copy",
  66376. value: function copy(out, v) {
  66377. out[0] = v[0];
  66378. out[1] = v[1];
  66379. return out;
  66380. }
  66381. /**
  66382. * @function LevelRenderer.Tool.Vector.prototype.set
  66383. * @description 设置向量的两个项。
  66384. *
  66385. * @param {Vector2} out - 基础向量。
  66386. * @param {number} a - 项 a。
  66387. * @param {number} b - 项 b。
  66388. * @return {Vector2} 结果。
  66389. */
  66390. }, {
  66391. key: "set",
  66392. value: function set(out, a, b) {
  66393. out[0] = a;
  66394. out[1] = b;
  66395. return out;
  66396. }
  66397. /**
  66398. * @function LevelRenderer.Tool.Vector.prototype.add
  66399. * @description 向量相加。
  66400. *
  66401. * @param {Vector2} out - 基础向量。
  66402. * @param {Vector2} v1 - 向量 v1。
  66403. * @param {Vector2} v2 - 向量 v2。
  66404. * @return {Vector2} 结果。
  66405. */
  66406. }, {
  66407. key: "add",
  66408. value: function add(out, v1, v2) {
  66409. out[0] = v1[0] + v2[0];
  66410. out[1] = v1[1] + v2[1];
  66411. return out;
  66412. }
  66413. /**
  66414. * @function LevelRenderer.Tool.Vector.prototype.scaleAndAdd
  66415. * @description 向量缩放后相加。
  66416. * @param {Vector2} out - 基础向量。
  66417. * @param {Vector2} v1 - 向量 v1。
  66418. * @param {Vector2} v2 - 向量 v2(缩放向量)。
  66419. * @param {number} a - 缩放参数。
  66420. * @return {Vector2} 结果。
  66421. */
  66422. }, {
  66423. key: "scaleAndAdd",
  66424. value: function scaleAndAdd(out, v1, v2, a) {
  66425. out[0] = v1[0] + v2[0] * a;
  66426. out[1] = v1[1] + v2[1] * a;
  66427. return out;
  66428. }
  66429. /**
  66430. * @function LevelRenderer.Tool.Vector.prototype.sub
  66431. * @description 向量相减。
  66432. * @param {Vector2} out - 基础向量。
  66433. * @param {Vector2} v1 - 向量 v1。
  66434. * @param {Vector2} v2 - 向量 v2。
  66435. * @return {Vector2} 结果。
  66436. */
  66437. }, {
  66438. key: "sub",
  66439. value: function sub(out, v1, v2) {
  66440. out[0] = v1[0] - v2[0];
  66441. out[1] = v1[1] - v2[1];
  66442. return out;
  66443. }
  66444. /**
  66445. * @function LevelRenderer.Tool.Vector.prototype.len
  66446. * @description 向量长度。
  66447. * @param {Vector2} v - 向量。
  66448. * @return {number} 向量长度。
  66449. */
  66450. }, {
  66451. key: "len",
  66452. value: function len(v) {
  66453. return Math.sqrt(this.lenSquare(v));
  66454. }
  66455. /**
  66456. * @function LevelRenderer.Tool.Vector.prototype.lenSquare
  66457. * @description 向量长度平方。
  66458. * @param {Vector2} v - 向量。
  66459. * @return {number} 向量长度平方。
  66460. */
  66461. }, {
  66462. key: "lenSquare",
  66463. value: function lenSquare(v) {
  66464. return v[0] * v[0] + v[1] * v[1];
  66465. }
  66466. /**
  66467. * @function LevelRenderer.Tool.Vector.prototype.mul
  66468. * @description 向量乘法。
  66469. * @param {Vector2} out - 基础向量。
  66470. * @param {Vector2} v1 - 向量 v1。
  66471. * @param {Vector2} v2 - 向量 v2。
  66472. * @return {Vector2} 结果。
  66473. */
  66474. }, {
  66475. key: "mul",
  66476. value: function mul(out, v1, v2) {
  66477. out[0] = v1[0] * v2[0];
  66478. out[1] = v1[1] * v2[1];
  66479. return out;
  66480. }
  66481. /**
  66482. * @function LevelRenderer.Tool.Vector.prototype.div
  66483. * @description 向量除法。
  66484. *
  66485. * @param {Vector2} out - 基础向量。
  66486. * @param {Vector2} v1 - 向量 v1。
  66487. * @param {Vector2} v2 - 向量 v2。
  66488. * @return {Vector2} 结果。
  66489. */
  66490. }, {
  66491. key: "div",
  66492. value: function div(out, v1, v2) {
  66493. out[0] = v1[0] / v2[0];
  66494. out[1] = v1[1] / v2[1];
  66495. return out;
  66496. }
  66497. /**
  66498. * @function LevelRenderer.Tool.Vector.prototype.dot
  66499. * @description 向量点乘。
  66500. *
  66501. * @param {Vector2} v1 - 向量 v1。
  66502. * @param {Vector2} v2 - 向量 v2。
  66503. * @return {number} 向量点乘。
  66504. */
  66505. }, {
  66506. key: "dot",
  66507. value: function dot(v1, v2) {
  66508. return v1[0] * v2[0] + v1[1] * v2[1];
  66509. }
  66510. /**
  66511. * @function LevelRenderer.Tool.Vector.prototype.scale
  66512. * @description 向量缩放。
  66513. *
  66514. * @param {Vector2} out - 基础向量。
  66515. * @param {Vector2} v - 向量v。
  66516. * @param {number} s -缩放参数。
  66517. * @return {Vector2} 结果。
  66518. */
  66519. }, {
  66520. key: "scale",
  66521. value: function scale(out, v, s) {
  66522. out[0] = v[0] * s;
  66523. out[1] = v[1] * s;
  66524. return out;
  66525. }
  66526. /**
  66527. * @function LevelRenderer.Tool.Vector.prototype.normalize
  66528. * @description 向量归一化。
  66529. *
  66530. * @param {Vector2} out - 基础向量。
  66531. * @param {Vector2} v - 向量 v。
  66532. * @return {Vector2} 结果。
  66533. */
  66534. }, {
  66535. key: "normalize",
  66536. value: function normalize(out, v) {
  66537. var d = this.len(v);
  66538. if (d === 0) {
  66539. out[0] = 0;
  66540. out[1] = 0;
  66541. } else {
  66542. out[0] = v[0] / d;
  66543. out[1] = v[1] / d;
  66544. }
  66545. return out;
  66546. }
  66547. /**
  66548. * @function LevelRenderer.Tool.Vector.prototype.distance
  66549. * @description 计算向量间距离。
  66550. *
  66551. * @param {Vector2} v1 - 向量 v1。
  66552. * @param {Vector2} v2 - 向量 v2。
  66553. * @return {number} 向量间距离。
  66554. */
  66555. }, {
  66556. key: "distance",
  66557. value: function distance(v1, v2) {
  66558. return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]));
  66559. }
  66560. /**
  66561. * @function LevelRenderer.Tool.Vector.prototype.distanceSquare
  66562. * @description 向量距离平方。
  66563. *
  66564. * @param {Vector2} v1 - 向量 v1。
  66565. * @param {Vector2} v2 - 向量 v2。
  66566. * @return {number} 向量距离平方。
  66567. */
  66568. }, {
  66569. key: "distanceSquare",
  66570. value: function distanceSquare(v1, v2) {
  66571. return (v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]);
  66572. }
  66573. /**
  66574. * @function LevelRenderer.Tool.Vector.prototype.negate
  66575. * @description 求负向量。
  66576. *
  66577. * @param {Vector2} out - 基础向量。
  66578. * @param {Vector2} v - 向量 v。
  66579. * @return {Vector2} 负向量。
  66580. */
  66581. }, {
  66582. key: "negate",
  66583. value: function negate(out, v) {
  66584. out[0] = -v[0];
  66585. out[1] = -v[1];
  66586. return out;
  66587. }
  66588. /**
  66589. * @function LevelRenderer.Tool.Vector.prototype.lerp
  66590. * @description 两点之间线性插值。
  66591. *
  66592. * @param {Vector2} out - 基础向量。
  66593. * @param {Vector2} v1 - 向量 v1。
  66594. * @param {Vector2} v2 - 向量 v2。
  66595. * @param {number} t
  66596. * @return {Vector2} 结果。
  66597. */
  66598. }, {
  66599. key: "lerp",
  66600. value: function lerp(out, v1, v2, t) {
  66601. out[0] = v1[0] + t * (v2[0] - v1[0]);
  66602. out[1] = v1[1] + t * (v2[1] - v1[1]);
  66603. return out;
  66604. }
  66605. /**
  66606. * @function LevelRenderer.Tool.Vector.prototype.applyTransform
  66607. * @description 矩阵左乘向量。
  66608. *
  66609. * @param {Vector2} out - 基础向量。
  66610. * @param {Vector2} v1 - 向量 v1。
  66611. * @param {Vector2} v2 - 向量 v2。
  66612. * @return {Vector2} 结果。
  66613. */
  66614. }, {
  66615. key: "applyTransform",
  66616. value: function applyTransform(out, v, m) {
  66617. var x = v[0];
  66618. var y = v[1];
  66619. out[0] = m[0] * x + m[2] * y + m[4];
  66620. out[1] = m[1] * x + m[3] * y + m[5];
  66621. return out;
  66622. }
  66623. /**
  66624. * @function LevelRenderer.Tool.Vector.prototype.min
  66625. * @description 求两个向量最小值。
  66626. * @param {Vector2} out - 基础向量。
  66627. * @param {Vector2} v1 - 向量 v1。
  66628. * @param {Vector2} v2 - 向量 v2。
  66629. * @return {Vector2} 结果。
  66630. */
  66631. }, {
  66632. key: "min",
  66633. value: function min(out, v1, v2) {
  66634. out[0] = Math.min(v1[0], v2[0]);
  66635. out[1] = Math.min(v1[1], v2[1]);
  66636. return out;
  66637. }
  66638. /**
  66639. * @function LevelRenderer.Tool.Vector.prototype.max
  66640. * @description 求两个向量最大值。
  66641. *
  66642. * @param {Vector2} out - 基础向量。
  66643. * @param {Vector2} v1 - 向量 v1。
  66644. * @param {Vector2} v2 - 向量 v2。
  66645. * @return {Vector2} 结果。
  66646. */
  66647. }, {
  66648. key: "max",
  66649. value: function max(out, v1, v2) {
  66650. out[0] = Math.max(v1[0], v2[0]);
  66651. out[1] = Math.max(v1[1], v2[1]);
  66652. return out;
  66653. }
  66654. /**
  66655. * @function LevelRenderer.Tool.Vector.prototype.length
  66656. * @description 向量长度。
  66657. *
  66658. * @param {Vector2} v - 向量。
  66659. * @return {number} 向量长度。
  66660. */
  66661. }, {
  66662. key: "length",
  66663. value: function length(v) {
  66664. return this.len(v);
  66665. }
  66666. /**
  66667. * @function LevelRenderer.Tool.Vector.prototype.lengthSquare
  66668. * @description 向量长度平方。
  66669. *
  66670. * @param {Vector2} v - 向量。
  66671. * @return {number} 向量长度平方。
  66672. */
  66673. }, {
  66674. key: "lengthSquare",
  66675. value: function lengthSquare(v) {
  66676. return this.lenSquare(v);
  66677. }
  66678. /**
  66679. * @function LevelRenderer.Tool.Vector.prototype.dist
  66680. * @description 计算向量间距离。
  66681. *
  66682. * @param {Vector2} v1 - 向量 v1。
  66683. * @param {Vector2} v2 - 向量 v2。
  66684. * @return {number} 向量间距离。
  66685. */
  66686. }, {
  66687. key: "dist",
  66688. value: function dist(v1, v2) {
  66689. return this.distance(v1, v2);
  66690. }
  66691. /**
  66692. * @function LevelRenderer.Tool.Vector.prototype.distSquare
  66693. * @description 向量距离平方。
  66694. *
  66695. * @param {Vector2} v1 - 向量 v1。
  66696. * @param {Vector2} v2 - 向量 v2。
  66697. * @return {number} 向量距离平方
  66698. */
  66699. }, {
  66700. key: "distSquare",
  66701. value: function distSquare(v1, v2) {
  66702. return this.distanceSquare(v1, v2);
  66703. }
  66704. }]);
  66705. return Vector;
  66706. }();
  66707. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Curve.js
  66708. function levelRenderer_Curve_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  66709. function levelRenderer_Curve_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  66710. function levelRenderer_Curve_createClass(Constructor, protoProps, staticProps) { if (protoProps) levelRenderer_Curve_defineProperties(Constructor.prototype, protoProps); if (staticProps) levelRenderer_Curve_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  66711. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  66712. * This program are made available under the terms of the Apache License, Version 2.0
  66713. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66714. /**
  66715. * @class LevelRenderer.Tool.Curve
  66716. * @category Visualization Theme
  66717. * @classdesc LevelRenderer 工具-曲线
  66718. * @private
  66719. */
  66720. var Curve_Curve = /*#__PURE__*/function () {
  66721. function Curve() {
  66722. levelRenderer_Curve_classCallCheck(this, Curve);
  66723. /**
  66724. * @member {LevelRenderer.Tool.Vector} LevelRenderer.Tool.Curve.prototype.vector
  66725. * @description 矢量工具。
  66726. */
  66727. this.vector = new levelRenderer_Vector_Vector();
  66728. /**
  66729. * @member {number} LevelRenderer.Tool.Curve.prototype.EPSILON
  66730. * @description e。
  66731. */
  66732. this.EPSILON = 1e-4;
  66733. /**
  66734. * @member {number} LevelRenderer.Tool.Curve.prototype.THREE_SQRT
  66735. * @description 3 的平方根。
  66736. */
  66737. this.THREE_SQRT = Math.sqrt(3);
  66738. /**
  66739. * @member {number} LevelRenderer.Tool.Curve.prototype.ONE_THIRD
  66740. * @description 1/3。
  66741. */
  66742. this.ONE_THIRD = 1 / 3;
  66743. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Curve";
  66744. }
  66745. /*
  66746. * Method: evalCubicCoeff
  66747. *
  66748. * Parameters:
  66749. * a - {number} 值。
  66750. * b - {number} 值。
  66751. * c - {number} 值。
  66752. * d - {number} 值。
  66753. * t - {number} 值。
  66754. *
  66755. * Returns:
  66756. * {number}
  66757. */
  66758. /*
  66759. evalCubicCoeff: function(a, b, c, d, t){
  66760. return ((a * t + b) * t + c) * t + d;
  66761. },
  66762. */
  66763. /**
  66764. * @function LevelRenderer.Tool.Curve.prototype.isAroundZero
  66765. * @description 判断一个值是否趋于0,判断参考值:1e-4。
  66766. * @param {number} val - 值。
  66767. * @returns {boolean} 值是否趋于0。
  66768. */
  66769. levelRenderer_Curve_createClass(Curve, [{
  66770. key: "isAroundZero",
  66771. value: function isAroundZero(val) {
  66772. return val > -this.EPSILON && val < this.EPSILON;
  66773. }
  66774. /**
  66775. * @function LevelRenderer.Tool.Curve.prototype.isNotAroundZero
  66776. * @description 判断一个值是否不趋于0,判断参考值:1e-4。
  66777. * @param {number} val - 值。
  66778. * @returns {boolean} 值是否不趋于0。
  66779. */
  66780. }, {
  66781. key: "isNotAroundZero",
  66782. value: function isNotAroundZero(val) {
  66783. return val > this.EPSILON || val < -this.EPSILON;
  66784. }
  66785. /**
  66786. * @function LevelRenderer.Tool.Curve.prototype.cubicAt
  66787. * @description 计算三次贝塞尔值
  66788. * @param {number} p0 - 点p0。
  66789. * @param {number} p1 - 点p1。
  66790. * @param {number} p2 - 点p2。
  66791. * @param {number} p3 - 点p3。
  66792. * @param {number} t - t值。
  66793. * @returns {number} 三次贝塞尔值。
  66794. */
  66795. }, {
  66796. key: "cubicAt",
  66797. value: function cubicAt(p0, p1, p2, p3, t) {
  66798. var onet = 1 - t;
  66799. return onet * onet * (onet * p0 + 3 * t * p1) + t * t * (t * p3 + 3 * onet * p2);
  66800. }
  66801. /**
  66802. * @function LevelRenderer.Tool.Curve.prototype.cubicDerivativeAt
  66803. * @description 计算三次贝塞尔导数值
  66804. * @param {number} p0 - 点p0。
  66805. * @param {number} p1 - 点p1。
  66806. * @param {number} p2 - 点p2。
  66807. * @param {number} p3 - 点p3。
  66808. * @param {number} t - t值。
  66809. * @returns {number} 三次贝塞尔导数值。
  66810. */
  66811. }, {
  66812. key: "cubicDerivativeAt",
  66813. value: function cubicDerivativeAt(p0, p1, p2, p3, t) {
  66814. var onet = 1 - t;
  66815. return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet + (p3 - p2) * t * t);
  66816. }
  66817. /**
  66818. * @function LevelRenderer.Tool.Curve.prototype.cubicRootAt
  66819. * @description 计算三次贝塞尔方程根,使用盛金公式
  66820. * @param {number} p0 - 点p0。
  66821. * @param {number} p1 - 点p1。
  66822. * @param {number} p2 - 点p2。
  66823. * @param {number} p3 - 点p3。
  66824. * @param {number} val - 值。
  66825. * @param {Array.<number>} roots - 有效根数目。
  66826. * @returns {number} 有效根。
  66827. */
  66828. }, {
  66829. key: "cubicRootAt",
  66830. value: function cubicRootAt(p0, p1, p2, p3, val, roots) {
  66831. // Evaluate roots of cubic functions
  66832. var a = p3 + 3 * (p1 - p2) - p0;
  66833. var b = 3 * (p2 - p1 * 2 + p0);
  66834. var c = 3 * (p1 - p0);
  66835. var d = p0 - val;
  66836. var A = b * b - 3 * a * c;
  66837. var B = b * c - 9 * a * d;
  66838. var C = c * c - 3 * b * d;
  66839. var n = 0;
  66840. if (this.isAroundZero(A) && this.isAroundZero(B)) {
  66841. if (this.isAroundZero(b)) {
  66842. roots[0] = 0;
  66843. } else {
  66844. var t1 = -c / b; //t1, t2, t3, b is not zero
  66845. if (t1 >= 0 && t1 <= 1) {
  66846. roots[n++] = t1;
  66847. }
  66848. }
  66849. } else {
  66850. var disc = B * B - 4 * A * C;
  66851. if (this.isAroundZero(disc)) {
  66852. var K = B / A;
  66853. var _t2 = -b / a + K; // t1, a is not zero
  66854. var t2 = -K / 2; // t2, t3
  66855. if (_t2 >= 0 && _t2 <= 1) {
  66856. roots[n++] = _t2;
  66857. }
  66858. if (t2 >= 0 && t2 <= 1) {
  66859. roots[n++] = t2;
  66860. }
  66861. } else if (disc > 0) {
  66862. var discSqrt = Math.sqrt(disc);
  66863. var Y1 = A * b + 1.5 * a * (-B + discSqrt);
  66864. var Y2 = A * b + 1.5 * a * (-B - discSqrt);
  66865. if (Y1 < 0) {
  66866. Y1 = -Math.pow(-Y1, this.ONE_THIRD);
  66867. } else {
  66868. Y1 = Math.pow(Y1, this.ONE_THIRD);
  66869. }
  66870. if (Y2 < 0) {
  66871. Y2 = -Math.pow(-Y2, this.ONE_THIRD);
  66872. } else {
  66873. Y2 = Math.pow(Y2, this.ONE_THIRD);
  66874. }
  66875. var _t3 = (-b - (Y1 + Y2)) / (3 * a);
  66876. if (_t3 >= 0 && _t3 <= 1) {
  66877. roots[n++] = _t3;
  66878. }
  66879. } else {
  66880. var T = (2 * A * b - 3 * a * B) / (2 * Math.sqrt(A * A * A));
  66881. var theta = Math.acos(T) / 3;
  66882. var ASqrt = Math.sqrt(A);
  66883. var tmp = Math.cos(theta);
  66884. var _t4 = (-b - 2 * ASqrt * tmp) / (3 * a);
  66885. var _t5 = (-b + ASqrt * (tmp + this.THREE_SQRT * Math.sin(theta))) / (3 * a);
  66886. var t3 = (-b + ASqrt * (tmp - this.THREE_SQRT * Math.sin(theta))) / (3 * a);
  66887. if (_t4 >= 0 && _t4 <= 1) {
  66888. roots[n++] = _t4;
  66889. }
  66890. if (_t5 >= 0 && _t5 <= 1) {
  66891. roots[n++] = _t5;
  66892. }
  66893. if (t3 >= 0 && t3 <= 1) {
  66894. roots[n++] = t3;
  66895. }
  66896. }
  66897. }
  66898. return n;
  66899. }
  66900. /**
  66901. * @function LevelRenderer.Tool.Curve.prototype.cubicRootAt
  66902. * @description 计算三次贝塞尔方程极限值的位置
  66903. * @param {number} p0 - 点p0。
  66904. * @param {number} p1 - 点p1。
  66905. * @param {number} p2 - 点p2。
  66906. * @param {number} p3 - 点p3。
  66907. * @param {Array.<number>} extrema - 值。
  66908. * @returns {number} 有效数目。
  66909. */
  66910. }, {
  66911. key: "cubicExtrema",
  66912. value: function cubicExtrema(p0, p1, p2, p3, extrema) {
  66913. var b = 6 * p2 - 12 * p1 + 6 * p0;
  66914. var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2;
  66915. var c = 3 * p1 - 3 * p0;
  66916. var n = 0;
  66917. if (this.isAroundZero(a)) {
  66918. if (this.isNotAroundZero(b)) {
  66919. var t1 = -c / b;
  66920. if (t1 >= 0 && t1 <= 1) {
  66921. extrema[n++] = t1;
  66922. }
  66923. }
  66924. } else {
  66925. var disc = b * b - 4 * a * c;
  66926. if (this.isAroundZero(disc)) {
  66927. extrema[0] = -b / (2 * a);
  66928. } else if (disc > 0) {
  66929. var discSqrt = Math.sqrt(disc);
  66930. var _t6 = (-b + discSqrt) / (2 * a);
  66931. var t2 = (-b - discSqrt) / (2 * a);
  66932. if (_t6 >= 0 && _t6 <= 1) {
  66933. extrema[n++] = _t6;
  66934. }
  66935. if (t2 >= 0 && t2 <= 1) {
  66936. extrema[n++] = t2;
  66937. }
  66938. }
  66939. }
  66940. return n;
  66941. }
  66942. /**
  66943. * @function LevelRenderer.Tool.Curve.prototype.cubicSubdivide
  66944. * @description 细分三次贝塞尔曲线
  66945. * @param {number} p0 - 点p0。
  66946. * @param {number} p1 - 点p1。
  66947. * @param {number} p2 - 点p2。
  66948. * @param {number} p3 - 点p3。
  66949. * @param {number} t - t值。
  66950. * @param {Array.<number>} out - 投射点。
  66951. * @returns {number} 投射点。
  66952. */
  66953. }, {
  66954. key: "cubicSubdivide",
  66955. value: function cubicSubdivide(p0, p1, p2, p3, t, out) {
  66956. var p01 = (p1 - p0) * t + p0;
  66957. var p12 = (p2 - p1) * t + p1;
  66958. var p23 = (p3 - p2) * t + p2;
  66959. var p012 = (p12 - p01) * t + p01;
  66960. var p123 = (p23 - p12) * t + p12;
  66961. var p0123 = (p123 - p012) * t + p012;
  66962. // Seg0
  66963. out[0] = p0;
  66964. out[1] = p01;
  66965. out[2] = p012;
  66966. out[3] = p0123;
  66967. // Seg1
  66968. out[4] = p0123;
  66969. out[5] = p123;
  66970. out[6] = p23;
  66971. out[7] = p3;
  66972. }
  66973. /**
  66974. * @function LevelRenderer.Tool.Curve.prototype.cubicProjectPoint
  66975. * @description 投射点到三次贝塞尔曲线上,返回投射距离。投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。
  66976. * @param {number} x0 - 点p0横坐标。
  66977. * @param {number} y0 - 点p0纵坐标。
  66978. * @param {number} x1 - 点p1横坐标。
  66979. * @param {number} y1 - 点p1纵坐标。
  66980. * @param {number} x2 - 点p2横坐标。
  66981. * @param {number} y2 - 点p2纵坐标。
  66982. * @param {number} x3 - 点p3横坐标。
  66983. * @param {number} y3 - 点p3纵坐标。
  66984. * @param {number} x - 点p横坐标。
  66985. * @param {number} y - 点p纵坐标。
  66986. * @param {Array.<number>} out - 投射点。
  66987. * @returns {number} 投射点。
  66988. */
  66989. }, {
  66990. key: "cubicProjectPoint",
  66991. value: function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {
  66992. // 临时变量
  66993. var _v0 = this.vector.create();
  66994. var _v1 = this.vector.create();
  66995. var _v2 = this.vector.create();
  66996. // var _v3 = vector.create();
  66997. // http://pomax.github.io/bezierinfo/#projections
  66998. var t;
  66999. var interval = 0.005;
  67000. var d = Infinity;
  67001. _v0[0] = x;
  67002. _v0[1] = y;
  67003. // 先粗略估计一下可能的最小距离的 t 值
  67004. // PENDING
  67005. for (var _t = 0; _t < 1; _t += 0.05) {
  67006. _v1[0] = this.cubicAt(x0, x1, x2, x3, _t);
  67007. _v1[1] = this.cubicAt(y0, y1, y2, y3, _t);
  67008. var d1 = this.vector.distSquare(_v0, _v1);
  67009. if (d1 < d) {
  67010. t = _t;
  67011. d = d1;
  67012. }
  67013. }
  67014. d = Infinity;
  67015. // At most 32 iteration
  67016. for (var i = 0; i < 32; i++) {
  67017. if (interval < this.EPSILON) {
  67018. break;
  67019. }
  67020. var prev = t - interval;
  67021. var next = t + interval;
  67022. // t - interval
  67023. _v1[0] = this.cubicAt(x0, x1, x2, x3, prev);
  67024. _v1[1] = this.cubicAt(y0, y1, y2, y3, prev);
  67025. var _d = this.vector.distSquare(_v1, _v0);
  67026. if (prev >= 0 && _d < d) {
  67027. t = prev;
  67028. d = _d;
  67029. } else {
  67030. // t + interval
  67031. _v2[0] = this.cubicAt(x0, x1, x2, x3, next);
  67032. _v2[1] = this.cubicAt(y0, y1, y2, y3, next);
  67033. var d2 = this.vector.distSquare(_v2, _v0);
  67034. if (next <= 1 && d2 < d) {
  67035. t = next;
  67036. d = d2;
  67037. } else {
  67038. interval *= 0.5;
  67039. }
  67040. }
  67041. }
  67042. // t
  67043. if (out) {
  67044. out[0] = this.cubicAt(x0, x1, x2, x3, t);
  67045. out[1] = this.cubicAt(y0, y1, y2, y3, t);
  67046. }
  67047. // console.log(interval, i);
  67048. return Math.sqrt(d);
  67049. }
  67050. /**
  67051. * @function LevelRenderer.Tool.Curve.prototype.quadraticAt
  67052. * @description 计算二次方贝塞尔值。
  67053. * @param {number} p0 - 点p0。
  67054. * @param {number} p1 - 点p1。
  67055. * @param {number} p2 - 点p2。
  67056. * @param {number} t - t值。
  67057. * @returns {number} 二次方贝塞尔值。
  67058. */
  67059. }, {
  67060. key: "quadraticAt",
  67061. value: function quadraticAt(p0, p1, p2, t) {
  67062. var onet = 1 - t;
  67063. return onet * (onet * p0 + 2 * t * p1) + t * t * p2;
  67064. }
  67065. /**
  67066. * @function LevelRenderer.Tool.Curve.prototype.quadraticAt
  67067. * @description 计算二次方贝塞尔导数值。
  67068. * @param {number} p0 - 点p0。
  67069. * @param {number} p1 - 点p1。
  67070. * @param {number} p2 - 点p2。
  67071. * @param {number} t - t值。
  67072. * @returns {number} 二次方贝塞尔导数值。
  67073. */
  67074. }, {
  67075. key: "quadraticDerivativeAt",
  67076. value: function quadraticDerivativeAt(p0, p1, p2, t) {
  67077. return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));
  67078. }
  67079. /**
  67080. * @function LevelRenderer.Tool.Curve.prototype.quadraticRootAt
  67081. * @description 计算二次方贝塞尔方程根
  67082. * @param {number} p0 - 点p0。
  67083. * @param {number} p1 - 点p1。
  67084. * @param {number} p2 - 点p2。
  67085. * @param {number} val - 值。
  67086. * @param {Array.<number>} roots - 有效根数目。
  67087. * @returns {number} 有效根数目。
  67088. */
  67089. }, {
  67090. key: "quadraticRootAt",
  67091. value: function quadraticRootAt(p0, p1, p2, val, roots) {
  67092. var a = p0 - 2 * p1 + p2;
  67093. var b = 2 * (p1 - p0);
  67094. var c = p0 - val;
  67095. var n = 0;
  67096. if (this.isAroundZero(a)) {
  67097. if (this.isNotAroundZero(b)) {
  67098. var t1 = -c / b;
  67099. if (t1 >= 0 && t1 <= 1) {
  67100. roots[n++] = t1;
  67101. }
  67102. }
  67103. } else {
  67104. var disc = b * b - 4 * a * c;
  67105. if (this.isAroundZero(disc)) {
  67106. var _t7 = -b / (2 * a);
  67107. if (_t7 >= 0 && _t7 <= 1) {
  67108. roots[n++] = _t7;
  67109. }
  67110. } else if (disc > 0) {
  67111. var discSqrt = Math.sqrt(disc);
  67112. var _t8 = (-b + discSqrt) / (2 * a);
  67113. var t2 = (-b - discSqrt) / (2 * a);
  67114. if (_t8 >= 0 && _t8 <= 1) {
  67115. roots[n++] = _t8;
  67116. }
  67117. if (t2 >= 0 && t2 <= 1) {
  67118. roots[n++] = t2;
  67119. }
  67120. }
  67121. }
  67122. return n;
  67123. }
  67124. /**
  67125. * @function LevelRenderer.Tool.Curve.prototype.quadraticExtremum
  67126. * @description 计算二次贝塞尔方程极限值
  67127. * @param {number} p0 - 点p0。
  67128. * @param {number} p1 - 点p1。
  67129. * @param {number} p2 - 点p2。
  67130. * @returns {number} 二次贝塞尔方程极限值。
  67131. */
  67132. }, {
  67133. key: "quadraticExtremum",
  67134. value: function quadraticExtremum(p0, p1, p2) {
  67135. var divider = p0 + p2 - 2 * p1;
  67136. if (divider === 0) {
  67137. // p1 is center of p0 and p2
  67138. return 0.5;
  67139. } else {
  67140. return (p0 - p1) / divider;
  67141. }
  67142. }
  67143. /**
  67144. * @function LevelRenderer.Tool.Curve.prototype.quadraticProjectPoint
  67145. * @description 投射点到二次贝塞尔曲线上,返回投射距离。投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。
  67146. * @param {number} x0 - 点p0横坐标。
  67147. * @param {number} y0 - 点p0纵坐标。
  67148. * @param {number} x1 - 点p1横坐标。
  67149. * @param {number} y1 - 点p1纵坐标。
  67150. * @param {number} x2 - 点p2横坐标。
  67151. * @param {number} y2 - 点p2纵坐标。
  67152. * @param {number} x - 点p横坐标。
  67153. * @param {number} y - 点p纵坐标。
  67154. * @param {Array.<number>} out - 投射点。
  67155. * @returns {number} 投射距离。
  67156. */
  67157. }, {
  67158. key: "quadraticProjectPoint",
  67159. value: function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {
  67160. // 临时变量
  67161. var _v0 = this.vector.create();
  67162. var _v1 = this.vector.create();
  67163. var _v2 = this.vector.create();
  67164. // http://pomax.github.io/bezierinfo/#projections
  67165. var t;
  67166. var interval = 0.005;
  67167. var d = Infinity;
  67168. _v0[0] = x;
  67169. _v0[1] = y;
  67170. // 先粗略估计一下可能的最小距离的 t 值
  67171. // PENDING
  67172. for (var _t = 0; _t < 1; _t += 0.05) {
  67173. _v1[0] = this.quadraticAt(x0, x1, x2, _t);
  67174. _v1[1] = this.quadraticAt(y0, y1, y2, _t);
  67175. var d1 = this.vector.distSquare(_v0, _v1);
  67176. if (d1 < d) {
  67177. t = _t;
  67178. d = d1;
  67179. }
  67180. }
  67181. d = Infinity;
  67182. // At most 32 iteration
  67183. for (var i = 0; i < 32; i++) {
  67184. if (interval < this.EPSILON) {
  67185. break;
  67186. }
  67187. var prev = t - interval;
  67188. var next = t + interval;
  67189. // t - interval
  67190. _v1[0] = this.quadraticAt(x0, x1, x2, prev);
  67191. _v1[1] = this.quadraticAt(y0, y1, y2, prev);
  67192. var _d2 = this.vector.distSquare(_v1, _v0);
  67193. if (prev >= 0 && _d2 < d) {
  67194. t = prev;
  67195. d = _d2;
  67196. } else {
  67197. // t + interval
  67198. _v2[0] = this.quadraticAt(x0, x1, x2, next);
  67199. _v2[1] = this.quadraticAt(y0, y1, y2, next);
  67200. var d2 = this.vector.distSquare(_v2, _v0);
  67201. if (next <= 1 && d2 < d) {
  67202. t = next;
  67203. d = d2;
  67204. } else {
  67205. interval *= 0.5;
  67206. }
  67207. }
  67208. }
  67209. // t
  67210. if (out) {
  67211. out[0] = this.quadraticAt(x0, x1, x2, t);
  67212. out[1] = this.quadraticAt(y0, y1, y2, t);
  67213. }
  67214. // console.log(interval, i);
  67215. return Math.sqrt(d);
  67216. }
  67217. }]);
  67218. return Curve;
  67219. }();
  67220. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Area.js
  67221. function Area_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  67222. function Area_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  67223. function Area_createClass(Constructor, protoProps, staticProps) { if (protoProps) Area_defineProperties(Constructor.prototype, protoProps); if (staticProps) Area_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  67224. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  67225. * This program are made available under the terms of the Apache License, Version 2.0
  67226. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67227. /**
  67228. * @class LevelRenderer.Tool.Area
  67229. * @category Visualization Theme
  67230. * @classdesc LevelRenderer 工具-图形范围判断
  67231. * @private
  67232. */
  67233. var Area = /*#__PURE__*/function () {
  67234. function Area() {
  67235. Area_classCallCheck(this, Area);
  67236. /**
  67237. * @member {LevelRenderer.Tool.Util} LevelRenderer.Tool.Areal.prototype.util
  67238. * @description 基础工具对象。
  67239. */
  67240. this.util = new levelRenderer_Util_Util();
  67241. /**
  67242. * @member {LevelRenderer.Tool.Curve} LevelRenderer.Tool.Areal.prototype.curve
  67243. * @description 曲线工具对象
  67244. */
  67245. this.curve = new Curve_Curve();
  67246. /**
  67247. * @member {Object} LevelRenderer.Tool.Areal.prototype._ctx
  67248. * @description Cavans2D 渲染上下文
  67249. */
  67250. this._ctx = null;
  67251. /**
  67252. * @member {Object} LevelRenderer.Tool.Areal.prototype._textWidthCache
  67253. * @description 文本宽度缓存
  67254. */
  67255. this._textWidthCache = {};
  67256. /**
  67257. * @member {Object} LevelRenderer.Tool.Areal.prototype._textHeightCache
  67258. * @description 文本高度缓存
  67259. */
  67260. this._textHeightCache = {};
  67261. /**
  67262. * @member {number} LevelRenderer.Tool.Areal.prototype._textWidthCacheCounter
  67263. * @description 文本宽度缓存数量
  67264. */
  67265. this._textWidthCacheCounter = 0;
  67266. /**
  67267. * @member {number} LevelRenderer.Tool.Areal.prototype._textHeightCacheCounter
  67268. * @description 文本高度缓存数量
  67269. */
  67270. this._textHeightCacheCounter = 0;
  67271. /**
  67272. * @member {number} LevelRenderer.Tool.Areal.prototype.TEXT_CACHE_MAX
  67273. * @description 文本最大缓存数量
  67274. */
  67275. this.TEXT_CACHE_MAX = 5000;
  67276. /**
  67277. * @member {number} LevelRenderer.Tool.Areal.prototype.PI2
  67278. * @description 2*PI 的值
  67279. */
  67280. this.PI2 = Math.PI * 2;
  67281. /**
  67282. * @member {Array.<number>} LevelRenderer.Tool.Areal.prototype.roots
  67283. * @description 临时数组
  67284. */
  67285. this.roots = [-1, -1, -1];
  67286. /**
  67287. * @member {Array.<number>} LevelRenderer.Tool.Areal.prototype.extrema
  67288. * @description 临时数组
  67289. */
  67290. this.extrema = [-1, -1];
  67291. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Area";
  67292. }
  67293. /**
  67294. * @function LevelRenderer.Tool.Areal.prototype.normalizeRadian
  67295. * @description 弧度标准化函数。
  67296. * @param {number} angle - 弧度值。
  67297. * @returns {number} 标准化后的弧度值。
  67298. */
  67299. Area_createClass(Area, [{
  67300. key: "normalizeRadian",
  67301. value: function normalizeRadian(angle) {
  67302. angle %= this.PI2;
  67303. if (angle < 0) {
  67304. angle += this.PI2;
  67305. }
  67306. return angle;
  67307. }
  67308. /**
  67309. * @function LevelRenderer.Tool.Areal.prototype.isInside
  67310. * @description 包含判断。
  67311. * @param {Object} shape - 图形。
  67312. * @param {number} area - 目标区域。
  67313. * @param {number} x - 横坐标。
  67314. * @param {number} y - 纵坐标。
  67315. * @returns {boolean} 图形是否包含鼠标位置。
  67316. */
  67317. }, {
  67318. key: "isInside",
  67319. value: function isInside(shape, area, x, y) {
  67320. if (!area || !shape) {
  67321. // 无参数或不支持类型
  67322. return false;
  67323. }
  67324. var zoneType = shape.type;
  67325. this._ctx = this._ctx || this.util.getContext();
  67326. // 未实现或不可用时则数学运算,主要是line,brokenLine,ring
  67327. var _mathReturn = this._mathMethod(shape, area, x, y);
  67328. if (typeof _mathReturn != 'undefined') {
  67329. return _mathReturn;
  67330. }
  67331. if (shape.buildPath && this._ctx.isPointInPath) {
  67332. return this._buildPathMethod(shape, this._ctx, area, x, y);
  67333. }
  67334. // 上面的方法都行不通时
  67335. switch (zoneType) {
  67336. case 'ellipse': // Todo,不精确
  67337. case 'smicellipse':
  67338. // Todo,不精确
  67339. return true;
  67340. // 旋轮曲线 不准确
  67341. case 'trochoid':
  67342. var _r = area.location == 'out' ? area.r1 + area.r2 + area.d : area.r1 - area.r2 + area.d;
  67343. return this.isInsideCircle(area, x, y, _r);
  67344. // 玫瑰线 不准确
  67345. case 'rose':
  67346. return this.isInsideCircle(area, x, y, area.maxr);
  67347. // 路径,椭圆,曲线等-----------------13
  67348. default:
  67349. return false;
  67350. // Todo,暂不支持
  67351. }
  67352. }
  67353. /**
  67354. * @function LevelRenderer.Tool.Areal.prototype._mathMethod
  67355. * @description 包含判断。用数学方法判断,三个方法中最快,但是支持的shape少。
  67356. * @param {Object} shape - 图形。
  67357. * @param {number} area - 目标区域。
  67358. * @param {number} x - 横坐标。
  67359. * @param {number} y - 纵坐标。
  67360. * @returns {boolean} 图形是否包含鼠标位置,true表示坐标处在图形中。
  67361. */
  67362. }, {
  67363. key: "_mathMethod",
  67364. value: function _mathMethod(shape, area, x, y) {
  67365. var zoneType = shape.type;
  67366. // 在矩形内则部分图形需要进一步判断
  67367. switch (zoneType) {
  67368. // 贝塞尔曲线
  67369. case 'bezier-curve':
  67370. if (typeof area.cpX2 === 'undefined') {
  67371. return this.isInsideQuadraticStroke(area.xStart, area.yStart, area.cpX1, area.cpY1, area.xEnd, area.yEnd, area.lineWidth, x, y);
  67372. }
  67373. return this.isInsideCubicStroke(area.xStart, area.yStart, area.cpX1, area.cpY1, area.cpX2, area.cpY2, area.xEnd, area.yEnd, area.lineWidth, x, y);
  67374. // 线
  67375. case 'line':
  67376. return this.isInsideLine(area.xStart, area.yStart, area.xEnd, area.yEnd, area.lineWidth, x, y);
  67377. // 折线
  67378. case 'broken-line':
  67379. return this.isInsideBrokenLine(area.pointList, area.lineWidth, x, y);
  67380. // 扩展折线
  67381. case 'smicbroken-line':
  67382. {
  67383. // SMIC-修改 - start
  67384. var icX = x;
  67385. var icY = y;
  67386. if (shape.refOriginalPosition) {
  67387. icX = x - shape.refOriginalPosition[0];
  67388. icY = y - shape.refOriginalPosition[1];
  67389. }
  67390. return this.isInsideBrokenLine(area.pointList, area.lineWidth, icX, icY);
  67391. }
  67392. //初始代码:
  67393. // return isInsideBrokenLine(
  67394. // area.pointList, area.lineWidth, x, y
  67395. // );
  67396. // SMIC-修改 - end
  67397. // 圆环
  67398. case 'ring':
  67399. return this.isInsideRing(area.x, area.y, area.r0, area.r, x, y);
  67400. case 'smicring':
  67401. {
  67402. var areaX = area.x;
  67403. var areaY = area.y;
  67404. if (shape.refOriginalPosition) {
  67405. areaX = area.x + shape.refOriginalPosition[0];
  67406. areaY = area.y + shape.refOriginalPosition[1];
  67407. }
  67408. return this.isInsideRing(areaX, areaY, area.r0, area.r, x, y);
  67409. }
  67410. // 圆形
  67411. case 'circle':
  67412. return this.isInsideCircle(area.x, area.y, area.r, x, y);
  67413. // 扩展-点
  67414. case 'smicpoint':
  67415. {
  67416. // SMIC-修改 - start
  67417. var _icX = x;
  67418. var _icY = y;
  67419. if (shape.refOriginalPosition) {
  67420. _icX = x - shape.refOriginalPosition[0];
  67421. _icY = y - shape.refOriginalPosition[1];
  67422. }
  67423. return this.isInsideCircle(area.x, area.y, area.r, _icX, _icY);
  67424. }
  67425. //初始代码:
  67426. // 无
  67427. // SMIC-修改 - end
  67428. // 扇形
  67429. case 'sector':
  67430. {
  67431. var startAngle = area.startAngle * Math.PI / 180;
  67432. var endAngle = area.endAngle * Math.PI / 180;
  67433. if (!area.clockWise) {
  67434. startAngle = -startAngle;
  67435. endAngle = -endAngle;
  67436. }
  67437. return this.isInsideSector(area.x, area.y, area.r0, area.r, startAngle, endAngle, !area.clockWise, x, y);
  67438. }
  67439. //初始代码:
  67440. // 无
  67441. // SMIC-增加 - end
  67442. // 扇形
  67443. case 'smicsector':
  67444. {
  67445. var _startAngle = area.startAngle * Math.PI / 180;
  67446. var _endAngle = area.endAngle * Math.PI / 180;
  67447. if (!area.clockWise) {
  67448. _startAngle = -_startAngle;
  67449. _endAngle = -_endAngle;
  67450. }
  67451. var _areaX = area.x;
  67452. var _areaY = area.y;
  67453. if (shape.refOriginalPosition) {
  67454. _areaX = area.x + shape.refOriginalPosition[0];
  67455. _areaY = area.y + shape.refOriginalPosition[1];
  67456. }
  67457. return this.isInsideSector(_areaX, _areaY, area.r0, area.r, _startAngle, _endAngle, !area.clockWise, x, y);
  67458. }
  67459. // 多边形
  67460. case 'path':
  67461. return this.isInsidePath(area.pathArray, Math.max(area.lineWidth, 5), area.brushType, x, y);
  67462. case 'polygon':
  67463. case 'star':
  67464. case 'smicstar':
  67465. case 'isogon':
  67466. case 'smicisogon':
  67467. return this.isInsidePolygon(area.pointList, x, y);
  67468. // 扩展多边形
  67469. case 'smicpolygon':
  67470. {
  67471. // SMIC-修改 - start
  67472. var _icX2 = x;
  67473. var _icY2 = y;
  67474. if (shape.refOriginalPosition) {
  67475. _icX2 = x - shape.refOriginalPosition[0];
  67476. _icY2 = y - shape.refOriginalPosition[1];
  67477. }
  67478. //岛洞面
  67479. if (shape.holePolygonPointLists && shape.holePolygonPointLists.length > 0) {
  67480. var isOnBase = this.isInsidePolygon(area.pointList, _icX2, _icY2);
  67481. // 遍历岛洞子面
  67482. var holePLS = shape.holePolygonPointLists;
  67483. var isOnHole = false;
  67484. for (var i = 0, holePLSen = holePLS.length; i < holePLSen; i++) {
  67485. var holePL = holePLS[i];
  67486. var isOnSubHole = this.isInsidePolygon(holePL, _icX2, _icY2);
  67487. if (isOnSubHole === true) {
  67488. isOnHole = true;
  67489. }
  67490. }
  67491. // 捕获判断
  67492. return isOnBase === true && isOnHole === false;
  67493. } else {
  67494. return this.isInsidePolygon(area.pointList, _icX2, _icY2);
  67495. }
  67496. }
  67497. // 初始代码:
  67498. // 无
  67499. // SMIC-修改 - end
  67500. // 文本
  67501. case 'text':
  67502. var rect = area.__rect || shape.getRect(area);
  67503. return this.isInsideRect(rect.x, rect.y, rect.width, rect.height, x, y);
  67504. // 扩展文本
  67505. case 'smictext':
  67506. //用文本背景矩形判断
  67507. var textBg = shape.getTextBackground(area);
  67508. return this.isInsidePolygon(textBg, x, y);
  67509. //初始代码:
  67510. // 无
  67511. // SMIC-修改 - end
  67512. // 矩形
  67513. case 'rectangle':
  67514. case 'image':
  67515. // 图片
  67516. return this.isInsideRect(area.x, area.y, area.width, area.height, x, y);
  67517. case 'smicimage':
  67518. {
  67519. var _areaX2 = area.x;
  67520. var _areaY2 = area.y;
  67521. if (shape.refOriginalPosition) {
  67522. _areaX2 = area.x + shape.refOriginalPosition[0];
  67523. _areaY2 = area.y + shape.refOriginalPosition[1];
  67524. }
  67525. return this.isInsideRect(_areaX2, _areaY2, area.width, area.height, x, y);
  67526. }
  67527. //// 扩展矩形
  67528. //case 'smicpolygon':
  67529. // // SMIC-修改 - start
  67530. // var icX = x;
  67531. // var icY = y;
  67532. // if(shape.refOriginalPosition) {
  67533. // icX = x - shape.refOriginalPosition[0];
  67534. // icY = y - shape.refOriginalPosition[1];
  67535. // }
  67536. // return this.isInsideRect(
  67537. // area.x, area.y, area.width, area.height, icX, icY
  67538. // );
  67539. //初始代码:
  67540. // 无
  67541. // SMIC-修改 - end
  67542. }
  67543. }
  67544. /**
  67545. * @function LevelRenderer.Tool.Areal.prototype._buildPathMethod
  67546. * @description 包含判断。通过buildPath方法来判断,三个方法中较快,但是不支持线条类型的 shape。
  67547. * @param {Object} shape - 图形。
  67548. * @param {Object} context - 上下文。
  67549. * @param {number} area - 目标区域。
  67550. * @param {number} x - 横坐标。
  67551. * @param {number} y - 纵坐标。
  67552. * @returns {boolean} 图形是否包含鼠标位置,true表示坐标处在图形中。
  67553. */
  67554. }, {
  67555. key: "_buildPathMethod",
  67556. value: function _buildPathMethod(shape, context, area, x, y) {
  67557. // 图形类实现路径创建了则用类的path
  67558. context.beginPath();
  67559. shape.buildPath(context, area);
  67560. context.closePath();
  67561. return context.isPointInPath(x, y);
  67562. }
  67563. /**
  67564. * @function LevelRenderer.Tool.Areal.prototype.isOutside
  67565. * @description 图形是否不包含鼠标位置。
  67566. * @param {Object} shape - 图形。
  67567. * @param {number} area - 目标区域。
  67568. * @param {number} x - 横坐标。
  67569. * @param {number} y - 纵坐标。
  67570. * @returns {boolean} 图形是否不包含鼠标位置, true表示坐标处在图形外。
  67571. */
  67572. }, {
  67573. key: "isOutside",
  67574. value: function isOutside(shape, area, x, y) {
  67575. return !this.isInside(shape, area, x, y);
  67576. }
  67577. /**
  67578. * @function LevelRenderer.Tool.Areal.prototype.isInsideLine
  67579. * @description 线段包含判断。
  67580. * @param {number} x0 - 线起始点横坐标。
  67581. * @param {number} y0 - 线起始点纵坐标。
  67582. * @param {number} x1 - 线终点横坐标。
  67583. * @param {number} y1 - 线终点纵坐标。
  67584. * @param {number} lineWidth - 线宽。
  67585. * @param {number} x - 鼠标位置横坐标。
  67586. * @param {number} y - 鼠标位置纵坐标。
  67587. * @returns {boolean} 图形是否包含鼠标位置,true表示坐标处在图形内。
  67588. */
  67589. }, {
  67590. key: "isInsideLine",
  67591. value: function isInsideLine(x0, y0, x1, y1, lineWidth, x, y) {
  67592. if (lineWidth === 0) {
  67593. return false;
  67594. }
  67595. var _l = Math.max(lineWidth, 5);
  67596. var _a = 0;
  67597. var _b = 0;
  67598. // Quick reject
  67599. if (y > y0 + _l && y > y1 + _l || y < y0 - _l && y < y1 - _l || x > x0 + _l && x > x1 + _l || x < x0 - _l && x < x1 - _l) {
  67600. return false;
  67601. }
  67602. if (x0 !== x1) {
  67603. _a = (y0 - y1) / (x0 - x1);
  67604. _b = (x0 * y1 - x1 * y0) / (x0 - x1);
  67605. } else {
  67606. return Math.abs(x - x0) <= _l / 2;
  67607. }
  67608. var tmp = _a * x - y + _b;
  67609. var _s = tmp * tmp / (_a * _a + 1);
  67610. return _s <= _l / 2 * _l / 2;
  67611. }
  67612. /**
  67613. * @function LevelRenderer.Tool.Areal.prototype.isInsideCubicStroke
  67614. * @description 三次贝塞尔曲线描边包含判断。
  67615. * @param {number} x0 - 点1横坐标。
  67616. * @param {number} y0 - 点1纵坐标。
  67617. * @param {number} x1 - 点2横坐标。
  67618. * @param {number} y1 - 点2纵坐标。
  67619. * @param {number} x2 - 点3纵坐标。
  67620. * @param {number} y2 - 点3纵坐标。
  67621. * @param {number} lineWidth - 线宽。
  67622. * @param {number} x - 鼠标位置横坐标。
  67623. * @param {number} y - 鼠标位置纵坐标。
  67624. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  67625. */
  67626. }, {
  67627. key: "isInsideCubicStroke",
  67628. value: function isInsideCubicStroke(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {
  67629. if (lineWidth === 0) {
  67630. return false;
  67631. }
  67632. var _l = Math.max(lineWidth, 5);
  67633. // Quick reject
  67634. if (y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l || y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l || x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l || x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l) {
  67635. return false;
  67636. }
  67637. var d = this.curve.cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null);
  67638. return d <= _l / 2;
  67639. }
  67640. /**
  67641. * @function LevelRenderer.Tool.Areal.prototype.isInsideQuadraticStroke
  67642. * @description 二次贝塞尔曲线描边包含判断。
  67643. * @param {number} x0 - 点1横坐标。
  67644. * @param {number} y0 - 点1纵坐标。
  67645. * @param {number} x1 - 点2横坐标。
  67646. * @param {number} y1 - 点2纵坐标。
  67647. * @param {number} x2 - 点3纵坐标。
  67648. * @param {number} y2 - 点3纵坐标。
  67649. * @param {number} lineWidth - 线宽。
  67650. * @param {number} x - 鼠标位置横坐标。
  67651. * @param {number} y - 鼠标位置纵坐标。
  67652. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  67653. */
  67654. }, {
  67655. key: "isInsideQuadraticStroke",
  67656. value: function isInsideQuadraticStroke(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {
  67657. if (lineWidth === 0) {
  67658. return false;
  67659. }
  67660. var _l = Math.max(lineWidth, 5);
  67661. // Quick reject
  67662. if (y > y0 + _l && y > y1 + _l && y > y2 + _l || y < y0 - _l && y < y1 - _l && y < y2 - _l || x > x0 + _l && x > x1 + _l && x > x2 + _l || x < x0 - _l && x < x1 - _l && x < x2 - _l) {
  67663. return false;
  67664. }
  67665. var d = this.curve.quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);
  67666. return d <= _l / 2;
  67667. }
  67668. /**
  67669. * @function LevelRenderer.Tool.Areal.prototype.isInsideArcStroke
  67670. * @description 圆弧描边包含判断。
  67671. * @param {number} cx - 圆心横坐标。
  67672. * @param {number} cy - 圆心纵坐标。
  67673. * @param {number} r - 圆半径。
  67674. * @param {number} startAngle - 起始角度。
  67675. * @param {number} endAngle - 终止角度。
  67676. * @param {number} anticlockwise - 顺时针还是逆时针。
  67677. * @param {number} lineWidth - 线宽。
  67678. * @param {number} x - 鼠标位置横坐标。
  67679. * @param {number} y - 鼠标位置纵坐标。
  67680. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  67681. */
  67682. }, {
  67683. key: "isInsideArcStroke",
  67684. value: function isInsideArcStroke(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {
  67685. var PI2 = this.PI2;
  67686. if (lineWidth === 0) {
  67687. return false;
  67688. }
  67689. var _l = Math.max(lineWidth, 5);
  67690. x -= cx;
  67691. y -= cy;
  67692. var d = Math.sqrt(x * x + y * y);
  67693. if (d - _l > r || d + _l < r) {
  67694. return false;
  67695. }
  67696. if (Math.abs(startAngle - endAngle) >= PI2) {
  67697. // Is a circle
  67698. return true;
  67699. }
  67700. if (anticlockwise) {
  67701. var tmp = startAngle;
  67702. startAngle = this.normalizeRadian(endAngle);
  67703. endAngle = this.normalizeRadian(tmp);
  67704. } else {
  67705. startAngle = this.normalizeRadian(startAngle);
  67706. endAngle = this.normalizeRadian(endAngle);
  67707. }
  67708. if (startAngle > endAngle) {
  67709. endAngle += PI2;
  67710. }
  67711. var angle = Math.atan2(y, x);
  67712. if (angle < 0) {
  67713. angle += PI2;
  67714. }
  67715. return angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle;
  67716. }
  67717. /**
  67718. * @function LevelRenderer.Tool.Areal.prototype.isInsideBrokenLine
  67719. * @description 图形 BrokenLine 是否包含鼠标位置, true表示坐标处在图形内。
  67720. * @param {Array} points - 曲线点对象。
  67721. * @param {number} lineWidth - 线宽。
  67722. * @param {number} x - 鼠标位置横坐标。
  67723. * @param {number} y - 鼠标位置纵坐标。
  67724. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  67725. */
  67726. }, {
  67727. key: "isInsideBrokenLine",
  67728. value: function isInsideBrokenLine(points, lineWidth, x, y) {
  67729. var _lineWidth = Math.max(lineWidth, 10);
  67730. for (var i = 0, l = points.length - 1; i < l; i++) {
  67731. var x0 = points[i][0];
  67732. var y0 = points[i][1];
  67733. var x1 = points[i + 1][0];
  67734. var y1 = points[i + 1][1];
  67735. if (this.isInsideLine(x0, y0, x1, y1, _lineWidth, x, y)) {
  67736. return true;
  67737. }
  67738. }
  67739. return false;
  67740. }
  67741. /**
  67742. * @function LevelRenderer.Tool.Areal.prototype.isInsideRing
  67743. * @description 图形 Ring 是否包含鼠标位置, true表示坐标处在图形内。
  67744. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  67745. */
  67746. }, {
  67747. key: "isInsideRing",
  67748. value: function isInsideRing(cx, cy, r0, r, x, y) {
  67749. var d = (x - cx) * (x - cx) + (y - cy) * (y - cy);
  67750. return d < r * r && d > r0 * r0;
  67751. }
  67752. /**
  67753. * @function LevelRenderer.Tool.Areal.prototype.isInsideRect
  67754. * @description 图形 Rect 是否包含鼠标位置, true表示坐标处在图形内。
  67755. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  67756. */
  67757. }, {
  67758. key: "isInsideRect",
  67759. value: function isInsideRect(x0, y0, width, height, x, y) {
  67760. return x >= x0 && x <= x0 + width && y >= y0 && y <= y0 + height;
  67761. }
  67762. /**
  67763. * @function LevelRenderer.Tool.Areal.prototype.isInsideCircle
  67764. * @description 图形 Circle 是否包含鼠标位置, true表示坐标处在图形内。
  67765. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  67766. */
  67767. }, {
  67768. key: "isInsideCircle",
  67769. value: function isInsideCircle(x0, y0, r, x, y) {
  67770. return (x - x0) * (x - x0) + (y - y0) * (y - y0) < r * r;
  67771. }
  67772. /**
  67773. * @function LevelRenderer.Tool.Areal.prototype.isInsideSector
  67774. * @description 图形 Sector 是否包含鼠标位置, true表示坐标处在图形内。
  67775. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  67776. */
  67777. }, {
  67778. key: "isInsideSector",
  67779. value: function isInsideSector(cx, cy, r0, r, startAngle, endAngle, anticlockwise, x, y) {
  67780. return this.isInsideArcStroke(cx, cy, (r0 + r) / 2, startAngle, endAngle, anticlockwise, r - r0, x, y);
  67781. }
  67782. /**
  67783. * @function LevelRenderer.Tool.Areal.prototype.isInsidePolygon
  67784. * @description 图形 Polygon 是否包含鼠标位置, true表示坐标处在图形内。与 canvas 一样采用 non-zero winding rule
  67785. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  67786. */
  67787. }, {
  67788. key: "isInsidePolygon",
  67789. value: function isInsidePolygon(points, x, y) {
  67790. var N = points.length;
  67791. var w = 0;
  67792. for (var i = 0, j = N - 1; i < N; i++) {
  67793. var x0 = points[j][0];
  67794. var y0 = points[j][1];
  67795. var x1 = points[i][0];
  67796. var y1 = points[i][1];
  67797. w += this.windingLine(x0, y0, x1, y1, x, y);
  67798. j = i;
  67799. }
  67800. return w !== 0;
  67801. }
  67802. /**
  67803. * @function LevelRenderer.Tool.Areal.prototype.windingLine
  67804. */
  67805. }, {
  67806. key: "windingLine",
  67807. value: function windingLine(x0, y0, x1, y1, x, y) {
  67808. if (y > y0 && y > y1 || y < y0 && y < y1) {
  67809. return 0;
  67810. }
  67811. if (y1 == y0) {
  67812. return 0;
  67813. }
  67814. var dir = y1 < y0 ? 1 : -1;
  67815. var t = (y - y0) / (y1 - y0);
  67816. var x_ = t * (x1 - x0) + x0;
  67817. return x_ > x ? dir : 0;
  67818. }
  67819. /**
  67820. * @function LevelRenderer.Tool.Areal.prototype.swapExtrema
  67821. */
  67822. }, {
  67823. key: "swapExtrema",
  67824. value: function swapExtrema() {
  67825. var tmp = this.extrema[0];
  67826. this.extrema[0] = this.extrema[1];
  67827. this.extrema[1] = tmp;
  67828. }
  67829. /**
  67830. * @function LevelRenderer.Tool.Areal.prototype.windingCubic
  67831. */
  67832. }, {
  67833. key: "windingCubic",
  67834. value: function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {
  67835. var curve = this.curve;
  67836. var roots = this.roots;
  67837. var extrema = this.extrema;
  67838. // Quick reject
  67839. if (y > y0 && y > y1 && y > y2 && y > y3 || y < y0 && y < y1 && y < y2 && y < y3) {
  67840. return 0;
  67841. }
  67842. var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots);
  67843. if (nRoots === 0) {
  67844. return 0;
  67845. } else {
  67846. var w = 0;
  67847. var nExtrema = -1;
  67848. var y0_, y1_;
  67849. for (var i = 0; i < nRoots; i++) {
  67850. var t = roots[i];
  67851. var x_ = curve.cubicAt(x0, x1, x2, x3, t);
  67852. if (x_ < x) {
  67853. // Quick reject
  67854. continue;
  67855. }
  67856. if (nExtrema < 0) {
  67857. nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema);
  67858. if (extrema[1] < extrema[0] && nExtrema > 1) {
  67859. this.swapExtrema();
  67860. }
  67861. y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]);
  67862. if (nExtrema > 1) {
  67863. y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]);
  67864. }
  67865. }
  67866. if (nExtrema == 2) {
  67867. // 分成三段单调函数
  67868. if (t < extrema[0]) {
  67869. w += y0_ < y0 ? 1 : -1;
  67870. } else if (t < extrema[1]) {
  67871. w += y1_ < y0_ ? 1 : -1;
  67872. } else {
  67873. w += y3 < y1_ ? 1 : -1;
  67874. }
  67875. } else {
  67876. // 分成两段单调函数
  67877. if (t < extrema[0]) {
  67878. w += y0_ < y0 ? 1 : -1;
  67879. } else {
  67880. w += y3 < y0_ ? 1 : -1;
  67881. }
  67882. }
  67883. }
  67884. return w;
  67885. }
  67886. }
  67887. /**
  67888. * @function LevelRenderer.Tool.Areal.prototype.windingQuadratic
  67889. */
  67890. }, {
  67891. key: "windingQuadratic",
  67892. value: function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {
  67893. var curve = this.curve;
  67894. var roots = this.roots;
  67895. // Quick reject
  67896. if (y > y0 && y > y1 && y > y2 || y < y0 && y < y1 && y < y2) {
  67897. return 0;
  67898. }
  67899. var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots);
  67900. if (nRoots === 0) {
  67901. return 0;
  67902. } else {
  67903. var t = curve.quadraticExtremum(y0, y1, y2);
  67904. if (t >= 0 && t <= 1) {
  67905. var w = 0;
  67906. var y_ = curve.quadraticAt(y0, y1, y2, t);
  67907. for (var i = 0; i < nRoots; i++) {
  67908. var x_ = curve.quadraticAt(x0, x1, x2, roots[i]);
  67909. if (x_ > x) {
  67910. continue;
  67911. }
  67912. if (roots[i] < t) {
  67913. w += y_ < y0 ? 1 : -1;
  67914. } else {
  67915. w += y2 < y_ ? 1 : -1;
  67916. }
  67917. }
  67918. return w;
  67919. } else {
  67920. var _x_ = curve.quadraticAt(x0, x1, x2, roots[0]);
  67921. if (_x_ > x) {
  67922. return 0;
  67923. }
  67924. return y2 < y0 ? 1 : -1;
  67925. }
  67926. }
  67927. }
  67928. /**
  67929. * @function LevelRenderer.Tool.Areal.prototype.windingArc
  67930. * // TODO Arc 旋转
  67931. */
  67932. }, {
  67933. key: "windingArc",
  67934. value: function windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {
  67935. var roots = this.roots;
  67936. var PI2 = this.PI2;
  67937. y -= cy;
  67938. if (y > r || y < -r) {
  67939. return 0;
  67940. }
  67941. var tmp = Math.sqrt(r * r - y * y);
  67942. roots[0] = -tmp;
  67943. roots[1] = tmp;
  67944. if (Math.abs(startAngle - endAngle) >= PI2) {
  67945. // Is a circle
  67946. startAngle = 0;
  67947. endAngle = PI2;
  67948. var dir = anticlockwise ? 1 : -1;
  67949. if (x >= roots[0] + cx && x <= roots[1] + cx) {
  67950. return dir;
  67951. } else {
  67952. return 0;
  67953. }
  67954. }
  67955. if (anticlockwise) {
  67956. var _tmp = startAngle;
  67957. startAngle = this.normalizeRadian(endAngle);
  67958. endAngle = this.normalizeRadian(_tmp);
  67959. } else {
  67960. startAngle = this.normalizeRadian(startAngle);
  67961. endAngle = this.normalizeRadian(endAngle);
  67962. }
  67963. if (startAngle > endAngle) {
  67964. endAngle += PI2;
  67965. }
  67966. var w = 0;
  67967. for (var i = 0; i < 2; i++) {
  67968. var x_ = roots[i];
  67969. if (x_ + cx > x) {
  67970. var angle = Math.atan2(y, x_);
  67971. var _dir = anticlockwise ? 1 : -1;
  67972. if (angle < 0) {
  67973. angle = PI2 + angle;
  67974. }
  67975. if (angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle) {
  67976. if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {
  67977. _dir = -_dir;
  67978. }
  67979. w += _dir;
  67980. }
  67981. }
  67982. }
  67983. return w;
  67984. }
  67985. /**
  67986. * @function LevelRenderer.Tool.Areal.prototype.isInsidePath
  67987. * @description 与 canvas 一样采用 non-zero winding rule
  67988. */
  67989. }, {
  67990. key: "isInsidePath",
  67991. value: function isInsidePath(pathArray, lineWidth, brushType, x, y) {
  67992. var w = 0;
  67993. var xi = 0;
  67994. var yi = 0;
  67995. var x0 = 0;
  67996. var y0 = 0;
  67997. var beginSubpath = true;
  67998. var firstCmd = true;
  67999. brushType = brushType || 'fill';
  68000. var hasStroke = brushType === 'stroke' || brushType === 'both';
  68001. var hasFill = brushType === 'fill' || brushType === 'both';
  68002. // var roots = [-1, -1, -1];
  68003. for (var i = 0; i < pathArray.length; i++) {
  68004. var seg = pathArray[i];
  68005. var p = seg.points;
  68006. // Begin a new subpath
  68007. if (beginSubpath || seg.command === 'M') {
  68008. if (i > 0) {
  68009. // Close previous subpath
  68010. if (hasFill) {
  68011. w += this.windingLine(xi, yi, x0, y0, x, y);
  68012. }
  68013. if (w !== 0) {
  68014. return true;
  68015. }
  68016. }
  68017. x0 = p[p.length - 2];
  68018. y0 = p[p.length - 1];
  68019. beginSubpath = false;
  68020. if (firstCmd && seg.command !== 'A') {
  68021. // 如果第一个命令不是M, 是lineTo, bezierCurveTo
  68022. // 等绘制命令的话,是会从该绘制的起点开始算的
  68023. // Arc 会在之后做单独处理所以这里忽略
  68024. firstCmd = false;
  68025. xi = x0;
  68026. yi = y0;
  68027. }
  68028. }
  68029. switch (seg.command) {
  68030. case 'M':
  68031. xi = p[0];
  68032. yi = p[1];
  68033. break;
  68034. case 'L':
  68035. if (hasStroke) {
  68036. if (this.isInsideLine(xi, yi, p[0], p[1], lineWidth, x, y)) {
  68037. return true;
  68038. }
  68039. }
  68040. if (hasFill) {
  68041. w += this.windingLine(xi, yi, p[0], p[1], x, y);
  68042. }
  68043. xi = p[0];
  68044. yi = p[1];
  68045. break;
  68046. case 'C':
  68047. if (hasStroke) {
  68048. if (this.isInsideCubicStroke(xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], lineWidth, x, y)) {
  68049. return true;
  68050. }
  68051. }
  68052. if (hasFill) {
  68053. w += this.windingCubic(xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], x, y);
  68054. }
  68055. xi = p[4];
  68056. yi = p[5];
  68057. break;
  68058. case 'Q':
  68059. if (hasStroke) {
  68060. if (this.isInsideQuadraticStroke(xi, yi, p[0], p[1], p[2], p[3], lineWidth, x, y)) {
  68061. return true;
  68062. }
  68063. }
  68064. if (hasFill) {
  68065. w += this.windingQuadratic(xi, yi, p[0], p[1], p[2], p[3], x, y);
  68066. }
  68067. xi = p[2];
  68068. yi = p[3];
  68069. break;
  68070. case 'A':
  68071. // TODO Arc 旋转
  68072. // TODO Arc 判断的开销比较大
  68073. var cx = p[0];
  68074. var cy = p[1];
  68075. var rx = p[2];
  68076. var ry = p[3];
  68077. var theta = p[4];
  68078. var dTheta = p[5];
  68079. var x1 = Math.cos(theta) * rx + cx;
  68080. var y1 = Math.sin(theta) * ry + cy;
  68081. // 不是直接使用 arc 命令
  68082. if (!firstCmd) {
  68083. w += this.windingLine(xi, yi, x1, y1);
  68084. } else {
  68085. firstCmd = false;
  68086. // 第一个命令起点还未定义
  68087. x0 = x1;
  68088. y0 = y1;
  68089. }
  68090. // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放
  68091. var _x = (x - cx) * ry / rx + cx;
  68092. if (hasStroke) {
  68093. if (this.isInsideArcStroke(cx, cy, ry, theta, theta + dTheta, 1 - p[7], lineWidth, _x, y)) {
  68094. return true;
  68095. }
  68096. }
  68097. if (hasFill) {
  68098. w += this.windingArc(cx, cy, ry, theta, theta + dTheta, 1 - p[7], _x, y);
  68099. }
  68100. xi = Math.cos(theta + dTheta) * rx + cx;
  68101. yi = Math.sin(theta + dTheta) * ry + cy;
  68102. break;
  68103. case 'z':
  68104. if (hasStroke) {
  68105. if (this.isInsideLine(xi, yi, x0, y0, lineWidth, x, y)) {
  68106. return true;
  68107. }
  68108. }
  68109. beginSubpath = true;
  68110. break;
  68111. }
  68112. }
  68113. if (hasFill) {
  68114. w += this.windingLine(xi, yi, x0, y0, x, y);
  68115. }
  68116. return w !== 0;
  68117. }
  68118. /**
  68119. * @function LevelRenderer.Tool.Areal.prototype.getTextWidth
  68120. * @description 测算多行文本宽度
  68121. */
  68122. }, {
  68123. key: "getTextWidth",
  68124. value: function getTextWidth(text, textFont) {
  68125. var key = text + ':' + textFont;
  68126. if (this._textWidthCache[key]) {
  68127. return this._textWidthCache[key];
  68128. }
  68129. this._ctx = this._ctx || this.util.getContext();
  68130. this._ctx.save();
  68131. if (textFont) {
  68132. this._ctx.font = textFont;
  68133. }
  68134. text = (text + '').split('\n');
  68135. var width = 0;
  68136. for (var i = 0, l = text.length; i < l; i++) {
  68137. width = Math.max(this._ctx.measureText(text[i]).width, width);
  68138. }
  68139. this._ctx.restore();
  68140. this._textWidthCache[key] = width;
  68141. if (++this._textWidthCacheCounter > this.TEXT_CACHE_MAX) {
  68142. // 内存释放
  68143. this._textWidthCacheCounter = 0;
  68144. this._textWidthCache = {};
  68145. }
  68146. return width;
  68147. }
  68148. /**
  68149. * @function LevelRenderer.Tool.Areal.prototype.getTextHeight
  68150. * @description 测算多行文本高度
  68151. */
  68152. }, {
  68153. key: "getTextHeight",
  68154. value: function getTextHeight(text, textFont) {
  68155. var key = text + ':' + textFont;
  68156. if (this._textHeightCache[key]) {
  68157. return this._textHeightCache[key];
  68158. }
  68159. this._ctx = this._ctx || this.util.getContext();
  68160. this._ctx.save();
  68161. if (textFont) {
  68162. this._ctx.font = textFont;
  68163. }
  68164. text = (text + '').split('\n');
  68165. // 比较粗暴
  68166. //var height = (this._ctx.measureText('国').width + 2) * text.length; //打包不支持中文,替换掉
  68167. var height = (this._ctx.measureText('ZH').width + 2) * text.length;
  68168. this._ctx.restore();
  68169. this._textHeightCache[key] = height;
  68170. if (++this._textHeightCacheCounter > this.TEXT_CACHE_MAX) {
  68171. // 内存释放
  68172. this._textHeightCacheCounter = 0;
  68173. this._textHeightCache = {};
  68174. }
  68175. return height;
  68176. }
  68177. }]);
  68178. return Area;
  68179. }();
  68180. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/ComputeBoundingBox.js
  68181. function ComputeBoundingBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68182. function ComputeBoundingBox_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  68183. function ComputeBoundingBox_createClass(Constructor, protoProps, staticProps) { if (protoProps) ComputeBoundingBox_defineProperties(Constructor.prototype, protoProps); if (staticProps) ComputeBoundingBox_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  68184. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  68185. * This program are made available under the terms of the Apache License, Version 2.0
  68186. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68187. /**
  68188. * @class LevelRenderer.Tool.ComputeBoundingBox
  68189. * @category Visualization Theme
  68190. * @classdesc LevelRenderer 工具-图形 Bounds 计算
  68191. * @private
  68192. */
  68193. var ComputeBoundingBox = /*#__PURE__*/function () {
  68194. function ComputeBoundingBox() {
  68195. ComputeBoundingBox_classCallCheck(this, ComputeBoundingBox);
  68196. if (arguments.length === 3) {
  68197. this.computeBoundingBox(arguments);
  68198. }
  68199. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.ComputeBoundingBox";
  68200. }
  68201. /**
  68202. * @function LevelRenderer.Tool.ComputeBoundingBox.prototype.computeBoundingBox
  68203. * @description 从顶点数组中计算出最小包围盒,写入'min'和'max'中。
  68204. * @param {Array.<Object>} points - 顶点数组。
  68205. * @param {Array.<number>} min - 最小
  68206. * @param {Array.<number>} max - 最大
  68207. */
  68208. ComputeBoundingBox_createClass(ComputeBoundingBox, [{
  68209. key: "computeBoundingBox",
  68210. value: function computeBoundingBox(points, min, max) {
  68211. if (points.length === 0) {
  68212. return;
  68213. }
  68214. var left = points[0][0];
  68215. var right = points[0][0];
  68216. var top = points[0][1];
  68217. var bottom = points[0][1];
  68218. for (var i = 1; i < points.length; i++) {
  68219. var p = points[i];
  68220. if (p[0] < left) {
  68221. left = p[0];
  68222. }
  68223. if (p[0] > right) {
  68224. right = p[0];
  68225. }
  68226. if (p[1] < top) {
  68227. top = p[1];
  68228. }
  68229. if (p[1] > bottom) {
  68230. bottom = p[1];
  68231. }
  68232. }
  68233. min[0] = left;
  68234. min[1] = top;
  68235. max[0] = right;
  68236. max[1] = bottom;
  68237. }
  68238. /**
  68239. * @function LevelRenderer.Tool.ComputeBoundingBox.prototype.cubeBezier
  68240. * @description 从三阶贝塞尔曲线(p0, p1, p2, p3)中计算出最小包围盒,写入'min'和'max'中。原:computeCubeBezierBoundingBox。
  68241. * @param {Array.<number>} p0 - 三阶贝塞尔曲线p0点
  68242. * @param {Array.<number>} p1 - 三阶贝塞尔曲线p1点
  68243. * @param {Array.<number>} p2 - 三阶贝塞尔曲线p2点
  68244. * @param {Array.<number>} p3 - 三阶贝塞尔曲线p3点
  68245. * @param {Array.<number>} min - 最小
  68246. * @param {Array.<number>} max - 最大
  68247. */
  68248. }, {
  68249. key: "cubeBezier",
  68250. value: function cubeBezier(p0, p1, p2, p3, min, max) {
  68251. var curve = new Curve_Curve();
  68252. var xDim = [];
  68253. curve.cubicExtrema(p0[0], p1[0], p2[0], p3[0], xDim);
  68254. for (var i = 0; i < xDim.length; i++) {
  68255. xDim[i] = curve.cubicAt(p0[0], p1[0], p2[0], p3[0], xDim[i]);
  68256. }
  68257. var yDim = [];
  68258. curve.cubicExtrema(p0[1], p1[1], p2[1], p3[1], yDim);
  68259. for (var _i2 = 0; _i2 < yDim.length; _i2++) {
  68260. yDim[_i2] = curve.cubicAt(p0[1], p1[1], p2[1], p3[1], yDim[_i2]);
  68261. }
  68262. xDim.push(p0[0], p3[0]);
  68263. yDim.push(p0[1], p3[1]);
  68264. var left = Math.min.apply(null, xDim);
  68265. var right = Math.max.apply(null, xDim);
  68266. var top = Math.min.apply(null, yDim);
  68267. var bottom = Math.max.apply(null, yDim);
  68268. min[0] = left;
  68269. min[1] = top;
  68270. max[0] = right;
  68271. max[1] = bottom;
  68272. }
  68273. /**
  68274. * @function LevelRenderer.Tool.ComputeBoundingBox.prototype.quadraticBezier
  68275. * @description 从二阶贝塞尔曲线(p0, p1, p2)中计算出最小包围盒,写入'min'和'max'中。原:computeQuadraticBezierBoundingBox。
  68276. * @param {Array.<number>} p0 - 二阶贝塞尔曲线p0点
  68277. * @param {Array.<number>} p1 - 二阶贝塞尔曲线p1点
  68278. * @param {Array.<number>} p2 - 二阶贝塞尔曲线p2点
  68279. * @param {Array.<number>} min - 最小
  68280. * @param {Array.<number>} max - 最大
  68281. */
  68282. }, {
  68283. key: "quadraticBezier",
  68284. value: function quadraticBezier(p0, p1, p2, min, max) {
  68285. var curve = new Curve_Curve();
  68286. // Find extremities, where derivative in x dim or y dim is zero
  68287. var t1 = curve.quadraticExtremum(p0[0], p1[0], p2[0]);
  68288. var t2 = curve.quadraticExtremum(p0[1], p1[1], p2[1]);
  68289. t1 = Math.max(Math.min(t1, 1), 0);
  68290. t2 = Math.max(Math.min(t2, 1), 0);
  68291. var ct1 = 1 - t1;
  68292. var ct2 = 1 - t2;
  68293. var x1 = ct1 * ct1 * p0[0] + 2 * ct1 * t1 * p1[0] + t1 * t1 * p2[0];
  68294. var y1 = ct1 * ct1 * p0[1] + 2 * ct1 * t1 * p1[1] + t1 * t1 * p2[1];
  68295. var x2 = ct2 * ct2 * p0[0] + 2 * ct2 * t2 * p1[0] + t2 * t2 * p2[0];
  68296. var y2 = ct2 * ct2 * p0[1] + 2 * ct2 * t2 * p1[1] + t2 * t2 * p2[1];
  68297. min[0] = Math.min(p0[0], p2[0], x1, x2);
  68298. min[1] = Math.min(p0[1], p2[1], y1, y2);
  68299. max[0] = Math.max(p0[0], p2[0], x1, x2);
  68300. max[1] = Math.max(p0[1], p2[1], y1, y2);
  68301. }
  68302. /**
  68303. * @function LevelRenderer.Tool.ComputeBoundingBox.prototype.arc
  68304. * @description 从圆弧中计算出最小包围盒,写入'min'和'max'中。原:computeArcBoundingBox。
  68305. * @param {number} x - 圆弧中心点 x
  68306. * @param {number} y - 圆弧中心点 y
  68307. * @param {number} r - 圆弧半径
  68308. * @param {number} startAngle - 圆弧开始角度
  68309. * @param {number} endAngle - 圆弧结束角度
  68310. * @param {number} anticlockwise - 是否是顺时针
  68311. * @param {number} min - 最小
  68312. * @param {number} max - 最大
  68313. */
  68314. }, {
  68315. key: "arc",
  68316. value: function arc(x, y, r, startAngle, endAngle, anticlockwise, min, max) {
  68317. var vec2 = new levelRenderer_Vector_Vector();
  68318. var start = vec2.create();
  68319. var end = vec2.create();
  68320. var extremity = vec2.create();
  68321. start[0] = Math.cos(startAngle) * r + x;
  68322. start[1] = Math.sin(startAngle) * r + y;
  68323. end[0] = Math.cos(endAngle) * r + x;
  68324. end[1] = Math.sin(endAngle) * r + y;
  68325. vec2.min(min, start, end);
  68326. vec2.max(max, start, end);
  68327. // Thresh to [0, Math.PI * 2]
  68328. startAngle = startAngle % (Math.PI * 2);
  68329. if (startAngle < 0) {
  68330. startAngle = startAngle + Math.PI * 2;
  68331. }
  68332. endAngle = endAngle % (Math.PI * 2);
  68333. if (endAngle < 0) {
  68334. endAngle = endAngle + Math.PI * 2;
  68335. }
  68336. if (startAngle > endAngle && !anticlockwise) {
  68337. endAngle += Math.PI * 2;
  68338. } else if (startAngle < endAngle && anticlockwise) {
  68339. startAngle += Math.PI * 2;
  68340. }
  68341. if (anticlockwise) {
  68342. var tmp = endAngle;
  68343. endAngle = startAngle;
  68344. startAngle = tmp;
  68345. }
  68346. // var number = 0;
  68347. // var step = (anticlockwise ? -Math.PI : Math.PI) / 2;
  68348. for (var angle = 0; angle < endAngle; angle += Math.PI / 2) {
  68349. if (angle > startAngle) {
  68350. extremity[0] = Math.cos(angle) * r + x;
  68351. extremity[1] = Math.sin(angle) * r + y;
  68352. vec2.min(min, extremity, min);
  68353. vec2.max(max, extremity, max);
  68354. }
  68355. }
  68356. }
  68357. }]);
  68358. return ComputeBoundingBox;
  68359. }();
  68360. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Env.js
  68361. function Env_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68362. function Env_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  68363. function Env_createClass(Constructor, protoProps, staticProps) { if (protoProps) Env_defineProperties(Constructor.prototype, protoProps); if (staticProps) Env_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  68364. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  68365. * This program are made available under the terms of the Apache License, Version 2.0
  68366. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68367. /**
  68368. * @class LevelRenderer.Tool.Env
  68369. * @category Visualization Theme
  68370. * @classdesc 环境识别
  68371. * @private
  68372. */
  68373. var Env = /*#__PURE__*/function () {
  68374. function Env() {
  68375. Env_classCallCheck(this, Env);
  68376. // Zepto.js
  68377. // (c) 2010-2013 Thomas Fuchs
  68378. // Zepto.js may be freely distributed under the MIT license.
  68379. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Env";
  68380. var me = this;
  68381. function detect(ua) {
  68382. var os = me.os = {};
  68383. var browser = me.browser = {};
  68384. var webkit = ua.match(/Web[kK]it[\/]{0,1}([\d.]+)/);
  68385. var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/);
  68386. var ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
  68387. var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
  68388. var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/);
  68389. var webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/);
  68390. var touchpad = webos && ua.match(/TouchPad/);
  68391. var kindle = ua.match(/Kindle\/([\d.]+)/);
  68392. var silk = ua.match(/Silk\/([\d._]+)/);
  68393. var blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/);
  68394. var bb10 = ua.match(/(BB10).*Version\/([\d.]+)/);
  68395. var rimtabletos = ua.match(/(RIM\sTablet\sOS)\s([\d.]+)/);
  68396. var playbook = ua.match(/PlayBook/);
  68397. var chrome = ua.match(/Chrome\/([\d.]+)/) || ua.match(/CriOS\/([\d.]+)/);
  68398. var firefox = ua.match(/Firefox\/([\d.]+)/);
  68399. var ie = ua.match(/MSIE ([\d.]+)/);
  68400. var safari = webkit && ua.match(/Mobile\//) && !chrome;
  68401. var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome;
  68402. // Todo: clean this up with a better OS/browser seperation:
  68403. // - discern (more) between multiple browsers on android
  68404. // - decide if kindle fire in silk mode is android or not
  68405. // - Firefox on Android doesn't specify the Android version
  68406. // - possibly devide in os, device and browser hashes
  68407. /*eslint-disable*/
  68408. if (browser.webkit = !!webkit) {
  68409. browser.version = webkit[1];
  68410. }
  68411. if (android) {
  68412. os.android = true;
  68413. os.version = android[2];
  68414. }
  68415. if (iphone && !ipod) {
  68416. os.ios = os.iphone = true;
  68417. os.version = iphone[2].replace(/_/g, '.');
  68418. }
  68419. if (ipad) {
  68420. os.ios = os.ipad = true;
  68421. os.version = ipad[2].replace(/_/g, '.');
  68422. }
  68423. if (ipod) {
  68424. os.ios = os.ipod = true;
  68425. os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null;
  68426. }
  68427. if (webos) {
  68428. os.webos = true;
  68429. os.version = webos[2];
  68430. }
  68431. if (touchpad) {
  68432. os.touchpad = true;
  68433. }
  68434. if (blackberry) {
  68435. os.blackberry = true;
  68436. os.version = blackberry[2];
  68437. }
  68438. if (bb10) {
  68439. os.bb10 = true;
  68440. os.version = bb10[2];
  68441. }
  68442. if (rimtabletos) {
  68443. os.rimtabletos = true;
  68444. os.version = rimtabletos[2];
  68445. }
  68446. if (playbook) {
  68447. browser.playbook = true;
  68448. }
  68449. if (kindle) {
  68450. os.kindle = true;
  68451. os.version = kindle[1];
  68452. }
  68453. if (silk) {
  68454. browser.silk = true;
  68455. browser.version = silk[1];
  68456. }
  68457. if (!silk && os.android && ua.match(/Kindle Fire/)) {
  68458. browser.silk = true;
  68459. }
  68460. if (chrome) {
  68461. browser.chrome = true;
  68462. browser.version = chrome[1];
  68463. }
  68464. if (firefox) {
  68465. browser.firefox = true;
  68466. browser.version = firefox[1];
  68467. }
  68468. if (ie) {
  68469. browser.ie = true;
  68470. browser.version = ie[1];
  68471. }
  68472. if (safari && (ua.match(/Safari/) || !!os.ios)) {
  68473. browser.safari = true;
  68474. }
  68475. if (webview) {
  68476. browser.webview = true;
  68477. }
  68478. if (ie) {
  68479. browser.ie = true;
  68480. browser.version = ie[1];
  68481. }
  68482. os.tablet = !!(ipad || playbook || android && !ua.match(/Mobile/) || firefox && ua.match(/Tablet/) || ie && !ua.match(/Phone/) && ua.match(/Touch/));
  68483. os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos || blackberry || bb10 || chrome && ua.match(/Android/) || chrome && ua.match(/CriOS\/([\d.]+)/) || firefox && ua.match(/Mobile/) || ie && ua.match(/Touch/)));
  68484. return {
  68485. browser: browser,
  68486. os: os,
  68487. // 原生canvas支持
  68488. canvasSupported: document.createElement('canvas').getContext ? true : false
  68489. };
  68490. }
  68491. return detect(navigator.userAgent);
  68492. }
  68493. Env_createClass(Env, [{
  68494. key: "destory",
  68495. value: function destory() {
  68496. return true;
  68497. }
  68498. }]);
  68499. return Env;
  68500. }();
  68501. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Event.js
  68502. function Event_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68503. function Event_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  68504. function Event_createClass(Constructor, protoProps, staticProps) { if (protoProps) Event_defineProperties(Constructor.prototype, protoProps); if (staticProps) Event_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  68505. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  68506. * This program are made available under the terms of the Apache License, Version 2.0
  68507. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68508. /**
  68509. * @class LevelRenderer.Tool.Event
  68510. * @category Visualization Theme
  68511. * @classdesc LevelRenderer 工具-事件辅助类
  68512. * @private
  68513. */
  68514. var Event_Event = /*#__PURE__*/function () {
  68515. function Event() {
  68516. Event_classCallCheck(this, Event);
  68517. /**
  68518. * @member {function} LevelRenderer.Tool.Event.prototype.stop
  68519. * @description 停止冒泡和阻止默认行为
  68520. */
  68521. this.stop = typeof window.addEventListener === 'function' ? function (e) {
  68522. e.preventDefault();
  68523. e.stopPropagation();
  68524. e.cancelBubble = true;
  68525. } : function (e) {
  68526. e.returnValue = false;
  68527. e.cancelBubble = true;
  68528. };
  68529. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Event";
  68530. }
  68531. /**
  68532. * @function LevelRenderer.Tool.Event.prototype.getX
  68533. * @description 提取鼠标(手指)x坐标。
  68534. * @param {Event} e - 事件。
  68535. * @returns {number} 鼠标(手指)x坐标。
  68536. */
  68537. Event_createClass(Event, [{
  68538. key: "getX",
  68539. value: function getX(e) {
  68540. return typeof e.zrenderX != 'undefined' && e.zrenderX || typeof e.offsetX != 'undefined' && e.offsetX || typeof e.layerX != 'undefined' && e.layerX || typeof e.clientX != 'undefined' && e.clientX;
  68541. }
  68542. /**
  68543. * @function LevelRenderer.Tool.Event.prototype.getY
  68544. * @description 提取鼠标(手指)y坐标。
  68545. * @param {Event} e - 事件。
  68546. * @returns {number} 鼠标(手指)y坐标。
  68547. */
  68548. }, {
  68549. key: "getY",
  68550. value: function getY(e) {
  68551. return typeof e.zrenderY != 'undefined' && e.zrenderY || typeof e.offsetY != 'undefined' && e.offsetY || typeof e.layerY != 'undefined' && e.layerY || typeof e.clientY != 'undefined' && e.clientY;
  68552. }
  68553. /**
  68554. * @function LevelRenderer.Tool.Event.prototype.getDelta
  68555. * @description 提取鼠标滚轮变化。
  68556. * @param {Event} e - 事件。
  68557. * @returns {number} 滚轮变化,正值说明滚轮是向上滚动,如果是负值说明滚轮是向下滚动。
  68558. */
  68559. }, {
  68560. key: "getDelta",
  68561. value: function getDelta(e) {
  68562. return typeof e.zrenderDelta != 'undefined' && e.zrenderDelta || typeof e.wheelDelta != 'undefined' && e.wheelDelta || typeof e.detail != 'undefined' && -e.detail;
  68563. }
  68564. }]);
  68565. return Event;
  68566. }();
  68567. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Http.js
  68568. function Http_typeof(obj) { "@babel/helpers - typeof"; return Http_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Http_typeof(obj); }
  68569. function Http_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68570. function Http_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  68571. function Http_createClass(Constructor, protoProps, staticProps) { if (protoProps) Http_defineProperties(Constructor.prototype, protoProps); if (staticProps) Http_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  68572. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  68573. * This program are made available under the terms of the Apache License, Version 2.0
  68574. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68575. /**
  68576. * @private
  68577. * @class LevelRenderer.Tool.Http
  68578. * @category Visualization Theme
  68579. * @classdesc LevelRenderer 工具-Http
  68580. */
  68581. var Http = /*#__PURE__*/function () {
  68582. function Http() {
  68583. Http_classCallCheck(this, Http);
  68584. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Http";
  68585. }
  68586. /**
  68587. * @function LevelRenderer.Tool.Http.prototype.get
  68588. * @description get请求。
  68589. * @param {(string|IHTTPGetOption)} url - 请求url
  68590. * @param {function} onsuccess - 请求成功函数
  68591. * @param {function} onerror - 请求失败函数
  68592. * @param {Object} opts - 额外参数
  68593. * @returns {number} cos值
  68594. */
  68595. Http_createClass(Http, [{
  68596. key: "get",
  68597. value: function get(url, onsuccess, onerror) {
  68598. if (Http_typeof(url) === 'object') {
  68599. var obj = url;
  68600. url = obj.url;
  68601. onsuccess = obj.onsuccess;
  68602. onerror = obj.onerror;
  68603. }
  68604. var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new window.ActiveXObject('Microsoft.XMLHTTP');
  68605. xhr.open('GET', url, true);
  68606. xhr.onreadystatechange = function () {
  68607. if (xhr.readyState == 4) {
  68608. if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {
  68609. onsuccess && onsuccess(xhr.responseText);
  68610. } else {
  68611. onerror && onerror();
  68612. }
  68613. xhr.onreadystatechange = new Function();
  68614. xhr = null;
  68615. }
  68616. };
  68617. xhr.send(null);
  68618. }
  68619. }]);
  68620. return Http;
  68621. }();
  68622. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Config.js
  68623. function Config_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  68624. function Config_createClass(Constructor, protoProps, staticProps) { if (protoProps) Config_defineProperties(Constructor.prototype, protoProps); if (staticProps) Config_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  68625. function Config_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68626. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  68627. * This program are made available under the terms of the Apache License, Version 2.0
  68628. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68629. var Config = /*#__PURE__*/Config_createClass(function Config() {
  68630. Config_classCallCheck(this, Config);
  68631. });
  68632. /**
  68633. * @enum EVENT
  68634. * @description 事件
  68635. * @type {Object}
  68636. * @private
  68637. */
  68638. Config.EVENT = {
  68639. //窗口大小变化
  68640. RESIZE: 'resize',
  68641. //鼠标按钮被(手指)按下,事件对象是:目标图形元素或空
  68642. CLICK: 'click',
  68643. //双击事件
  68644. DBLCLICK: 'dblclick',
  68645. //鼠标滚轮变化,事件对象是:目标图形元素或空
  68646. MOUSEWHEEL: 'mousewheel',
  68647. //鼠标(手指)被移动,事件对象是:目标图形元素或空
  68648. MOUSEMOVE: 'mousemove',
  68649. //鼠标移到某图形元素之上,事件对象是:目标图形元素
  68650. MOUSEOVER: 'mouseover',
  68651. //鼠标从某图形元素移开,事件对象是:目标图形元素
  68652. MOUSEOUT: 'mouseout',
  68653. //鼠标按钮(手指)被按下,事件对象是:目标图形元素或空
  68654. MOUSEDOWN: 'mousedown',
  68655. //鼠标按键(手指)被松开,事件对象是:目标图形元素或空
  68656. MOUSEUP: 'mouseup',
  68657. //全局离开,MOUSEOUT触发比较频繁,一次离开优化绑定
  68658. GLOBALOUT: 'globalout',
  68659. // 一次成功元素拖拽的行为事件过程是:
  68660. // dragstart > dragenter > dragover [> dragleave] > drop > dragend
  68661. //开始拖拽时触发,事件对象是:被拖拽图形元素
  68662. DRAGSTART: 'dragstart',
  68663. //拖拽完毕时触发(在drop之后触发),事件对象是:被拖拽图形元素
  68664. DRAGEND: 'dragend',
  68665. //拖拽图形元素进入目标图形元素时触发,事件对象是:目标图形元素
  68666. DRAGENTER: 'dragenter',
  68667. //拖拽图形元素在目标图形元素上移动时触发,事件对象是:目标图形元素
  68668. DRAGOVER: 'dragover',
  68669. //拖拽图形元素离开目标图形元素时触发,事件对象是:目标图形元素
  68670. DRAGLEAVE: 'dragleave',
  68671. //拖拽图形元素放在目标图形元素内时触发,事件对象是:目标图形元素
  68672. DROP: 'drop',
  68673. //touch end - start < delay is click
  68674. touchClickDelay: 300
  68675. };
  68676. /**
  68677. * @enum catchBrushException
  68678. * @description 是否异常捕获
  68679. * @type {boolean}
  68680. * @private
  68681. */
  68682. Config.catchBrushException = false;
  68683. /**
  68684. * @enum debugMode
  68685. * @description debug 日志选项:catchBrushException 为 true 下有效。
  68686. * 0 : 不生成debug数据,发布用
  68687. * 1 : 异常抛出,调试用
  68688. * 2 : 控制台输出,调试用
  68689. * @type {boolean}
  68690. * @private
  68691. */
  68692. Config.debugMode = 0;
  68693. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Log.js
  68694. function Log_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68695. function Log_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  68696. function Log_createClass(Constructor, protoProps, staticProps) { if (protoProps) Log_defineProperties(Constructor.prototype, protoProps); if (staticProps) Log_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  68697. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  68698. * This program are made available under the terms of the Apache License, Version 2.0
  68699. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68700. /**
  68701. * @private
  68702. * @class LevelRenderer.Tool.Log
  68703. * @category Visualization Theme
  68704. * @classdesc LevelRenderer 工具-日志
  68705. */
  68706. var Log = /*#__PURE__*/function () {
  68707. function Log() {
  68708. Log_classCallCheck(this, Log);
  68709. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Log";
  68710. return function () {
  68711. if (+Config.debugMode === 0) {
  68712. return;
  68713. } else if (+Config.debugMode === 1) {
  68714. for (var k in arguments) {
  68715. throw new Error(arguments[k]);
  68716. }
  68717. } else if (+Config.debugMode > 1) {
  68718. for (var _k2 in arguments) {
  68719. console.log(arguments[_k2]);
  68720. }
  68721. }
  68722. };
  68723. /* for debug
  68724. return function(mes) {
  68725. document.getElementById('wrong-message').innerHTML =
  68726. mes + ' ' + (new Date() - 0)
  68727. + '<br/>'
  68728. + document.getElementById('wrong-message').innerHTML;
  68729. };
  68730. */
  68731. }
  68732. Log_createClass(Log, [{
  68733. key: "destory",
  68734. value: function destory() {
  68735. return true;
  68736. }
  68737. }]);
  68738. return Log;
  68739. }();
  68740. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Math.js
  68741. function Math_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68742. function Math_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  68743. function Math_createClass(Constructor, protoProps, staticProps) { if (protoProps) Math_defineProperties(Constructor.prototype, protoProps); if (staticProps) Math_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  68744. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  68745. * This program are made available under the terms of the Apache License, Version 2.0
  68746. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68747. /**
  68748. * @private
  68749. * @class LevelRenderer.Tool.Math
  68750. * @category Visualization Theme
  68751. * @classdesc LevelRenderer 工具-数学辅助类
  68752. */
  68753. var MathTool = /*#__PURE__*/function () {
  68754. function MathTool() {
  68755. Math_classCallCheck(this, MathTool);
  68756. /**
  68757. * @member {number} LevelRenderer.Tool.Math._radians
  68758. * @description 角度与弧度转化参数
  68759. */
  68760. this._radians = window.Math.PI / 180;
  68761. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Math";
  68762. }
  68763. /**
  68764. * @function LevelRenderer.Tool.Math.prototype.sin
  68765. * @description 正弦函数。
  68766. * @param {number} angle - 弧度(角度)参数。
  68767. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  68768. * @returns {number} sin 值。
  68769. */
  68770. Math_createClass(MathTool, [{
  68771. key: "sin",
  68772. value: function sin(angle, isDegrees) {
  68773. return window.Math.sin(isDegrees ? angle * this._radians : angle);
  68774. }
  68775. /**
  68776. * @function LevelRenderer.Tool.Math.prototype.cos
  68777. * @description 余弦函数。
  68778. * @param {number} angle - 弧度(角度)参数。
  68779. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  68780. * @returns {number} cos 值。
  68781. */
  68782. }, {
  68783. key: "cos",
  68784. value: function cos(angle, isDegrees) {
  68785. return window.Math.cos(isDegrees ? angle * this._radians : angle);
  68786. }
  68787. /**
  68788. * @function LevelRenderer.Tool.Math.prototype.degreeToRadian
  68789. * @description 角度转弧度。
  68790. * @param {number} angle - 弧度(角度)参数。
  68791. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  68792. * @returns {number} 弧度值。
  68793. */
  68794. }, {
  68795. key: "degreeToRadian",
  68796. value: function degreeToRadian(angle) {
  68797. return angle * this._radians;
  68798. }
  68799. /**
  68800. * @function LevelRenderer.Tool.Math.prototype.radianToDegree
  68801. * @description 弧度转角度。
  68802. * @param {number} angle - 弧度(角度)参数。
  68803. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  68804. * @returns {number} 角度。
  68805. */
  68806. }, {
  68807. key: "radianToDegree",
  68808. value: function radianToDegree(angle) {
  68809. return angle / this._radians;
  68810. }
  68811. }]);
  68812. return MathTool;
  68813. }();
  68814. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Matrix.js
  68815. function Matrix_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68816. function Matrix_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  68817. function Matrix_createClass(Constructor, protoProps, staticProps) { if (protoProps) Matrix_defineProperties(Constructor.prototype, protoProps); if (staticProps) Matrix_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  68818. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  68819. * This program are made available under the terms of the Apache License, Version 2.0
  68820. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68821. /**
  68822. * @private
  68823. * @class LevelRenderer.Tool.Matrix
  68824. * @category Visualization Theme
  68825. * @classdesc LevelRenderer 工具-3x2矩阵操作类
  68826. */
  68827. var Matrix = /*#__PURE__*/function () {
  68828. function Matrix() {
  68829. Matrix_classCallCheck(this, Matrix);
  68830. /**
  68831. * @member {Object} LevelRenderer.Tool.Matrix.prototype.ArrayCtor
  68832. * @description 数组类型控制
  68833. */
  68834. this.ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array;
  68835. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Matrix";
  68836. }
  68837. /**
  68838. * @function LevelRenderer.Tool.Matrix.prototype.create
  68839. * @description 创建一个单位矩阵。
  68840. * @returns {(Float32Array|Array.<number>)} 单位矩阵。
  68841. */
  68842. Matrix_createClass(Matrix, [{
  68843. key: "create",
  68844. value: function create() {
  68845. var ArrayCtor = this.ArrayCtor;
  68846. var out = new ArrayCtor(6);
  68847. this.identity(out);
  68848. return out;
  68849. }
  68850. /**
  68851. * @function LevelRenderer.Tool.Matrix.prototype.identity
  68852. * @description 设置矩阵为单位矩阵。
  68853. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  68854. * @returns {(Float32Array|Array.<number>)} 单位矩阵。
  68855. */
  68856. }, {
  68857. key: "identity",
  68858. value: function identity(out) {
  68859. out[0] = 1;
  68860. out[1] = 0;
  68861. out[2] = 0;
  68862. out[3] = 1;
  68863. out[4] = 0;
  68864. out[5] = 0;
  68865. return out;
  68866. }
  68867. /**
  68868. * @function LevelRenderer.Tool.Matrix.prototype.copy
  68869. * @description 复制矩阵。
  68870. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  68871. * @returns {(Float32Array|Array.<number>)} 克隆矩阵。
  68872. */
  68873. }, {
  68874. key: "copy",
  68875. value: function copy(out, m) {
  68876. out[0] = m[0];
  68877. out[1] = m[1];
  68878. out[2] = m[2];
  68879. out[3] = m[3];
  68880. out[4] = m[4];
  68881. out[5] = m[5];
  68882. return out;
  68883. }
  68884. /**
  68885. * @function LevelRenderer.Tool.Matrix.prototype.mul
  68886. * @description 矩阵相乘。
  68887. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  68888. * @param {(Float32Array|Array.<number>)} m1 - 矩阵m1。
  68889. * @param {(Float32Array|Array.<number>)} m2- 矩阵m2。
  68890. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  68891. */
  68892. }, {
  68893. key: "mul",
  68894. value: function mul(out, m1, m2) {
  68895. out[0] = m1[0] * m2[0] + m1[2] * m2[1];
  68896. out[1] = m1[1] * m2[0] + m1[3] * m2[1];
  68897. out[2] = m1[0] * m2[2] + m1[2] * m2[3];
  68898. out[3] = m1[1] * m2[2] + m1[3] * m2[3];
  68899. out[4] = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];
  68900. out[5] = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];
  68901. return out;
  68902. }
  68903. /**
  68904. * @function LevelRenderer.Tool.Matrix.prototype.mul
  68905. * @description 平移变换。
  68906. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  68907. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  68908. * @param {(Float32Array|Array.<number>)} v- 平移参数。
  68909. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  68910. */
  68911. }, {
  68912. key: "translate",
  68913. value: function translate(out, a, v) {
  68914. out[0] = a[0];
  68915. out[1] = a[1];
  68916. out[2] = a[2];
  68917. out[3] = a[3];
  68918. out[4] = a[4] + v[0];
  68919. out[5] = a[5] + v[1];
  68920. return out;
  68921. }
  68922. /**
  68923. * @function LevelRenderer.Tool.Matrix.prototype.rotate
  68924. * @description 平移变换。
  68925. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  68926. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  68927. * @param {(Float32Array|Array.<number>)} rad - 旋转参数。
  68928. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  68929. */
  68930. }, {
  68931. key: "rotate",
  68932. value: function rotate(out, a, rad) {
  68933. var aa = a[0];
  68934. var ac = a[2];
  68935. var atx = a[4];
  68936. var ab = a[1];
  68937. var ad = a[3];
  68938. var aty = a[5];
  68939. var st = Math.sin(rad);
  68940. var ct = Math.cos(rad);
  68941. out[0] = aa * ct + ab * st;
  68942. out[1] = -aa * st + ab * ct;
  68943. out[2] = ac * ct + ad * st;
  68944. out[3] = -ac * st + ct * ad;
  68945. out[4] = ct * atx + st * aty;
  68946. out[5] = ct * aty - st * atx;
  68947. return out;
  68948. }
  68949. /**
  68950. * @function LevelRenderer.Tool.Matrix.prototype.scale
  68951. * @description 缩放变换。
  68952. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  68953. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  68954. * @param {(Float32Array|Array.<number>)} v - 缩放参数。
  68955. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  68956. */
  68957. }, {
  68958. key: "scale",
  68959. value: function scale(out, a, v) {
  68960. var vx = v[0];
  68961. var vy = v[1];
  68962. out[0] = a[0] * vx;
  68963. out[1] = a[1] * vy;
  68964. out[2] = a[2] * vx;
  68965. out[3] = a[3] * vy;
  68966. out[4] = a[4] * vx;
  68967. out[5] = a[5] * vy;
  68968. return out;
  68969. }
  68970. /**
  68971. * @function LevelRenderer.Tool.Matrix.prototype.invert
  68972. * @description 求逆矩阵。
  68973. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  68974. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  68975. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  68976. */
  68977. }, {
  68978. key: "invert",
  68979. value: function invert(out, a) {
  68980. var aa = a[0];
  68981. var ac = a[2];
  68982. var atx = a[4];
  68983. var ab = a[1];
  68984. var ad = a[3];
  68985. var aty = a[5];
  68986. var det = aa * ad - ab * ac;
  68987. if (!det) {
  68988. return null;
  68989. }
  68990. det = 1.0 / det;
  68991. out[0] = ad * det;
  68992. out[1] = -ab * det;
  68993. out[2] = -ac * det;
  68994. out[3] = aa * det;
  68995. out[4] = (ac * aty - ad * atx) * det;
  68996. out[5] = (ab * atx - aa * aty) * det;
  68997. return out;
  68998. }
  68999. /**
  69000. * @function LevelRenderer.Tool.Matrix.prototype.mulVector
  69001. * @description 矩阵左乘向量。
  69002. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  69003. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  69004. * @param {(Float32Array|Array.<number>)} v - 缩放参数。
  69005. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  69006. */
  69007. }, {
  69008. key: "mulVector",
  69009. value: function mulVector(out, a, v) {
  69010. var aa = a[0];
  69011. var ac = a[2];
  69012. var atx = a[4];
  69013. var ab = a[1];
  69014. var ad = a[3];
  69015. var aty = a[5];
  69016. out[0] = v[0] * aa + v[1] * ac + atx;
  69017. out[1] = v[0] * ab + v[1] * ad + aty;
  69018. return out;
  69019. }
  69020. }]);
  69021. return Matrix;
  69022. }();
  69023. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SUtil.js
  69024. function SUtil_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  69025. function SUtil_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  69026. function SUtil_createClass(Constructor, protoProps, staticProps) { if (protoProps) SUtil_defineProperties(Constructor.prototype, protoProps); if (staticProps) SUtil_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  69027. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  69028. * This program are made available under the terms of the Apache License, Version 2.0
  69029. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  69030. var SUtil_SUtil = /*#__PURE__*/function () {
  69031. function SUtil() {
  69032. SUtil_classCallCheck(this, SUtil);
  69033. }
  69034. SUtil_createClass(SUtil, null, [{
  69035. key: "SUtil_smoothBezier",
  69036. value:
  69037. /**
  69038. * @function LevelRenderer.SUtil.SUtil_smoothBezier
  69039. * @description 贝塞尔平滑曲线。
  69040. * @private
  69041. * @param {Array} points - 线段顶点数组。
  69042. * @param {number} smooth - 平滑等级, 0-1。
  69043. * @param {boolean} isLoop - isLoop。
  69044. * @param {Array} constraint - 将计算出来的控制点约束在一个包围盒内,比如 [[0, 0], [100, 100]], 这个包围盒会与整个折线的包围盒做一个并集用来约束控制点。
  69045. * @param {Array.<number>} [originalPosition=[0, 0]] - 参考原点。
  69046. * @return {Array} 生成的平滑节点数组。
  69047. */
  69048. function SUtil_smoothBezier(points, smooth, isLoop, constraint, originalPosition) {
  69049. if (!originalPosition || originalPosition.length !== 2) {
  69050. originalPosition = [0, 0];
  69051. }
  69052. var __OP = originalPosition;
  69053. var cps = [];
  69054. var v = [];
  69055. var v1 = [];
  69056. var v2 = [];
  69057. var hasConstraint = !!constraint;
  69058. var min, max;
  69059. if (hasConstraint) {
  69060. min = [Infinity, Infinity];
  69061. max = [-Infinity, -Infinity];
  69062. var _len = points.length;
  69063. for (var i = 0; i < _len; i++) {
  69064. SUtil.Util_vector.min(min, min, [points[i][0] + __OP[0], points[i][1] + __OP[1]]);
  69065. SUtil.Util_vector.max(max, max, [points[i][0] + __OP[0], points[i][1] + __OP[1]]);
  69066. }
  69067. // 与指定的包围盒做并集
  69068. SUtil.Util_vector.min(min, min, constraint[0]);
  69069. SUtil.Util_vector.max(max, max, constraint[1]);
  69070. }
  69071. var len = points.length;
  69072. for (var _i2 = 0; _i2 < len; _i2++) {
  69073. var point = [points[_i2][0] + __OP[0], points[_i2][1] + __OP[1]];
  69074. var prevPoint = void 0;
  69075. var nextPoint = void 0;
  69076. if (isLoop) {
  69077. prevPoint = [points[_i2 ? _i2 - 1 : len - 1][0] + __OP[0], points[_i2 ? _i2 - 1 : len - 1][1] + __OP[1]];
  69078. nextPoint = [points[(_i2 + 1) % len][0] + __OP[0], points[(_i2 + 1) % len][1] + __OP[1]];
  69079. } else {
  69080. if (_i2 === 0 || _i2 === len - 1) {
  69081. cps.push([points[_i2][0] + __OP[0], points[_i2][1] + __OP[1]]);
  69082. continue;
  69083. } else {
  69084. prevPoint = [points[_i2 - 1][0] + __OP[0], points[_i2 - 1][1] + __OP[1]];
  69085. nextPoint = [points[_i2 + 1][0] + __OP[0], points[_i2 + 1][1] + __OP[1]];
  69086. }
  69087. }
  69088. SUtil.Util_vector.sub(v, nextPoint, prevPoint);
  69089. // use degree to scale the handle length
  69090. SUtil.Util_vector.scale(v, v, smooth);
  69091. var d0 = SUtil.Util_vector.distance(point, prevPoint);
  69092. var d1 = SUtil.Util_vector.distance(point, nextPoint);
  69093. var sum = d0 + d1;
  69094. if (sum !== 0) {
  69095. d0 /= sum;
  69096. d1 /= sum;
  69097. }
  69098. SUtil.Util_vector.scale(v1, v, -d0);
  69099. SUtil.Util_vector.scale(v2, v, d1);
  69100. var cp0 = SUtil.Util_vector.add([], point, v1);
  69101. var cp1 = SUtil.Util_vector.add([], point, v2);
  69102. if (hasConstraint) {
  69103. SUtil.Util_vector.max(cp0, cp0, min);
  69104. SUtil.Util_vector.min(cp0, cp0, max);
  69105. SUtil.Util_vector.max(cp1, cp1, min);
  69106. SUtil.Util_vector.min(cp1, cp1, max);
  69107. }
  69108. cps.push(cp0);
  69109. cps.push(cp1);
  69110. }
  69111. if (isLoop) {
  69112. cps.push(cps.shift());
  69113. }
  69114. return cps;
  69115. }
  69116. /**
  69117. * @function LevelRenderer.SUtil.SUtil_smoothSpline
  69118. * @description 插值折线。
  69119. * @private
  69120. * @param {Array} points - 线段顶点数组。
  69121. * @param {boolean} isLoop - isLoop。
  69122. * @param {Array} constraint - 将计算出来的控制点约束在一个包围盒内,比如 [[0, 0], [100, 100]], 这个包围盒会与整个折线的包围盒做一个并集用来约束控制点。
  69123. * @param {Array.<number>} originalPosition - 参考原点。默认值:[0, 0]。
  69124. * @return {Array} 生成的平滑节点数组。
  69125. */
  69126. }, {
  69127. key: "SUtil_smoothSpline",
  69128. value: function SUtil_smoothSpline(points, isLoop, constraint, originalPosition) {
  69129. if (!originalPosition || originalPosition.length !== 2) {
  69130. originalPosition = [0, 0];
  69131. }
  69132. var __OP = originalPosition;
  69133. var len = points.length;
  69134. var ret = [];
  69135. var distance = 0;
  69136. for (var i = 1; i < len; i++) {
  69137. distance += SUtil.Util_vector.distance([points[i - 1][0] + __OP[0], points[i - 1][1] + __OP[1]], [points[i][0] + __OP[0], points[i][1] + __OP[1]]);
  69138. }
  69139. var segs = distance / 5;
  69140. segs = segs < len ? len : segs;
  69141. for (var _i4 = 0; _i4 < segs; _i4++) {
  69142. var pos = _i4 / (segs - 1) * (isLoop ? len : len - 1);
  69143. var idx = Math.floor(pos);
  69144. var w = pos - idx;
  69145. var p0 = void 0;
  69146. var p1 = [points[idx % len][0] + __OP[0], points[idx % len][1] + __OP[1]];
  69147. var p2 = void 0;
  69148. var p3 = void 0;
  69149. if (!isLoop) {
  69150. p0 = [points[idx === 0 ? idx : idx - 1][0] + __OP[0], points[idx === 0 ? idx : idx - 1][1] + __OP[1]];
  69151. p2 = [points[idx > len - 2 ? len - 1 : idx + 1][0] + __OP[0], points[idx > len - 2 ? len - 1 : idx + 1][1] + __OP[1]];
  69152. p3 = [points[idx > len - 3 ? len - 1 : idx + 2][0] + __OP[0], points[idx > len - 3 ? len - 1 : idx + 2][1] + __OP[1]];
  69153. } else {
  69154. p0 = [points[(idx - 1 + len) % len][0] + __OP[0], points[(idx - 1 + len) % len][1] + __OP[1]];
  69155. p2 = [points[(idx + 1) % len][0] + __OP[0], points[(idx + 1) % len][1] + __OP[1]];
  69156. p3 = [points[(idx + 2) % len][0] + __OP[0], points[(idx + 2) % len][1] + __OP[1]];
  69157. }
  69158. var w2 = w * w;
  69159. var w3 = w * w2;
  69160. ret.push([interpolate(p0[0], p1[0], p2[0], p3[0], w, w2, w3), interpolate(p0[1], p1[1], p2[1], p3[1], w, w2, w3)]);
  69161. }
  69162. return ret;
  69163. // inner Function
  69164. function interpolate(p0, p1, p2, p3, t, t2, t3) {
  69165. var v0 = (p2 - p0) * 0.5;
  69166. var v1 = (p3 - p1) * 0.5;
  69167. return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1;
  69168. }
  69169. }
  69170. /**
  69171. * @function LevelRenderer.SUtil.SUtil_dashedLineTo
  69172. * @description 虚线 lineTo。
  69173. */
  69174. }, {
  69175. key: "SUtil_dashedLineTo",
  69176. value: function SUtil_dashedLineTo(ctx, x1, y1, x2, y2, dashLength, customDashPattern) {
  69177. // http://msdn.microsoft.com/en-us/library/ie/dn265063(v=vs.85).aspx
  69178. var dashPattern = [5, 5];
  69179. dashLength = typeof dashLength != 'number' ? 5 : dashLength;
  69180. if (ctx.setLineDash) {
  69181. dashPattern[0] = dashLength;
  69182. dashPattern[1] = dashLength;
  69183. if (customDashPattern && customDashPattern instanceof Array) {
  69184. ctx.setLineDash(customDashPattern);
  69185. } else {
  69186. ctx.setLineDash(dashPattern);
  69187. }
  69188. // ctx.setLineDash(dashPattern);
  69189. ctx.moveTo(x1, y1);
  69190. ctx.lineTo(x2, y2);
  69191. return;
  69192. }
  69193. var dx = x2 - x1;
  69194. var dy = y2 - y1;
  69195. var numDashes = Math.floor(Math.sqrt(dx * dx + dy * dy) / dashLength);
  69196. dx = dx / numDashes;
  69197. dy = dy / numDashes;
  69198. var flag = true;
  69199. for (var i = 0; i < numDashes; ++i) {
  69200. if (flag) {
  69201. ctx.moveTo(x1, y1);
  69202. } else {
  69203. ctx.lineTo(x1, y1);
  69204. }
  69205. flag = !flag;
  69206. x1 += dx;
  69207. y1 += dy;
  69208. }
  69209. ctx.lineTo(x2, y2);
  69210. }
  69211. }]);
  69212. return SUtil;
  69213. }();
  69214. // 把所有工具对象放到全局静态变量上,以便直接调用工具方法,
  69215. // 避免使用工具时频繁的创建工具对象带来的性能消耗。
  69216. SUtil_SUtil.Util_area = new Area();
  69217. SUtil_SUtil.Util_color = new Color();
  69218. SUtil_SUtil.Util_computeBoundingBox = new ComputeBoundingBox();
  69219. SUtil_SUtil.Util_curve = new Curve_Curve();
  69220. SUtil_SUtil.Util_env = new Env();
  69221. SUtil_SUtil.Util_event = new Event_Event();
  69222. SUtil_SUtil.Util_http = new Http();
  69223. SUtil_SUtil.Util_log = new Log();
  69224. SUtil_SUtil.Util_math = new MathTool();
  69225. SUtil_SUtil.Util_matrix = new Matrix();
  69226. SUtil_SUtil.Util = new levelRenderer_Util_Util();
  69227. SUtil_SUtil.Util_vector = new levelRenderer_Vector_Vector();
  69228. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Transformable.js
  69229. function Transformable_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  69230. function Transformable_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  69231. function Transformable_createClass(Constructor, protoProps, staticProps) { if (protoProps) Transformable_defineProperties(Constructor.prototype, protoProps); if (staticProps) Transformable_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  69232. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  69233. * This program are made available under the terms of the Apache License, Version 2.0
  69234. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  69235. /**
  69236. * @private
  69237. * @class LevelRenderer.Transformable
  69238. * @category Visualization Theme
  69239. * @classdesc 可变换超类,所有支持 Canvas Transform 变换操作的类均是此类的子类。此类不可实例化。
  69240. */
  69241. var Transformable = /*#__PURE__*/function () {
  69242. function Transformable() {
  69243. Transformable_classCallCheck(this, Transformable);
  69244. /**
  69245. * @member {Array.<number>} LevelRenderer.Transformable.prototype.position
  69246. * @description 平移,默认值:[0, 0]。
  69247. */
  69248. this.position = [0, 0];
  69249. /**
  69250. * @member {Array.<number>} LevelRenderer.Transformable.prototype.rotation
  69251. * @description 旋转,可以通过数组二三项指定旋转的原点,默认值:[0, 0, 0]。
  69252. */
  69253. this.rotation = [0, 0, 0];
  69254. /**
  69255. * @member {Array.<number>} LevelRenderer.Transformable.prototype.scale
  69256. * @description 缩放,可以通过数组三四项指定缩放的原点,默认值:[1, 1, 0, 0]。
  69257. */
  69258. this.scale = [1, 1, 0, 0];
  69259. /**
  69260. * @member {boolean} LevelRenderer.Transformable.prototype.needLocalTransform
  69261. * @description 是否变换。默认值:false。
  69262. */
  69263. this.needLocalTransform = false;
  69264. /**
  69265. * @member {boolean} LevelRenderer.Transformable.prototype.needTransform
  69266. * @description 是否有坐标变换。默认值:false。
  69267. */
  69268. this.needTransform = false;
  69269. this.CLASS_NAME = "SuperMap.LevelRenderer.Transformable";
  69270. /**
  69271. * @function LevelRenderer.Transformable.prototype.lookAt
  69272. * @description 设置图形的朝向。
  69273. */
  69274. this.lookAt = function () {
  69275. var v = SUtil_SUtil.Util_vector.create();
  69276. // {Array.<Number>|Float32Array} target
  69277. return function (target) {
  69278. if (!this.transform) {
  69279. this.transform = SUtil_SUtil.Util_matrix.create();
  69280. }
  69281. var m = this.transform;
  69282. SUtil_SUtil.Util_vector.sub(v, target, this.position);
  69283. if (isAroundZero(v[0]) && isAroundZero(v[1])) {
  69284. return;
  69285. }
  69286. SUtil_SUtil.Util_vector.normalize(v, v);
  69287. // Y Axis
  69288. // TODO Scale origin ?
  69289. m[2] = v[0] * this.scale[1];
  69290. m[3] = v[1] * this.scale[1];
  69291. // X Axis
  69292. m[0] = v[1] * this.scale[0];
  69293. m[1] = -v[0] * this.scale[0];
  69294. // Position
  69295. m[4] = this.position[0];
  69296. m[5] = this.position[1];
  69297. this.decomposeTransform();
  69298. function isAroundZero(val) {
  69299. var EPSILON = 5e-5;
  69300. return val > -EPSILON && val < EPSILON;
  69301. }
  69302. };
  69303. }();
  69304. }
  69305. /**
  69306. * @function LevelRenderer.Transformable.prototype.destroy
  69307. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  69308. */
  69309. Transformable_createClass(Transformable, [{
  69310. key: "destroy",
  69311. value: function destroy() {
  69312. this.position = null;
  69313. this.rotation = null;
  69314. this.scale = null;
  69315. this.needLocalTransform = null;
  69316. this.needTransform = null;
  69317. }
  69318. /**
  69319. * @function LevelRenderer.Transformable.prototype.updateNeedTransform
  69320. * @description 更新 needLocalTransform
  69321. */
  69322. }, {
  69323. key: "updateNeedTransform",
  69324. value: function updateNeedTransform() {
  69325. this.needLocalTransform = isNotAroundZero(this.rotation[0]) || isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1]) || isNotAroundZero(this.scale[0] - 1) || isNotAroundZero(this.scale[1] - 1);
  69326. function isNotAroundZero(val) {
  69327. var EPSILON = 5e-5;
  69328. return val > EPSILON || val < -EPSILON;
  69329. }
  69330. }
  69331. /**
  69332. * @function LevelRenderer.Transformable.prototype.updateTransform
  69333. * @description 判断是否需要有坐标变换,更新 needTransform 属性。如果有坐标变换,则从 position, rotation, scale 以及父节点的 transform 计算出自身的 transform 矩阵。
  69334. */
  69335. }, {
  69336. key: "updateTransform",
  69337. value: function updateTransform() {
  69338. this.updateNeedTransform();
  69339. if (this.parent) {
  69340. this.needTransform = this.needLocalTransform || this.parent.needTransform;
  69341. } else {
  69342. this.needTransform = this.needLocalTransform;
  69343. }
  69344. if (!this.needTransform) {
  69345. return;
  69346. }
  69347. var origin = [0, 0];
  69348. var m = this.transform || SUtil_SUtil.Util_matrix.create();
  69349. SUtil_SUtil.Util_matrix.identity(m);
  69350. if (this.needLocalTransform) {
  69351. if (isNotAroundZero(this.scale[0]) || isNotAroundZero(this.scale[1])) {
  69352. origin[0] = -this.scale[2] || 0;
  69353. origin[1] = -this.scale[3] || 0;
  69354. var haveOrigin = isNotAroundZero(origin[0]) || isNotAroundZero(origin[1]);
  69355. if (haveOrigin) {
  69356. SUtil_SUtil.Util_matrix.translate(m, m, origin);
  69357. }
  69358. SUtil_SUtil.Util_matrix.scale(m, m, this.scale);
  69359. if (haveOrigin) {
  69360. origin[0] = -origin[0];
  69361. origin[1] = -origin[1];
  69362. SUtil_SUtil.Util_matrix.translate(m, m, origin);
  69363. }
  69364. }
  69365. if (this.rotation instanceof Array) {
  69366. if (this.rotation[0] !== 0) {
  69367. origin[0] = -this.rotation[1] || 0;
  69368. origin[1] = -this.rotation[2] || 0;
  69369. var _haveOrigin = isNotAroundZero(origin[0]) || isNotAroundZero(origin[1]);
  69370. if (_haveOrigin) {
  69371. SUtil_SUtil.Util_matrix.translate(m, m, origin);
  69372. }
  69373. SUtil_SUtil.Util_matrix.rotate(m, m, this.rotation[0]);
  69374. if (_haveOrigin) {
  69375. origin[0] = -origin[0];
  69376. origin[1] = -origin[1];
  69377. SUtil_SUtil.Util_matrix.translate(m, m, origin);
  69378. }
  69379. }
  69380. } else {
  69381. if (+this.rotation !== 0) {
  69382. SUtil_SUtil.Util_matrix.rotate(m, m, this.rotation);
  69383. }
  69384. }
  69385. if (isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1])) {
  69386. SUtil_SUtil.Util_matrix.translate(m, m, this.position);
  69387. }
  69388. }
  69389. // 保存这个变换矩阵
  69390. this.transform = m;
  69391. // 应用父节点变换
  69392. if (this.parent && this.parent.needTransform) {
  69393. if (this.needLocalTransform) {
  69394. SUtil_SUtil.Util_matrix.mul(this.transform, this.parent.transform, this.transform);
  69395. } else {
  69396. SUtil_SUtil.Util_matrix.copy(this.transform, this.parent.transform);
  69397. }
  69398. }
  69399. function isNotAroundZero(val) {
  69400. var EPSILON = 5e-5;
  69401. return val > EPSILON || val < -EPSILON;
  69402. }
  69403. }
  69404. /**
  69405. * @function LevelRenderer.Transformable.prototype.setTransform
  69406. * @description 将自己的 transform 应用到 context 上。
  69407. *
  69408. * @param {Context2D} ctx - Context2D 上下文。
  69409. */
  69410. }, {
  69411. key: "setTransform",
  69412. value: function setTransform(ctx) {
  69413. if (this.needTransform) {
  69414. var m = this.transform;
  69415. ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
  69416. }
  69417. }
  69418. /**
  69419. * @function LevelRenderer.Transformable.prototype.decomposeTransform
  69420. * @description 分解`transform`矩阵到`position`, `rotation`, `scale` 。
  69421. */
  69422. }, {
  69423. key: "decomposeTransform",
  69424. value: function decomposeTransform() {
  69425. if (!this.transform) {
  69426. return;
  69427. }
  69428. var m = this.transform;
  69429. var sx = m[0] * m[0] + m[1] * m[1];
  69430. var position = this.position;
  69431. var scale = this.scale;
  69432. var rotation = this.rotation;
  69433. if (isNotAroundZero(sx - 1)) {
  69434. sx = Math.sqrt(sx);
  69435. }
  69436. var sy = m[2] * m[2] + m[3] * m[3];
  69437. if (isNotAroundZero(sy - 1)) {
  69438. sy = Math.sqrt(sy);
  69439. }
  69440. position[0] = m[4];
  69441. position[1] = m[5];
  69442. scale[0] = sx;
  69443. scale[1] = sy;
  69444. scale[2] = scale[3] = 0;
  69445. rotation[0] = Math.atan2(-m[1] / sy, m[0] / sx);
  69446. rotation[1] = rotation[2] = 0;
  69447. function isNotAroundZero(val) {
  69448. var EPSILON = 5e-5;
  69449. return val > EPSILON || val < -EPSILON;
  69450. }
  69451. }
  69452. }]);
  69453. return Transformable;
  69454. }();
  69455. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Shape.js
  69456. function Shape_typeof(obj) { "@babel/helpers - typeof"; return Shape_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Shape_typeof(obj); }
  69457. function Shape_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  69458. function Shape_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  69459. function Shape_createClass(Constructor, protoProps, staticProps) { if (protoProps) Shape_defineProperties(Constructor.prototype, protoProps); if (staticProps) Shape_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  69460. function Shape_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Shape_get = Reflect.get.bind(); } else { Shape_get = function _get(target, property, receiver) { var base = Shape_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Shape_get.apply(this, arguments); }
  69461. function Shape_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Shape_getPrototypeOf(object); if (object === null) break; } return object; }
  69462. function Shape_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Shape_setPrototypeOf(subClass, superClass); }
  69463. function Shape_setPrototypeOf(o, p) { Shape_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Shape_setPrototypeOf(o, p); }
  69464. function Shape_createSuper(Derived) { var hasNativeReflectConstruct = Shape_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Shape_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Shape_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Shape_possibleConstructorReturn(this, result); }; }
  69465. function Shape_possibleConstructorReturn(self, call) { if (call && (Shape_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Shape_assertThisInitialized(self); }
  69466. function Shape_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  69467. function Shape_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  69468. function Shape_getPrototypeOf(o) { Shape_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Shape_getPrototypeOf(o); }
  69469. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  69470. * This program are made available under the terms of the Apache License, Version 2.0
  69471. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  69472. /**
  69473. * @private
  69474. * @class LevelRenderer.Shape
  69475. * @category Visualization Theme
  69476. * @classdesc 图形(shape)基类。
  69477. * @extends LevelRenderer.Eventful
  69478. * @extends LevelRenderer.Transformable
  69479. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  69480. */
  69481. var Shape_Shape = /*#__PURE__*/function (_mixin) {
  69482. Shape_inherits(Shape, _mixin);
  69483. var _super = Shape_createSuper(Shape);
  69484. function Shape(options) {
  69485. var _this;
  69486. Shape_classCallCheck(this, Shape);
  69487. _this = _super.call(this, options);
  69488. options = options || {};
  69489. /**
  69490. * @member {string} LevelRenderer.Shape.prototype.id
  69491. * @description 唯一标识。
  69492. */
  69493. _this.id = null;
  69494. /**
  69495. * @member {Object} LevelRenderer.Shape.prototype.style
  69496. * @description 基础绘制样式。
  69497. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  69498. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  69499. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  69500. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  69501. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  69502. * @param {number} style.opacity - 绘制透明度。默认值:1。
  69503. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  69504. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  69505. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  69506. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  69507. * @param {string} style.text - 图形中的附加文本。默认值:""。
  69508. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  69509. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  69510. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  69511. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  69512. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  69513. *
  69514. */
  69515. _this.style = {};
  69516. /**
  69517. * @member {Object} LevelRenderer.Shape.prototype.style.__rect
  69518. * @description 包围图形的最小矩形盒子。
  69519. *
  69520. * @param {number} x - 左上角顶点x轴坐标。
  69521. * @param {number} y - 左上角顶点y轴坐标。
  69522. * @param {number} width - 包围盒矩形宽度。
  69523. * @param {number} height - 包围盒矩形高度。
  69524. */
  69525. /**
  69526. * @member {Object} LevelRenderer.Shape.prototype.highlightStyle
  69527. * @description 高亮样式。
  69528. *
  69529. * @param {string} highlightStyle.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  69530. * @param {string} highlightStyle.color - 填充颜色。默认值:"#000000'"。
  69531. * @param {string} highlightStyle.strokeColor - 描边颜色。默认值:"#000000'"。
  69532. * @param {string} highlightStyle.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  69533. * @param {number} highlightStyle.lineWidth - 描边宽度。默认值:1。
  69534. * @param {number} highlightStyle.opacity - 绘制透明度。默认值:1。
  69535. * @param {number} highlightStyle.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  69536. * @param {number} highlightStyle.shadowColor - 阴影颜色。默认值:"#000000'"。
  69537. * @param {number} highlightStyle.shadowOffsetX - 阴影横向偏移。默认值:0。
  69538. * @param {number} highlightStyle.shadowOffsetY - 阴影纵向偏移。默认值:0。
  69539. * @param {string} highlightStyle.text - 图形中的附加文本。默认值:""。
  69540. * @param {string} highlightStyle.textColor - 文本颜色。默认值:"#000000'"。
  69541. * @param {string} highlightStyle.textFont - 附加文本样式。示例:'bold 18px verdana'。
  69542. * @param {string} highlightStyle.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  69543. * @param {string} highlightStyle.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  69544. * @param {string} highlightStyle.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  69545. */
  69546. _this.highlightStyle = null;
  69547. /**
  69548. * @member {Object} LevelRenderer.Shape.prototype.parent
  69549. * @description 父节点,只读属性。<LevelRenderer.Group>
  69550. */
  69551. _this.parent = null;
  69552. /**
  69553. * @member {boolean} LevelRenderer.Shape.prototype.__dirty
  69554. * @description {boolean}
  69555. */
  69556. _this.__dirty = true;
  69557. /**
  69558. * @member {Array} LevelRenderer.Shape.prototype.__clipShapes
  69559. * @description {Array}
  69560. *
  69561. */
  69562. _this.__clipShapes = [];
  69563. /**
  69564. * @member {boolean} LevelRenderer.Shape.prototype.invisible
  69565. * @description 图形是否可见,为 true 时不绘制图形,但是仍能触发鼠标事件。默认值:false。
  69566. */
  69567. _this.invisible = false;
  69568. /**
  69569. * @member {boolean} LevelRenderer.Shape.prototype.ignore
  69570. * @description 图形是否忽略,为 true 时忽略图形的绘制以及事件触发。默认值:false。
  69571. */
  69572. _this.ignore = false;
  69573. /**
  69574. * @member {boolean} LevelRenderer.Shape.prototype.zlevel
  69575. * @description z 层 level,决定绘画在哪层 canvas 中。默认值:0。
  69576. */
  69577. _this.zlevel = 0;
  69578. /**
  69579. * @member {boolean} LevelRenderer.Shape.prototype.draggable
  69580. * @description 是否可拖拽。默认值:false。
  69581. */
  69582. _this.draggable = false;
  69583. /**
  69584. * @member {boolean} LevelRenderer.Shape.prototype.clickable
  69585. * @description 是否可点击。默认值:false。
  69586. */
  69587. _this.clickable = false;
  69588. /**
  69589. * @member {boolean} LevelRenderer.Shape.prototype.hoverable
  69590. * @description 是否可以 hover。默认值:true。
  69591. */
  69592. _this.hoverable = true;
  69593. /**
  69594. * @member {number} LevelRenderer.Shape.prototype.z
  69595. * @description z值,跟zlevel一样影响shape绘制的前后顺序,z值大的shape会覆盖在z值小的上面,但是并不会创建新的canvas,所以优先级低于zlevel,而且频繁改动的开销比zlevel小很多。默认值:0。
  69596. */
  69597. _this.z = 0;
  69598. //地理扩展
  69599. /**
  69600. * @member {Array.<number>} LevelRenderer.Shape.prototype.refOriginalPosition
  69601. * @description 图形参考原点位置,图形的参考中心位置。
  69602. * refOriginalPosition 是长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  69603. *
  69604. * refOriginalPosition 表示图形的参考中心,通常情况下,图形是使用 canvas 的原点位置作为位置参考,
  69605. * 但 refOriginalPosition 可以改变图形的参考位置,例如: refOriginalPosition = [80, 80],
  69606. * 图形圆的 style.x = 20, style.y = 20,那么圆在 canvas 中的实际位置是 [100, 100]。
  69607. *
  69608. * 图形(Shape) 的所有位置相关属性都是以 refOriginalPosition 为参考中心,
  69609. * 也就是说图形的所有位置信息在 canvas 中都是以 refOriginalPosition 为参考的相对位置,只有
  69610. * refOriginalPosition 的值为 [0, 0] 时,形的位置信息才是 canvas 绝对位置。
  69611. *
  69612. * 图形的位置信息通常有:style.pointList,style.x,style.y。
  69613. *
  69614. * refOriginalPosition。默认值是: [0, 0]。
  69615. */
  69616. _this.refOriginalPosition = [0, 0];
  69617. /**
  69618. * @member {string} LevelRenderer.Shape.prototype.refDataID
  69619. * @description 图形所关联数据的 ID。
  69620. *
  69621. */
  69622. _this.refDataID = null;
  69623. /**
  69624. * @member {boolean} LevelRenderer.Shape.prototype.isHoverByRefDataID
  69625. * @description 是否根据 refDataID 进行高亮。用于同时高亮所有 refDataID 相同的图形。
  69626. *
  69627. */
  69628. _this.isHoverByRefDataID = false;
  69629. /**
  69630. * @member {string} LevelRenderer.Shape.prototype.refDataHoverGroup
  69631. * @description 高亮图形组的组名。此属性在 refDataID 有效且 isHoverByRefDataID 为 true 时生效。
  69632. * 一旦设置此属性,且属性值有效,只有关联同一个数据的图形且此属性相同的图形才会高亮。
  69633. *
  69634. */
  69635. _this.refDataHoverGroup = null;
  69636. /**
  69637. * @member {Object} LevelRenderer.Shape.prototype.dataInfo
  69638. * @description 图形的数据信息。
  69639. *
  69640. */
  69641. _this.dataInfo = null;
  69642. Util_Util.extend(Shape_assertThisInitialized(_this), options);
  69643. _this.id = _this.id || Util_Util.createUniqueID("smShape_");
  69644. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape";
  69645. /**
  69646. * @function LevelRenderer.Shape.prototype.getTansform
  69647. * @description 变换鼠标位置到 shape 的局部坐标空间
  69648. *
  69649. */
  69650. _this.getTansform = function () {
  69651. var invTransform = [];
  69652. return function (x, y) {
  69653. var originPos = [x, y];
  69654. // 对鼠标的坐标也做相同的变换
  69655. if (this.needTransform && this.transform) {
  69656. SUtil_SUtil.Util_matrix.invert(invTransform, this.transform);
  69657. SUtil_SUtil.Util_matrix.mulVector(originPos, invTransform, [x, y, 1]);
  69658. if (x == originPos[0] && y == originPos[1]) {
  69659. // 避免外部修改导致的 needTransform 不准确
  69660. this.updateNeedTransform();
  69661. }
  69662. }
  69663. return originPos;
  69664. };
  69665. }();
  69666. return _this;
  69667. }
  69668. /**
  69669. * @function LevelRenderer.Shape.prototype.destroy
  69670. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  69671. */
  69672. Shape_createClass(Shape, [{
  69673. key: "destroy",
  69674. value: function destroy() {
  69675. this.id = null;
  69676. this.style = null;
  69677. this.highlightStyle = null;
  69678. this.parent = null;
  69679. this.__dirty = null;
  69680. this.__clipShapes = null;
  69681. this.invisible = null;
  69682. this.ignore = null;
  69683. this.zlevel = null;
  69684. this.draggable = null;
  69685. this.clickable = null;
  69686. this.hoverable = null;
  69687. this.z = null;
  69688. this.refOriginalPosition = null;
  69689. this.refDataID = null;
  69690. this.refDataHoverGroup = null;
  69691. this.isHoverByRefDataID = null;
  69692. this.dataInfo = null;
  69693. Shape_get(Shape_getPrototypeOf(Shape.prototype), "destroy", this).call(this);
  69694. }
  69695. /**
  69696. * @function LevelRenderer.Shape.prototype.brush
  69697. * @description 绘制图形。
  69698. *
  69699. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  69700. * @param {boolean} isHighlight - 是否使用高亮属性。
  69701. * @param {function} updateCallback - 需要异步加载资源的 shape 可以通过这个 callback(e),让painter更新视图,base.brush 没用,需要的话重载 brush。
  69702. */
  69703. }, {
  69704. key: "brush",
  69705. value: function brush(ctx, isHighlight) {
  69706. var style = this.beforeBrush(ctx, isHighlight);
  69707. ctx.beginPath();
  69708. this.buildPath(ctx, style);
  69709. switch (style.brushType) {
  69710. /* jshint ignore:start */
  69711. case 'both':
  69712. this.setCtxGlobalAlpha(ctx, "fill", style);
  69713. ctx.fill();
  69714. if (style.lineWidth > 0) {
  69715. this.setCtxGlobalAlpha(ctx, "stroke", style);
  69716. ctx.stroke();
  69717. }
  69718. this.setCtxGlobalAlpha(ctx, "reset", style);
  69719. break;
  69720. case 'stroke':
  69721. this.setCtxGlobalAlpha(ctx, "stroke", style);
  69722. style.lineWidth > 0 && ctx.stroke();
  69723. this.setCtxGlobalAlpha(ctx, "reset", style);
  69724. break;
  69725. /* jshint ignore:end */
  69726. default:
  69727. this.setCtxGlobalAlpha(ctx, "fill", style);
  69728. ctx.fill();
  69729. this.setCtxGlobalAlpha(ctx, "reset", style);
  69730. break;
  69731. }
  69732. this.drawText(ctx, style, this.style);
  69733. this.afterBrush(ctx);
  69734. }
  69735. /**
  69736. * @function LevelRenderer.Shape.prototype.beforeBrush
  69737. * @description 具体绘制操作前的一些公共操作。
  69738. *
  69739. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  69740. * @param {boolean} isHighlight - 是否使用高亮属性。
  69741. * @return {Object} 处理后的样式。
  69742. */
  69743. }, {
  69744. key: "beforeBrush",
  69745. value: function beforeBrush(ctx, isHighlight) {
  69746. var style = this.style;
  69747. if (this.brushTypeOnly) {
  69748. style.brushType = this.brushTypeOnly;
  69749. }
  69750. if (isHighlight) {
  69751. // 根据style扩展默认高亮样式
  69752. style = this.getHighlightStyle(style, this.highlightStyle || {}, this.brushTypeOnly);
  69753. }
  69754. if (this.brushTypeOnly == 'stroke') {
  69755. style.strokeColor = style.strokeColor || style.color;
  69756. }
  69757. ctx.save();
  69758. this.doClip(ctx);
  69759. this.setContext(ctx, style);
  69760. // 设置transform
  69761. this.setTransform(ctx);
  69762. return style;
  69763. }
  69764. /**
  69765. * @function LevelRenderer.Shape.prototype.afterBrush
  69766. * @description 绘制后的处理。
  69767. *
  69768. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  69769. *
  69770. */
  69771. }, {
  69772. key: "afterBrush",
  69773. value: function afterBrush(ctx) {
  69774. ctx.restore();
  69775. }
  69776. /**
  69777. * @function LevelRenderer.Shape.prototype.setContext
  69778. * @description 设置 fillStyle, strokeStyle, shadow 等通用绘制样式。
  69779. *
  69780. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  69781. * @param {Object} style - 样式。
  69782. *
  69783. */
  69784. }, {
  69785. key: "setContext",
  69786. value: function setContext(ctx, style) {
  69787. var STYLE_CTX_MAP = [['color', 'fillStyle'], ['strokeColor', 'strokeStyle'], ['opacity', 'globalAlpha'], ['lineCap', 'lineCap'], ['lineJoin', 'lineJoin'], ['miterLimit', 'miterLimit'], ['lineWidth', 'lineWidth'], ['shadowBlur', 'shadowBlur'], ['shadowColor', 'shadowColor'], ['shadowOffsetX', 'shadowOffsetX'], ['shadowOffsetY', 'shadowOffsetY']];
  69788. for (var i = 0, len = STYLE_CTX_MAP.length; i < len; i++) {
  69789. var styleProp = STYLE_CTX_MAP[i][0];
  69790. var styleValue = style[styleProp];
  69791. var ctxProp = STYLE_CTX_MAP[i][1];
  69792. if (typeof styleValue != 'undefined') {
  69793. ctx[ctxProp] = styleValue;
  69794. }
  69795. }
  69796. }
  69797. /**
  69798. * @function LevelRenderer.Shape.prototype.doClip
  69799. *
  69800. */
  69801. }, {
  69802. key: "doClip",
  69803. value: function doClip(ctx) {
  69804. var clipShapeInvTransform = SUtil_SUtil.Util_matrix.create();
  69805. if (this.__clipShapes) {
  69806. for (var i = 0; i < this.__clipShapes.length; i++) {
  69807. var clipShape = this.__clipShapes[i];
  69808. if (clipShape.needTransform) {
  69809. var m = clipShape.transform;
  69810. SUtil_SUtil.Util_matrix.invert(clipShapeInvTransform, m);
  69811. ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
  69812. }
  69813. ctx.beginPath();
  69814. clipShape.buildPath(ctx, clipShape.style);
  69815. ctx.clip();
  69816. // Transform back
  69817. if (clipShape.needTransform) {
  69818. var _m = clipShapeInvTransform;
  69819. ctx.transform(_m[0], _m[1], _m[2], _m[3], _m[4], _m[5]);
  69820. }
  69821. }
  69822. }
  69823. }
  69824. /**
  69825. * @function LevelRenderer.Shape.prototype.getHighlightStyle
  69826. * @description 根据默认样式扩展高亮样式
  69827. *
  69828. * @param {Object} style - 样式。
  69829. * @param {Object} highlightStyle - 高亮样式。
  69830. * @param {string} brushTypeOnly - brushTypeOnly。
  69831. *
  69832. */
  69833. }, {
  69834. key: "getHighlightStyle",
  69835. value: function getHighlightStyle(style, highlightStyle, brushTypeOnly) {
  69836. var newStyle = {};
  69837. for (var k in style) {
  69838. newStyle[k] = style[k];
  69839. }
  69840. var highlightColor = SUtil_SUtil.Util_color.getHighlightColor();
  69841. // 根据highlightStyle扩展
  69842. if (style.brushType != 'stroke') {
  69843. // 带填充则用高亮色加粗边线
  69844. newStyle.strokeColor = highlightColor;
  69845. // SMIC-方法修改 - start
  69846. newStyle.lineWidth = style.lineWidth || 1;
  69847. // 原始代码
  69848. // newStyle.lineWidth = (style.lineWidth || 1)
  69849. // + this.getHighlightZoom();
  69850. // 修改代码1
  69851. // if(!style.lineType || style.lineType === "solid"){
  69852. // newStyle.lineWidth = (style.lineWidth || 1)
  69853. // + this.getHighlightZoom();
  69854. // }
  69855. // else{
  69856. // newStyle.lineWidth = (style.lineWidth || 1);
  69857. // }
  69858. // SMIC-方法修改 - end
  69859. newStyle.brushType = 'both';
  69860. } else {
  69861. if (brushTypeOnly != 'stroke') {
  69862. // 描边型的则用原色加工高亮
  69863. newStyle.strokeColor = highlightColor;
  69864. // SMIC-方法修改 - start
  69865. newStyle.lineWidth = style.lineWidth || 1;
  69866. // 原始代码
  69867. // newStyle.lineWidth = (style.lineWidth || 1)
  69868. // + this.getHighlightZoom();
  69869. // 修改代码1
  69870. // if(!style.lineType || style.lineType === "solid"){
  69871. // newStyle.lineWidth = (style.lineWidth || 1)
  69872. // + this.getHighlightZoom();
  69873. // }
  69874. // else{
  69875. // newStyle.lineWidth = (style.lineWidth || 1);
  69876. // }
  69877. // SMIC-方法修改 - end
  69878. } else {
  69879. // 线型的则用原色加工高亮
  69880. newStyle.strokeColor = highlightStyle.strokeColor || SUtil_SUtil.Util_color.mix(style.strokeColor, SUtil_SUtil.Util_color.toRGB(highlightColor));
  69881. }
  69882. }
  69883. // 可自定义覆盖默认值
  69884. for (var _k2 in highlightStyle) {
  69885. if (typeof highlightStyle[_k2] != 'undefined') {
  69886. newStyle[_k2] = highlightStyle[_k2];
  69887. }
  69888. }
  69889. return newStyle;
  69890. }
  69891. /**
  69892. * @function LevelRenderer.Shape.prototype.getHighlightZoom
  69893. * @description 高亮放大效果参数,当前统一设置为6,如有需要差异设置,通过 this.type 判断实例类型
  69894. *
  69895. */
  69896. }, {
  69897. key: "getHighlightZoom",
  69898. value: function getHighlightZoom() {
  69899. return this.type != 'text' ? 6 : 2;
  69900. }
  69901. /**
  69902. * @function LevelRenderer.Shape.prototype.drift
  69903. * @description 移动位置
  69904. *
  69905. * @param {Object} dx - 横坐标变化。
  69906. * @param {Object} dy - 纵坐标变化。
  69907. *
  69908. */
  69909. }, {
  69910. key: "drift",
  69911. value: function drift(dx, dy) {
  69912. this.position[0] += dx;
  69913. this.position[1] += dy;
  69914. }
  69915. /**
  69916. * @function LevelRenderer.Shape.prototype.buildPath
  69917. * @description 构建绘制的Path。子类必须重新实现此方法。
  69918. *
  69919. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  69920. * @param {Object} style - 样式。
  69921. */
  69922. }, {
  69923. key: "buildPath",
  69924. value: function buildPath(ctx, style) {
  69925. // eslint-disable-line no-unused-vars
  69926. SUtil_SUtil.Util_log('buildPath not implemented in ' + this.type);
  69927. }
  69928. /**
  69929. * @function LevelRenderer.Shape.prototype.getRect
  69930. * @description 计算返回包围盒矩形。子类必须重新实现此方法。
  69931. *
  69932. * @param {Object} style - 样式。
  69933. */
  69934. }, {
  69935. key: "getRect",
  69936. value: function getRect(style) {
  69937. // eslint-disable-line no-unused-vars
  69938. SUtil_SUtil.Util_log('getRect not implemented in ' + this.type);
  69939. }
  69940. /**
  69941. * @function LevelRenderer.Shape.prototype.isCover
  69942. * @description 判断鼠标位置是否在图形内。
  69943. *
  69944. * @param {number} x - x。
  69945. * @param {number} y - y。
  69946. */
  69947. }, {
  69948. key: "isCover",
  69949. value: function isCover(x, y) {
  69950. var originPos = this.getTansform(x, y);
  69951. x = originPos[0];
  69952. y = originPos[1];
  69953. // 快速预判并保留判断矩形
  69954. var rect = this.style.__rect;
  69955. if (!rect) {
  69956. rect = this.style.__rect = this.getRect(this.style);
  69957. }
  69958. if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) {
  69959. // 矩形内
  69960. return SUtil_SUtil.Util_area.isInside(this, this.style, x, y);
  69961. }
  69962. return false;
  69963. }
  69964. /**
  69965. * @function LevelRenderer.Shape.prototype.drawText
  69966. * @description 绘制附加文本。
  69967. *
  69968. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  69969. * @param {string} style - 样式。
  69970. * @param {string} normalStyle - normalStyle 默认样式,用于定位文字显示。
  69971. */
  69972. }, {
  69973. key: "drawText",
  69974. value: function drawText(ctx, style, normalStyle) {
  69975. if (typeof style.text == 'undefined' || style.text === false) {
  69976. return;
  69977. }
  69978. // 字体颜色策略
  69979. var textColor = style.textColor || style.color || style.strokeColor;
  69980. ctx.fillStyle = textColor;
  69981. // 文本与图形间空白间隙
  69982. var dd = 10;
  69983. var al; // 文本水平对齐
  69984. var bl; // 文本垂直对齐
  69985. var tx; // 文本横坐标
  69986. var ty; // 文本纵坐标
  69987. var textPosition = style.textPosition // 用户定义
  69988. || this.textPosition // shape默认
  69989. || 'top'; // 全局默认
  69990. // Smic 方法修改 -start
  69991. var __OP = [];
  69992. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  69993. __OP = [0, 0];
  69994. } else {
  69995. __OP = this.refOriginalPosition;
  69996. }
  69997. //原代码:
  69998. // Smic 方法修改 -end
  69999. switch (textPosition) {
  70000. case 'inside':
  70001. case 'top':
  70002. case 'bottom':
  70003. case 'left':
  70004. case 'right':
  70005. if (this.getRect) {
  70006. var rect = (normalStyle || style).__rect || this.getRect(normalStyle || style);
  70007. switch (textPosition) {
  70008. case 'inside':
  70009. tx = rect.x + rect.width / 2;
  70010. ty = rect.y + rect.height / 2;
  70011. al = 'center';
  70012. bl = 'middle';
  70013. if (style.brushType != 'stroke' && textColor == style.color) {
  70014. ctx.fillStyle = '#fff';
  70015. }
  70016. break;
  70017. case 'left':
  70018. tx = rect.x - dd;
  70019. ty = rect.y + rect.height / 2;
  70020. al = 'end';
  70021. bl = 'middle';
  70022. break;
  70023. case 'right':
  70024. tx = rect.x + rect.width + dd;
  70025. ty = rect.y + rect.height / 2;
  70026. al = 'start';
  70027. bl = 'middle';
  70028. break;
  70029. case 'top':
  70030. tx = rect.x + rect.width / 2;
  70031. ty = rect.y - dd;
  70032. al = 'center';
  70033. bl = 'bottom';
  70034. break;
  70035. case 'bottom':
  70036. tx = rect.x + rect.width / 2;
  70037. ty = rect.y + rect.height + dd;
  70038. al = 'center';
  70039. bl = 'top';
  70040. break;
  70041. }
  70042. }
  70043. break;
  70044. case 'start':
  70045. case 'end':
  70046. var xStart = 0;
  70047. var xEnd = 0;
  70048. var yStart = 0;
  70049. var yEnd = 0;
  70050. if (typeof style.pointList != 'undefined') {
  70051. var pointList = style.pointList;
  70052. if (pointList.length < 2) {
  70053. // 少于2个点就不画了~
  70054. return;
  70055. }
  70056. var length = pointList.length;
  70057. switch (textPosition) {
  70058. // Smic 方法修改 -start
  70059. case 'start':
  70060. xStart = pointList[0][0] + __OP[0];
  70061. xEnd = pointList[1][0] + __OP[0];
  70062. yStart = pointList[0][1] + __OP[1];
  70063. yEnd = pointList[1][1] + __OP[1];
  70064. break;
  70065. case 'end':
  70066. xStart = pointList[length - 2][0] + __OP[0];
  70067. xEnd = pointList[length - 1][0] + __OP[0];
  70068. yStart = pointList[length - 2][1] + __OP[1];
  70069. yEnd = pointList[length - 1][1] + __OP[1];
  70070. break;
  70071. //原代码:
  70072. /*
  70073. case 'start':
  70074. xStart = pointList[0][0];
  70075. xEnd = pointList[1][0];
  70076. yStart = pointList[0][1];
  70077. yEnd = pointList[1][1];
  70078. break;
  70079. case 'end':
  70080. xStart = pointList[length - 2][0];
  70081. xEnd = pointList[length - 1][0];
  70082. yStart = pointList[length - 2][1];
  70083. yEnd = pointList[length - 1][1];
  70084. break;
  70085. */
  70086. // Smic 方法修改 -end
  70087. }
  70088. } else {
  70089. // Smic 方法修改 -start
  70090. xStart = style.xStart + __OP[0] || 0;
  70091. xEnd = style.xEnd + __OP[0] || 0;
  70092. yStart = style.yStart + __OP[1] || 0;
  70093. yEnd = style.yEnd + __OP[1] || 0;
  70094. //原代码:
  70095. /*
  70096. xStart = style.xStart || 0;
  70097. xEnd = style.xEnd || 0;
  70098. yStart = style.yStart || 0;
  70099. yEnd = style.yEnd || 0;
  70100. */
  70101. // Smic 方法修改 -end
  70102. }
  70103. switch (textPosition) {
  70104. case 'start':
  70105. al = xStart < xEnd ? 'end' : 'start';
  70106. bl = yStart < yEnd ? 'bottom' : 'top';
  70107. tx = xStart;
  70108. ty = yStart;
  70109. break;
  70110. case 'end':
  70111. al = xStart < xEnd ? 'start' : 'end';
  70112. bl = yStart < yEnd ? 'top' : 'bottom';
  70113. tx = xEnd;
  70114. ty = yEnd;
  70115. break;
  70116. }
  70117. dd -= 4;
  70118. if (xStart && xEnd && xStart != xEnd) {
  70119. tx -= al == 'end' ? dd : -dd;
  70120. } else {
  70121. al = 'center';
  70122. }
  70123. if (yStart != yEnd) {
  70124. ty -= bl == 'bottom' ? dd : -dd;
  70125. } else {
  70126. bl = 'middle';
  70127. }
  70128. break;
  70129. case 'specific':
  70130. tx = style.textX || 0;
  70131. ty = style.textY || 0;
  70132. al = 'start';
  70133. bl = 'middle';
  70134. break;
  70135. }
  70136. // Smic 方法修改 -start
  70137. if (style.labelXOffset && !isNaN(style.labelXOffset)) {
  70138. tx += style.labelXOffset;
  70139. }
  70140. if (style.labelYOffset && !isNaN(style.labelYOffset)) {
  70141. ty += style.labelYOffset;
  70142. }
  70143. //原代码:
  70144. // Smic 方法修改 -end
  70145. if (tx != null && ty != null) {
  70146. Shape._fillText(ctx, style.text, tx, ty, style.textFont, style.textAlign || al, style.textBaseline || bl);
  70147. }
  70148. }
  70149. /**
  70150. * @function LevelRenderer.Shape.prototype.modSelf
  70151. * @description 图形发生改变
  70152. */
  70153. }, {
  70154. key: "modSelf",
  70155. value: function modSelf() {
  70156. this.__dirty = true;
  70157. if (this.style) {
  70158. this.style.__rect = null;
  70159. }
  70160. if (this.highlightStyle) {
  70161. this.highlightStyle.__rect = null;
  70162. }
  70163. }
  70164. /**
  70165. * @function LevelRenderer.Shape.prototype.isSilent
  70166. * @description 图形是否会触发事件,通过 bind 绑定的事件
  70167. */
  70168. }, {
  70169. key: "isSilent",
  70170. value: function isSilent() {
  70171. return !(this.hoverable || this.draggable || this.clickable || this.onmousemove || this.onmouseover || this.onmouseout || this.onmousedown || this.onmouseup || this.onclick || this.ondragenter || this.ondragover || this.ondragleave || this.ondrop);
  70172. }
  70173. /**
  70174. * @function LevelRenderer.Shape.prototype.setCtxGlobalAlpha
  70175. * @description 设置 Cavans 上下文全局透明度
  70176. *
  70177. * @param {Object} _ctx - Cavans 上下文
  70178. * @param {string} type - one of 'stroke', 'fill', or 'reset'
  70179. * @param {Object} style - Symbolizer hash
  70180. */
  70181. }, {
  70182. key: "setCtxGlobalAlpha",
  70183. value: function setCtxGlobalAlpha(_ctx, type, style) {
  70184. if (type === "fill") {
  70185. _ctx.globalAlpha = typeof style["fillOpacity"] === "undefined" ? typeof style["opacity"] === "undefined" ? 1 : style['opacity'] : style['fillOpacity'];
  70186. } else if (type === "stroke") {
  70187. _ctx.globalAlpha = typeof style["strokeOpacity"] === "undefined" ? typeof style["opacity"] === "undefined" ? 1 : style['opacity'] : style['strokeOpacity'];
  70188. } else {
  70189. _ctx.globalAlpha = typeof style["opacity"] === "undefined" ? 1 : style['opacity'];
  70190. }
  70191. }
  70192. /**
  70193. * @function LevelRenderer.Shape.prototype._fillText
  70194. * @description 填充文本
  70195. */
  70196. }], [{
  70197. key: "_fillText",
  70198. value: function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) {
  70199. if (textFont) {
  70200. ctx.font = textFont;
  70201. }
  70202. ctx.textAlign = textAlign;
  70203. ctx.textBaseline = textBaseline;
  70204. var rect = Shape._getTextRect(text, x, y, textFont, textAlign, textBaseline);
  70205. text = (text + '').split('\n');
  70206. var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', textFont);
  70207. switch (textBaseline) {
  70208. case 'top':
  70209. y = rect.y;
  70210. break;
  70211. case 'bottom':
  70212. y = rect.y + lineHeight;
  70213. break;
  70214. default:
  70215. y = rect.y + lineHeight / 2;
  70216. }
  70217. for (var i = 0, l = text.length; i < l; i++) {
  70218. ctx.fillText(text[i], x, y);
  70219. y += lineHeight;
  70220. }
  70221. }
  70222. /**
  70223. * @function LevelRenderer.Shape._getTextRect
  70224. * @description 返回矩形区域,用于局部刷新和文字定位
  70225. *
  70226. * @param {string} text - text。
  70227. * @param {number} x - x。
  70228. * @param {number} y - y。
  70229. * @param {string} textFont - textFont。
  70230. * @param {string} textAlign - textAlign。
  70231. * @param {string} textBaseline - textBaseline。
  70232. * @return {Object} 矩形区域。
  70233. */
  70234. }, {
  70235. key: "_getTextRect",
  70236. value: function _getTextRect(text, x, y, textFont, textAlign, textBaseline) {
  70237. var width = SUtil_SUtil.Util_area.getTextWidth(text, textFont);
  70238. var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', textFont);
  70239. text = (text + '').split('\n');
  70240. switch (textAlign) {
  70241. case 'end':
  70242. case 'right':
  70243. x -= width;
  70244. break;
  70245. case 'center':
  70246. x -= width / 2;
  70247. break;
  70248. }
  70249. switch (textBaseline) {
  70250. case 'top':
  70251. break;
  70252. case 'bottom':
  70253. y -= lineHeight * text.length;
  70254. break;
  70255. default:
  70256. y -= lineHeight * text.length / 2;
  70257. }
  70258. return {
  70259. x: x,
  70260. y: y,
  70261. width: width,
  70262. height: lineHeight * text.length
  70263. };
  70264. }
  70265. }]);
  70266. return Shape;
  70267. }(mixinExt(Eventful, Transformable));
  70268. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicPoint.js
  70269. function SmicPoint_typeof(obj) { "@babel/helpers - typeof"; return SmicPoint_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicPoint_typeof(obj); }
  70270. function SmicPoint_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  70271. function SmicPoint_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  70272. function SmicPoint_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicPoint_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicPoint_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  70273. function SmicPoint_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicPoint_get = Reflect.get.bind(); } else { SmicPoint_get = function _get(target, property, receiver) { var base = SmicPoint_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicPoint_get.apply(this, arguments); }
  70274. function SmicPoint_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicPoint_getPrototypeOf(object); if (object === null) break; } return object; }
  70275. function SmicPoint_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicPoint_setPrototypeOf(subClass, superClass); }
  70276. function SmicPoint_setPrototypeOf(o, p) { SmicPoint_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicPoint_setPrototypeOf(o, p); }
  70277. function SmicPoint_createSuper(Derived) { var hasNativeReflectConstruct = SmicPoint_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicPoint_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicPoint_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicPoint_possibleConstructorReturn(this, result); }; }
  70278. function SmicPoint_possibleConstructorReturn(self, call) { if (call && (SmicPoint_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicPoint_assertThisInitialized(self); }
  70279. function SmicPoint_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  70280. function SmicPoint_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  70281. function SmicPoint_getPrototypeOf(o) { SmicPoint_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicPoint_getPrototypeOf(o); }
  70282. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  70283. * This program are made available under the terms of the Apache License, Version 2.0
  70284. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  70285. /**
  70286. * @private
  70287. * @class LevelRenderer.Shape.SmicPoint
  70288. * @category Visualization Theme
  70289. * @classdesc 点。
  70290. * @extends LevelRenderer.Shape
  70291. * @example
  70292. * var shape = new LevelRenderer.Shape.SmicPoint({
  70293. * style: {
  70294. * x: 100,
  70295. * y: 100,
  70296. * r: 40,
  70297. * brushType: 'both',
  70298. * color: 'blue',
  70299. * strokeColor: 'red',
  70300. * lineWidth: 3,
  70301. * text: 'point'
  70302. * }
  70303. * });
  70304. * levelRenderer.addShape(shape);
  70305. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  70306. *
  70307. */
  70308. var SmicPoint = /*#__PURE__*/function (_Shape) {
  70309. SmicPoint_inherits(SmicPoint, _Shape);
  70310. var _super = SmicPoint_createSuper(SmicPoint);
  70311. function SmicPoint(options) {
  70312. var _this;
  70313. SmicPoint_classCallCheck(this, SmicPoint);
  70314. _this = _super.call(this, options);
  70315. /**
  70316. * @member {string} LevelRenderer.Shape.SmicPoint.prototype.type
  70317. * @description 图形类型。
  70318. */
  70319. _this.type = 'smicpoint';
  70320. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  70321. _this.refOriginalPosition = [0, 0];
  70322. }
  70323. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicPoint";
  70324. return _this;
  70325. }
  70326. /**
  70327. * @function cdestroy
  70328. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  70329. */
  70330. SmicPoint_createClass(SmicPoint, [{
  70331. key: "destroy",
  70332. value: function destroy() {
  70333. this.type = null;
  70334. SmicPoint_get(SmicPoint_getPrototypeOf(SmicPoint.prototype), "destroy", this).call(this);
  70335. }
  70336. /**
  70337. * @function LevelRenderer.Shape.SmicPoint.prototype.buildPath
  70338. * @description 创建点触。
  70339. *
  70340. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  70341. * @param {Object} style - style。
  70342. *
  70343. */
  70344. }, {
  70345. key: "buildPath",
  70346. value: function buildPath(ctx, style) {
  70347. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  70348. this.refOriginalPosition = [0, 0];
  70349. }
  70350. var __OP = this.refOriginalPosition;
  70351. ctx.arc(style.x + __OP[0], style.y + __OP[1], style.r, 0, Math.PI * 2, true);
  70352. return;
  70353. }
  70354. /**
  70355. * @function LevelRenderer.Shape.SmicPoint.prototype.getRect
  70356. * @description 计算返回点的包围盒矩形。该包围盒是直接从四个控制点计算,并非最小包围盒。
  70357. *
  70358. * @param {Object} style - style
  70359. * @return {Object} 边框对象。包含属性:x,y,width,height。
  70360. */
  70361. }, {
  70362. key: "getRect",
  70363. value: function getRect(style) {
  70364. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  70365. this.refOriginalPosition = [0, 0];
  70366. }
  70367. var __OP = this.refOriginalPosition;
  70368. if (style.__rect) {
  70369. return style.__rect;
  70370. }
  70371. var lineWidth;
  70372. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  70373. lineWidth = style.lineWidth || 1;
  70374. } else {
  70375. lineWidth = 0;
  70376. }
  70377. style.__rect = {
  70378. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  70379. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  70380. width: style.r * 2 + lineWidth,
  70381. height: style.r * 2 + lineWidth
  70382. };
  70383. return style.__rect;
  70384. }
  70385. }]);
  70386. return SmicPoint;
  70387. }(Shape_Shape);
  70388. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicText.js
  70389. function SmicText_typeof(obj) { "@babel/helpers - typeof"; return SmicText_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicText_typeof(obj); }
  70390. function SmicText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  70391. function SmicText_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  70392. function SmicText_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicText_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicText_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  70393. function SmicText_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicText_get = Reflect.get.bind(); } else { SmicText_get = function _get(target, property, receiver) { var base = SmicText_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicText_get.apply(this, arguments); }
  70394. function SmicText_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicText_getPrototypeOf(object); if (object === null) break; } return object; }
  70395. function SmicText_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicText_setPrototypeOf(subClass, superClass); }
  70396. function SmicText_setPrototypeOf(o, p) { SmicText_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicText_setPrototypeOf(o, p); }
  70397. function SmicText_createSuper(Derived) { var hasNativeReflectConstruct = SmicText_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicText_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicText_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicText_possibleConstructorReturn(this, result); }; }
  70398. function SmicText_possibleConstructorReturn(self, call) { if (call && (SmicText_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicText_assertThisInitialized(self); }
  70399. function SmicText_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  70400. function SmicText_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  70401. function SmicText_getPrototypeOf(o) { SmicText_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicText_getPrototypeOf(o); }
  70402. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  70403. * This program are made available under the terms of the Apache License, Version 2.0
  70404. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  70405. /**
  70406. * @private
  70407. * @class LevelRenderer.Shape.SmicText
  70408. * @category Visualization Theme
  70409. * @extends {LevelRenderer.Shape}
  70410. * @example
  70411. * var shape = new LevelRenderer.Shape.SmicText({
  70412. * style: {
  70413. * text: 'Label',
  70414. * x: 100,
  70415. * y: 100,
  70416. * textFont: '14px Arial'
  70417. * }
  70418. * });
  70419. * levelRenderer.addShape(shape);
  70420. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  70421. */
  70422. var SmicText = /*#__PURE__*/function (_Shape) {
  70423. SmicText_inherits(SmicText, _Shape);
  70424. var _super = SmicText_createSuper(SmicText);
  70425. function SmicText(options) {
  70426. var _this;
  70427. SmicText_classCallCheck(this, SmicText);
  70428. _this = _super.call(this, options);
  70429. /**
  70430. * @member {string} LevelRenderer.Shape.SmicText.prototype.type
  70431. * @description 图形类型.
  70432. */
  70433. _this.type = 'smictext';
  70434. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  70435. _this.refOriginalPosition = [0, 0];
  70436. }
  70437. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicText";
  70438. return _this;
  70439. }
  70440. /**
  70441. * @function LevelRenderer.Shape.SmicText.prototype.destroy
  70442. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  70443. */
  70444. SmicText_createClass(SmicText, [{
  70445. key: "destroy",
  70446. value: function destroy() {
  70447. this.type = null;
  70448. SmicText_get(SmicText_getPrototypeOf(SmicText.prototype), "destroy", this).call(this);
  70449. }
  70450. /**
  70451. * @function LevelRenderer.Shape.SmicText.prototype.brush
  70452. * @description 笔触。
  70453. *
  70454. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  70455. * @param {boolean} isHighlight - 是否使用高亮属性。
  70456. *
  70457. */
  70458. }, {
  70459. key: "brush",
  70460. value: function brush(ctx, isHighlight) {
  70461. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  70462. this.refOriginalPosition = [0, 0];
  70463. }
  70464. var __OP = this.refOriginalPosition;
  70465. var style = this.style;
  70466. if (isHighlight) {
  70467. // 根据style扩展默认高亮样式
  70468. style = this.getHighlightStyle(style, this.highlightStyle || {});
  70469. }
  70470. if (typeof style.text == 'undefined' || style.text === false) {
  70471. return;
  70472. }
  70473. ctx.save();
  70474. this.doClip(ctx);
  70475. this.setContext(ctx, style);
  70476. // 设置transform
  70477. this.setTransform(ctx);
  70478. if (style.textFont) {
  70479. ctx.font = style.textFont;
  70480. }
  70481. ctx.textAlign = style.textAlign || 'start';
  70482. ctx.textBaseline = style.textBaseline || 'middle';
  70483. var text = (style.text + '').split('\n');
  70484. var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', style.textFont);
  70485. var rect = this.getRectNoRotation(style);
  70486. // var x = style.x;
  70487. var x = style.x + __OP[0];
  70488. var y;
  70489. if (style.textBaseline == 'top') {
  70490. y = rect.y;
  70491. } else if (style.textBaseline == 'bottom') {
  70492. y = rect.y + lineHeight;
  70493. } else {
  70494. y = rect.y + lineHeight / 2;
  70495. }
  70496. var ox = style.x + __OP[0];
  70497. var oy = style.y + __OP[1];
  70498. //文本绘制
  70499. for (var i = 0, l = text.length; i < l; i++) {
  70500. //是否渲染矩形背景及颜色
  70501. if (style.labelRect) {
  70502. //+4,-2是为了让文字距边框左右边缘有点间隔
  70503. ctx.fillRect(rect.x - 2, rect.y, rect.width + 4, rect.height);
  70504. ctx.fillStyle = style.strokeColor;
  70505. ctx.strokeRect(rect.x - 2, rect.y, rect.width + 4, rect.height);
  70506. ctx.fillStyle = style.textColor;
  70507. }
  70508. switch (style.brushType) {
  70509. case 'stroke':
  70510. this.setCtxGlobalAlpha(ctx, "stroke", style);
  70511. if (style.textRotation && style.textRotation !== 0) {
  70512. ctx.save();
  70513. ctx.translate(ox, oy);
  70514. ctx.rotate(style.textRotation * Math.PI / 180);
  70515. if (style.textBaseline == 'top') {
  70516. if (style.maxWidth) {
  70517. ctx.strokeText(text[i], 0, lineHeight * i, style.maxWidth);
  70518. } else {
  70519. ctx.strokeText(text[i], 0, lineHeight * i);
  70520. }
  70521. } else if (style.textBaseline == 'bottom') {
  70522. if (style.maxWidth) {
  70523. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  70524. } else {
  70525. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height);
  70526. }
  70527. } else {
  70528. if (style.maxWidth) {
  70529. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  70530. } else {
  70531. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  70532. }
  70533. }
  70534. ctx.restore();
  70535. } else {
  70536. if (style.maxWidth) {
  70537. ctx.strokeText(text[i], x, y, style.maxWidth);
  70538. } else {
  70539. ctx.strokeText(text[i], x, y);
  70540. }
  70541. }
  70542. this.setCtxGlobalAlpha(ctx, "reset", style);
  70543. break;
  70544. case 'both':
  70545. if (style.textRotation && style.textRotation !== 0) {
  70546. ctx.save();
  70547. ctx.translate(ox, oy);
  70548. ctx.rotate(style.textRotation * Math.PI / 180);
  70549. if (style.textBaseline == 'top') {
  70550. if (style.maxWidth) {
  70551. this.setCtxGlobalAlpha(ctx, "fill", style);
  70552. ctx.fillText(text[i], 0, lineHeight * i, style.maxWidth);
  70553. this.setCtxGlobalAlpha(ctx, "reset", style);
  70554. this.setCtxGlobalAlpha(ctx, "stroke", style);
  70555. ctx.strokeText(text[i], 0, lineHeight * i, style.maxWidth);
  70556. this.setCtxGlobalAlpha(ctx, "reset", style);
  70557. } else {
  70558. this.setCtxGlobalAlpha(ctx, "fill", style);
  70559. ctx.fillText(text[i], 0, lineHeight * i);
  70560. this.setCtxGlobalAlpha(ctx, "reset", style);
  70561. this.setCtxGlobalAlpha(ctx, "stroke", style);
  70562. ctx.strokeText(text[i], 0, lineHeight * i);
  70563. this.setCtxGlobalAlpha(ctx, "reset", style);
  70564. }
  70565. } else if (style.textBaseline == 'bottom') {
  70566. if (style.maxWidth) {
  70567. this.setCtxGlobalAlpha(ctx, "fill", style);
  70568. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  70569. this.setCtxGlobalAlpha(ctx, "reset", style);
  70570. this.setCtxGlobalAlpha(ctx, "stroke", style);
  70571. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  70572. this.setCtxGlobalAlpha(ctx, "reset", style);
  70573. } else {
  70574. this.setCtxGlobalAlpha(ctx, "fill", style);
  70575. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height);
  70576. this.setCtxGlobalAlpha(ctx, "reset", style);
  70577. this.setCtxGlobalAlpha(ctx, "stroke", style);
  70578. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height);
  70579. this.setCtxGlobalAlpha(ctx, "reset", style);
  70580. }
  70581. } else {
  70582. if (style.maxWidth) {
  70583. this.setCtxGlobalAlpha(ctx, "fill", style);
  70584. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  70585. this.setCtxGlobalAlpha(ctx, "reset", style);
  70586. this.setCtxGlobalAlpha(ctx, "stroke", style);
  70587. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  70588. this.setCtxGlobalAlpha(ctx, "reset", style);
  70589. } else {
  70590. this.setCtxGlobalAlpha(ctx, "fill", style);
  70591. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  70592. this.setCtxGlobalAlpha(ctx, "reset", style);
  70593. this.setCtxGlobalAlpha(ctx, "stroke", style);
  70594. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  70595. this.setCtxGlobalAlpha(ctx, "reset", style);
  70596. }
  70597. }
  70598. ctx.restore();
  70599. } else {
  70600. if (style.maxWidth) {
  70601. this.setCtxGlobalAlpha(ctx, "fill", style);
  70602. ctx.fillText(text[i], x, y, style.maxWidth);
  70603. this.setCtxGlobalAlpha(ctx, "reset", style);
  70604. this.setCtxGlobalAlpha(ctx, "stroke", style);
  70605. ctx.strokeText(text[i], x, y, style.maxWidth);
  70606. this.setCtxGlobalAlpha(ctx, "reset", style);
  70607. } else {
  70608. this.setCtxGlobalAlpha(ctx, "fill", style);
  70609. ctx.fillText(text[i], x, y);
  70610. this.setCtxGlobalAlpha(ctx, "reset", style);
  70611. this.setCtxGlobalAlpha(ctx, "stroke", style);
  70612. ctx.strokeText(text[i], x, y);
  70613. this.setCtxGlobalAlpha(ctx, "reset", style);
  70614. }
  70615. }
  70616. break;
  70617. default:
  70618. //fill or others
  70619. this.setCtxGlobalAlpha(ctx, "fill", style);
  70620. if (style.textRotation && style.textRotation !== 0) {
  70621. ctx.save();
  70622. ctx.translate(ox, oy);
  70623. ctx.rotate(style.textRotation * Math.PI / 180);
  70624. if (style.textBaseline == 'top') {
  70625. if (style.maxWidth) {
  70626. ctx.fillText(text[i], 0, lineHeight * i, style.maxWidth);
  70627. } else {
  70628. ctx.fillText(text[i], 0, lineHeight * i);
  70629. }
  70630. } else if (style.textBaseline == 'bottom') {
  70631. if (style.maxWidth) {
  70632. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  70633. } else {
  70634. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height);
  70635. }
  70636. } else {
  70637. if (style.maxWidth) {
  70638. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  70639. } else {
  70640. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  70641. }
  70642. }
  70643. ctx.restore();
  70644. } else {
  70645. if (style.maxWidth) {
  70646. ctx.fillText(text[i], x, y, style.maxWidth);
  70647. } else {
  70648. ctx.fillText(text[i], x, y);
  70649. }
  70650. }
  70651. this.setCtxGlobalAlpha(ctx, "reset", style);
  70652. }
  70653. y += lineHeight;
  70654. }
  70655. ctx.restore();
  70656. return;
  70657. }
  70658. /**
  70659. * @function LevelRenderer.Shape.SmicText.prototype.getRect
  70660. * @description 返回文字包围盒矩形
  70661. */
  70662. }, {
  70663. key: "getRect",
  70664. value: function getRect(style) {
  70665. if (style.__rect) {
  70666. return style.__rect;
  70667. }
  70668. var left, top, right, bottom;
  70669. var tbg = this.getTextBackground(style, true);
  70670. for (var i = 0, len = tbg.length; i < len; i++) {
  70671. var poi = tbg[i];
  70672. //用第一个点初始化
  70673. if (i == 0) {
  70674. left = poi[0];
  70675. right = poi[0];
  70676. top = poi[1];
  70677. bottom = poi[1];
  70678. } else {
  70679. if (poi[0] < left) {
  70680. left = poi[0];
  70681. }
  70682. if (poi[0] > right) {
  70683. right = poi[0];
  70684. }
  70685. if (poi[1] < top) {
  70686. top = poi[1];
  70687. }
  70688. if (poi[1] > bottom) {
  70689. bottom = poi[1];
  70690. }
  70691. }
  70692. }
  70693. style.__rect = {
  70694. x: left,
  70695. y: top,
  70696. width: right - left,
  70697. height: bottom - top
  70698. };
  70699. return style.__rect;
  70700. }
  70701. /**
  70702. * @function LevelRenderer.Shape.SmicText.prototype.getRectNoRotation
  70703. * @description 返回忽略旋转和maxWidth时文字包围盒矩形
  70704. */
  70705. }, {
  70706. key: "getRectNoRotation",
  70707. value: function getRectNoRotation(style) {
  70708. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  70709. this.refOriginalPosition = [0, 0];
  70710. }
  70711. var __OP = this.refOriginalPosition;
  70712. var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', style.textFont);
  70713. var width = SUtil_SUtil.Util_area.getTextWidth(style.text, style.textFont);
  70714. var height = SUtil_SUtil.Util_area.getTextHeight(style.text, style.textFont);
  70715. //处理文字位置,注:文本的绘制是由此 rect 决定
  70716. var textX = style.x + __OP[0]; // 默认start == left
  70717. if (style.textAlign == 'end' || style.textAlign == 'right') {
  70718. textX -= width;
  70719. } else if (style.textAlign == 'center') {
  70720. textX -= width / 2;
  70721. }
  70722. var textY;
  70723. if (style.textBaseline == 'top') {
  70724. // textY = style.y;
  70725. textY = style.y + __OP[1];
  70726. } else if (style.textBaseline == 'bottom') {
  70727. textY = style.y + __OP[1] - height;
  70728. } else {
  70729. // middle
  70730. textY = style.y + __OP[1] - height / 2;
  70731. }
  70732. var isWidthChangeByMaxWidth = false;
  70733. var widthBeforeChangeByMaxWidth;
  70734. //处理 maxWidth
  70735. if (style.maxWidth) {
  70736. var maxWidth = parseInt(style.maxWidth);
  70737. if (maxWidth < width) {
  70738. widthBeforeChangeByMaxWidth = width;
  70739. isWidthChangeByMaxWidth = true;
  70740. width = maxWidth;
  70741. }
  70742. textX = style.x + __OP[0];
  70743. if (style.textAlign == 'end' || style.textAlign == 'right') {
  70744. textX -= width;
  70745. } else if (style.textAlign == 'center') {
  70746. textX -= width / 2;
  70747. }
  70748. }
  70749. //处理斜体字
  70750. if (style.textFont) {
  70751. var textFont = style.textFont;
  70752. var textFontStr = textFont.toLowerCase();
  70753. if (textFontStr.indexOf("italic") > -1) {
  70754. if (isWidthChangeByMaxWidth === true) {
  70755. width += lineHeight / 3 * (width / widthBeforeChangeByMaxWidth);
  70756. } else {
  70757. width += lineHeight / 3;
  70758. }
  70759. }
  70760. }
  70761. var rect = {
  70762. x: textX,
  70763. y: textY,
  70764. width: width,
  70765. height: height
  70766. };
  70767. return rect;
  70768. }
  70769. /**
  70770. * @function LevelRenderer.Shape.SmicText.prototype.getTextBackground
  70771. * @description 获取文本背景框范围
  70772. *
  70773. * @param {Object} style - 样式。
  70774. * @param {boolean} redo - 是否强制重新计算 textBackground。
  70775. */
  70776. }, {
  70777. key: "getTextBackground",
  70778. value: function getTextBackground(style, redo) {
  70779. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  70780. this.refOriginalPosition = [0, 0];
  70781. }
  70782. var __OP = this.refOriginalPosition;
  70783. if (!redo && style.__textBackground) {
  70784. return style.__textBackground;
  70785. }
  70786. //不旋转时矩形框
  70787. var rect = this.getRectNoRotation(style);
  70788. //旋转中心点
  70789. var ox = style.x + __OP[0];
  70790. var oy = style.y + __OP[1];
  70791. //背景框
  70792. var background = [];
  70793. if (style.textRotation && style.textRotation !== 0) {
  70794. var textRotation = style.textRotation;
  70795. var ltPoi = this.getRotatedLocation(rect.x, rect.y, ox, oy, textRotation);
  70796. var rtPoi = this.getRotatedLocation(rect.x + rect.width, rect.y, ox, oy, textRotation);
  70797. var rbPoi = this.getRotatedLocation(rect.x + rect.width, rect.y + rect.height, ox, oy, textRotation);
  70798. var lbPoi = this.getRotatedLocation(rect.x, rect.y + rect.height, ox, oy, textRotation);
  70799. background.push(ltPoi);
  70800. background.push(rtPoi);
  70801. background.push(rbPoi);
  70802. background.push(lbPoi);
  70803. } else {
  70804. var _ltPoi = [rect.x, rect.y];
  70805. var _rtPoi = [rect.x + rect.width, rect.y];
  70806. var _rbPoi = [rect.x + rect.width, rect.y + rect.height];
  70807. var _lbPoi = [rect.x, rect.y + rect.height];
  70808. background.push(_ltPoi);
  70809. background.push(_rtPoi);
  70810. background.push(_rbPoi);
  70811. background.push(_lbPoi);
  70812. }
  70813. style.__textBackground = background;
  70814. return style.__textBackground;
  70815. }
  70816. /**
  70817. * @function LevelRenderer.Shape.SmicText.prototype.getRotatedLocation
  70818. * @description 获取一个点绕旋转中心顺时针旋转后的位置。(此方法用于屏幕坐标)
  70819. *
  70820. * @param {number} x - 旋转点横坐标。
  70821. * @param {number} y - 旋转点纵坐标。
  70822. * @param {number} rx - 旋转中心点横坐标。
  70823. * @param {number} ry - 旋转中心点纵坐标。
  70824. * @param {number} angle - 旋转角度(度)。
  70825. * @return {Array.<number>} 旋转后的坐标位置,长度为 2 的一维数组,数组第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  70826. */
  70827. }, {
  70828. key: "getRotatedLocation",
  70829. value: function getRotatedLocation(x, y, rx, ry, angle) {
  70830. var loc = new Array(),
  70831. x0,
  70832. y0;
  70833. y = -y;
  70834. ry = -ry;
  70835. angle = -angle; //顺时针旋转
  70836. x0 = (x - rx) * Math.cos(angle / 180 * Math.PI) - (y - ry) * Math.sin(angle / 180 * Math.PI) + rx;
  70837. y0 = (x - rx) * Math.sin(angle / 180 * Math.PI) + (y - ry) * Math.cos(angle / 180 * Math.PI) + ry;
  70838. loc[0] = x0;
  70839. loc[1] = -y0;
  70840. return loc;
  70841. }
  70842. }]);
  70843. return SmicText;
  70844. }(Shape_Shape);
  70845. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicCircle.js
  70846. function SmicCircle_typeof(obj) { "@babel/helpers - typeof"; return SmicCircle_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicCircle_typeof(obj); }
  70847. function SmicCircle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  70848. function SmicCircle_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  70849. function SmicCircle_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicCircle_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicCircle_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  70850. function SmicCircle_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicCircle_get = Reflect.get.bind(); } else { SmicCircle_get = function _get(target, property, receiver) { var base = SmicCircle_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicCircle_get.apply(this, arguments); }
  70851. function SmicCircle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicCircle_getPrototypeOf(object); if (object === null) break; } return object; }
  70852. function SmicCircle_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicCircle_setPrototypeOf(subClass, superClass); }
  70853. function SmicCircle_setPrototypeOf(o, p) { SmicCircle_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicCircle_setPrototypeOf(o, p); }
  70854. function SmicCircle_createSuper(Derived) { var hasNativeReflectConstruct = SmicCircle_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicCircle_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicCircle_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicCircle_possibleConstructorReturn(this, result); }; }
  70855. function SmicCircle_possibleConstructorReturn(self, call) { if (call && (SmicCircle_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicCircle_assertThisInitialized(self); }
  70856. function SmicCircle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  70857. function SmicCircle_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  70858. function SmicCircle_getPrototypeOf(o) { SmicCircle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicCircle_getPrototypeOf(o); }
  70859. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  70860. * This program are made available under the terms of the Apache License, Version 2.0
  70861. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  70862. /**
  70863. * @private
  70864. * @class LevelRenderer.Shape.SmicCircle
  70865. * @category Visualization Theme
  70866. * @classdesc 圆形
  70867. * @extends LevelRenderer.Shape
  70868. * @example
  70869. * var shape = new LevelRenderer.Shape.SmicCircle({
  70870. * style: {
  70871. * x: 100,
  70872. * y: 100,
  70873. * r: 60,
  70874. * brushType: "both",
  70875. * color: "blue",
  70876. * strokeColor: "red",
  70877. * lineWidth: 3,
  70878. * text: "Circle"
  70879. * }
  70880. * });
  70881. * levelRenderer.addShape(shape);
  70882. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  70883. *
  70884. */
  70885. var SmicCircle = /*#__PURE__*/function (_Shape) {
  70886. SmicCircle_inherits(SmicCircle, _Shape);
  70887. var _super = SmicCircle_createSuper(SmicCircle);
  70888. function SmicCircle(options) {
  70889. var _this;
  70890. SmicCircle_classCallCheck(this, SmicCircle);
  70891. _this = _super.call(this, options);
  70892. /**
  70893. * @member {string} LevelRenderer.Shape.SmicCircle.prototype.type
  70894. * @description 图形类型。
  70895. */
  70896. _this.type = 'smiccircle';
  70897. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  70898. _this.refOriginalPosition = [0, 0];
  70899. }
  70900. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicCircle";
  70901. return _this;
  70902. }
  70903. /**
  70904. * @function LevelRenderer.Shape.SmicCircle.prototype.destroy
  70905. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  70906. */
  70907. SmicCircle_createClass(SmicCircle, [{
  70908. key: "destroy",
  70909. value: function destroy() {
  70910. this.type = null;
  70911. SmicCircle_get(SmicCircle_getPrototypeOf(SmicCircle.prototype), "destroy", this).call(this);
  70912. }
  70913. /**
  70914. * @function LevelRenderer.Shape.SmicCircle.prototype.buildPath
  70915. * @description 创建图形路径。
  70916. *
  70917. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  70918. * @param {Object} style - style。
  70919. *
  70920. */
  70921. }, {
  70922. key: "buildPath",
  70923. value: function buildPath(ctx, style) {
  70924. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  70925. this.refOriginalPosition = [0, 0];
  70926. }
  70927. var __OP = this.refOriginalPosition;
  70928. var x = style.x + __OP[0]; // 圆心x
  70929. var y = style.y + __OP[1]; // 圆心y
  70930. ctx.moveTo(x + style.r, y);
  70931. ctx.arc(x, y, style.r, 0, Math.PI * 2, true);
  70932. return true;
  70933. }
  70934. /**
  70935. * @function LevelRenderer.Shape.SmicCircle.prototype.getRect
  70936. * @description 返回圆形包围盒矩形
  70937. *
  70938. * @param {Object} style - style
  70939. * @return {Object} 边框对象。包含属性:x,y,width,height。
  70940. *
  70941. */
  70942. }, {
  70943. key: "getRect",
  70944. value: function getRect(style) {
  70945. if (style.__rect) {
  70946. return style.__rect;
  70947. }
  70948. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  70949. this.refOriginalPosition = [0, 0];
  70950. }
  70951. var __OP = this.refOriginalPosition;
  70952. var x = style.x + __OP[0]; // 圆心x
  70953. var y = style.y + __OP[1]; // 圆心y
  70954. var r = style.r; // 圆r
  70955. var lineWidth;
  70956. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  70957. lineWidth = style.lineWidth || 1;
  70958. } else {
  70959. lineWidth = 0;
  70960. }
  70961. style.__rect = {
  70962. x: Math.round(x - r - lineWidth / 2),
  70963. y: Math.round(y - r - lineWidth / 2),
  70964. width: r * 2 + lineWidth,
  70965. height: r * 2 + lineWidth
  70966. };
  70967. return style.__rect;
  70968. }
  70969. }]);
  70970. return SmicCircle;
  70971. }(Shape_Shape);
  70972. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicPolygon.js
  70973. function SmicPolygon_typeof(obj) { "@babel/helpers - typeof"; return SmicPolygon_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicPolygon_typeof(obj); }
  70974. function SmicPolygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  70975. function SmicPolygon_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  70976. function SmicPolygon_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicPolygon_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicPolygon_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  70977. function SmicPolygon_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicPolygon_get = Reflect.get.bind(); } else { SmicPolygon_get = function _get(target, property, receiver) { var base = SmicPolygon_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicPolygon_get.apply(this, arguments); }
  70978. function SmicPolygon_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicPolygon_getPrototypeOf(object); if (object === null) break; } return object; }
  70979. function SmicPolygon_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicPolygon_setPrototypeOf(subClass, superClass); }
  70980. function SmicPolygon_setPrototypeOf(o, p) { SmicPolygon_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicPolygon_setPrototypeOf(o, p); }
  70981. function SmicPolygon_createSuper(Derived) { var hasNativeReflectConstruct = SmicPolygon_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicPolygon_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicPolygon_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicPolygon_possibleConstructorReturn(this, result); }; }
  70982. function SmicPolygon_possibleConstructorReturn(self, call) { if (call && (SmicPolygon_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicPolygon_assertThisInitialized(self); }
  70983. function SmicPolygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  70984. function SmicPolygon_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  70985. function SmicPolygon_getPrototypeOf(o) { SmicPolygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicPolygon_getPrototypeOf(o); }
  70986. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  70987. * This program are made available under the terms of the Apache License, Version 2.0
  70988. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  70989. /**
  70990. * @private
  70991. * @class LevelRenderer.Shape.SmicPolygon
  70992. * @category Visualization Theme
  70993. * @classdesc 多边形。
  70994. * @extends LevelRenderer.Shape
  70995. * @example
  70996. * var shape = new LevelRenderer.Shape.SmicPolygon({
  70997. * style: {
  70998. * // 100x100 的正方形
  70999. * pointList: [[0, 0], [100, 0], [100, 100], [0, 100]],
  71000. * color: 'blue'
  71001. * }
  71002. * });
  71003. * levelRenderer.addShape(shape);
  71004. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  71005. */
  71006. var SmicPolygon = /*#__PURE__*/function (_Shape) {
  71007. SmicPolygon_inherits(SmicPolygon, _Shape);
  71008. var _super = SmicPolygon_createSuper(SmicPolygon);
  71009. function SmicPolygon(options) {
  71010. var _this;
  71011. SmicPolygon_classCallCheck(this, SmicPolygon);
  71012. _this = _super.call(this, options);
  71013. /**
  71014. * @member {string} LevelRenderer.Shape.SmicPolygon.prototype.type
  71015. * @description 图形类型.
  71016. */
  71017. _this.type = 'smicpolygon';
  71018. /**
  71019. * @member {Array} LevelRenderer.Shape.SmicPolygon.prototype._holePolygonPointList
  71020. * @description 岛洞面多边形顶点数组(三维数组)
  71021. *
  71022. */
  71023. _this.holePolygonPointLists = null;
  71024. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  71025. _this.refOriginalPosition = [0, 0];
  71026. }
  71027. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicPolygon";
  71028. return _this;
  71029. }
  71030. /**
  71031. * @function LevelRenderer.Shape.SmicPolygon.prototype.destroy
  71032. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  71033. */
  71034. SmicPolygon_createClass(SmicPolygon, [{
  71035. key: "destroy",
  71036. value: function destroy() {
  71037. this.type = null;
  71038. this.holePolygonPointLists = null;
  71039. SmicPolygon_get(SmicPolygon_getPrototypeOf(SmicPolygon.prototype), "destroy", this).call(this);
  71040. }
  71041. /**
  71042. * @function LevelRenderer.Shape.SmicPolygon.prototype.brush
  71043. * @description 笔触。
  71044. *
  71045. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  71046. * @param {boolean} isHighlight - 是否使用高亮属性。
  71047. *
  71048. */
  71049. }, {
  71050. key: "brush",
  71051. value: function brush(ctx, isHighlight) {
  71052. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  71053. this.refOriginalPosition = [0, 0];
  71054. }
  71055. var style = this.style;
  71056. if (isHighlight) {
  71057. // 根据style扩展默认高亮样式
  71058. style = this.getHighlightStyle(style, this.highlightStyle || {});
  71059. }
  71060. ctx.save();
  71061. this.setContext(ctx, style);
  71062. // 设置 transform
  71063. this.setTransform(ctx);
  71064. // 先 fill 再stroke
  71065. var hasPath = false;
  71066. if (style.brushType == 'fill' || style.brushType == 'both' || typeof style.brushType == 'undefined') {
  71067. // 默认为fill
  71068. ctx.beginPath();
  71069. if (style.lineType == 'dashed' || style.lineType == 'dotted' || style.lineType == 'dot' || style.lineType == 'dash' || style.lineType == 'dashdot' || style.lineType == 'longdash' || style.lineType == 'longdashdot') {
  71070. // 特殊处理,虚线围不成path,实线再build一次
  71071. this.buildPath(ctx, {
  71072. lineType: 'solid',
  71073. lineWidth: style.lineWidth,
  71074. pointList: style.pointList
  71075. });
  71076. } else {
  71077. this.buildPath(ctx, style);
  71078. hasPath = true; // 这个path能用
  71079. }
  71080. ctx.closePath();
  71081. this.setCtxGlobalAlpha(ctx, "fill", style);
  71082. ctx.fill();
  71083. this.setCtxGlobalAlpha(ctx, "reset", style);
  71084. }
  71085. if (style.lineWidth > 0 && (style.brushType == 'stroke' || style.brushType == 'both')) {
  71086. if (!hasPath) {
  71087. ctx.beginPath();
  71088. this.buildPath(ctx, style);
  71089. }
  71090. this.setCtxGlobalAlpha(ctx, "stroke", style);
  71091. ctx.stroke();
  71092. this.setCtxGlobalAlpha(ctx, "reset", style);
  71093. }
  71094. this.drawText(ctx, style, this.style);
  71095. //岛洞
  71096. var hpStyle = Util_Util.cloneObject(style);
  71097. if (hpStyle.pointList) {
  71098. if (this.holePolygonPointLists && this.holePolygonPointLists.length > 0) {
  71099. var holePLS = this.holePolygonPointLists;
  71100. var holePLSen = holePLS.length;
  71101. for (var i = 0; i < holePLSen; i++) {
  71102. var holePL = holePLS[i];
  71103. //岛洞面
  71104. hpStyle.pointList = holePL;
  71105. ctx.globalCompositeOperation = "destination-out";
  71106. // 先 fill 再stroke
  71107. hasPath = false;
  71108. if (hpStyle.brushType == 'fill' || hpStyle.brushType == 'both' || typeof hpStyle.brushType == 'undefined') {
  71109. // 默认为fill
  71110. ctx.beginPath();
  71111. if (hpStyle.lineType == 'dashed' || hpStyle.lineType == 'dotted' || hpStyle.lineType == 'dot' || hpStyle.lineType == 'dash' || hpStyle.lineType == 'dashdot' || hpStyle.lineType == 'longdash' || hpStyle.lineType == 'longdashdot') {
  71112. // 特殊处理,虚线围不成path,实线再build一次
  71113. this.buildPath(ctx, {
  71114. lineType: 'solid',
  71115. lineWidth: hpStyle.lineWidth,
  71116. pointList: hpStyle.pointList
  71117. });
  71118. } else {
  71119. this.buildPath(ctx, hpStyle);
  71120. hasPath = true; // 这个path能用
  71121. }
  71122. ctx.closePath();
  71123. this.setCtxGlobalAlpha(ctx, "fill", hpStyle);
  71124. ctx.fill();
  71125. this.setCtxGlobalAlpha(ctx, "reset", hpStyle);
  71126. }
  71127. if (hpStyle.lineWidth > 0 && (hpStyle.brushType == 'stroke' || hpStyle.brushType == 'both')) {
  71128. if (!hasPath) {
  71129. ctx.beginPath();
  71130. this.buildPath(ctx, hpStyle);
  71131. }
  71132. //如果描边,先回复 globalCompositeOperation 默认值再描边。
  71133. ctx.globalCompositeOperation = "source-over";
  71134. this.setCtxGlobalAlpha(ctx, "stroke", hpStyle);
  71135. ctx.stroke();
  71136. this.setCtxGlobalAlpha(ctx, "reset", hpStyle);
  71137. } else {
  71138. ctx.globalCompositeOperation = "source-over";
  71139. }
  71140. }
  71141. }
  71142. }
  71143. ctx.restore();
  71144. return;
  71145. }
  71146. /**
  71147. * @function LevelRenderer.Shape.SmicPolygon.prototype.buildPath
  71148. * @description 创建多边形路径。
  71149. *
  71150. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  71151. * @param {Object} style - style。
  71152. *
  71153. */
  71154. }, {
  71155. key: "buildPath",
  71156. value: function buildPath(ctx, style) {
  71157. if (style.showShadow) {
  71158. ctx.shadowBlur = style.shadowBlur;
  71159. ctx.shadowColor = style.shadowColor;
  71160. ctx.shadowOffsetX = style.shadowOffsetX;
  71161. ctx.shadowOffsetY = style.shadowOffsetY;
  71162. }
  71163. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  71164. this.refOriginalPosition = [0, 0];
  71165. }
  71166. var __OP = this.refOriginalPosition;
  71167. // 虽然能重用 brokenLine,但底层图形基于性能考虑,重复代码减少调用吧
  71168. var pointList = style.pointList;
  71169. if (pointList.length < 2) {
  71170. // 少于2个点就不画了~
  71171. return;
  71172. }
  71173. if (style.smooth && style.smooth !== 'spline') {
  71174. var controlPoints = SUtil_SUtil.SUtil_smoothBezier(pointList, style.smooth, true, style.smoothConstraint, __OP);
  71175. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  71176. var cp1;
  71177. var cp2;
  71178. var p;
  71179. var len = pointList.length;
  71180. for (var i = 0; i < len; i++) {
  71181. cp1 = controlPoints[i * 2];
  71182. cp2 = controlPoints[i * 2 + 1];
  71183. p = [pointList[(i + 1) % len][0] + __OP[0], pointList[(i + 1) % len][1] + __OP[1]];
  71184. ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);
  71185. }
  71186. } else {
  71187. if (style.smooth === 'spline') {
  71188. pointList = SUtil_SUtil.SUtil_smoothSpline(pointList, true, null, __OP);
  71189. }
  71190. if (!style.lineType || style.lineType == 'solid') {
  71191. // 默认为实线
  71192. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  71193. for (var _i2 = 1; _i2 < pointList.length; _i2++) {
  71194. ctx.lineTo(pointList[_i2][0] + __OP[0], pointList[_i2][1] + __OP[1]);
  71195. }
  71196. ctx.lineTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  71197. } else if (style.lineType === 'dashed' || style.lineType === 'dotted' || style.lineType === 'dot' || style.lineType === 'dash' || style.lineType === 'longdash') {
  71198. // SMIC-方法修改 - start
  71199. var dashLengthForStyle = style._dashLength || (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1);
  71200. style._dashLength = dashLengthForStyle;
  71201. var dashLength = style.lineWidth || 1;
  71202. var pattern1 = dashLength;
  71203. var pattern2 = dashLength;
  71204. //dashed
  71205. if (style.lineType === 'dashed') {
  71206. pattern1 *= 5;
  71207. pattern2 *= 5;
  71208. if (style.lineCap && style.lineCap !== "butt") {
  71209. pattern1 -= dashLength;
  71210. pattern2 += dashLength;
  71211. }
  71212. }
  71213. //dotted
  71214. if (style.lineType === 'dotted') {
  71215. if (style.lineCap && style.lineCap !== "butt") {
  71216. pattern1 = 1;
  71217. pattern2 += dashLength;
  71218. }
  71219. }
  71220. //dot
  71221. if (style.lineType === 'dot') {
  71222. pattern2 *= 4;
  71223. if (style.lineCap && style.lineCap !== "butt") {
  71224. pattern1 = 1;
  71225. pattern2 += dashLength;
  71226. }
  71227. }
  71228. //dash
  71229. if (style.lineType === 'dash') {
  71230. pattern1 *= 4;
  71231. pattern2 *= 4;
  71232. if (style.lineCap && style.lineCap !== "butt") {
  71233. pattern1 -= dashLength;
  71234. pattern2 += dashLength;
  71235. }
  71236. }
  71237. //longdash
  71238. if (style.lineType === 'longdash') {
  71239. pattern1 *= 8;
  71240. pattern2 *= 4;
  71241. if (style.lineCap && style.lineCap !== "butt") {
  71242. pattern1 -= dashLength;
  71243. pattern2 += dashLength;
  71244. }
  71245. }
  71246. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  71247. for (var _i4 = 1; _i4 < pointList.length; _i4++) {
  71248. SUtil_SUtil.SUtil_dashedLineTo(ctx, pointList[_i4 - 1][0] + __OP[0], pointList[_i4 - 1][1] + __OP[1], pointList[_i4][0] + __OP[0], pointList[_i4][1] + __OP[1], dashLength, [pattern1, pattern2]);
  71249. }
  71250. SUtil_SUtil.SUtil_dashedLineTo(ctx, pointList[pointList.length - 1][0] + __OP[0], pointList[pointList.length - 1][1] + __OP[1], pointList[0][0] + __OP[0], pointList[0][1] + __OP[1], dashLength, [pattern1, pattern2]);
  71251. } else if (style.lineType === 'dashdot' || style.lineType === 'longdashdot') {
  71252. var _dashLengthForStyle = style._dashLength || (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1);
  71253. style._dashLength = _dashLengthForStyle;
  71254. var _dashLength = style.lineWidth || 1;
  71255. var _pattern = _dashLength;
  71256. var _pattern2 = _dashLength;
  71257. var pattern3 = _dashLength;
  71258. var pattern4 = _dashLength;
  71259. //dashdot
  71260. if (style.lineType === 'dashdot') {
  71261. _pattern *= 4;
  71262. _pattern2 *= 4;
  71263. pattern4 *= 4;
  71264. if (style.lineCap && style.lineCap !== "butt") {
  71265. _pattern -= _dashLength;
  71266. _pattern2 += _dashLength;
  71267. pattern3 = 1;
  71268. pattern4 += _dashLength;
  71269. }
  71270. }
  71271. //longdashdot
  71272. if (style.lineType === 'longdashdot') {
  71273. _pattern *= 8;
  71274. _pattern2 *= 4;
  71275. pattern4 *= 4;
  71276. if (style.lineCap && style.lineCap !== "butt") {
  71277. _pattern -= _dashLength;
  71278. _pattern2 += _dashLength;
  71279. pattern3 = 1;
  71280. pattern4 += _dashLength;
  71281. }
  71282. }
  71283. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  71284. for (var _i6 = 1; _i6 < pointList.length; _i6++) {
  71285. SUtil_SUtil.SUtil_dashedLineTo(ctx, pointList[_i6 - 1][0] + __OP[0], pointList[_i6 - 1][1] + __OP[1], pointList[_i6][0] + __OP[0], pointList[_i6][1] + __OP[1], _dashLength, [_pattern, _pattern2, pattern3, pattern4]);
  71286. }
  71287. SUtil_SUtil.SUtil_dashedLineTo(ctx, pointList[pointList.length - 1][0] + __OP[0], pointList[pointList.length - 1][1] + __OP[1], pointList[0][0] + __OP[0], pointList[0][1] + __OP[1], _dashLength, [_pattern, _pattern2, pattern3, pattern4]);
  71288. }
  71289. }
  71290. return;
  71291. }
  71292. /**
  71293. * @function LevelRenderer.Shape.SmicPolygon.prototype.getRect
  71294. * @description 计算返回多边形包围盒矩阵。该包围盒是直接从四个控制点计算,并非最小包围盒。
  71295. *
  71296. * @param {Object} style - style
  71297. * @return {Object} 边框对象。包含属性:x,y,width,height。
  71298. *
  71299. */
  71300. }, {
  71301. key: "getRect",
  71302. value: function getRect(style, refOriginalPosition) {
  71303. var __OP;
  71304. if (!refOriginalPosition) {
  71305. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  71306. this.refOriginalPosition = [0, 0];
  71307. }
  71308. __OP = this.refOriginalPosition;
  71309. } else {
  71310. __OP = refOriginalPosition;
  71311. }
  71312. if (style.__rect) {
  71313. return style.__rect;
  71314. }
  71315. var minX = Number.MAX_VALUE;
  71316. var maxX = Number.MIN_VALUE;
  71317. var minY = Number.MAX_VALUE;
  71318. var maxY = Number.MIN_VALUE;
  71319. var pointList = style.pointList;
  71320. for (var i = 0, l = pointList.length; i < l; i++) {
  71321. if (pointList[i][0] + __OP[0] < minX) {
  71322. minX = pointList[i][0] + __OP[0];
  71323. }
  71324. if (pointList[i][0] + __OP[0] > maxX) {
  71325. maxX = pointList[i][0] + __OP[0];
  71326. }
  71327. if (pointList[i][1] + __OP[1] < minY) {
  71328. minY = pointList[i][1] + __OP[1];
  71329. }
  71330. if (pointList[i][1] + __OP[1] > maxY) {
  71331. maxY = pointList[i][1] + __OP[1];
  71332. }
  71333. }
  71334. var lineWidth;
  71335. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  71336. lineWidth = style.lineWidth || 1;
  71337. } else {
  71338. lineWidth = 0;
  71339. }
  71340. style.__rect = {
  71341. x: Math.round(minX - lineWidth / 2),
  71342. y: Math.round(minY - lineWidth / 2),
  71343. width: maxX - minX + lineWidth,
  71344. height: maxY - minY + lineWidth
  71345. };
  71346. return style.__rect;
  71347. }
  71348. }]);
  71349. return SmicPolygon;
  71350. }(Shape_Shape);
  71351. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicBrokenLine.js
  71352. function SmicBrokenLine_typeof(obj) { "@babel/helpers - typeof"; return SmicBrokenLine_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicBrokenLine_typeof(obj); }
  71353. function SmicBrokenLine_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  71354. function SmicBrokenLine_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  71355. function SmicBrokenLine_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicBrokenLine_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicBrokenLine_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  71356. function SmicBrokenLine_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicBrokenLine_get = Reflect.get.bind(); } else { SmicBrokenLine_get = function _get(target, property, receiver) { var base = SmicBrokenLine_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicBrokenLine_get.apply(this, arguments); }
  71357. function SmicBrokenLine_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicBrokenLine_getPrototypeOf(object); if (object === null) break; } return object; }
  71358. function SmicBrokenLine_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicBrokenLine_setPrototypeOf(subClass, superClass); }
  71359. function SmicBrokenLine_setPrototypeOf(o, p) { SmicBrokenLine_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicBrokenLine_setPrototypeOf(o, p); }
  71360. function SmicBrokenLine_createSuper(Derived) { var hasNativeReflectConstruct = SmicBrokenLine_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicBrokenLine_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicBrokenLine_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicBrokenLine_possibleConstructorReturn(this, result); }; }
  71361. function SmicBrokenLine_possibleConstructorReturn(self, call) { if (call && (SmicBrokenLine_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicBrokenLine_assertThisInitialized(self); }
  71362. function SmicBrokenLine_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  71363. function SmicBrokenLine_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  71364. function SmicBrokenLine_getPrototypeOf(o) { SmicBrokenLine_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicBrokenLine_getPrototypeOf(o); }
  71365. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  71366. * This program are made available under the terms of the Apache License, Version 2.0
  71367. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  71368. /**
  71369. * @private
  71370. * @class LevelRenderer.Shape.SmicBrokenLine
  71371. * @category Visualization Theme
  71372. * @classdesc 折线(ic)。
  71373. * @extends LevelRenderer.Shape
  71374. * @example
  71375. * var shape = new LevelRenderer.Shape.SmicBrokenLine({
  71376. * style: {
  71377. * pointList: [[0, 0], [100, 100], [100, 0]],
  71378. * smooth: 'bezier',
  71379. * strokeColor: 'purple'
  71380. * }
  71381. * });
  71382. * levelRenderer.addShape(shape);
  71383. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  71384. *
  71385. */
  71386. var SmicBrokenLine = /*#__PURE__*/function (_Shape) {
  71387. SmicBrokenLine_inherits(SmicBrokenLine, _Shape);
  71388. var _super = SmicBrokenLine_createSuper(SmicBrokenLine);
  71389. function SmicBrokenLine(options) {
  71390. var _this;
  71391. SmicBrokenLine_classCallCheck(this, SmicBrokenLine);
  71392. _this = _super.call(this, options);
  71393. /**
  71394. * @member {string} LevelRenderer.Shape.SmicBrokenLine.prototype.brushTypeOnly
  71395. * @description 线条只能描边。
  71396. */
  71397. _this.brushTypeOnly = 'stroke';
  71398. /**
  71399. * @member {string} LevelRenderer.Shape.SmicBrokenLine.prototype.textPosition
  71400. * @description 文本位置。
  71401. */
  71402. _this.textPosition = 'end';
  71403. /**
  71404. * @member {string} LevelRenderer.Shape.SmicBrokenLine.prototype.type
  71405. * @description 图形类型.
  71406. */
  71407. _this.type = 'smicbroken-line';
  71408. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  71409. _this.refOriginalPosition = [0, 0];
  71410. }
  71411. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicBrokenLine";
  71412. return _this;
  71413. }
  71414. /**
  71415. * @function LevelRenderer.Shape.SmicBrokenLine.prototype.destroy
  71416. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  71417. */
  71418. SmicBrokenLine_createClass(SmicBrokenLine, [{
  71419. key: "destroy",
  71420. value: function destroy() {
  71421. this.brushTypeOnly = null;
  71422. this.textPosition = null;
  71423. this.type = null;
  71424. SmicBrokenLine_get(SmicBrokenLine_getPrototypeOf(SmicBrokenLine.prototype), "destroy", this).call(this);
  71425. }
  71426. /**
  71427. * @function LevelRenderer.Shape.SmicBrokenLine.prototype.buildPath
  71428. * @description 创建折线路径。
  71429. *
  71430. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  71431. * @param {Object} style - style。
  71432. *
  71433. */
  71434. }, {
  71435. key: "buildPath",
  71436. value: function buildPath(ctx, style) {
  71437. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  71438. this.refOriginalPosition = [0, 0];
  71439. }
  71440. var __OP = this.refOriginalPosition;
  71441. var pointList = style.pointList;
  71442. if (pointList.length < 2) {
  71443. // 少于2个点就不画了~
  71444. return;
  71445. }
  71446. var len = Math.min(style.pointList.length, Math.round(style.pointListLength || style.pointList.length));
  71447. if (style.smooth && style.smooth !== 'spline') {
  71448. var controlPoints = SUtil_SUtil.SUtil_smoothBezier(pointList, style.smooth, false, style.smoothConstraint, __OP);
  71449. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  71450. var cp1;
  71451. var cp2;
  71452. var p;
  71453. for (var _i2 = 0; _i2 < len - 1; _i2++) {
  71454. cp1 = controlPoints[_i2 * 2];
  71455. cp2 = controlPoints[_i2 * 2 + 1];
  71456. p = [pointList[_i2 + 1][0] + __OP[0], pointList[_i2 + 1][1] + __OP[1]];
  71457. ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);
  71458. }
  71459. } else {
  71460. if (style.smooth === 'spline') {
  71461. pointList = SUtil_SUtil.SUtil_smoothSpline(pointList, null, null, __OP);
  71462. len = pointList.length;
  71463. }
  71464. if (!style.lineType || style.lineType === 'solid') {
  71465. // 默认为实线
  71466. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  71467. for (var _i4 = 1; _i4 < len; _i4++) {
  71468. ctx.lineTo(pointList[_i4][0] + __OP[0], pointList[_i4][1] + __OP[1]);
  71469. }
  71470. } else if (style.lineType === 'dashed' || style.lineType === 'dotted' || style.lineType === 'dot' || style.lineType === 'dash' || style.lineType === 'longdash') {
  71471. var dashLength = style.lineWidth || 1;
  71472. var pattern1 = dashLength;
  71473. var pattern2 = dashLength;
  71474. //dashed
  71475. if (style.lineType === 'dashed') {
  71476. pattern1 *= 5;
  71477. pattern2 *= 5;
  71478. if (style.lineCap && style.lineCap !== "butt") {
  71479. pattern1 -= dashLength;
  71480. pattern2 += dashLength;
  71481. }
  71482. }
  71483. //dotted
  71484. if (style.lineType === 'dotted') {
  71485. if (style.lineCap && style.lineCap !== "butt") {
  71486. pattern1 = 1;
  71487. pattern2 += dashLength;
  71488. }
  71489. }
  71490. //dot
  71491. if (style.lineType === 'dot') {
  71492. pattern2 *= 4;
  71493. if (style.lineCap && style.lineCap !== "butt") {
  71494. pattern1 = 1;
  71495. pattern2 += dashLength;
  71496. }
  71497. }
  71498. //dash
  71499. if (style.lineType === 'dash') {
  71500. pattern1 *= 4;
  71501. pattern2 *= 4;
  71502. if (style.lineCap && style.lineCap !== "butt") {
  71503. pattern1 -= dashLength;
  71504. pattern2 += dashLength;
  71505. }
  71506. }
  71507. //longdash
  71508. if (style.lineType === 'longdash') {
  71509. pattern1 *= 8;
  71510. pattern2 *= 4;
  71511. if (style.lineCap && style.lineCap !== "butt") {
  71512. pattern1 -= dashLength;
  71513. pattern2 += dashLength;
  71514. }
  71515. }
  71516. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  71517. for (var i = 1; i < len; i++) {
  71518. SUtil_SUtil.SUtil_dashedLineTo(ctx, pointList[i - 1][0] + __OP[0], pointList[i - 1][1] + __OP[1], pointList[i][0] + __OP[0], pointList[i][1] + __OP[1], dashLength, [pattern1, pattern2]);
  71519. }
  71520. } else if (style.lineType === 'dashdot' || style.lineType === 'longdashdot') {
  71521. var _dashLength = style.lineWidth || 1;
  71522. var _pattern = _dashLength;
  71523. var _pattern2 = _dashLength;
  71524. var pattern3 = _dashLength;
  71525. var pattern4 = _dashLength;
  71526. //dashdot
  71527. if (style.lineType === 'dashdot') {
  71528. _pattern *= 4;
  71529. _pattern2 *= 4;
  71530. pattern4 *= 4;
  71531. if (style.lineCap && style.lineCap !== "butt") {
  71532. _pattern -= _dashLength;
  71533. _pattern2 += _dashLength;
  71534. pattern3 = 1;
  71535. pattern4 += _dashLength;
  71536. }
  71537. }
  71538. //longdashdot
  71539. if (style.lineType === 'longdashdot') {
  71540. _pattern *= 8;
  71541. _pattern2 *= 4;
  71542. pattern4 *= 4;
  71543. if (style.lineCap && style.lineCap !== "butt") {
  71544. _pattern -= _dashLength;
  71545. _pattern2 += _dashLength;
  71546. pattern3 = 1;
  71547. pattern4 += _dashLength;
  71548. }
  71549. }
  71550. _dashLength = (style.lineWidth || 1) * (style.lineType === 'dashed' ? 5 : 1);
  71551. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  71552. for (var _i6 = 1; _i6 < len; _i6++) {
  71553. SUtil_SUtil.SUtil_dashedLineTo(ctx, pointList[_i6 - 1][0] + __OP[0], pointList[_i6 - 1][1] + __OP[1], pointList[_i6][0] + __OP[0], pointList[_i6][1] + __OP[1], _dashLength, [_pattern, _pattern2, pattern3, pattern4]);
  71554. }
  71555. }
  71556. }
  71557. return;
  71558. }
  71559. /**
  71560. * @function LevelRenderer.Shape.SmicBrokenLine.prototype.getRect
  71561. * @description 计算返回折线包围盒矩形。该包围盒是直接从四个控制点计算,并非最小包围盒。
  71562. *
  71563. * @param {Object} style - style
  71564. * @return {Object} 边框对象。包含属性:x,y,width,height。
  71565. */
  71566. }, {
  71567. key: "getRect",
  71568. value: function getRect(style) {
  71569. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  71570. this.refOriginalPosition = [0, 0];
  71571. }
  71572. var __OP = this.refOriginalPosition;
  71573. return SmicPolygon.prototype.getRect.apply(this, [style, __OP]);
  71574. }
  71575. }]);
  71576. return SmicBrokenLine;
  71577. }(Shape_Shape);
  71578. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicImage.js
  71579. function SmicImage_typeof(obj) { "@babel/helpers - typeof"; return SmicImage_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicImage_typeof(obj); }
  71580. function SmicImage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  71581. function SmicImage_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  71582. function SmicImage_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicImage_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicImage_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  71583. function SmicImage_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicImage_get = Reflect.get.bind(); } else { SmicImage_get = function _get(target, property, receiver) { var base = SmicImage_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicImage_get.apply(this, arguments); }
  71584. function SmicImage_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicImage_getPrototypeOf(object); if (object === null) break; } return object; }
  71585. function SmicImage_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicImage_setPrototypeOf(subClass, superClass); }
  71586. function SmicImage_setPrototypeOf(o, p) { SmicImage_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicImage_setPrototypeOf(o, p); }
  71587. function SmicImage_createSuper(Derived) { var hasNativeReflectConstruct = SmicImage_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicImage_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicImage_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicImage_possibleConstructorReturn(this, result); }; }
  71588. function SmicImage_possibleConstructorReturn(self, call) { if (call && (SmicImage_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicImage_assertThisInitialized(self); }
  71589. function SmicImage_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  71590. function SmicImage_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  71591. function SmicImage_getPrototypeOf(o) { SmicImage_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicImage_getPrototypeOf(o); }
  71592. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  71593. * This program are made available under the terms of the Apache License, Version 2.0
  71594. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  71595. /**
  71596. * @private
  71597. * @class LevelRenderer.Shape.SmicImage
  71598. * @category Visualization Theme
  71599. * @classdesc 图片绘制。
  71600. * @extends LevelRenderer.Shape
  71601. * @example
  71602. * var shape = new LevelRenderer.Shape.SmicImage({
  71603. * style: {
  71604. * image: 'test.jpg',
  71605. * x: 100,
  71606. * y: 100
  71607. * }
  71608. * });
  71609. * levelRenderer.addShape(shape);
  71610. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  71611. *
  71612. */
  71613. var SmicImage = /*#__PURE__*/function (_Shape) {
  71614. SmicImage_inherits(SmicImage, _Shape);
  71615. var _super = SmicImage_createSuper(SmicImage);
  71616. function SmicImage(options) {
  71617. var _this;
  71618. SmicImage_classCallCheck(this, SmicImage);
  71619. _this = _super.call(this, options);
  71620. /**
  71621. * @member {string} LevelRenderer.Shape.SmicImage.prototype.type
  71622. * @description 图形类型。
  71623. */
  71624. _this.type = 'smicimage';
  71625. /**
  71626. * @member {string} LevelRenderer.Shape.SmicImage.prototype._imageCache
  71627. * @description 图片缓存。
  71628. */
  71629. _this._imageCache = {};
  71630. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  71631. _this.refOriginalPosition = [0, 0];
  71632. }
  71633. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicImage";
  71634. return _this;
  71635. }
  71636. /**
  71637. * @function LevelRenderer.Shape.SmicImage.prototype.destroy
  71638. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  71639. */
  71640. SmicImage_createClass(SmicImage, [{
  71641. key: "destroy",
  71642. value: function destroy() {
  71643. this.type = null;
  71644. this._imageCache = null;
  71645. SmicImage_get(SmicImage_getPrototypeOf(SmicImage.prototype), "destroy", this).call(this);
  71646. }
  71647. /**
  71648. * @function LevelRenderer.Shape.SmicImage.prototype.buildPath
  71649. * @description 创建图片。
  71650. *
  71651. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  71652. * @param {Object} style - style。
  71653. *
  71654. */
  71655. }, {
  71656. key: "brush",
  71657. value: function brush(ctx, isHighlight, refresh) {
  71658. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  71659. this.refOriginalPosition = [0, 0];
  71660. }
  71661. var __OP = this.refOriginalPosition;
  71662. var style = this.style || {};
  71663. if (isHighlight) {
  71664. // 根据style扩展默认高亮样式
  71665. style = this.getHighlightStyle(style, this.highlightStyle || {});
  71666. }
  71667. var image = style.image;
  71668. var me = this;
  71669. if (typeof image === 'string') {
  71670. var src = image;
  71671. if (this._imageCache[src]) {
  71672. image = this._imageCache[src];
  71673. } else {
  71674. image = new Image();
  71675. image.onload = function () {
  71676. image.onload = null;
  71677. clearTimeout(SmicImage._refreshTimeout);
  71678. SmicImage._needsRefresh.push(me);
  71679. // 防止因为缓存短时间内触发多次onload事件
  71680. SmicImage._refreshTimeout = setTimeout(function () {
  71681. refresh && refresh(SmicImage._needsRefresh);
  71682. // 清空 needsRefresh
  71683. SmicImage._needsRefresh = [];
  71684. }, 10);
  71685. };
  71686. image.src = src;
  71687. this._imageCache[src] = image;
  71688. }
  71689. }
  71690. if (image) {
  71691. // 图片已经加载完成
  71692. if (image.nodeName.toUpperCase() == 'IMG') {
  71693. if (window.ActiveXObject) {
  71694. if (image.readyState != 'complete') {
  71695. return;
  71696. }
  71697. } else {
  71698. if (!image.complete) {
  71699. return;
  71700. }
  71701. }
  71702. }
  71703. // Else is canvas
  71704. var width = style.width || image.width;
  71705. var height = style.height || image.height;
  71706. var x = style.x + __OP[0];
  71707. var y = style.y + __OP[1];
  71708. // 图片加载失败
  71709. if (!image.width || !image.height) {
  71710. return;
  71711. }
  71712. ctx.save();
  71713. this.doClip(ctx);
  71714. this.setContext(ctx, style);
  71715. // 设置transform
  71716. this.setTransform(ctx);
  71717. if (style.sWidth && style.sHeight) {
  71718. var sx = style.sx + __OP[0] || 0;
  71719. var sy = style.sy + __OP[1] || 0;
  71720. ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height);
  71721. } else if (style.sx && style.sy) {
  71722. var _sx = style.sx + __OP[0];
  71723. var _sy = style.sy + __OP[1];
  71724. var sWidth = width - _sx;
  71725. var sHeight = height - _sy;
  71726. ctx.drawImage(image, _sx, _sy, sWidth, sHeight, x, y, width, height);
  71727. } else {
  71728. ctx.drawImage(image, x, y, width, height);
  71729. }
  71730. // 如果没设置宽和高的话自动根据图片宽高设置
  71731. if (!style.width) {
  71732. style.width = width;
  71733. }
  71734. if (!style.height) {
  71735. style.height = height;
  71736. }
  71737. if (!this.style.width) {
  71738. this.style.width = width;
  71739. }
  71740. if (!this.style.height) {
  71741. this.style.height = height;
  71742. }
  71743. this.drawText(ctx, style, this.style);
  71744. ctx.restore();
  71745. }
  71746. }
  71747. /**
  71748. * @function LevelRenderer.Shape.SmicImage.prototype.getRect
  71749. * @description 计算返回图片的包围盒矩形。
  71750. *
  71751. * @param {Object} style - style
  71752. * @return {Object} 边框对象。包含属性:x,y,width,height。
  71753. */
  71754. }, {
  71755. key: "getRect",
  71756. value: function getRect(style) {
  71757. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  71758. this.refOriginalPosition = [0, 0];
  71759. }
  71760. var __OP = this.refOriginalPosition;
  71761. return {
  71762. x: style.x + __OP[0],
  71763. y: style.y + __OP[1],
  71764. width: style.width,
  71765. height: style.height
  71766. };
  71767. }
  71768. /**
  71769. * @function LevelRenderer.Shape.SmicImage.prototype.clearCache
  71770. * @description 清除图片缓存。
  71771. *
  71772. * @param {Object} style - style
  71773. * @return {Object} 边框对象。包含属性:x,y,width,height。
  71774. *
  71775. */
  71776. }, {
  71777. key: "clearCache",
  71778. value: function clearCache() {
  71779. this._imageCache = {};
  71780. }
  71781. }]);
  71782. return SmicImage;
  71783. }(Shape_Shape);
  71784. SmicImage._needsRefresh = [];
  71785. SmicImage._refreshTimeout = null;
  71786. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicRectangle.js
  71787. function SmicRectangle_typeof(obj) { "@babel/helpers - typeof"; return SmicRectangle_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicRectangle_typeof(obj); }
  71788. function SmicRectangle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  71789. function SmicRectangle_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  71790. function SmicRectangle_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicRectangle_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicRectangle_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  71791. function SmicRectangle_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicRectangle_get = Reflect.get.bind(); } else { SmicRectangle_get = function _get(target, property, receiver) { var base = SmicRectangle_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicRectangle_get.apply(this, arguments); }
  71792. function SmicRectangle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicRectangle_getPrototypeOf(object); if (object === null) break; } return object; }
  71793. function SmicRectangle_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicRectangle_setPrototypeOf(subClass, superClass); }
  71794. function SmicRectangle_setPrototypeOf(o, p) { SmicRectangle_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicRectangle_setPrototypeOf(o, p); }
  71795. function SmicRectangle_createSuper(Derived) { var hasNativeReflectConstruct = SmicRectangle_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicRectangle_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicRectangle_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicRectangle_possibleConstructorReturn(this, result); }; }
  71796. function SmicRectangle_possibleConstructorReturn(self, call) { if (call && (SmicRectangle_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicRectangle_assertThisInitialized(self); }
  71797. function SmicRectangle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  71798. function SmicRectangle_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  71799. function SmicRectangle_getPrototypeOf(o) { SmicRectangle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicRectangle_getPrototypeOf(o); }
  71800. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  71801. * This program are made available under the terms of the Apache License, Version 2.0
  71802. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  71803. /**
  71804. * @private
  71805. * @class LevelRenderer.Shape.SmicRectangle
  71806. * @category Visualization Theme
  71807. * @classdesc 矩形。
  71808. * @extends LevelRenderer.Shape
  71809. * @example
  71810. * var shape = new LevelRenderer.Shape.SmicRectangle({
  71811. * style: {
  71812. * x: 0,
  71813. * y: 0,
  71814. * width: 100,
  71815. * height: 100,
  71816. * radius: 20
  71817. * }
  71818. * });
  71819. * levelRenderer.addShape(shape);
  71820. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  71821. */
  71822. var SmicRectangle = /*#__PURE__*/function (_Shape) {
  71823. SmicRectangle_inherits(SmicRectangle, _Shape);
  71824. var _super = SmicRectangle_createSuper(SmicRectangle);
  71825. function SmicRectangle(options) {
  71826. var _this;
  71827. SmicRectangle_classCallCheck(this, SmicRectangle);
  71828. _this = _super.call(this, options);
  71829. /**
  71830. * @member {string} LevelRenderer.Shape.SmicRectangle.prototype.type
  71831. * @description 图形类型.
  71832. */
  71833. _this.type = 'smicrectangle';
  71834. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  71835. _this.refOriginalPosition = [0, 0];
  71836. }
  71837. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicRectangle";
  71838. return _this;
  71839. }
  71840. /**
  71841. * @function LevelRenderer.Shape.SmicRectangle.prototype.destroy
  71842. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  71843. */
  71844. SmicRectangle_createClass(SmicRectangle, [{
  71845. key: "destroy",
  71846. value: function destroy() {
  71847. this.type = null;
  71848. SmicRectangle_get(SmicRectangle_getPrototypeOf(SmicRectangle.prototype), "destroy", this).call(this);
  71849. }
  71850. /**
  71851. * APIMethod: _buildRadiusPath
  71852. * 创建矩形的圆角路径。
  71853. *
  71854. * Parameters:
  71855. * ctx - {CanvasRenderingContext2D} Context2D 上下文。
  71856. * style - {Object} style。
  71857. *
  71858. */
  71859. }, {
  71860. key: "_buildRadiusPath",
  71861. value: function _buildRadiusPath(ctx, style) {
  71862. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  71863. this.refOriginalPosition = [0, 0];
  71864. }
  71865. var __OP = this.refOriginalPosition;
  71866. // 左上、右上、右下、左下角的半径依次为r1、r2、r3、r4
  71867. // r缩写为1 相当于 [1, 1, 1, 1]
  71868. // r缩写为[1] 相当于 [1, 1, 1, 1]
  71869. // r缩写为[1, 2] 相当于 [1, 2, 1, 2]
  71870. // r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2]
  71871. var x = style.x + __OP[0];
  71872. var y = style.y + __OP[1];
  71873. var width = style.width;
  71874. var height = style.height;
  71875. var r = style.radius;
  71876. var r1;
  71877. var r2;
  71878. var r3;
  71879. var r4;
  71880. if (typeof r === 'number') {
  71881. r1 = r2 = r3 = r4 = r;
  71882. } else if (r instanceof Array) {
  71883. if (r.length === 1) {
  71884. r1 = r2 = r3 = r4 = r[0];
  71885. } else if (r.length === 2) {
  71886. r1 = r3 = r[0];
  71887. r2 = r4 = r[1];
  71888. } else if (r.length === 3) {
  71889. r1 = r[0];
  71890. r2 = r4 = r[1];
  71891. r3 = r[2];
  71892. } else {
  71893. r1 = r[0];
  71894. r2 = r[1];
  71895. r3 = r[2];
  71896. r4 = r[3];
  71897. }
  71898. } else {
  71899. r1 = r2 = r3 = r4 = 0;
  71900. }
  71901. var total;
  71902. if (r1 + r2 > width) {
  71903. total = r1 + r2;
  71904. r1 *= width / total;
  71905. r2 *= width / total;
  71906. }
  71907. if (r3 + r4 > width) {
  71908. total = r3 + r4;
  71909. r3 *= width / total;
  71910. r4 *= width / total;
  71911. }
  71912. if (r2 + r3 > height) {
  71913. total = r2 + r3;
  71914. r2 *= height / total;
  71915. r3 *= height / total;
  71916. }
  71917. if (r1 + r4 > height) {
  71918. total = r1 + r4;
  71919. r1 *= height / total;
  71920. r4 *= height / total;
  71921. }
  71922. ctx.moveTo(x + r1, y);
  71923. ctx.lineTo(x + width - r2, y);
  71924. r2 !== 0 && ctx.quadraticCurveTo(x + width, y, x + width, y + r2);
  71925. ctx.lineTo(x + width, y + height - r3);
  71926. r3 !== 0 && ctx.quadraticCurveTo(x + width, y + height, x + width - r3, y + height);
  71927. ctx.lineTo(x + r4, y + height);
  71928. r4 !== 0 && ctx.quadraticCurveTo(x, y + height, x, y + height - r4);
  71929. ctx.lineTo(x, y + r1);
  71930. r1 !== 0 && ctx.quadraticCurveTo(x, y, x + r1, y);
  71931. }
  71932. /**
  71933. * @function LevelRenderer.Shape.SmicRectangle.prototype.buildPath
  71934. * @description 创建矩形路径。
  71935. *
  71936. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  71937. * @param {Object} style - style。
  71938. *
  71939. */
  71940. }, {
  71941. key: "buildPath",
  71942. value: function buildPath(ctx, style) {
  71943. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  71944. this.refOriginalPosition = [0, 0];
  71945. }
  71946. var __OP = this.refOriginalPosition;
  71947. if (!style.radius) {
  71948. ctx.moveTo(style.x + __OP[0], style.y + __OP[1]);
  71949. ctx.lineTo(style.x + __OP[0] + style.width, style.y + __OP[1]);
  71950. ctx.lineTo(style.x + __OP[0] + style.width, style.y + __OP[1] + style.height);
  71951. ctx.lineTo(style.x + __OP[0], style.y + __OP[1] + style.height);
  71952. ctx.lineTo(style.x + __OP[0], style.y + __OP[1]);
  71953. // ctx.rect(style.x, style.y, style.width, style.height);
  71954. } else {
  71955. this._buildRadiusPath(ctx, style);
  71956. }
  71957. ctx.closePath();
  71958. return;
  71959. }
  71960. /**
  71961. * @function LevelRenderer.Shape.SmicRectangle.prototype.getRect
  71962. * @description 计算返回矩形包围盒矩阵。该包围盒是直接从四个控制点计算,并非最小包围盒。
  71963. *
  71964. * @param {Object} style - style
  71965. * @return {Object} 边框对象。包含属性:x,y,width,height。
  71966. */
  71967. }, {
  71968. key: "getRect",
  71969. value: function getRect(style) {
  71970. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  71971. this.refOriginalPosition = [0, 0];
  71972. }
  71973. var __OP = this.refOriginalPosition;
  71974. if (style.__rect) {
  71975. return style.__rect;
  71976. }
  71977. var lineWidth;
  71978. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  71979. lineWidth = style.lineWidth || 1;
  71980. } else {
  71981. lineWidth = 0;
  71982. }
  71983. style.__rect = {
  71984. x: Math.round(style.x + __OP[0] - lineWidth / 2),
  71985. y: Math.round(style.y + __OP[1] - lineWidth / 2),
  71986. width: style.width + lineWidth,
  71987. height: style.height + lineWidth
  71988. };
  71989. return style.__rect;
  71990. }
  71991. }]);
  71992. return SmicRectangle;
  71993. }(Shape_Shape);
  71994. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicSector.js
  71995. function SmicSector_typeof(obj) { "@babel/helpers - typeof"; return SmicSector_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicSector_typeof(obj); }
  71996. function SmicSector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  71997. function SmicSector_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  71998. function SmicSector_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicSector_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicSector_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  71999. function SmicSector_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicSector_get = Reflect.get.bind(); } else { SmicSector_get = function _get(target, property, receiver) { var base = SmicSector_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicSector_get.apply(this, arguments); }
  72000. function SmicSector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicSector_getPrototypeOf(object); if (object === null) break; } return object; }
  72001. function SmicSector_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicSector_setPrototypeOf(subClass, superClass); }
  72002. function SmicSector_setPrototypeOf(o, p) { SmicSector_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicSector_setPrototypeOf(o, p); }
  72003. function SmicSector_createSuper(Derived) { var hasNativeReflectConstruct = SmicSector_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicSector_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicSector_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicSector_possibleConstructorReturn(this, result); }; }
  72004. function SmicSector_possibleConstructorReturn(self, call) { if (call && (SmicSector_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicSector_assertThisInitialized(self); }
  72005. function SmicSector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  72006. function SmicSector_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  72007. function SmicSector_getPrototypeOf(o) { SmicSector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicSector_getPrototypeOf(o); }
  72008. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  72009. * This program are made available under the terms of the Apache License, Version 2.0
  72010. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  72011. /**
  72012. * @private
  72013. * @class LevelRenderer.Shape.SmicSector
  72014. * @category Visualization Theme
  72015. * @classdesc 扇形。
  72016. * @extends LevelRenderer.Shape
  72017. * @example
  72018. * var shape = new LevelRenderer.Shape.SmicSector({
  72019. * style: {
  72020. * x: 100,
  72021. * y: 100,
  72022. * r: 60,
  72023. * r0: 30,
  72024. * startAngle: 0,
  72025. * endEngle: 180
  72026. * }
  72027. * });
  72028. * levelRenderer.addShape(shape);
  72029. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  72030. *
  72031. */
  72032. var SmicSector = /*#__PURE__*/function (_Shape) {
  72033. SmicSector_inherits(SmicSector, _Shape);
  72034. var _super = SmicSector_createSuper(SmicSector);
  72035. function SmicSector(options) {
  72036. var _this;
  72037. SmicSector_classCallCheck(this, SmicSector);
  72038. _this = _super.call(this, options);
  72039. /**
  72040. * @member {string} LevelRenderer.Shape.SmicSector.protptype.type
  72041. * @description 图形类型。
  72042. */
  72043. _this.type = 'smicsector';
  72044. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  72045. _this.refOriginalPosition = [0, 0];
  72046. }
  72047. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicSector";
  72048. return _this;
  72049. }
  72050. /**
  72051. * @function LevelRenderer.Shape.SmicSector.prototype.destroy
  72052. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  72053. */
  72054. SmicSector_createClass(SmicSector, [{
  72055. key: "destroy",
  72056. value: function destroy() {
  72057. this.type = null;
  72058. SmicSector_get(SmicSector_getPrototypeOf(SmicSector.prototype), "destroy", this).call(this);
  72059. }
  72060. /**
  72061. * @function LevelRenderer.Shape.SmicSector.prototype.buildPath
  72062. * @description 创建扇形路径。
  72063. *
  72064. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  72065. * @param {Object} style - style。
  72066. *
  72067. */
  72068. }, {
  72069. key: "buildPath",
  72070. value: function buildPath(ctx, style) {
  72071. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  72072. this.refOriginalPosition = [0, 0];
  72073. }
  72074. var __OP = this.refOriginalPosition;
  72075. var x = style.x + __OP[0]; // 圆心x
  72076. var y = style.y + __OP[1]; // 圆心y
  72077. var r0 = style.r0 || 0; // 形内半径[0,r)
  72078. var r = style.r; // 扇形外半径(0,r]
  72079. var startAngle = style.startAngle; // 起始角度[0,360)
  72080. var endAngle = style.endAngle; // 结束角度(0,360]
  72081. var clockWise = style.clockWise || false;
  72082. startAngle = SUtil_SUtil.Util_math.degreeToRadian(startAngle);
  72083. endAngle = SUtil_SUtil.Util_math.degreeToRadian(endAngle);
  72084. if (!clockWise) {
  72085. // 扇形默认是逆时针方向,Y轴向上
  72086. // 这个跟arc的标准不一样,为了兼容echarts
  72087. startAngle = -startAngle;
  72088. endAngle = -endAngle;
  72089. }
  72090. var unitX = SUtil_SUtil.Util_math.cos(startAngle);
  72091. var unitY = SUtil_SUtil.Util_math.sin(startAngle);
  72092. ctx.moveTo(unitX * r0 + x, unitY * r0 + y);
  72093. ctx.lineTo(unitX * r + x, unitY * r + y);
  72094. ctx.arc(x, y, r, startAngle, endAngle, !clockWise);
  72095. ctx.lineTo(SUtil_SUtil.Util_math.cos(endAngle) * r0 + x, SUtil_SUtil.Util_math.sin(endAngle) * r0 + y);
  72096. if (r0 !== 0) {
  72097. ctx.arc(x, y, r0, endAngle, startAngle, clockWise);
  72098. }
  72099. ctx.closePath();
  72100. return;
  72101. }
  72102. /**
  72103. * @function LevelRenderer.Shape.SmicSector.prototype.getRect
  72104. * @description 返回扇形包围盒矩形
  72105. *
  72106. * @param {Object} style - style
  72107. * @return {Object} 边框对象。包含属性:x,y,width,height。
  72108. *
  72109. */
  72110. }, {
  72111. key: "getRect",
  72112. value: function getRect(style) {
  72113. if (style.__rect) {
  72114. return style.__rect;
  72115. }
  72116. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  72117. this.refOriginalPosition = [0, 0];
  72118. }
  72119. var __OP = this.refOriginalPosition;
  72120. var min0 = SUtil_SUtil.Util_vector.create();
  72121. var min1 = SUtil_SUtil.Util_vector.create();
  72122. var max0 = SUtil_SUtil.Util_vector.create();
  72123. var max1 = SUtil_SUtil.Util_vector.create();
  72124. var x = style.x + __OP[0]; // 圆心x
  72125. var y = style.y + __OP[1]; // 圆心y
  72126. var r0 = style.r0 || 0; // 形内半径[0,r)
  72127. var r = style.r; // 扇形外半径(0,r]
  72128. var startAngle = SUtil_SUtil.Util_math.degreeToRadian(style.startAngle);
  72129. var endAngle = SUtil_SUtil.Util_math.degreeToRadian(style.endAngle);
  72130. var clockWise = style.clockWise;
  72131. if (!clockWise) {
  72132. startAngle = -startAngle;
  72133. endAngle = -endAngle;
  72134. }
  72135. if (r0 > 1) {
  72136. SUtil_SUtil.Util_computeBoundingBox.arc(x, y, r0, startAngle, endAngle, !clockWise, min0, max0);
  72137. } else {
  72138. min0[0] = max0[0] = x;
  72139. min0[1] = max0[1] = y;
  72140. }
  72141. SUtil_SUtil.Util_computeBoundingBox.arc(x, y, r, startAngle, endAngle, !clockWise, min1, max1);
  72142. SUtil_SUtil.Util_vector.min(min0, min0, min1);
  72143. SUtil_SUtil.Util_vector.max(max0, max0, max1);
  72144. style.__rect = {
  72145. x: min0[0],
  72146. y: min0[1],
  72147. width: max0[0] - min0[0],
  72148. height: max0[1] - min0[1]
  72149. };
  72150. return style.__rect;
  72151. }
  72152. }]);
  72153. return SmicSector;
  72154. }(Shape_Shape);
  72155. ;// CONCATENATED MODULE: ./src/common/overlay/feature/ShapeFactory.js
  72156. function ShapeFactory_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  72157. function ShapeFactory_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  72158. function ShapeFactory_createClass(Constructor, protoProps, staticProps) { if (protoProps) ShapeFactory_defineProperties(Constructor.prototype, protoProps); if (staticProps) ShapeFactory_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  72159. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  72160. * This program are made available under the terms of the Apache License, Version 2.0
  72161. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  72162. /**
  72163. * @class FeatureShapeFactory
  72164. * @aliasclass Feature.ShapeFactory
  72165. * @deprecatedclass SuperMap.Feature.ShapeFactory
  72166. * @category Visualization Theme
  72167. * @classdesc 图形工厂类。
  72168. * 目前支持创建的图形有:<br>
  72169. * 用于统计专题图:<br>
  72170. * 点 - 参数对象 <{@link ShapeParametersPoint}> <br>
  72171. * 线 - 参数对象 <{@link ShapeParametersLine}> <br>
  72172. * 面 - 参数对象 <{@link ShapeParametersPolygon}> <br>
  72173. * 矩形 - 参数对象 <{@link ShapeParametersPolygon}> <br>
  72174. * 扇形 - 参数对象 <{@link ShapeParametersSector}> <br>
  72175. * 标签 - 参数对象 <{@link ShapeParametersLabel}> <br>
  72176. * 图片 - 参数对象 <{@link ShapeParametersImage}> <br>
  72177. * 用于符号专题图:<br>
  72178. * 圆形 - 参数对象:<{@link ShapeParametersCircle}>
  72179. * @param {Object} [shapeParameters] - 图形参数对象,<{@link ShapeParameters}> 子类对象。
  72180. * @usage
  72181. */
  72182. var ShapeFactory = /*#__PURE__*/function () {
  72183. function ShapeFactory(shapeParameters) {
  72184. ShapeFactory_classCallCheck(this, ShapeFactory);
  72185. /**
  72186. * @member {Object} FeatureShapeFactory.prototype.shapeParameters
  72187. * @description 图形参数对象,<{@link ShapeParameters}> 子类对象。必设参数,默认值 null。
  72188. */
  72189. this.shapeParameters = shapeParameters;
  72190. this.CLASS_NAME = "SuperMap.Feature.ShapeFactory";
  72191. }
  72192. /**
  72193. * @function FeatureShapeFactory.prototype.destroy
  72194. * @description 销毁图形工厂类对象。
  72195. */
  72196. ShapeFactory_createClass(ShapeFactory, [{
  72197. key: "destroy",
  72198. value: function destroy() {
  72199. this.shapeParameters = null;
  72200. }
  72201. /**
  72202. * @function FeatureShapeFactory.prototype.createShape
  72203. * @description 创建一个图形。具体图形由 shapeParameters 决定。
  72204. * @param {Object} shapeParameters - 图形参数对象,<{@link ShapeParameters}> 子类对象。
  72205. * 此参数可选,如果使用此参数(不为 null),shapeParameters 属性值将被修改为参数的值,然后再使用 shapeParameters 属性值创建图形;
  72206. * 如果不使用此参数,createShape 方法将直接使用 shapeParameters 属性创建图形。
  72207. * @returns {Object} 图形对象(或 null - 图形创建失败)。
  72208. */
  72209. }, {
  72210. key: "createShape",
  72211. value: function createShape(shapeParameters) {
  72212. if (shapeParameters) {
  72213. this.shapeParameters = shapeParameters;
  72214. }
  72215. if (!this.shapeParameters) {
  72216. return null;
  72217. }
  72218. var sps = this.shapeParameters;
  72219. if (sps instanceof Point_Point) {
  72220. // 点
  72221. //设置style
  72222. var style = new Object();
  72223. style["x"] = sps.x;
  72224. style["y"] = sps.y;
  72225. style["r"] = sps.r;
  72226. style = Util_Util.copyAttributesWithClip(style, sps.style, ['x', 'y']);
  72227. //创建图形
  72228. var shape = new SmicPoint();
  72229. shape.style = ShapeFactory.transformStyle(style);
  72230. shape.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  72231. Util_Util.copyAttributesWithClip(shape, sps, ['x', 'y', 'style', 'highlightStyle']);
  72232. return shape;
  72233. } else if (sps instanceof Line_Line) {
  72234. // 线
  72235. //检查参数 pointList 是否存在
  72236. if (!sps.pointList) {
  72237. return null;
  72238. }
  72239. // 设置style
  72240. var _style = new Object();
  72241. _style["pointList"] = sps.pointList;
  72242. _style = Util_Util.copyAttributesWithClip(_style, sps.style, ['pointList']);
  72243. // 创建图形
  72244. var _shape = new SmicBrokenLine();
  72245. _shape.style = ShapeFactory.transformStyle(_style);
  72246. _shape.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  72247. Util_Util.copyAttributesWithClip(_shape, sps, ['pointList', 'style', 'highlightStyle']);
  72248. return _shape;
  72249. } else if (sps instanceof feature_Polygon_Polygon) {
  72250. // 面
  72251. //检查参数 pointList 是否存在
  72252. if (!sps.pointList) {
  72253. return null;
  72254. }
  72255. //设置style
  72256. var _style2 = new Object();
  72257. _style2["pointList"] = sps.pointList;
  72258. _style2 = Util_Util.copyAttributesWithClip(_style2, sps.style, ['pointList']);
  72259. //创建图形
  72260. var _shape2 = new SmicPolygon();
  72261. _shape2.style = ShapeFactory.transformStyle(_style2);
  72262. _shape2.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  72263. Util_Util.copyAttributesWithClip(_shape2, sps, ['pointList', 'style', "highlightStyle"]);
  72264. return _shape2;
  72265. } else if (sps instanceof Rectangle_Rectangle) {
  72266. // 矩形
  72267. //检查参数 pointList 是否存在
  72268. if (!sps.x && !sps.y & !sps.width & !sps.height) {
  72269. return null;
  72270. }
  72271. //设置style
  72272. var _style3 = new Object();
  72273. _style3["x"] = sps.x;
  72274. _style3["y"] = sps.y;
  72275. _style3["width"] = sps.width;
  72276. _style3["height"] = sps.height;
  72277. _style3 = Util_Util.copyAttributesWithClip(_style3, sps.style, ['x', 'y', 'width', 'height']);
  72278. //创建图形
  72279. var _shape3 = new SmicRectangle();
  72280. _shape3.style = ShapeFactory.transformStyle(_style3);
  72281. _shape3.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  72282. Util_Util.copyAttributesWithClip(_shape3, sps, ['x', 'y', 'width', 'height', 'style', 'highlightStyle']);
  72283. return _shape3;
  72284. } else if (sps instanceof Sector) {
  72285. // 扇形
  72286. //设置style
  72287. var _style4 = new Object();
  72288. _style4["x"] = sps.x;
  72289. _style4["y"] = sps.y;
  72290. _style4["r"] = sps.r;
  72291. _style4["startAngle"] = sps.startAngle;
  72292. _style4["endAngle"] = sps.endAngle;
  72293. if (sps["r0"]) {
  72294. _style4["r0"] = sps.r0;
  72295. }
  72296. if (sps["clockWise"]) {
  72297. _style4["clockWise"] = sps.clockWise;
  72298. }
  72299. _style4 = Util_Util.copyAttributesWithClip(_style4, sps.style, ['x', 'y', 'r', 'startAngle', 'endAngle', 'r0', 'endAngle']);
  72300. //创建图形
  72301. var _shape4 = new SmicSector();
  72302. _shape4.style = ShapeFactory.transformStyle(_style4);
  72303. _shape4.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  72304. Util_Util.copyAttributesWithClip(_shape4, sps, ['x', 'y', 'r', 'startAngle', 'endAngle', 'r0', 'endAngle', 'style', 'highlightStyle']);
  72305. return _shape4;
  72306. } else if (sps instanceof Label) {
  72307. // 标签
  72308. //设置style
  72309. var _style5 = new Object();
  72310. _style5["x"] = sps.x;
  72311. _style5["y"] = sps.y;
  72312. _style5["text"] = sps.text;
  72313. _style5 = Util_Util.copyAttributesWithClip(_style5, sps.style, ['x', 'y', 'text']);
  72314. //创建图形
  72315. var _shape5 = new SmicText();
  72316. _shape5.style = ShapeFactory.transformStyle(_style5);
  72317. _shape5.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  72318. Util_Util.copyAttributesWithClip(_shape5, sps, ['x', 'y', 'text', 'style', 'highlightStyle']);
  72319. return _shape5;
  72320. } else if (sps instanceof Image_Image) {
  72321. // 图片
  72322. //设置style
  72323. var _style6 = new Object();
  72324. _style6["x"] = sps.x;
  72325. _style6["y"] = sps.y;
  72326. if (sps["image"]) {
  72327. _style6["image"] = sps.image;
  72328. }
  72329. if (sps["width"]) {
  72330. _style6["width"] = sps.width;
  72331. }
  72332. if (sps["height"]) {
  72333. _style6["height"] = sps.height;
  72334. }
  72335. if (sps["sx"]) {
  72336. _style6["sx"] = sps.sx;
  72337. }
  72338. if (sps["sy"]) {
  72339. _style6["sy"] = sps.sy;
  72340. }
  72341. if (sps["sWidth"]) {
  72342. _style6["sWidth"] = sps.sWidth;
  72343. }
  72344. if (sps["sHeight"]) {
  72345. _style6["sHeight"] = sps.sHeight;
  72346. }
  72347. _style6 = Util_Util.copyAttributesWithClip(_style6, sps.style, ['x', 'y', 'image', 'width', 'height', 'sx', 'sy', 'sWidth', 'sHeight']);
  72348. //创建图形
  72349. var _shape6 = new SmicImage();
  72350. _shape6.style = ShapeFactory.transformStyle(_style6);
  72351. _shape6.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  72352. Util_Util.copyAttributesWithClip(_shape6, sps, ['x', 'y', 'image', 'width', 'height', 'style', 'highlightStyle']);
  72353. return _shape6;
  72354. } else if (sps instanceof Circle_Circle) {
  72355. //圆形 用于符号专题图
  72356. //设置stytle
  72357. var _style7 = new Object();
  72358. _style7["x"] = sps.x;
  72359. _style7["r"] = sps.r;
  72360. _style7["y"] = sps.y;
  72361. _style7 = Util_Util.copyAttributesWithClip(_style7, sps.style, ['x', 'y', 'r']);
  72362. //创建图形
  72363. var _shape7 = new SmicCircle();
  72364. _shape7.style = ShapeFactory.transformStyle(_style7);
  72365. _shape7.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  72366. Util_Util.copyAttributesWithClip(_shape7, sps, ['x', 'y', 'r', 'style', 'highlightStyle', 'lineWidth', 'text', 'textPosition']);
  72367. return _shape7;
  72368. }
  72369. return null;
  72370. }
  72371. /**
  72372. * @function FeatureShapeFactory.prototype.transformStyle
  72373. * @description 将用户 feature.style (类 Svg style 标准) 的样式,转换为 levelRenderer 的样式标准(类 CSS-Canvas 样式)
  72374. * @param {Object} style - 用户 style。
  72375. * @returns {Object} 符合 levelRenderer 的 style。
  72376. */
  72377. }], [{
  72378. key: "transformStyle",
  72379. value: function transformStyle(style) {
  72380. var newStyle = {};
  72381. //字体 ["font-style", "font-variant", "font-weight", "font-size / line-height", "font-family"];
  72382. var fontStr = ["normal", "normal", "normal", "12", "arial,sans-serif"];
  72383. //画笔类型 ["fill", "stroke"];
  72384. var brushType = [true, false];
  72385. for (var ss in style) {
  72386. switch (ss) {
  72387. case "fill":
  72388. brushType[0] = style[ss];
  72389. break;
  72390. case "fillColor":
  72391. newStyle["color"] = style[ss];
  72392. break;
  72393. case "stroke":
  72394. brushType[1] = style[ss];
  72395. break;
  72396. case "strokeWidth":
  72397. newStyle["lineWidth"] = style[ss];
  72398. break;
  72399. case "strokeLinecap":
  72400. newStyle["lineCap"] = style[ss];
  72401. break;
  72402. case "strokeLineJoin":
  72403. newStyle["lineJoin"] = style[ss];
  72404. break;
  72405. case "strokeDashstyle":
  72406. newStyle["lineType"] = style[ss];
  72407. break;
  72408. case "pointRadius":
  72409. newStyle["r"] = style[ss];
  72410. break;
  72411. case "label":
  72412. newStyle["text"] = style[ss];
  72413. break;
  72414. case "labelRect":
  72415. newStyle["labelRect"] = style[ss];
  72416. break;
  72417. case "fontColor":
  72418. newStyle["textColor"] = style[ss];
  72419. break;
  72420. case "fontStyle":
  72421. fontStr[0] = style[ss];
  72422. break;
  72423. case "fontVariant":
  72424. fontStr[1] = style[ss];
  72425. break;
  72426. case "fontWeight":
  72427. fontStr[2] = style[ss];
  72428. break;
  72429. case "fontSize":
  72430. var unit = "";
  72431. if (style[ss] && style[ss].toString().indexOf("px") < 0) {
  72432. unit = "px";
  72433. }
  72434. fontStr[3] = style[ss] + unit;
  72435. break;
  72436. case "fontFamily":
  72437. fontStr[4] = style[ss];
  72438. break;
  72439. case "fontOpacity":
  72440. newStyle["opacity"] = style[ss];
  72441. break;
  72442. case "labelPosition":
  72443. newStyle["textPosition"] = style[ss];
  72444. break;
  72445. case "labelAlign":
  72446. newStyle["textAlign"] = style[ss];
  72447. break;
  72448. case "labelBaseline":
  72449. newStyle["textBaseline"] = style[ss];
  72450. break;
  72451. case "labelRotation":
  72452. newStyle["textRotation"] = style[ss];
  72453. break;
  72454. default:
  72455. newStyle[ss] = style[ss];
  72456. break;
  72457. }
  72458. }
  72459. //拼接字体字符串
  72460. newStyle["textFont"] = fontStr.join(" ");
  72461. //画笔类型
  72462. if (brushType[0] === true && brushType[1] === false) {
  72463. newStyle["brushType"] = "fill";
  72464. } else if (brushType[0] === false && brushType[1] === true) {
  72465. newStyle["brushType"] = "stroke";
  72466. } else if (brushType[0] === true && brushType[1] === true) {
  72467. newStyle["brushType"] = "both";
  72468. } else {
  72469. newStyle["brushType"] = "fill";
  72470. }
  72471. //默认线宽 1
  72472. if (newStyle["lineWidth"] == null) {
  72473. newStyle["lineWidth"] = 1;
  72474. }
  72475. return newStyle;
  72476. }
  72477. /**
  72478. * @function FeatureShapeFactory.prototype.Background
  72479. * @description 创建一个矩形背景框图形对象。
  72480. * @param {FeatureShapeFactory} shapeFactory - 图形工厂对象。
  72481. * @param {Array.<number>} box - 框区域,长度为 4 的一维数组,像素坐标,[left, bottom, right, top]。
  72482. * @param {Object} setting - 图表配置参数。本函数中图形配置对象 setting 可设属性:
  72483. * @param {Object} setting.backgroundStyle - 背景样式,此样式对象对象可设属性:<ShapeParametersRectangle#style>。
  72484. * @param {Array.<number>} [setting.backgroundRadius=[0,0,0,0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4,则 backgroundRadius 为 [r1、r2、r3、r4 ]。
  72485. * @returns {Object} 背景框图形,一个可视化图形(矩形)对象。
  72486. */
  72487. }, {
  72488. key: "Background",
  72489. value: function Background(shapeFactory, box, setting) {
  72490. var sets = setting ? setting : {};
  72491. // 背景框图形参数对象
  72492. var bgSP = new Rectangle_Rectangle(box[0], box[3], Math.abs(box[2] - box[0]), Math.abs(box[3] - box[1]));
  72493. // 默认样式
  72494. bgSP.style = {
  72495. fillColor: "#f3f3f3"
  72496. };
  72497. // 设置用户 style
  72498. if (sets.backgroundStyle) {
  72499. Util_Util.copyAttributesWithClip(bgSP.style, sets.backgroundStyle);
  72500. }
  72501. // 设置背景框圆角参数
  72502. if (sets.backgroundRadius) {
  72503. bgSP.style["radius"] = sets.backgroundRadius;
  72504. }
  72505. // 禁止背景框响应事件
  72506. bgSP.clickable = false;
  72507. bgSP.hoverable = false;
  72508. return shapeFactory.createShape(bgSP);
  72509. }
  72510. /**
  72511. * @function FeatureShapeFactory.prototype.GraphAxis
  72512. * @description 创建一个统计图表坐标轴图形对象组。
  72513. * @param {FeatureShapeFactory} shapeFactory - 图形工厂对象。
  72514. * @param {Array.<number>} dataViewBox - 统计图表模型的数据视图框,长度为 4 的一维数组,像素坐标,[left, bottom, right, top]。
  72515. * @param {Object} setting - 图表配置参数。
  72516. * @param {Object} setting.axisStyle - 坐标轴样式,此样式对象对象可设属性:<ShapeParametersLine#style>。
  72517. * @param {boolean} [setting.axisUseArrow=false] - 坐标轴是否使用箭头。
  72518. * @param {number} [setting.axisYTick=0] - y 轴刻度数量,0表示不使用箭头。
  72519. * @param {Array.<string>} setting.axisYLabels - y 轴上的标签组内容,标签顺序沿着数据视图框左面条边自上而下,等距排布。例如:["1000", "750", "500", "250", "0"]。
  72520. * @param {Object} setting.axisYLabelsStyle - y 轴上的标签组样式,此样式对象对象可设属性:<ShapeParametersLabel#style>。
  72521. * @param {Array.<number>} [setting.axisYLabelsOffset=[0,0]] - y 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 y 轴标签组横向上的偏移量,向左为正,默认值:0;数组第二项表示 y 轴标签组纵向上的偏移量,向下为正,默认值:0。
  72522. * @param {Array.<string>} setting.axisXLabels - x 轴上的标签组内容,标签顺序沿着数据视图框下面条边自左向右排布,例如:["92年", "95年", "99年"]。
  72523. * 标签排布规则:当标签数量与 xShapeInfo 中的属性 xPositions 数量相同(即标签个数与数据个数相等时), 按照 xPositions 提供的位置在水平方向上排布标签,否则沿数据视图框下面条边等距排布标签。
  72524. * @param {Object} setting.axisXLabelsStyle - x 轴上的标签组样式,此样式对象对象可设属性:<ShapeParametersLabel#style>。
  72525. * @param {Array.<number>} [setting.axisXLabelsOffset=[0,0]] - x 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 x 轴标签组横向上的偏移量,向左为正,默认值:0;数组第二项表示 x 轴标签组纵向上的偏移量,向下为正,默认值:0。
  72526. * @param {boolean} setting.useXReferenceLine - 是否使用水平参考线,如果为 true,在 axisYTick 大于 0 时有效,水平参考线是 y 轴刻度在数据视图框里的延伸。
  72527. * @param {Object} setting.xReferenceLineStyle - 水平参考线样式,此样式对象对象可设属性:<ShapeParametersLine#style>。
  72528. * @param {number} [setting.axis3DParameter=0] - 3D 坐标轴参数,此属性值在大于等于 15 时有效。
  72529. * @param {Object} xShapeInfo - X 方向上的图形信息对象,包含两个属性。
  72530. * @param {Array.<number>} xShapeInfo.xPositions - 图形在 x 轴方向上的像素坐标值,是一个一维数组,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  72531. * @param {number} xShapeInfo.width - 图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  72532. * @returns {Array.<Object>} 统计图表坐标轴图形对象数组。
  72533. */
  72534. }, {
  72535. key: "GraphAxis",
  72536. value: function GraphAxis(shapeFactory, dataViewBox, setting, xShapeInfo) {
  72537. var dvb = dataViewBox;
  72538. var sets = setting ? setting : {};
  72539. // 参考线图形对象组
  72540. var refLines = [];
  72541. //坐标轴箭头对象组
  72542. var arrows = [];
  72543. // 是否使用参水平考线,默认不使用
  72544. var isAddRefLine = sets.useXReferenceLine ? sets.useXReferenceLine : false;
  72545. // y 轴上的刻度
  72546. var axisytick = sets.axisYTick && !isNaN(sets.axisYTick) ? sets.axisYTick : 0;
  72547. // 坐标轴节点数组
  72548. var pois = [];
  72549. //z 轴箭头数组
  72550. var zArrowPois = [];
  72551. // x,y 轴主干节点数组
  72552. var xMainPois = [];
  72553. if (axisytick == 0) {
  72554. xMainPois.push([dvb[0], dvb[3] - 5]);
  72555. xMainPois.push([dvb[0], dvb[1]]);
  72556. // 3D 坐标轴 第三象限平分线
  72557. if (sets.axis3DParameter && !isNaN(sets.axis3DParameter) && sets.axis3DParameter >= 15) {
  72558. var axis3DParameter = parseInt(sets.axis3DParameter);
  72559. var axis3DPoi = [dvb[0] - axis3DParameter, dvb[1] + axis3DParameter];
  72560. // 添加 3D 轴节点
  72561. if (sets.axisUseArrow) {
  72562. // 添加 3D 轴箭头节点坐标
  72563. //箭头坐标
  72564. zArrowPois.push([axis3DPoi[0] + 1.5, axis3DPoi[1] - 7.5]);
  72565. zArrowPois.push([axis3DPoi[0] - 1, axis3DPoi[1] + 1]);
  72566. zArrowPois.push([axis3DPoi[0] + 7.5, axis3DPoi[1] - 1.5]);
  72567. //3D轴
  72568. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  72569. } else {
  72570. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  72571. }
  72572. xMainPois.push([dvb[0], dvb[1]]);
  72573. }
  72574. xMainPois.push([dvb[2] + 5, dvb[1]]);
  72575. } else {
  72576. // 单位刻度长度
  72577. var unitTick = Math.abs(dvb[1] - dvb[3]) / axisytick;
  72578. // 刻度 y 坐标
  72579. var thckY = dvb[3];
  72580. xMainPois.push([dvb[0], thckY - 5]);
  72581. for (var i = 0; i < axisytick; i++) {
  72582. xMainPois.push([dvb[0], thckY]);
  72583. xMainPois.push([dvb[0] - 5, thckY]);
  72584. xMainPois.push([dvb[0], thckY]);
  72585. // 参考线
  72586. if (isAddRefLine) {
  72587. // 参考线参数对象
  72588. var refLineSP = new Line_Line([[dvb[0], thckY], [dvb[2], thckY]]);
  72589. // 参考线默认样式对象
  72590. refLineSP.style = {
  72591. strokeColor: "#cfcfcf",
  72592. strokeLinecap: "butt",
  72593. strokeLineJoin: "round",
  72594. strokeWidth: 1
  72595. };
  72596. // 禁止事件
  72597. refLineSP.clickable = false;
  72598. refLineSP.hoverable = false;
  72599. // 用户style
  72600. if (sets.xReferenceLineStyle) {
  72601. Util_Util.copyAttributesWithClip(refLineSP.style, sets.xReferenceLineStyle);
  72602. }
  72603. // 生成参考线图形对象
  72604. refLines.push(shapeFactory.createShape(refLineSP));
  72605. }
  72606. // y 刻度增量
  72607. thckY += unitTick;
  72608. }
  72609. xMainPois.push([dvb[0], dvb[1]]);
  72610. // 3D 坐标轴 第三象限平分线
  72611. if (sets.axis3DParameter && !isNaN(sets.axis3DParameter) && sets.axis3DParameter >= 15) {
  72612. var _axis3DParameter = parseInt(sets.axis3DParameter);
  72613. var _axis3DPoi = [dvb[0] - _axis3DParameter, dvb[1] + _axis3DParameter];
  72614. /*
  72615. // 箭头计算过程
  72616. var axis3DPoiRef = [axis3DPoi[0] + 7, axis3DPoi[1] - 7]; // 7 是 10 为斜边 cos(45度)时邻边的值
  72617. var axis3DPoiLT = [axis3DPoiRef[0] - 4, axis3DPoiRef[1] - 4];
  72618. var axis3DPoiRB = [axis3DPoiRef[0] + 4, axis3DPoiRef[1] + 4];
  72619. if(sets.axisUseArrow){
  72620. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  72621. xMainPois.push([axis3DPoiLT[0], axis3DPoiLT[1]]);
  72622. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  72623. xMainPois.push([axis3DPoiRB[0], axis3DPoiRB[1]]);
  72624. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  72625. }
  72626. else{
  72627. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  72628. }
  72629. */
  72630. // 添加 3D 轴节点
  72631. if (sets.axisUseArrow) {
  72632. // 添加 3D 轴和箭头坐标
  72633. //箭头坐标
  72634. zArrowPois.push([_axis3DPoi[0] + 1.5, _axis3DPoi[1] - 7.5]);
  72635. zArrowPois.push([_axis3DPoi[0] - 1, _axis3DPoi[1] + 1]);
  72636. zArrowPois.push([_axis3DPoi[0] + 7.5, _axis3DPoi[1] - 1.5]);
  72637. //3D轴
  72638. xMainPois.push([_axis3DPoi[0], _axis3DPoi[1]]);
  72639. } else {
  72640. xMainPois.push([_axis3DPoi[0], _axis3DPoi[1]]);
  72641. }
  72642. xMainPois.push([dvb[0], dvb[1]]);
  72643. }
  72644. xMainPois.push([dvb[2] + 5, dvb[1]]);
  72645. }
  72646. // 坐标轴箭头
  72647. if (sets.axisUseArrow) {
  72648. // x 轴箭头节点数组
  72649. var xArrowPois = [[dvb[2] + 5, dvb[1] + 4], [dvb[2] + 13, dvb[1]], [dvb[2] + 5, dvb[1] - 4]];
  72650. // y 轴箭头节点数组
  72651. var yArrowPois = [[dvb[0] - 4, dvb[3] - 5], [dvb[0], dvb[3] - 13], [dvb[0] + 4, dvb[3] - 5]];
  72652. //x轴箭头
  72653. var xSP = new feature_Polygon_Polygon(xArrowPois);
  72654. xSP.style = {
  72655. fillColor: "#008acd"
  72656. };
  72657. Util_Util.copyAttributesWithClip(xSP.style, sets.axisStyle);
  72658. arrows.push(shapeFactory.createShape(xSP));
  72659. //y轴箭头
  72660. var ySP = new feature_Polygon_Polygon(yArrowPois);
  72661. ySP.style = {
  72662. fillColor: "#008acd"
  72663. };
  72664. Util_Util.copyAttributesWithClip(ySP.style, sets.axisStyle);
  72665. arrows.push(shapeFactory.createShape(ySP));
  72666. // z轴箭头 坐标轴箭头是否要使用
  72667. if (sets.axis3DParameter && !isNaN(sets.axis3DParameter) && sets.axis3DParameter >= 15) {
  72668. var zSP = new feature_Polygon_Polygon(zArrowPois);
  72669. zSP.style = {
  72670. fillColor: "#008acd"
  72671. };
  72672. Util_Util.copyAttributesWithClip(zSP.style, sets.axisStyle);
  72673. arrows.push(shapeFactory.createShape(zSP));
  72674. }
  72675. }
  72676. //不带箭头的坐标轴
  72677. pois = xMainPois;
  72678. // 坐标轴参数对象
  72679. var axisSP = new Line_Line(pois);
  72680. // 坐标轴默认style
  72681. axisSP.style = {
  72682. strokeLinecap: "butt",
  72683. strokeLineJoin: "round",
  72684. strokeColor: "#008acd",
  72685. strokeWidth: 1
  72686. };
  72687. // 用户 style
  72688. if (sets.axisStyle) {
  72689. Util_Util.copyAttributesWithClip(axisSP.style, sets.axisStyle);
  72690. }
  72691. // 禁止事件
  72692. axisSP.clickable = false;
  72693. axisSP.hoverable = false;
  72694. // 创建坐标轴图形对象
  72695. var axisMain = [shapeFactory.createShape(axisSP)];
  72696. // Y 轴标签
  72697. var yLabels = [];
  72698. if (sets.axisYLabels && sets.axisYLabels.length && sets.axisYLabels.length > 0) {
  72699. var axisYLabels = sets.axisYLabels;
  72700. var len = axisYLabels.length;
  72701. // 标签偏移量
  72702. var ylOffset = [0, 0];
  72703. if (sets.axisYLabelsOffset && sets.axisYLabelsOffset.length) {
  72704. ylOffset = sets.axisYLabelsOffset;
  72705. }
  72706. if (len == 1) {
  72707. // 标签参数对象
  72708. var labelYSP = new Label(dvb[0] - 5 + ylOffset[0], dvb[3] + ylOffset[1], axisYLabels[0]);
  72709. labelYSP.style = {
  72710. labelAlign: "right"
  72711. };
  72712. // 用户 style
  72713. if (sets.axisYLabelsStyle) {
  72714. Util_Util.copyAttributesWithClip(labelYSP.style, sets.axisYLabelsStyle);
  72715. }
  72716. // 禁止事件
  72717. labelYSP.clickable = false;
  72718. labelYSP.hoverable = false;
  72719. // 制作标签
  72720. yLabels.push(shapeFactory.createShape(labelYSP));
  72721. } else {
  72722. var labelY = dvb[3];
  72723. // y 轴标签单位距离
  72724. var yUnit = Math.abs(dvb[1] - dvb[3]) / (len - 1);
  72725. for (var j = 0; j < len; j++) {
  72726. // 标签参数对象
  72727. var _labelYSP = new Label(dvb[0] - 5 + ylOffset[0], labelY + ylOffset[1], axisYLabels[j]);
  72728. _labelYSP.style = {
  72729. labelAlign: "right"
  72730. };
  72731. // 用户 style
  72732. if (sets.axisYLabelsStyle) {
  72733. Util_Util.copyAttributesWithClip(_labelYSP.style, sets.axisYLabelsStyle);
  72734. }
  72735. // 禁止事件
  72736. _labelYSP.clickable = false;
  72737. _labelYSP.hoverable = false;
  72738. // 制作标签
  72739. yLabels.push(shapeFactory.createShape(_labelYSP));
  72740. // y 轴标签 y 方向增量
  72741. labelY += yUnit;
  72742. }
  72743. }
  72744. }
  72745. // X 轴标签
  72746. var xLabels = [];
  72747. if (sets.axisXLabels && sets.axisXLabels.length && sets.axisXLabels.length > 0) {
  72748. var axisXLabels = sets.axisXLabels;
  72749. var _len = axisXLabels.length;
  72750. // 标签偏移量
  72751. var xlOffset = [0, 0];
  72752. if (sets.axisXLabelsOffset && sets.axisXLabelsOffset.length) {
  72753. xlOffset = sets.axisXLabelsOffset;
  72754. }
  72755. // 标签个数与数据字段个数相等等时,标签在 x 轴均匀排列
  72756. if (xShapeInfo && xShapeInfo.xPositions && xShapeInfo.xPositions.length && xShapeInfo.xPositions.length == _len) {
  72757. var xsCenter = xShapeInfo.xPositions;
  72758. for (var K = 0; K < _len; K++) {
  72759. // 标签参数对象
  72760. var labelXSP = new Label(xsCenter[K] + xlOffset[0], dvb[1] + xlOffset[1], axisXLabels[K]);
  72761. // 默认 style
  72762. labelXSP.style = {
  72763. labelAlign: "center",
  72764. labelBaseline: "top"
  72765. };
  72766. // 用户 style
  72767. if (sets.axisXLabelsStyle) {
  72768. Util_Util.copyAttributesWithClip(labelXSP.style, sets.axisXLabelsStyle);
  72769. }
  72770. // 禁止事件
  72771. labelXSP.clickable = false;
  72772. labelXSP.hoverable = false;
  72773. // 创建标签对象
  72774. xLabels.push(shapeFactory.createShape(labelXSP));
  72775. }
  72776. } else {
  72777. if (_len == 1) {
  72778. // 标签参数对象
  72779. var _labelXSP = new Label(dvb[0] - 5 + xlOffset[0], dvb[1] + xlOffset[0], axisXLabels[0]);
  72780. // 默认 style
  72781. _labelXSP.style = {
  72782. labelAlign: "center",
  72783. labelBaseline: "top"
  72784. };
  72785. // 用户 style
  72786. if (sets.axisXLabelsStyle) {
  72787. Util_Util.copyAttributesWithClip(_labelXSP.style, sets.axisXLabelsStyle);
  72788. }
  72789. // 禁止事件
  72790. _labelXSP.clickable = false;
  72791. _labelXSP.hoverable = false;
  72792. // 创建标签对象
  72793. xLabels.push(shapeFactory.createShape(_labelXSP));
  72794. } else {
  72795. var labelX = dvb[0];
  72796. // x 轴标签单位距离
  72797. var xUnit = Math.abs(dvb[2] - dvb[0]) / (_len - 1);
  72798. for (var m = 0; m < _len; m++) {
  72799. // 标签参数对象
  72800. var _labelXSP2 = new Label(labelX + xlOffset[0], dvb[1] + xlOffset[1], axisXLabels[m]);
  72801. // 默认 style
  72802. _labelXSP2.style = {
  72803. labelAlign: "center",
  72804. labelBaseline: "top"
  72805. };
  72806. // 用户 style
  72807. if (sets.axisXLabelsStyle) {
  72808. Util_Util.copyAttributesWithClip(_labelXSP2.style, sets.axisXLabelsStyle);
  72809. }
  72810. // 禁止事件
  72811. _labelXSP2.clickable = false;
  72812. _labelXSP2.hoverable = false;
  72813. // 创建标签对象
  72814. xLabels.push(shapeFactory.createShape(_labelXSP2));
  72815. // x 轴标签 x 方向增量
  72816. labelX += xUnit;
  72817. }
  72818. }
  72819. }
  72820. }
  72821. // 组装并返回构成坐标轴的图形
  72822. return refLines.concat(axisMain).concat(yLabels).concat(xLabels).concat(arrows);
  72823. }
  72824. /**
  72825. * @function FeatureShapeFactory.prototype.ShapeStyleTool
  72826. * @description 一个图形 style 处理工具。此工具将指定的默认 style,通用 style,按 styleGroup 取得的 style 和按数据值 value 范围取得的 style 进行合并,得到图形最终的 style。
  72827. * @param {Object} defaultStyle - 默认style,此样式对象可设属性根据图形类型参考 <{@link ShapeParameters}> 子类对象的 style 属性。
  72828. * @param {Object} style - 图形对象基础 style,此参数控制图形的基础样式,可设属性根据图形类型参考 <{@link ShapeParameters}> 子类对象的 style 属性。优先级低于 styleGroup,styleByCodomain。
  72829. * @param {Array.<Object>} styleGroup - 一个 style 数组,优先级低于 styleByCodomain,高于 style。此数组每个元素是样式对象,
  72830. * 其可设属性根据图形类型参考 <{@link ShapeParameters}> 子类对象的 style 属性。通过 index 参数从 styleGroup 中取 style。
  72831. * @param {Array.<Object>} styleByCodomain - 按数据(参数 value)所在值域范围控制数据的可视化对象样式。
  72832. * (start code)
  72833. * // styleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  72834. * // start: 值域值下限(包含);
  72835. * // end: 值域值上限(不包含);
  72836. * // style: 数据可视化图形的 style,其可设属性根据图形类型参考 <ShapeParameters> 子类对象的 style 属性。
  72837. * // dataStyleByCodomain 数组形如:
  72838. * [
  72839. * {
  72840. * start:0,
  72841. * end:250,
  72842. * style:{
  72843. * fillColor:"#00CD00"
  72844. * }
  72845. * },
  72846. * {
  72847. * start:250,
  72848. * end:500,
  72849. * style:{
  72850. * fillColor:"#00EE00"
  72851. * }
  72852. * },
  72853. * {
  72854. * start:500,
  72855. * end:750,
  72856. * style:{
  72857. * fillColor:"#00FF7F"
  72858. * }
  72859. * },
  72860. * {
  72861. * start:750,
  72862. * end:1500,
  72863. * style:{
  72864. * fillColor:"#00FF00"
  72865. * }
  72866. * }
  72867. * ]
  72868. * (end)
  72869. * @param {number} index - styleGroup 的索引值,用于取出 styleGroup 指定的 style。
  72870. * @param {number} value - 数据值,用于取出 styleByCodomain 指定的 style。
  72871. * @returns {Object} 合并后的样式 (style) 对象。
  72872. */
  72873. }, {
  72874. key: "ShapeStyleTool",
  72875. value: function ShapeStyleTool(defaultStyle, style, styleGroup, styleByCodomain, index, value) {
  72876. // 用 defaultStyle 初始化 style 对象
  72877. var finalStyle = defaultStyle ? defaultStyle : {};
  72878. // 基础 style
  72879. if (style) {
  72880. Util_Util.copyAttributesWithClip(finalStyle, style);
  72881. }
  72882. // 按索引赋 style
  72883. if (styleGroup && styleGroup.length && typeof index !== "undefined" && !isNaN(index) && index >= 0) {
  72884. if (styleGroup[index]) {
  72885. Util_Util.copyAttributesWithClip(finalStyle, styleGroup[index]);
  72886. }
  72887. }
  72888. // 按值域赋 style
  72889. if (styleByCodomain && styleByCodomain.length && typeof value !== "undefined") {
  72890. var dsc = styleByCodomain;
  72891. var dscLen = dsc.length;
  72892. var v = parseFloat(value);
  72893. for (var i = 0; i < dscLen; i++) {
  72894. if (dsc[i].start <= v && v < dsc[i].end) {
  72895. Util_Util.copyAttributesWithClip(finalStyle, dsc[i].style);
  72896. break;
  72897. }
  72898. }
  72899. }
  72900. return finalStyle;
  72901. }
  72902. }]);
  72903. return ShapeFactory;
  72904. }();
  72905. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Theme.js
  72906. function feature_Theme_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  72907. function feature_Theme_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  72908. function feature_Theme_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Theme_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Theme_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  72909. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  72910. * This program are made available under the terms of the Apache License, Version 2.0
  72911. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  72912. /**
  72913. * @class FeatureTheme
  72914. * @aliasclass Feature.Theme
  72915. * @deprecatedclass SuperMap.Feature.Theme
  72916. * @category Visualization Theme
  72917. * @classdesc 专题要素基类。
  72918. * @param {Object} data - 用户数据,用于生成可视化 shape。
  72919. * @param {SuperMap.Layer.Theme} layer - 此专题要素所在图层。
  72920. * @usage
  72921. */
  72922. var Theme_Theme = /*#__PURE__*/function () {
  72923. function Theme(data, layer) {
  72924. feature_Theme_classCallCheck(this, Theme);
  72925. if (!data) {
  72926. return;
  72927. }
  72928. // layer 必须已经添加到地图, 且已初始化渲染器
  72929. if (!layer || !layer.map || !layer.renderer) {
  72930. return;
  72931. }
  72932. /**
  72933. * @member {string} FeatureTheme.prototype.id
  72934. * @description 专题要素唯一标识。
  72935. */
  72936. this.id = Util_Util.createUniqueID(this.CLASS_NAME + "_");
  72937. /**
  72938. * @member {LonLat} FeatureTheme.prototype.lonlat
  72939. * @description 专题要素地理参考位置。子类中必须根据用户数据(或地理位置参数)对其赋值。
  72940. */
  72941. this.lonlat = null;
  72942. /**
  72943. * @member {Array.<number>} FeatureTheme.prototype.location
  72944. * @description 专题要素像素参考位置。通常由地理参考位置决定。长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  72945. */
  72946. this.location = [];
  72947. /**
  72948. * @readonly
  72949. * @member {Object} FeatureTheme.prototype.data
  72950. * @description 用户数据,用于生成可视化 shape,可在子类中规定数据格式或类型,如:<{@link FeatureVector}>。
  72951. */
  72952. this.data = data;
  72953. /**
  72954. * @readonly
  72955. * @member {Array.<Object>} FeatureTheme.prototype.shapes
  72956. * @description 构成此专题要素的可视化图形对象数组,数组顺序控制渲染。
  72957. */
  72958. this.shapes = [];
  72959. /**
  72960. * @readonly
  72961. * @member {SuperMap.Layer.Theme} FeatureTheme.prototype.layer
  72962. * @description 此专题要素所在专题图层。
  72963. */
  72964. this.layer = layer;
  72965. this.CLASS_NAME = "SuperMap.Feature.Theme";
  72966. }
  72967. /**
  72968. * @function FeatureTheme.prototype.destroy
  72969. * @description 销毁专题要素。
  72970. */
  72971. feature_Theme_createClass(Theme, [{
  72972. key: "destroy",
  72973. value: function destroy() {
  72974. this.data = null;
  72975. this.id = null;
  72976. this.lonlat = null;
  72977. this.location = null;
  72978. this.shapes = null;
  72979. this.layer = null;
  72980. }
  72981. /**
  72982. * @function FeatureTheme.prototype.getLocalXY
  72983. * @description 地理坐标转为像素坐标。
  72984. * @param {GeometryPoint|GeometryGeoText|LonLat} coordinate - 地理坐标点。
  72985. * @returns {Array.<number>} 长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  72986. */
  72987. }, {
  72988. key: "getLocalXY",
  72989. value: function getLocalXY(coordinate) {
  72990. var resolution = this.layer.map.getResolution();
  72991. var extent = this.layer.map.getExtent();
  72992. if (coordinate instanceof Point || coordinate instanceof GeoText) {
  72993. var x = coordinate.x / resolution + -extent.left / resolution;
  72994. var y = extent.top / resolution - coordinate.y / resolution;
  72995. return [x, y];
  72996. } else if (coordinate instanceof LonLat) {
  72997. var _x = coordinate.lon / resolution + -extent.left / resolution;
  72998. var _y = extent.top / resolution - coordinate.lat / resolution;
  72999. return [_x, _y];
  73000. } else {
  73001. return null;
  73002. }
  73003. }
  73004. }]);
  73005. return Theme;
  73006. }();
  73007. ;// CONCATENATED MODULE: ./src/common/overlay/Graph.js
  73008. function Graph_typeof(obj) { "@babel/helpers - typeof"; return Graph_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Graph_typeof(obj); }
  73009. function Graph_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73010. function Graph_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  73011. function Graph_createClass(Constructor, protoProps, staticProps) { if (protoProps) Graph_defineProperties(Constructor.prototype, protoProps); if (staticProps) Graph_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  73012. function Graph_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Graph_get = Reflect.get.bind(); } else { Graph_get = function _get(target, property, receiver) { var base = Graph_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Graph_get.apply(this, arguments); }
  73013. function Graph_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Graph_getPrototypeOf(object); if (object === null) break; } return object; }
  73014. function Graph_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Graph_setPrototypeOf(subClass, superClass); }
  73015. function Graph_setPrototypeOf(o, p) { Graph_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Graph_setPrototypeOf(o, p); }
  73016. function Graph_createSuper(Derived) { var hasNativeReflectConstruct = Graph_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Graph_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Graph_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Graph_possibleConstructorReturn(this, result); }; }
  73017. function Graph_possibleConstructorReturn(self, call) { if (call && (Graph_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Graph_assertThisInitialized(self); }
  73018. function Graph_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73019. function Graph_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  73020. function Graph_getPrototypeOf(o) { Graph_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Graph_getPrototypeOf(o); }
  73021. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  73022. * This program are made available under the terms of the Apache License, Version 2.0
  73023. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73024. /**
  73025. * @class FeatureThemeGraph
  73026. * @aliasclass Feature.Theme.Graph
  73027. * @deprecatedclass SuperMap.Feature.Theme.Graph
  73028. * @category Visualization Theme
  73029. * @classdesc 统计专题要素基类。
  73030. * 此类定义了统计专题要素基础模型,具体的图表模型通过继承此类,在子类中实现 assembleShapes 方法。
  73031. * 统计专题要素模型采用了可视化图形大小自适应策略,用较少的参数控制着图表诸多图形,图表配置对象 <FeatureThemeGraph.setting> 的基础属性只有 7 个,
  73032. * 它们控制着图表结构、值域范围、数据小数位等基础图表形态。构成图表的图形必须在图表结构里自适应大小。
  73033. * 此类不可实例化,此类的可实例化子类必须实现 assembleShapes() 方法。
  73034. * @extends FeatureTheme
  73035. * @param {FeatureVector} data - 用户数据。
  73036. * @param {SuperMap.Layer.Theme} layer - 此专题要素所在图层。
  73037. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  73038. * @param {Object} setting - 图表配置对象。
  73039. * @param {LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  73040. * @usage
  73041. */
  73042. var Graph = /*#__PURE__*/function (_Theme) {
  73043. Graph_inherits(Graph, _Theme);
  73044. var _super = Graph_createSuper(Graph);
  73045. function Graph(data, layer, fields, setting, lonlat, options) {
  73046. var _this;
  73047. Graph_classCallCheck(this, Graph);
  73048. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  73049. /**
  73050. * @member {FeatureShapeFactory} FeatureThemeGraph.prototype.shapeFactory
  73051. * @description 内置的图形工厂对象,调用其 createShape 方法创建图形。
  73052. */
  73053. _this.shapeFactory = new ShapeFactory();
  73054. /**
  73055. * @member {Object} FeatureThemeGraph.prototype.shapeParameters
  73056. * @description 当前图形参数对象,<{@link ShapeParameters}> 的子类对象。
  73057. */
  73058. _this.shapeParameters = null;
  73059. /**
  73060. * @member {boolean} [FeatureThemeGraph.prototype.RelativeCoordinate]
  73061. * @description 图形是否已经计算了相对坐标。
  73062. */
  73063. _this.RelativeCoordinate = false;
  73064. /**
  73065. * @member {Object} FeatureThemeGraph.prototype.setting
  73066. * @description 图表配置对象,该对象控制着图表的可视化显示。
  73067. * @param {number} width - 专题要素(图表)宽度。
  73068. * @param {number} height - 专题要素(图表)高度。
  73069. * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  73070. * @param {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  73071. * @param {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  73072. * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox
  73073. * (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  73074. * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。
  73075. * 如果不设置此参数,在取数据值时不对数据做小数位处理。
  73076. *
  73077. */
  73078. _this.setting = null;
  73079. /**
  73080. * @readonly
  73081. * @member {Array.<number>} FeatureThemeGraph.prototype.origonPoint
  73082. * @description 专题要素(图表)原点,图表左上角点像素坐标,是长度为 2 的一维数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  73083. */
  73084. _this.origonPoint = null;
  73085. /**
  73086. * @readonly
  73087. * @member {Array.<number>} FeatureThemeGraph.prototype.chartBox
  73088. * @description 专题要素(图表)区域,即图表框,长度为 4 的一维数组,数组的 4 个元素依次表示图表框左端 x 坐标值、
  73089. * 下端 y坐标值、右端 x坐标值、上端 y 坐标值;[left, bottom, right, top]。
  73090. */
  73091. _this.chartBox = null;
  73092. /**
  73093. * @readonly
  73094. * @member {Bounds} FeatureThemeGraph.prototype.chartBounds
  73095. * @description 图表 Bounds 随着 lonlat、XOffset、YOffset 更新,注意 chartBounds 是图表像素范围,不是地理范围。
  73096. */
  73097. _this.chartBounds = null;
  73098. /**
  73099. * @readonly
  73100. * @member {number} FeatureThemeGraph.prototype.width
  73101. * @description 专题要素(图表)宽度 。
  73102. */
  73103. _this.width = null;
  73104. /**
  73105. * @readonly
  73106. * @member {number} FeatureThemeGraph.prototype.height
  73107. * @description 专题要素(图表)高度 。
  73108. */
  73109. _this.height = null;
  73110. /**
  73111. * @readonly
  73112. * @member {number} FeatureThemeGraph.prototype.XOffset
  73113. * @description 专题要素(图表)在 X 方向上的偏移值,单位像素。
  73114. */
  73115. _this.XOffset = 0;
  73116. /**
  73117. * @readonly
  73118. * @member {number} FeatureThemeGraph.prototype.YOffset
  73119. * @description 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  73120. */
  73121. _this.YOffset = 0;
  73122. /**
  73123. * @readonly
  73124. * @member {Array.<number>} FeatureThemeGraph.prototype.DVBParameter
  73125. * @description 数据视图框参数,长度为 4 的一维数组(数组元素值 >= 0),[leftOffset, bottomOffset, rightOffset, topOffset],chartBox 内偏距值。
  73126. * 此属性用于指定数据视图框 dataViewBox 的范围。
  73127. */
  73128. _this.DVBParameter = null;
  73129. /**
  73130. * @readonly
  73131. * @member {Array.<number>} FeatureThemeGraph.prototype.dataViewBox
  73132. * @description 数据视图框,长度为 4 的一维数组,[left, bottom, right, top]。
  73133. * dataViewBox 是统计专题要素最核心的内容,它负责解释数据在一个像素区域里的数据可视化含义,
  73134. * 这种含义用可视化图形表达出来,这些表示数据的图形和一些辅助图形组合在一起构成统计专题图表。
  73135. */
  73136. _this.dataViewBox = null;
  73137. /**
  73138. * @readonly
  73139. * @member {Array.<number>} FeatureThemeGraph.prototype.DVBCodomain
  73140. * @description 数据视图框的内允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  73141. * dataViewBox 中允许的数据范围,对数据溢出值域范围情况的处理需要在 assembleShapes 中进行。
  73142. */
  73143. _this.DVBCodomain = null;
  73144. /**
  73145. * @readonly
  73146. * @member {Array.<number>} FeatureThemeGraph.prototype.DVBCenterPoint
  73147. * @description 数据视图框中心点,长度为 2 的一维数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  73148. */
  73149. _this.DVBCenterPoint = null;
  73150. /**
  73151. * @readonly
  73152. * @member {string} FeatureThemeGraph.prototype.DVBUnitValue
  73153. * @description 单位值。在 assembleShapes() 中初始化其具体意义,例如:饼图的 DVBUnitValue 可以定义为"360/数据总和",
  73154. * 折线图的 DVBUnitValue 可以定义为 "DVBCodomain/DVBHeight"。
  73155. */
  73156. _this.DVBUnitValue = null;
  73157. /**
  73158. * @readonly
  73159. * @member {Array.<number>} FeatureThemeGraph.prototype.DVBOrigonPoint
  73160. * @description 数据视图框原点,数据视图框左上角点,长度为 2 的一维数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  73161. */
  73162. _this.DVBOrigonPoint = null;
  73163. /**
  73164. * @readonly
  73165. * @member {number} FeatureThemeGraph.prototype.DVBWidth
  73166. * @description 数据视图框宽度。
  73167. */
  73168. _this.DVBWidth = null;
  73169. /**
  73170. * @readonly
  73171. * @member {number} FeatureThemeGraph.prototype.DVBHeight
  73172. * @description 数据视图框高度。
  73173. */
  73174. _this.DVBHeight = null;
  73175. /**
  73176. * @readonly
  73177. * @member {Array.<number>} FeatureThemeGraph.prototype.origonPointOffset
  73178. * @description 数据视图框原点相对于图表框的原点偏移量,长度为 2 的一维数组,第一个元素表示 x 偏移量,第二个元素表示 y 偏移量。
  73179. */
  73180. _this.origonPointOffset = null;
  73181. /**
  73182. * @readonly
  73183. * @member {Array.<string>} FeatureThemeGraph.prototype.fields
  73184. * @description 数据{FeatureVector}属性字段。
  73185. */
  73186. _this.fields = fields || [];
  73187. /**
  73188. * @readonly
  73189. * @member {Array.<number>} FeatureThemeGraph.prototype.dataValues
  73190. * @description 图表展示的数据值,通过 fields 从数据 feature 属性中获得。
  73191. */
  73192. _this.dataValues = null;
  73193. // 图表位置
  73194. if (lonlat) {
  73195. _this.lonlat = lonlat;
  73196. } else {
  73197. // 默认使用 bounds 中心
  73198. _this.lonlat = _this.data.geometry.getBounds().getCenterLonLat();
  73199. }
  73200. // 配置项检测与赋值
  73201. if (setting && setting.width && setting.height && setting.codomain) {
  73202. _this.setting = setting;
  73203. }
  73204. _this.CLASS_NAME = "SuperMap.Feature.Theme.Graph";
  73205. return _this;
  73206. }
  73207. /**
  73208. * @function FeatureThemeGraph.prototype.destroy
  73209. * @description 销毁专题要素。
  73210. */
  73211. Graph_createClass(Graph, [{
  73212. key: "destroy",
  73213. value: function destroy() {
  73214. this.shapeFactory = null;
  73215. this.shapeParameters = null;
  73216. this.width = null;
  73217. this.height = null;
  73218. this.origonPoint = null;
  73219. this.chartBox = null;
  73220. this.dataViewBox = null;
  73221. this.chartBounds = null;
  73222. this.DVBParameter = null;
  73223. this.DVBOrigonPoint = null;
  73224. this.DVBCenterPoint = null;
  73225. this.DVBWidth = null;
  73226. this.DVBHeight = null;
  73227. this.DVBCodomain = null;
  73228. this.DVBUnitValue = null;
  73229. this.origonPointOffset = null;
  73230. this.XOffset = null;
  73231. this.YOffset = null;
  73232. this.fields = null;
  73233. this.dataValues = null;
  73234. this.setting = null;
  73235. Graph_get(Graph_getPrototypeOf(Graph.prototype), "destroy", this).call(this);
  73236. }
  73237. /**
  73238. * @function FeatureThemeGraph.prototype.initBaseParameter
  73239. * @description 初始化专题要素(图表)基础参数。在调用此方法前,此类的图表模型相关属性都是不可用的 ,此方法在 assembleShapes 函数中调用。
  73240. * 调用此函数关系到 setting 对象的以下属性。
  73241. * @param {number} width - 专题要素(图表)宽度。
  73242. * @param {number} height - 专题要素(图表)高度。
  73243. * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  73244. * @param {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  73245. * @param {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  73246. * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox。
  73247. * (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  73248. * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  73249. * @returns {boolean} 初始化参数是否成功。
  73250. */
  73251. }, {
  73252. key: "initBaseParameter",
  73253. value: function initBaseParameter() {
  73254. // 参数初始化是否成功
  73255. var isSuccess = true;
  73256. // setting 属性是否已成功赋值
  73257. if (!this.setting) {
  73258. return false;
  73259. }
  73260. var sets = this.setting;
  73261. // 检测 setting 的必设参数
  73262. if (!(sets.width && sets.height && sets.codomain)) {
  73263. return false;
  73264. }
  73265. // 数据
  73266. var decimalNumber = typeof sets.decimalNumber !== "undefined" && !isNaN(sets.decimalNumber) ? sets.decimalNumber : -1;
  73267. var dataEffective = Theme_Theme.getDataValues(this.data, this.fields, decimalNumber);
  73268. this.dataValues = dataEffective ? dataEffective : [];
  73269. // 基础参数 width, height, codomain
  73270. this.width = parseFloat(sets.width);
  73271. this.height = parseFloat(sets.height);
  73272. this.DVBCodomain = sets.codomain;
  73273. // 图表偏移
  73274. // if(sets.XOffset) {this.XOffset = sets.XOffset};
  73275. // if(sets.YOffset) {this.YOffset = sets.YOffset};
  73276. this.XOffset = sets.XOffset ? sets.XOffset : 0;
  73277. this.YOffset = sets.YOffset ? sets.YOffset : 0;
  73278. // 其他默认值
  73279. this.origonPoint = [];
  73280. this.chartBox = [];
  73281. this.dataViewBox = [];
  73282. this.DVBParameter = sets.dataViewBoxParameter ? sets.dataViewBoxParameter : [0, 0, 0, 0];
  73283. this.DVBOrigonPoint = [];
  73284. this.DVBCenterPoint = [];
  73285. this.origonPointOffset = [];
  73286. // 图表位置
  73287. this.resetLocation();
  73288. // 专题要素宽度 w
  73289. var w = this.width;
  73290. // 专题要素高度 h
  73291. var h = this.height;
  73292. // 专题要素像素位置 loc
  73293. var loc = this.location;
  73294. // 专题要素像素位置 loc
  73295. this.origonPoint = [loc[0] - w / 2, loc[1] - h / 2];
  73296. // 专题要素原点(左上角)
  73297. var op = this.origonPoint;
  73298. // 图表框([left, bottom, right, top])
  73299. this.chartBox = [op[0], op[1] + h, op[0] + w, op[1]];
  73300. // 图表框
  73301. var cb = this.chartBox;
  73302. // 数据视图框参数,它是图表框各方向对应的内偏距
  73303. var dbbP = this.DVBParameter;
  73304. // 数据视图框 ([left, bottom, right, top])
  73305. this.dataViewBox = [cb[0] + dbbP[0], cb[1] - dbbP[1], cb[2] - dbbP[2], cb[3] + dbbP[3]];
  73306. // 数据视图框
  73307. var dvb = this.dataViewBox;
  73308. //检查数据视图框是否合法
  73309. if (dvb[0] >= dvb[2] || dvb[1] <= dvb[3]) {
  73310. return false;
  73311. }
  73312. // 数据视图框原点
  73313. this.DVBOrigonPoint = [dvb[0], dvb[3]];
  73314. // 数据视图框宽度
  73315. this.DVBWidth = Math.abs(dvb[2] - dvb[0]);
  73316. // 数据视图框高度
  73317. this.DVBHeight = Math.abs(dvb[1] - dvb[3]);
  73318. // 数据视图框中心点
  73319. this.DVBCenterPoint = [this.DVBOrigonPoint[0] + this.DVBWidth / 2, this.DVBOrigonPoint[1] + this.DVBHeight / 2];
  73320. // 数据视图框原点与图表框的原点偏移量
  73321. this.origonPointOffset = [this.DVBOrigonPoint[0] - op[0], this.DVBOrigonPoint[1] - op[1]];
  73322. return isSuccess;
  73323. }
  73324. /**
  73325. * @function FeatureThemeGraph.prototype.resetLocation
  73326. * @description 根据地理位置 lonlat 重置专题要素(图表)位置。
  73327. * @param {LonLat} lonlat - 专题要素新的像素中心位置。
  73328. * @returns {Array.<number>} 新专题要素像素参考位置。长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  73329. */
  73330. }, {
  73331. key: "resetLocation",
  73332. value: function resetLocation(lonlat) {
  73333. if (lonlat) {
  73334. this.lonlat = lonlat;
  73335. }
  73336. // 获取地理位置对应的像素坐标 newLocalLX
  73337. var newLocalLX = this.getLocalXY(this.lonlat);
  73338. // 处理偏移量 XOffset, YOffset
  73339. newLocalLX[0] += this.XOffset;
  73340. newLocalLX[1] += this.YOffset;
  73341. // 将图形位置赋予 location 属性(注意 location 属性表示的是专题要素中心位置)
  73342. this.location = newLocalLX;
  73343. // 更新图表像素 Bounds
  73344. var w = this.width;
  73345. var h = this.height;
  73346. var loc = this.location;
  73347. this.chartBounds = new Bounds(loc[0] - w / 2, loc[1] + h / 2, loc[0] + w / 2, loc[1] - h / 2);
  73348. //重新计算当前渐变色
  73349. this.resetLinearGradient();
  73350. return loc;
  73351. }
  73352. /**
  73353. * @function FeatureThemeGraph.prototype.resetLinearGradient
  73354. * @description resetLocation 中调用 图表的相对坐标存在的时候,重新计算渐变的颜色(目前用于二维柱状图渐变色 所以子类实现此方法)。
  73355. */
  73356. }, {
  73357. key: "resetLinearGradient",
  73358. value: function resetLinearGradient() {
  73359. //子类实现此方法
  73360. }
  73361. /**
  73362. * @function FeatureThemeGraph.prototype.shapesConvertToRelativeCoordinate
  73363. * @description 将(构成图表)图形的节点转为相对坐标表示,此函数必须且只能在 assembleShapes() 结束时调用。
  73364. */
  73365. }, {
  73366. key: "shapesConvertToRelativeCoordinate",
  73367. value: function shapesConvertToRelativeCoordinate() {
  73368. var shapes = this.shapes;
  73369. var shapeROP = this.location;
  73370. for (var i = 0, len = shapes.length; i < len; i++) {
  73371. shapes[i].refOriginalPosition = shapeROP;
  73372. var style = shapes[i].style;
  73373. for (var sty in style) {
  73374. switch (sty) {
  73375. case "pointList":
  73376. var pl = style[sty];
  73377. for (var j = 0, len2 = pl.length; j < len2; j++) {
  73378. pl[j][0] -= shapeROP[0];
  73379. pl[j][1] -= shapeROP[1];
  73380. }
  73381. break;
  73382. case "x":
  73383. style[sty] -= shapeROP[0];
  73384. break;
  73385. case "y":
  73386. style[sty] -= shapeROP[1];
  73387. break;
  73388. default:
  73389. break;
  73390. }
  73391. }
  73392. }
  73393. this.RelativeCoordinate = true;
  73394. }
  73395. /**
  73396. * @function FeatureThemeGraph.prototype.assembleShapes
  73397. * @description 图形装配函数。抽象方法,可视化子类必须实现此方法。<br>
  73398. * 重写此方法的步骤:<br>
  73399. * 1. 图表的某些特殊配置项(setting)处理,例如多数图表模型需要重新指定 dataViewBoxParameter 的默认值。<br>
  73400. * 2. 调用 initBaseParameter() 方法初始化模型属性值,此步骤必须执行,只有当 initBaseParameter 返回 true 时才可以允许进行后续步骤。<br>
  73401. * 3. 计算图形参数,制作图形,图形组合。在组装图表过程中,应该特别注意数据视图框单位值的定义、数据值溢出值域范围的处理和图形大小自适应。<br>
  73402. * 4. 调用 shapesConvertToRelativeCoordinate() 方法,将图形的坐标值转为相对坐标,此步骤必须执行。
  73403. * @example
  73404. * //子类实现 assembleShapes() 接口的步骤示例:
  73405. * assembleShapes: function(){
  73406. * // 第一步:图表的某些特殊配置项(setting)处理,例如多数图表模型需要重新指定 dataViewBoxParameter 的默认值。此步骤是非必须过程。
  73407. *
  73408. * // 图表配置对象
  73409. * var sets = this.setting;
  73410. * // 默认数据视图框,这里展示在使用坐标轴和不使用坐标轴情况下对数据视图框参数赋予不同的默认值
  73411. * if(!sets.dataViewBoxParameter){
  73412. * if(typeof(sets.useAxis) === "undefined" || sets.useAxis){
  73413. * sets.dataViewBoxParameter = [45, 15, 15, 15];
  73414. * }
  73415. * else{
  73416. * sets.dataViewBoxParameter = [5, 5, 5, 5];
  73417. * }
  73418. * }
  73419. *
  73420. * // 第二步:初始化图表模型基本参数,只有在图表模型基本参数初始化成功时才可模型相关属性,如 this.dataViewBox、 this.DVBCodomain等。此步骤是必须过程。
  73421. * if(!this.initBaseParameter()) return;
  73422. *
  73423. * // 第三步:用图形组装图表,在组装图表过程中,应该特别注意数据视图框单位值的定义、数据值溢出值域范围的处理和图形大小自适应。
  73424. * // 定义图表数据视图框中单位值的含义,下面行代码表示将数据视图框单位值定义为数据视图框高度上每像素代表的数据值
  73425. * this.DVBUnitValue = (this.codomain[1] - this.codomain[0])/this.DVBHeight;
  73426. * var uv = this.DVBUnitValue;
  73427. *
  73428. * // 图形参数计算代码......
  73429. *
  73430. * // 关于图形装配,实际上就是利用图形工程对象 this.shapeFactory 的 createShape() 方法通过图形参数对象创建可视化的图形对象,并把这些图形对象按序添加到模型的图形库(his.shapes)中。下面的代码演示创建一个面图形参数对象,并允许通过图形配置对象设置图形的 style 和 highlightStyle,
  73431. * var barParams = new ShapeParametersPolygon(poiLists);
  73432. * barParams.style = sets.barStyle? sets.barStyle:{fillColor: "lightblue"};
  73433. * barParams.highlightStyle = sets.barHoverStyle? sets.barHoverStyle:{fillColor: "blue"};
  73434. * // 图形携带数据ID信息
  73435. * barParams.refDataID = this.data.id;
  73436. * // 创建图形并添加到图表图形数组中
  73437. * this.shapes.push(this.shapeFactory.createShape(barParams));
  73438. *
  73439. * // 第四步:调用 shapesConvertToRelativeCoordinate() 方法,将图形库(his.shapes)中的图形转为由相对坐标表示的图形,客户端统计专题图模块从结构上要求可视化图形使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数。此步骤是必须过程。
  73440. * this.shapesConvertToRelativeCoordinate();
  73441. * },
  73442. */
  73443. }, {
  73444. key: "assembleShapes",
  73445. value: function assembleShapes() {
  73446. //子类必须实现此方法
  73447. }
  73448. /**
  73449. * @function FeatureThemeGraph.prototype.getLocalXY
  73450. * @description 地理坐标转为像素坐标。
  73451. * @param {LonLat} lonlat - 带转换的地理坐标。
  73452. * @returns 屏幕像素坐标。
  73453. */
  73454. }, {
  73455. key: "getLocalXY",
  73456. value: function getLocalXY(lonlat) {
  73457. return this.layer.getLocalXY(lonlat);
  73458. }
  73459. }]);
  73460. return Graph;
  73461. }(Theme_Theme);
  73462. /**
  73463. * @function FeatureTheme.getDataValues
  73464. * @description 根据字段名数组获取指定数据(feature)的属性值数组。属性值类型必须为 Number。
  73465. * @param {FeatureVector} data - 数据。
  73466. * @param {Array.<string>} [fields] - 字段名数组。
  73467. * @param {number} [decimalNumber] - 小数位处理参数,对获取到的属性数据值进行小数位处理。
  73468. * @returns {Array.<string>} 字段名数组对应的属性数据值数组。
  73469. */
  73470. Theme_Theme.getDataValues = function (data, fields, decimalNumber) {
  73471. if (!data.attributes) {
  73472. return false;
  73473. }
  73474. var fieldsValue = [];
  73475. var attrs = data.attributes;
  73476. for (var i = 0; i < fields.length; i++) {
  73477. for (var field in attrs) {
  73478. if (field !== fields[i]) {
  73479. continue;
  73480. }
  73481. // 数字转换判断
  73482. try {
  73483. if (!isNaN(decimalNumber) && decimalNumber >= 0) {
  73484. fieldsValue.push(parseFloat(attrs[field].toString()).toFixed(decimalNumber));
  73485. } else {
  73486. fieldsValue.push(parseFloat(attrs[field].toString()));
  73487. }
  73488. } catch (e) {
  73489. throw new Error("not a number");
  73490. }
  73491. }
  73492. }
  73493. if (fieldsValue.length === fields.length) {
  73494. return fieldsValue;
  73495. } else {
  73496. return false;
  73497. }
  73498. };
  73499. ;// CONCATENATED MODULE: ./src/common/overlay/Bar.js
  73500. function Bar_typeof(obj) { "@babel/helpers - typeof"; return Bar_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Bar_typeof(obj); }
  73501. function Bar_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73502. function Bar_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  73503. function Bar_createClass(Constructor, protoProps, staticProps) { if (protoProps) Bar_defineProperties(Constructor.prototype, protoProps); if (staticProps) Bar_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  73504. function Bar_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Bar_get = Reflect.get.bind(); } else { Bar_get = function _get(target, property, receiver) { var base = Bar_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Bar_get.apply(this, arguments); }
  73505. function Bar_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Bar_getPrototypeOf(object); if (object === null) break; } return object; }
  73506. function Bar_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Bar_setPrototypeOf(subClass, superClass); }
  73507. function Bar_setPrototypeOf(o, p) { Bar_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Bar_setPrototypeOf(o, p); }
  73508. function Bar_createSuper(Derived) { var hasNativeReflectConstruct = Bar_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Bar_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Bar_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Bar_possibleConstructorReturn(this, result); }; }
  73509. function Bar_possibleConstructorReturn(self, call) { if (call && (Bar_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Bar_assertThisInitialized(self); }
  73510. function Bar_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73511. function Bar_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  73512. function Bar_getPrototypeOf(o) { Bar_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Bar_getPrototypeOf(o); }
  73513. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  73514. * This program are made available under the terms of the Apache License, Version 2.0
  73515. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73516. /**
  73517. * @class FeatureThemeBar
  73518. * @aliasclass Feature.Theme.Bar
  73519. * @deprecatedclass SuperMap.Feature.Theme.Bar
  73520. * @classdesc 柱状图 。
  73521. * @category Visualization Theme
  73522. * @example
  73523. * // barStyleByCodomain参数用法如下:
  73524. * // barStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  73525. * // start: 值域值下限(包含);
  73526. * // end: 值域值上限(不包含);
  73527. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <ShapeParametersPolygon.style> 。
  73528. * // barStyleByCodomain 数组形如:
  73529. * [
  73530. * {
  73531. * start:0,
  73532. * end:250,
  73533. * style:{
  73534. * fillColor:"#00CD00"
  73535. * }
  73536. * },
  73537. * {
  73538. * start:250,
  73539. * end:500,
  73540. * style:{
  73541. * fillColor:"#00EE00"
  73542. * }
  73543. * },
  73544. * {
  73545. * start:500,
  73546. * end:750,
  73547. * style:{
  73548. * fillColor:"#00FF7F"
  73549. * }
  73550. * },
  73551. * {
  73552. * start:750,
  73553. * end:1500,
  73554. * style:{
  73555. * fillColor:"#00FF00"
  73556. * }
  73557. * }
  73558. * ]
  73559. * @extends FeatureThemeGraph
  73560. * @param {FeatureVector} data - 用户数据。
  73561. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  73562. * @param {Array.<string>} fields - data 属性中的参与此图表生成的属性字段名称。
  73563. * @param {FeatureThemeBar.setting} setting - 图表配置对象。
  73564. * @param {LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  73565. * @usage
  73566. * @private
  73567. */
  73568. var Bar = /*#__PURE__*/function (_Graph) {
  73569. Bar_inherits(Bar, _Graph);
  73570. var _super = Bar_createSuper(Bar);
  73571. function Bar(data, layer, fields, setting, lonlat) {
  73572. var _this;
  73573. Bar_classCallCheck(this, Bar);
  73574. _this = _super.call(this, data, layer, fields, setting, lonlat);
  73575. _this.CLASS_NAME = "SuperMap.Feature.Theme.Bar";
  73576. return _this;
  73577. }
  73578. /**
  73579. * @function FeatureThemeBar.prototype.destroy
  73580. * @override
  73581. */
  73582. Bar_createClass(Bar, [{
  73583. key: "destroy",
  73584. value: function destroy() {
  73585. Bar_get(Bar_getPrototypeOf(Bar.prototype), "destroy", this).call(this);
  73586. }
  73587. /**
  73588. * @function FeatureThemeBar.prototype.assembleShapes
  73589. * @description 图表图形装配函数。
  73590. */
  73591. }, {
  73592. key: "assembleShapes",
  73593. value: function assembleShapes() {
  73594. //默认渐变颜色数组
  73595. var deafaultColors = [["#00FF00", "#00CD00"], ["#00CCFF", "#5E87A2"], ["#00FF66", "#669985"], ["#CCFF00", "#94A25E"], ["#FF9900", "#A2945E"]];
  73596. //默认阴影
  73597. var deafaultShawdow = {
  73598. showShadow: true,
  73599. shadowBlur: 8,
  73600. shadowColor: "rgba(100,100,100,0.8)",
  73601. shadowOffsetX: 2,
  73602. shadowOffsetY: 2
  73603. };
  73604. // 图表配置对象
  73605. var sets = this.setting;
  73606. if (!sets.barLinearGradient) {
  73607. sets.barLinearGradient = deafaultColors;
  73608. }
  73609. // 默认数据视图框
  73610. if (!sets.dataViewBoxParameter) {
  73611. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  73612. sets.dataViewBoxParameter = [45, 15, 15, 15];
  73613. } else {
  73614. sets.dataViewBoxParameter = [5, 5, 5, 5];
  73615. }
  73616. }
  73617. // 重要步骤:初始化参数
  73618. if (!this.initBaseParameter()) {
  73619. return;
  73620. }
  73621. // 值域
  73622. var codomain = this.DVBCodomain;
  73623. // 重要步骤:定义图表 BaFeatureThemeBarr 数据视图框中单位值的含义
  73624. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight;
  73625. // 数据视图域
  73626. var dvb = this.dataViewBox;
  73627. // 用户数据值
  73628. var fv = this.dataValues;
  73629. if (fv.length < 1) {
  73630. return;
  73631. } // 没有数据
  73632. // 数据溢出值域范围处理
  73633. for (var _i2 = 0, fvLen = fv.length; _i2 < fvLen; _i2++) {
  73634. if (fv[_i2] < codomain[0] || fv[_i2] > codomain[1]) {
  73635. return;
  73636. }
  73637. }
  73638. // 获取 x 轴上的图形信息
  73639. var xShapeInfo = this.calculateXShapeInfo();
  73640. if (!xShapeInfo) {
  73641. return;
  73642. }
  73643. // 每个柱条 x 位置
  73644. var xsLoc = xShapeInfo.xPositions;
  73645. // 柱条宽度
  73646. var xsWdith = xShapeInfo.width;
  73647. // 背景框,默认启用
  73648. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  73649. // 将背景框图形添加到模型的 shapes 数组,注意添加顺序,后添加的图形在先添加的图形之上。
  73650. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  73651. }
  73652. // 坐标轴, 默认启用
  73653. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  73654. // 添加坐标轴图形数组
  73655. this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
  73656. }
  73657. for (var i = 0; i < fv.length; i++) {
  73658. // 计算柱条 top 边的 y 轴坐标值
  73659. var yPx = dvb[1] - (fv[i] - codomain[0]) / this.DVBUnitValue;
  73660. // 柱条节点数组
  73661. var poiLists = [[xsLoc[i] - xsWdith / 2, dvb[1] - 1], [xsLoc[i] + xsWdith / 2, dvb[1] - 1], [xsLoc[i] + xsWdith / 2, yPx], [xsLoc[i] - xsWdith / 2, yPx]];
  73662. // 柱条参数对象(一个面参数对象)
  73663. var barParams = new feature_Polygon_Polygon(poiLists);
  73664. // 柱条 阴影 style
  73665. if (typeof sets.showShadow === "undefined" || sets.showShadow) {
  73666. if (sets.barShadowStyle) {
  73667. var sss = sets.barShadowStyle;
  73668. if (sss.shadowBlur) {
  73669. deafaultShawdow.shadowBlur = sss.shadowBlur;
  73670. }
  73671. if (sss.shadowColor) {
  73672. deafaultShawdow.shadowColor = sss.shadowColor;
  73673. }
  73674. if (sss.shadowOffsetX) {
  73675. deafaultShawdow.shadowOffsetX = sss.shadowOffsetX;
  73676. }
  73677. if (sss.shadowOffsetY) {
  73678. deafaultShawdow.shadowOffsetY = sss.shadowOffsetY;
  73679. }
  73680. }
  73681. barParams.style = {};
  73682. Util_Util.copyAttributesWithClip(barParams.style, deafaultShawdow);
  73683. }
  73684. // 图形携带的数据信息
  73685. barParams.refDataID = this.data.id;
  73686. barParams.dataInfo = {
  73687. field: this.fields[i],
  73688. value: fv[i]
  73689. };
  73690. // 柱条 hover click
  73691. if (typeof sets.barHoverAble !== "undefined") {
  73692. barParams.hoverable = sets.barHoverAble;
  73693. }
  73694. if (typeof sets.barClickAble !== "undefined") {
  73695. barParams.clickable = sets.barClickAble;
  73696. }
  73697. // 创建柱条并添加到图表图形数组中
  73698. this.shapes.push(this.shapeFactory.createShape(barParams));
  73699. }
  73700. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  73701. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  73702. this.shapesConvertToRelativeCoordinate();
  73703. }
  73704. /**
  73705. * @function FeatureThemeBar.prototype.calculateXShapeInfo
  73706. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  73707. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  73708. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  73709. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  73710. * 本函数中图形配置对象 setting 可设属性:
  73711. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  73712. * 长度为 3 的数组,第一元素表示第一个图形左端与数据视图框左端的空白间距,第二个元素表示图形间空白间距,
  73713. * 第三个元素表示最后一个图形右端与数据视图框右端端的空白间距 。
  73714. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:
  73715. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  73716. * width - {number} 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  73717. *
  73718. */
  73719. }, {
  73720. key: "calculateXShapeInfo",
  73721. value: function calculateXShapeInfo() {
  73722. var dvb = this.dataViewBox; // 数据视图框
  73723. var sets = this.setting; // 图表配置对象
  73724. var fvc = this.dataValues.length; // 数组值个数
  73725. if (fvc < 1) {
  73726. return null;
  73727. }
  73728. var xBlank; // x 轴空白间隔参数
  73729. var xShapePositions = []; // x 轴上图形的位置
  73730. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  73731. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  73732. // x 轴空白间隔参数处理
  73733. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 3) {
  73734. xBlank = sets.xShapeBlank;
  73735. var xsLen = dvbWidth - (xBlank[0] + xBlank[2] + (fvc - 1) * xBlank[1]);
  73736. if (xsLen <= fvc) {
  73737. return null;
  73738. }
  73739. xShapeWidth = xsLen / fvc;
  73740. } else {
  73741. // 默认使用等距离空白间隔,空白间隔为图形宽度
  73742. xShapeWidth = dvbWidth / (2 * fvc + 1);
  73743. xBlank = [xShapeWidth, xShapeWidth, xShapeWidth];
  73744. }
  73745. // 图形 x 轴上的位置计算
  73746. var xOffset = 0;
  73747. for (var i = 0; i < fvc; i++) {
  73748. if (i == 0) {
  73749. xOffset = xBlank[0] + xShapeWidth / 2;
  73750. } else {
  73751. xOffset += xShapeWidth + xBlank[1];
  73752. }
  73753. xShapePositions.push(dvb[0] + xOffset);
  73754. }
  73755. return {
  73756. "xPositions": xShapePositions,
  73757. "width": xShapeWidth
  73758. };
  73759. }
  73760. /**
  73761. * @function FeatureThemeBar.prototype.resetLinearGradient
  73762. * @description 图表的相对坐标存在的时候,重新计算渐变的颜色(目前用于二维柱状图 所以子类实现此方法)。
  73763. */
  73764. }, {
  73765. key: "resetLinearGradient",
  73766. value: function resetLinearGradient() {
  73767. if (this.RelativeCoordinate) {
  73768. var shpelength = this.shapes.length;
  73769. var barLinearGradient = this.setting.barLinearGradient;
  73770. var index = -1;
  73771. for (var i = 0; i < shpelength; i++) {
  73772. var shape = this.shapes[i];
  73773. if (shape.CLASS_NAME === "SuperMap.LevelRenderer.Shape.SmicPolygon") {
  73774. var style = shape.style;
  73775. //计算出当前的绝对 x y
  73776. var x1 = this.location[0] + style.pointList[0][0];
  73777. var x2 = this.location[0] + style.pointList[1][0];
  73778. //渐变颜色
  73779. index++;
  73780. //以防定义的颜色数组不够用
  73781. if (index >= barLinearGradient.length) {
  73782. index = index % barLinearGradient.length;
  73783. }
  73784. var color1 = barLinearGradient[index][0];
  73785. var color2 = barLinearGradient[index][1];
  73786. //颜色
  73787. var zcolor = new Color();
  73788. var linearGradient = zcolor.getLinearGradient(x1, 0, x2, 0, [[0, color1], [1, color2]]);
  73789. //赋值
  73790. shape.style.color = linearGradient;
  73791. }
  73792. }
  73793. }
  73794. }
  73795. }]);
  73796. return Bar;
  73797. }(Graph);
  73798. ;// CONCATENATED MODULE: ./src/common/overlay/Bar3D.js
  73799. function Bar3D_typeof(obj) { "@babel/helpers - typeof"; return Bar3D_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Bar3D_typeof(obj); }
  73800. function Bar3D_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73801. function Bar3D_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  73802. function Bar3D_createClass(Constructor, protoProps, staticProps) { if (protoProps) Bar3D_defineProperties(Constructor.prototype, protoProps); if (staticProps) Bar3D_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  73803. function Bar3D_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Bar3D_get = Reflect.get.bind(); } else { Bar3D_get = function _get(target, property, receiver) { var base = Bar3D_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Bar3D_get.apply(this, arguments); }
  73804. function Bar3D_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Bar3D_getPrototypeOf(object); if (object === null) break; } return object; }
  73805. function Bar3D_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Bar3D_setPrototypeOf(subClass, superClass); }
  73806. function Bar3D_setPrototypeOf(o, p) { Bar3D_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Bar3D_setPrototypeOf(o, p); }
  73807. function Bar3D_createSuper(Derived) { var hasNativeReflectConstruct = Bar3D_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Bar3D_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Bar3D_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Bar3D_possibleConstructorReturn(this, result); }; }
  73808. function Bar3D_possibleConstructorReturn(self, call) { if (call && (Bar3D_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Bar3D_assertThisInitialized(self); }
  73809. function Bar3D_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73810. function Bar3D_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  73811. function Bar3D_getPrototypeOf(o) { Bar3D_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Bar3D_getPrototypeOf(o); }
  73812. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  73813. * This program are made available under the terms of the Apache License, Version 2.0
  73814. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73815. /**
  73816. * @class FeatureThemeBar3D
  73817. * @aliasclass Feature.Theme.Bar3D
  73818. * @deprecatedclass SuperMap.Feature.Theme.Bar3D
  73819. * @classdesc 三维柱状图 。
  73820. * @category Visualization Theme
  73821. * @extends FeatureThemeGraph
  73822. * @param {FeatureVector} data - 用户数据。
  73823. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  73824. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  73825. * @param {FeatureThemeBar3D.setting} setting - 图表配置对象。
  73826. * @param {LonLat} [lonlat] - 专题要素地理位置,默认为 data 指代的地理要素 Bounds 中心。
  73827. *
  73828. *
  73829. * @example
  73830. * // barFaceStyleByCodomain 用法示例如下:
  73831. * // barFaceStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  73832. * // start: 值域值下限(包含);
  73833. * // end: 值域值上限(不包含);
  73834. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <ShapeParametersPolygon.style> 。
  73835. * // barFaceStyleByCodomain 数组形如:
  73836. * [
  73837. * {
  73838. * start:0,
  73839. * end:250,
  73840. * style:{
  73841. * fillColor:"#00CD00"
  73842. * }
  73843. * },
  73844. * {
  73845. * start:250,
  73846. * end:500,
  73847. * style:{
  73848. * fillColor:"#00EE00"
  73849. * }
  73850. * },
  73851. * {
  73852. * start:500,
  73853. * end:750,
  73854. * style:{
  73855. * fillColor:"#00FF7F"
  73856. * }
  73857. * },
  73858. * {
  73859. * start:750,
  73860. * end:1500,
  73861. * style:{
  73862. * fillColor:"#00FF00"
  73863. * }
  73864. * }
  73865. * ]
  73866. *
  73867. * @example
  73868. * // barSideStyleByCodomain 用法示例如下:
  73869. * // barSideStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  73870. * // start: 值域值下限(包含);
  73871. * // end: 值域值上限(不包含);
  73872. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <ShapeParametersPolygon.style> 。
  73873. * // barSideStyleByCodomain 数组形如:
  73874. * [
  73875. * {
  73876. * start:0,
  73877. * end:250,
  73878. * style:{
  73879. * fillColor:"#00CD00"
  73880. * }
  73881. * },
  73882. * {
  73883. * start:250,
  73884. * end:500,
  73885. * style:{
  73886. * fillColor:"#00EE00"
  73887. * }
  73888. * },
  73889. * {
  73890. * start:500,
  73891. * end:750,
  73892. * style:{
  73893. * fillColor:"#00FF7F"
  73894. * }
  73895. * },
  73896. * {
  73897. * start:750,
  73898. * end:1500,
  73899. * style:{
  73900. * fillColor:"#00FF00"
  73901. * }
  73902. * }
  73903. * ]
  73904. *
  73905. * @example
  73906. * // barTopStyleByCodomain 用法示例如下:
  73907. * // barTopStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  73908. * // start: 值域值下限(包含);
  73909. * // end: 值域值上限(不包含);
  73910. * // style: 数据可视化图形的 style,这个样式对象的可设属性:<ShapeParametersPolygon.style> 。
  73911. * // barTopStyleByCodomain 数组形如:
  73912. * [
  73913. * {
  73914. * start:0,
  73915. * end:250,
  73916. * style:{
  73917. * fillColor:"#00CD00"
  73918. * }
  73919. * },
  73920. * {
  73921. * start:250,
  73922. * end:500,
  73923. * style:{
  73924. * fillColor:"#00EE00"
  73925. * }
  73926. * },
  73927. * {
  73928. * start:500,
  73929. * end:750,
  73930. * style:{
  73931. * fillColor:"#00FF7F"
  73932. * }
  73933. * },
  73934. * {
  73935. * start:750,
  73936. * end:1500,
  73937. * style:{
  73938. * fillColor:"#00FF00"
  73939. * }
  73940. * }
  73941. * ]
  73942. * @usage
  73943. * @private
  73944. */
  73945. var Bar3D = /*#__PURE__*/function (_Graph) {
  73946. Bar3D_inherits(Bar3D, _Graph);
  73947. var _super = Bar3D_createSuper(Bar3D);
  73948. function Bar3D(data, layer, fields, setting, lonlat) {
  73949. var _this;
  73950. Bar3D_classCallCheck(this, Bar3D);
  73951. _this = _super.call(this, data, layer, fields, setting, lonlat);
  73952. _this.CLASS_NAME = "SuperMap.Feature.Theme.Bar3D";
  73953. return _this;
  73954. }
  73955. /**
  73956. * @function FeatureThemeBar3D.prototype.destroy
  73957. * @override
  73958. */
  73959. Bar3D_createClass(Bar3D, [{
  73960. key: "destroy",
  73961. value: function destroy() {
  73962. Bar3D_get(Bar3D_getPrototypeOf(Bar3D.prototype), "destroy", this).call(this);
  73963. }
  73964. /**
  73965. * @function FeatureThemeBar3D.prototype.assembleShapes
  73966. * @description 图形装配实现(扩展接口)。
  73967. */
  73968. }, {
  73969. key: "assembleShapes",
  73970. value: function assembleShapes() {
  73971. // 图表配置对象
  73972. var sets = this.setting;
  73973. // 默认数据视图框
  73974. if (!sets.dataViewBoxParameter) {
  73975. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  73976. sets.dataViewBoxParameter = [45, 25, 20, 20];
  73977. } else {
  73978. sets.dataViewBoxParameter = [5, 5, 5, 5];
  73979. }
  73980. }
  73981. // 3d 柱图的坐标轴默认使用坐标轴箭头
  73982. sets.axisUseArrow = typeof sets.axisUseArrow !== "undefined" ? sets.axisUseArrow : true;
  73983. sets.axisXLabelsOffset = typeof sets.axisXLabelsOffset !== "undefined" ? sets.axisXLabelsOffset : [-10, 10];
  73984. // 重要步骤:初始化参数
  73985. if (!this.initBaseParameter()) {
  73986. return;
  73987. }
  73988. // 值域
  73989. var codomain = this.DVBCodomain;
  73990. // 重要步骤:定义图表 FeatureThemeBar 数据视图框中单位值的含义
  73991. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight;
  73992. // 数据视图域
  73993. var dvb = this.dataViewBox;
  73994. // 用户数据值
  73995. var fv = this.dataValues;
  73996. if (fv.length < 1) {
  73997. return;
  73998. } // 没有数据
  73999. // 数据溢出值域范围处理
  74000. for (var i = 0, fvLen = fv.length; i < fvLen; i++) {
  74001. if (fv[i] < codomain[0] || fv[i] > codomain[1]) {
  74002. return;
  74003. }
  74004. }
  74005. // 获取 x 轴上的图形信息
  74006. var xShapeInfo = this.calculateXShapeInfo();
  74007. if (!xShapeInfo) {
  74008. return;
  74009. }
  74010. // 每个柱条 x 位置
  74011. var xsLoc = xShapeInfo.xPositions;
  74012. // 柱条宽度
  74013. var xsWdith = xShapeInfo.width;
  74014. // 坐标轴, 默认启用
  74015. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  74016. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  74017. }
  74018. // 坐标轴
  74019. if (!sets.axis3DParameter || isNaN(sets.axis3DParameter) || sets.axis3DParameter < 15) {
  74020. sets.axis3DParameter = 20;
  74021. }
  74022. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  74023. this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
  74024. }
  74025. // 3d 偏移量, 默认值 10;
  74026. var offset3d = sets.bar3DParameter && !isNaN(sets.bar3DParameter) ? sets.bar3DParameter : 10;
  74027. for (var _i2 = 0; _i2 < fv.length; _i2++) {
  74028. // 无 3d 偏移量时的柱面顶部 y 坐标
  74029. var yPx = dvb[1] - (fv[_i2] - codomain[0]) / this.DVBUnitValue;
  74030. // 无 3d 偏移量时的柱面的左、右端 x 坐标
  74031. var iPoiL = xsLoc[_i2] - xsWdith / 2;
  74032. var iPoiR = xsLoc[_i2] + xsWdith / 2;
  74033. // 3d 柱顶面节点
  74034. var bar3DTopPois = [[iPoiL, yPx], [iPoiR, yPx], [iPoiR - offset3d, yPx + offset3d], [iPoiL - offset3d, yPx + offset3d]];
  74035. // 3d 柱侧面节点
  74036. var bar3DSidePois = [[iPoiR, yPx], [iPoiR - offset3d, yPx + offset3d], [iPoiR - offset3d, dvb[1] + offset3d], [iPoiR, dvb[1]]];
  74037. // 3d 柱正面节点
  74038. var bar3DFacePois = [[iPoiL - offset3d, dvb[1] + offset3d], [iPoiR - offset3d, dvb[1] + offset3d], [iPoiR - offset3d, yPx + offset3d], [iPoiL - offset3d, yPx + offset3d]];
  74039. if (offset3d <= 0) {
  74040. // offset3d <= 0 时正面不偏移
  74041. bar3DFacePois = [[iPoiL, dvb[1]], [iPoiR, dvb[1]], [iPoiR, yPx], [iPoiL, yPx]];
  74042. }
  74043. // 新建 3d 柱面顶面、侧面、正面图形参数对象
  74044. var polyTopSP = new feature_Polygon_Polygon(bar3DTopPois);
  74045. var polySideSP = new feature_Polygon_Polygon(bar3DSidePois);
  74046. var polyFaceSP = new feature_Polygon_Polygon(bar3DFacePois);
  74047. // 侧面、正面图形 style 默认值
  74048. sets.barSideStyle = sets.barSideStyle ? sets.barSideStyle : sets.barFaceStyle;
  74049. sets.barSideStyleByFields = sets.barSideStyleByFields ? sets.barSideStyleByFields : sets.barFaceStyleByFields;
  74050. sets.barSideStyleByCodomain = sets.barSideStyleByCodomain ? sets.barSideStyleByCodomain : sets.barFaceStyleByCodomain;
  74051. sets.barTopStyle = sets.barTopStyle ? sets.barTopStyle : sets.barFaceStyle;
  74052. sets.barTopStyleByFields = sets.barTopStyleByFields ? sets.barTopStyleByFields : sets.barFaceStyleByFields;
  74053. sets.barTopStyleByCodomain = sets.barTopStyleByCodomain ? sets.barTopStyleByCodomain : sets.barFaceStyleByCodomain;
  74054. // 顶面、侧面、正面图形 style
  74055. polyFaceSP.style = ShapeFactory.ShapeStyleTool({
  74056. stroke: true,
  74057. strokeColor: "#ffffff",
  74058. fillColor: "#ee9900"
  74059. }, sets.barFaceStyle, sets.barFaceStyleByFields, sets.barFaceStyleByCodomain, _i2, fv[_i2]);
  74060. polySideSP.style = ShapeFactory.ShapeStyleTool({
  74061. stroke: true,
  74062. strokeColor: "#ffffff",
  74063. fillColor: "#ee9900"
  74064. }, sets.barSideStyle, sets.barSideStyleByFields, sets.barSideStyleByCodomain, _i2, fv[_i2]);
  74065. polyTopSP.style = ShapeFactory.ShapeStyleTool({
  74066. stroke: true,
  74067. strokeColor: "#ffffff",
  74068. fillColor: "#ee9900"
  74069. }, sets.barTopStyle, sets.barTopStyleByFields, sets.barTopStyleByCodomain, _i2, fv[_i2]);
  74070. // 3d 柱条高亮样式
  74071. sets.barSideHoverStyle = sets.barSideHoverStyle ? sets.barSideHoverStyle : sets.barFaceHoverStyle;
  74072. sets.barTopHoverStyle = sets.barTopHoverStyle ? sets.barTopHoverStyle : sets.barFaceHoverStyle;
  74073. polyFaceSP.highlightStyle = ShapeFactory.ShapeStyleTool({
  74074. stroke: true
  74075. }, sets.barFaceHoverStyle);
  74076. polySideSP.highlightStyle = ShapeFactory.ShapeStyleTool({
  74077. stroke: true
  74078. }, sets.barSideHoverStyle);
  74079. polyTopSP.highlightStyle = ShapeFactory.ShapeStyleTool({
  74080. stroke: true
  74081. }, sets.barTopHoverStyle);
  74082. // 图形携带的数据 id 信息 & 高亮模式
  74083. polyTopSP.refDataID = polySideSP.refDataID = polyFaceSP.refDataID = this.data.id;
  74084. // hover 模式(组合)
  74085. polyTopSP.isHoverByRefDataID = polySideSP.isHoverByRefDataID = polyFaceSP.isHoverByRefDataID = true;
  74086. // 高亮组(当鼠标 hover 到组内任何一个图形,整个组的图形都会高亮。refDataHoverGroup 在 isHoverByRefDataID 为 true 时有效)
  74087. polyTopSP.refDataHoverGroup = polySideSP.refDataHoverGroup = polyFaceSP.refDataHoverGroup = Util_Util.createUniqueID("lr_shg");
  74088. // 图形携带的数据信息
  74089. polyTopSP.dataInfo = polySideSP.dataInfo = polyFaceSP.dataInfo = {
  74090. field: this.fields[_i2],
  74091. value: fv[_i2]
  74092. };
  74093. // 3d 柱条顶面、侧面、正面图形 hover click 设置
  74094. if (typeof sets.barHoverAble !== "undefined") {
  74095. polyTopSP.hoverable = polySideSP.hoverable = polyFaceSP.hoverable = sets.barHoverAble;
  74096. }
  74097. if (typeof sets.barClickAble !== "undefined") {
  74098. polyTopSP.clickable = polySideSP.clickable = polyFaceSP.clickable = sets.barClickAble;
  74099. }
  74100. // 创建3d 柱条的顶面、侧面、正面图形并添加到图表的图形列表数组
  74101. this.shapes.push(this.shapeFactory.createShape(polySideSP));
  74102. this.shapes.push(this.shapeFactory.createShape(polyTopSP));
  74103. this.shapes.push(this.shapeFactory.createShape(polyFaceSP));
  74104. }
  74105. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  74106. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  74107. this.shapesConvertToRelativeCoordinate();
  74108. }
  74109. /**
  74110. * @function FeatureThemeBar3D.prototype.calculateXShapeInfo
  74111. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  74112. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  74113. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  74114. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  74115. * 本函数中图形配置对象 setting 可设属性:
  74116. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  74117. * 长度为 3 的数组,第一元素表示第一个图形左端与数据视图框左端的空白间距,第二个元素表示图形间空白间距,
  74118. * 第三个元素表示最后一个图形右端与数据视图框右端端的空白间距 。
  74119. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:
  74120. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  74121. * width - {number} 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  74122. */
  74123. }, {
  74124. key: "calculateXShapeInfo",
  74125. value: function calculateXShapeInfo() {
  74126. var dvb = this.dataViewBox; // 数据视图框
  74127. var sets = this.setting; // 图表配置对象
  74128. var fvc = this.dataValues.length; // 数组值个数
  74129. if (fvc < 1) {
  74130. return null;
  74131. }
  74132. var xBlank; // x 轴空白间隔参数
  74133. var xShapePositions = []; // x 轴上图形的位置
  74134. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  74135. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  74136. // x 轴空白间隔参数处理
  74137. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 3) {
  74138. xBlank = sets.xShapeBlank;
  74139. var xsLen = dvbWidth - (xBlank[0] + xBlank[2] + (fvc - 1) * xBlank[1]);
  74140. if (xsLen <= fvc) {
  74141. return null;
  74142. }
  74143. xShapeWidth = xsLen / fvc;
  74144. } else {
  74145. // 默认使用等距离空白间隔,空白间隔为图形宽度
  74146. xShapeWidth = dvbWidth / (2 * fvc + 1);
  74147. xBlank = [xShapeWidth, xShapeWidth, xShapeWidth];
  74148. }
  74149. // 图形 x 轴上的位置计算
  74150. var xOffset = 0;
  74151. for (var i = 0; i < fvc; i++) {
  74152. if (i == 0) {
  74153. xOffset = xBlank[0] + xShapeWidth / 2;
  74154. } else {
  74155. xOffset += xShapeWidth + xBlank[1];
  74156. }
  74157. xShapePositions.push(dvb[0] + xOffset);
  74158. }
  74159. return {
  74160. "xPositions": xShapePositions,
  74161. "width": xShapeWidth
  74162. };
  74163. }
  74164. }]);
  74165. return Bar3D;
  74166. }(Graph);
  74167. ;// CONCATENATED MODULE: ./src/common/overlay/RankSymbol.js
  74168. function RankSymbol_typeof(obj) { "@babel/helpers - typeof"; return RankSymbol_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, RankSymbol_typeof(obj); }
  74169. function RankSymbol_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  74170. function RankSymbol_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  74171. function RankSymbol_createClass(Constructor, protoProps, staticProps) { if (protoProps) RankSymbol_defineProperties(Constructor.prototype, protoProps); if (staticProps) RankSymbol_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  74172. function RankSymbol_get() { if (typeof Reflect !== "undefined" && Reflect.get) { RankSymbol_get = Reflect.get.bind(); } else { RankSymbol_get = function _get(target, property, receiver) { var base = RankSymbol_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return RankSymbol_get.apply(this, arguments); }
  74173. function RankSymbol_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = RankSymbol_getPrototypeOf(object); if (object === null) break; } return object; }
  74174. function RankSymbol_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) RankSymbol_setPrototypeOf(subClass, superClass); }
  74175. function RankSymbol_setPrototypeOf(o, p) { RankSymbol_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RankSymbol_setPrototypeOf(o, p); }
  74176. function RankSymbol_createSuper(Derived) { var hasNativeReflectConstruct = RankSymbol_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = RankSymbol_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = RankSymbol_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return RankSymbol_possibleConstructorReturn(this, result); }; }
  74177. function RankSymbol_possibleConstructorReturn(self, call) { if (call && (RankSymbol_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return RankSymbol_assertThisInitialized(self); }
  74178. function RankSymbol_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  74179. function RankSymbol_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  74180. function RankSymbol_getPrototypeOf(o) { RankSymbol_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RankSymbol_getPrototypeOf(o); }
  74181. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  74182. * This program are made available under the terms of the Apache License, Version 2.0
  74183. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  74184. /**
  74185. * @class FeatureThemeRankSymbol
  74186. * @aliasclass Feature.Theme.RankSymbol
  74187. * @deprecatedclass SuperMap.Feature.Theme.RankSymbol
  74188. * @category Visualization Theme
  74189. * @classdesc 符号专题要素基类。此类定义了符号专题要素基础模型,具体的图表模型通过继承此类,在子类中实现 assembleShapes 方法。
  74190. * 符号专题要素模型采用了可视化图形大小自适应策略,用较少的参数控制着图表诸多图形,图表配置对象 <FeatureThemeRankSymbol.setting> 的基础属性只有 5 个,
  74191. * 它们控制着图表结构、值域范围、数据小数位等基础图表形态。构成图表的图形必须在图表结构里自适应大小。
  74192. * 此类不可实例化,此类的可实例化子类必须实现 assembleShapes() 方法。
  74193. * @param {FeatureVector} data - 用户数据。
  74194. * @param {SuperMap.Layer.RankSymbol} layer - 此专题要素所在图层。
  74195. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  74196. * @param {LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  74197. * @param {Object} setting - 图表配置对象。除了以下 5 个基础属性,此对象的可设属性在不同子类中有较大差异,不同子类中对同一属性的解释也可能不同,请在此类的子类中查看 setting 对象的可设属性和属性含义。
  74198. * @param {Array.<number>} setting.codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  74199. * @param {number} [setting.XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  74200. * @param {number} [setting.YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  74201. * @param {Array.<number>} [setting.dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  74202. * @param {number} [setting.decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  74203. * @extends FeatureThemeGraph
  74204. * @usage
  74205. */
  74206. var RankSymbol = /*#__PURE__*/function (_Graph) {
  74207. RankSymbol_inherits(RankSymbol, _Graph);
  74208. var _super = RankSymbol_createSuper(RankSymbol);
  74209. function RankSymbol(data, layer, fields, setting, lonlat, options) {
  74210. var _this;
  74211. RankSymbol_classCallCheck(this, RankSymbol);
  74212. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  74213. /**
  74214. * @member {Object} FeatureThemeRankSymbol.prototype.setting
  74215. * @description 符号配置对象,该对象控制着图表的可视化显示。
  74216. */
  74217. _this.setting = null;
  74218. // 配置项检测与赋值
  74219. if (setting && setting.codomain) {
  74220. _this.setting = setting;
  74221. _this.DVBCodomain = _this.setting.codomain;
  74222. }
  74223. _this.CLASS_NAME = "SuperMap.Feature.Theme.RankSymbol";
  74224. return _this;
  74225. }
  74226. /**
  74227. * @function FeatureThemeRankSymbol.prototype.destroy
  74228. * @description 销毁专题要素。
  74229. */
  74230. RankSymbol_createClass(RankSymbol, [{
  74231. key: "destroy",
  74232. value: function destroy() {
  74233. this.setting = null;
  74234. RankSymbol_get(RankSymbol_getPrototypeOf(RankSymbol.prototype), "destroy", this).call(this);
  74235. }
  74236. /**
  74237. * @function FeatureThemeRankSymbol.prototype.initBaseParameter
  74238. * @description 初始化专题要素(图形)基础参数。
  74239. * 在调用此方法前,此类的图表模型相关属性都是不可用的 ,此方法在 assembleShapes 函数中调用。
  74240. * 调用此函数关系到 setting 对象的以下属性。
  74241. * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  74242. * @param {number} [XOffset] - 专题要素(图形)在 X 方向上的偏移值,单位像素。
  74243. * @param {number} [YOffset] - 专题要素(图形)在 Y 方向上的偏移值,单位像素。
  74244. * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图形框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  74245. * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  74246. * @returns {boolean} 初始化参数是否成功。
  74247. */
  74248. }, {
  74249. key: "initBaseParameter",
  74250. value: function initBaseParameter() {
  74251. // 参数初始化是否成功
  74252. var isSuccess = true;
  74253. // setting 属性是否已成功赋值
  74254. if (!this.setting) {
  74255. return false;
  74256. }
  74257. var sets = this.setting;
  74258. // 图表偏移
  74259. if (sets.XOffset) {
  74260. this.XOffset = sets.XOffset;
  74261. }
  74262. if (sets.YOffset) {
  74263. this.YOffset = sets.YOffset;
  74264. }
  74265. this.XOffset = sets.XOffset ? sets.XOffset : 0;
  74266. this.YOffset = sets.YOffset ? sets.YOffset : 0;
  74267. // 其他默认值
  74268. this.origonPoint = [];
  74269. this.chartBox = [];
  74270. this.dataViewBox = [];
  74271. this.DVBParameter = sets.dataViewBoxParameter ? sets.dataViewBoxParameter : [0, 0, 0, 0];
  74272. this.DVBOrigonPoint = [];
  74273. this.DVBCenterPoint = [];
  74274. this.origonPointOffset = [];
  74275. // 图表位置
  74276. this.resetLocation();
  74277. // 专题要素宽度 w
  74278. var w = this.width;
  74279. // 专题要素高度 h
  74280. var h = this.height;
  74281. // 专题要素像素位置 loc
  74282. var loc = this.location;
  74283. // 专题要素像素位置 loc
  74284. this.origonPoint = [loc[0] - w / 2, loc[1] - h / 2];
  74285. // 专题要素原点(左上角)
  74286. var op = this.origonPoint;
  74287. // 图表框([left, bottom, right, top])
  74288. this.chartBox = [op[0], op[1] + h, op[0] + w, op[1]];
  74289. // 图表框
  74290. var cb = this.chartBox;
  74291. // 数据视图框参数,它是图表框各方向对应的内偏距
  74292. var dbbP = this.DVBParameter;
  74293. // 数据视图框 ([left, bottom, right, top])
  74294. this.dataViewBox = [cb[0] + dbbP[0], cb[1] - dbbP[1], cb[2] - dbbP[2], cb[3] + dbbP[3]];
  74295. // 数据视图框
  74296. var dvb = this.dataViewBox;
  74297. //检查数据视图框是否合法
  74298. if (dvb[0] >= dvb[2] || dvb[1] <= dvb[3]) {
  74299. return false;
  74300. }
  74301. // 数据视图框原点
  74302. this.DVBOrigonPoint = [dvb[0], dvb[3]];
  74303. // 数据视图框宽度
  74304. this.DVBWidth = Math.abs(dvb[2] - dvb[0]);
  74305. // 数据视图框高度
  74306. this.DVBHeight = Math.abs(dvb[1] - dvb[3]);
  74307. // 数据视图框中心点
  74308. this.DVBCenterPoint = [this.DVBOrigonPoint[0] + this.DVBWidth / 2, this.DVBOrigonPoint[1] + this.DVBHeight / 2];
  74309. // 数据视图框原点与图表框的原点偏移量
  74310. this.origonPointOffset = [this.DVBOrigonPoint[0] - op[0], this.DVBOrigonPoint[1] - op[1]];
  74311. return isSuccess;
  74312. }
  74313. }]);
  74314. return RankSymbol;
  74315. }(Graph);
  74316. ;// CONCATENATED MODULE: ./src/common/overlay/Circle.js
  74317. function overlay_Circle_typeof(obj) { "@babel/helpers - typeof"; return overlay_Circle_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, overlay_Circle_typeof(obj); }
  74318. function overlay_Circle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  74319. function overlay_Circle_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  74320. function overlay_Circle_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Circle_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Circle_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  74321. function overlay_Circle_get() { if (typeof Reflect !== "undefined" && Reflect.get) { overlay_Circle_get = Reflect.get.bind(); } else { overlay_Circle_get = function _get(target, property, receiver) { var base = overlay_Circle_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return overlay_Circle_get.apply(this, arguments); }
  74322. function overlay_Circle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Circle_getPrototypeOf(object); if (object === null) break; } return object; }
  74323. function overlay_Circle_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) overlay_Circle_setPrototypeOf(subClass, superClass); }
  74324. function overlay_Circle_setPrototypeOf(o, p) { overlay_Circle_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return overlay_Circle_setPrototypeOf(o, p); }
  74325. function overlay_Circle_createSuper(Derived) { var hasNativeReflectConstruct = overlay_Circle_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = overlay_Circle_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = overlay_Circle_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return overlay_Circle_possibleConstructorReturn(this, result); }; }
  74326. function overlay_Circle_possibleConstructorReturn(self, call) { if (call && (overlay_Circle_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return overlay_Circle_assertThisInitialized(self); }
  74327. function overlay_Circle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  74328. function overlay_Circle_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  74329. function overlay_Circle_getPrototypeOf(o) { overlay_Circle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return overlay_Circle_getPrototypeOf(o); }
  74330. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  74331. * This program are made available under the terms of the Apache License, Version 2.0
  74332. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  74333. /**
  74334. * @class FeatureThemeCircle
  74335. * @aliasclass Feature.Theme.Circle
  74336. * @deprecatedclass SuperMap.Feature.Theme.Circle
  74337. * @classdesc 圆类。
  74338. * @category Visualization Theme
  74339. * @extends FeatureThemeRankSymbol
  74340. * @param {FeatureVector} data - 用户数据。
  74341. * @param {SuperMap.Layer.RankSymbol} layer - 此专题要素所在图层。
  74342. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  74343. * @param {FeatureThemeCircle.setting} setting - 图表配置对象。
  74344. * @param {LonLat} [lonlat] - 专题要素地理位置,默认为 data 指代的地理要素 Bounds 中心。
  74345. * @usage
  74346. * @private
  74347. */
  74348. var Circle = /*#__PURE__*/function (_RankSymbol) {
  74349. overlay_Circle_inherits(Circle, _RankSymbol);
  74350. var _super = overlay_Circle_createSuper(Circle);
  74351. function Circle(data, layer, fields, setting, lonlat) {
  74352. var _this;
  74353. overlay_Circle_classCallCheck(this, Circle);
  74354. _this = _super.call(this, data, layer, fields, setting, lonlat);
  74355. _this.CLASS_NAME = "SuperMap.Feature.Theme.Circle";
  74356. return _this;
  74357. }
  74358. /**
  74359. * @function FeatureThemeCircle.prototype.destroy
  74360. * @override
  74361. */
  74362. overlay_Circle_createClass(Circle, [{
  74363. key: "destroy",
  74364. value: function destroy() {
  74365. overlay_Circle_get(overlay_Circle_getPrototypeOf(Circle.prototype), "destroy", this).call(this);
  74366. }
  74367. /**
  74368. * @function FeatureThemeCircle.prototype.assembleShapes
  74369. * @description 装配图形(扩展接口)。
  74370. */
  74371. }, {
  74372. key: "assembleShapes",
  74373. value: function assembleShapes() {
  74374. //默认填充颜色
  74375. var defaultFillColor = "#ff9277";
  74376. // setting 属性是否已成功赋值
  74377. if (!this.setting) {
  74378. return false;
  74379. }
  74380. var sets = this.setting;
  74381. // 检测 setting 的必设参数
  74382. if (!sets.codomain) {
  74383. return false;
  74384. }
  74385. // 数据
  74386. var decimalNumber = typeof sets.decimalNumber !== "undefined" && !isNaN(sets.decimalNumber) ? sets.decimalNumber : -1;
  74387. var dataEffective = Theme_Theme.getDataValues(this.data, this.fields, decimalNumber);
  74388. this.dataValues = dataEffective ? dataEffective : [];
  74389. // 数据值数组
  74390. var fv = this.dataValues;
  74391. //if(fv.length != 1) return; // 没有数据 或者数据不唯一
  74392. //if(fv[0] < 0) return; //数据为负值
  74393. //用户应该定义最大 最小半径 默认最大半径MaxR:100 最小半径MinR:0;
  74394. if (!sets.maxR) {
  74395. sets.maxR = 100;
  74396. }
  74397. if (!sets.minR) {
  74398. sets.minR = 0;
  74399. }
  74400. // 值域范围
  74401. var codomain = this.DVBCodomain;
  74402. // 重要步骤:定义Circle数据视图框中单位值的含义,单位值:1所代表的长度
  74403. // 用户定义了值域范围
  74404. if (codomain && codomain[1] - codomain[0] > 0) {
  74405. this.DVBUnitValue = sets.maxR / (codomain[1] - codomain[0]);
  74406. } else {
  74407. //this.DVBUnitValue = sets.maxR / maxValue;
  74408. this.DVBUnitValue = sets.maxR;
  74409. }
  74410. var uv = this.DVBUnitValue;
  74411. //圆半径
  74412. var r = fv[0] * uv + sets.minR;
  74413. this.width = 2 * r;
  74414. this.height = 2 * r;
  74415. // 重要步骤:初始化参数
  74416. if (!this.initBaseParameter()) {
  74417. return;
  74418. }
  74419. //假如用户设置了值域范围 没有在值域范围直接返回
  74420. if (codomain) {
  74421. if (fv[0] < codomain[0] || fv[0] > codomain[1]) {
  74422. return;
  74423. }
  74424. }
  74425. var dvbCenter = this.DVBCenterPoint; // 数据视图框中心作为圆心
  74426. //圆形对象参数
  74427. var circleSP = new Circle_Circle(dvbCenter[0], dvbCenter[1], r);
  74428. //circleSP.sytle 初始化
  74429. circleSP.style = ShapeFactory.ShapeStyleTool(null, sets.circleStyle, null, null, 0);
  74430. //图形的填充颜色
  74431. if (typeof sets.fillColor !== "undefined") {
  74432. //用户自定义
  74433. circleSP.style.fillColor = sets.fillColor;
  74434. } else {
  74435. //当前默认
  74436. circleSP.style.fillColor = defaultFillColor;
  74437. }
  74438. //圆形 Hover样式
  74439. circleSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.circleHoverStyle);
  74440. //圆形 Hover 与 click 设置
  74441. if (typeof sets.circleHoverAble !== "undefined") {
  74442. circleSP.hoverable = sets.circleHoverAble;
  74443. }
  74444. if (typeof sets.circleClickAble !== "undefined") {
  74445. circleSP.clickable = sets.circleClickAble;
  74446. }
  74447. //图形携带的数据信息
  74448. circleSP.refDataID = this.data.id;
  74449. circleSP.dataInfo = {
  74450. field: this.fields[0],
  74451. r: r,
  74452. value: fv[0]
  74453. };
  74454. // 创建扇形并把此扇形添加到图表图形数组
  74455. this.shapes.push(this.shapeFactory.createShape(circleSP));
  74456. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  74457. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  74458. this.shapesConvertToRelativeCoordinate();
  74459. }
  74460. }]);
  74461. return Circle;
  74462. }(RankSymbol);
  74463. ;// CONCATENATED MODULE: ./src/common/overlay/Line.js
  74464. function overlay_Line_typeof(obj) { "@babel/helpers - typeof"; return overlay_Line_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, overlay_Line_typeof(obj); }
  74465. function overlay_Line_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  74466. function overlay_Line_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  74467. function overlay_Line_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Line_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Line_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  74468. function overlay_Line_get() { if (typeof Reflect !== "undefined" && Reflect.get) { overlay_Line_get = Reflect.get.bind(); } else { overlay_Line_get = function _get(target, property, receiver) { var base = overlay_Line_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return overlay_Line_get.apply(this, arguments); }
  74469. function overlay_Line_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Line_getPrototypeOf(object); if (object === null) break; } return object; }
  74470. function overlay_Line_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) overlay_Line_setPrototypeOf(subClass, superClass); }
  74471. function overlay_Line_setPrototypeOf(o, p) { overlay_Line_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return overlay_Line_setPrototypeOf(o, p); }
  74472. function overlay_Line_createSuper(Derived) { var hasNativeReflectConstruct = overlay_Line_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = overlay_Line_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = overlay_Line_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return overlay_Line_possibleConstructorReturn(this, result); }; }
  74473. function overlay_Line_possibleConstructorReturn(self, call) { if (call && (overlay_Line_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return overlay_Line_assertThisInitialized(self); }
  74474. function overlay_Line_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  74475. function overlay_Line_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  74476. function overlay_Line_getPrototypeOf(o) { overlay_Line_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return overlay_Line_getPrototypeOf(o); }
  74477. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  74478. * This program are made available under the terms of the Apache License, Version 2.0
  74479. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  74480. /**
  74481. * @class FeatureThemeLine
  74482. * @aliasclass Feature.Theme.Line
  74483. * @deprecatedclass SuperMap.Feature.Theme.Line
  74484. * @classdesc 折线图。
  74485. * @category Visualization Theme
  74486. * @example
  74487. * // pointStyleByCodomain 参数用法示例
  74488. * // pointStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  74489. * // start: 值域值下限(包含);
  74490. * // end: 值域值上限(不包含);
  74491. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <Point.style> 。
  74492. * // pointStyleByCodomain 数组形如:
  74493. * [
  74494. * {
  74495. * start:0,
  74496. * end:250,
  74497. * style:{
  74498. * fillColor:"#00CD00"
  74499. * }
  74500. * },
  74501. * {
  74502. * start:250,
  74503. * end:500,
  74504. * style:{
  74505. * fillColor:"#00EE00"
  74506. * }
  74507. * },
  74508. * {
  74509. * start:500,
  74510. * end:750,
  74511. * style:{
  74512. * fillColor:"#00FF7F"
  74513. * }
  74514. * },
  74515. * {
  74516. * start:750,
  74517. * end:1500,
  74518. * style:{
  74519. * fillColor:"#00FF00"
  74520. * }
  74521. * }
  74522. * ]
  74523. *
  74524. * @extends FeatureThemeGraph
  74525. * @param {FeatureVector} data - 用户数据。
  74526. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  74527. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  74528. * @param {FeatureThemeLine.setting} setting - 图表配置对象。
  74529. * @param {LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  74530. * @usage
  74531. * @private
  74532. */
  74533. var Line = /*#__PURE__*/function (_Graph) {
  74534. overlay_Line_inherits(Line, _Graph);
  74535. var _super = overlay_Line_createSuper(Line);
  74536. function Line(data, layer, fields, setting, lonlat, options) {
  74537. var _this;
  74538. overlay_Line_classCallCheck(this, Line);
  74539. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  74540. _this.CLASS_NAME = "SuperMap.Feature.Theme.Line";
  74541. return _this;
  74542. }
  74543. /**
  74544. * @function FeatureThemeLine.prototype.destroy
  74545. * @override
  74546. */
  74547. overlay_Line_createClass(Line, [{
  74548. key: "destroy",
  74549. value: function destroy() {
  74550. overlay_Line_get(overlay_Line_getPrototypeOf(Line.prototype), "destroy", this).call(this);
  74551. }
  74552. /**
  74553. * @function FeatureThemeLine.prototype.assembleShapes
  74554. * @description 装配图形(扩展接口)。
  74555. */
  74556. }, {
  74557. key: "assembleShapes",
  74558. value: function assembleShapes() {
  74559. // 图表配置对象
  74560. var sets = this.setting;
  74561. // 默认数据视图框
  74562. if (!sets.dataViewBoxParameter) {
  74563. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  74564. sets.dataViewBoxParameter = [45, 15, 15, 15];
  74565. } else {
  74566. sets.dataViewBoxParameter = [5, 5, 5, 5];
  74567. }
  74568. }
  74569. // 重要步骤:初始化参数
  74570. if (!this.initBaseParameter()) {
  74571. return;
  74572. }
  74573. var dvb = this.dataViewBox;
  74574. // 值域
  74575. var codomain = this.DVBCodomain;
  74576. // 重要步骤:定义图表 FeatureThemeBar 数据视图框中单位值的含义
  74577. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight;
  74578. var uv = this.DVBUnitValue;
  74579. // 数据值数组
  74580. var fv = this.dataValues;
  74581. if (fv.length < 1) {
  74582. return;
  74583. } // 没有数据
  74584. // 获取 x 轴上的图形信息
  74585. var xShapeInfo = this.calculateXShapeInfo();
  74586. if (!xShapeInfo) {
  74587. return;
  74588. }
  74589. // 折线每个节点的 x 位置
  74590. var xsLoc = xShapeInfo.xPositions;
  74591. // 背景框,默认启用
  74592. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  74593. // 将背景框图形添加到模型的 shapes 数组,注意添加顺序,后添加的图形在先添加的图形之上。
  74594. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  74595. }
  74596. // 折线图必须使用坐标轴
  74597. this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
  74598. // var isDataEffective = true;
  74599. var xPx; // 折线节点 x 坐标
  74600. var yPx; // 折线节点 y 坐标
  74601. var poiLists = []; // 折线节点数组
  74602. var shapePois = []; // 折线节点图形数组
  74603. for (var i = 0, len = fv.length; i < len; i++) {
  74604. // 数据溢出值域检查
  74605. if (fv[i] < codomain[0] || fv[i] > codomain[1]) {
  74606. // isDataEffective = false;
  74607. return null;
  74608. }
  74609. xPx = xsLoc[i];
  74610. yPx = dvb[1] - (fv[i] - codomain[0]) / uv;
  74611. // 折线节点参数对象
  74612. var poiSP = new Point_Point(xPx, yPx);
  74613. // 折线节点 style
  74614. poiSP.style = ShapeFactory.ShapeStyleTool({
  74615. fillColor: "#ee9900"
  74616. }, sets.pointStyle, sets.pointStyleByFields, sets.pointStyleByCodomain, i, fv[i]);
  74617. // 折线节点 hover 样式
  74618. poiSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.pointHoverStyle);
  74619. // 折线节点 hover click
  74620. if (typeof sets.pointHoverAble !== "undefined") {
  74621. poiSP.hoverable = sets.pointHoverAble;
  74622. }
  74623. if (typeof sets.pointClickAble !== "undefined") {
  74624. poiSP.clickable = sets.pointClickAble;
  74625. }
  74626. // 图形携带的数据信息
  74627. poiSP.refDataID = this.data.id;
  74628. poiSP.dataInfo = {
  74629. field: this.fields[i],
  74630. value: fv[i]
  74631. };
  74632. // 创建图形并把此图形添加到折线节点图形数组
  74633. shapePois.push(this.shapeFactory.createShape(poiSP));
  74634. // 添加折线节点到折线节点数组
  74635. var poi = [xPx, yPx];
  74636. poiLists.push(poi);
  74637. }
  74638. // 折线参数对象
  74639. var lineSP = new Line_Line(poiLists);
  74640. lineSP.style = ShapeFactory.ShapeStyleTool({
  74641. strokeColor: "#ee9900"
  74642. }, sets.lineStyle);
  74643. // 禁止事件响应
  74644. lineSP.clickable = false;
  74645. lineSP.hoverable = false;
  74646. var shapeLine = this.shapeFactory.createShape(lineSP);
  74647. this.shapes.push(shapeLine);
  74648. // 添加节点到图表图形数组
  74649. this.shapes = this.shapes.concat(shapePois);
  74650. // // 数据范围检测未通过,清空图形
  74651. // if (isDataEffective === false) {
  74652. // this.shapes = [];
  74653. // }
  74654. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  74655. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  74656. this.shapesConvertToRelativeCoordinate();
  74657. }
  74658. /**
  74659. * @function FeatureThemeLine.prototype.calculateXShapeInfo
  74660. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  74661. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  74662. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  74663. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  74664. * 本函数中图形配置对象 setting 可设属性:<br>
  74665. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  74666. * 长度为 2 的数组,第一元素表示第折线左端点与数据视图框左端的空白间距,第二个元素表示折线右端点右端与数据视图框右端端的空白间距 。
  74667. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:<br>
  74668. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。<br>
  74669. * width - {number} 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  74670. */
  74671. }, {
  74672. key: "calculateXShapeInfo",
  74673. value: function calculateXShapeInfo() {
  74674. var dvb = this.dataViewBox; // 数据视图框
  74675. var sets = this.setting; // 图表配置对象
  74676. var fvc = this.dataValues.length; // 数组值个数
  74677. if (fvc < 1) {
  74678. return null;
  74679. }
  74680. var xBlank; // x 轴空白间隔参数
  74681. var xShapePositions = []; // x 轴上图形的位置
  74682. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  74683. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  74684. var unitOffset = 0; // 单位偏移量
  74685. // x 轴空白间隔参数处理
  74686. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 2) {
  74687. xBlank = sets.xShapeBlank;
  74688. var xsLen = dvbWidth - (xBlank[0] + xBlank[1]);
  74689. if (xsLen <= fvc) {
  74690. return null;
  74691. }
  74692. unitOffset = xsLen / (fvc - 1);
  74693. } else {
  74694. // 默认使用等距离空白间隔,空白间隔为图形宽度
  74695. unitOffset = dvbWidth / (fvc + 1);
  74696. xBlank = [unitOffset, unitOffset, unitOffset];
  74697. }
  74698. // 图形 x 轴上的位置计算
  74699. var xOffset = 0;
  74700. for (var i = 0; i < fvc; i++) {
  74701. if (i == 0) {
  74702. xOffset = xBlank[0];
  74703. } else {
  74704. xOffset += unitOffset;
  74705. }
  74706. xShapePositions.push(dvb[0] + xOffset);
  74707. }
  74708. return {
  74709. "xPositions": xShapePositions,
  74710. "width": xShapeWidth
  74711. };
  74712. }
  74713. }]);
  74714. return Line;
  74715. }(Graph);
  74716. ;// CONCATENATED MODULE: ./src/common/overlay/Pie.js
  74717. function Pie_typeof(obj) { "@babel/helpers - typeof"; return Pie_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Pie_typeof(obj); }
  74718. function Pie_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  74719. function Pie_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  74720. function Pie_createClass(Constructor, protoProps, staticProps) { if (protoProps) Pie_defineProperties(Constructor.prototype, protoProps); if (staticProps) Pie_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  74721. function Pie_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Pie_get = Reflect.get.bind(); } else { Pie_get = function _get(target, property, receiver) { var base = Pie_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Pie_get.apply(this, arguments); }
  74722. function Pie_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Pie_getPrototypeOf(object); if (object === null) break; } return object; }
  74723. function Pie_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Pie_setPrototypeOf(subClass, superClass); }
  74724. function Pie_setPrototypeOf(o, p) { Pie_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Pie_setPrototypeOf(o, p); }
  74725. function Pie_createSuper(Derived) { var hasNativeReflectConstruct = Pie_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Pie_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Pie_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Pie_possibleConstructorReturn(this, result); }; }
  74726. function Pie_possibleConstructorReturn(self, call) { if (call && (Pie_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Pie_assertThisInitialized(self); }
  74727. function Pie_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  74728. function Pie_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  74729. function Pie_getPrototypeOf(o) { Pie_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Pie_getPrototypeOf(o); }
  74730. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  74731. * This program are made available under the terms of the Apache License, Version 2.0
  74732. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  74733. /**
  74734. * @class FeatureThemePie
  74735. * @aliasclass Feature.Theme.Pie
  74736. * @deprecatedclass SuperMap.Feature.Theme.Pie
  74737. * @classdesc 饼图。
  74738. * @category Visualization Theme
  74739. * @param {FeatureVector} data - 用户数据。
  74740. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  74741. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  74742. * @param {FeatureThemePoint.setting} setting - 图表配置对象。
  74743. * @param {LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  74744. * @extends FeatureThemeGraph
  74745. * @example
  74746. * // sectorStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  74747. * // start: 值域值下限(包含);
  74748. * // end: 值域值上限(不包含);
  74749. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <ShapeParametersSector.style> 。
  74750. * // sectorStyleByCodomain 数组形如:
  74751. * [
  74752. * {
  74753. * start:0,
  74754. * end:250,
  74755. * style:{
  74756. * fillColor:"#00CD00"
  74757. * }
  74758. * },
  74759. * {
  74760. * start:250,
  74761. * end:500,
  74762. * style:{
  74763. * fillColor:"#00EE00"
  74764. * }
  74765. * },
  74766. * {
  74767. * start:500,
  74768. * end:750,
  74769. * style:{
  74770. * fillColor:"#00FF7F"
  74771. * }
  74772. * },
  74773. * {
  74774. * start:750,
  74775. * end:1500,
  74776. * style:{
  74777. * fillColor:"#00FF00"
  74778. * }
  74779. * }
  74780. * ]
  74781. * @usage
  74782. * @private
  74783. */
  74784. var Pie = /*#__PURE__*/function (_Graph) {
  74785. Pie_inherits(Pie, _Graph);
  74786. var _super = Pie_createSuper(Pie);
  74787. function Pie(data, layer, fields, setting, lonlat) {
  74788. var _this;
  74789. Pie_classCallCheck(this, Pie);
  74790. _this = _super.call(this, data, layer, fields, setting, lonlat);
  74791. _this.CLASS_NAME = "SuperMap.Feature.Theme.Pie";
  74792. return _this;
  74793. }
  74794. /**
  74795. * @function FeatureThemePie.prototype.destroy
  74796. * @description 销毁此专题要素。调用 destroy 后此对象所以属性置为 null。
  74797. */
  74798. Pie_createClass(Pie, [{
  74799. key: "destroy",
  74800. value: function destroy() {
  74801. Pie_get(Pie_getPrototypeOf(Pie.prototype), "destroy", this).call(this);
  74802. }
  74803. /**
  74804. * @function FeatureThemePie.prototype.assembleShapes
  74805. * @description 装配图形(扩展接口)。
  74806. */
  74807. }, {
  74808. key: "assembleShapes",
  74809. value: function assembleShapes() {
  74810. // 图表配置对象
  74811. var sets = this.setting;
  74812. // 一个默认 style 组
  74813. var defaultStyleGroup = [{
  74814. fillColor: "#ff9277"
  74815. }, {
  74816. fillColor: "#dddd00"
  74817. }, {
  74818. fillColor: "#ffc877"
  74819. }, {
  74820. fillColor: "#bbe3ff"
  74821. }, {
  74822. fillColor: "#d5ffbb"
  74823. }, {
  74824. fillColor: "#bbbbff"
  74825. }, {
  74826. fillColor: "#ddb000"
  74827. }, {
  74828. fillColor: "#b0dd00"
  74829. }, {
  74830. fillColor: "#e2bbff"
  74831. }, {
  74832. fillColor: "#ffbbe3"
  74833. }, {
  74834. fillColor: "#ff7777"
  74835. }, {
  74836. fillColor: "#ff9900"
  74837. }, {
  74838. fillColor: "#83dd00"
  74839. }, {
  74840. fillColor: "#77e3ff"
  74841. }, {
  74842. fillColor: "#778fff"
  74843. }, {
  74844. fillColor: "#c877ff"
  74845. }, {
  74846. fillColor: "#ff77ab"
  74847. }, {
  74848. fillColor: "#ff6600"
  74849. }, {
  74850. fillColor: "#aa8800"
  74851. }, {
  74852. fillColor: "#77c7ff"
  74853. }, {
  74854. fillColor: "#ad77ff"
  74855. }, {
  74856. fillColor: "#ff77ff"
  74857. }, {
  74858. fillColor: "#dd0083"
  74859. }, {
  74860. fillColor: "#777700"
  74861. }, {
  74862. fillColor: "#00aa00"
  74863. }, {
  74864. fillColor: "#0088aa"
  74865. }, {
  74866. fillColor: "#8400dd"
  74867. }, {
  74868. fillColor: "#aa0088"
  74869. }, {
  74870. fillColor: "#dd0000"
  74871. }, {
  74872. fillColor: "#772e00"
  74873. }];
  74874. // 重要步骤:初始化参数
  74875. if (!this.initBaseParameter()) {
  74876. return;
  74877. }
  74878. // 背景框,默认不启用
  74879. if (sets.useBackground) {
  74880. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  74881. }
  74882. // 数据值数组
  74883. var fv = this.dataValues;
  74884. if (fv.length < 1) {
  74885. return;
  74886. } // 没有数据
  74887. // 值域范围
  74888. var codomain = this.DVBCodomain;
  74889. // 值域范围检测
  74890. for (var _i2 = 0; _i2 < fv.length; _i2++) {
  74891. if (fv[_i2] < codomain[0] || fv[_i2] > codomain[1]) {
  74892. return;
  74893. }
  74894. }
  74895. // 值的绝对值总和
  74896. var valueSum = 0;
  74897. for (var _i4 = 0; _i4 < fv.length; _i4++) {
  74898. valueSum += Math.abs(fv[_i4]);
  74899. }
  74900. // 重要步骤:定义图表 FeatureThemePie 数据视图框中单位值的含义,单位值:每度代表的数值
  74901. this.DVBUnitValue = 360 / valueSum;
  74902. var uv = this.DVBUnitValue;
  74903. var dvbCenter = this.DVBCenterPoint; // 数据视图框中心作为扇心
  74904. var startAngle = 0; // 扇形起始边角度
  74905. var endAngle = 0; // 扇形终止边角度
  74906. var startAngleTmp = startAngle; // 扇形临时起始边角度
  74907. // 扇形(自适应)半径
  74908. var r = this.DVBHeight < this.DVBWidth ? this.DVBHeight / 2 : this.DVBWidth / 2;
  74909. for (var i = 0; i < fv.length; i++) {
  74910. var fvi = Math.abs(fv[i]);
  74911. //计算终止角
  74912. if (i === 0) {
  74913. endAngle = startAngle + fvi * uv;
  74914. } else if (i === fvi.length - 1) {
  74915. endAngle = startAngleTmp;
  74916. } else {
  74917. endAngle = startAngle + fvi * uv;
  74918. }
  74919. //矫正误差计算
  74920. if (endAngle - startAngle >= 360) {
  74921. endAngle = 359.9999999;
  74922. }
  74923. // 扇形参数对象
  74924. var sectorSP = new Sector(dvbCenter[0], dvbCenter[1], r, startAngle, endAngle);
  74925. // 扇形样式
  74926. if (typeof sets.sectorStyleByFields === "undefined") {
  74927. // 使用默认 style 组
  74928. var colorIndex = i % defaultStyleGroup.length;
  74929. sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, defaultStyleGroup, null, colorIndex);
  74930. } else {
  74931. sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, sets.sectorStyleByFields, sets.sectorStyleByCodomain, i, fv[i]);
  74932. }
  74933. // 扇形 hover 样式
  74934. sectorSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.sectorHoverStyle);
  74935. // 扇形 hover 与 click 设置
  74936. if (typeof sets.sectorHoverAble !== "undefined") {
  74937. sectorSP.hoverable = sets.sectorHoverAble;
  74938. }
  74939. if (typeof sets.sectorClickAble !== "undefined") {
  74940. sectorSP.clickable = sets.sectorClickAble;
  74941. }
  74942. // 图形携带的数据信息
  74943. sectorSP.refDataID = this.data.id;
  74944. sectorSP.dataInfo = {
  74945. field: this.fields[i],
  74946. value: fv[i]
  74947. };
  74948. // 创建扇形并把此扇形添加到图表图形数组
  74949. this.shapes.push(this.shapeFactory.createShape(sectorSP));
  74950. // 把上一次的结束角度作为下一次的起始角度
  74951. startAngle = endAngle;
  74952. }
  74953. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  74954. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  74955. this.shapesConvertToRelativeCoordinate();
  74956. }
  74957. }]);
  74958. return Pie;
  74959. }(Graph);
  74960. ;// CONCATENATED MODULE: ./src/common/overlay/Point.js
  74961. function overlay_Point_typeof(obj) { "@babel/helpers - typeof"; return overlay_Point_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, overlay_Point_typeof(obj); }
  74962. function overlay_Point_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  74963. function overlay_Point_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  74964. function overlay_Point_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Point_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Point_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  74965. function overlay_Point_get() { if (typeof Reflect !== "undefined" && Reflect.get) { overlay_Point_get = Reflect.get.bind(); } else { overlay_Point_get = function _get(target, property, receiver) { var base = overlay_Point_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return overlay_Point_get.apply(this, arguments); }
  74966. function overlay_Point_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Point_getPrototypeOf(object); if (object === null) break; } return object; }
  74967. function overlay_Point_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) overlay_Point_setPrototypeOf(subClass, superClass); }
  74968. function overlay_Point_setPrototypeOf(o, p) { overlay_Point_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return overlay_Point_setPrototypeOf(o, p); }
  74969. function overlay_Point_createSuper(Derived) { var hasNativeReflectConstruct = overlay_Point_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = overlay_Point_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = overlay_Point_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return overlay_Point_possibleConstructorReturn(this, result); }; }
  74970. function overlay_Point_possibleConstructorReturn(self, call) { if (call && (overlay_Point_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return overlay_Point_assertThisInitialized(self); }
  74971. function overlay_Point_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  74972. function overlay_Point_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  74973. function overlay_Point_getPrototypeOf(o) { overlay_Point_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return overlay_Point_getPrototypeOf(o); }
  74974. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  74975. * This program are made available under the terms of the Apache License, Version 2.0
  74976. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  74977. /**
  74978. * @class FeatureThemePoint
  74979. * @aliasclass Feature.Theme.Point
  74980. * @deprecatedclass SuperMap.Feature.Theme.Point
  74981. * @classdesc 点状图。
  74982. * @category Visualization Theme
  74983. * @param {FeatureVector} data - 用户数据。
  74984. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  74985. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  74986. * @param {FeatureThemePoint.setting} setting - 图表配置对象。
  74987. * @param {LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  74988. * @example
  74989. * // pointStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  74990. * // start: 值域值下限(包含);
  74991. * // end: 值域值上限(不包含);
  74992. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <Point.style> 。
  74993. * // pointStyleByCodomain 数组形如:
  74994. * [
  74995. * {
  74996. * start:0,
  74997. * end:250,
  74998. * style:{
  74999. * fillColor:"#00CD00"
  75000. * }
  75001. * },
  75002. * {
  75003. * start:250,
  75004. * end:500,
  75005. * style:{
  75006. * fillColor:"#00EE00"
  75007. * }
  75008. * },
  75009. * {
  75010. * start:500,
  75011. * end:750,
  75012. * style:{
  75013. * fillColor:"#00FF7F"
  75014. * }
  75015. * },
  75016. * {
  75017. * start:750,
  75018. * end:1500,
  75019. * style:{
  75020. * fillColor:"#00FF00"
  75021. * }
  75022. * }
  75023. * ]
  75024. * @extends FeatureThemeGraph
  75025. * @usage
  75026. * @private
  75027. */
  75028. var overlay_Point_Point = /*#__PURE__*/function (_Graph) {
  75029. overlay_Point_inherits(Point, _Graph);
  75030. var _super = overlay_Point_createSuper(Point);
  75031. function Point(data, layer, fields, setting, lonlat, options) {
  75032. var _this;
  75033. overlay_Point_classCallCheck(this, Point);
  75034. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  75035. _this.CLASS_NAME = "SuperMap.Feature.Theme.Point";
  75036. return _this;
  75037. }
  75038. /**
  75039. * @function FeatureThemePoint.prototype.destroy
  75040. * @description 销毁此专题要素。调用 destroy 后此对象所以属性置为 null。
  75041. */
  75042. overlay_Point_createClass(Point, [{
  75043. key: "destroy",
  75044. value: function destroy() {
  75045. overlay_Point_get(overlay_Point_getPrototypeOf(Point.prototype), "destroy", this).call(this);
  75046. }
  75047. /**
  75048. * @function FeatureThemePoint.prototype.Point.assembleShapes
  75049. * @description 装配图形(扩展接口)。
  75050. */
  75051. }, {
  75052. key: "assembleShapes",
  75053. value: function assembleShapes() {
  75054. // 图表配置对象
  75055. var sets = this.setting;
  75056. // 默认数据视图框
  75057. if (!sets.dataViewBoxParameter) {
  75058. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  75059. sets.dataViewBoxParameter = [45, 15, 15, 15];
  75060. } else {
  75061. sets.dataViewBoxParameter = [5, 5, 5, 5];
  75062. }
  75063. }
  75064. // 重要步骤:初始化参数
  75065. if (!this.initBaseParameter()) {
  75066. return;
  75067. }
  75068. var dvb = this.dataViewBox;
  75069. // 值域
  75070. var codomain = this.DVBCodomain;
  75071. // 重要步骤:定义图表 FeatureThemeBar 数据视图框中单位值的含义
  75072. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight;
  75073. var uv = this.DVBUnitValue;
  75074. var fv = this.dataValues;
  75075. // 获取 x 轴上的图形信息
  75076. var xShapeInfo = this.calculateXShapeInfo();
  75077. if (!xShapeInfo) {
  75078. return;
  75079. }
  75080. // 折线每个节点的 x 位置
  75081. var xsLoc = xShapeInfo.xPositions;
  75082. // 背景框,默认启用
  75083. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  75084. // 将背景框图形添加到模型的 shapes 数组,注意添加顺序,后添加的图形在先添加的图形之上。
  75085. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  75086. }
  75087. // 点状图必须使用坐标轴
  75088. this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
  75089. var xPx; // 图形点 x 坐标
  75090. var yPx; // 图形点 y 坐标
  75091. for (var i = 0, len = fv.length; i < len; i++) {
  75092. // 数据溢出值域检查
  75093. if (fv[i] < codomain[0] || fv[i] > codomain[1]) {
  75094. //isDataEffective = false;
  75095. return null;
  75096. }
  75097. xPx = xsLoc[i];
  75098. yPx = dvb[1] - (fv[i] - codomain[0]) / uv;
  75099. // 图形点参数对象
  75100. var poiSP = new Point_Point(xPx, yPx);
  75101. // 图形点 style
  75102. poiSP.style = ShapeFactory.ShapeStyleTool({
  75103. fillColor: "#ee9900"
  75104. }, sets.pointStyle, sets.pointStyleByFields, sets.pointStyleByCodomain, i, fv[i]);
  75105. // 图形点 hover 样式
  75106. poiSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.pointHoverStyle);
  75107. // 图形点 hover click
  75108. if (typeof sets.pointHoverAble !== "undefined") {
  75109. poiSP.hoverable = sets.pointHoverAble;
  75110. }
  75111. if (typeof sets.pointClickAble !== "undefined") {
  75112. poiSP.clickable = sets.pointClickAble;
  75113. }
  75114. // 图形携带的数据信息
  75115. poiSP.refDataID = this.data.id;
  75116. poiSP.dataInfo = {
  75117. field: this.fields[i],
  75118. value: fv[i]
  75119. };
  75120. // 创建图形点并把此图形添加到图表图形数组
  75121. this.shapes.push(this.shapeFactory.createShape(poiSP));
  75122. }
  75123. // 数据范围检测未通过,清空图形
  75124. // if (isDataEffective === false) {
  75125. // this.shapes = [];
  75126. // }
  75127. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  75128. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  75129. this.shapesConvertToRelativeCoordinate();
  75130. }
  75131. /**
  75132. * @function FeatureThemePoint.prototype.calculateXShapeInfo
  75133. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  75134. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  75135. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  75136. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  75137. * 本函数中图形配置对象 setting 可设属性:<br>
  75138. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  75139. * 长度为 2 的数组,第一元素表示第折线左端点与数据视图框左端的空白间距,第二个元素表示折线右端点右端与数据视图框右端端的空白间距 。
  75140. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:<br>
  75141. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  75142. * width - {number}表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  75143. */
  75144. }, {
  75145. key: "calculateXShapeInfo",
  75146. value: function calculateXShapeInfo() {
  75147. var dvb = this.dataViewBox; // 数据视图框
  75148. var sets = this.setting; // 图表配置对象
  75149. var fvc = this.dataValues.length; // 数组值个数
  75150. if (fvc < 1) {
  75151. return null;
  75152. }
  75153. var xBlank; // x 轴空白间隔参数
  75154. var xShapePositions = []; // x 轴上图形的位置
  75155. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  75156. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  75157. var unitOffset = 0; // 单位偏移量
  75158. // x 轴空白间隔参数处理
  75159. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 2) {
  75160. xBlank = sets.xShapeBlank;
  75161. var xsLen = dvbWidth - (xBlank[0] + xBlank[1]);
  75162. if (xsLen <= fvc) {
  75163. return null;
  75164. }
  75165. unitOffset = xsLen / (fvc - 1);
  75166. } else {
  75167. // 默认使用等距离空白间隔,空白间隔为图形宽度
  75168. unitOffset = dvbWidth / (fvc + 1);
  75169. xBlank = [unitOffset, unitOffset, unitOffset];
  75170. }
  75171. // 图形 x 轴上的位置计算
  75172. var xOffset = 0;
  75173. for (var i = 0; i < fvc; i++) {
  75174. if (i == 0) {
  75175. xOffset = xBlank[0];
  75176. } else {
  75177. xOffset += unitOffset;
  75178. }
  75179. xShapePositions.push(dvb[0] + xOffset);
  75180. }
  75181. return {
  75182. "xPositions": xShapePositions,
  75183. "width": xShapeWidth
  75184. };
  75185. }
  75186. }]);
  75187. return Point;
  75188. }(Graph);
  75189. ;// CONCATENATED MODULE: ./src/common/overlay/Ring.js
  75190. function Ring_typeof(obj) { "@babel/helpers - typeof"; return Ring_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Ring_typeof(obj); }
  75191. function Ring_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  75192. function Ring_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  75193. function Ring_createClass(Constructor, protoProps, staticProps) { if (protoProps) Ring_defineProperties(Constructor.prototype, protoProps); if (staticProps) Ring_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  75194. function Ring_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Ring_get = Reflect.get.bind(); } else { Ring_get = function _get(target, property, receiver) { var base = Ring_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Ring_get.apply(this, arguments); }
  75195. function Ring_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Ring_getPrototypeOf(object); if (object === null) break; } return object; }
  75196. function Ring_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Ring_setPrototypeOf(subClass, superClass); }
  75197. function Ring_setPrototypeOf(o, p) { Ring_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Ring_setPrototypeOf(o, p); }
  75198. function Ring_createSuper(Derived) { var hasNativeReflectConstruct = Ring_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Ring_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Ring_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Ring_possibleConstructorReturn(this, result); }; }
  75199. function Ring_possibleConstructorReturn(self, call) { if (call && (Ring_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Ring_assertThisInitialized(self); }
  75200. function Ring_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  75201. function Ring_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  75202. function Ring_getPrototypeOf(o) { Ring_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Ring_getPrototypeOf(o); }
  75203. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  75204. * This program are made available under the terms of the Apache License, Version 2.0
  75205. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  75206. /**
  75207. * @class FeatureThemeRing
  75208. * @aliasclass Feature.Theme.Ring
  75209. * @deprecatedclass SuperMap.Feature.Theme.Ring
  75210. * @classdesc 环状图。
  75211. * @category Visualization Theme
  75212. * @description 基于路由对象计算指定点 M 值操作的参数类。通过该类提供参数信息。
  75213. * @param {FeatureVector} data - 用户数据。
  75214. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  75215. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  75216. * @param {FeatureThemeRing.setting} setting - 图表配置对象。
  75217. * @param {LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  75218. * @example
  75219. * // sectorStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  75220. * // start: 值域值下限(包含);
  75221. * // end: 值域值上限(不包含);
  75222. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <ShapeParametersSector.style> 。
  75223. * // sectorStyleByCodomain 数组形如:
  75224. * [
  75225. * {
  75226. * start:0,
  75227. * end:250,
  75228. * style:{
  75229. * fillColor:"#00CD00"
  75230. * }
  75231. * },
  75232. * {
  75233. * start:250,
  75234. * end:500,
  75235. * style:{
  75236. * fillColor:"#00EE00"
  75237. * }
  75238. * },
  75239. * {
  75240. * start:500,
  75241. * end:750,
  75242. * style:{
  75243. * fillColor:"#00FF7F"
  75244. * }
  75245. * },
  75246. * {
  75247. * start:750,
  75248. * end:1500,
  75249. * style:{
  75250. * fillColor:"#00FF00"
  75251. * }
  75252. * }
  75253. * ]
  75254. * @param {Object} [sectorHoverStyle=true] - 环状图扇形 hover 状态时的样式,sectorHoverAble 为 true 时有效。
  75255. * @param {boolean} [sectorHoverAble=true] - 是否允许环状图扇形使用 hover 状态。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽环状图扇形对专题图层事件的响应。
  75256. * @param {boolean} [sectorClickAble=true] - 是否允许环状图扇形被点击。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽环状图扇形对专题图层事件的响应。
  75257. *
  75258. * @extends FeatureThemeGraph
  75259. * @usage
  75260. * @private
  75261. */
  75262. var Ring = /*#__PURE__*/function (_Graph) {
  75263. Ring_inherits(Ring, _Graph);
  75264. var _super = Ring_createSuper(Ring);
  75265. function Ring(data, layer, fields, setting, lonlat) {
  75266. var _this;
  75267. Ring_classCallCheck(this, Ring);
  75268. _this = _super.call(this, data, layer, fields, setting, lonlat);
  75269. _this.CLASS_NAME = "SuperMap.Feature.Theme.Ring";
  75270. return _this;
  75271. }
  75272. /**
  75273. * @function FeatureThemeRing.prototype.destroy
  75274. * @description 销毁此专题要素。调用 destroy 后此对象所以属性置为 null。
  75275. */
  75276. Ring_createClass(Ring, [{
  75277. key: "destroy",
  75278. value: function destroy() {
  75279. Ring_get(Ring_getPrototypeOf(Ring.prototype), "destroy", this).call(this);
  75280. }
  75281. /**
  75282. * @function FeatureThemeRing.prototype.assembleShapes
  75283. * @description 装配图形(扩展接口)。
  75284. */
  75285. }, {
  75286. key: "assembleShapes",
  75287. value: function assembleShapes() {
  75288. // 重要步骤:初始化参数
  75289. if (!this.initBaseParameter()) {
  75290. return;
  75291. }
  75292. // 一个默认 style 组
  75293. var defaultStyleGroup = [{
  75294. fillColor: "#ff9277"
  75295. }, {
  75296. fillColor: "#dddd00"
  75297. }, {
  75298. fillColor: "#ffc877"
  75299. }, {
  75300. fillColor: "#bbe3ff"
  75301. }, {
  75302. fillColor: "#d5ffbb"
  75303. }, {
  75304. fillColor: "#bbbbff"
  75305. }, {
  75306. fillColor: "#ddb000"
  75307. }, {
  75308. fillColor: "#b0dd00"
  75309. }, {
  75310. fillColor: "#e2bbff"
  75311. }, {
  75312. fillColor: "#ffbbe3"
  75313. }, {
  75314. fillColor: "#ff7777"
  75315. }, {
  75316. fillColor: "#ff9900"
  75317. }, {
  75318. fillColor: "#83dd00"
  75319. }, {
  75320. fillColor: "#77e3ff"
  75321. }, {
  75322. fillColor: "#778fff"
  75323. }, {
  75324. fillColor: "#c877ff"
  75325. }, {
  75326. fillColor: "#ff77ab"
  75327. }, {
  75328. fillColor: "#ff6600"
  75329. }, {
  75330. fillColor: "#aa8800"
  75331. }, {
  75332. fillColor: "#77c7ff"
  75333. }, {
  75334. fillColor: "#ad77ff"
  75335. }, {
  75336. fillColor: "#ff77ff"
  75337. }, {
  75338. fillColor: "#dd0083"
  75339. }, {
  75340. fillColor: "#777700"
  75341. }, {
  75342. fillColor: "#00aa00"
  75343. }, {
  75344. fillColor: "#0088aa"
  75345. }, {
  75346. fillColor: "#8400dd"
  75347. }, {
  75348. fillColor: "#aa0088"
  75349. }, {
  75350. fillColor: "#dd0000"
  75351. }, {
  75352. fillColor: "#772e00"
  75353. }];
  75354. // 图表配置对象
  75355. var sets = this.setting;
  75356. // 背景框,默认不启用
  75357. if (sets.useBackground) {
  75358. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  75359. }
  75360. // 数据值数组
  75361. var fv = this.dataValues;
  75362. if (fv.length < 1) {
  75363. return;
  75364. } // 没有数据
  75365. // 值域范围
  75366. var codomain = this.DVBCodomain;
  75367. // 值域范围检测
  75368. for (var _i2 = 0; _i2 < fv.length; _i2++) {
  75369. if (fv[_i2] < codomain[0] || fv[_i2] > codomain[1]) {
  75370. return;
  75371. }
  75372. }
  75373. // 值的绝对值总和
  75374. var valueSum = 0;
  75375. for (var _i4 = 0; _i4 < fv.length; _i4++) {
  75376. valueSum += Math.abs(fv[_i4]);
  75377. }
  75378. // 重要步骤:定义图表 FeatureThemeRing 数据视图框中单位值的含义,单位值:每度代表的数值
  75379. this.DVBUnitValue = 360 / valueSum;
  75380. var uv = this.DVBUnitValue;
  75381. var dvbCenter = this.DVBCenterPoint; // 数据视图框中心作为扇心
  75382. var startAngle = 0; // 扇形起始边角度
  75383. var endAngle = 0; // 扇形终止边角度
  75384. var startAngleTmp = startAngle; // 扇形临时起始边角度
  75385. // 扇形外环(自适应)半径
  75386. var r = this.DVBHeight < this.DVBWidth ? this.DVBHeight / 2 : this.DVBWidth / 2;
  75387. // 扇形内环(自适应)半径
  75388. var isInRange = sets.innerRingRadius >= 0 && sets.innerRingRadius < r;
  75389. var r0 = typeof sets.innerRingRadius !== "undefined" && !isNaN(sets.innerRingRadius) && isInRange ? sets.innerRingRadius : 0;
  75390. for (var i = 0; i < fv.length; i++) {
  75391. var fvi = Math.abs(fv[i]);
  75392. // 计算结束角度
  75393. if (i === 0) {
  75394. endAngle = startAngle + fvi * uv;
  75395. } else if (i === fvi.length - 1) {
  75396. endAngle = startAngleTmp;
  75397. } else {
  75398. endAngle = startAngle + fvi * uv;
  75399. }
  75400. // 扇形参数对象
  75401. var sectorSP = new Sector(dvbCenter[0], dvbCenter[1], r, startAngle, endAngle, r0);
  75402. // 扇形样式
  75403. if (typeof sets.sectorStyleByFields === "undefined") {
  75404. // 使用默认 style 组
  75405. var colorIndex = i % defaultStyleGroup.length;
  75406. sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, defaultStyleGroup, null, colorIndex);
  75407. } else {
  75408. sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, sets.sectorStyleByFields, sets.sectorStyleByCodomain, i, fv[i]);
  75409. }
  75410. // 扇形 hover 样式
  75411. sectorSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.sectorHoverStyle);
  75412. // 扇形 hover 与 click 设置
  75413. if (typeof sets.sectorHoverAble !== "undefined") {
  75414. sectorSP.hoverable = sets.sectorHoverAble;
  75415. }
  75416. if (typeof sets.sectorClickAble !== "undefined") {
  75417. sectorSP.clickable = sets.sectorClickAble;
  75418. }
  75419. // 图形携带的数据信息
  75420. sectorSP.refDataID = this.data.id;
  75421. sectorSP.dataInfo = {
  75422. field: this.fields[i],
  75423. value: fv[i]
  75424. };
  75425. // 创建扇形并把此扇形添加到图表图形数组
  75426. this.shapes.push(this.shapeFactory.createShape(sectorSP));
  75427. // 把上一次的结束角度作为下一次的起始角度
  75428. startAngle = endAngle;
  75429. }
  75430. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  75431. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  75432. this.shapesConvertToRelativeCoordinate();
  75433. }
  75434. }]);
  75435. return Ring;
  75436. }(Graph);
  75437. ;// CONCATENATED MODULE: ./src/common/overlay/ThemeVector.js
  75438. function ThemeVector_typeof(obj) { "@babel/helpers - typeof"; return ThemeVector_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ThemeVector_typeof(obj); }
  75439. function ThemeVector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  75440. function ThemeVector_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  75441. function ThemeVector_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeVector_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeVector_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  75442. function ThemeVector_get() { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeVector_get = Reflect.get.bind(); } else { ThemeVector_get = function _get(target, property, receiver) { var base = ThemeVector_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return ThemeVector_get.apply(this, arguments); }
  75443. function ThemeVector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeVector_getPrototypeOf(object); if (object === null) break; } return object; }
  75444. function ThemeVector_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ThemeVector_setPrototypeOf(subClass, superClass); }
  75445. function ThemeVector_setPrototypeOf(o, p) { ThemeVector_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeVector_setPrototypeOf(o, p); }
  75446. function ThemeVector_createSuper(Derived) { var hasNativeReflectConstruct = ThemeVector_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThemeVector_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThemeVector_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThemeVector_possibleConstructorReturn(this, result); }; }
  75447. function ThemeVector_possibleConstructorReturn(self, call) { if (call && (ThemeVector_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ThemeVector_assertThisInitialized(self); }
  75448. function ThemeVector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  75449. function ThemeVector_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  75450. function ThemeVector_getPrototypeOf(o) { ThemeVector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeVector_getPrototypeOf(o); }
  75451. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  75452. * This program are made available under the terms of the Apache License, Version 2.0
  75453. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  75454. /**
  75455. * @class FeatureThemeVector
  75456. * @aliasclass Feature.Theme.ThemeVector
  75457. * @deprecatedclass SuperMap.Feature.Theme.ThemeVector
  75458. * @classdesc 矢量专题要素类。
  75459. * @category Visualization Theme
  75460. * @extends FeatureTheme
  75461. * @param {FeatureVector} data - 用户数据,的类型为矢量数据 feature。
  75462. * @param {SuperMap.Layer} layer - 此专题要素所在图层。
  75463. * @param {Object} style - 样式。
  75464. * @param {Object} options - 创建专题要素时的可选参数。
  75465. * @param {number} [options.nodesClipPixel=2] - 节点抽稀像素距离,单位:像素。
  75466. * @param {boolean} [options.isHoverAble=true] - 图形是否可 hover。
  75467. * @param {boolean} [options.isMultiHover=true] - 是否使用多图形高亮,isHoverAble 为 true 时生效。
  75468. * @param {boolean} [options.isClickAble=true] - 图形是否可点击。
  75469. * @param {Object} [options.highlightStyle] - 高亮样式。
  75470. * @usage
  75471. */
  75472. var ThemeVector = /*#__PURE__*/function (_Theme) {
  75473. ThemeVector_inherits(ThemeVector, _Theme);
  75474. var _super = ThemeVector_createSuper(ThemeVector);
  75475. function ThemeVector(data, layer, style, options, shapeOptions) {
  75476. var _this;
  75477. ThemeVector_classCallCheck(this, ThemeVector);
  75478. _this = _super.call(this, data, layer);
  75479. //数据的 geometry 属性必须存在且类型是 Geometry 或其子类的类型
  75480. if (!data.geometry) {
  75481. return ThemeVector_possibleConstructorReturn(_this);
  75482. }
  75483. if (!(data.geometry instanceof Geometry_Geometry)) {
  75484. return ThemeVector_possibleConstructorReturn(_this);
  75485. }
  75486. /**
  75487. * @member {Bounds} [FeatureThemeVector.prototype.dataBounds]
  75488. * @description 用户数据的(feature.geometry)地理范围。
  75489. */
  75490. _this.dataBounds = data.geometry.getBounds();
  75491. /**
  75492. * @member {number} [FeatureThemeVector.prototype.nodesClipPixel=2]
  75493. * @description 节点抽稀像素距离。
  75494. */
  75495. _this.nodesClipPixel = 2;
  75496. /**
  75497. * @member {boolean} [FeatureThemeVector.prototype.isHoverAble=true]
  75498. * @description 图形是否可 hover。
  75499. */
  75500. _this.isHoverAble = true;
  75501. /**
  75502. * @member {boolean} [FeatureThemeVector.prototype.isMultiHover=true]
  75503. * @description 是否使用多图形高亮,isHoverAble 为 true 时生效。
  75504. */
  75505. _this.isMultiHover = true;
  75506. /**
  75507. * @member {boolean} [FeatureThemeVector.prototype.isClickAble=true]
  75508. * @description 图形是否可点击。
  75509. */
  75510. _this.isClickAble = true;
  75511. /**
  75512. * @member {Object} [FeatureThemeVector.prototype.highlightStyle]
  75513. * @description 高亮样式。
  75514. */
  75515. _this.highlightStyle = null;
  75516. /**
  75517. * @member {Object} [FeatureThemeVector.prototype.shapeOptions]
  75518. * @description 添加到渲染器前修改 shape 的一些属性,非特殊情况通常不允许这么做。
  75519. */
  75520. _this.shapeOptions = {};
  75521. /**
  75522. * @member {Object} [FeatureThemeVector.prototype.style]
  75523. * @description 可视化图形的 style。在子类中规定其对象结构和默认属性值。
  75524. */
  75525. _this.style = style || {};
  75526. _this.CLASS_NAME = "SuperMap.Feature.Theme.Vector";
  75527. _this.style = style ? style : {};
  75528. if (options) {
  75529. Util_Util.copyAttributesWithClip(ThemeVector_assertThisInitialized(_this), options, ["shapeOptions", "dataBounds"]);
  75530. }
  75531. if (shapeOptions) {
  75532. Util_Util.copyAttributesWithClip(_this.shapeOptions, shapeOptions);
  75533. }
  75534. //设置基础参数 dataBounds、lonlat、location
  75535. var geometry = data.geometry;
  75536. _this.lonlat = _this.dataBounds.getCenterLonLat();
  75537. _this.location = _this.getLocalXY(_this.lonlat);
  75538. //将地理要素转为专题要素
  75539. if (geometry instanceof LinearRing_LinearRing) {
  75540. _this.lineToTF(geometry);
  75541. } else if (geometry instanceof LineString) {
  75542. _this.lineToTF(geometry);
  75543. } else if (geometry instanceof Curve) {
  75544. //独立几何体
  75545. } else if (geometry instanceof MultiPoint) {
  75546. _this.multiPointToTF(geometry);
  75547. } else if (geometry instanceof MultiLineString) {
  75548. _this.multiLineStringToTF(geometry);
  75549. } else if (geometry instanceof MultiPolygon) {
  75550. _this.multiPolygonToTF(geometry);
  75551. } else if (geometry instanceof Polygon_Polygon) {
  75552. _this.polygonToTF(geometry);
  75553. } else if (geometry instanceof Collection) {
  75554. //独立几何体
  75555. } else if (geometry instanceof Point) {
  75556. _this.pointToTF(geometry);
  75557. } else if (geometry instanceof Rectangle) {
  75558. _this.rectangleToTF(geometry);
  75559. } else if (geometry instanceof GeoText) {
  75560. _this.geoTextToTF(geometry);
  75561. }
  75562. return _this;
  75563. }
  75564. /**
  75565. * @function FeatureThemeVector.prototype.destroy
  75566. * @override
  75567. */
  75568. ThemeVector_createClass(ThemeVector, [{
  75569. key: "destroy",
  75570. value: function destroy() {
  75571. this.style = null;
  75572. this.dataBounds = null;
  75573. this.nodesClipPixel = null;
  75574. this.isHoverAble = null;
  75575. this.isMultiHover = null;
  75576. this.isClickAble = null;
  75577. this.highlightStyle = null;
  75578. this.shapeOptions = null;
  75579. ThemeVector_get(ThemeVector_getPrototypeOf(ThemeVector.prototype), "destroy", this).call(this);
  75580. }
  75581. /**
  75582. * @function FeatureThemeVector.prototype.lineToTF
  75583. * @description 转换线和线环要素。
  75584. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 GeometryLineString 或 GeometryLineRing。
  75585. */
  75586. }, {
  75587. key: "lineToTF",
  75588. value: function lineToTF(geometry) {
  75589. var components = geometry.components;
  75590. //节点像素坐标
  75591. var localLX = [];
  75592. //参考位置,参考中心为
  75593. var refLocal = [];
  75594. var location = this.location;
  75595. var pointList = [];
  75596. //节点抽稀距离
  75597. var nCPx = this.nodesClipPixel;
  75598. for (var i = 0; i < components.length; i++) {
  75599. var components_i = components[i];
  75600. refLocal = [];
  75601. localLX = this.getLocalXY(components_i);
  75602. refLocal[0] = localLX[0] - location[0];
  75603. refLocal[1] = localLX[1] - location[1];
  75604. //抽稀 - 2 px
  75605. if (pointList.length > 0) {
  75606. var lastLocalXY = pointList[pointList.length - 1];
  75607. if (Math.abs(lastLocalXY[0] - refLocal[0]) <= nCPx && Math.abs(lastLocalXY[1] - refLocal[1]) <= nCPx) {
  75608. continue;
  75609. }
  75610. }
  75611. //使用参考点
  75612. pointList.push(refLocal);
  75613. }
  75614. if (pointList.length < 2) {
  75615. return null;
  75616. }
  75617. //赋 style
  75618. var style = new Object();
  75619. style = Util_Util.copyAttributesWithClip(style, this.style, ['pointList']);
  75620. style.pointList = pointList;
  75621. //创建图形
  75622. var shape = new SmicBrokenLine({
  75623. style: style,
  75624. clickable: this.isClickAble,
  75625. hoverable: this.isHoverAble
  75626. });
  75627. //设置高亮样式
  75628. if (this.highlightStyle) {
  75629. shape.highlightStyle = this.highlightStyle;
  75630. }
  75631. //设置参考中心,指定图形位置
  75632. shape.refOriginalPosition = this.location;
  75633. //储存数据 id 属性,用于事件
  75634. shape.refDataID = this.data.id;
  75635. //储存数据 id 属性,用于事件-多图形同时高亮
  75636. shape.isHoverByRefDataID = this.isMultiHover;
  75637. //添加到渲染器前修改 shape 的一些属性,非特殊情况通常不允许这么做
  75638. if (this.shapeOptions) {
  75639. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  75640. }
  75641. this.shapes.push(shape);
  75642. }
  75643. /**
  75644. * @function FeatureThemeVector.prototype.multiPointToTF
  75645. * @description 转多点要素。
  75646. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 MultiPoint。
  75647. */
  75648. }, {
  75649. key: "multiPointToTF",
  75650. value: function multiPointToTF(geometry) {
  75651. /* //-- 不抽稀
  75652. var components = geometry.components;
  75653. for(var i = 0; i < components.length; i++){
  75654. var components_i = components[i];
  75655. this.pointToTF(components_i);
  75656. }
  75657. */
  75658. var components = geometry.components;
  75659. //节点像素坐标
  75660. var localLX = [];
  75661. //参考位置,参考中心为
  75662. var refLocal = [];
  75663. var location = this.location;
  75664. var pointList = [];
  75665. //节点抽稀距离
  75666. var nCPx = this.nodesClipPixel;
  75667. for (var i = 0; i < components.length; i++) {
  75668. var components_i = components[i];
  75669. refLocal = [];
  75670. localLX = this.getLocalXY(components_i);
  75671. refLocal[0] = localLX[0] - location[0];
  75672. refLocal[1] = localLX[1] - location[1];
  75673. //抽稀
  75674. if (pointList.length > 0) {
  75675. var lastLocalXY = pointList[pointList.length - 1];
  75676. if (Math.abs(lastLocalXY[0] - refLocal[0]) <= nCPx && Math.abs(lastLocalXY[1] - refLocal[1]) <= nCPx) {
  75677. continue;
  75678. }
  75679. }
  75680. //使用参考点
  75681. pointList.push(refLocal);
  75682. //赋 style
  75683. var style = new Object();
  75684. style.r = 6; //防止漏设此参数,默认 6 像素
  75685. style = Util_Util.copyAttributesWithClip(style, this.style);
  75686. style.x = refLocal[0];
  75687. style.y = refLocal[1];
  75688. //创建图形
  75689. var shape = new SmicPoint({
  75690. style: style,
  75691. clickable: this.isClickAble,
  75692. hoverable: this.isHoverAble
  75693. });
  75694. //设置高亮样式
  75695. if (this.highlightStyle) {
  75696. shape.highlightStyle = this.highlightStyle;
  75697. }
  75698. //设置参考中心,指定图形位置
  75699. shape.refOriginalPosition = location;
  75700. //储存数据 id 属性,用于事件
  75701. shape.refDataID = this.data.id;
  75702. //储存数据 id 属性,用于事件-多图形同时高亮
  75703. shape.isHoverByRefDataID = this.isMultiHover;
  75704. //修改一些 shape 可选属性,通常不需要这么做
  75705. if (this.shapeOptions) {
  75706. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  75707. }
  75708. this.shapes.push(shape);
  75709. }
  75710. }
  75711. /**
  75712. * @function FeatureThemeVector.prototype.multiLineStringToTF
  75713. * @description 转换多线要素。
  75714. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 MultiLineString。
  75715. */
  75716. }, {
  75717. key: "multiLineStringToTF",
  75718. value: function multiLineStringToTF(geometry) {
  75719. var components = geometry.components;
  75720. for (var i = 0; i < components.length; i++) {
  75721. var components_i = components[i];
  75722. this.lineToTF(components_i);
  75723. }
  75724. }
  75725. /**
  75726. * @function FeatureThemeVector.prototype.multiPolygonToTF
  75727. * @description 转换多面要素。
  75728. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 MultiPolygon。
  75729. */
  75730. }, {
  75731. key: "multiPolygonToTF",
  75732. value: function multiPolygonToTF(geometry) {
  75733. var components = geometry.components;
  75734. for (var i = 0; i < components.length; i++) {
  75735. var components_i = components[i];
  75736. this.polygonToTF(components_i);
  75737. }
  75738. }
  75739. /**
  75740. * @function FeatureThemeVector.prototype.pointToTF
  75741. * @description 转换点要素。
  75742. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 Point。
  75743. */
  75744. }, {
  75745. key: "pointToTF",
  75746. value: function pointToTF(geometry) {
  75747. //参考位置,参考中心为
  75748. var location = this.location;
  75749. //geometry 像素坐标
  75750. var localLX = this.getLocalXY(geometry);
  75751. //赋 style
  75752. var style = new Object();
  75753. style.r = 6; //防止漏设此参数,默认 6 像素
  75754. style = Util_Util.copyAttributesWithClip(style, this.style);
  75755. style.x = localLX[0] - location[0];
  75756. style.y = localLX[1] - location[1];
  75757. //创建图形
  75758. var shape = new SmicPoint({
  75759. style: style,
  75760. clickable: this.isClickAble,
  75761. hoverable: this.isHoverAble
  75762. });
  75763. //设置高亮样式
  75764. if (this.highlightStyle) {
  75765. shape.highlightStyle = this.highlightStyle;
  75766. }
  75767. //设置参考中心,指定图形位置
  75768. shape.refOriginalPosition = location;
  75769. //储存数据 id 属性,用于事件
  75770. shape.refDataID = this.data.id;
  75771. //储存数据 id 属性,用于事件-多图形同时高亮
  75772. shape.isHoverByRefDataID = this.isMultiHover;
  75773. //修改一些 shape 可选属性,通常不需要这么做
  75774. if (this.shapeOptions) {
  75775. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  75776. }
  75777. this.shapes.push(shape);
  75778. }
  75779. /**
  75780. * @function FeatureThemeVector.prototype.polygonToThemeFeature
  75781. * @description 转换面要素。
  75782. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 Polygon。
  75783. */
  75784. }, {
  75785. key: "polygonToTF",
  75786. value: function polygonToTF(geometry) {
  75787. var components = geometry.components;
  75788. //节点像素坐标
  75789. var localLX = [];
  75790. //参考位置,参考中心为
  75791. var refLocal = [];
  75792. var location = this.location;
  75793. var pointList = [];
  75794. //岛洞
  75795. var holePolygonPointList = [];
  75796. var holePolygonPointLists = [];
  75797. //节点抽稀距离
  75798. var nCPx = this.nodesClipPixel;
  75799. for (var i = 0; i < components.length; i++) {
  75800. var components_i = components[i].components;
  75801. if (i === 0) {
  75802. // 第一个 component 正常绘制
  75803. pointList = [];
  75804. for (var j = 0; j < components_i.length; j++) {
  75805. refLocal = [];
  75806. localLX = this.getLocalXY(components_i[j]);
  75807. refLocal[0] = localLX[0] - location[0];
  75808. refLocal[1] = localLX[1] - location[1];
  75809. //抽稀 - 2 px
  75810. if (pointList.length > 0) {
  75811. var lastLocalXY = pointList[pointList.length - 1];
  75812. if (Math.abs(lastLocalXY[0] - refLocal[0]) <= nCPx && Math.abs(lastLocalXY[1] - refLocal[1]) <= nCPx) {
  75813. continue;
  75814. }
  75815. }
  75816. //使用参考点
  75817. pointList.push(refLocal);
  75818. }
  75819. } else {
  75820. // 其它 component 作为岛洞
  75821. holePolygonPointList = [];
  75822. for (var k = 0; k < components_i.length; k++) {
  75823. refLocal = [];
  75824. localLX = this.getLocalXY(components_i[k]);
  75825. refLocal[0] = localLX[0] - location[0];
  75826. refLocal[1] = localLX[1] - location[1];
  75827. //抽稀 - 2 px
  75828. if (holePolygonPointList.length > 0) {
  75829. var lastXY = holePolygonPointList[holePolygonPointList.length - 1];
  75830. if (Math.abs(lastXY[0] - refLocal[0]) <= nCPx && Math.abs(lastXY[1] - refLocal[1]) <= nCPx) {
  75831. continue;
  75832. }
  75833. }
  75834. //使用参考点
  75835. holePolygonPointList.push(refLocal);
  75836. }
  75837. }
  75838. if (holePolygonPointList.length < 2) {
  75839. continue;
  75840. }
  75841. holePolygonPointLists.push(holePolygonPointList);
  75842. }
  75843. if (pointList.length < 2) {
  75844. return;
  75845. }
  75846. //赋 style
  75847. var style = {};
  75848. style = Util_Util.copyAttributesWithClip(style, this.style, ['pointList']);
  75849. style.pointList = pointList;
  75850. //创建图形
  75851. var shape = new SmicPolygon({
  75852. style: style,
  75853. clickable: this.isClickAble,
  75854. hoverable: this.isHoverAble
  75855. });
  75856. //设置高亮样式
  75857. if (this.highlightStyle) {
  75858. shape.highlightStyle = this.highlightStyle;
  75859. }
  75860. //设置参考中心,指定图形位置
  75861. shape.refOriginalPosition = this.location;
  75862. //储存数据 id 属性,用于事件
  75863. shape.refDataID = this.data.id;
  75864. //储存数据 id 属性,用于事件-多图形同时高亮
  75865. shape.isHoverByRefDataID = this.isMultiHover;
  75866. //岛洞面
  75867. if (holePolygonPointLists.length > 0) {
  75868. shape.holePolygonPointLists = holePolygonPointLists;
  75869. }
  75870. //修改一些 shape 可选属性,通常不需要这么做
  75871. if (this.shapeOptions) {
  75872. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  75873. }
  75874. this.shapes.push(shape);
  75875. }
  75876. /**
  75877. * @function FeatureThemeVector.prototype.rectangleToTF
  75878. * @description 转换矩形要素。
  75879. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 Rectangle。
  75880. */
  75881. }, {
  75882. key: "rectangleToTF",
  75883. value: function rectangleToTF(geometry) {
  75884. //参考位置,参考中心为
  75885. var location = this.location;
  75886. var ll = new LonLat(geometry.x, geometry.y);
  75887. //地图分辨率
  75888. var res = this.layer.map.getResolution();
  75889. //geometry 像素坐标
  75890. var localLX = this.getLocalXY(ll);
  75891. //赋 style
  75892. var style = new Object();
  75893. style.r = 6; //防止漏设此参数,默认 6 像素
  75894. style = Util_Util.copyAttributesWithClip(style, this.style);
  75895. style.x = localLX[0] - location[0];
  75896. // Rectangle 使用左下角定位, SmicRectangle 使用左上角定位,需要转换
  75897. style.y = localLX[1] - location[1] - 2 * geometry.width / res;
  75898. style.width = geometry.width / res;
  75899. style.height = geometry.height / res;
  75900. //创建图形
  75901. var shape = new SmicRectangle({
  75902. style: style,
  75903. clickable: this.isClickAble,
  75904. hoverable: this.isHoverAble
  75905. });
  75906. //设置高亮样式
  75907. if (this.highlightStyle) {
  75908. shape.highlightStyle = this.highlightStyle;
  75909. }
  75910. //设置参考中心,指定图形位置
  75911. shape.refOriginalPosition = location;
  75912. //储存数据 id 属性,用于事件
  75913. shape.refDataID = this.data.id;
  75914. //储存数据 id 属性,用于事件-多图形同时高亮
  75915. shape.isHoverByRefDataID = this.isMultiHover;
  75916. //修改一些 shape 可选属性,通常不需要这么做
  75917. if (this.shapeOptions) {
  75918. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  75919. }
  75920. this.shapes.push(shape);
  75921. }
  75922. /**
  75923. * @function FeatureThemeVector.prototype.geoTextToTF
  75924. * @description 转换文本要素。
  75925. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 GeoText。
  75926. */
  75927. }, {
  75928. key: "geoTextToTF",
  75929. value: function geoTextToTF(geometry) {
  75930. //参考位置,参考中心为
  75931. var location = this.location;
  75932. //geometry 像素坐标
  75933. var localLX = this.getLocalXY(geometry);
  75934. //赋 style
  75935. var style = new Object();
  75936. style.r = 6; //防止漏设此参数,默认 6 像素
  75937. style = Util_Util.copyAttributesWithClip(style, this.style, ["x", "y", "text"]);
  75938. style.x = localLX[0] - location[0];
  75939. style.y = localLX[1] - location[1];
  75940. style.text = geometry.text;
  75941. //创建图形
  75942. var shape = new SmicText({
  75943. style: style,
  75944. clickable: this.isClickAble,
  75945. hoverable: this.isHoverAble
  75946. });
  75947. //设置高亮样式
  75948. if (this.highlightStyle) {
  75949. shape.highlightStyle = this.highlightStyle;
  75950. }
  75951. //设置参考中心,指定图形位置
  75952. shape.refOriginalPosition = location;
  75953. //储存数据 id 属性,用于事件
  75954. shape.refDataID = this.data.id;
  75955. //储存数据 id 属性,用于事件-多图形同时高亮
  75956. shape.isHoverByRefDataID = this.isMultiHover;
  75957. //修改一些 shape 可选属性,通常不需要这么做
  75958. if (this.shapeOptions) {
  75959. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  75960. }
  75961. this.shapes.push(shape);
  75962. }
  75963. /**
  75964. * @function FeatureThemeVector.prototype.updateAndAddShapes
  75965. * @description 修改位置,针对地图平移操作,地图漫游操作后调用此函数。
  75966. */
  75967. }, {
  75968. key: "updateAndAddShapes",
  75969. value: function updateAndAddShapes() {
  75970. var newLocalLX = this.getLocalXY(this.lonlat);
  75971. this.location = newLocalLX;
  75972. var render = this.layer.renderer;
  75973. for (var i = 0, len = this.shapes.length; i < len; i++) {
  75974. var shape = this.shapes[i];
  75975. //设置参考中心,指定图形位置
  75976. shape.refOriginalPosition = newLocalLX;
  75977. render.addShape(shape);
  75978. }
  75979. }
  75980. /**
  75981. * @function FeatureThemeVector.prototype.getShapesCount
  75982. * @description 获得专题要素中可视化图形的数量。
  75983. * @returns {number} 可视化图形的数量。
  75984. */
  75985. }, {
  75986. key: "getShapesCount",
  75987. value: function getShapesCount() {
  75988. return this.shapes.length;
  75989. }
  75990. /**
  75991. * @function FeatureThemeVector.prototype.getLocalXY
  75992. * @description 地理坐标转为像素坐标。
  75993. * @param {LonLat} lonlat - 专题要素地理位置。
  75994. */
  75995. }, {
  75996. key: "getLocalXY",
  75997. value: function getLocalXY(lonlat) {
  75998. return this.layer.getLocalXY(lonlat);
  75999. }
  76000. }]);
  76001. return ThemeVector;
  76002. }(Theme_Theme);
  76003. ;// CONCATENATED MODULE: ./src/common/overlay/feature/index.js
  76004. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  76005. * This program are made available under the terms of the Apache License, Version 2.0
  76006. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  76007. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Group.js
  76008. function Group_typeof(obj) { "@babel/helpers - typeof"; return Group_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Group_typeof(obj); }
  76009. function Group_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  76010. function Group_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  76011. function Group_createClass(Constructor, protoProps, staticProps) { if (protoProps) Group_defineProperties(Constructor.prototype, protoProps); if (staticProps) Group_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  76012. function Group_get() { if (typeof Reflect !== "undefined" && Reflect.get) { Group_get = Reflect.get.bind(); } else { Group_get = function _get(target, property, receiver) { var base = Group_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return Group_get.apply(this, arguments); }
  76013. function Group_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Group_getPrototypeOf(object); if (object === null) break; } return object; }
  76014. function Group_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Group_setPrototypeOf(subClass, superClass); }
  76015. function Group_setPrototypeOf(o, p) { Group_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Group_setPrototypeOf(o, p); }
  76016. function Group_createSuper(Derived) { var hasNativeReflectConstruct = Group_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Group_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Group_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Group_possibleConstructorReturn(this, result); }; }
  76017. function Group_possibleConstructorReturn(self, call) { if (call && (Group_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Group_assertThisInitialized(self); }
  76018. function Group_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  76019. function Group_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  76020. function Group_getPrototypeOf(o) { Group_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Group_getPrototypeOf(o); }
  76021. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  76022. * This program are made available under the terms of the Apache License, Version 2.0
  76023. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  76024. /**
  76025. * @class LevelRenderer.Group
  76026. * @category Visualization Theme
  76027. * @private
  76028. * @classdesc Group 是一个容器,可以插入子节点,Group 的变换也会被应用到子节点上。
  76029. * @extends {LevelRenderer.Transformable}
  76030. * (code)
  76031. * var g = new LevelRenderer.Group();
  76032. * var Circle = new LevelRenderer.Shape.Circle();
  76033. * g.position[0] = 100;
  76034. * g.position[1] = 100;
  76035. * g.addChild(new Circle({
  76036. * style: {
  76037. * x: 100,
  76038. * y: 100,
  76039. * r: 20,
  76040. * brushType: 'fill'
  76041. * }
  76042. * }));
  76043. * LR.addGroup(g);
  76044. * (end)
  76045. * @param {Array} options - Group 的配置(options)项,可以是 Group 的自有属性,也可以是自定义的属性。
  76046. */
  76047. var Group = /*#__PURE__*/function (_mixin) {
  76048. Group_inherits(Group, _mixin);
  76049. var _super = Group_createSuper(Group);
  76050. function Group(options) {
  76051. var _this;
  76052. Group_classCallCheck(this, Group);
  76053. _this = _super.call(this, options);
  76054. options = options || {};
  76055. /**
  76056. * @member {string} LevelRenderer.Group.prototype.id
  76057. * @description Group 的唯一标识。
  76058. */
  76059. _this.id = null;
  76060. /**
  76061. * @readonly
  76062. * @member {string} [LevelRenderer.Group.prototype.type='group']
  76063. * @description 类型。
  76064. */
  76065. _this.type = 'group';
  76066. //http://www.w3.org/TR/2dcontext/#clipping-region
  76067. /**
  76068. * @member {string} LevelRenderer.Group.prototype.clipShape
  76069. * @description 用于裁剪的图形(shape),所有 Group 内的图形在绘制时都会被这个图形裁剪,该图形会继承 Group 的变换。
  76070. */
  76071. _this.clipShape = null;
  76072. /**
  76073. * @member {Array} LevelRenderer.Group.prototype._children
  76074. * @description _children。
  76075. */
  76076. _this._children = [];
  76077. /**
  76078. * @member {Array} LevelRenderer.Group.prototype._storage
  76079. * @description _storage。
  76080. */
  76081. _this._storage = null;
  76082. /**
  76083. * @member {boolean} [LevelRenderer.Group.prototype.__dirty=true]
  76084. * @description __dirty。
  76085. */
  76086. _this.__dirty = true;
  76087. /**
  76088. * @member {boolean} [LevelRenderer.Group.prototype.ignore=false]
  76089. * @description 是否忽略该 Group 及其所有子节点。
  76090. */
  76091. _this.ignore = false;
  76092. Util_Util.extend(Group_assertThisInitialized(_this), options);
  76093. _this.id = _this.id || Util_Util.createUniqueID("smShapeGroup_");
  76094. _this.CLASS_NAME = "SuperMap.LevelRenderer.Group";
  76095. return _this;
  76096. }
  76097. /**
  76098. * @function LevelRenderer.Group.prototype.destroy
  76099. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  76100. */
  76101. Group_createClass(Group, [{
  76102. key: "destroy",
  76103. value: function destroy() {
  76104. this.id = null;
  76105. this.type = null;
  76106. this.clipShape = null;
  76107. this._children = null;
  76108. this._storage = null;
  76109. this.__dirty = null;
  76110. this.ignore = null;
  76111. Group_get(Group_getPrototypeOf(Group.prototype), "destroy", this).call(this);
  76112. }
  76113. /**
  76114. * @function LevelRenderer.Group.prototype.children
  76115. * @description 复制并返回一份新的包含所有儿子节点的数组。
  76116. * @returns {Array.<LevelRenderer.Shape>} 图形数组。
  76117. */
  76118. }, {
  76119. key: "children",
  76120. value: function children() {
  76121. return this._children.slice();
  76122. }
  76123. /**
  76124. * @function LevelRenderer.Group.prototype.childAt
  76125. * @description 获取指定 index 的儿子节点
  76126. * @param {number} idx - 节点索引。
  76127. * @returns {LevelRenderer.Shape} 图形。
  76128. */
  76129. }, {
  76130. key: "childAt",
  76131. value: function childAt(idx) {
  76132. return this._children[idx];
  76133. }
  76134. /**
  76135. * @function LevelRenderer.Group.prototype.addChild
  76136. * @description 添加子节点,可以是 Shape 或者 Group。
  76137. * @param {(LevelRenderer.Shape|LevelRenderer.Group)} child - 节点图形。
  76138. */
  76139. // TODO Type Check
  76140. }, {
  76141. key: "addChild",
  76142. value: function addChild(child) {
  76143. if (child == this) {
  76144. return;
  76145. }
  76146. if (child.parent == this) {
  76147. return;
  76148. }
  76149. if (child.parent) {
  76150. child.parent.removeChild(child);
  76151. }
  76152. this._children.push(child);
  76153. child.parent = this;
  76154. if (this._storage && this._storage !== child._storage) {
  76155. this._storage.addToMap(child);
  76156. if (child instanceof Group) {
  76157. child.addChildrenToStorage(this._storage);
  76158. }
  76159. }
  76160. }
  76161. /**
  76162. * @function LevelRenderer.Group.prototype.removeChild
  76163. * @description 移除子节点。
  76164. * @param {LevelRenderer.Shape} child - 需要移除的子节点图形。
  76165. */
  76166. }, {
  76167. key: "removeChild",
  76168. value: function removeChild(child) {
  76169. var idx = Util_Util.indexOf(this._children, child);
  76170. this._children.splice(idx, 1);
  76171. child.parent = null;
  76172. if (this._storage) {
  76173. this._storage.delFromMap(child.id);
  76174. if (child instanceof Group) {
  76175. child.delChildrenFromStorage(this._storage);
  76176. }
  76177. }
  76178. }
  76179. /**
  76180. * @function LevelRenderer.Group.prototype.eachChild
  76181. * @description 遍历所有子节点。
  76182. * @param {function} cb - 回调函数。
  76183. * @param {Object} context - 上下文。
  76184. */
  76185. }, {
  76186. key: "eachChild",
  76187. value: function eachChild(cb, context) {
  76188. var haveContext = !!context;
  76189. for (var i = 0; i < this._children.length; i++) {
  76190. var child = this._children[i];
  76191. if (haveContext) {
  76192. cb.call(context, child);
  76193. } else {
  76194. cb(child);
  76195. }
  76196. }
  76197. }
  76198. /**
  76199. * @function LevelRenderer.Group.prototype.traverse
  76200. * @description 深度优先遍历所有子孙节点。
  76201. * @param {function} cb - 回调函数。
  76202. * @param {Object} context - 上下文。
  76203. */
  76204. }, {
  76205. key: "traverse",
  76206. value: function traverse(cb, context) {
  76207. var haveContext = !!context;
  76208. for (var i = 0; i < this._children.length; i++) {
  76209. var child = this._children[i];
  76210. if (haveContext) {
  76211. cb.call(context, child);
  76212. } else {
  76213. cb(child);
  76214. }
  76215. if (child.type === 'group') {
  76216. child.traverse(cb, context);
  76217. }
  76218. }
  76219. }
  76220. /**
  76221. * @function LevelRenderer.Group.prototype.addChildrenToStorage
  76222. * @description 把子图形添加到仓库。
  76223. * @param {LevelRenderer.Storage} storage - 图形仓库。
  76224. */
  76225. }, {
  76226. key: "addChildrenToStorage",
  76227. value: function addChildrenToStorage(storage) {
  76228. for (var i = 0; i < this._children.length; i++) {
  76229. var child = this._children[i];
  76230. storage.addToMap(child);
  76231. if (child.type === 'group') {
  76232. child.addChildrenToStorage(storage);
  76233. }
  76234. }
  76235. }
  76236. /**
  76237. * @function LevelRenderer.Group.prototype.delChildrenFromStorage
  76238. * @description 从仓库把子图形删除。
  76239. * @param {LevelRenderer.Storage} storage - 图形仓库。
  76240. */
  76241. }, {
  76242. key: "delChildrenFromStorage",
  76243. value: function delChildrenFromStorage(storage) {
  76244. for (var i = 0; i < this._children.length; i++) {
  76245. var child = this._children[i];
  76246. storage.delFromMap(child.id);
  76247. if (child.type === 'group') {
  76248. child.delChildrenFromStorage(storage);
  76249. }
  76250. }
  76251. }
  76252. /**
  76253. * @function LevelRenderer.Group.prototype.modSelf
  76254. * @description 是否修改。
  76255. */
  76256. }, {
  76257. key: "modSelf",
  76258. value: function modSelf() {
  76259. this.__dirty = true;
  76260. }
  76261. }]);
  76262. return Group;
  76263. }(mixinExt(Eventful, Transformable));
  76264. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Storage.js
  76265. function Storage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  76266. function Storage_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  76267. function Storage_createClass(Constructor, protoProps, staticProps) { if (protoProps) Storage_defineProperties(Constructor.prototype, protoProps); if (staticProps) Storage_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  76268. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  76269. * This program are made available under the terms of the Apache License, Version 2.0
  76270. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  76271. /**
  76272. * @private
  76273. * @class LevelRenderer.Storage
  76274. * @category Visualization Theme
  76275. * @classdesc 内容(图像)仓库 (M) 。
  76276. */
  76277. var Storage = /*#__PURE__*/function () {
  76278. function Storage() {
  76279. Storage_classCallCheck(this, Storage);
  76280. /**
  76281. * @member {Object} LevelRenderer.Storage.prototype._elements
  76282. * @description 所有常规形状,id 索引的 map。
  76283. */
  76284. this._elements = {};
  76285. /**
  76286. * @member {Array} LevelRenderer.Storage.prototype._hoverElements
  76287. * @description 高亮层形状,不稳定,动态增删,数组位置也是 z 轴方向,靠前显示在下方。
  76288. *
  76289. */
  76290. this._hoverElements = [];
  76291. /**
  76292. * @member {Array} LevelRenderer.Storage.prototype._roots
  76293. * @description _roots。
  76294. *
  76295. */
  76296. this._roots = [];
  76297. /**
  76298. * @member {Array} LevelRenderer.Storage.prototype._shapeList
  76299. * @description _shapeList。
  76300. *
  76301. */
  76302. this._shapeList = [];
  76303. /**
  76304. * @member {number} LevelRenderer.Storage.prototype._shapeListOffset
  76305. * @description _shapeListOffset。默认值:0。
  76306. *
  76307. */
  76308. this._shapeListOffset = 0;
  76309. this.CLASS_NAME = "SuperMap.LevelRenderer.Storage";
  76310. }
  76311. /**
  76312. * @function LevelRenderer.Storage.prototype.destroy
  76313. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  76314. */
  76315. Storage_createClass(Storage, [{
  76316. key: "destroy",
  76317. value: function destroy() {
  76318. this.dispose();
  76319. this._shapeList = null;
  76320. this._shapeListOffset = null;
  76321. }
  76322. /**
  76323. * @function LevelRenderer.Storage.prototype.iterShape
  76324. * @description 遍历迭代器。
  76325. *
  76326. * @param {function} fun - 迭代回调函数,return true终止迭代。
  76327. * @param {Object} option - 迭代参数,缺省为仅降序遍历普通层图形。
  76328. * @param {boolean} [hover=true] - 是否是高亮层图形。
  76329. * @param {string} [normal='down'] - 是否是普通层图形,迭代时是否指定及z轴顺序。可设值:'down' ,'up'。
  76330. * @param {boolean} [update=false] - 是否在迭代前更新形状列表。
  76331. * @return {LevelRenderer.Storage} this。
  76332. */
  76333. }, {
  76334. key: "iterShape",
  76335. value: function iterShape(fun, option) {
  76336. if (!option) {
  76337. var defaultIterateOption = {
  76338. hover: false,
  76339. normal: 'down',
  76340. update: false
  76341. };
  76342. option = defaultIterateOption;
  76343. }
  76344. if (option.hover) {
  76345. // 高亮层数据遍历
  76346. for (var i = 0, l = this._hoverElements.length; i < l; i++) {
  76347. var el = this._hoverElements[i];
  76348. el.updateTransform();
  76349. if (fun(el)) {
  76350. return this;
  76351. }
  76352. }
  76353. }
  76354. if (option.update) {
  76355. this.updateShapeList();
  76356. }
  76357. // 遍历: 'down' | 'up'
  76358. switch (option.normal) {
  76359. case 'down':
  76360. {
  76361. // 降序遍历,高层优先
  76362. var _l = this._shapeList.length;
  76363. while (_l--) {
  76364. if (fun(this._shapeList[_l])) {
  76365. return this;
  76366. }
  76367. }
  76368. break;
  76369. }
  76370. // case 'up':
  76371. default:
  76372. {
  76373. // 升序遍历,底层优先
  76374. for (var _i2 = 0, _l3 = this._shapeList.length; _i2 < _l3; _i2++) {
  76375. if (fun(this._shapeList[_i2])) {
  76376. return this;
  76377. }
  76378. }
  76379. break;
  76380. }
  76381. }
  76382. return this;
  76383. }
  76384. /**
  76385. * @function LevelRenderer.Storage.prototype.getHoverShapes
  76386. * @param {boolean} [update=false] - 是否在返回前更新图形的变换。
  76387. * @return {Array.<LevelRenderer.Shape>} 图形数组。
  76388. */
  76389. }, {
  76390. key: "getHoverShapes",
  76391. value: function getHoverShapes(update) {
  76392. // hoverConnect
  76393. var hoverElements = [],
  76394. len = this._hoverElements.length;
  76395. for (var i = 0; i < len; i++) {
  76396. hoverElements.push(this._hoverElements[i]);
  76397. var target = this._hoverElements[i].hoverConnect;
  76398. if (target) {
  76399. var shape;
  76400. target = target instanceof Array ? target : [target];
  76401. for (var j = 0, k = target.length; j < k; j++) {
  76402. shape = target[j].id ? target[j] : this.get(target[j]);
  76403. if (shape) {
  76404. hoverElements.push(shape);
  76405. }
  76406. }
  76407. }
  76408. }
  76409. hoverElements.sort(Storage.shapeCompareFunc);
  76410. if (update) {
  76411. for (var _i4 = 0, l = hoverElements.length; _i4 < l; _i4++) {
  76412. hoverElements[_i4].updateTransform();
  76413. }
  76414. }
  76415. return hoverElements;
  76416. }
  76417. /**
  76418. * @function LevelRenderer.Storage.prototype.getShapeList
  76419. * @description 返回所有图形的绘制队列。
  76420. *
  76421. * @param {boolean} [update=false] - 是否在返回前更新该数组。详见:<LevelRenderer.Shape> updateShapeList。
  76422. * @return {LevelRenderer.Shape} 图形。
  76423. */
  76424. }, {
  76425. key: "getShapeList",
  76426. value: function getShapeList(update) {
  76427. if (update) {
  76428. this.updateShapeList();
  76429. }
  76430. return this._shapeList;
  76431. }
  76432. /**
  76433. * @function LevelRenderer.Storage.prototype.updateShapeList
  76434. * @description 更新图形的绘制队列。每次绘制前都会调用,该方法会先深度优先遍历整个树,更新所有Group和Shape的变换并且把所有可见的Shape保存到数组中,最后根据绘制的优先级(zlevel > z > 插入顺序)排序得到绘制队列。
  76435. */
  76436. }, {
  76437. key: "updateShapeList",
  76438. value: function updateShapeList() {
  76439. this._shapeListOffset = 0;
  76440. var rootsLen = this._roots.length;
  76441. for (var i = 0; i < rootsLen; i++) {
  76442. var root = this._roots[i];
  76443. this._updateAndAddShape(root);
  76444. }
  76445. this._shapeList.length = this._shapeListOffset;
  76446. var shapeListLen = this._shapeList.length;
  76447. for (var _i6 = 0; _i6 < shapeListLen; _i6++) {
  76448. this._shapeList[_i6].__renderidx = _i6;
  76449. }
  76450. this._shapeList.sort(Storage.shapeCompareFunc);
  76451. }
  76452. /**
  76453. * @function LevelRenderer.Storage.prototype._updateAndAddShape
  76454. * @description 更新并添加图形。
  76455. *
  76456. */
  76457. }, {
  76458. key: "_updateAndAddShape",
  76459. value: function _updateAndAddShape(el, clipShapes) {
  76460. if (el.ignore) {
  76461. return;
  76462. }
  76463. el.updateTransform();
  76464. if (el.type == 'group') {
  76465. if (el.clipShape) {
  76466. // clipShape 的变换是基于 group 的变换
  76467. el.clipShape.parent = el;
  76468. el.clipShape.updateTransform();
  76469. // PENDING 效率影响
  76470. if (clipShapes) {
  76471. clipShapes = clipShapes.slice();
  76472. clipShapes.push(el.clipShape);
  76473. } else {
  76474. clipShapes = [el.clipShape];
  76475. }
  76476. }
  76477. for (var i = 0; i < el._children.length; i++) {
  76478. var child = el._children[i];
  76479. // Force to mark as dirty if group is dirty
  76480. child.__dirty = el.__dirty || child.__dirty;
  76481. this._updateAndAddShape(child, clipShapes);
  76482. }
  76483. // Mark group clean here
  76484. el.__dirty = false;
  76485. } else {
  76486. el.__clipShapes = clipShapes;
  76487. this._shapeList[this._shapeListOffset++] = el;
  76488. }
  76489. }
  76490. /**
  76491. * @function LevelRenderer.Storage.prototype.mod
  76492. * @description 修改图形(Shape)或者组(Group)。
  76493. *
  76494. * @param {string} elId - 唯一标识。
  76495. * @param {Object} params - 参数。
  76496. * @return {LevelRenderer.Storage} this。
  76497. */
  76498. }, {
  76499. key: "mod",
  76500. value: function mod(elId, params) {
  76501. var el = this._elements[elId];
  76502. if (el) {
  76503. el.modSelf();
  76504. if (params) {
  76505. // 如果第二个参数直接使用 shape
  76506. // parent, _storage, __startClip 三个属性会有循环引用
  76507. // 主要为了向 1.x 版本兼容,2.x 版本不建议使用第二个参数
  76508. if (params.parent || params._storage || params.__startClip) {
  76509. var target = {};
  76510. for (var name in params) {
  76511. if (name == 'parent' || name == '_storage' || name == '__startClip') {
  76512. continue;
  76513. }
  76514. if (params.hasOwnProperty(name)) {
  76515. target[name] = params[name];
  76516. }
  76517. }
  76518. new levelRenderer_Util_Util().merge(el, target, true);
  76519. } else {
  76520. new levelRenderer_Util_Util().merge(el, params, true);
  76521. }
  76522. }
  76523. }
  76524. return this;
  76525. }
  76526. /**
  76527. * @function LevelRenderer.Storage.prototype.drift
  76528. * @description 移动指定的图形(Shape)的位置。
  76529. * @param {string} shapeId - 唯一标识。
  76530. * @param {number} dx
  76531. * @param {number} dy
  76532. * @return {LevelRenderer.Storage} this。
  76533. */
  76534. }, {
  76535. key: "drift",
  76536. value: function drift(shapeId, dx, dy) {
  76537. var shape = this._elements[shapeId];
  76538. if (shape) {
  76539. shape.needTransform = true;
  76540. if (shape.draggable === 'horizontal') {
  76541. dy = 0;
  76542. } else if (shape.draggable === 'vertical') {
  76543. dx = 0;
  76544. }
  76545. if (!shape.ondrift // ondrift
  76546. // 有onbrush并且调用执行返回false或undefined则继续
  76547. || shape.ondrift && !shape.ondrift(dx, dy)) {
  76548. shape.drift(dx, dy);
  76549. }
  76550. }
  76551. return this;
  76552. }
  76553. /**
  76554. * @function LevelRenderer.Storage.prototype.addHover
  76555. * @description 添加高亮层数据。
  76556. * @param {LevelRenderer.Shape} shape - 图形。
  76557. * @return {LevelRenderer.Storage} this。
  76558. */
  76559. }, {
  76560. key: "addHover",
  76561. value: function addHover(shape) {
  76562. shape.updateNeedTransform();
  76563. this._hoverElements.push(shape);
  76564. return this;
  76565. }
  76566. /**
  76567. * @function LevelRenderer.Storage.prototype.delHover
  76568. * @description 清空高亮层数据。
  76569. * @return {LevelRenderer.Storage} this。
  76570. */
  76571. }, {
  76572. key: "delHover",
  76573. value: function delHover() {
  76574. this._hoverElements = [];
  76575. return this;
  76576. }
  76577. /**
  76578. * @function LevelRenderer.Storage.prototype.hasHoverShape
  76579. * @description 是否有图形在高亮层里。
  76580. * @return {boolean} 是否有图形在高亮层里。
  76581. */
  76582. }, {
  76583. key: "hasHoverShape",
  76584. value: function hasHoverShape() {
  76585. return this._hoverElements.length > 0;
  76586. }
  76587. /**
  76588. * @function LevelRenderer.Storage.prototype.addRoot
  76589. * @description 添加图形(Shape)或者组(Group)到根节点。
  76590. *
  76591. * @param {(LevelRenderer.Shape/LevelRenderer.Group)} el - 图形。
  76592. *
  76593. */
  76594. }, {
  76595. key: "addRoot",
  76596. value: function addRoot(el) {
  76597. if (el instanceof Group) {
  76598. el.addChildrenToStorage(this);
  76599. }
  76600. this.addToMap(el);
  76601. this._roots.push(el);
  76602. }
  76603. /**
  76604. * @function LevelRenderer.Storage.prototype.delRoot
  76605. * @description 删除指定的图形(Shape)或者组(Group)。
  76606. *
  76607. * @param {Array.<string>} elId - 删除图形(Shape)或者组(Group)的 ID 数组。如果为空清空整个Storage。
  76608. *
  76609. */
  76610. }, {
  76611. key: "delRoot",
  76612. value: function delRoot(elId) {
  76613. if (typeof elId == 'undefined') {
  76614. // 不指定elId清空
  76615. for (var i = 0; i < this._roots.length; i++) {
  76616. var root = this._roots[i];
  76617. if (root instanceof Group) {
  76618. root.delChildrenFromStorage(this);
  76619. }
  76620. }
  76621. this._elements = {};
  76622. this._hoverElements = [];
  76623. this._roots = [];
  76624. return;
  76625. }
  76626. if (elId instanceof Array) {
  76627. var elIdLen = elId.length;
  76628. for (var _i8 = 0; _i8 < elIdLen; _i8++) {
  76629. this.delRoot(elId[_i8]);
  76630. }
  76631. return;
  76632. }
  76633. var el;
  76634. if (typeof elId == 'string') {
  76635. el = this._elements[elId];
  76636. } else {
  76637. el = elId;
  76638. }
  76639. var idx = new levelRenderer_Util_Util().indexOf(this._roots, el);
  76640. if (idx >= 0) {
  76641. this.delFromMap(el.id);
  76642. this._roots.splice(idx, 1);
  76643. if (el instanceof Group) {
  76644. el.delChildrenFromStorage(this);
  76645. }
  76646. }
  76647. }
  76648. /**
  76649. * @function LevelRenderer.Storage.prototype.addToMap
  76650. * @description 添加图形到 map。
  76651. *
  76652. * @param {LevelRenderer.Shape} el - 图形。
  76653. * @return {LevelRenderer.Storage} this。
  76654. */
  76655. }, {
  76656. key: "addToMap",
  76657. value: function addToMap(el) {
  76658. if (el instanceof Group) {
  76659. el._storage = this;
  76660. }
  76661. el.modSelf();
  76662. this._elements[el.id] = el;
  76663. return this;
  76664. }
  76665. /**
  76666. * @function LevelRenderer.Storage.prototype.get
  76667. * @description 获取指定图形。
  76668. *
  76669. * @param {string} elId - 图形 id。
  76670. * @return {LevelRenderer.Shape} 图形。
  76671. */
  76672. }, {
  76673. key: "get",
  76674. value: function get(elId) {
  76675. return this._elements[elId];
  76676. }
  76677. /**
  76678. * @function LevelRenderer.Storage.prototype.delFromMap
  76679. * @description 从 map 中删除指定图形。
  76680. *
  76681. * @param {string} elId - 图形id。
  76682. * @return {LevelRenderer.Storage} this。
  76683. */
  76684. }, {
  76685. key: "delFromMap",
  76686. value: function delFromMap(elId) {
  76687. var el = this._elements[elId];
  76688. if (el) {
  76689. delete this._elements[elId];
  76690. if (el instanceof Group) {
  76691. el._storage = null;
  76692. }
  76693. }
  76694. return this;
  76695. }
  76696. /**
  76697. * @function LevelRenderer.Storage.prototype.dispose
  76698. * @description 清空并且释放 Storage。
  76699. */
  76700. }, {
  76701. key: "dispose",
  76702. value: function dispose() {
  76703. this._elements = null;
  76704. // this._renderList = null;
  76705. this._roots = null;
  76706. this._hoverElements = null;
  76707. }
  76708. }], [{
  76709. key: "shapeCompareFunc",
  76710. value: function shapeCompareFunc(a, b) {
  76711. if (a.zlevel == b.zlevel) {
  76712. if (a.z == b.z) {
  76713. return a.__renderidx - b.__renderidx;
  76714. }
  76715. return a.z - b.z;
  76716. }
  76717. return a.zlevel - b.zlevel;
  76718. }
  76719. }]);
  76720. return Storage;
  76721. }();
  76722. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Painter.js
  76723. function Painter_typeof(obj) { "@babel/helpers - typeof"; return Painter_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Painter_typeof(obj); }
  76724. function Painter_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Painter_setPrototypeOf(subClass, superClass); }
  76725. function Painter_setPrototypeOf(o, p) { Painter_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Painter_setPrototypeOf(o, p); }
  76726. function Painter_createSuper(Derived) { var hasNativeReflectConstruct = Painter_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Painter_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Painter_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Painter_possibleConstructorReturn(this, result); }; }
  76727. function Painter_possibleConstructorReturn(self, call) { if (call && (Painter_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Painter_assertThisInitialized(self); }
  76728. function Painter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  76729. function Painter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  76730. function Painter_getPrototypeOf(o) { Painter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Painter_getPrototypeOf(o); }
  76731. function Painter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  76732. function Painter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  76733. function Painter_createClass(Constructor, protoProps, staticProps) { if (protoProps) Painter_defineProperties(Constructor.prototype, protoProps); if (staticProps) Painter_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  76734. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  76735. * This program are made available under the terms of the Apache License, Version 2.0
  76736. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  76737. /**
  76738. * @private
  76739. * @class LevelRenderer.Painter
  76740. * @category Visualization Theme
  76741. * @classdesc Painter 绘图模块。
  76742. * @param {HTMLElement} root - 绘图区域(DIV)。
  76743. * @param {LevelRenderer.Storage} storage - Storage 实例。
  76744. */
  76745. var Painter = /*#__PURE__*/function () {
  76746. function Painter(root, storage) {
  76747. Painter_classCallCheck(this, Painter);
  76748. /**
  76749. * @member {HTMLElement} LevelRenderer.Painter.prototype.root
  76750. * @description 绘图容器。
  76751. *
  76752. */
  76753. this.root = root;
  76754. /**
  76755. * @member {Array} LevelRenderer.Painter.prototype.storage
  76756. * @description 图形仓库。
  76757. *
  76758. */
  76759. this.storage = storage;
  76760. /**
  76761. * @member {HTMLElement} LevelRenderer.Painter.prototype._domRoot
  76762. * @description 容器根 dom 对象。
  76763. *
  76764. */
  76765. this._domRoot = null;
  76766. /**
  76767. * @member {Object} LevelRenderer.Painter.prototype._layers
  76768. * @description 绘制层对象。
  76769. *
  76770. */
  76771. this._layers = {};
  76772. /**
  76773. * @member {Array} LevelRenderer.Painter.prototype._zlevelList
  76774. * @description 层列表。
  76775. *
  76776. */
  76777. this._zlevelList = [];
  76778. /**
  76779. * @member {Object} LevelRenderer.Painter.prototype._layerConfig
  76780. * @description 绘制层配置对象。
  76781. *
  76782. */
  76783. this._layerConfig = {};
  76784. /**
  76785. * @member {Object} LevelRenderer.Painter.prototype._bgDom
  76786. * @description 背景层 Canvas (Dom)。
  76787. *
  76788. */
  76789. this._bgDom = null;
  76790. /**
  76791. * @member {function} LevelRenderer.Painter.prototype.shapeToImage
  76792. * @description 形状转图像函数。
  76793. *
  76794. */
  76795. this.shapeToImage = null;
  76796. // retina 屏幕优化
  76797. Painter.devicePixelRatio = Math.max(window.devicePixelRatio || 1, 1);
  76798. this.CLASS_NAME = "SuperMap.LevelRenderer.Painter";
  76799. this.root.innerHTML = '';
  76800. this._width = this._getWidth(); // 宽,缓存记录
  76801. this._height = this._getHeight(); // 高,缓存记录
  76802. var domRoot = document.createElement('div');
  76803. this._domRoot = domRoot;
  76804. // domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬
  76805. domRoot.style.position = 'relative';
  76806. domRoot.style.overflow = 'hidden';
  76807. domRoot.style.width = this._width + 'px';
  76808. domRoot.style.height = this._height + 'px';
  76809. this.root.appendChild(domRoot);
  76810. this.shapeToImage = this._createShapeToImageProcessor();
  76811. // 创建各层canvas
  76812. // 背景
  76813. //this._bgDom = Painter.createDom('bg', 'div', this);
  76814. this._bgDom = Painter.createDom(Util_Util.createUniqueID("SuperMap.Theme_background_"), 'div', this);
  76815. domRoot.appendChild(this._bgDom);
  76816. this._bgDom.onselectstart = returnFalse;
  76817. this._bgDom.style['-webkit-user-select'] = 'none';
  76818. this._bgDom.style['user-select'] = 'none';
  76819. this._bgDom.style['-webkit-touch-callout'] = 'none';
  76820. // 高亮
  76821. //var hoverLayer = new PaintLayer('_hoverLayer_', this);
  76822. var hoverLayer = new PaintLayer(Util_Util.createUniqueID("_highLightLayer_"), this);
  76823. this._layers['hover'] = hoverLayer;
  76824. domRoot.appendChild(hoverLayer.dom);
  76825. hoverLayer.initContext();
  76826. hoverLayer.dom.onselectstart = returnFalse;
  76827. hoverLayer.dom.style['-webkit-user-select'] = 'none';
  76828. hoverLayer.dom.style['user-select'] = 'none';
  76829. hoverLayer.dom.style['-webkit-touch-callout'] = 'none';
  76830. var me = this;
  76831. this.updatePainter = function (shapeList, callback) {
  76832. me.refreshShapes(shapeList, callback);
  76833. };
  76834. // 返回false的方法,用于避免页面被选中
  76835. function returnFalse() {
  76836. return false;
  76837. }
  76838. /* eslint-disable */
  76839. // 什么都不干的空方法
  76840. function doNothing() {//NOSONAR
  76841. }
  76842. /* eslint-enable */
  76843. }
  76844. /**
  76845. * @function LevelRenderer.Painter.prototype.destroy
  76846. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  76847. */
  76848. Painter_createClass(Painter, [{
  76849. key: "destroy",
  76850. value: function destroy() {
  76851. this.dispose();
  76852. this._zlevelList = null;
  76853. this._layerConfig = null;
  76854. this._bgDom = null;
  76855. this.shapeToImage = null;
  76856. }
  76857. /**
  76858. * @function LevelRenderer.Painter.prototype.render
  76859. * @description 渲染。首次绘图,创建各种 dom 和 context。
  76860. *
  76861. * @param {function} callback - 绘画结束后的回调函数。
  76862. * @return {LevelRenderer.Painter} this。
  76863. */
  76864. }, {
  76865. key: "render",
  76866. value: function render(callback) {
  76867. // TODO
  76868. this.refresh(callback, true);
  76869. return this;
  76870. }
  76871. /**
  76872. * @function LevelRenderer.Painter.prototype.refresh
  76873. * @description 刷新。
  76874. *
  76875. * @param {function} callback - 刷新结束后的回调函数。
  76876. * @param {boolean} paintAll - 强制绘制所有 shape。
  76877. * @return {LevelRenderer.Painter} this。
  76878. */
  76879. }, {
  76880. key: "refresh",
  76881. value: function refresh(callback, paintAll) {
  76882. var list = this.storage.getShapeList(true);
  76883. this._paintList(list, paintAll);
  76884. if (typeof callback == 'function') {
  76885. callback();
  76886. }
  76887. return this;
  76888. }
  76889. /**
  76890. * Method: _paintList
  76891. * 按列表绘制图形。
  76892. */
  76893. }, {
  76894. key: "_paintList",
  76895. value: function _paintList(list, paintAll) {
  76896. if (typeof paintAll == 'undefined') {
  76897. paintAll = false;
  76898. }
  76899. this._updateLayerStatus(list);
  76900. var currentLayer;
  76901. var currentZLevel;
  76902. var ctx;
  76903. for (var id in this._layers) {
  76904. if (id !== 'hover') {
  76905. this._layers[id].unusedCount++;
  76906. this._layers[id].updateTransform();
  76907. }
  76908. }
  76909. var invTransform = [];
  76910. for (var i = 0, l = list.length; i < l; i++) {
  76911. var shape = list[i];
  76912. if (currentZLevel !== shape.zlevel) {
  76913. if (currentLayer && currentLayer.needTransform) {
  76914. ctx.restore();
  76915. }
  76916. currentLayer = this.getLayer(shape.zlevel);
  76917. ctx = currentLayer.ctx;
  76918. currentZLevel = shape.zlevel;
  76919. // Reset the count
  76920. currentLayer.unusedCount = 0;
  76921. if (currentLayer.dirty || paintAll) {
  76922. currentLayer.clear();
  76923. }
  76924. if (currentLayer.needTransform) {
  76925. ctx.save();
  76926. currentLayer.setTransform(ctx);
  76927. }
  76928. }
  76929. // Start group clipping
  76930. if (ctx && shape.__startClip) {
  76931. var clipShape = shape.__startClip;
  76932. ctx.save();
  76933. // Set transform
  76934. if (clipShape.needTransform) {
  76935. var m = clipShape.transform;
  76936. SUtil_SUtil.Util_matrix.invert(invTransform, m);
  76937. ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
  76938. }
  76939. ctx.beginPath();
  76940. clipShape.buildPath(ctx, clipShape.style);
  76941. ctx.clip();
  76942. // Transform back
  76943. if (clipShape.needTransform) {
  76944. var _m = invTransform;
  76945. ctx.transform(_m[0], _m[1], _m[2], _m[3], _m[4], _m[5]);
  76946. }
  76947. }
  76948. if ((currentLayer && currentLayer.dirty || paintAll) && !shape.invisible) {
  76949. if (!shape.onbrush || shape.onbrush && !shape.onbrush(ctx, false)) {
  76950. if (Config.catchBrushException) {
  76951. try {
  76952. shape.brush(ctx, false, this.updatePainter);
  76953. } catch (error) {
  76954. SUtil_SUtil.Util_log(error, 'brush error of ' + shape.type, shape);
  76955. }
  76956. } else {
  76957. shape.brush(ctx, false, this.updatePainter);
  76958. }
  76959. }
  76960. }
  76961. // Stop group clipping
  76962. if (ctx && shape.__stopClip) {
  76963. ctx.restore();
  76964. }
  76965. shape.__dirty = false;
  76966. }
  76967. if (ctx && currentLayer && currentLayer.needTransform) {
  76968. ctx.restore();
  76969. }
  76970. for (var _id2 in this._layers) {
  76971. if (_id2 !== 'hover') {
  76972. var layer = this._layers[_id2];
  76973. layer.dirty = false;
  76974. // 删除过期的层
  76975. // PENDING
  76976. // if (layer.unusedCount >= 500) {
  76977. // this.delLayer(id);
  76978. // }
  76979. if (layer.unusedCount == 1) {
  76980. layer.clear();
  76981. }
  76982. }
  76983. }
  76984. }
  76985. /**
  76986. * @function LevelRenderer.Painter.prototype.getLayer
  76987. * @description 获取 zlevel 所在层,如果不存在则会创建一个新的层。
  76988. *
  76989. * @param {number} zlevel - zlevel。
  76990. * @return {LevelRenderer.Painter} this。
  76991. */
  76992. }, {
  76993. key: "getLayer",
  76994. value: function getLayer(zlevel) {
  76995. // Change draw layer
  76996. var currentLayer = this._layers[zlevel];
  76997. if (!currentLayer) {
  76998. var len = this._zlevelList.length;
  76999. var prevLayer = null;
  77000. var i = -1;
  77001. if (len > 0 && zlevel > this._zlevelList[0]) {
  77002. for (i = 0; i < len - 1; i++) {
  77003. if (this._zlevelList[i] < zlevel && this._zlevelList[i + 1] > zlevel) {
  77004. break;
  77005. }
  77006. }
  77007. prevLayer = this._layers[this._zlevelList[i]];
  77008. }
  77009. this._zlevelList.splice(i + 1, 0, zlevel);
  77010. // Create a new layer
  77011. //currentLayer = new PaintLayer(zlevel, this);
  77012. currentLayer = new PaintLayer(Util_Util.createUniqueID("_levelLayer_" + zlevel), this);
  77013. var prevDom = prevLayer ? prevLayer.dom : this._bgDom;
  77014. if (prevDom.nextSibling) {
  77015. prevDom.parentNode.insertBefore(currentLayer.dom, prevDom.nextSibling);
  77016. } else {
  77017. prevDom.parentNode.appendChild(currentLayer.dom);
  77018. }
  77019. currentLayer.initContext();
  77020. this._layers[zlevel] = currentLayer;
  77021. if (this._layerConfig[zlevel]) {
  77022. new levelRenderer_Util_Util().merge(currentLayer, this._layerConfig[zlevel], true);
  77023. }
  77024. currentLayer.updateTransform();
  77025. }
  77026. return currentLayer;
  77027. }
  77028. /**
  77029. * @function LevelRenderer.Painter.prototype.getLayers
  77030. * @description 获取所有已创建的层。
  77031. * @return {Array.<Painter.Layer>} 已创建的层
  77032. */
  77033. }, {
  77034. key: "getLayers",
  77035. value: function getLayers() {
  77036. return this._layers;
  77037. }
  77038. /**
  77039. * Method: _updateLayerStatus
  77040. * 更新绘制层状态。
  77041. */
  77042. }, {
  77043. key: "_updateLayerStatus",
  77044. value: function _updateLayerStatus(list) {
  77045. var layers = this._layers;
  77046. var elCounts = {};
  77047. for (var z in layers) {
  77048. if (z !== 'hover') {
  77049. elCounts[z] = layers[z].elCount;
  77050. layers[z].elCount = 0;
  77051. }
  77052. }
  77053. for (var i = 0; i < list.length; i++) {
  77054. var shape = list[i];
  77055. var zlevel = shape.zlevel;
  77056. var layer = layers[zlevel];
  77057. if (layer) {
  77058. layer.elCount++;
  77059. // 已经被标记为需要刷新
  77060. if (layer.dirty) {
  77061. continue;
  77062. }
  77063. layer.dirty = shape.__dirty;
  77064. }
  77065. }
  77066. // 层中的元素数量有发生变化
  77067. for (var _z2 in layers) {
  77068. if (_z2 !== 'hover') {
  77069. if (elCounts[_z2] !== layers[_z2].elCount) {
  77070. layers[_z2].dirty = true;
  77071. }
  77072. }
  77073. }
  77074. }
  77075. /**
  77076. * @function LevelRenderer.Painter.prototype.refreshShapes
  77077. * @description 更新的图形元素列表。
  77078. *
  77079. * @param {number} shapeList - 需要更新的图形元素列表。
  77080. * @param {number} callback - 视图更新后回调函数。
  77081. * @return {LevelRenderer.Painter} this。
  77082. */
  77083. }, {
  77084. key: "refreshShapes",
  77085. value: function refreshShapes(shapeList, callback) {
  77086. for (var i = 0, l = shapeList.length; i < l; i++) {
  77087. var shape = shapeList[i];
  77088. this.storage.mod(shape.id);
  77089. }
  77090. this.refresh(callback);
  77091. return this;
  77092. }
  77093. /**
  77094. * @function LevelRenderer.Painter.prototype.clear
  77095. * @description 清除 hover 层外所有内容。
  77096. * @return {LevelRenderer.Painter} this。
  77097. */
  77098. }, {
  77099. key: "clear",
  77100. value: function clear() {
  77101. for (var k in this._layers) {
  77102. if (k == 'hover') {
  77103. continue;
  77104. }
  77105. this._layers[k].clear();
  77106. }
  77107. return this;
  77108. }
  77109. /**
  77110. * @function LevelRenderer.Painter.prototype.modLayer
  77111. * @description 修改指定 zlevel 的绘制参数。
  77112. *
  77113. * @param {string} zlevel - zlevel。
  77114. * @param {Object} config - 配置对象。
  77115. * @param {string} [config.clearColor=0] - 每次清空画布的颜色。
  77116. * @param {boolean} [config.motionBlur=false] - 是否开启动态模糊。
  77117. * @param {number} [config.lastFrameAlpha=0.7] - 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显。默认值:0.7。
  77118. * @param {Array.<number>} config.position - 层的平移。
  77119. * @param {Array.<number>} config.rotation - 层的旋转。
  77120. * @param {Array.<number>} config.scale - 层的缩放。
  77121. * @param {boolean} config.zoomable - 层是否支持鼠标缩放操作。默认值:false。
  77122. * @param {boolean} config.panable - 层是否支持鼠标平移操作。默认值:false。
  77123. *
  77124. */
  77125. }, {
  77126. key: "modLayer",
  77127. value: function modLayer(zlevel, config) {
  77128. if (config) {
  77129. if (!this._layerConfig[zlevel]) {
  77130. this._layerConfig[zlevel] = config;
  77131. } else {
  77132. new levelRenderer_Util_Util().merge(this._layerConfig[zlevel], config, true);
  77133. }
  77134. var layer = this._layers[zlevel];
  77135. if (layer) {
  77136. new levelRenderer_Util_Util().merge(layer, this._layerConfig[zlevel], true);
  77137. }
  77138. }
  77139. }
  77140. /**
  77141. * @function LevelRenderer.Painter.prototype.delLayer
  77142. * @description 删除指定层。
  77143. *
  77144. * @param {string} zlevel - 层所在的 zlevel。
  77145. */
  77146. }, {
  77147. key: "delLayer",
  77148. value: function delLayer(zlevel) {
  77149. var layer = this._layers[zlevel];
  77150. if (!layer) {
  77151. return;
  77152. }
  77153. // Save config
  77154. this.modLayer(zlevel, {
  77155. position: layer.position,
  77156. rotation: layer.rotation,
  77157. scale: layer.scale
  77158. });
  77159. layer.dom.parentNode.removeChild(layer.dom);
  77160. delete this._layers[zlevel];
  77161. this._zlevelList.splice(new levelRenderer_Util_Util().indexOf(this._zlevelList, zlevel), 1);
  77162. }
  77163. /**
  77164. * @function LevelRenderer.Painter.prototype.refreshHover
  77165. * @description 刷新 hover 层。
  77166. * @return {LevelRenderer.Painter} this。
  77167. */
  77168. }, {
  77169. key: "refreshHover",
  77170. value: function refreshHover() {
  77171. this.clearHover();
  77172. var list = this.storage.getHoverShapes(true);
  77173. for (var i = 0, l = list.length; i < l; i++) {
  77174. this._brushHover(list[i]);
  77175. }
  77176. this.storage.delHover();
  77177. return this;
  77178. }
  77179. /**
  77180. * @function LevelRenderer.Painter.prototype.clearHover
  77181. * @description 清除 hover 层所有内容。
  77182. * @return {LevelRenderer.Painter} this。
  77183. */
  77184. }, {
  77185. key: "clearHover",
  77186. value: function clearHover() {
  77187. var hover = this._layers.hover;
  77188. hover && hover.clear();
  77189. return this;
  77190. }
  77191. /**
  77192. * @function LevelRenderer.Painter.prototype.resize
  77193. * @description 区域大小变化后重绘。
  77194. * @return {LevelRenderer.Painter} this。
  77195. */
  77196. }, {
  77197. key: "resize",
  77198. value: function resize() {
  77199. var domRoot = this._domRoot;
  77200. domRoot.style.display = 'none';
  77201. var width = this._getWidth();
  77202. var height = this._getHeight();
  77203. domRoot.style.display = '';
  77204. // 优化没有实际改变的resize
  77205. if (this._width != width || height != this._height) {
  77206. this._width = width;
  77207. this._height = height;
  77208. domRoot.style.width = width + 'px';
  77209. domRoot.style.height = height + 'px';
  77210. for (var id in this._layers) {
  77211. this._layers[id].resize(width, height);
  77212. }
  77213. this.refresh(null, true);
  77214. }
  77215. return this;
  77216. }
  77217. /**
  77218. * @function LevelRenderer.Painter.prototype.clearLayer
  77219. * @description 清除指定的一个层。
  77220. * @param {number} zLevel - 层。
  77221. */
  77222. }, {
  77223. key: "clearLayer",
  77224. value: function clearLayer(zLevel) {
  77225. var layer = this._layers[zLevel];
  77226. if (layer) {
  77227. layer.clear();
  77228. }
  77229. }
  77230. /**
  77231. * @function LevelRenderer.Painter.prototype.dispose
  77232. * @description 释放。
  77233. *
  77234. */
  77235. }, {
  77236. key: "dispose",
  77237. value: function dispose() {
  77238. this.root.innerHTML = '';
  77239. this.root = null;
  77240. this.storage = null;
  77241. this._domRoot = null;
  77242. this._layers = null;
  77243. }
  77244. /**
  77245. * @function LevelRenderer.Painter.prototype.getDomHover
  77246. * @description 获取 Hover 层的 Dom。
  77247. */
  77248. }, {
  77249. key: "getDomHover",
  77250. value: function getDomHover() {
  77251. return this._layers.hover.dom;
  77252. }
  77253. /**
  77254. * @function LevelRenderer.Painter.prototype.toDataURL
  77255. * @description 图像导出。
  77256. * @param {string} type - 图片类型。
  77257. * @param {string} backgroundColor - 背景色。默认值:'#fff'。
  77258. * @param {Object} args
  77259. * @return {string} 图片的Base64 url。
  77260. */
  77261. }, {
  77262. key: "toDataURL",
  77263. value: function toDataURL(type, backgroundColor, args) {
  77264. //var imageDom = Painter.createDom('image', 'canvas', this);
  77265. var imageDom = Painter.createDom(Util_Util.createUniqueID("SuperMap.Theme.image_"), 'canvas', this);
  77266. this._bgDom.appendChild(imageDom);
  77267. var ctx = imageDom.getContext('2d');
  77268. Painter.devicePixelRatio != 1 && ctx.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  77269. ctx.fillStyle = backgroundColor || '#fff';
  77270. ctx.rect(0, 0, this._width * Painter.devicePixelRatio, this._height * Painter.devicePixelRatio);
  77271. ctx.fill();
  77272. var self = this;
  77273. // 升序遍历,shape上的zlevel指定绘画图层的z轴层叠
  77274. this.storage.iterShape(function (shape) {
  77275. if (!shape.invisible) {
  77276. if (!shape.onbrush // 没有onbrush
  77277. // 有onbrush并且调用执行返回false或undefined则继续粉刷
  77278. || shape.onbrush && !shape.onbrush(ctx, false)) {
  77279. if (Config.catchBrushException) {
  77280. try {
  77281. shape.brush(ctx, false, self.updatePainter);
  77282. } catch (error) {
  77283. SUtil_SUtil.Util_log(error, 'brush error of ' + shape.type, shape);
  77284. }
  77285. } else {
  77286. shape.brush(ctx, false, self.updatePainter);
  77287. }
  77288. }
  77289. }
  77290. }, {
  77291. normal: 'up',
  77292. update: true
  77293. });
  77294. var image = imageDom.toDataURL(type, args);
  77295. ctx = null;
  77296. this._bgDom.removeChild(imageDom);
  77297. return image;
  77298. }
  77299. /**
  77300. * @function LevelRenderer.Painter.prototype.getWidth
  77301. * @description 获取绘图区域宽度。
  77302. * @return {number} 绘图区域宽度。
  77303. */
  77304. }, {
  77305. key: "getWidth",
  77306. value: function getWidth() {
  77307. return this._width;
  77308. }
  77309. /**
  77310. * @function LevelRenderer.Painter.prototype.getHeight
  77311. * @description 获取绘图区域高度。
  77312. * @return {number} 绘图区域高度。
  77313. */
  77314. }, {
  77315. key: "getHeight",
  77316. value: function getHeight() {
  77317. return this._height;
  77318. }
  77319. /**
  77320. * Method: _getWidth
  77321. *
  77322. */
  77323. }, {
  77324. key: "_getWidth",
  77325. value: function _getWidth() {
  77326. var root = this.root;
  77327. var stl = root.currentStyle || document.defaultView.getComputedStyle(root);
  77328. return ((root.clientWidth || parseInt(stl.width, 10)) - parseInt(stl.paddingLeft, 10) // 请原谅我这比较粗暴
  77329. - parseInt(stl.paddingRight, 10)).toFixed(0) - 0;
  77330. }
  77331. /**
  77332. * Method: _getHeight
  77333. *
  77334. */
  77335. }, {
  77336. key: "_getHeight",
  77337. value: function _getHeight() {
  77338. var root = this.root;
  77339. var stl = root.currentStyle || document.defaultView.getComputedStyle(root);
  77340. return ((root.clientHeight || parseInt(stl.height, 10)) - parseInt(stl.paddingTop, 10) // 请原谅我这比较粗暴
  77341. - parseInt(stl.paddingBottom, 10)).toFixed(0) - 0;
  77342. }
  77343. /**
  77344. * Method: _brushHover
  77345. *
  77346. */
  77347. }, {
  77348. key: "_brushHover",
  77349. value: function _brushHover(shape) {
  77350. var ctx = this._layers.hover.ctx;
  77351. if (!shape.onbrush // 没有onbrush
  77352. // 有onbrush并且调用执行返回false或undefined则继续粉刷
  77353. || shape.onbrush && !shape.onbrush(ctx, true)) {
  77354. var layer = this.getLayer(shape.zlevel);
  77355. if (layer.needTransform) {
  77356. ctx.save();
  77357. layer.setTransform(ctx);
  77358. }
  77359. // Retina 优化
  77360. if (Config.catchBrushException) {
  77361. try {
  77362. shape.brush(ctx, true, this.updatePainter);
  77363. } catch (error) {
  77364. SUtil_SUtil.Util_log(error, 'hoverBrush error of ' + shape.type, shape);
  77365. }
  77366. } else {
  77367. shape.brush(ctx, true, this.updatePainter);
  77368. }
  77369. if (layer.needTransform) {
  77370. ctx.restore();
  77371. }
  77372. }
  77373. }
  77374. /**
  77375. * Method: _shapeToImage
  77376. *
  77377. */
  77378. }, {
  77379. key: "_shapeToImage",
  77380. value: function _shapeToImage(id, shape, width, height, devicePixelRatio) {
  77381. var canvas = document.createElement('canvas');
  77382. var ctx = canvas.getContext('2d');
  77383. var _devicePixelRatio = devicePixelRatio || window.devicePixelRatio || 1;
  77384. canvas.style.width = width + 'px';
  77385. canvas.style.height = height + 'px';
  77386. canvas.setAttribute('width', width * _devicePixelRatio);
  77387. canvas.setAttribute('height', height * _devicePixelRatio);
  77388. ctx.clearRect(0, 0, width * _devicePixelRatio, height * _devicePixelRatio);
  77389. var shapeTransform = {
  77390. position: shape.position,
  77391. rotation: shape.rotation,
  77392. scale: shape.scale
  77393. };
  77394. shape.position = [0, 0, 0];
  77395. shape.rotation = 0;
  77396. shape.scale = [1, 1];
  77397. if (shape) {
  77398. shape.brush(ctx, false);
  77399. }
  77400. var imgShape = new SmicImage({
  77401. id: id,
  77402. style: {
  77403. x: 0,
  77404. y: 0,
  77405. image: canvas
  77406. }
  77407. });
  77408. if (shapeTransform.position != null) {
  77409. imgShape.position = shape.position = shapeTransform.position;
  77410. }
  77411. if (shapeTransform.rotation != null) {
  77412. imgShape.rotation = shape.rotation = shapeTransform.rotation;
  77413. }
  77414. if (shapeTransform.scale != null) {
  77415. imgShape.scale = shape.scale = shapeTransform.scale;
  77416. }
  77417. return imgShape;
  77418. }
  77419. /**
  77420. * Method: _createShapeToImageProcessor
  77421. *
  77422. */
  77423. }, {
  77424. key: "_createShapeToImageProcessor",
  77425. value: function _createShapeToImageProcessor() {
  77426. var me = this;
  77427. return function (id, e, width, height) {
  77428. return me._shapeToImage(id, e, width, height, Painter.devicePixelRatio);
  77429. };
  77430. }
  77431. // SMIC-方法扩展 - start
  77432. /**
  77433. * @function LevelRenderer.Painter.prototype.updateHoverLayer
  77434. * @description 更新设置显示高亮图层。
  77435. * @param {Array} shapes - 图形数组。
  77436. */
  77437. }, {
  77438. key: "updateHoverLayer",
  77439. value: function updateHoverLayer(shapes) {
  77440. if (!(shapes instanceof Array)) {
  77441. return this;
  77442. }
  77443. //清除高亮
  77444. this.clearHover();
  77445. this.storage.delHover();
  77446. for (var i = 0; i < shapes.length; i++) {
  77447. this.storage.addHover(shapes[i]);
  77448. this._brushHover(shapes[i]);
  77449. }
  77450. }
  77451. /**
  77452. * @function LevelRenderer.Painter.prototype.createDom
  77453. * @description 创建 Dom。
  77454. *
  77455. * @param {string} id - Dom id
  77456. * @param {string} type - Dom type
  77457. * @param {LevelRenderer.Painter} painter - Painter 实例。
  77458. * @return {Object} Dom
  77459. */
  77460. }], [{
  77461. key: "createDom",
  77462. value: function createDom(id, type, painter) {
  77463. var newDom = document.createElement(type);
  77464. var width = painter._width;
  77465. var height = painter._height;
  77466. // 没append呢,请原谅我这样写,清晰~
  77467. newDom.style.position = 'absolute';
  77468. newDom.style.left = 0;
  77469. newDom.style.top = 0;
  77470. newDom.style.width = width + 'px';
  77471. newDom.style.height = height + 'px';
  77472. newDom.setAttribute('width', width * Painter.devicePixelRatio);
  77473. newDom.setAttribute('height', height * Painter.devicePixelRatio);
  77474. // id不作为索引用,避免可能造成的重名,定义为私有属性
  77475. //newDom.setAttribute('data-zr-dom-id', id);
  77476. newDom.setAttribute('id', id);
  77477. return newDom;
  77478. }
  77479. }]);
  77480. return Painter;
  77481. }();
  77482. /**
  77483. * @private
  77484. * @class Painter.Layer
  77485. * @classdesc 绘制层类。
  77486. * @extends LevelRenderer.Transformable
  77487. */
  77488. var PaintLayer = /*#__PURE__*/function (_Transformable) {
  77489. Painter_inherits(PaintLayer, _Transformable);
  77490. var _super = Painter_createSuper(PaintLayer);
  77491. /**
  77492. * @function Painter.Layer.constructor
  77493. * @description 构造函数。
  77494. *
  77495. * @param {string} id - id。
  77496. * @param {LevelRenderer.Painter} painter - Painter 实例。
  77497. *
  77498. */
  77499. function PaintLayer(id, painter) {
  77500. var _this;
  77501. Painter_classCallCheck(this, PaintLayer);
  77502. _this = _super.call(this, id, painter);
  77503. /**
  77504. * @member {Object} Painter.Layer.prototype.dom
  77505. * @description dom。
  77506. */
  77507. _this.dom = null;
  77508. /**
  77509. * @member {Object} Painter.Layer.prototype.domBack
  77510. * @description domBack。
  77511. */
  77512. _this.domBack = null;
  77513. /**
  77514. * @member {Object} Painter.Layer.prototype.ctxBack
  77515. * @description ctxBack。
  77516. */
  77517. _this.ctxBack = null;
  77518. /**
  77519. * @member {LevelRenderer.Painter} Painter.Layer.prototype.painter
  77520. * @description painter。
  77521. */
  77522. _this.painter = painter;
  77523. /**
  77524. * @member {number} Painter.Layer.prototype.unusedCount
  77525. * @description unusedCount。
  77526. */
  77527. _this.unusedCount = 0;
  77528. /**
  77529. * @member {Object} Painter.Layer.prototype.config
  77530. * @description config。
  77531. */
  77532. _this.config = null;
  77533. /**
  77534. * @member {boolean} Painter.Layer.prototype.dirty
  77535. * @description dirty。
  77536. */
  77537. _this.dirty = true;
  77538. /**
  77539. * @member {number} Painter.Layer.prototype.elCount
  77540. * @description elCount。
  77541. */
  77542. _this.elCount = 0;
  77543. // Configs
  77544. /**
  77545. * @member {string} Painter.Layer.prototype.clearColor
  77546. * @description 每次清空画布的颜色。默认值:0;
  77547. */
  77548. _this.clearColor = 0;
  77549. /**
  77550. * @member {boolean} Painter.Layer.prototype.motionBlur
  77551. * @description 是否开启动态模糊。默认值:false;
  77552. */
  77553. _this.motionBlur = false;
  77554. /**
  77555. * @member {number} Painter.Layer.prototype.lastFrameAlpha
  77556. * @description 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显
  77557. */
  77558. _this.lastFrameAlpha = 0.7;
  77559. /**
  77560. * @member {boolean} Painter.Layer.prototype.zoomable
  77561. * @description 层是否支持鼠标平移操作。默认值:false;
  77562. */
  77563. _this.zoomable = false;
  77564. /**
  77565. * @member {boolean} Painter.Layer.prototype.panable
  77566. * @description 层是否支持鼠标缩放操作。默认值:false;
  77567. */
  77568. _this.panable = false;
  77569. /**
  77570. * @member {number} Painter.Layer.prototype.maxZoom
  77571. * @description maxZoom。默认值:Infinity。
  77572. */
  77573. _this.maxZoom = Infinity;
  77574. /**
  77575. * @member {number} Painter.Layer.prototype.minZoom
  77576. * @description minZoom。默认值:0。
  77577. */
  77578. _this.minZoom = 0;
  77579. /**
  77580. * @member {number} Painter.Layer.prototype.ctx
  77581. * @description Canvas 上下文。
  77582. */
  77583. _this.ctx = null;
  77584. _this.dom = Painter.createDom(Util_Util.createUniqueID("SuperMap.Theme" + id), 'canvas', painter);
  77585. _this.dom.onselectstart = returnFalse; // 避免页面选中的尴尬
  77586. _this.dom.style['-webkit-user-select'] = 'none';
  77587. _this.dom.style['user-select'] = 'none';
  77588. _this.dom.style['-webkit-touch-callout'] = 'none';
  77589. // Function
  77590. // 返回false的方法,用于避免页面被选中
  77591. function returnFalse() {
  77592. return false;
  77593. }
  77594. _this.CLASS_NAME = "SuperMap.LevelRenderer.Painter.Layer";
  77595. return _this;
  77596. }
  77597. /**
  77598. * @function Painter.Layer.prototype.destroy
  77599. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  77600. */
  77601. Painter_createClass(PaintLayer, [{
  77602. key: "destroy",
  77603. value: function destroy() {
  77604. this.dom = null;
  77605. this.domBack = null;
  77606. this.ctxBack = null;
  77607. this.painter = null;
  77608. this.unusedCount = null;
  77609. this.config = null;
  77610. this.dirty = null;
  77611. this.elCount = null;
  77612. this.clearColor = null;
  77613. this.motionBlur = null;
  77614. this.lastFrameAlpha = null;
  77615. this.zoomable = null;
  77616. this.panable = null;
  77617. this.maxZoom = null;
  77618. this.minZoom = null;
  77619. this.ctx = null;
  77620. Transformable.destroy.apply(this, arguments);
  77621. }
  77622. /**
  77623. * @function Painter.Layer.prototype.initContext
  77624. * @description 初始化 Canvan 2D 上下文。
  77625. */
  77626. }, {
  77627. key: "initContext",
  77628. value: function initContext() {
  77629. this.ctx = this.dom.getContext('2d');
  77630. if (Painter.devicePixelRatio != 1) {
  77631. this.ctx.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  77632. }
  77633. }
  77634. /**
  77635. * @function Painter.Layer.prototype.createBackBuffer
  77636. * @description 创建备份缓冲。
  77637. */
  77638. }, {
  77639. key: "createBackBuffer",
  77640. value: function createBackBuffer() {
  77641. this.domBack = Painter.createDom(Util_Util.createUniqueID("SuperMap.Theme.back-" + this.id), 'canvas', this.painter);
  77642. this.ctxBack = this.domBack.getContext('2d');
  77643. if (Painter.devicePixelRatio != 1) {
  77644. this.ctxBack.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  77645. }
  77646. }
  77647. /**
  77648. * @function Painter.Layer.prototype.resize
  77649. * @description 改变大小。
  77650. *
  77651. * @param {number} width - 宽。
  77652. * @param {number} height - 高。
  77653. */
  77654. }, {
  77655. key: "resize",
  77656. value: function resize(width, height) {
  77657. this.dom.style.width = width + 'px';
  77658. this.dom.style.height = height + 'px';
  77659. this.dom.setAttribute('width', width * Painter.devicePixelRatio);
  77660. this.dom.setAttribute('height', height * Painter.devicePixelRatio);
  77661. if (Painter.devicePixelRatio != 1) {
  77662. this.ctx.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  77663. }
  77664. if (this.domBack) {
  77665. this.domBack.setAttribute('width', width * Painter.devicePixelRatio);
  77666. this.domBack.setAttribute('height', height * Painter.devicePixelRatio);
  77667. if (Painter.devicePixelRatio != 1) {
  77668. this.ctxBack.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  77669. }
  77670. }
  77671. }
  77672. /**
  77673. * @function Painter.Layer.prototype.clear
  77674. * @description 清空该层画布。
  77675. */
  77676. }, {
  77677. key: "clear",
  77678. value: function clear() {
  77679. var dom = this.dom;
  77680. var ctx = this.ctx;
  77681. var width = dom.width;
  77682. var height = dom.height;
  77683. var haveClearColor = this.clearColor;
  77684. var haveMotionBLur = this.motionBlur;
  77685. var lastFrameAlpha = this.lastFrameAlpha;
  77686. if (haveMotionBLur) {
  77687. if (!this.domBack) {
  77688. this.createBackBuffer();
  77689. }
  77690. this.ctxBack.globalCompositeOperation = 'copy';
  77691. this.ctxBack.drawImage(dom, 0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
  77692. }
  77693. if (haveClearColor) {
  77694. ctx.save();
  77695. ctx.fillStyle = this.config.clearColor;
  77696. ctx.fillRect(0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
  77697. ctx.restore();
  77698. } else {
  77699. ctx.clearRect(0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
  77700. }
  77701. if (haveMotionBLur) {
  77702. var domBack = this.domBack;
  77703. ctx.save();
  77704. ctx.globalAlpha = lastFrameAlpha;
  77705. ctx.drawImage(domBack, 0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
  77706. ctx.restore();
  77707. }
  77708. }
  77709. }]);
  77710. return PaintLayer;
  77711. }(Transformable);
  77712. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Handler.js
  77713. function Handler_typeof(obj) { "@babel/helpers - typeof"; return Handler_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Handler_typeof(obj); }
  77714. function Handler_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  77715. function Handler_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  77716. function Handler_createClass(Constructor, protoProps, staticProps) { if (protoProps) Handler_defineProperties(Constructor.prototype, protoProps); if (staticProps) Handler_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  77717. function Handler_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Handler_setPrototypeOf(subClass, superClass); }
  77718. function Handler_setPrototypeOf(o, p) { Handler_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Handler_setPrototypeOf(o, p); }
  77719. function Handler_createSuper(Derived) { var hasNativeReflectConstruct = Handler_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Handler_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Handler_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Handler_possibleConstructorReturn(this, result); }; }
  77720. function Handler_possibleConstructorReturn(self, call) { if (call && (Handler_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Handler_assertThisInitialized(self); }
  77721. function Handler_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  77722. function Handler_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  77723. function Handler_getPrototypeOf(o) { Handler_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Handler_getPrototypeOf(o); }
  77724. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  77725. * This program are made available under the terms of the Apache License, Version 2.0
  77726. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  77727. /**
  77728. * @private
  77729. * @class LevelRenderer.Handler
  77730. * @category Visualization Theme
  77731. * @classdesc Handler控制模块。
  77732. * @extends {LevelRenderer.Eventful}
  77733. * @param {HTMLElement} root - 绘图区域。
  77734. * @param {LevelRenderer.Storage} storage - Storage 实例。
  77735. * @param {LevelRenderer.Painter} painter - Painter 实例。
  77736. */
  77737. var Handler = /*#__PURE__*/function (_Eventful) {
  77738. Handler_inherits(Handler, _Eventful);
  77739. var _super = Handler_createSuper(Handler);
  77740. function Handler(root, storage, painter) {
  77741. var _this;
  77742. Handler_classCallCheck(this, Handler);
  77743. _this = _super.call(this, root, storage, painter);
  77744. /**
  77745. * @member {HTMLElement} LevelRenderer.Handler.prototype.root
  77746. * @description 绘图区域
  77747. */
  77748. _this.root = root;
  77749. /**
  77750. * @member {LevelRenderer.Storage} LevelRenderer.Handler.prototype.storage
  77751. * @description Storage 实例
  77752. */
  77753. _this.storage = storage;
  77754. /**
  77755. * @member {LevelRenderer.Painter} LevelRenderer.Handler.prototype.Painter
  77756. * @description Painter 实例
  77757. */
  77758. _this.painter = painter;
  77759. /**
  77760. * @member {number} [LevelRenderer.Handler.prototype._lastX=0]
  77761. * @description 上一次鼠标位置x坐标值
  77762. */
  77763. _this._lastX = 0;
  77764. /**
  77765. * @member {number} [LevelRenderer.Handler.prototype._lastY=0]
  77766. * @description 上一次鼠标位置y坐标值
  77767. */
  77768. _this._lastY = 0;
  77769. /**
  77770. * @member {number} [LevelRenderer.Handler.prototype._mouseX=0]
  77771. * @description 当前鼠标位置x坐标值
  77772. */
  77773. _this._mouseX = 0;
  77774. /**
  77775. * @member {number} [LevelRenderer.Handler.prototype._mouseY=0]
  77776. * @description 当前鼠标位置y坐标值
  77777. */
  77778. _this._mouseY = 0;
  77779. /**
  77780. * @member {function} LevelRenderer.Handler.prototype._findHover
  77781. * @description 查找 Hover 图形
  77782. */
  77783. _this._findHover = null;
  77784. /**
  77785. * @member {Object} LevelRenderer.Handler.prototype._domHover
  77786. * @description 高亮 DOM
  77787. */
  77788. _this._domHover = null;
  77789. // 各种事件标识的私有变量
  77790. // this._hasfound = false; // 是否找到 hover 图形元素
  77791. // this._lastHover = null; // 最后一个 hover 图形元素
  77792. // this._mouseDownTarget = null;
  77793. // this._draggingTarget = null; // 当前被拖拽的图形元素
  77794. // this._isMouseDown = false;
  77795. // this._isDragging = false;
  77796. // this._lastMouseDownMoment;
  77797. // this._lastTouchMoment;
  77798. // this._lastDownButton;
  77799. _this._findHover = bind3Arg(findHover, Handler_assertThisInitialized(_this));
  77800. _this._domHover = painter.getDomHover();
  77801. _this.CLASS_NAME = "SuperMap.LevelRenderer.Handler";
  77802. var domHandlers = {
  77803. /**
  77804. * Method: resize
  77805. * 窗口大小改变响应函数。
  77806. *
  77807. * Parameters:
  77808. * event - {Event} event。
  77809. *
  77810. */
  77811. resize: function resize(event) {
  77812. event = event || window.event;
  77813. this._lastHover = null;
  77814. this._isMouseDown = 0;
  77815. // 分发SuperMap.LevelRenderer.Config.EVENT.RESIZE事件,global
  77816. this.dispatch(Config.EVENT.RESIZE, event);
  77817. },
  77818. /**
  77819. * Method: click
  77820. * 点击响应函数。
  77821. *
  77822. * Parameters:
  77823. * event - {Event} event。
  77824. *
  77825. */
  77826. click: function click(event) {
  77827. event = this._zrenderEventFixed(event);
  77828. // 分发SuperMap.LevelRenderer.Config.EVENT.CLICK事件
  77829. var _lastHover = this._lastHover;
  77830. if (_lastHover && _lastHover.clickable || !_lastHover) {
  77831. // 判断没有发生拖拽才触发click事件
  77832. if (this._clickThreshold < 10) {
  77833. this._dispatchAgency(_lastHover, Config.EVENT.CLICK, event);
  77834. }
  77835. }
  77836. this._mousemoveHandler(event);
  77837. },
  77838. /**
  77839. * Method: dblclick
  77840. * 双击响应函数。
  77841. *
  77842. * Parameters:
  77843. * event - {Event} event。
  77844. *
  77845. */
  77846. dblclick: function dblclick(event) {
  77847. event = event || window.event;
  77848. event = this._zrenderEventFixed(event);
  77849. // 分发SuperMap.LevelRenderer.Config.EVENT.DBLCLICK事件
  77850. var _lastHover = this._lastHover;
  77851. if (_lastHover && _lastHover.clickable || !_lastHover) {
  77852. // 判断没有发生拖拽才触发dblclick事件
  77853. if (this._clickThreshold < 5) {
  77854. this._dispatchAgency(_lastHover, Config.EVENT.DBLCLICK, event);
  77855. }
  77856. }
  77857. this._mousemoveHandler(event);
  77858. },
  77859. /**
  77860. * Method: mousewheel
  77861. * 鼠标滚轮响应函数。
  77862. *
  77863. * Parameters:
  77864. * event - {Event} event。
  77865. *
  77866. */
  77867. mousewheel: function mousewheel(event) {
  77868. event = this._zrenderEventFixed(event);
  77869. // http://www.sitepoint.com/html5-javascript-mouse-wheel/
  77870. // https://developer.mozilla.org/en-US/docs/DOM/DOM_event_reference/mousewheel
  77871. var delta = event.wheelDelta // Webkit
  77872. || -event.detail; // Firefox
  77873. var scale = delta > 0 ? 1.1 : 1 / 1.1;
  77874. var layers = this.painter.getLayers();
  77875. var needsRefresh = false;
  77876. for (var z in layers) {
  77877. if (z !== 'hover') {
  77878. var layer = layers[z];
  77879. var pos = layer.position;
  77880. if (layer.zoomable) {
  77881. layer.__zoom = layer.__zoom || 1;
  77882. var newZoom = layer.__zoom;
  77883. newZoom *= scale;
  77884. newZoom = Math.max(Math.min(layer.maxZoom, newZoom), layer.minZoom);
  77885. scale = newZoom / layer.__zoom;
  77886. layer.__zoom = newZoom;
  77887. // Keep the mouse center when scaling
  77888. pos[0] -= (this._mouseX - pos[0]) * (scale - 1);
  77889. pos[1] -= (this._mouseY - pos[1]) * (scale - 1);
  77890. layer.scale[0] *= scale;
  77891. layer.scale[1] *= scale;
  77892. layer.dirty = true;
  77893. needsRefresh = true;
  77894. }
  77895. }
  77896. }
  77897. if (needsRefresh) {
  77898. this.painter.refresh();
  77899. }
  77900. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEWHEEL事件
  77901. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEWHEEL, event);
  77902. this._mousemoveHandler(event);
  77903. },
  77904. /**
  77905. * Method: mousemove
  77906. * 鼠标(手指)移动响应函数。
  77907. *
  77908. * Parameters:
  77909. * event - {Event} event。
  77910. *
  77911. */
  77912. mousemove: function mousemove(event) {
  77913. // 拖拽不触发click事件
  77914. this._clickThreshold++;
  77915. event = this._zrenderEventFixed(event);
  77916. this._lastX = this._mouseX;
  77917. this._lastY = this._mouseY;
  77918. this._mouseX = SUtil_SUtil.Util_event.getX(event);
  77919. this._mouseY = SUtil_SUtil.Util_event.getY(event);
  77920. var dx = this._mouseX - this._lastX;
  77921. var dy = this._mouseY - this._lastY;
  77922. // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGSTART事件
  77923. // 避免手抖点击误认为拖拽
  77924. // if (this._mouseX - this._lastX > 1 || this._mouseY - this._lastY > 1) {
  77925. this._processDragStart(event);
  77926. // }
  77927. this._hasfound = 0;
  77928. this._event = event;
  77929. this._iterateAndFindHover();
  77930. // 找到的在迭代函数里做了处理,没找到得在迭代完后处理
  77931. if (!this._hasfound) {
  77932. // 过滤首次拖拽产生的mouseout和dragLeave
  77933. if (!this._draggingTarget || this._lastHover && this._lastHover != this._draggingTarget) {
  77934. // 可能出现SuperMap.LevelRenderer.Config.EVENT.MOUSEOUT事件
  77935. this._processOutShape(event);
  77936. // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGLEAVE事件
  77937. this._processDragLeave(event);
  77938. }
  77939. this._lastHover = null;
  77940. this.storage.delHover();
  77941. this.painter.clearHover();
  77942. }
  77943. // set cursor for root element
  77944. var cursor = '';
  77945. // 如果存在拖拽中元素,被拖拽的图形元素最后addHover
  77946. if (this._draggingTarget) {
  77947. this.storage.drift(this._draggingTarget.id, dx, dy);
  77948. this._draggingTarget.modSelf();
  77949. this.storage.addHover(this._draggingTarget);
  77950. } else if (this._isMouseDown) {
  77951. // Layer dragging
  77952. var layers = this.painter.getLayers();
  77953. var needsRefresh = false;
  77954. for (var z in layers) {
  77955. if (z !== 'hover') {
  77956. var layer = layers[z];
  77957. if (layer.panable) {
  77958. // PENDING
  77959. cursor = 'move';
  77960. // Keep the mouse center when scaling
  77961. layer.position[0] += dx;
  77962. layer.position[1] += dy;
  77963. needsRefresh = true;
  77964. layer.dirty = true;
  77965. }
  77966. }
  77967. }
  77968. if (needsRefresh) {
  77969. this.painter.refresh();
  77970. }
  77971. }
  77972. if (this._draggingTarget || this._hasfound && this._lastHover.draggable) {
  77973. cursor = 'move';
  77974. } else if (this._hasfound && this._lastHover.clickable) {
  77975. cursor = 'pointer';
  77976. }
  77977. this.root.style.cursor = cursor;
  77978. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEMOVE事件
  77979. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEMOVE, event);
  77980. if (this._draggingTarget || this._hasfound || this.storage.hasHoverShape()) {
  77981. this.painter.refreshHover();
  77982. }
  77983. },
  77984. /**
  77985. * Method: mouseout
  77986. * 鼠标(手指)离开响应函数。
  77987. *
  77988. * Parameters:
  77989. * event - {Event} event。
  77990. *
  77991. */
  77992. mouseout: function mouseout(event) {
  77993. event = this._zrenderEventFixed(event);
  77994. var element = event.toElement || event.relatedTarget;
  77995. if (element != this.root) {
  77996. while (element && element.nodeType != 9) {
  77997. // 忽略包含在root中的dom引起的mouseOut
  77998. if (element == this.root) {
  77999. this._mousemoveHandler(event);
  78000. return;
  78001. }
  78002. element = element.parentNode;
  78003. }
  78004. }
  78005. event.zrenderX = this._lastX;
  78006. event.zrenderY = this._lastY;
  78007. this.root.style.cursor = '';
  78008. this._isMouseDown = 0;
  78009. this._processOutShape(event);
  78010. this._processDrop(event);
  78011. this._processDragEnd(event);
  78012. this.painter.refreshHover();
  78013. this.dispatch(Config.EVENT.GLOBALOUT, event);
  78014. },
  78015. /**
  78016. * Method: mousedown
  78017. * 鼠标(手指)按下响应函数。
  78018. *
  78019. * Parameters:
  78020. * event - {Event} event。
  78021. *
  78022. */
  78023. mousedown: function mousedown(event) {
  78024. // 重置 clickThreshold
  78025. this._clickThreshold = 0;
  78026. if (this._lastDownButton == 2) {
  78027. this._lastDownButton = event.button;
  78028. this._mouseDownTarget = null;
  78029. // 仅作为关闭右键菜单使用
  78030. return;
  78031. }
  78032. this._lastMouseDownMoment = new Date();
  78033. event = this._zrenderEventFixed(event);
  78034. this._isMouseDown = 1;
  78035. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEDOWN事件
  78036. this._mouseDownTarget = this._lastHover;
  78037. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEDOWN, event);
  78038. this._lastDownButton = event.button;
  78039. },
  78040. /**
  78041. * Method: mouseup
  78042. * 鼠标(手指)抬起响应函数。
  78043. *
  78044. * Parameters:
  78045. * event - {Event} event。
  78046. *
  78047. */
  78048. mouseup: function mouseup(event) {
  78049. event = this._zrenderEventFixed(event);
  78050. this.root.style.cursor = '';
  78051. this._isMouseDown = 0;
  78052. this._mouseDownTarget = null;
  78053. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEUP事件
  78054. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEUP, event);
  78055. this._processDrop(event);
  78056. this._processDragEnd(event);
  78057. },
  78058. /**
  78059. * Method: touchstart
  78060. * Touch 开始响应函数。
  78061. *
  78062. * Parameters:
  78063. * event - {Event} event。
  78064. *
  78065. */
  78066. touchstart: function touchstart(event) {
  78067. // SUtil.Util_event.stop(event);// 阻止浏览器默认事件,重要
  78068. event = this._zrenderEventFixed(event, true);
  78069. this._lastTouchMoment = new Date();
  78070. // 平板补充一次findHover
  78071. this._mobildFindFixed(event);
  78072. this._mousedownHandler(event);
  78073. },
  78074. /**
  78075. * Method: touchmove
  78076. * Touch 移动响应函数。
  78077. *
  78078. * Parameters:
  78079. * event - {Event} event。
  78080. *
  78081. */
  78082. touchmove: function touchmove(event) {
  78083. event = this._zrenderEventFixed(event, true);
  78084. this._mousemoveHandler(event);
  78085. if (this._isDragging) {
  78086. SUtil_SUtil.Util_event.stop(event); // 阻止浏览器默认事件,重要
  78087. }
  78088. },
  78089. /**
  78090. * Method: touchend
  78091. * Touch 结束响应函数。
  78092. *
  78093. * Parameters:
  78094. * event - {Event} event。
  78095. *
  78096. */
  78097. touchend: function touchend(event) {
  78098. // SUtil.Util_event.stop(event);// 阻止浏览器默认事件,重要
  78099. event = this._zrenderEventFixed(event, true);
  78100. this._mouseupHandler(event);
  78101. var now = new Date();
  78102. if (now - this._lastTouchMoment < Config.EVENT.touchClickDelay) {
  78103. this._mobildFindFixed(event);
  78104. this._clickHandler(event);
  78105. if (now - this._lastClickMoment < Config.EVENT.touchClickDelay / 2) {
  78106. this._dblclickHandler(event);
  78107. if (this._lastHover && this._lastHover.clickable) {
  78108. SUtil_SUtil.Util_event.stop(event); // 阻止浏览器默认事件,重要
  78109. }
  78110. }
  78111. this._lastClickMoment = now;
  78112. }
  78113. this.painter.clearHover();
  78114. }
  78115. };
  78116. initDomHandler(Handler_assertThisInitialized(_this));
  78117. // 初始化,事件绑定,支持的所有事件都由如下原生事件计算得来
  78118. if (window.addEventListener) {
  78119. window.addEventListener('resize', _this._resizeHandler);
  78120. if (SUtil_SUtil.Util_env.os.tablet || SUtil_SUtil.Util_env.os.phone) {
  78121. // mobile支持
  78122. root.addEventListener('touchstart', _this._touchstartHandler);
  78123. root.addEventListener('touchmove', _this._touchmoveHandler);
  78124. root.addEventListener('touchend', _this._touchendHandler);
  78125. } else {
  78126. // mobile的click/move/up/down自己模拟
  78127. root.addEventListener('click', _this._clickHandler);
  78128. root.addEventListener('dblclick', _this._dblclickHandler);
  78129. root.addEventListener('mousewheel', _this._mousewheelHandler);
  78130. root.addEventListener('mousemove', _this._mousemoveHandler);
  78131. root.addEventListener('mousedown', _this._mousedownHandler);
  78132. root.addEventListener('mouseup', _this._mouseupHandler);
  78133. }
  78134. root.addEventListener('DOMMouseScroll', _this._mousewheelHandler);
  78135. root.addEventListener('mouseout', _this._mouseoutHandler);
  78136. } else {
  78137. window.attachEvent('onresize', _this._resizeHandler);
  78138. root.attachEvent('onclick', _this._clickHandler);
  78139. //root.attachEvent('ondblclick ', this._dblclickHandler);
  78140. root.ondblclick = _this._dblclickHandler;
  78141. root.attachEvent('onmousewheel', _this._mousewheelHandler);
  78142. root.attachEvent('onmousemove', _this._mousemoveHandler);
  78143. root.attachEvent('onmouseout', _this._mouseoutHandler);
  78144. root.attachEvent('onmousedown', _this._mousedownHandler);
  78145. root.attachEvent('onmouseup', _this._mouseupHandler);
  78146. }
  78147. // 辅助函数 start
  78148. /**
  78149. * Method: bind1Arg
  78150. * bind 一个参数的 function。
  78151. *
  78152. * Parameters:
  78153. * handler - {function} 要 bind 的 function。
  78154. * context - {Object} 运行时 this 环境。
  78155. *
  78156. * Returns:
  78157. * {function}
  78158. */
  78159. function bind1Arg(handler, context) {
  78160. return function (e) {
  78161. return handler.call(context, e);
  78162. };
  78163. }
  78164. /*
  78165. // bind 两个参数的 function
  78166. function bind2Arg(handler, context) {
  78167. return function (arg1, arg2) {
  78168. return handler.call(context, arg1, arg2);
  78169. };
  78170. }
  78171. */
  78172. // bind 三个参数的 function
  78173. function bind3Arg(handler, context) {
  78174. return function (arg1, arg2, arg3) {
  78175. return handler.call(context, arg1, arg2, arg3);
  78176. };
  78177. }
  78178. /**
  78179. * Method: initDomHandler
  78180. * 为控制类实例初始化 dom 事件处理函数。
  78181. *
  78182. * Parameters:
  78183. * instance - {<LevelRenderer.Handler>} 控制类实例 。
  78184. *
  78185. * Returns:
  78186. * {function}
  78187. */
  78188. function initDomHandler(instance) {
  78189. var domHandlerNames = ['resize', 'click', 'dblclick', 'mousewheel', 'mousemove', 'mouseout', 'mouseup', 'mousedown', 'touchstart', 'touchend', 'touchmove'];
  78190. var len = domHandlerNames.length;
  78191. while (len--) {
  78192. var name = domHandlerNames[len];
  78193. instance['_' + name + 'Handler'] = bind1Arg(domHandlers[name], instance);
  78194. }
  78195. }
  78196. /**
  78197. * Method: findHover
  78198. * 迭代函数,查找 hover 到的图形元素并即时做些事件分发。
  78199. *
  78200. * Parameters:
  78201. * shape - {Object} 图形。
  78202. * x - {number} 鼠标 x。
  78203. * y - {number} 鼠标 y。
  78204. *
  78205. * Returns:
  78206. * {boolean} 是否找到图形。
  78207. *
  78208. */
  78209. function findHover(shape, x, y) {
  78210. var me = this;
  78211. if (me._draggingTarget && me._draggingTarget.id == shape.id // 迭代到当前拖拽的图形上
  78212. || shape.isSilent() // 打酱油的路过,啥都不响应的shape~
  78213. ) {
  78214. return false;
  78215. }
  78216. var event = me._event;
  78217. if (shape.isCover(x, y)) {
  78218. if (shape.hoverable) {
  78219. // SMIC-修改 - start
  78220. if (shape.isHoverByRefDataID && shape.isHoverByRefDataID === true) {
  78221. if (shape.refDataID) {
  78222. var fid = shape.refDataID;
  78223. //me.painter.clearHover();
  78224. //me.storage.delHover();
  78225. var hoverGroup = null;
  78226. if (shape.refDataHoverGroup) {
  78227. hoverGroup = shape.refDataHoverGroup;
  78228. }
  78229. //查找同一个用户数据 feature 的所有图形
  78230. var shapeList = me.storage._shapeList;
  78231. for (var i = 0, len = shapeList.length; i < len; i++) {
  78232. var si = shapeList[i];
  78233. if (si.refDataID && fid === si.refDataID) {
  78234. if (hoverGroup) {
  78235. if (si.refDataHoverGroup && hoverGroup === si.refDataHoverGroup) {
  78236. me.storage.addHover(si);
  78237. }
  78238. } else {
  78239. me.storage.addHover(si);
  78240. }
  78241. }
  78242. }
  78243. }
  78244. } else {
  78245. me.storage.addHover(shape);
  78246. }
  78247. //初始代码:
  78248. // me.storage.addHover(shape);
  78249. // SMIC-修改 - end
  78250. }
  78251. // 查找是否在 clipShape 中
  78252. var p = shape.parent;
  78253. while (p) {
  78254. if (p.clipShape && !p.clipShape.isCover(me._mouseX, me._mouseY)) {
  78255. // 已经被祖先 clip 掉了
  78256. return false;
  78257. }
  78258. p = p.parent;
  78259. }
  78260. if (me._lastHover != shape) {
  78261. me._processOutShape(event);
  78262. // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGLEAVE事件
  78263. me._processDragLeave(event);
  78264. me._lastHover = shape;
  78265. // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGENTER事件
  78266. me._processDragEnter(event);
  78267. }
  78268. me._processOverShape(event);
  78269. // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGOVER
  78270. me._processDragOver(event);
  78271. me._hasfound = 1;
  78272. return true; // 找到则中断迭代查找
  78273. }
  78274. return false;
  78275. }
  78276. // 辅助函数 end
  78277. return _this;
  78278. }
  78279. /**
  78280. * @function LevelRenderer.Handler.prototype.destroy
  78281. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为null。
  78282. */
  78283. Handler_createClass(Handler, [{
  78284. key: "destroy",
  78285. value: function destroy() {
  78286. this.dispose();
  78287. this._lastX = null;
  78288. this._lastY = null;
  78289. this._mouseX = null;
  78290. this._mouseY = null;
  78291. this._findHover = null;
  78292. Eventful.prototype.destroy.apply(this, arguments);
  78293. }
  78294. /**
  78295. * @function LevelRenderer.Handler.prototype.on
  78296. * @description 自定义事件绑定。
  78297. * @param {string} eventName - 事件名称,resize、hover、drag等。
  78298. * @param {function} handler - 响应函数。
  78299. * @returns {LevelRenderer.Handler} this。
  78300. */
  78301. }, {
  78302. key: "on",
  78303. value: function on(eventName, handler) {
  78304. this.bind(eventName, handler);
  78305. return this;
  78306. }
  78307. /**
  78308. * @function LevelRenderer.Handler.prototype.un
  78309. * @description 自定义事件解除绑定。
  78310. * @param {string} eventName - 事件名称,resize、hover、drag等。
  78311. * @param {function} handler - 响应函数。
  78312. * @returns {LevelRenderer.Handler} this。
  78313. */
  78314. }, {
  78315. key: "un",
  78316. value: function un(eventName, handler) {
  78317. this.unbind(eventName, handler);
  78318. return this;
  78319. }
  78320. /**
  78321. * @function LevelRenderer.Handler.prototype.trigger
  78322. * @description 事件触发。
  78323. * @param {string} eventName - 事件名称,resize、hover、drag等。
  78324. * @param {event} eventArgs - dom事件对象。
  78325. */
  78326. }, {
  78327. key: "trigger",
  78328. value: function trigger(eventName, eventArgs) {
  78329. var EVENT = Config.EVENT;
  78330. switch (eventName) {
  78331. case EVENT.RESIZE:
  78332. case EVENT.CLICK:
  78333. case EVENT.DBLCLICK:
  78334. case EVENT.MOUSEWHEEL:
  78335. case EVENT.MOUSEMOVE:
  78336. case EVENT.MOUSEDOWN:
  78337. case EVENT.MOUSEUP:
  78338. case EVENT.MOUSEOUT:
  78339. this['_' + eventName + 'Handler'](eventArgs);
  78340. break;
  78341. }
  78342. }
  78343. /**
  78344. * @function LevelRenderer.Handler.prototype.dispose
  78345. * @description 释放,解绑所有事件。
  78346. */
  78347. }, {
  78348. key: "dispose",
  78349. value: function dispose() {
  78350. var root = this.root;
  78351. if (window.removeEventListener) {
  78352. window.removeEventListener('resize', this._resizeHandler);
  78353. if (SUtil_SUtil.Util_env.os.tablet || SUtil_SUtil.Util_env.os.phone) {
  78354. // mobile支持
  78355. root.removeEventListener('touchstart', this._touchstartHandler);
  78356. root.removeEventListener('touchmove', this._touchmoveHandler);
  78357. root.removeEventListener('touchend', this._touchendHandler);
  78358. } else {
  78359. // mobile的click自己模拟
  78360. root.removeEventListener('click', this._clickHandler);
  78361. root.removeEventListener('dblclick', this._dblclickHandler);
  78362. root.removeEventListener('mousewheel', this._mousewheelHandler);
  78363. root.removeEventListener('mousemove', this._mousemoveHandler);
  78364. root.removeEventListener('mousedown', this._mousedownHandler);
  78365. root.removeEventListener('mouseup', this._mouseupHandler);
  78366. }
  78367. root.removeEventListener('DOMMouseScroll', this._mousewheelHandler);
  78368. root.removeEventListener('mouseout', this._mouseoutHandler);
  78369. } else {
  78370. window.detachEvent('onresize', this._resizeHandler);
  78371. root.detachEvent('onclick', this._clickHandler);
  78372. root.detachEvent('dblclick', this._dblclickHandler);
  78373. root.detachEvent('onmousewheel', this._mousewheelHandler);
  78374. root.detachEvent('onmousemove', this._mousemoveHandler);
  78375. root.detachEvent('onmouseout', this._mouseoutHandler);
  78376. root.detachEvent('onmousedown', this._mousedownHandler);
  78377. root.detachEvent('onmouseup', this._mouseupHandler);
  78378. }
  78379. this.root = null;
  78380. this._domHover = null;
  78381. this.storage = null;
  78382. this.painter = null;
  78383. this.un();
  78384. }
  78385. /**
  78386. * Method: _processDragStart
  78387. * 拖拽开始。
  78388. *
  78389. * Parameters:
  78390. * event - {Object} 事件对象。
  78391. *
  78392. */
  78393. }, {
  78394. key: "_processDragStart",
  78395. value: function _processDragStart(event) {
  78396. var _lastHover = this._lastHover;
  78397. if (this._isMouseDown && _lastHover && _lastHover.draggable && !this._draggingTarget && this._mouseDownTarget == _lastHover) {
  78398. // 拖拽点击生效时长阀门,某些场景需要降低拖拽敏感度
  78399. if (_lastHover.dragEnableTime && new Date() - this._lastMouseDownMoment < _lastHover.dragEnableTime) {
  78400. return;
  78401. }
  78402. var _draggingTarget = _lastHover;
  78403. this._draggingTarget = _draggingTarget;
  78404. this._isDragging = 1;
  78405. _draggingTarget.invisible = true;
  78406. this.storage.mod(_draggingTarget.id);
  78407. // 分发 Config.EVENT.DRAGSTART事件
  78408. this._dispatchAgency(_draggingTarget, Config.EVENT.DRAGSTART, event);
  78409. this.painter.refresh();
  78410. }
  78411. }
  78412. /**
  78413. * Method: _processDragEnter
  78414. * 拖拽进入目标元素。
  78415. *
  78416. * Parameters:
  78417. * event - {Object} 事件对象。
  78418. *
  78419. */
  78420. }, {
  78421. key: "_processDragEnter",
  78422. value: function _processDragEnter(event) {
  78423. if (this._draggingTarget) {
  78424. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGENTER事件
  78425. this._dispatchAgency(this._lastHover, Config.EVENT.DRAGENTER, event, this._draggingTarget);
  78426. }
  78427. }
  78428. /**
  78429. * Method: _processDragOver
  78430. * 拖拽在目标元素上移动。
  78431. *
  78432. * Parameters:
  78433. * event - {Object} 事件对象。
  78434. *
  78435. */
  78436. }, {
  78437. key: "_processDragOver",
  78438. value: function _processDragOver(event) {
  78439. if (this._draggingTarget) {
  78440. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGOVER事件
  78441. this._dispatchAgency(this._lastHover, Config.EVENT.DRAGOVER, event, this._draggingTarget);
  78442. }
  78443. }
  78444. /**
  78445. * Method: _processDragLeave
  78446. * 拖拽离开目标元素。
  78447. *
  78448. * Parameters:
  78449. * event - {Object} 事件对象。
  78450. *
  78451. */
  78452. }, {
  78453. key: "_processDragLeave",
  78454. value: function _processDragLeave(event) {
  78455. if (this._draggingTarget) {
  78456. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGLEAVE事件
  78457. this._dispatchAgency(this._lastHover, Config.EVENT.DRAGLEAVE, event, this._draggingTarget);
  78458. }
  78459. }
  78460. /**
  78461. * Method: _processDrop
  78462. * 拖拽在目标元素上完成。
  78463. *
  78464. * Parameters:
  78465. * event - {Object} 事件对象。
  78466. *
  78467. */
  78468. }, {
  78469. key: "_processDrop",
  78470. value: function _processDrop(event) {
  78471. if (this._draggingTarget) {
  78472. this._draggingTarget.invisible = false;
  78473. this.storage.mod(this._draggingTarget.id);
  78474. this.painter.refresh();
  78475. // 分发SuperMap.LevelRenderer.Config.EVENT.DROP事件
  78476. this._dispatchAgency(this._lastHover, Config.EVENT.DROP, event, this._draggingTarget);
  78477. }
  78478. }
  78479. /**
  78480. * Method: _processDragEnd
  78481. * 拖拽结束。
  78482. *
  78483. * Parameters:
  78484. * event - {Object} 事件对象。
  78485. *
  78486. */
  78487. }, {
  78488. key: "_processDragEnd",
  78489. value: function _processDragEnd(event) {
  78490. if (this._draggingTarget) {
  78491. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGEND事件
  78492. this._dispatchAgency(this._draggingTarget, Config.EVENT.DRAGEND, event);
  78493. this._lastHover = null;
  78494. }
  78495. this._isDragging = 0;
  78496. this._draggingTarget = null;
  78497. }
  78498. /**
  78499. * Method: _processOverShape
  78500. * 鼠标在某个图形元素上移动。
  78501. *
  78502. * Parameters:
  78503. * event - {Object} 事件对象。
  78504. *
  78505. */
  78506. }, {
  78507. key: "_processOverShape",
  78508. value: function _processOverShape(event) {
  78509. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEOVER事件
  78510. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEOVER, event);
  78511. }
  78512. /**
  78513. * Method: _processOutShape
  78514. * 鼠标离开某个图形元素。
  78515. *
  78516. * Parameters:
  78517. * event - {Object} 事件对象。
  78518. *
  78519. */
  78520. }, {
  78521. key: "_processOutShape",
  78522. value: function _processOutShape(event) {
  78523. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEOUT事件
  78524. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEOUT, event);
  78525. }
  78526. /**
  78527. * Method: _dispatchAgency
  78528. * 鼠标离开某个图形元素。
  78529. *
  78530. * Parameters:
  78531. * targetShape - {Object} 目标图形元素。
  78532. * eventName - {Object} 事件名称。
  78533. * event - {Object} 事件对象。
  78534. * draggedShape - {Object} 拖拽事件特有,当前被拖拽图形元素。
  78535. *
  78536. */
  78537. }, {
  78538. key: "_dispatchAgency",
  78539. value: function _dispatchAgency(targetShape, eventName, event, draggedShape) {
  78540. var eventHandler = 'on' + eventName;
  78541. var eventPacket = {
  78542. type: eventName,
  78543. event: event,
  78544. target: targetShape,
  78545. cancelBubble: false
  78546. };
  78547. var el = targetShape;
  78548. if (draggedShape) {
  78549. eventPacket.dragged = draggedShape;
  78550. }
  78551. while (el) {
  78552. el[eventHandler] && (eventPacket.cancelBubble = el[eventHandler](eventPacket));
  78553. el.dispatch(eventName, eventPacket);
  78554. el = el.parent;
  78555. if (eventPacket.cancelBubble) {
  78556. break;
  78557. }
  78558. }
  78559. if (targetShape) {
  78560. // 冒泡到顶级 zrender 对象
  78561. if (!eventPacket.cancelBubble) {
  78562. this.dispatch(eventName, eventPacket);
  78563. }
  78564. } else if (!draggedShape) {
  78565. // 无hover目标,无拖拽对象,原生事件分发
  78566. this.dispatch(eventName, {
  78567. type: eventName,
  78568. event: event
  78569. });
  78570. }
  78571. }
  78572. /**
  78573. * Method: _iterateAndFindHover
  78574. * 迭代寻找 hover shape。
  78575. *
  78576. */
  78577. }, {
  78578. key: "_iterateAndFindHover",
  78579. value: function _iterateAndFindHover() {
  78580. var invTransform = SUtil_SUtil.Util_matrix.create();
  78581. var list = this.storage.getShapeList();
  78582. var currentZLevel;
  78583. var currentLayer;
  78584. var tmp = [0, 0];
  78585. for (var i = list.length - 1; i >= 0; i--) {
  78586. var shape = list[i];
  78587. if (currentZLevel !== shape.zlevel) {
  78588. currentLayer = this.painter.getLayer(shape.zlevel, currentLayer);
  78589. tmp[0] = this._mouseX;
  78590. tmp[1] = this._mouseY;
  78591. if (currentLayer.needTransform) {
  78592. SUtil_SUtil.Util_matrix.invert(invTransform, currentLayer.transform);
  78593. SUtil_SUtil.Util_vector.applyTransform(tmp, tmp, invTransform);
  78594. }
  78595. }
  78596. if (this._findHover(shape, tmp[0], tmp[1])) {
  78597. break;
  78598. }
  78599. }
  78600. }
  78601. /**
  78602. * Method: _mobildFindFixed
  78603. * touch 有指尖错觉,四向尝试,让touch上的点击更好触发事件。
  78604. *
  78605. * Parameters:
  78606. * event - {Object} 事件对象。
  78607. *
  78608. */
  78609. }, {
  78610. key: "_mobildFindFixed",
  78611. value: function _mobildFindFixed(event) {
  78612. // touch指尖错觉的尝试偏移量配置
  78613. var MOBILE_TOUCH_OFFSETS = [{
  78614. x: 10
  78615. }, {
  78616. x: -20
  78617. }, {
  78618. x: 10,
  78619. y: 10
  78620. }, {
  78621. y: -20
  78622. }];
  78623. this._lastHover = null;
  78624. this._mouseX = event.zrenderX;
  78625. this._mouseY = event.zrenderY;
  78626. this._event = event;
  78627. this._iterateAndFindHover();
  78628. for (var i = 0; !this._lastHover && i < MOBILE_TOUCH_OFFSETS.length; i++) {
  78629. var offset = MOBILE_TOUCH_OFFSETS[i];
  78630. offset.x && (this._mouseX += offset.x);
  78631. offset.y && (this._mouseX += offset.y);
  78632. this._iterateAndFindHover();
  78633. }
  78634. if (this._lastHover) {
  78635. event.zrenderX = this._mouseX;
  78636. event.zrenderY = this._mouseY;
  78637. }
  78638. }
  78639. /**
  78640. * Method: _zrenderEventFixed
  78641. * 如果存在第三方嵌入的一些dom触发的事件,或touch事件,需要转换一下事件坐标 。
  78642. *
  78643. * Parameters:
  78644. * event - {Object} 事件。
  78645. * isTouch - {boolean} 是否触摸。
  78646. *
  78647. */
  78648. }, {
  78649. key: "_zrenderEventFixed",
  78650. value: function _zrenderEventFixed(event, isTouch) {
  78651. if (event.zrenderFixed) {
  78652. return event;
  78653. }
  78654. if (!isTouch) {
  78655. event = event || window.event;
  78656. // 进入对象优先~
  78657. var target = event.toElement || event.relatedTarget || event.srcElement || event.target;
  78658. if (target && target != this._domHover) {
  78659. event.zrenderX = (typeof event.offsetX != 'undefined' ? event.offsetX : event.layerX) + target.offsetLeft;
  78660. event.zrenderY = (typeof event.offsetY != 'undefined' ? event.offsetY : event.layerY) + target.offsetTop;
  78661. }
  78662. } else {
  78663. var touch = event.type != 'touchend' ? event.targetTouches[0] : event.changedTouches[0];
  78664. if (touch) {
  78665. var rBounding = this.root.getBoundingClientRect();
  78666. // touch事件坐标是全屏的~
  78667. event.zrenderX = touch.clientX - rBounding.left;
  78668. event.zrenderY = touch.clientY - rBounding.top;
  78669. }
  78670. }
  78671. event.zrenderFixed = 1;
  78672. return event;
  78673. }
  78674. // SMIC-方法扩展 - start
  78675. /**
  78676. * @function LevelRenderer.Handler.prototype.getLastHoverOne
  78677. * @description 获取单个高亮图形
  78678. */
  78679. }, {
  78680. key: "getLastHoverOne",
  78681. value: function getLastHoverOne() {
  78682. if (this._lastHover) {
  78683. return this._lastHover;
  78684. }
  78685. return null;
  78686. }
  78687. // SMIC-方法扩展 - end
  78688. }]);
  78689. return Handler;
  78690. }(Eventful);
  78691. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Easing.js
  78692. function Easing_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  78693. function Easing_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  78694. function Easing_createClass(Constructor, protoProps, staticProps) { if (protoProps) Easing_defineProperties(Constructor.prototype, protoProps); if (staticProps) Easing_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  78695. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  78696. * This program are made available under the terms of the Apache License, Version 2.0
  78697. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  78698. /**
  78699. * @class LevelRenderer.Animation.easing
  78700. * @category Visualization Theme
  78701. * @classdesc 缓动
  78702. * @private
  78703. */
  78704. // 缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js
  78705. // http://sole.github.io/tween.js/examples/03_graphs.html
  78706. var Easing = /*#__PURE__*/function () {
  78707. function Easing() {
  78708. Easing_classCallCheck(this, Easing);
  78709. this.CLASS_NAME = "SuperMap.LevelRenderer.Animation.easing";
  78710. }
  78711. /**
  78712. * @function LevelRenderer.Animation.easing.destroy
  78713. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  78714. */
  78715. Easing_createClass(Easing, [{
  78716. key: "destroy",
  78717. value: function destroy() {}
  78718. /**
  78719. * @function LevelRenderer.Animation.easing.Linear
  78720. * @description 线性缓动
  78721. * @param {number} k - 参数
  78722. * @return {number} 输入值
  78723. */
  78724. }, {
  78725. key: "Linear",
  78726. value: function Linear(k) {
  78727. return k;
  78728. }
  78729. /**
  78730. * @function LevelRenderer.Animation.easing.QuadraticIn
  78731. * @description 二次方的缓动(t^2)
  78732. * @param {number} k - 参数
  78733. * @return {number} 二次方的缓动的值
  78734. */
  78735. }, {
  78736. key: "QuadraticIn",
  78737. value: function QuadraticIn(k) {
  78738. return k * k;
  78739. }
  78740. /**
  78741. * @function LevelRenderer.Animation.easing.QuadraticOut
  78742. * @description 返回按二次方缓动退出的值
  78743. * @param {number} k - 参数
  78744. * @return {number} 按二次方缓动退出的值
  78745. */
  78746. }, {
  78747. key: "QuadraticOut",
  78748. value: function QuadraticOut(k) {
  78749. return k * (2 - k);
  78750. }
  78751. /**
  78752. * @function LevelRenderer.Animation.easing.QuadraticInOut
  78753. * @description 返回按二次方缓动进入和退出的值
  78754. * @param {number} k - 参数
  78755. * @return {number} 按二次方缓动进入和退出的值
  78756. */
  78757. }, {
  78758. key: "QuadraticInOut",
  78759. value: function QuadraticInOut(k) {
  78760. if ((k *= 2) < 1) {
  78761. return 0.5 * k * k;
  78762. }
  78763. return -0.5 * (--k * (k - 2) - 1);
  78764. }
  78765. /**
  78766. * @function LevelRenderer.Animation.easing.CubicIn
  78767. * @description 三次方的缓动(t^3)
  78768. * @param {number} k - 参数
  78769. * @return {number} 按三次方缓动的值
  78770. */
  78771. }, {
  78772. key: "CubicIn",
  78773. value: function CubicIn(k) {
  78774. return k * k * k;
  78775. }
  78776. /**
  78777. * @function LevelRenderer.Animation.easing.CubicOut
  78778. * @description 返回按三次方缓动退出的值
  78779. * @param {number} k - 参数
  78780. * @return {number} 按三次方缓动退出的值
  78781. */
  78782. }, {
  78783. key: "CubicOut",
  78784. value: function CubicOut(k) {
  78785. return --k * k * k + 1;
  78786. }
  78787. /**
  78788. * @function LevelRenderer.Animation.easing.CubicInOut
  78789. * @description 返回按三次方缓动进入退出的值
  78790. * @param {number} k - 参数
  78791. * @return {number} 按三次方缓动进入退出的值
  78792. */
  78793. }, {
  78794. key: "CubicInOut",
  78795. value: function CubicInOut(k) {
  78796. if ((k *= 2) < 1) {
  78797. return 0.5 * k * k * k;
  78798. }
  78799. return 0.5 * ((k -= 2) * k * k + 2);
  78800. }
  78801. /**
  78802. * @function LevelRenderer.Animation.easing.QuarticIn
  78803. * @description 返回按四次方缓动进入的值
  78804. * @param {number} k - 参数
  78805. * @return {number} 按四次方缓动进入的值
  78806. */
  78807. }, {
  78808. key: "QuarticIn",
  78809. value: function QuarticIn(k) {
  78810. return k * k * k * k;
  78811. }
  78812. /**
  78813. * @function LevelRenderer.Animation.easing.QuarticOut
  78814. * @description 返回按四次方缓动退出的值
  78815. * @param {number} k - 参数
  78816. * @return {number} 按四次方缓动退出的值
  78817. */
  78818. }, {
  78819. key: "QuarticOut",
  78820. value: function QuarticOut(k) {
  78821. return 1 - --k * k * k * k;
  78822. }
  78823. /**
  78824. * @function LevelRenderer.Animation.easing.QuarticInOut
  78825. * @description 返回按四次方缓动进入退出的值
  78826. * @param {number} k - 参数
  78827. * @return {number} 按四次方缓动进入退出的值
  78828. */
  78829. }, {
  78830. key: "QuarticInOut",
  78831. value: function QuarticInOut(k) {
  78832. if ((k *= 2) < 1) {
  78833. return 0.5 * k * k * k * k;
  78834. }
  78835. return -0.5 * ((k -= 2) * k * k * k - 2);
  78836. }
  78837. // 五次方的缓动(t^5)
  78838. /**
  78839. * @function LevelRenderer.Animation.easing.QuinticIn
  78840. * @description 返回按五次方缓动的值
  78841. * @param {number} k - 参数
  78842. * @return {number} 按五次方缓动的值
  78843. */
  78844. }, {
  78845. key: "QuinticIn",
  78846. value: function QuinticIn(k) {
  78847. return k * k * k * k * k;
  78848. }
  78849. /**
  78850. * @function LevelRenderer.Animation.easing.QuinticOut
  78851. * @description 返回按五次方缓动退出的值
  78852. * @param {number} k - 参数
  78853. * @return {number} 按五次方缓动退出的值
  78854. */
  78855. }, {
  78856. key: "QuinticOut",
  78857. value: function QuinticOut(k) {
  78858. return --k * k * k * k * k + 1;
  78859. }
  78860. /**
  78861. * @function LevelRenderer.Animation.easing.QuinticInOut
  78862. * @description 返回按五次方缓动进入退出的值
  78863. * @param {number} k - 参数
  78864. * @return {number} 按五次方缓动进入退出的值
  78865. */
  78866. }, {
  78867. key: "QuinticInOut",
  78868. value: function QuinticInOut(k) {
  78869. if ((k *= 2) < 1) {
  78870. return 0.5 * k * k * k * k * k;
  78871. }
  78872. return 0.5 * ((k -= 2) * k * k * k * k + 2);
  78873. }
  78874. // 正弦曲线的缓动(sin(t))
  78875. /**
  78876. * @function LevelRenderer.Animation.easing.SinusoidalIn
  78877. * @description 返回按正弦曲线的缓动进入的值
  78878. * @param {number} k - 参数
  78879. * @return {number} 按正弦曲线的缓动进入的值
  78880. */
  78881. }, {
  78882. key: "SinusoidalIn",
  78883. value: function SinusoidalIn(k) {
  78884. return 1 - Math.cos(k * Math.PI / 2);
  78885. }
  78886. /**
  78887. * @function LevelRenderer.Animation.easing.SinusoidalOut
  78888. * @description 返回按正弦曲线的缓动退出的值
  78889. * @param {number} k - 参数
  78890. * @return {number} 按正弦曲线的缓动退出的值
  78891. */
  78892. }, {
  78893. key: "SinusoidalOut",
  78894. value: function SinusoidalOut(k) {
  78895. return Math.sin(k * Math.PI / 2);
  78896. }
  78897. /**
  78898. * @function LevelRenderer.Animation.easing.SinusoidalInOut
  78899. * @description 返回按正弦曲线的缓动进入退出的值
  78900. * @param {number} k - 参数
  78901. * @return {number} 按正弦曲线的缓动进入退出的值
  78902. */
  78903. }, {
  78904. key: "SinusoidalInOut",
  78905. value: function SinusoidalInOut(k) {
  78906. return 0.5 * (1 - Math.cos(Math.PI * k));
  78907. }
  78908. // 指数曲线的缓动(2^t)
  78909. /**
  78910. * @function LevelRenderer.Animation.easing.ExponentialIn
  78911. * @description 返回按指数曲线的缓动进入的值
  78912. * @param {number} k - 参数
  78913. * @return {number} 按指数曲线的缓动进入的值
  78914. */
  78915. }, {
  78916. key: "ExponentialIn",
  78917. value: function ExponentialIn(k) {
  78918. return k === 0 ? 0 : Math.pow(1024, k - 1);
  78919. }
  78920. /**
  78921. * @function LevelRenderer.Animation.easing.ExponentialOut
  78922. * @description 返回按指数曲线的缓动退出的值
  78923. * @param {number} k - 参数
  78924. * @return {number} 按指数曲线的缓动退出的值
  78925. */
  78926. }, {
  78927. key: "ExponentialOut",
  78928. value: function ExponentialOut(k) {
  78929. return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);
  78930. }
  78931. /**
  78932. * @function LevelRenderer.Animation.easing.ExponentialInOut
  78933. * @description 返回按指数曲线的缓动进入退出的值
  78934. * @param {number} k - 参数
  78935. * @return {number} 按指数曲线的缓动进入退出的值
  78936. */
  78937. }, {
  78938. key: "ExponentialInOut",
  78939. value: function ExponentialInOut(k) {
  78940. if (k === 0) {
  78941. return 0;
  78942. }
  78943. if (k === 1) {
  78944. return 1;
  78945. }
  78946. if ((k *= 2) < 1) {
  78947. return 0.5 * Math.pow(1024, k - 1);
  78948. }
  78949. return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);
  78950. }
  78951. // 圆形曲线的缓动(sqrt(1-t^2))
  78952. /**
  78953. * @function LevelRenderer.Animation.easing.CircularIn
  78954. * @description 返回按圆形曲线的缓动进入的值
  78955. * @param {number} k - 参数
  78956. * @return {number} 按圆形曲线的缓动进入的值
  78957. */
  78958. }, {
  78959. key: "CircularIn",
  78960. value: function CircularIn(k) {
  78961. return 1 - Math.sqrt(1 - k * k);
  78962. }
  78963. /**
  78964. * @function LevelRenderer.Animation.easing.CircularOut
  78965. * @description 返回按圆形曲线的缓动退出的值
  78966. * @param {number} k - 参数
  78967. * @return {number} 按圆形曲线的缓动退出的值
  78968. */
  78969. }, {
  78970. key: "CircularOut",
  78971. value: function CircularOut(k) {
  78972. return Math.sqrt(1 - --k * k);
  78973. }
  78974. /**
  78975. * @function LevelRenderer.Animation.easing.CircularInOut
  78976. * @description 返回按圆形曲线的缓动进入退出的值
  78977. * @param {number} k - 参数
  78978. * @return {number} 按圆形曲线的缓动进入退出的值
  78979. */
  78980. }, {
  78981. key: "CircularInOut",
  78982. value: function CircularInOut(k) {
  78983. if ((k *= 2) < 1) {
  78984. return -0.5 * (Math.sqrt(1 - k * k) - 1);
  78985. }
  78986. return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);
  78987. }
  78988. // 创建类似于弹簧在停止前来回振荡的动画
  78989. /**
  78990. * @function LevelRenderer.Animation.easing.ElasticIn
  78991. * @description 返回按类似于弹簧在停止前来回振荡的动画的缓动进入的值
  78992. * @param {number} k - 参数
  78993. * @return {number} 按类似于弹簧在停止前来回振荡的动画的缓动进入的值
  78994. */
  78995. }, {
  78996. key: "ElasticIn",
  78997. value: function ElasticIn(k) {
  78998. var s;
  78999. var a = 0.1;
  79000. var p = 0.4;
  79001. if (k === 0) {
  79002. return 0;
  79003. }
  79004. if (k === 1) {
  79005. return 1;
  79006. }
  79007. if (a < 1) {
  79008. a = 1;
  79009. s = p / 4;
  79010. } else {
  79011. s = p * Math.asin(1 / a) / (2 * Math.PI);
  79012. }
  79013. return -(a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));
  79014. }
  79015. /**
  79016. * @function LevelRenderer.Animation.easing.ElasticOut
  79017. * @description 返回按类似于弹簧在停止前来回振荡的动画的缓动退出的值
  79018. * @param {number} k - 参数
  79019. * @return {number} 按类似于弹簧在停止前来回振荡的动画的缓动退出的值
  79020. */
  79021. }, {
  79022. key: "ElasticOut",
  79023. value: function ElasticOut(k) {
  79024. var s;
  79025. var a = 0.1;
  79026. var p = 0.4;
  79027. if (k === 0) {
  79028. return 0;
  79029. }
  79030. if (k === 1) {
  79031. return 1;
  79032. }
  79033. if (a < 1) {
  79034. a = 1;
  79035. s = p / 4;
  79036. } else {
  79037. s = p * Math.asin(1 / a) / (2 * Math.PI);
  79038. }
  79039. return a * Math.pow(2, -10 * k) * Math.sin((k - s) * (2 * Math.PI) / p) + 1;
  79040. }
  79041. /**
  79042. * @function LevelRenderer.Animation.easing.ElasticInOut
  79043. * @description 返回按类似于弹簧在停止前来回振荡的动画的缓动进入退出的值
  79044. * @param {number} k - 参数
  79045. * @return {number} 按类似于弹簧在停止前来回振荡的动画的缓动进入退出的值
  79046. */
  79047. }, {
  79048. key: "ElasticInOut",
  79049. value: function ElasticInOut(k) {
  79050. var s;
  79051. var a = 0.1;
  79052. var p = 0.4;
  79053. if (k === 0) {
  79054. return 0;
  79055. }
  79056. if (k === 1) {
  79057. return 1;
  79058. }
  79059. if (a < 1) {
  79060. a = 1;
  79061. s = p / 4;
  79062. } else {
  79063. s = p * Math.asin(1 / a) / (2 * Math.PI);
  79064. }
  79065. if ((k *= 2) < 1) {
  79066. return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));
  79067. }
  79068. return a * Math.pow(2, -10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;
  79069. }
  79070. // 在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动
  79071. /**
  79072. * @function LevelRenderer.Animation.easing.BackIn
  79073. * @description 返回按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入的值
  79074. * @param {number} k - 参数
  79075. * @return {number} 按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入的值
  79076. */
  79077. }, {
  79078. key: "BackIn",
  79079. value: function BackIn(k) {
  79080. var s = 1.70158;
  79081. return k * k * ((s + 1) * k - s);
  79082. }
  79083. /**
  79084. * @function LevelRenderer.Animation.easing.BackOut
  79085. * @description 返回按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动退出的值
  79086. * @param {number} k - 参数
  79087. * @return {number} 按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动退出的值
  79088. */
  79089. }, {
  79090. key: "BackOut",
  79091. value: function BackOut(k) {
  79092. var s = 1.70158;
  79093. return --k * k * ((s + 1) * k + s) + 1;
  79094. }
  79095. /**
  79096. * @function LevelRenderer.Animation.easing.BackInOut
  79097. * @description 返回按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入退出的值
  79098. * @param {number} k - 参数
  79099. * @return {number} 按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入退出的值
  79100. */
  79101. }, {
  79102. key: "BackInOut",
  79103. value: function BackInOut(k) {
  79104. var s = 1.70158 * 1.525;
  79105. if ((k *= 2) < 1) {
  79106. return 0.5 * (k * k * ((s + 1) * k - s));
  79107. }
  79108. return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);
  79109. }
  79110. // 创建弹跳效果
  79111. /**
  79112. * @function LevelRenderer.Animation.easing.BounceIn
  79113. * @description 返回按弹跳效果的缓动进入的值
  79114. * @param {number} k - 参数
  79115. * @return {number} 按弹跳效果的缓动进入的值
  79116. */
  79117. }, {
  79118. key: "BounceIn",
  79119. value: function BounceIn(k) {
  79120. return 1 - this.BounceOut(1 - k);
  79121. }
  79122. /**
  79123. * @function LevelRenderer.Animation.easing.BounceOut
  79124. * @description 返回按弹跳效果的缓动退出的值
  79125. * @param {number} k - 参数
  79126. * @return {number} 按弹跳效果的缓动退出的值
  79127. */
  79128. }, {
  79129. key: "BounceOut",
  79130. value: function BounceOut(k) {
  79131. if (k < 1 / 2.75) {
  79132. return 7.5625 * k * k;
  79133. } else if (k < 2 / 2.75) {
  79134. return 7.5625 * (k -= 1.5 / 2.75) * k + 0.75;
  79135. } else if (k < 2.5 / 2.75) {
  79136. return 7.5625 * (k -= 2.25 / 2.75) * k + 0.9375;
  79137. } else {
  79138. return 7.5625 * (k -= 2.625 / 2.75) * k + 0.984375;
  79139. }
  79140. }
  79141. /**
  79142. * @function LevelRenderer.Animation.easing.BounceInOut
  79143. * @description 返回按弹跳效果的缓动进入退出的值
  79144. * @param {number} k - 参数
  79145. * @return {number} 按弹跳效果的缓动进入退出的值
  79146. */
  79147. }, {
  79148. key: "BounceInOut",
  79149. value: function BounceInOut(k) {
  79150. if (k < 0.5) {
  79151. return this.BounceIn(k * 2) * 0.5;
  79152. }
  79153. return this.BounceOut(k * 2 - 1) * 0.5 + 0.5;
  79154. }
  79155. }]);
  79156. return Easing;
  79157. }();
  79158. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Clip.js
  79159. function Clip_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  79160. function Clip_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  79161. function Clip_createClass(Constructor, protoProps, staticProps) { if (protoProps) Clip_defineProperties(Constructor.prototype, protoProps); if (staticProps) Clip_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  79162. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  79163. * This program are made available under the terms of the Apache License, Version 2.0
  79164. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  79165. /**
  79166. * @class LevelRenderer.Animation.Clip
  79167. * @category Visualization Theme
  79168. * @classdesc 动画片段
  79169. * @param {Object} options - 参数。
  79170. * @param {Object} options.target - 动画对象,可以是数组,如果是数组的话会批量分发 onframe 等事件。
  79171. * @param {number} [options.life=1000] - 动画时长。
  79172. * @param {number} [options.delay=0] - 动画延迟时间。
  79173. * @param {boolean} [options.loop=true] - 是否循环。
  79174. * @param {number} [options.gap=0] - 循环的间隔时间。
  79175. * @param {Object} options.onframe - 帧。
  79176. * @param {boolean} options.easing - 是否消除。
  79177. * @param {boolean} options.ondestroy - 是否销毁。
  79178. * @param {boolean} options.onrestart - 是否重播。
  79179. * @private
  79180. */
  79181. var Clip = /*#__PURE__*/function () {
  79182. function Clip(options) {
  79183. Clip_classCallCheck(this, Clip);
  79184. this._targetPool = options.target || {};
  79185. if (!(this._targetPool instanceof Array)) {
  79186. this._targetPool = [this._targetPool];
  79187. }
  79188. // 生命周期
  79189. this._life = options.life || 1000;
  79190. // 延时
  79191. this._delay = options.delay || 0;
  79192. // 开始时间
  79193. this._startTime = new Date().getTime() + this._delay; // 单位毫秒
  79194. // 结束时间
  79195. this._endTime = this._startTime + this._life * 1000;
  79196. // 是否循环
  79197. this.loop = typeof options.loop == 'undefined' ? false : options.loop;
  79198. this.gap = options.gap || 0;
  79199. this.easing = options.easing || 'Linear';
  79200. this.onframe = options.onframe;
  79201. this.ondestroy = options.ondestroy;
  79202. this.onrestart = options.onrestart;
  79203. this.CLASS_NAME = "SuperMap.LevelRenderer.Animation.Clip";
  79204. }
  79205. /**
  79206. * @function LevelRenderer.Animation.Clip.prototype.destroy
  79207. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  79208. */
  79209. Clip_createClass(Clip, [{
  79210. key: "destroy",
  79211. value: function destroy() {}
  79212. }, {
  79213. key: "step",
  79214. value: function step(time) {
  79215. var easing = new Easing();
  79216. var percent = (time - this._startTime) / this._life;
  79217. // 还没开始
  79218. if (percent < 0) {
  79219. return;
  79220. }
  79221. percent = Math.min(percent, 1);
  79222. var easingFunc = typeof this.easing == 'string' ? easing[this.easing] : this.easing;
  79223. var schedule = typeof easingFunc === 'function' ? easingFunc(percent) : percent;
  79224. this.fire('frame', schedule);
  79225. // 结束
  79226. if (percent == 1) {
  79227. if (this.loop) {
  79228. this.restart();
  79229. // 重新开始周期
  79230. // 抛出而不是直接调用事件直到 stage.update 后再统一调用这些事件
  79231. return 'restart';
  79232. }
  79233. // 动画完成将这个控制器标识为待删除
  79234. // 在Animation.update中进行批量删除
  79235. this._needsRemove = true;
  79236. return 'destroy';
  79237. }
  79238. return null;
  79239. }
  79240. }, {
  79241. key: "restart",
  79242. value: function restart() {
  79243. var time = new Date().getTime();
  79244. var remainder = (time - this._startTime) % this._life;
  79245. this._startTime = new Date().getTime() - remainder + this.gap;
  79246. }
  79247. }, {
  79248. key: "fire",
  79249. value: function fire(eventType, arg) {
  79250. for (var i = 0, len = this._targetPool.length; i < len; i++) {
  79251. if (this['on' + eventType]) {
  79252. this['on' + eventType](this._targetPool[i], arg);
  79253. }
  79254. }
  79255. }
  79256. }]);
  79257. return Clip;
  79258. }();
  79259. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Animation.js
  79260. function Animation_typeof(obj) { "@babel/helpers - typeof"; return Animation_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Animation_typeof(obj); }
  79261. function Animation_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  79262. function Animation_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  79263. function Animation_createClass(Constructor, protoProps, staticProps) { if (protoProps) Animation_defineProperties(Constructor.prototype, protoProps); if (staticProps) Animation_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  79264. function Animation_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Animation_setPrototypeOf(subClass, superClass); }
  79265. function Animation_setPrototypeOf(o, p) { Animation_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Animation_setPrototypeOf(o, p); }
  79266. function Animation_createSuper(Derived) { var hasNativeReflectConstruct = Animation_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Animation_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Animation_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Animation_possibleConstructorReturn(this, result); }; }
  79267. function Animation_possibleConstructorReturn(self, call) { if (call && (Animation_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Animation_assertThisInitialized(self); }
  79268. function Animation_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  79269. function Animation_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  79270. function Animation_getPrototypeOf(o) { Animation_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Animation_getPrototypeOf(o); }
  79271. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  79272. * This program are made available under the terms of the Apache License, Version 2.0
  79273. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  79274. /**
  79275. * @class LevelRenderer.Animation
  79276. * @classdesc 动画主类, 调度和管理所有动画控制器
  79277. * @category Visualization Theme
  79278. * @extends {LevelRenderer.Eventful}
  79279. * @param {Object} options - 动画参数。
  79280. * @param {Object} options.onframe - onframe。
  79281. * @param {Object} options.stage - stage。
  79282. * @example 例如:
  79283. * (start code)
  79284. * var animation = new LevelRenderer.Animation();
  79285. * var obj = {
  79286. * x: 100,
  79287. * y: 100
  79288. * };
  79289. * animation.animate(node.position)
  79290. * .when(1000, {
  79291. * x: 500,
  79292. * y: 500
  79293. * })
  79294. * .when(2000, {
  79295. * x: 100,
  79296. * y: 100
  79297. * })
  79298. * .start('spline');
  79299. * (end)
  79300. * @private
  79301. */
  79302. var Animation = /*#__PURE__*/function (_Eventful) {
  79303. Animation_inherits(Animation, _Eventful);
  79304. var _super = Animation_createSuper(Animation);
  79305. function Animation(options) {
  79306. var _this;
  79307. Animation_classCallCheck(this, Animation);
  79308. _this = _super.call(this, options);
  79309. options = options || {};
  79310. /**
  79311. * @member {Object} LevelRenderer.Animation.prototype.stage
  79312. * @description stage。
  79313. */
  79314. _this.stage = {};
  79315. /**
  79316. * @member {Object} LevelRenderer.Animation.prototype.onframe
  79317. * @description onframe。
  79318. */
  79319. _this.onframe = function () {};
  79320. /**
  79321. * @member {Array} LevelRenderer.Animation.prototype._clips
  79322. * @description _clips。
  79323. */
  79324. _this._clips = [];
  79325. /**
  79326. * @member {boolean} LevelRenderer.Animation.prototype._running
  79327. * @description _running。
  79328. */
  79329. _this._running = false;
  79330. /**
  79331. * @member {number} LevelRenderer.Animation.prototype._time
  79332. * @description _time。
  79333. */
  79334. _this._time = 0;
  79335. Util_Util.extend(Animation_assertThisInitialized(_this), options);
  79336. _this.CLASS_NAME = "SuperMap.LevelRenderer.Animation";
  79337. return _this;
  79338. }
  79339. /**
  79340. * @function LevelRenderer.Animation.prototype.add
  79341. * @description 添加动画片段。
  79342. * @param {LevelRenderer.Animation.Clip} clip - 动画片段。
  79343. */
  79344. Animation_createClass(Animation, [{
  79345. key: "add",
  79346. value: function add(clip) {
  79347. this._clips.push(clip);
  79348. }
  79349. /**
  79350. * @function LevelRenderer.Animation.prototype.remove
  79351. * @description 删除动画片段。
  79352. * @param {LevelRenderer.Animation.Clip} clip - 动画片段。
  79353. */
  79354. }, {
  79355. key: "remove",
  79356. value: function remove(clip) {
  79357. var idx = new levelRenderer_Util_Util().indexOf(this._clips, clip);
  79358. if (idx >= 0) {
  79359. this._clips.splice(idx, 1);
  79360. }
  79361. }
  79362. /**
  79363. * @function LevelRenderer.Animation.prototype.update
  79364. * @description 更新动画片段。
  79365. */
  79366. }, {
  79367. key: "_update",
  79368. value: function _update() {
  79369. var time = new Date().getTime();
  79370. var delta = time - this._time;
  79371. var clips = this._clips;
  79372. var len = clips.length;
  79373. var deferredEvents = [];
  79374. var deferredClips = [];
  79375. for (var i = 0; i < len; i++) {
  79376. var clip = clips[i];
  79377. var e = clip.step(time);
  79378. // Throw out the events need to be called after
  79379. // stage.update, like destroy
  79380. if (e) {
  79381. deferredEvents.push(e);
  79382. deferredClips.push(clip);
  79383. }
  79384. }
  79385. if (this.stage.update) {
  79386. this.stage.update();
  79387. }
  79388. // Remove the finished clip
  79389. for (var _i2 = 0; _i2 < len;) {
  79390. if (clips[_i2]._needsRemove) {
  79391. clips[_i2] = clips[len - 1];
  79392. clips.pop();
  79393. len--;
  79394. } else {
  79395. _i2++;
  79396. }
  79397. }
  79398. len = deferredEvents.length;
  79399. for (var _i4 = 0; _i4 < len; _i4++) {
  79400. deferredClips[_i4].fire(deferredEvents[_i4]);
  79401. }
  79402. this._time = time;
  79403. this.onframe(delta);
  79404. this.dispatch('frame', delta);
  79405. }
  79406. /**
  79407. * @function LevelRenderer.Animation.prototype.start
  79408. * @description 开始运行动画。
  79409. */
  79410. }, {
  79411. key: "start",
  79412. value: function start() {
  79413. var requestAnimationFrame = window.requestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function (func) {
  79414. setTimeout(func, 16);
  79415. };
  79416. var self = this;
  79417. this._running = true;
  79418. function step() {
  79419. if (self._running) {
  79420. self._update();
  79421. requestAnimationFrame(step);
  79422. }
  79423. }
  79424. this._time = new Date().getTime();
  79425. requestAnimationFrame(step);
  79426. }
  79427. /**
  79428. * @function LevelRenderer.Animation.prototype.stop
  79429. * @description 停止运行动画。
  79430. */
  79431. }, {
  79432. key: "stop",
  79433. value: function stop() {
  79434. this._running = false;
  79435. }
  79436. /**
  79437. * @function LevelRenderer.Animation.prototype.clear
  79438. * @description 清除所有动画片段。
  79439. */
  79440. }, {
  79441. key: "clear",
  79442. value: function clear() {
  79443. this._clips = [];
  79444. }
  79445. /**
  79446. * @function LevelRenderer.Animation.prototype.animate
  79447. * @description 对一个目标创建一个animator对象,可以指定目标中的属性使用动画。
  79448. * @param {Object} target - 目标对象。
  79449. * @param {Object} options - 动画参数选项。
  79450. * @param {boolean} [options.loop=false] - 是否循环播放动画。
  79451. * @param {function} [options.getter] - 如果指定getter函数,会通过getter函数取属性值。
  79452. * @param {function} [options.setter] - 如果指定setter函数,会通过setter函数设置属性值。
  79453. * @returns {LevelRenderer.Animation.Animator} Animator。
  79454. */
  79455. }, {
  79456. key: "animate",
  79457. value: function animate(target, options) {
  79458. options = options || {};
  79459. var deferred = new Animator(target, options.loop, options.getter, options.setter);
  79460. deferred.animation = this;
  79461. return deferred;
  79462. }
  79463. }], [{
  79464. key: "_interpolateNumber",
  79465. value: function _interpolateNumber(p0, p1, percent) {
  79466. return (p1 - p0) * percent + p0;
  79467. }
  79468. }, {
  79469. key: "_interpolateArray",
  79470. value: function _interpolateArray(p0, p1, percent, out, arrDim) {
  79471. var len = p0.length;
  79472. if (arrDim == 1) {
  79473. for (var i = 0; i < len; i++) {
  79474. out[i] = Animation._interpolateNumber(p0[i], p1[i], percent);
  79475. }
  79476. } else {
  79477. var len2 = p0[0].length;
  79478. for (var _i6 = 0; _i6 < len; _i6++) {
  79479. for (var j = 0; j < len2; j++) {
  79480. out[_i6][j] = Animation._interpolateNumber(p0[_i6][j], p1[_i6][j], percent);
  79481. }
  79482. }
  79483. }
  79484. }
  79485. }, {
  79486. key: "_isArrayLike",
  79487. value: function _isArrayLike(data) {
  79488. switch (Animation_typeof(data)) {
  79489. case 'undefined':
  79490. case 'string':
  79491. return false;
  79492. }
  79493. return typeof data.length !== 'undefined';
  79494. }
  79495. }, {
  79496. key: "_catmullRomInterpolateArray",
  79497. value: function _catmullRomInterpolateArray(p0, p1, p2, p3, t, t2, t3, out, arrDim) {
  79498. var len = p0.length;
  79499. if (arrDim == 1) {
  79500. for (var i = 0; i < len; i++) {
  79501. out[i] = Animation._catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3);
  79502. }
  79503. } else {
  79504. var len2 = p0[0].length;
  79505. for (var _i8 = 0; _i8 < len; _i8++) {
  79506. for (var j = 0; j < len2; j++) {
  79507. out[_i8][j] = Animation._catmullRomInterpolate(p0[_i8][j], p1[_i8][j], p2[_i8][j], p3[_i8][j], t, t2, t3);
  79508. }
  79509. }
  79510. }
  79511. }
  79512. }, {
  79513. key: "_catmullRomInterpolate",
  79514. value: function _catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) {
  79515. var v0 = (p2 - p0) * 0.5;
  79516. var v1 = (p3 - p1) * 0.5;
  79517. return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1;
  79518. }
  79519. }, {
  79520. key: "_cloneValue",
  79521. value: function _cloneValue(value) {
  79522. var arraySlice = Array.prototype.slice;
  79523. if (Animation._isArrayLike(value)) {
  79524. var len = value.length;
  79525. if (Animation._isArrayLike(value[0])) {
  79526. var ret = [];
  79527. for (var i = 0; i < len; i++) {
  79528. ret.push(arraySlice.call(value[i]));
  79529. }
  79530. return ret;
  79531. } else {
  79532. return arraySlice.call(value);
  79533. }
  79534. } else {
  79535. return value;
  79536. }
  79537. }
  79538. }, {
  79539. key: "rgba2String",
  79540. value: function rgba2String(rgba) {
  79541. rgba[0] = Math.floor(rgba[0]);
  79542. rgba[1] = Math.floor(rgba[1]);
  79543. rgba[2] = Math.floor(rgba[2]);
  79544. return 'rgba(' + rgba.join(',') + ')';
  79545. }
  79546. }]);
  79547. return Animation;
  79548. }(Eventful);
  79549. /**
  79550. * @class LevelRenderer.Animation.Animator
  79551. */
  79552. var Animator = /*#__PURE__*/function () {
  79553. /**
  79554. * @function LevelRenderer.Animation.Animator.prototype.animate
  79555. * @description 构造函数
  79556. * @param {Object} target - 目标对象。
  79557. * @param {Object} options - 动画参数选项。
  79558. * @param {boolean} [loop=false] - 是否循环播放动画。
  79559. * @param {function} [getterl] - 如果指定getter函数,会通过getter函数取属性值。
  79560. * @param {function} [setter] - 如果指定setter函数,会通过setter函数设置属性值。
  79561. */
  79562. function Animator(target, loop, getter, setter) {
  79563. Animation_classCallCheck(this, Animator);
  79564. /**
  79565. * @member {Object} LevelRenderer.Animation.Animator.prototype._tracks
  79566. * @description _tracks。
  79567. */
  79568. this._tracks = {};
  79569. /**
  79570. * @member {Object} LevelRenderer.Animation.Animator.prototype._target
  79571. * @description _target。
  79572. */
  79573. this._target = target;
  79574. /**
  79575. * @member {boolean} LevelRenderer.Animation.Animator.prototype._loop
  79576. * @description _loop。
  79577. */
  79578. this._loop = loop || false;
  79579. /**
  79580. * @member {function} LevelRenderer.Animation.Animator.prototype._getter
  79581. * @description _getter。
  79582. */
  79583. this._getter = getter || _defaultGetter;
  79584. /**
  79585. * @member {function} LevelRenderer.Animation.Animator.prototype._setter
  79586. * @description _setter。
  79587. */
  79588. this._setter = setter || _defaultSetter;
  79589. /**
  79590. * @member {number} LevelRenderer.Animation.Animator.prototype._clipCount
  79591. * @description _clipCount。
  79592. */
  79593. this._clipCount = 0;
  79594. /**
  79595. * @member {number} LevelRenderer.Animation.Animator.prototype._delay
  79596. * @description _delay。
  79597. */
  79598. this._delay = 0;
  79599. /**
  79600. * @member {Array} LevelRenderer.Animation.Animator.prototype._doneList
  79601. * @description _doneList。
  79602. */
  79603. this._doneList = [];
  79604. /**
  79605. * @member {Array} LevelRenderer.Animation.Animator.prototype._onframeList
  79606. * @description _onframeList。
  79607. */
  79608. this._onframeList = [];
  79609. /**
  79610. * @member {Array} LevelRenderer.Animation.Animator.prototype._clipList
  79611. * @description _clipList。
  79612. */
  79613. this._clipList = [];
  79614. this.CLASS_NAME = "SuperMap.LevelRenderer.Animation.Animator";
  79615. //Function
  79616. function _defaultGetter(target, key) {
  79617. return target[key];
  79618. }
  79619. function _defaultSetter(target, key, value) {
  79620. target[key] = value;
  79621. }
  79622. }
  79623. /**
  79624. * @function LevelRenderer.Animation.Animator.prototype.when
  79625. * @description 设置动画关键帧
  79626. * @param {number} time - 关键帧时间,单位是ms
  79627. * @param {Object} props - 关键帧的属性值,key-value表示
  79628. * @returns {LevelRenderer.Animation.Animator} Animator
  79629. */
  79630. Animation_createClass(Animator, [{
  79631. key: "when",
  79632. value: function when(time /* ms */, props) {
  79633. for (var propName in props) {
  79634. if (!this._tracks[propName]) {
  79635. this._tracks[propName] = [];
  79636. // If time is 0
  79637. // Then props is given initialize value
  79638. // Else
  79639. // Initialize value from current prop value
  79640. if (time !== 0) {
  79641. this._tracks[propName].push({
  79642. time: 0,
  79643. value: Animation._cloneValue(this._getter(this._target, propName))
  79644. });
  79645. }
  79646. }
  79647. this._tracks[propName].push({
  79648. time: parseInt(time, 10),
  79649. value: props[propName]
  79650. });
  79651. }
  79652. return this;
  79653. }
  79654. /**
  79655. * @function LevelRenderer.Animation.Animator.prototype.during
  79656. * @description 添加动画每一帧的回调函数
  79657. * @param {RequestCallback} callback - 回调函数
  79658. * @returns {LevelRenderer.Animation.Animator} Animator
  79659. */
  79660. }, {
  79661. key: "during",
  79662. value: function during(callback) {
  79663. this._onframeList.push(callback);
  79664. return this;
  79665. }
  79666. /**
  79667. * @function LevelRenderer.Animation.Animator.prototype.start
  79668. * @description 开始执行动画
  79669. * @param {(string|function)} easing - 动画缓动函数。详见:<{@link LevelRenderer.Animation.easing}>。
  79670. * @returns {LevelRenderer.Animation.Animator} Animator
  79671. */
  79672. }, {
  79673. key: "start",
  79674. value: function start(easing) {
  79675. var self = this;
  79676. var setter = this._setter;
  79677. var getter = this._getter;
  79678. var onFrameListLen = self._onframeList.length;
  79679. var useSpline = easing === 'spline';
  79680. var ondestroy = function ondestroy() {
  79681. self._clipCount--;
  79682. if (self._clipCount === 0) {
  79683. // Clear all tracks
  79684. self._tracks = {};
  79685. var len = self._doneList.length;
  79686. for (var i = 0; i < len; i++) {
  79687. self._doneList[i].call(self);
  79688. }
  79689. }
  79690. };
  79691. var createTrackClip = function createTrackClip(keyframes, propName) {
  79692. var trackLen = keyframes.length;
  79693. if (!trackLen) {
  79694. return;
  79695. }
  79696. // Guess data type
  79697. var firstVal = keyframes[0].value;
  79698. var isValueArray = Animation._isArrayLike(firstVal);
  79699. var isValueColor = false;
  79700. // For vertices morphing
  79701. var arrDim = isValueArray && Animation._isArrayLike(firstVal[0]) ? 2 : 1;
  79702. // Sort keyframe as ascending
  79703. keyframes.sort(function (a, b) {
  79704. return a.time - b.time;
  79705. });
  79706. var trackMaxTime = keyframes[trackLen - 1].time;
  79707. // Percents of each keyframe
  79708. var kfPercents = [];
  79709. // Value of each keyframe
  79710. var kfValues = [];
  79711. for (var _i10 = 0; _i10 < trackLen; _i10++) {
  79712. kfPercents.push(keyframes[_i10].time / trackMaxTime);
  79713. // Assume value is a color when it is a string
  79714. var value = keyframes[_i10].value;
  79715. if (typeof value == 'string') {
  79716. value = SUtil_SUtil.Util_color.toArray(value);
  79717. if (value.length === 0) {
  79718. // Invalid color
  79719. value[0] = value[1] = value[2] = 0;
  79720. value[3] = 1;
  79721. }
  79722. isValueColor = true;
  79723. }
  79724. kfValues.push(value);
  79725. }
  79726. // Cache the key of last frame to speed up when
  79727. // animation playback is sequency
  79728. var cacheKey = 0;
  79729. var cachePercent = 0;
  79730. var start;
  79731. var i;
  79732. var w;
  79733. var p0;
  79734. var p1;
  79735. var p2;
  79736. var p3;
  79737. if (isValueColor) {
  79738. var rgba = [0, 0, 0, 0];
  79739. }
  79740. var onframe = function onframe(target, percent) {
  79741. // Find the range keyframes
  79742. // kf1-----kf2---------current--------kf3
  79743. // find kf2 and kf3 and do interpolation
  79744. if (percent < cachePercent) {
  79745. // Start from next key
  79746. start = Math.min(cacheKey + 1, trackLen - 1);
  79747. for (i = start; i >= 0; i--) {
  79748. if (kfPercents[i] <= percent) {
  79749. break;
  79750. }
  79751. }
  79752. i = Math.min(i, trackLen - 2);
  79753. } else {
  79754. for (i = cacheKey; i < trackLen; i++) {
  79755. if (kfPercents[i] > percent) {
  79756. break;
  79757. }
  79758. }
  79759. i = Math.min(i - 1, trackLen - 2);
  79760. }
  79761. cacheKey = i;
  79762. cachePercent = percent;
  79763. var range = kfPercents[i + 1] - kfPercents[i];
  79764. if (range === 0) {
  79765. return;
  79766. } else {
  79767. w = (percent - kfPercents[i]) / range;
  79768. }
  79769. if (useSpline) {
  79770. p1 = kfValues[i];
  79771. p0 = kfValues[i === 0 ? i : i - 1];
  79772. p2 = kfValues[i > trackLen - 2 ? trackLen - 1 : i + 1];
  79773. p3 = kfValues[i > trackLen - 3 ? trackLen - 1 : i + 2];
  79774. if (isValueArray) {
  79775. Animation._catmullRomInterpolateArray(p0, p1, p2, p3, w, w * w, w * w * w, getter(target, propName), arrDim);
  79776. } else {
  79777. var _value;
  79778. if (isValueColor) {
  79779. // value = LevelRenderer.Animation._catmullRomInterpolateArray(
  79780. // p0, p1, p2, p3, w, w * w, w * w * w,
  79781. // rgba, 1
  79782. // );
  79783. _value = Animation.rgba2String(rgba);
  79784. } else {
  79785. _value = Animation._catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w);
  79786. }
  79787. setter(target, propName, _value);
  79788. }
  79789. } else {
  79790. if (isValueArray) {
  79791. Animation._interpolateArray(kfValues[i], kfValues[i + 1], w, getter(target, propName), arrDim);
  79792. } else {
  79793. var _value2;
  79794. if (isValueColor) {
  79795. Animation._interpolateArray(kfValues[i], kfValues[i + 1], w, rgba, 1);
  79796. _value2 = Animation.rgba2String(rgba);
  79797. } else {
  79798. _value2 = Animation._interpolateNumber(kfValues[i], kfValues[i + 1], w);
  79799. }
  79800. setter(target, propName, _value2);
  79801. }
  79802. }
  79803. for (i = 0; i < onFrameListLen; i++) {
  79804. self._onframeList[i](target, percent);
  79805. }
  79806. };
  79807. var clip = new Clip({
  79808. target: self._target,
  79809. life: trackMaxTime,
  79810. loop: self._loop,
  79811. delay: self._delay,
  79812. onframe: onframe,
  79813. ondestroy: ondestroy
  79814. });
  79815. if (easing && easing !== 'spline') {
  79816. clip.easing = easing;
  79817. }
  79818. self._clipList.push(clip);
  79819. self._clipCount++;
  79820. self.animation.add(clip);
  79821. };
  79822. for (var propName in this._tracks) {
  79823. createTrackClip(this._tracks[propName], propName);
  79824. }
  79825. return this;
  79826. }
  79827. /**
  79828. * @function LevelRenderer.Animation.Animator.prototype.stop
  79829. * @description 停止动画
  79830. */
  79831. }, {
  79832. key: "stop",
  79833. value: function stop() {
  79834. for (var i = 0; i < this._clipList.length; i++) {
  79835. var clip = this._clipList[i];
  79836. this.animation.remove(clip);
  79837. }
  79838. this._clipList = [];
  79839. }
  79840. /**
  79841. * @function LevelRenderer.Animation.Animator.prototype.delay
  79842. * @description 设置动画延迟开始的时间
  79843. * @param {number} time - 时间,单位ms
  79844. * @returns {LevelRenderer.Animation.Animator} Animator
  79845. */
  79846. }, {
  79847. key: "delay",
  79848. value: function delay(time) {
  79849. this._delay = time;
  79850. return this;
  79851. }
  79852. /**
  79853. * @function LevelRenderer.Animation.Animator.prototype.done
  79854. * @description 添加动画结束的回调
  79855. * @param {function} cb - Function
  79856. * @returns {LevelRenderer.Animation.Animator} Animator
  79857. */
  79858. }, {
  79859. key: "done",
  79860. value: function done(cb) {
  79861. if (cb) {
  79862. this._doneList.push(cb);
  79863. }
  79864. return this;
  79865. }
  79866. }]);
  79867. return Animator;
  79868. }();
  79869. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Render.js
  79870. function Render_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  79871. function Render_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  79872. function Render_createClass(Constructor, protoProps, staticProps) { if (protoProps) Render_defineProperties(Constructor.prototype, protoProps); if (staticProps) Render_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  79873. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  79874. * This program are made available under the terms of the Apache License, Version 2.0
  79875. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  79876. /**
  79877. * @private
  79878. * @class LevelRenderer.Render
  79879. * @category Visualization Theme
  79880. * @classdesc Render 接口类,对外可用的所有接口都在这里。内部使用非 get 接口统一返回 this 对象,支持链式调用。
  79881. * @param {string} id - 唯一标识。
  79882. * @param {HTMLElement} dom - Dom 对象。
  79883. */
  79884. var Render = /*#__PURE__*/function () {
  79885. function Render(id, dom) {
  79886. Render_classCallCheck(this, Render);
  79887. /**
  79888. * @member {string} LevelRenderer.Render.prototype.id
  79889. * @description 唯一标识。
  79890. */
  79891. this.id = id;
  79892. /**
  79893. * @member {LevelRenderer.Storage} LevelRenderer.Render.prototype.storage
  79894. * @description 图形仓库对象。
  79895. */
  79896. this.storage = new Storage();
  79897. /**
  79898. * @member {LevelRenderer.Painter} LevelRenderer.Render.prototype.painter
  79899. * @description 绘制器对象。
  79900. *
  79901. */
  79902. this.painter = new Painter(dom, this.storage);
  79903. /**
  79904. * @member {LevelRenderer.Handler} LevelRenderer.Render.prototype.handler
  79905. * @description 事件处理对象。
  79906. *
  79907. */
  79908. this.handler = new Handler(dom, this.storage, this.painter);
  79909. /**
  79910. * @member {Array} LevelRenderer.Render.prototype.animatingElements
  79911. * @description 动画控制数组。
  79912. *
  79913. */
  79914. this.animatingElements = [];
  79915. /**
  79916. * @member {LevelRenderer.animation.Animation} LevelRenderer.Render.prototype.animation
  79917. * @description 动画对象。
  79918. *
  79919. */
  79920. this.animation = new Animation({
  79921. stage: {
  79922. update: Render.getFrameCallback(this)
  79923. }
  79924. });
  79925. /**
  79926. * @member {boolean} LevelRenderer.Render.prototype._needsRefreshNextFrame
  79927. * @description 是否需要刷新下一帧。
  79928. *
  79929. */
  79930. this._needsRefreshNextFrame = false;
  79931. this.animation.start();
  79932. this.CLASS_NAME = "SuperMap.LevelRenderer.Render";
  79933. }
  79934. /**
  79935. * @function LevelRenderer.Render.prototype.destory
  79936. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  79937. */
  79938. Render_createClass(Render, [{
  79939. key: "destroy",
  79940. value: function destroy() {
  79941. this.id = null;
  79942. this.storage = null;
  79943. this.painter = null;
  79944. this.handler = null;
  79945. this.animatingElements = null;
  79946. this.animation = null;
  79947. this._needsRefreshNextFrame = null;
  79948. }
  79949. /**
  79950. * @function LevelRenderer.Render.prototype.getId
  79951. * @description 获取实例唯一标识。
  79952. * @return {string} 实例唯一标识。
  79953. */
  79954. }, {
  79955. key: "getId",
  79956. value: function getId() {
  79957. return this.id;
  79958. }
  79959. /**
  79960. * @function LevelRenderer.Render.prototype.addShape
  79961. * @description 添加图形形状到根节点。
  79962. *
  79963. * @param {LevelRenderer.Shape} shape - 图形对象,可用属性全集,详见各 shape。
  79964. * @return {LevelRenderer.Render} this。
  79965. */
  79966. }, {
  79967. key: "addShape",
  79968. value: function addShape(shape) {
  79969. this.storage.addRoot(shape);
  79970. return this;
  79971. }
  79972. /**
  79973. * @function LevelRenderer.Render.prototype.addGroup
  79974. * @description 添加组到根节点。
  79975. *
  79976. * (code)
  79977. * //添加组到根节点例子
  79978. * var render = new LevelRenderer.Render("Render",document.getElementById('lRendertest'));
  79979. * render.clear();
  79980. * var g = new LevelRenderer.Group();
  79981. * g.addChild(new LevelRenderer.Shape.Circle({
  79982. * style: {
  79983. * x: 100,
  79984. * y: 100,
  79985. * r: 20,
  79986. * brushType: 'fill'
  79987. * }
  79988. * }));
  79989. * render.addGroup(g);
  79990. * render.render();
  79991. * (end)
  79992. *
  79993. * @param {LevelRenderer.Group} group - 组对象。
  79994. * @return {LevelRenderer.Render} this。
  79995. */
  79996. }, {
  79997. key: "addGroup",
  79998. value: function addGroup(group) {
  79999. this.storage.addRoot(group);
  80000. return this;
  80001. }
  80002. /**
  80003. * @function LevelRenderer.Render.prototype.delShape
  80004. * @description 从根节点删除图形形状。
  80005. *
  80006. * @param {string} shapeId - 图形对象唯一标识。
  80007. * @return {LevelRenderer.Render} this。
  80008. */
  80009. }, {
  80010. key: "delShape",
  80011. value: function delShape(shapeId) {
  80012. this.storage.delRoot(shapeId);
  80013. return this;
  80014. }
  80015. /**
  80016. * @function LevelRenderer.Render.prototype.delGroup
  80017. * @description 从根节点删除组。
  80018. *
  80019. * @param {string} groupId - 组对象唯一标识。
  80020. * @return {LevelRenderer.Render} this。
  80021. */
  80022. }, {
  80023. key: "delGroup",
  80024. value: function delGroup(groupId) {
  80025. this.storage.delRoot(groupId);
  80026. return this;
  80027. }
  80028. /**
  80029. * @function LevelRenderer.Render.prototype.modShape
  80030. * @description 修改图形形状。
  80031. *
  80032. * @param {string} shapeId - 图形对象唯一标识。
  80033. * @param {LevelRenderer.Shape} shape - 图形对象。
  80034. * @return {LevelRenderer.Render} this。
  80035. */
  80036. }, {
  80037. key: "modShape",
  80038. value: function modShape(shapeId, shape) {
  80039. this.storage.mod(shapeId, shape);
  80040. return this;
  80041. }
  80042. /**
  80043. * @function LevelRenderer.Render.prototype.modGroup
  80044. * @description 修改组。
  80045. *
  80046. * @param {string} groupId - 组对象唯一标识。
  80047. * @param {LevelRenderer.Group} group - 组对象。
  80048. * @return {LevelRenderer.Render} this。
  80049. */
  80050. }, {
  80051. key: "modGroup",
  80052. value: function modGroup(groupId, group) {
  80053. this.storage.mod(groupId, group);
  80054. return this;
  80055. }
  80056. /**
  80057. * @function LevelRenderer.Render.prototype.modLayer
  80058. * @description 修改指定 zlevel 的绘制配置项。
  80059. *
  80060. * @param {string} zLevel - 组对象唯一标识。
  80061. * @param {Object} config - 配置对象。
  80062. * @param {string} clearColor - 每次清空画布的颜色。默认值:0。
  80063. * @param {noolean} motionBlur - 是否开启动态模糊。默认值:false。
  80064. * @param {number} lastFrameAlpha - 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显。默认值:0.7。
  80065. * @param {Array.<number>} position - 层的平移。
  80066. * @param {Array.<number>} rotation - 层的旋转。
  80067. * @param {Array.<number>} scale - 层的缩放。
  80068. * @param {boolean} zoomable - 层是否支持鼠标缩放操作。默认值:false。
  80069. * @param {boolean} panable - 层是否支持鼠标平移操作。默认值:false。
  80070. * @return {LevelRenderer.Render} this。
  80071. */
  80072. }, {
  80073. key: "modLayer",
  80074. value: function modLayer(zLevel, config) {
  80075. this.painter.modLayer(zLevel, config);
  80076. return this;
  80077. }
  80078. /**
  80079. * @function LevelRenderer.Render.prototype.addHoverShape
  80080. * @description 添加额外高亮层显示,仅提供添加方法,每次刷新后高亮层图形均被清空。
  80081. *
  80082. * @param {LevelRenderer.Shape} shape - 图形对象。
  80083. * @return {LevelRenderer.Render} this。
  80084. */
  80085. }, {
  80086. key: "addHoverShape",
  80087. value: function addHoverShape(shape) {
  80088. this.storage.addHover(shape);
  80089. return this;
  80090. }
  80091. /**
  80092. * @function LevelRenderer.Render.prototype.render
  80093. * @description 渲染。
  80094. *
  80095. * @callback {function} callback - 渲染结束后回调函数。
  80096. * @return {LevelRenderer.Render} this。
  80097. */
  80098. }, {
  80099. key: "render",
  80100. value: function render(callback) {
  80101. this.painter.render(callback);
  80102. this._needsRefreshNextFrame = false;
  80103. return this;
  80104. }
  80105. /**
  80106. * @function LevelRenderer.Render.prototype.refresh
  80107. * @description 视图更新。
  80108. *
  80109. * @callback {function} callback - 视图更新后回调函数。
  80110. * @return {LevelRenderer.Render} this。
  80111. */
  80112. }, {
  80113. key: "refresh",
  80114. value: function refresh(callback) {
  80115. this.painter.refresh(callback);
  80116. this._needsRefreshNextFrame = false;
  80117. return this;
  80118. }
  80119. /**
  80120. * @function LevelRenderer.Render.prototype.refreshNextFrame
  80121. * @description 标记视图在浏览器下一帧需要绘制。
  80122. * @return {LevelRenderer.Render} this。
  80123. */
  80124. }, {
  80125. key: "refreshNextFrame",
  80126. value: function refreshNextFrame() {
  80127. this._needsRefreshNextFrame = true;
  80128. return this;
  80129. }
  80130. /**
  80131. * @function LevelRenderer.Render.prototype.refreshHover
  80132. * @description 绘制(视图更新)高亮层。
  80133. * @callback {function} callback - 视图更新后回调函数。
  80134. * @return {LevelRenderer.Render} this。
  80135. */
  80136. }, {
  80137. key: "refreshHover",
  80138. value: function refreshHover(callback) {
  80139. this.painter.refreshHover(callback);
  80140. return this;
  80141. }
  80142. /**
  80143. * @function LevelRenderer.Render.prototype.refreshShapes
  80144. * @description 视图更新。
  80145. *
  80146. * @param {Array.<LevelRenderer.Shape>} shapeList - 需要更新的图形列表。
  80147. * @callback {function} callback - 视图更新后回调函数。
  80148. * @return {LevelRenderer.Render} this。
  80149. */
  80150. }, {
  80151. key: "refreshShapes",
  80152. value: function refreshShapes(shapeList, callback) {
  80153. this.painter.refreshShapes(shapeList, callback);
  80154. return this;
  80155. }
  80156. /**
  80157. * @function LevelRenderer.Render.prototype.resize
  80158. * @description 调整视图大小。
  80159. * @return {LevelRenderer.Render} this。
  80160. */
  80161. }, {
  80162. key: "resize",
  80163. value: function resize() {
  80164. this.painter.resize();
  80165. return this;
  80166. }
  80167. /**
  80168. * @function LevelRenderer.Render.prototype.animate
  80169. * @description 动画。
  80170. *
  80171. * @example
  80172. * zr.animate(circle.id, 'style', false)
  80173. * .when(1000, {x: 10} )
  80174. * .done(function(){ // Animation done })
  80175. * .start()
  80176. *
  80177. *
  80178. * @param {Array.<(LevelRenderer.Shape/LevelRenderer.Group)>} el - 动画对象。
  80179. * @param {string} path - 需要添加动画的属性获取路径,可以通过 a.b.c 来获取深层的属性。若传入对象为<LevelRenderer.Group>,path需为空字符串。
  80180. * @param {function} loop - 动画是否循环。
  80181. * @return {LevelRenderer.animation.Animator} Animator。
  80182. */
  80183. }, {
  80184. key: "animate",
  80185. value: function animate(el, path, loop) {
  80186. if (typeof el === 'string') {
  80187. el = this.storage.get(el);
  80188. }
  80189. if (el) {
  80190. var target;
  80191. if (path) {
  80192. var pathSplitted = path.split('.');
  80193. var prop = el;
  80194. for (var i = 0, l = pathSplitted.length; i < l; i++) {
  80195. if (!prop) {
  80196. continue;
  80197. }
  80198. prop = prop[pathSplitted[i]];
  80199. }
  80200. if (prop) {
  80201. target = prop;
  80202. }
  80203. } else {
  80204. target = el;
  80205. }
  80206. if (!target) {
  80207. SUtil_SUtil.Util_log('Property "' + path + '" is not existed in element ' + el.id);
  80208. return;
  80209. }
  80210. var animatingElements = this.animatingElements;
  80211. if (typeof el.__aniCount === 'undefined') {
  80212. // 正在进行的动画记数
  80213. el.__aniCount = 0;
  80214. }
  80215. if (el.__aniCount === 0) {
  80216. animatingElements.push(el);
  80217. }
  80218. el.__aniCount++;
  80219. return this.animation.animate(target, {
  80220. loop: loop
  80221. }).done(function () {
  80222. el.__aniCount--;
  80223. if (el.__aniCount === 0) {
  80224. // 从animatingElements里移除
  80225. var idx = new levelRenderer_Util_Util().indexOf(animatingElements, el);
  80226. animatingElements.splice(idx, 1);
  80227. }
  80228. });
  80229. } else {
  80230. SUtil_SUtil.Util_log('Element not existed');
  80231. }
  80232. }
  80233. /**
  80234. * @function LevelRenderer.Render.prototype.clearAnimation
  80235. * @description 停止所有动画。
  80236. *
  80237. */
  80238. }, {
  80239. key: "clearAnimation",
  80240. value: function clearAnimation() {
  80241. this.animation.clear();
  80242. }
  80243. /**
  80244. * @function LevelRenderer.Render.prototype.getWidth
  80245. * @description 获取视图宽度。
  80246. * @return {number} 视图宽度。
  80247. */
  80248. }, {
  80249. key: "getWidth",
  80250. value: function getWidth() {
  80251. return this.painter.getWidth();
  80252. }
  80253. /**
  80254. * @function LevelRenderer.Render.prototype.getHeight
  80255. * @description 获取视图高度。
  80256. * @return {number} 视图高度。
  80257. */
  80258. }, {
  80259. key: "getHeight",
  80260. value: function getHeight() {
  80261. return this.painter.getHeight();
  80262. }
  80263. /**
  80264. * @function LevelRenderer.Render.prototype.toDataURL
  80265. * @description 图像导出。
  80266. *
  80267. * @param {string} type - 类型。
  80268. * @param {string} backgroundColor - 背景色,默认值:"#FFFFFF"。
  80269. * @param {string} args - 参数。
  80270. * @return {string} 图片的 Base64 url。
  80271. */
  80272. }, {
  80273. key: "toDataURL",
  80274. value: function toDataURL(type, backgroundColor, args) {
  80275. return this.painter.toDataURL(type, backgroundColor, args);
  80276. }
  80277. /**
  80278. * @function LevelRenderer.Render.prototype.shapeToImage
  80279. * @description 将常规 shape 转成 image shape。
  80280. *
  80281. * @param {LevelRenderer.Shape} e - 图形。
  80282. * @param {number} width - 宽度。
  80283. * @param {number} height - 高度。
  80284. * @return {Object} image shape。
  80285. */
  80286. }, {
  80287. key: "shapeToImage",
  80288. value: function shapeToImage(e, width, height) {
  80289. var id = Util_Util.createUniqueID("SuperMap.LevelRenderer.ToImage_");
  80290. return this.painter.shapeToImage(id, e, width, height);
  80291. }
  80292. /**
  80293. * @function LevelRenderer.Render.prototype.on
  80294. * @description 事件绑定。
  80295. *
  80296. * @param {string} eventName - 事件名称。
  80297. * @param {function} eventHandler - 响应函数。
  80298. * @return {LevelRenderer.Render} this。
  80299. */
  80300. }, {
  80301. key: "on",
  80302. value: function on(eventName, eventHandler) {
  80303. this.handler.on(eventName, eventHandler);
  80304. return this;
  80305. }
  80306. /**
  80307. * @function LevelRenderer.Render.prototype.un
  80308. * @description 事件解绑定,参数为空则解绑所有自定义事件。
  80309. *
  80310. * @param {string} eventName - 事件名称。
  80311. * @param {function} eventHandler - 响应函数。
  80312. * @return {LevelRenderer.Render} this。
  80313. */
  80314. }, {
  80315. key: "un",
  80316. value: function un(eventName, eventHandler) {
  80317. this.handler.un(eventName, eventHandler);
  80318. return this;
  80319. }
  80320. /**
  80321. * @function LevelRenderer.Render.prototype.trigger
  80322. * @description 事件触发。
  80323. *
  80324. * @param {string} eventName - 事件名称,resize,hover,drag,etc。
  80325. * @param {event} event - event dom事件对象。
  80326. * @return {LevelRenderer.Render} this。
  80327. */
  80328. }, {
  80329. key: "trigger",
  80330. value: function trigger(eventName, event) {
  80331. this.handler.trigger(eventName, event);
  80332. this.handler.dispatch(eventName, event);
  80333. return this;
  80334. }
  80335. /**
  80336. * @function LevelRenderer.Render.prototype.clear
  80337. * @description 清除当前 Render 下所有类图的数据和显示,clear 后 MVC 和已绑定事件均还存在在,Render 可用。
  80338. * @return {LevelRenderer.Render} this。
  80339. */
  80340. }, {
  80341. key: "clear",
  80342. value: function clear() {
  80343. this.storage.delRoot();
  80344. this.painter.clear();
  80345. return this;
  80346. }
  80347. /**
  80348. * @function LevelRenderer.Render.prototype.dispose
  80349. * @description 释放当前 Render 实例(删除包括 dom,数据、显示和事件绑定),dispose后 Render 不可用。
  80350. */
  80351. }, {
  80352. key: "dispose",
  80353. value: function dispose() {
  80354. this.animation.stop();
  80355. this.clear();
  80356. this.storage.dispose();
  80357. this.painter.dispose();
  80358. this.handler.dispose();
  80359. this.animation = null;
  80360. this.animatingElements = null;
  80361. this.storage = null;
  80362. this.painter = null;
  80363. this.handler = null;
  80364. // 释放后告诉全局删除对自己的索引,没想到啥好方法
  80365. // zrender.delInstance(this.id);
  80366. }
  80367. // SMIC-方法扩展 - start
  80368. /**
  80369. * @function LevelRenderer.Render.prototype.updateHoverShapes
  80370. * @description 更新设置显示高亮图层。
  80371. *
  80372. * @param {Array.<LevelRenderer.Shape>} shapes - 图形数组。
  80373. * @return {LevelRenderer.Render} this。
  80374. */
  80375. }, {
  80376. key: "updateHoverShapes",
  80377. value: function updateHoverShapes(shapes) {
  80378. this.painter.updateHoverLayer(shapes);
  80379. return this;
  80380. }
  80381. /**
  80382. * @function LevelRenderer.Render.prototype.getAllShapes
  80383. * @description 获取所有图形。
  80384. * @return {Array.<LevelRenderer.Shape>} 图形数组。
  80385. */
  80386. }, {
  80387. key: "getAllShapes",
  80388. value: function getAllShapes() {
  80389. return this.storage._shapeList;
  80390. }
  80391. /**
  80392. * @function LevelRenderer.Render.prototype.clearAll
  80393. * @description 清除高亮和图形图层。
  80394. * @return {LevelRenderer.Render} this。
  80395. */
  80396. }, {
  80397. key: "clearAll",
  80398. value: function clearAll() {
  80399. this.clear();
  80400. this.painter.clearHover();
  80401. return this;
  80402. }
  80403. /**
  80404. * @function LevelRenderer.Render.prototype.getHoverOne
  80405. * @description 获取单个高亮图形,当前鼠标对应。
  80406. * @return {LevelRenderer.Shape} 高亮图形。
  80407. */
  80408. }, {
  80409. key: "getHoverOne",
  80410. value: function getHoverOne() {
  80411. return this.handler.getLastHoverOne();
  80412. }
  80413. }], [{
  80414. key: "getFrameCallback",
  80415. value: function getFrameCallback(renderInstance) {
  80416. return function () {
  80417. var animatingElements = renderInstance.animatingElements;
  80418. //animatingElements instanceof Array 临时解决 destory 报错
  80419. if (animatingElements instanceof Array) {
  80420. for (var i = 0, l = animatingElements.length; i < l; i++) {
  80421. renderInstance.storage.mod(animatingElements[i].id);
  80422. }
  80423. if (animatingElements.length || renderInstance._needsRefreshNextFrame) {
  80424. renderInstance.refresh();
  80425. }
  80426. }
  80427. };
  80428. }
  80429. // SMIC-方法扩展 - end
  80430. }]);
  80431. return Render;
  80432. }();
  80433. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/LevelRenderer.js
  80434. function LevelRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  80435. function LevelRenderer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  80436. function LevelRenderer_createClass(Constructor, protoProps, staticProps) { if (protoProps) LevelRenderer_defineProperties(Constructor.prototype, protoProps); if (staticProps) LevelRenderer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  80437. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  80438. * This program are made available under the terms of the Apache License, Version 2.0
  80439. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  80440. /**
  80441. * @class LevelRenderer
  80442. * @deprecatedclass SuperMap.LevelRenderer
  80443. * @category Visualization Theme
  80444. * @classdesc LevelRenderer 渲染器
  80445. * @example
  80446. * //在渲染器上加上图形
  80447. * var levelRenderer = new LevelRenderer();
  80448. * var zr = levelRenderer.init(document.getElementById('lRendertest'));
  80449. * zr.clear();
  80450. * zr.addShape(new LevelRenderer.Shape.Circle({
  80451. * style:{
  80452. * x : 100,
  80453. * y : 100,
  80454. * r : 50,
  80455. * brushType: 'fill'
  80456. * }
  80457. * }));
  80458. * zr.render();
  80459. * @private
  80460. */
  80461. var LevelRenderer = /*#__PURE__*/function () {
  80462. function LevelRenderer() {
  80463. LevelRenderer_classCallCheck(this, LevelRenderer);
  80464. /**
  80465. * @member {Object} LevelRenderer.prototype._instances
  80466. * @description LevelRenderer 实例 map 索引
  80467. */
  80468. LevelRenderer._instances = {};
  80469. // 工具
  80470. LevelRenderer.Tool = {};
  80471. /**
  80472. * @member {string} LevelRenderer.prototype.version
  80473. * @description 版本。zRender(Baidu)的版本号
  80474. * 记录当前 LevelRenderer 是在 zRender 的那个版本上构建而来。
  80475. * 在每次完整评判和实施由 zRender(Baidu)升级带来的 LevelRenderer 升级后修改。
  80476. */
  80477. this.version = '2.0.4';
  80478. this.CLASS_NAME = "SuperMap.LevelRenderer";
  80479. }
  80480. /**
  80481. * @function LevelRenderer.prototype.destroy
  80482. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为null。
  80483. */
  80484. LevelRenderer_createClass(LevelRenderer, [{
  80485. key: "destroy",
  80486. value: function destroy() {
  80487. this.dispose();
  80488. this.version = null;
  80489. }
  80490. /**
  80491. * @function LevelRenderer.prototype.init
  80492. * @description 创建 LevelRenderer 实例。
  80493. * @param {HTMLElement} dom - 绘图容器。
  80494. * @returns {LevelRenderer} LevelRenderer 实例。
  80495. */
  80496. }, {
  80497. key: "init",
  80498. value: function init(dom) {
  80499. var zr = new Render(Util_Util.createUniqueID("LRenderer_"), dom);
  80500. LevelRenderer._instances[zr.id] = zr;
  80501. return zr;
  80502. }
  80503. /**
  80504. * @function LevelRenderer.prototype.dispose
  80505. * @description LevelRenderer 实例销毁。
  80506. * 可以通过 zrender.dispose(zr) 销毁指定 LevelRenderer.Render 实例。
  80507. * 也可以通过 zr.dispose() 直接销毁
  80508. * @param {LevelRenderer.Render} zr - ZRender对象,不传此参数则销毁全部。
  80509. * @returns {LevelRenderer} this。
  80510. */
  80511. }, {
  80512. key: "dispose",
  80513. value: function dispose(zr) {
  80514. if (zr) {
  80515. zr.dispose();
  80516. this.delInstance(zr.id);
  80517. } else {
  80518. for (var key in LevelRenderer._instances) {
  80519. LevelRenderer._instances[key].dispose();
  80520. }
  80521. LevelRenderer._instances = {};
  80522. }
  80523. return this;
  80524. }
  80525. /**
  80526. * @function LevelRenderer.prototype.getInstance
  80527. * @description 获取 LevelRenderer.Render 实例。
  80528. * @param {string} id - ZRender对象索引。
  80529. * @returns {LevelRenderer.Render} LevelRenderer.Render 实例。
  80530. */
  80531. }, {
  80532. key: "getInstance",
  80533. value: function getInstance(id) {
  80534. return LevelRenderer._instances[id];
  80535. }
  80536. /**
  80537. * @function LevelRenderer.prototype.delInstance
  80538. * @description 删除 zrender 实例,LevelRenderer.Render 实例 dispose 时会调用,删除后 getInstance 则返回 undefined
  80539. * @param {string} id - ZRender对象索引。
  80540. * @param {string} id - LevelRenderer.Render 对象索引。
  80541. * @returns {LevelRenderer} this。
  80542. */
  80543. }, {
  80544. key: "delInstance",
  80545. value: function delInstance(id) {
  80546. delete LevelRenderer._instances[id];
  80547. return this;
  80548. }
  80549. }]);
  80550. return LevelRenderer;
  80551. }();
  80552. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicEllipse.js
  80553. function SmicEllipse_typeof(obj) { "@babel/helpers - typeof"; return SmicEllipse_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicEllipse_typeof(obj); }
  80554. function SmicEllipse_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  80555. function SmicEllipse_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  80556. function SmicEllipse_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicEllipse_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicEllipse_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  80557. function SmicEllipse_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicEllipse_get = Reflect.get.bind(); } else { SmicEllipse_get = function _get(target, property, receiver) { var base = SmicEllipse_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicEllipse_get.apply(this, arguments); }
  80558. function SmicEllipse_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicEllipse_getPrototypeOf(object); if (object === null) break; } return object; }
  80559. function SmicEllipse_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicEllipse_setPrototypeOf(subClass, superClass); }
  80560. function SmicEllipse_setPrototypeOf(o, p) { SmicEllipse_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicEllipse_setPrototypeOf(o, p); }
  80561. function SmicEllipse_createSuper(Derived) { var hasNativeReflectConstruct = SmicEllipse_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicEllipse_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicEllipse_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicEllipse_possibleConstructorReturn(this, result); }; }
  80562. function SmicEllipse_possibleConstructorReturn(self, call) { if (call && (SmicEllipse_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicEllipse_assertThisInitialized(self); }
  80563. function SmicEllipse_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  80564. function SmicEllipse_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  80565. function SmicEllipse_getPrototypeOf(o) { SmicEllipse_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicEllipse_getPrototypeOf(o); }
  80566. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  80567. * This program are made available under the terms of the Apache License, Version 2.0
  80568. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  80569. /**
  80570. * @private
  80571. * @class LevelRenderer.Shape.SmicEllipse
  80572. * @category Visualization Theme
  80573. * @classdesc 椭圆。
  80574. * @extends LevelRenderer.Shape
  80575. * @example
  80576. * var shape = new LevelRenderer.Shape.SmicEllipse({
  80577. * style: {
  80578. * x: 100,
  80579. * y: 100,
  80580. * a: 40,
  80581. * b: 20,
  80582. * brushType: 'both',
  80583. * color: 'blue',
  80584. * strokeColor: 'red',
  80585. * lineWidth: 3,
  80586. * text: 'SmicEllipse'
  80587. * }
  80588. * });
  80589. * levelRenderer.addShape(shape);
  80590. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  80591. *
  80592. */
  80593. var SmicEllipse = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
  80594. SmicEllipse_inherits(SmicEllipse, _Shape);
  80595. var _super = SmicEllipse_createSuper(SmicEllipse);
  80596. function SmicEllipse(options) {
  80597. var _this;
  80598. SmicEllipse_classCallCheck(this, SmicEllipse);
  80599. _this = _super.call(this, options);
  80600. /**
  80601. * @member {string} LevelRenderer.Shape.SmicEllipse.prototype.type
  80602. * @description 图形类型。
  80603. */
  80604. _this.type = 'smicellipse';
  80605. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  80606. _this.refOriginalPosition = [0, 0];
  80607. }
  80608. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicEllipse";
  80609. return _this;
  80610. }
  80611. /**
  80612. * @function LevelRenderer.Shape.SmicEllipse.prototype.destroy
  80613. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  80614. */
  80615. SmicEllipse_createClass(SmicEllipse, [{
  80616. key: "destroy",
  80617. value: function destroy() {
  80618. this.type = null;
  80619. SmicEllipse_get(SmicEllipse_getPrototypeOf(SmicEllipse.prototype), "destroy", this).call(this);
  80620. }
  80621. /**
  80622. * @function LevelRenderer.Shape.SmicEllipse.prototype.buildPath
  80623. * @description 构建椭圆的 Path。
  80624. *
  80625. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  80626. * @param {Object} style - style。
  80627. *
  80628. */
  80629. }, {
  80630. key: "buildPath",
  80631. value: function buildPath(ctx, style) {
  80632. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  80633. this.refOriginalPosition = [0, 0];
  80634. }
  80635. var __OP = this.refOriginalPosition;
  80636. var k = 0.5522848;
  80637. var x = style.x + __OP[0];
  80638. var y = style.y + __OP[1];
  80639. var a = style.a;
  80640. var b = style.b;
  80641. var ox = a * k; // 水平控制点偏移量
  80642. var oy = b * k; // 垂直控制点偏移量
  80643. // 从椭圆的左端点开始顺时针绘制四条三次贝塞尔曲线
  80644. ctx.moveTo(x - a, y);
  80645. ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b);
  80646. ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y);
  80647. ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b);
  80648. ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y);
  80649. ctx.closePath();
  80650. }
  80651. /**
  80652. * @function LevelRenderer.Shape.SmicEllipse.prototype.getRect
  80653. * @description 计算返回椭圆包围盒矩形
  80654. *
  80655. * @param {Object} style - style
  80656. * @return {Object} 边框对象。包含属性:x,y,width,height。
  80657. *
  80658. */
  80659. }, {
  80660. key: "getRect",
  80661. value: function getRect(style) {
  80662. if (style.__rect) {
  80663. return style.__rect;
  80664. }
  80665. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  80666. this.refOriginalPosition = [0, 0];
  80667. }
  80668. var __OP = this.refOriginalPosition;
  80669. var lineWidth;
  80670. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  80671. lineWidth = style.lineWidth || 1;
  80672. } else {
  80673. lineWidth = 0;
  80674. }
  80675. style.__rect = {
  80676. x: Math.round(style.x + __OP[0] - style.a - lineWidth / 2),
  80677. y: Math.round(style.x + __OP[1] - style.b - lineWidth / 2),
  80678. width: style.a * 2 + lineWidth,
  80679. height: style.b * 2 + lineWidth
  80680. };
  80681. return style.__rect;
  80682. }
  80683. }]);
  80684. return SmicEllipse;
  80685. }(Shape)));
  80686. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicIsogon.js
  80687. function SmicIsogon_typeof(obj) { "@babel/helpers - typeof"; return SmicIsogon_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicIsogon_typeof(obj); }
  80688. function SmicIsogon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  80689. function SmicIsogon_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  80690. function SmicIsogon_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicIsogon_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicIsogon_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  80691. function SmicIsogon_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicIsogon_get = Reflect.get.bind(); } else { SmicIsogon_get = function _get(target, property, receiver) { var base = SmicIsogon_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicIsogon_get.apply(this, arguments); }
  80692. function SmicIsogon_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicIsogon_getPrototypeOf(object); if (object === null) break; } return object; }
  80693. function SmicIsogon_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicIsogon_setPrototypeOf(subClass, superClass); }
  80694. function SmicIsogon_setPrototypeOf(o, p) { SmicIsogon_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicIsogon_setPrototypeOf(o, p); }
  80695. function SmicIsogon_createSuper(Derived) { var hasNativeReflectConstruct = SmicIsogon_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicIsogon_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicIsogon_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicIsogon_possibleConstructorReturn(this, result); }; }
  80696. function SmicIsogon_possibleConstructorReturn(self, call) { if (call && (SmicIsogon_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicIsogon_assertThisInitialized(self); }
  80697. function SmicIsogon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  80698. function SmicIsogon_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  80699. function SmicIsogon_getPrototypeOf(o) { SmicIsogon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicIsogon_getPrototypeOf(o); }
  80700. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  80701. * This program are made available under the terms of the Apache License, Version 2.0
  80702. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  80703. /**
  80704. * @private
  80705. * @class LevelRenderer.Shape.SmicIsogon
  80706. * @category Visualization Theme
  80707. * @classdesc 正多边形。
  80708. * @extends LevelRenderer.Shape
  80709. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  80710. */
  80711. var SmicIsogon = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
  80712. SmicIsogon_inherits(SmicIsogon, _Shape);
  80713. var _super = SmicIsogon_createSuper(SmicIsogon);
  80714. function SmicIsogon(options) {
  80715. var _this;
  80716. SmicIsogon_classCallCheck(this, SmicIsogon);
  80717. _this = _super.call(this, options);
  80718. /**
  80719. * @member {string} LevelRenderer.Shape.SmicIsogon.prototype.type
  80720. * @description 图形类型。
  80721. */
  80722. _this.type = 'smicisogon';
  80723. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  80724. _this.refOriginalPosition = [0, 0];
  80725. }
  80726. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicIsogon";
  80727. return _this;
  80728. }
  80729. /**
  80730. * @function LevelRenderer.Shape.SmicIsogon.prototype.destroy
  80731. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  80732. */
  80733. SmicIsogon_createClass(SmicIsogon, [{
  80734. key: "destroy",
  80735. value: function destroy() {
  80736. this.type = null;
  80737. SmicIsogon_get(SmicIsogon_getPrototypeOf(SmicIsogon.prototype), "destroy", this).call(this);
  80738. }
  80739. /**
  80740. * @function LevelRenderer.Shape.SmicIsogon.prototype.buildPath
  80741. * @description 创建n角星(n>=3)路径。
  80742. *
  80743. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  80744. * @param {Object} style - style。
  80745. *
  80746. */
  80747. }, {
  80748. key: "buildPath",
  80749. value: function buildPath(ctx, style) {
  80750. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  80751. this.refOriginalPosition = [0, 0];
  80752. }
  80753. var __OP = this.refOriginalPosition;
  80754. var sin = SUtil.Util_math.sin;
  80755. var cos = SUtil.Util_math.cos;
  80756. var PI = Math.PI;
  80757. var n = style.n;
  80758. if (!n || n < 2) {
  80759. return;
  80760. }
  80761. var x = style.x + __OP[0];
  80762. var y = style.y + __OP[1];
  80763. var r = style.r;
  80764. var dStep = 2 * PI / n;
  80765. var deg = -PI / 2;
  80766. var xStart = x + r * cos(deg);
  80767. var yStart = y + r * sin(deg);
  80768. deg += dStep;
  80769. // 记录边界点,用于判断insight
  80770. var pointList = style.pointList = [];
  80771. pointList.push([xStart, yStart]);
  80772. for (var i = 0, end = n - 1; i < end; i++) {
  80773. pointList.push([x + r * cos(deg), y + r * sin(deg)]);
  80774. deg += dStep;
  80775. }
  80776. pointList.push([xStart, yStart]);
  80777. // 绘制
  80778. ctx.moveTo(pointList[0][0], pointList[0][1]);
  80779. for (var _i2 = 0; _i2 < pointList.length; _i2++) {
  80780. ctx.lineTo(pointList[_i2][0], pointList[_i2][1]);
  80781. }
  80782. ctx.closePath();
  80783. return;
  80784. }
  80785. /**
  80786. * @function LevelRenderer.Shape.SmicIsogon.prototype.getRect
  80787. * @description 计算返回正多边形的包围盒矩形。
  80788. *
  80789. * @param {Object} style - style
  80790. * @return {Object} 边框对象。包含属性:x,y,width,height。
  80791. */
  80792. }, {
  80793. key: "getRect",
  80794. value: function getRect(style) {
  80795. if (style.__rect) {
  80796. return style.__rect;
  80797. }
  80798. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  80799. this.refOriginalPosition = [0, 0];
  80800. }
  80801. var __OP = this.refOriginalPosition;
  80802. var lineWidth;
  80803. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  80804. lineWidth = style.lineWidth || 1;
  80805. } else {
  80806. lineWidth = 0;
  80807. }
  80808. style.__rect = {
  80809. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  80810. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  80811. width: style.r * 2 + lineWidth,
  80812. height: style.r * 2 + lineWidth
  80813. };
  80814. return style.__rect;
  80815. }
  80816. }]);
  80817. return SmicIsogon;
  80818. }(Shape)));
  80819. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicRing.js
  80820. function SmicRing_typeof(obj) { "@babel/helpers - typeof"; return SmicRing_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicRing_typeof(obj); }
  80821. function SmicRing_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  80822. function SmicRing_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  80823. function SmicRing_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicRing_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicRing_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  80824. function SmicRing_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicRing_get = Reflect.get.bind(); } else { SmicRing_get = function _get(target, property, receiver) { var base = SmicRing_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicRing_get.apply(this, arguments); }
  80825. function SmicRing_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicRing_getPrototypeOf(object); if (object === null) break; } return object; }
  80826. function SmicRing_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicRing_setPrototypeOf(subClass, superClass); }
  80827. function SmicRing_setPrototypeOf(o, p) { SmicRing_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicRing_setPrototypeOf(o, p); }
  80828. function SmicRing_createSuper(Derived) { var hasNativeReflectConstruct = SmicRing_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicRing_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicRing_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicRing_possibleConstructorReturn(this, result); }; }
  80829. function SmicRing_possibleConstructorReturn(self, call) { if (call && (SmicRing_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicRing_assertThisInitialized(self); }
  80830. function SmicRing_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  80831. function SmicRing_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  80832. function SmicRing_getPrototypeOf(o) { SmicRing_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicRing_getPrototypeOf(o); }
  80833. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  80834. * This program are made available under the terms of the Apache License, Version 2.0
  80835. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  80836. /**
  80837. * @private
  80838. * @class LevelRenderer.Shape.SmicRing
  80839. * @category Visualization Theme
  80840. * @classdesc 圆环。
  80841. * @extends LevelRenderer.Shape
  80842. * @example
  80843. * var shape = new LevelRenderer.Shape.SmicRing({
  80844. * style: {
  80845. * x: 100,
  80846. * y: 100,
  80847. * r0: 30,
  80848. * r: 50
  80849. * }
  80850. * });
  80851. * levelRenderer.addShape(shape);
  80852. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  80853. */
  80854. var SmicRing = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
  80855. SmicRing_inherits(SmicRing, _Shape);
  80856. var _super = SmicRing_createSuper(SmicRing);
  80857. function SmicRing(options) {
  80858. var _this;
  80859. SmicRing_classCallCheck(this, SmicRing);
  80860. _this = _super.call(this, options);
  80861. /**
  80862. * @member {string} LevelRenderer.Shape.SmicRing.prototype.type
  80863. * @description 图形类型。
  80864. */
  80865. _this.type = 'smicring';
  80866. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  80867. _this.refOriginalPosition = [0, 0];
  80868. }
  80869. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicRing";
  80870. return _this;
  80871. }
  80872. /**
  80873. * @function LevelRenderer.Shape.SmicRing.prototype.destroy
  80874. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  80875. */
  80876. SmicRing_createClass(SmicRing, [{
  80877. key: "destroy",
  80878. value: function destroy() {
  80879. this.type = null;
  80880. SmicRing_get(SmicRing_getPrototypeOf(SmicRing.prototype), "destroy", this).call(this);
  80881. }
  80882. /**
  80883. * @function LevelRenderer.Shape.SmicRing.prototype.buildPath
  80884. * @description 创建圆环路径。
  80885. *
  80886. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  80887. * @param {Object} style - style。
  80888. *
  80889. */
  80890. }, {
  80891. key: "buildPath",
  80892. value: function buildPath(ctx, style) {
  80893. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  80894. this.refOriginalPosition = [0, 0];
  80895. }
  80896. var __OP = this.refOriginalPosition;
  80897. // 非零环绕填充优化
  80898. ctx.arc(style.x + __OP[0], style.y + __OP[1], style.r, 0, Math.PI * 2, false);
  80899. ctx.moveTo(style.x + __OP[0] + style.r0, style.y + __OP[1]);
  80900. ctx.arc(style.x + __OP[0], style.y + __OP[1], style.r0, 0, Math.PI * 2, true);
  80901. return;
  80902. }
  80903. /**
  80904. * @function LevelRenderer.Shape.SmicRing.prototype.getRect
  80905. * @description 计算返回圆环包围盒矩阵
  80906. *
  80907. * @param {Object} style - style
  80908. * @return {Object} 边框对象。包含属性:x,y,width,height。
  80909. */
  80910. }, {
  80911. key: "getRect",
  80912. value: function getRect(style) {
  80913. if (style.__rect) {
  80914. return style.__rect;
  80915. }
  80916. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  80917. this.refOriginalPosition = [0, 0];
  80918. }
  80919. var __OP = this.refOriginalPosition;
  80920. var lineWidth;
  80921. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  80922. lineWidth = style.lineWidth || 1;
  80923. } else {
  80924. lineWidth = 0;
  80925. }
  80926. style.__rect = {
  80927. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  80928. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  80929. width: style.r * 2 + lineWidth,
  80930. height: style.r * 2 + lineWidth
  80931. };
  80932. return style.__rect;
  80933. }
  80934. }]);
  80935. return SmicRing;
  80936. }(Shape)));
  80937. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicStar.js
  80938. function SmicStar_typeof(obj) { "@babel/helpers - typeof"; return SmicStar_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SmicStar_typeof(obj); }
  80939. function SmicStar_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  80940. function SmicStar_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  80941. function SmicStar_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicStar_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicStar_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  80942. function SmicStar_get() { if (typeof Reflect !== "undefined" && Reflect.get) { SmicStar_get = Reflect.get.bind(); } else { SmicStar_get = function _get(target, property, receiver) { var base = SmicStar_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return SmicStar_get.apply(this, arguments); }
  80943. function SmicStar_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicStar_getPrototypeOf(object); if (object === null) break; } return object; }
  80944. function SmicStar_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SmicStar_setPrototypeOf(subClass, superClass); }
  80945. function SmicStar_setPrototypeOf(o, p) { SmicStar_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicStar_setPrototypeOf(o, p); }
  80946. function SmicStar_createSuper(Derived) { var hasNativeReflectConstruct = SmicStar_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SmicStar_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SmicStar_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SmicStar_possibleConstructorReturn(this, result); }; }
  80947. function SmicStar_possibleConstructorReturn(self, call) { if (call && (SmicStar_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SmicStar_assertThisInitialized(self); }
  80948. function SmicStar_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  80949. function SmicStar_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  80950. function SmicStar_getPrototypeOf(o) { SmicStar_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicStar_getPrototypeOf(o); }
  80951. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  80952. * This program are made available under the terms of the Apache License, Version 2.0
  80953. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  80954. /**
  80955. * @private
  80956. * @class LevelRenderer.Shape.SmicStar
  80957. * @category Visualization Theme
  80958. * @classdesc n 角星(n>3)。
  80959. * @extends LevelRenderer.Shape
  80960. * @example
  80961. * var shape = new LevelRenderer.Shape.SmicStar({
  80962. * style: {
  80963. * x: 200,
  80964. * y: 100,
  80965. * r: 150,
  80966. * n: 5,
  80967. * text: '五角星'
  80968. * }
  80969. * });
  80970. * levelRenderer.addShape(shape);
  80971. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  80972. *
  80973. */
  80974. var SmicStar = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
  80975. SmicStar_inherits(SmicStar, _Shape);
  80976. var _super = SmicStar_createSuper(SmicStar);
  80977. function SmicStar(options) {
  80978. var _this;
  80979. SmicStar_classCallCheck(this, SmicStar);
  80980. _this = _super.call(this, options);
  80981. /**
  80982. * @member {string} LevelRenderer.Shape.SmicStar.prototype.type
  80983. * @description 图形类型。
  80984. */
  80985. _this.type = 'smicstar';
  80986. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  80987. _this.refOriginalPosition = [0, 0];
  80988. }
  80989. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicStar";
  80990. return _this;
  80991. }
  80992. /**
  80993. * @function LevelRenderer.Shape.SmicStar.prototype.destroy
  80994. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  80995. */
  80996. SmicStar_createClass(SmicStar, [{
  80997. key: "destroy",
  80998. value: function destroy() {
  80999. this.type = null;
  81000. SmicStar_get(SmicStar_getPrototypeOf(SmicStar.prototype), "destroy", this).call(this);
  81001. }
  81002. /**
  81003. * @function LevelRenderer.Shape.SmicStar.prototype.buildPath
  81004. * @description 创建n 角星(n>3)路径。
  81005. *
  81006. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  81007. * @param {Object} style - style。
  81008. *
  81009. */
  81010. }, {
  81011. key: "buildPath",
  81012. value: function buildPath(ctx, style) {
  81013. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  81014. this.refOriginalPosition = [0, 0];
  81015. }
  81016. var __OP = this.refOriginalPosition;
  81017. var n = style.n;
  81018. if (!n || n < 2) {
  81019. return;
  81020. }
  81021. var sin = SUtil.Util_math.sin;
  81022. var cos = SUtil.Util_math.cos;
  81023. var PI = Math.PI;
  81024. var x = style.x + __OP[0];
  81025. var y = style.y + __OP[1];
  81026. var r = style.r;
  81027. var r0 = style.r0;
  81028. // 如果未指定内部顶点外接圆半径,则自动计算
  81029. if (r0 == null) {
  81030. r0 = n > 4
  81031. // 相隔的外部顶点的连线的交点,
  81032. // 被取为内部交点,以此计算r0
  81033. ? r * cos(2 * PI / n) / cos(PI / n)
  81034. // 二三四角星的特殊处理
  81035. : r / 3;
  81036. }
  81037. var dStep = PI / n;
  81038. var deg = -PI / 2;
  81039. var xStart = x + r * cos(deg);
  81040. var yStart = y + r * sin(deg);
  81041. deg += dStep;
  81042. // 记录边界点,用于判断inside
  81043. var pointList = style.pointList = [];
  81044. pointList.push([xStart, yStart]);
  81045. for (var i = 0, end = n * 2 - 1, ri; i < end; i++) {
  81046. ri = i % 2 === 0 ? r0 : r;
  81047. pointList.push([x + ri * cos(deg), y + ri * sin(deg)]);
  81048. deg += dStep;
  81049. }
  81050. pointList.push([xStart, yStart]);
  81051. // 绘制
  81052. ctx.moveTo(pointList[0][0], pointList[0][1]);
  81053. for (var _i2 = 0; _i2 < pointList.length; _i2++) {
  81054. ctx.lineTo(pointList[_i2][0], pointList[_i2][1]);
  81055. }
  81056. ctx.closePath();
  81057. return;
  81058. }
  81059. /**
  81060. * @function LevelRenderer.Shape.SmicStar.prototype.getRect
  81061. * @description 返回 n 角星包围盒矩形。
  81062. *
  81063. * @param {Object} style - style
  81064. * @return {Object} 边框对象。包含属性:x,y,width,height。
  81065. */
  81066. }, {
  81067. key: "getRect",
  81068. value: function getRect(style) {
  81069. if (style.__rect) {
  81070. return style.__rect;
  81071. }
  81072. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  81073. this.refOriginalPosition = [0, 0];
  81074. }
  81075. var __OP = this.refOriginalPosition;
  81076. var lineWidth;
  81077. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  81078. lineWidth = style.lineWidth || 1;
  81079. } else {
  81080. lineWidth = 0;
  81081. }
  81082. style.__rect = {
  81083. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  81084. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  81085. width: style.r * 2 + lineWidth,
  81086. height: style.r * 2 + lineWidth
  81087. };
  81088. return style.__rect;
  81089. }
  81090. }]);
  81091. return SmicStar;
  81092. }(Shape)));
  81093. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/index.js
  81094. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  81095. * This program are made available under the terms of the Apache License, Version 2.0
  81096. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  81097. ;// CONCATENATED MODULE: ./src/common/overlay/threejs/Transform.js
  81098. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  81099. * This program are made available under the terms of the Apache License, Version 2.0
  81100. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  81101. function wrap(source, min, max) {
  81102. if (source === max || source === min) {
  81103. return source;
  81104. }
  81105. var len = max - min;
  81106. return ((source - min) % len + len) % len + min;
  81107. }
  81108. function rad(angle) {
  81109. return angle * Math.PI / 180;
  81110. }
  81111. var Projection = {
  81112. R: 6378137,
  81113. minZoom: 0,
  81114. maxZoom: 22,
  81115. nativeMaxZoom: 19,
  81116. RAD: Math.PI / 180,
  81117. METERS_PER_DEGREE: 6378137 * Math.PI / 180,
  81118. MAX_LATITUDE: 85.0511287798,
  81119. project: function project(lngLat) {
  81120. var rad = this.RAD,
  81121. metersPerDegree = this.METERS_PER_DEGREE,
  81122. max = this.MAX_LATITUDE;
  81123. var ll = lngLat instanceof Array ? {
  81124. lng: lngLat[0],
  81125. lat: lngLat[1]
  81126. } : {
  81127. lng: lngLat.lng,
  81128. lat: lngLat.lat
  81129. };
  81130. var lng = ll.lng,
  81131. lat = Math.max(Math.min(max, ll.lat), -max);
  81132. var c;
  81133. if (lat === 0) {
  81134. c = 0;
  81135. } else {
  81136. c = Math.log(Math.tan((90 + lat) * rad / 2)) / rad;
  81137. }
  81138. return {
  81139. x: lng * metersPerDegree,
  81140. y: c * metersPerDegree
  81141. };
  81142. },
  81143. unproject: function unproject(point) {
  81144. var x = point.x,
  81145. y = point.y;
  81146. var rad = this.RAD,
  81147. metersPerDegree = this.METERS_PER_DEGREE;
  81148. var c;
  81149. if (y === 0) {
  81150. c = 0;
  81151. } else {
  81152. c = y / metersPerDegree;
  81153. c = (2 * Math.atan(Math.exp(c * rad)) - Math.PI / 2) / rad;
  81154. }
  81155. return {
  81156. lng: wrap(x / metersPerDegree, -180, 180),
  81157. lat: wrap(c, -this.MAX_LATITUDE, this.MAX_LATITUDE)
  81158. };
  81159. },
  81160. locate: function locate(lngLat, dx, dy) {
  81161. if (!lngLat) {
  81162. return null;
  81163. }
  81164. dx = !dx ? 0 : dx;
  81165. dy = !dy ? 0 : dy;
  81166. if (!dx && !dy) {
  81167. return lngLat;
  81168. }
  81169. var lng = lngLat.lng;
  81170. if (dx !== 0) {
  81171. var ndx = Math.abs(dx),
  81172. radLng = rad(lngLat.lng);
  81173. var sLng = 2 * Math.sqrt(Math.pow(Math.sin(ndx / (2 * this.R)), 2) / Math.pow(Math.cos(radLng), 2));
  81174. radLng = radLng + sLng * (ndx > 0 ? 1 : -1);
  81175. lng = wrap(radLng * 180 / Math.PI, -180, 180);
  81176. }
  81177. var lat = lngLat.lat;
  81178. if (dy !== 0) {
  81179. var ndy = Math.abs(dy),
  81180. radLat = rad(lngLat.lat);
  81181. var sLat = Math.sin(ndy / (2 * this.R)) * 2;
  81182. radLat = radLat + sLat * (ndy > 0 ? 1 : -1);
  81183. lat = wrap(radLat * 180 / Math.PI, -90, 90);
  81184. }
  81185. return {
  81186. lng: lng,
  81187. lat: lat
  81188. };
  81189. },
  81190. getResolution: function getResolution(zoom) {
  81191. if (!this.resolutions) {
  81192. var resolutions = [];
  81193. var d = 2 * 6378137 * Math.PI;
  81194. for (var i = 0; i <= this.maxZoom; i++) {
  81195. resolutions[i] = d / (256 * Math.pow(2, i));
  81196. }
  81197. this.resolutions = resolutions;
  81198. }
  81199. var z = zoom | 0,
  81200. length = this.resolutions.length;
  81201. z = z < 0 ? 0 : z > length - 1 ? length - 1 : z;
  81202. var res = this.resolutions[z];
  81203. if ((zoom | 0) !== zoom && z !== length - 1) {
  81204. var next = this.resolutions[z + 1];
  81205. return res + (next - res) * (zoom - z);
  81206. }
  81207. return res;
  81208. }
  81209. };
  81210. var Transform = {
  81211. matrix: [1, -1, 0, 0],
  81212. projection: Projection,
  81213. project: function project(lngLat) {
  81214. return this.projection.project(lngLat);
  81215. },
  81216. unproject: function unproject(point) {
  81217. return this.projection.unproject(point);
  81218. },
  81219. lngLatToPoint: function lngLatToPoint(lngLat, zoom) {
  81220. var pt = this.project(lngLat);
  81221. return this.transform(pt, this.projection.getResolution(zoom));
  81222. },
  81223. locate: function locate(lngLat, dx, dy) {
  81224. return this.projection.locate(lngLat, dx, dy);
  81225. },
  81226. transform: function transform(point, scale) {
  81227. return {
  81228. x: this.matrix[0] * (point.x - this.matrix[2]) / scale,
  81229. y: this.matrix[1] * (point.y - this.matrix[3]) / scale
  81230. };
  81231. }
  81232. };
  81233. ;// CONCATENATED MODULE: ./src/common/overlay/index.js
  81234. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  81235. * This program are made available under the terms of the Apache License, Version 2.0
  81236. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  81237. ;// CONCATENATED MODULE: ./src/common/components/CommonTypes.js
  81238. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  81239. * This program are made available under the terms of the Apache License, Version 2.0
  81240. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  81241. /**
  81242. * @description 该文件用于存储一些公用常量
  81243. * @private
  81244. */
  81245. var CommonTypes_FileTypes = {
  81246. EXCEL: "EXCEL",
  81247. CSV: "CSV",
  81248. ISERVER: "ISERVER",
  81249. GEOJSON: "GEOJSON",
  81250. JSON: 'JSON'
  81251. };
  81252. var CommonTypes_FileConfig = {
  81253. fileMaxSize: 10 * 1024 * 1024
  81254. };
  81255. ;// CONCATENATED MODULE: ./src/common/components/openfile/FileModel.js
  81256. function FileModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  81257. function FileModel_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  81258. function FileModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) FileModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) FileModel_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  81259. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  81260. * This program are made available under the terms of the Apache License, Version 2.0
  81261. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  81262. /**
  81263. * @class FileModel
  81264. * @deprecatedclass SuperMap.FileModel
  81265. * @description 文件数据组件数据模型,用于存储一些文件数据或状态,todo 结构待完善
  81266. * @category Components OpenFile
  81267. * @private
  81268. */
  81269. var FileModel = /*#__PURE__*/(/* unused pure expression or super */ null && (function () {
  81270. function FileModel(options) {
  81271. FileModel_classCallCheck(this, FileModel);
  81272. this.FileTypes = FileTypes;
  81273. this.FileConfig = FileConfig;
  81274. this.loadFileObject = options && options.loadFileObject ? options.loadFileObject : [];
  81275. }
  81276. /**
  81277. * @function FileModel.prototype.set
  81278. * @description 设置属性值
  81279. * @param {string} key - 属性名称
  81280. * @param {string|Object} value - 属性值
  81281. */
  81282. FileModel_createClass(FileModel, [{
  81283. key: "set",
  81284. value: function set(key, value) {
  81285. this[key] = value;
  81286. }
  81287. /**
  81288. * @function FileModel.prototype.get
  81289. * @description 获取数据值
  81290. * @param {string} key - 属性名称
  81291. * @returns {string|Object} value - 返回属性值
  81292. */
  81293. }, {
  81294. key: "get",
  81295. value: function get(key) {
  81296. return this[key];
  81297. }
  81298. }]);
  81299. return FileModel;
  81300. }()));
  81301. ;// CONCATENATED MODULE: ./src/common/components/messagebox/MessageBox.js
  81302. function MessageBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  81303. function MessageBox_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  81304. function MessageBox_createClass(Constructor, protoProps, staticProps) { if (protoProps) MessageBox_defineProperties(Constructor.prototype, protoProps); if (staticProps) MessageBox_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  81305. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  81306. * This program are made available under the terms of the Apache License, Version 2.0
  81307. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  81308. /**
  81309. * @class MessageBox
  81310. * @aliasclass Components.MessageBox
  81311. * @deprecatedclass SuperMap.Components.MessageBox
  81312. * @version 9.1.1
  81313. * @classdesc 组件信息提示框。
  81314. * @category Components Common
  81315. * @usage
  81316. */
  81317. var MessageBox = /*#__PURE__*/function () {
  81318. function MessageBox() {
  81319. MessageBox_classCallCheck(this, MessageBox);
  81320. this._initView();
  81321. }
  81322. MessageBox_createClass(MessageBox, [{
  81323. key: "_initView",
  81324. value: function _initView() {
  81325. //原生js形式
  81326. var messageBoxContainer = document.createElement("div");
  81327. messageBoxContainer.hidden = true;
  81328. messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-orange");
  81329. //图标
  81330. var iconContainer = document.createElement("div");
  81331. iconContainer.setAttribute("class", "icon");
  81332. this.icon = document.createElement("span");
  81333. this.icon.setAttribute("class", "supermapol-icons-message-warning");
  81334. iconContainer.appendChild(this.icon);
  81335. messageBoxContainer.appendChild(iconContainer);
  81336. //内容:
  81337. var messageBox = document.createElement("div");
  81338. messageBox.setAttribute("class", "component-messagebox");
  81339. messageBox.innerHTML = "";
  81340. messageBoxContainer.appendChild(messageBox);
  81341. this.messageBox = messageBox;
  81342. //关闭按钮
  81343. var cancelContainer = document.createElement("div");
  81344. cancelContainer.setAttribute("class", "component-messagebox__cancelbtncontainer");
  81345. var cancelBtn = document.createElement("button");
  81346. cancelBtn.setAttribute("class", "component-messagebox__cancelBtn");
  81347. cancelBtn.innerHTML = "x";
  81348. cancelBtn.onclick = this.closeView.bind(this);
  81349. cancelContainer.appendChild(cancelBtn);
  81350. messageBoxContainer.appendChild(cancelContainer);
  81351. this.messageBoxContainer = messageBoxContainer;
  81352. document.body.appendChild(this.messageBoxContainer);
  81353. }
  81354. /**
  81355. * @function MessageBox.prototype.closeView
  81356. * @description 关闭提示框。
  81357. */
  81358. }, {
  81359. key: "closeView",
  81360. value: function closeView() {
  81361. this.messageBoxContainer.hidden = true;
  81362. }
  81363. /**
  81364. * @function MessageBox.prototype.showView
  81365. * @description 显示提示框。
  81366. * @param {string} message - 提示框显示内容。
  81367. * @param {string}[type="warring"] 提示框类型,如 "warring", "failure", "success"。
  81368. */
  81369. }, {
  81370. key: "showView",
  81371. value: function showView(message) {
  81372. var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'warring';
  81373. //设置提示框的样式:
  81374. if (type === "success") {
  81375. this.icon.setAttribute("class", "supermapol-icons-message-success");
  81376. this.messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-green");
  81377. } else if (type === "failure") {
  81378. this.icon.setAttribute("class", "supermapol-icons-message-failure");
  81379. this.messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-red");
  81380. } else if (type === "warring") {
  81381. this.icon.setAttribute("class", "supermapol-icons-message-warning");
  81382. this.messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-orange");
  81383. }
  81384. this.messageBox.innerHTML = message;
  81385. this.messageBoxContainer.hidden = false;
  81386. }
  81387. }]);
  81388. return MessageBox;
  81389. }();
  81390. ;// CONCATENATED MODULE: external "function(){try{return echarts}catch(e){return {}}}()"
  81391. var external_function_try_return_echarts_catch_e_return_namespaceObject = function(){try{return echarts}catch(e){return {}}}();
  81392. ;// CONCATENATED MODULE: ./src/common/lang/locales/en-US.js
  81393. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  81394. * This program are made available under the terms of the Apache License, Version 2.0
  81395. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  81396. /**
  81397. * Namespace: SuperMap.Lang["en"]
  81398. * Dictionary for English. Keys for entries are used in calls to
  81399. * <SuperMap.Lang.translate>. Entry bodies are normal strings or
  81400. * strings formatted for use with <SuperMap.String.format> calls.
  81401. */
  81402. var en = {
  81403. 'title_dataFlowService': 'Data Flow Service',
  81404. 'title_distributedAnalysis': 'Distributed Analysis',
  81405. 'title_clientComputing': 'Client Computing',
  81406. 'title_dataServiceQuery': 'Data Service Query',
  81407. 'title_searchCity': 'Search city',
  81408. 'title_searchLayer': ' Search layer',
  81409. 'text_input_value_inputDataFlowUrl': 'Please enter the data stream service address such as: ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe',
  81410. 'text_displayFeaturesInfo': 'Display feature information',
  81411. 'text_subscribe': 'subscribe',
  81412. 'text_cancelSubscribe': 'unsubscribe',
  81413. 'text_densityAnalysis': 'Density Analysis',
  81414. 'text_CalculateTheValuePerUnitArea': 'Calculate the value per unit area within the neighborhood shape',
  81415. 'text_option_selectDataset': 'Please select a dataset',
  81416. 'text_label_dataset': 'Dataset',
  81417. 'text_option_simplePointDensityAnalysis': 'Simple point density analysis',
  81418. 'text_option_nuclearDensityAnalysis': 'Nuclear density analysis',
  81419. 'text_label_analyticalMethod': 'Analytical method',
  81420. 'text_option_quadrilateral': 'Quadrilateral',
  81421. 'text_option_hexagon': 'hexagon',
  81422. 'text_label_meshType': 'Mesh type',
  81423. 'text_option_notSet': 'Not set',
  81424. 'text_label_weightField': 'Weight field',
  81425. 'text_label_gridSizeInMeters': 'Grid size',
  81426. 'text_label_searchRadius': 'Search radius',
  81427. 'text_label_queryRange': 'Scope of analysis',
  81428. 'text_label_areaUnit': 'Area unit',
  81429. 'text_option_equidistantSegmentation': 'Equidistant segmentation',
  81430. 'text_option_logarithm': 'Logarithm',
  81431. 'text_option_equalCountingSegment': 'Equal counting segment',
  81432. 'text_option_squareRootSegmentation': 'Square root segmentation',
  81433. 'text_label_thematicMapSegmentationMode': 'Thematic map segmentation mode',
  81434. 'text_label_thematicMapSegmentationParameters': 'Thematic map segmentation parameters',
  81435. 'text_option_greenOrangePurpleGradient': 'Green orange purple gradient',
  81436. 'text_option_greenOrangeRedGradient': 'Green orange red gradient',
  81437. 'text_option_rainbowGradient': 'Rainbow gradient',
  81438. 'text_option_spectralGradient': 'Spectral gradient',
  81439. 'text_option_terrainGradient': 'Terrain gradient',
  81440. 'text_label_thematicMapColorGradientMode': 'Thematic map color gradient mode',
  81441. 'text_label_resultLayerName': 'Result layer name',
  81442. 'text_chooseFile': 'Open File',
  81443. 'text_isoline': 'Isoline',
  81444. 'text_extractDiscreteValue': 'Extract discrete value generation curve',
  81445. 'text_buffer': 'Buffer',
  81446. 'text_specifyTheDistance': 'Specify the distance to create the surrounding area',
  81447. 'text_label_analysisLayer': 'Analysis layer',
  81448. 'text_label_extractField': 'Extract field',
  81449. 'text_label_extractedValue': 'Extracted value',
  81450. 'text_label_distanceAttenuation': 'Distance attenuation',
  81451. 'text_label_gridSize': 'gridSize',
  81452. 'text_label_bufferRadius': 'Buffer radius',
  81453. 'text_label_defaultkilometers': 'Default 10 kilometers',
  81454. 'text_label_kilometer': 'kilometer',
  81455. 'text_label_unit': 'unit',
  81456. 'text_retainOriginal': 'Retain original object field',
  81457. 'text_mergeBuffer': 'Merge buffer',
  81458. 'text_label_color': 'Color',
  81459. 'text_label_buffer': '[Buffer]',
  81460. 'text_label_isolines': '[Isolines]',
  81461. 'text_label_queryRangeTips': 'The default is the full range of input data. Example: -74.050, 40.650, -73.850, 40.850',
  81462. 'text_label_queryModel': 'Query mode',
  81463. 'text_label_IDArrayOfFeatures': 'ID array of features',
  81464. 'text_label_maxFeatures': 'The maximum number of features that can be returned',
  81465. 'text_label_bufferDistance': 'Buffer distance',
  81466. 'text_label_queryRange1': 'Query range',
  81467. 'text_label_spatialQueryMode': 'Spatial query mode',
  81468. 'text_label_featureFilter': 'Feature filter',
  81469. 'text_label_geometricObject': 'Geometric object',
  81470. 'text_label_queryMode': 'Query mode',
  81471. 'text_label_searchTips': 'Search for city locations or layer features',
  81472. 'text_label_chooseSearchLayers': 'Select a query layer',
  81473. 'text_loadSearchCriteria': 'Load search criteria',
  81474. 'text_saveSearchCriteria': 'Save search criteria',
  81475. "btn_analyze": "Analyze",
  81476. "btn_analyzing": "Analyzing",
  81477. "btn_emptyTheAnalysisLayer": "Empty the analysis layer",
  81478. "btn_cancelAnalysis": "Cancel",
  81479. "btn_query": "Query",
  81480. "btn_querying": "Querying",
  81481. "btn_emptyTheRresultLayer": "Clear all result layers",
  81482. 'msg_dataReturnedIsEmpty.': 'The request is successful and the data returned by the query is empty.',
  81483. 'msg_dataFlowServiceHasBeenSubscribed': 'The data stream service has been subscribed to.',
  81484. 'msg_inputDataFlowUrlFirst': 'Please enter the data stream service address first.',
  81485. 'msg_datasetOrMethodUnsupport': 'This dataset does not support this analysis type. Please reselect the dataset.',
  81486. 'msg_selectDataset': 'Please select a data set!',
  81487. 'msg_setTheWeightField': 'Please set the weight field!',
  81488. 'msg_theFieldNotSupportAnalysis': 'The field you currently select does not support analysis!',
  81489. 'msg_resultIsEmpty': 'The result of the analysis is empty!',
  81490. 'msg_openFileFail': 'Failed to open file!',
  81491. 'msg_fileTypeUnsupported': 'File format is not supported!',
  81492. 'msg_fileSizeExceeded': 'File size exceeded! The file size should not exceed 10M!',
  81493. 'msg_dataInWrongGeoJSONFormat': 'Wrong data format! Non standard GEOJSON format data!',
  81494. 'msg_dataInWrongFormat': 'Wrong data format! Non standard EXCEL, CSV or GEOJSON format data!',
  81495. 'msg_searchKeywords': "Search keywords cannot be empty. Please enter your search criteria.",
  81496. 'msg_searchGeocodeField': "Did not match the address matching service data!",
  81497. 'msg_cityGeocodeField': "The address matching service of the current city is not configured.",
  81498. 'msg_getFeatureField': "No related vector features found!",
  81499. 'msg_dataflowservicesubscribed': 'The data stream service has been subscribed to.',
  81500. 'msg_subscribesucceeded': 'The data stream service subscription was successful.',
  81501. 'msg_crsunsupport': 'Does not support the coordinate system of the current map',
  81502. 'msg_tilematrixsetunsupport': 'Incoming TileMatrixSet is not supported',
  81503. 'msg_jsonResolveFiled': 'JSON format parsing failure!',
  81504. 'msg_requestContentFiled': 'Failed to request data through iportal!',
  81505. 'msg_getdatafailed': 'Failed to get data!'
  81506. };
  81507. ;// CONCATENATED MODULE: ./src/common/lang/locales/zh-CN.js
  81508. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  81509. * This program are made available under the terms of the Apache License, Version 2.0
  81510. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  81511. /**
  81512. * Namespace: SuperMap.Lang["zh-CN"]
  81513. * Dictionary for Simplified Chinese. Keys for entries are used in calls to
  81514. * <SuperMap.Lang.translate>. Entry bodies are normal strings or
  81515. * strings formatted for use with <SuperMap.String.format> calls.
  81516. */
  81517. var zh = {
  81518. 'title_dataFlowService': '数据流服务',
  81519. 'title_distributedAnalysis': '分布式分析',
  81520. 'title_clientComputing': '客户端计算',
  81521. 'title_dataServiceQuery': '数据服务查询',
  81522. 'title_searchCity': '搜索城市',
  81523. 'title_searchLayer': '搜索图层',
  81524. 'text_input_value_inputDataFlowUrl': '请输入数据流服务地址如:ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe',
  81525. 'text_displayFeaturesInfo': '显示要素信息',
  81526. 'text_subscribe': '订阅',
  81527. 'text_cancelSubscribe': '取消订阅',
  81528. 'text_densityAnalysis': '密度分析',
  81529. 'text_CalculateTheValuePerUnitArea': '计算点指定邻域形状内的每单位面积量值',
  81530. 'text_option_selectDataset': '请选择数据集',
  81531. 'text_label_dataset': '数据集',
  81532. 'text_option_simplePointDensityAnalysis': '简单点密度分析',
  81533. 'text_option_nuclearDensityAnalysis': '核密度分析',
  81534. 'text_label_analyticalMethod': '分析方法',
  81535. 'text_option_quadrilateral': '四边形',
  81536. 'text_option_hexagon': '六边形',
  81537. 'text_label_meshType': '网格面类型',
  81538. 'text_option_notSet': '未设置',
  81539. 'text_label_weightField': '权重字段',
  81540. 'text_label_gridSizeInMeters': '网格大小',
  81541. 'text_label_searchRadius': '搜索半径',
  81542. 'text_label_queryRange': '分析范围',
  81543. 'text_label_areaUnit': '面积单位',
  81544. 'text_option_equidistantSegmentation': '等距离分段',
  81545. 'text_option_logarithm': '对数',
  81546. 'text_option_equalCountingSegment': '等计数分段',
  81547. 'text_option_squareRootSegmentation': '平方根分段',
  81548. 'text_label_thematicMapSegmentationMode': '专题图分段模式',
  81549. 'text_label_thematicMapSegmentationParameters': '专题图分段参数',
  81550. 'text_option_greenOrangePurpleGradient': '绿橙紫渐变',
  81551. 'text_option_greenOrangeRedGradient': '绿橙红渐变',
  81552. 'text_option_rainbowGradient': '彩虹渐变',
  81553. 'text_option_spectralGradient': '光谱渐变',
  81554. 'text_option_terrainGradient': '地形渐变',
  81555. 'text_label_thematicMapColorGradientMode': '专题图颜色渐变模式',
  81556. 'text_label_resultLayerName': '结果图层名称',
  81557. 'text_chooseFile': '选择文件',
  81558. 'text_isoline': '等值线',
  81559. 'text_extractDiscreteValue': '提取离散值生成曲线',
  81560. 'text_buffer': '缓冲区',
  81561. 'text_specifyTheDistance': '指定距离创建周边区域',
  81562. 'text_label_analysisLayer': '分析图层',
  81563. 'text_label_extractField': '提取字段',
  81564. 'text_label_extractedValue': '提取值',
  81565. 'text_label_distanceAttenuation': '距离衰减',
  81566. 'text_label_gridSize': '栅格大小',
  81567. 'text_label_bufferRadius': '缓冲半径',
  81568. 'text_label_defaultkilometers': '默认10千米',
  81569. 'text_option_kilometer': '千米',
  81570. 'text_label_unit': '单位',
  81571. 'text_retainOriginal': '保留原对象字段属性',
  81572. 'text_mergeBuffer': '合并缓冲区',
  81573. 'text_label_color': '颜色',
  81574. 'text_label_buffer': '[缓冲区]',
  81575. 'text_label_isolines': '[等值线]',
  81576. 'text_label_queryRangeTips': '默认为输入数据的全幅范围。范例:-74.050,40.650,-73.850,40.850',
  81577. 'text_label_IDArrayOfFeatures': '要素 ID 数组',
  81578. 'text_label_maxFeatures': '最多可返回的要素数量',
  81579. 'text_label_bufferDistance': '缓冲区距离',
  81580. 'text_label_queryRange1': '查询范围',
  81581. 'text_label_spatialQueryMode': '空间查询模式',
  81582. 'text_label_featureFilter': '要素过滤器',
  81583. 'text_label_geometricObject': '几何对象',
  81584. 'text_label_queryMode': '查询模式',
  81585. 'text_label_searchTips': '搜索城市地点或图层要素',
  81586. 'text_label_chooseSearchLayers': '选择查询图层',
  81587. 'text_loadSearchCriteria': '加载搜索条件',
  81588. 'text_saveSearchCriteria': '保存搜索条件',
  81589. "btn_analyze": "分析",
  81590. "btn_analyzing": "分析中",
  81591. "btn_emptyTheAnalysisLayer": "清空分析图层",
  81592. "btn_cancelAnalysis": "取消",
  81593. "btn_query": "查询",
  81594. "btn_querying": "查询中",
  81595. "btn_emptyTheRresultLayer": "清除所有结果图层",
  81596. 'msg_dataFlowServiceHasBeenSubscribed': '已订阅该数据流服务。',
  81597. 'msg_inputDataFlowUrlFirst': '请先输入数据流服务地址。',
  81598. 'msg_datasetOrMethodUnsupport': '该数据集不支持本分析类型,请重新选择数据集',
  81599. 'msg_selectDataset': '请选择数据集!',
  81600. 'msg_setTheWeightField': '请设置权重字段!',
  81601. 'msg_theFieldNotSupportAnalysis': '您当前选择的字段不支持分析!',
  81602. 'msg_resultIsEmpty': '分析的结果为空!',
  81603. 'msg_dataReturnedIsEmpty': '请求成功,查询返回的数据为空。',
  81604. 'msg_openFileFail': '打开文件失败!',
  81605. 'msg_fileTypeUnsupported': '不支持该文件格式!',
  81606. 'msg_fileSizeExceeded': '文件大小超限!文件大小不得超过 10M!',
  81607. 'msg_dataInWrongGeoJSONFormat': '数据格式错误!非标准的 GEOJSON 格式数据!',
  81608. 'msg_dataInWrongFormat': '数据格式错误!非标准的 EXCEL, CSV 或 GEOJSON 格式数据!',
  81609. 'msg_searchKeywords': "搜索关键字不能为空,请输入搜索条件。",
  81610. 'msg_searchGeocodeField': "未匹配到地址匹配服务数据!",
  81611. 'msg_cityGeocodeField': "未配置当前城市的地址匹配服务。",
  81612. 'msg_getFeatureField': "未查找到相关矢量要素!",
  81613. 'msg_dataflowservicesubscribed': '已订阅该数据流服务。',
  81614. 'msg_subscribesucceeded': '数据流服务订阅成功。',
  81615. 'msg_crsunsupport': '不支持当前地图的坐标系',
  81616. 'msg_tilematrixsetunsupport': '不支持传入的TileMatrixSet',
  81617. 'msg_jsonResolveFiled': 'json格式解析失败!',
  81618. 'msg_requestContentFiled': '通过iportal请求数据失败!',
  81619. 'msg_getdatafailed': '获取数据失败!'
  81620. };
  81621. ;// CONCATENATED MODULE: ./src/common/lang/Lang.js
  81622. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  81623. * This program are made available under the terms of the Apache License, Version 2.0
  81624. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  81625. /**
  81626. * @name Lang
  81627. * @namespace
  81628. * @category BaseTypes Internationalization
  81629. * @description 国际化的命名空间,包含多种语言和方法库来设置和获取当前的语言。
  81630. * @usage
  81631. * ```
  81632. * // 浏览器
  81633. * <script type="text/javascript" src="{cdn}"></script>
  81634. * <script>
  81635. * const result = {namespace}.Lang.getCode();
  81636. *
  81637. * // 弃用的写法
  81638. * const result = SuperMap.Lang.getCode();
  81639. *
  81640. * </script>
  81641. *
  81642. * // ES6 Import
  81643. * import { Lang } from '{npm}';
  81644. *
  81645. * const result = Lang.getCode();
  81646. *
  81647. * ```
  81648. */
  81649. var Lang = {
  81650. 'en-US': en,
  81651. "zh-CN": zh,
  81652. /**
  81653. * @member {string} Lang.code
  81654. * @description 当前所使用的语言类型。
  81655. */
  81656. code: null,
  81657. /**
  81658. * @member {string} [Lang.defaultCode='en-US']
  81659. * @description 默认使用的语言类型。
  81660. */
  81661. defaultCode: "en-US",
  81662. /**
  81663. * @function Lang.getCode
  81664. * @description 获取当前的语言代码。
  81665. * @returns {string} 当前的语言代码。
  81666. */
  81667. getCode: function getCode() {
  81668. if (!Lang.code) {
  81669. Lang.setCode();
  81670. }
  81671. return Lang.code;
  81672. },
  81673. /**
  81674. * @function Lang.setCode
  81675. * @description 设置语言代码。
  81676. * @param {string} code - 此参数遵循IETF规范。
  81677. */
  81678. setCode: function setCode() {
  81679. var lang = this.getLanguageFromCookie();
  81680. if (!lang) {
  81681. lang = Lang.defaultCode;
  81682. if (navigator.appName === 'Netscape') {
  81683. lang = navigator.language;
  81684. } else {
  81685. lang = navigator.browserLanguage;
  81686. }
  81687. }
  81688. if (lang.indexOf('zh') === 0) {
  81689. lang = 'zh-CN';
  81690. }
  81691. if (lang.indexOf('en') === 0) {
  81692. lang = 'en-US';
  81693. }
  81694. Lang.code = lang;
  81695. },
  81696. /**
  81697. * @function Lang.getLanguageFromCookie
  81698. * @description 从 cookie 中获取语言类型。
  81699. */
  81700. getLanguageFromCookie: function getLanguageFromCookie() {
  81701. var name = 'language=';
  81702. var ca = document.cookie.split(';');
  81703. for (var i = 0; i < ca.length; i++) {
  81704. var c = ca[i];
  81705. while (c.charAt(0) === ' ') {
  81706. c = c.substring(1);
  81707. }
  81708. if (c.indexOf(name) !== -1) {
  81709. return c.substring(name.length, c.length);
  81710. }
  81711. }
  81712. return "";
  81713. },
  81714. /**
  81715. * @function Lang.i18n
  81716. * @description 从当前语言字符串的字典查找 key。
  81717. * @param {string} key - 字典中 i18n 字符串值的关键字。
  81718. * @returns {string} 国际化的字符串。
  81719. */
  81720. i18n: function i18n(key) {
  81721. var dictionary = Lang[Lang.getCode()];
  81722. var message = dictionary && dictionary[key];
  81723. if (!message) {
  81724. // Message not found, fall back to message key
  81725. message = key;
  81726. }
  81727. return message;
  81728. }
  81729. };
  81730. ;// CONCATENATED MODULE: external "function(){try{return XLSX}catch(e){return {}}}()"
  81731. var external_function_try_return_XLSX_catch_e_return_namespaceObject = function(){try{return XLSX}catch(e){return {}}}();
  81732. ;// CONCATENATED MODULE: ./src/common/components/util/FileReaderUtil.js
  81733. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  81734. * This program are made available under the terms of the Apache License, Version 2.0
  81735. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  81736. /**
  81737. * @name FileReaderUtil
  81738. * @namespace
  81739. * @category Components OpenFile
  81740. * @description 组件读取文件工具类。
  81741. * @version 9.1.1
  81742. * @type {{rABS: (boolean|*), rABF: (boolean|*), rAT: (boolean|*), readFile: (function(*, *=, *=, *=, *=)), readTextFile: (function(*, *=, *=, *=)), readXLSXFile: (function(*, *=, *=, *=)), processDataToGeoJson: (function(string, Object): GeoJSONObject), processExcelDataToGeoJson: (function(Object): GeoJSONObject), isXField: (function(*)), isYField: (function(*)), string2Csv: (function(*, *=))}}
  81743. * @usage
  81744. * ```
  81745. * // 浏览器
  81746. * <script type="text/javascript" src="{cdn}"></script>
  81747. * <script>
  81748. * const result = {namespace}.Components.FileReaderUtil.isXField(data);
  81749. *
  81750. * // 弃用的写法
  81751. * const result = SuperMap.Components.FileReaderUtil.isXField(data);
  81752. *
  81753. * </script>
  81754. *
  81755. * // ES6 Import
  81756. * import { FileReaderUtil } from '{npm}';
  81757. *
  81758. * const result = FileReaderUtil.isXField(data);
  81759. * ```
  81760. */
  81761. var FileReaderUtil = {
  81762. rABS: typeof FileReader !== 'undefined' && FileReader.prototype && FileReader.prototype.readAsBinaryString,
  81763. rABF: typeof FileReader !== 'undefined' && FileReader.prototype && FileReader.prototype.readAsArrayBuffer,
  81764. rAT: typeof FileReader !== 'undefined' && FileReader.prototype && FileReader.prototype.readAsText,
  81765. /**
  81766. * @function FileReaderUtil.prototype.readFile
  81767. * @description 读取文件。
  81768. * @param {string} fileType - 当前读取的文件类型。
  81769. *
  81770. * @param {Object} file - 读取回来的文件内容对象。
  81771. * @param {function} success - 读取文件成功回调函数。
  81772. * @param {function} failed - 读取文件失败回调函数。
  81773. * @param {Object} context - 回调重定向对象。
  81774. */
  81775. readFile: function readFile(fileType, file, success, failed, context) {
  81776. if (CommonTypes_FileTypes.JSON === fileType || CommonTypes_FileTypes.GEOJSON === fileType) {
  81777. this.readTextFile(file, success, failed, context);
  81778. } else if (CommonTypes_FileTypes.EXCEL === fileType || CommonTypes_FileTypes.CSV === fileType) {
  81779. this.readXLSXFile(file, success, failed, context);
  81780. }
  81781. },
  81782. /**
  81783. * @description 读取文本文件。
  81784. * @param {Object} file 文件内容对象。
  81785. * @param {function} success 读取文件成功回调函数。
  81786. * @param {function} failed 读取文件失败回调函数。
  81787. * @param {Object} context - 回调重定向对象。
  81788. */
  81789. readTextFile: function readTextFile(file, success, failed, context) {
  81790. var reader = new FileReader();
  81791. reader.onloadend = function (evt) {
  81792. success && success.call(context, evt.target.result);
  81793. };
  81794. reader.onerror = function (error) {
  81795. failed && failed.call(context, error);
  81796. };
  81797. this.rAT ? reader.readAsText(file.file, 'utf-8') : reader.readAsBinaryString(file.file);
  81798. },
  81799. /**
  81800. * @description 读取excel或csv文件。
  81801. * @param {Object} file 文件内容对象。
  81802. * @param {function} success 读取文件成功回调函数。
  81803. * @param {function} failed 读取文件失败回调函数。
  81804. * @param {Object} context - 回调重定向对象。
  81805. */
  81806. readXLSXFile: function readXLSXFile(file, success, failed, context) {
  81807. var reader = new FileReader();
  81808. reader.onloadend = function (evt) {
  81809. var xLSXData = new Uint8Array(evt.target.result);
  81810. var workbook = external_function_try_return_XLSX_catch_e_return_namespaceObject.read(xLSXData, {
  81811. type: "array"
  81812. });
  81813. try {
  81814. if (workbook && workbook.SheetNames && workbook.SheetNames.length > 0) {
  81815. //暂时只读取第一个sheets的内容
  81816. var sheetName = workbook.SheetNames[0];
  81817. var xLSXCSVString = external_function_try_return_XLSX_catch_e_return_namespaceObject.utils.sheet_to_csv(workbook.Sheets[sheetName]);
  81818. success && success.call(context, xLSXCSVString);
  81819. }
  81820. } catch (error) {
  81821. failed && failed.call(context, error);
  81822. }
  81823. };
  81824. reader.onerror = function (error) {
  81825. failed && failed.call(context, error);
  81826. };
  81827. this.rABF && reader.readAsArrayBuffer(file.file);
  81828. },
  81829. /**
  81830. * @function FileReaderUtil.prototype.processDataToGeoJson
  81831. * @description 将读取回来得数据统一处理为 GeoJSON 格式。
  81832. * @param {string} type - 文件类型。
  81833. * @param {Object} data - 读取返回的数据对象。
  81834. * @param {function} success - 数据处理成功的回调。
  81835. * @param {function} failed - 数据处理失败的回调。
  81836. * @param {Object} context - 回调重定向对象。
  81837. * @returns {GeoJSONObject} 返回标准 GeoJSON 规范格式数据。
  81838. * @private
  81839. */
  81840. processDataToGeoJson: function processDataToGeoJson(type, data, success, failed, context) {
  81841. var geojson = null;
  81842. if (type === "EXCEL" || type === "CSV") {
  81843. geojson = this.processExcelDataToGeoJson(data);
  81844. success && success.call(context, geojson);
  81845. } else if (type === 'JSON' || type === 'GEOJSON') {
  81846. var result = data;
  81847. //geojson、json未知,通过类容来判断
  81848. if (typeof result === "string") {
  81849. result = JSON.parse(result);
  81850. }
  81851. if (result.type === 'ISERVER') {
  81852. geojson = result.data.recordsets[0].features;
  81853. } else if (result.type === 'FeatureCollection') {
  81854. //geojson
  81855. geojson = result;
  81856. } else {
  81857. //不支持数据
  81858. failed && failed.call(context, Lang.i18n('msg_dataInWrongGeoJSONFormat'));
  81859. }
  81860. success && success.call(context, geojson);
  81861. } else {
  81862. failed && failed.call(context, Lang.i18n('msg_dataInWrongFormat'));
  81863. }
  81864. },
  81865. /**
  81866. * @function FileReaderUtil.prototype.processExcelDataToGeoJson
  81867. * @description 表格文件数据处理。
  81868. * @param {Object} data - 读取的表格文件数据。
  81869. * @returns {GeoJSONObject} 返回标准 GeoJSON 规范格式数据。
  81870. * @private
  81871. */
  81872. processExcelDataToGeoJson: function processExcelDataToGeoJson(data) {
  81873. //处理为对象格式转化
  81874. var dataContent = this.string2Csv(data);
  81875. var fieldCaptions = dataContent.colTitles;
  81876. //位置属性处理
  81877. var xfieldIndex = -1,
  81878. yfieldIndex = -1;
  81879. for (var i = 0, len = fieldCaptions.length; i < len; i++) {
  81880. if (this.isXField(fieldCaptions[i])) {
  81881. xfieldIndex = i;
  81882. }
  81883. if (this.isYField(fieldCaptions[i])) {
  81884. yfieldIndex = i;
  81885. }
  81886. }
  81887. // feature 构建后期支持坐标系 4326/3857
  81888. var features = [];
  81889. for (var _i2 = 0, _len2 = dataContent.rows.length; _i2 < _len2; _i2++) {
  81890. var row = dataContent.rows[_i2];
  81891. //if (featureFrom === "LonLat") {
  81892. var x = Number(row[xfieldIndex]),
  81893. y = Number(row[yfieldIndex]);
  81894. //属性信息
  81895. var attributes = {};
  81896. for (var index in dataContent.colTitles) {
  81897. var key = dataContent.colTitles[index];
  81898. attributes[key] = dataContent.rows[_i2][index];
  81899. }
  81900. //目前csv 只支持处理点,所以先生成点类型的 geojson
  81901. var feature = {
  81902. "type": "Feature",
  81903. "geometry": {
  81904. "type": "Point",
  81905. "coordinates": [x, y]
  81906. },
  81907. "properties": attributes
  81908. };
  81909. features.push(feature);
  81910. }
  81911. return features;
  81912. },
  81913. /**
  81914. * @description 判断是否地理X坐标。
  81915. * @param {string} data 字段名。
  81916. */
  81917. isXField: function isXField(data) {
  81918. var lowerdata = data.toLowerCase();
  81919. return lowerdata === "x" || lowerdata === "smx" || lowerdata === "jd" || lowerdata === "经度" || lowerdata === "东经" || lowerdata === "longitude" || lowerdata === "lot" || lowerdata === "lon" || lowerdata === "lng" || lowerdata === "x坐标";
  81920. },
  81921. /**
  81922. * @description 判断是否地理Y坐标。
  81923. * @param {string} data 字段名。
  81924. */
  81925. isYField: function isYField(data) {
  81926. var lowerdata = data.toLowerCase();
  81927. return lowerdata === "y" || lowerdata === "smy" || lowerdata === "wd" || lowerdata === "纬度" || lowerdata === "北纬" || lowerdata === "latitude" || lowerdata === "lat" || lowerdata === "y坐标";
  81928. },
  81929. /**
  81930. * @description 字符串转为dataEditor 支持的csv格式数据。
  81931. * @param {string} string 待转化的字符串。
  81932. * @param {boolean} withoutTitle 是否需要列标题。
  81933. */
  81934. string2Csv: function string2Csv(string, withoutTitle) {
  81935. // let rows = string.split('\r\n');
  81936. var rows = string.split('\n');
  81937. var result = {};
  81938. if (!withoutTitle) {
  81939. result["colTitles"] = rows[0].split(',');
  81940. } else {
  81941. result["colTitles"] = [];
  81942. }
  81943. result['rows'] = [];
  81944. for (var i = withoutTitle ? 0 : 1; i < rows.length; i++) {
  81945. rows[i] && result['rows'].push(rows[i].split(','));
  81946. }
  81947. return result;
  81948. }
  81949. };
  81950. ;// CONCATENATED MODULE: ./src/common/components/chart/ChartModel.js
  81951. function ChartModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  81952. function ChartModel_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  81953. function ChartModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartModel_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  81954. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  81955. * This program are made available under the terms of the Apache License, Version 2.0
  81956. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  81957. /**
  81958. * @class ChartModel
  81959. * @classdesc 图表组件数据模型
  81960. * @private
  81961. * @param {Object} datasets - 数据来源。
  81962. * @category Components Chart
  81963. * @fires ChartModel#getdatafailed
  81964. */
  81965. var ChartModel = /*#__PURE__*/function () {
  81966. function ChartModel(datasets) {
  81967. ChartModel_classCallCheck(this, ChartModel);
  81968. this.datasets = datasets;
  81969. this.EVENT_TYPES = ['getdatafailed'];
  81970. this.events = new Events(this, null, this.EVENT_TYPES);
  81971. }
  81972. /**
  81973. * @private
  81974. * @function ChartModel.prototype.getDatasetInfo
  81975. * @description 获得数据集数据。
  81976. * @param {string} datasetUrl - 数据集资源地址。
  81977. */
  81978. ChartModel_createClass(ChartModel, [{
  81979. key: "getDatasetInfo",
  81980. value: function getDatasetInfo(success) {
  81981. var datasetUrl = this.datasets.url;
  81982. var me = this;
  81983. FetchRequest.get(datasetUrl).then(function (response) {
  81984. return response.json();
  81985. }).then(function (results) {
  81986. if (results.datasetInfo) {
  81987. var datasetInfo = results.datasetInfo;
  81988. me.datasetsInfo = {
  81989. dataSourceName: datasetInfo.dataSourceName,
  81990. datasetName: datasetInfo.name,
  81991. mapName: results.name
  81992. };
  81993. success({
  81994. result: me.datasetsInfo
  81995. });
  81996. }
  81997. })["catch"](function (error) {
  81998. console.log(error);
  81999. me._fireFailedEvent(error);
  82000. });
  82001. }
  82002. /**
  82003. * @private
  82004. * @function ChartModel.prototype.getDataFeatures
  82005. * @description 请求数据集的数据信息
  82006. * @param {Object} results - 数据集信息。
  82007. * @param {function} success - 成功回调函数。
  82008. */
  82009. }, {
  82010. key: "getDataFeatures",
  82011. value: function getDataFeatures(results, success) {
  82012. var datasetsInfo = results.result;
  82013. var getFeatureParam, getFeatureBySQLParams, getFeatureBySQLService;
  82014. var params = {
  82015. name: datasetsInfo.datasetName + '@' + datasetsInfo.dataSourceName
  82016. };
  82017. Object.assign(params, this.datasets.queryInfo);
  82018. getFeatureParam = new FilterParameter(params);
  82019. getFeatureBySQLParams = new GetFeaturesBySQLParameters({
  82020. queryParameter: getFeatureParam,
  82021. datasetNames: [datasetsInfo.dataSourceName + ':' + datasetsInfo.datasetName],
  82022. fromIndex: 0,
  82023. toIndex: 100000
  82024. });
  82025. getFeatureBySQLService = new GetFeaturesBySQLService(datasetsInfo.dataUrl, {
  82026. eventListeners: {
  82027. processCompleted: success,
  82028. processFailed: function processFailed() {}
  82029. }
  82030. });
  82031. getFeatureBySQLService.processAsync(getFeatureBySQLParams);
  82032. }
  82033. /**
  82034. * @private
  82035. * @function ChartModel.prototype.getLayerFeatures
  82036. * @description 请求图层要素的数据信息
  82037. * @param {Object} results - 数据集信息。
  82038. * @param {Callbacks} success - 成功回调函数。
  82039. */
  82040. }, {
  82041. key: "getLayerFeatures",
  82042. value: function getLayerFeatures(results, success) {
  82043. var datasetsInfo = results.result;
  82044. var queryParam, queryBySQLParams, queryBySQLService;
  82045. var params = {
  82046. name: datasetsInfo.mapName
  82047. };
  82048. Object.assign(params, this.datasets.queryInfo);
  82049. queryParam = new FilterParameter(params);
  82050. queryBySQLParams = new QueryBySQLParameters({
  82051. queryParams: [queryParam],
  82052. expectCount: 100000
  82053. });
  82054. queryBySQLService = new QueryBySQLService(datasetsInfo.dataUrl, {
  82055. eventListeners: {
  82056. processCompleted: success,
  82057. processFailed: function processFailed() {}
  82058. }
  82059. });
  82060. queryBySQLService.processAsync(queryBySQLParams);
  82061. }
  82062. /**
  82063. * @private
  82064. * @function ChartModel.prototype.getDataInfoByIptl
  82065. * @description 用dataId获取iportal的数据。
  82066. * @param {Callbacks} success - 成功回调函数。
  82067. *
  82068. */
  82069. }, {
  82070. key: "getDataInfoByIptl",
  82071. value: function getDataInfoByIptl(success) {
  82072. // success是chart的回调
  82073. this.getServiceInfo(this.datasets.url, success);
  82074. }
  82075. /**
  82076. * @private
  82077. * @function ChartModel.prototype.getServiceInfo
  82078. * @description 用iportal获取dataItemServices。
  82079. * @param {string} url
  82080. * @param {Callbacks} success - 成功回调函数。
  82081. * */
  82082. }, {
  82083. key: "getServiceInfo",
  82084. value: function getServiceInfo(url, success) {
  82085. var me = this;
  82086. FetchRequest.get(url, null, {
  82087. withCredentials: this.datasets.withCredentials
  82088. }).then(function (response) {
  82089. return response.json();
  82090. }).then(function (data) {
  82091. if (data.succeed === false) {
  82092. //请求失败
  82093. me._fireFailedEvent(data);
  82094. return;
  82095. }
  82096. // 是否有rest服务
  82097. if (data.dataItemServices && data.dataItemServices.length > 0) {
  82098. var dataItemServices = data.dataItemServices,
  82099. resultData;
  82100. dataItemServices.forEach(function (item) {
  82101. // 如果有restdata并且发布成功,就请求restdata服务
  82102. // 如果有restmap并且发布成功,就请求restmap服务
  82103. // 其他情况就请求iportal/content.json
  82104. if (item.serviceType === 'RESTDATA' && item.serviceStatus === 'PUBLISHED') {
  82105. resultData = item;
  82106. } else if (item.serviceType === 'RESTMAP' && item.serviceStatus === 'PUBLISHED') {
  82107. resultData = item;
  82108. } else {
  82109. me.getDatafromContent(url, success);
  82110. return;
  82111. }
  82112. });
  82113. // 如果有服务,获取数据源和数据集, 然后请求rest服务
  82114. resultData && me.getDatafromRest(resultData.serviceType, resultData.address, success);
  82115. } else {
  82116. me.getDatafromContent(url, success);
  82117. return;
  82118. }
  82119. })["catch"](function (error) {
  82120. console.log(error);
  82121. me._fireFailedEvent(error);
  82122. });
  82123. }
  82124. /**
  82125. * @private
  82126. * @function ChartModel.prototype.getDatafromURL
  82127. * @description 用iportal获取数据。(通过固定的url来请求,但是不能请求工作空间的数据)
  82128. * @param {string} url
  82129. * @param {Callbacks} success - 成功回调函数。
  82130. */
  82131. }, {
  82132. key: "getDatafromContent",
  82133. value: function getDatafromContent(url, success) {
  82134. var _this = this;
  82135. // 成功回调传入的results
  82136. var results = {
  82137. result: {}
  82138. },
  82139. me = this;
  82140. url += '/content.json?pageSize=9999999&currentPage=1';
  82141. // 获取图层数据
  82142. FetchRequest.get(url, null, {
  82143. withCredentials: this.datasets.withCredentials
  82144. }).then(function (response) {
  82145. return response.json();
  82146. }).then(function (data) {
  82147. if (data.succeed === false) {
  82148. //请求失败
  82149. me._fireFailedEvent(data);
  82150. return;
  82151. }
  82152. if (data.type) {
  82153. if (data.type === 'JSON' || data.type === 'GEOJSON') {
  82154. // 将字符串转换成json
  82155. data.content = JSON.parse(data.content.trim());
  82156. // 如果是json文件 data.content = {type:'fco', features},格式不固定
  82157. if (!data.content.features) {
  82158. //json格式解析失败
  82159. console.log(Lang.i18n('msg_jsonResolveFiled'));
  82160. return;
  82161. }
  82162. var features = _this._formatGeoJSON(data.content);
  82163. results.result.features = {
  82164. type: data.content.type,
  82165. features: features
  82166. };
  82167. } else if (data.type === 'EXCEL' || data.type === 'CSV') {
  82168. var _features = _this._excelData2Feature(data.content);
  82169. results.result.features = {
  82170. type: 'FeatureCollection',
  82171. features: _features
  82172. };
  82173. }
  82174. success(results, 'content');
  82175. }
  82176. }, this)["catch"](function (error) {
  82177. console.log(error);
  82178. me._fireFailedEvent(error);
  82179. });
  82180. }
  82181. /**
  82182. * @private
  82183. * @function ChartModel.prototype._getDataSource
  82184. * @description 获取数据源名和数据集名。
  82185. * @param {string} serviceType 服务类型
  82186. * @param {string} address 地址
  82187. * @param {Callbacks} success - 成功回调函数。
  82188. * @return {Array.<string>} ["数据源名:数据集名"]
  82189. * @return {string} 图层名
  82190. */
  82191. }, {
  82192. key: "getDatafromRest",
  82193. value: function getDatafromRest(serviceType, address, success) {
  82194. var me = this,
  82195. withCredentials = this.datasets.withCredentials;
  82196. if (serviceType === 'RESTDATA') {
  82197. var url = "".concat(address, "/data/datasources"),
  82198. sourceName,
  82199. datasetName;
  82200. // 请求获取数据源名
  82201. FetchRequest.get(url, null, {
  82202. withCredentials: withCredentials
  82203. }).then(function (response) {
  82204. return response.json();
  82205. }).then(function (data) {
  82206. sourceName = data.datasourceNames[0];
  82207. url = "".concat(address, "/data/datasources/").concat(sourceName, "/datasets");
  82208. // 请求获取数据集名
  82209. FetchRequest.get(url, null, {
  82210. withCredentials: withCredentials
  82211. }).then(function (response) {
  82212. return response.json();
  82213. }).then(function (data) {
  82214. datasetName = data.datasetNames[0];
  82215. // 请求restdata服务
  82216. me.getDatafromRestData("".concat(address, "/data"), [sourceName + ':' + datasetName], success);
  82217. return [sourceName + ':' + datasetName];
  82218. })["catch"](function (error) {
  82219. me._fireFailedEvent(error);
  82220. });
  82221. })["catch"](function (error) {
  82222. me._fireFailedEvent(error);
  82223. });
  82224. } else {
  82225. // 如果是地图服务
  82226. var _url = "".concat(address, "/maps"),
  82227. mapName,
  82228. layerName,
  82229. path;
  82230. // 请求获取地图名
  82231. FetchRequest.get(_url, null, {
  82232. withCredentials: withCredentials
  82233. }).then(function (response) {
  82234. return response.json();
  82235. }).then(function (data) {
  82236. mapName = data[0].name;
  82237. path = data[0].path;
  82238. _url = _url = "".concat(address, "/maps/").concat(mapName, "/layers");
  82239. // 请求获取图层名
  82240. FetchRequest.get(_url, null, {
  82241. withCredentials: withCredentials
  82242. }).then(function (response) {
  82243. return response.json();
  82244. }).then(function (data) {
  82245. layerName = data[0].subLayers.layers[0].caption;
  82246. // 请求restmap服务
  82247. me.getDatafromRestMap(layerName, path, success);
  82248. return layerName;
  82249. })["catch"](function (error) {
  82250. me._fireFailedEvent(error);
  82251. });
  82252. })["catch"](function (error) {
  82253. me._fireFailedEvent(error);
  82254. });
  82255. }
  82256. }
  82257. /**
  82258. * @private
  82259. * @function ChartModel.prototype.getDatafromRestData
  82260. * @description 请求restdata服务
  82261. * @param {string} url
  82262. * @param {Array<string>} dataSource [数据源名:数据集名]
  82263. * @param {Callbacks} success - 成功回调函数。
  82264. */
  82265. }, {
  82266. key: "getDatafromRestData",
  82267. value: function getDatafromRestData(url, dataSource, success) {
  82268. var me = this;
  82269. this.datasets.queryInfo.attributeFilter = this.datasets.queryInfo.attributeFilter || 'SmID>0';
  82270. this._getFeatureBySQL(url, dataSource, this.datasets.queryInfo, function (results) {
  82271. // 此时的features已经处理成geojson了
  82272. success(results, 'RESTDATA');
  82273. }, function (error) {
  82274. console.log(error);
  82275. me._fireFailedEvent(error);
  82276. });
  82277. }
  82278. /**
  82279. * @private
  82280. * @function ChartModel.prototype.getDatafromRestMap
  82281. * @description 请求restmap服务
  82282. * @param {string} dataSource layerName
  82283. * @param {string} path - map服务地址。
  82284. * @param {Callbacks} success - 成功回调函数。
  82285. */
  82286. }, {
  82287. key: "getDatafromRestMap",
  82288. value: function getDatafromRestMap(dataSource, path, success) {
  82289. var me = this;
  82290. this.datasets.queryInfo.attributeFilter = this.datasets.queryInfo.attributeFilter || 'smid=1';
  82291. this._queryFeatureBySQL(path, dataSource, this.datasets.queryInfo, null, null, function (results) {
  82292. // let features = result.result.recordsets[0].features;
  82293. success(results, 'RESTMAP');
  82294. }, function (error) {
  82295. console.log(error);
  82296. me._fireFailedEvent(error);
  82297. });
  82298. }
  82299. /**
  82300. * @private
  82301. * @function ChartModel.prototype._getFeatureBySQL
  82302. * @description 通过 sql 方式查询数据。
  82303. */
  82304. }, {
  82305. key: "_getFeatureBySQL",
  82306. value: function _getFeatureBySQL(url, datasetNames, queryInfo, _processCompleted, processFaild) {
  82307. var getFeatureParam, getFeatureBySQLService, getFeatureBySQLParams;
  82308. var params = {
  82309. name: datasetNames.join().replace(':', '@')
  82310. };
  82311. Object.assign(params, queryInfo);
  82312. getFeatureParam = new FilterParameter(params);
  82313. getFeatureBySQLParams = new GetFeaturesBySQLParameters({
  82314. queryParameter: getFeatureParam,
  82315. datasetNames: datasetNames,
  82316. fromIndex: 0,
  82317. toIndex: 100000,
  82318. returnContent: true
  82319. });
  82320. var options = {
  82321. eventListeners: {
  82322. processCompleted: function processCompleted(getFeaturesEventArgs) {
  82323. _processCompleted && _processCompleted(getFeaturesEventArgs);
  82324. },
  82325. processFailed: function processFailed(e) {
  82326. processFaild && processFaild(e);
  82327. }
  82328. }
  82329. };
  82330. getFeatureBySQLService = new GetFeaturesBySQLService(url, options);
  82331. getFeatureBySQLService.processAsync(getFeatureBySQLParams);
  82332. }
  82333. /**
  82334. * @private
  82335. * @function ChartModel.prototype._queryFeatureBySQL
  82336. * @description 通过 sql 方式查询数据。
  82337. */
  82338. }, {
  82339. key: "_queryFeatureBySQL",
  82340. value: function _queryFeatureBySQL(url, layerName, queryInfo, fields, epsgCode, processCompleted, processFaild, startRecord, recordLength, onlyAttribute) {
  82341. var queryParam, queryBySQLParams;
  82342. var filterParams = {
  82343. name: layerName
  82344. };
  82345. Object.assign(filterParams, queryInfo);
  82346. queryParam = new FilterParameter(filterParams);
  82347. if (fields) {
  82348. queryParam.fields = fields;
  82349. }
  82350. var params = {
  82351. queryParams: [queryParam]
  82352. };
  82353. if (onlyAttribute) {
  82354. params.queryOption = QueryOption.ATTRIBUTE;
  82355. }
  82356. startRecord && (params.startRecord = startRecord);
  82357. recordLength && (params.expectCount = recordLength);
  82358. if (epsgCode) {
  82359. params.prjCoordSys = {
  82360. epsgCode: epsgCode
  82361. };
  82362. }
  82363. queryBySQLParams = new QueryBySQLParameters(params);
  82364. this._queryBySQL(url, queryBySQLParams, function (data) {
  82365. data.type === 'processCompleted' ? processCompleted(data) : processFaild(data);
  82366. });
  82367. }
  82368. /**
  82369. * @function ChartModel.prototype._queryBySQL
  82370. * @description SQL 查询服务。
  82371. * @param {QueryBySQLParameters} params - SQL 查询相关参数类。
  82372. * @param {RequestCallback} callback - 回调函数。
  82373. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 结果类型。
  82374. */
  82375. }, {
  82376. key: "_queryBySQL",
  82377. value: function _queryBySQL(url, params, callback, resultFormat) {
  82378. var me = this;
  82379. var queryBySQLService = new QueryBySQLService(url, {
  82380. eventListeners: {
  82381. scope: me,
  82382. processCompleted: callback,
  82383. processFailed: callback
  82384. },
  82385. format: me._processFormat(resultFormat)
  82386. });
  82387. queryBySQLService.processAsync(params);
  82388. }
  82389. /**
  82390. * @function ChartModel.prototype._processFormat
  82391. * @description 将数据转换成geojson。
  82392. * @param {Object} resultFormat - 返回结果集。
  82393. * @return {Object} [resultFormat=DataFormat.GEOJSON] - 结果类型。
  82394. */
  82395. }, {
  82396. key: "_processFormat",
  82397. value: function _processFormat(resultFormat) {
  82398. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  82399. }
  82400. /**
  82401. * @private
  82402. * @function ChartModel.prototype._formatGeoJSON
  82403. * @description 格式 GeoJSON。
  82404. * @param {GeoJSON} data - GeoJSON 数据。
  82405. */
  82406. }, {
  82407. key: "_formatGeoJSON",
  82408. value: function _formatGeoJSON(data) {
  82409. var features = data.features;
  82410. features.forEach(function (row, index) {
  82411. row.properties['index'] = index;
  82412. });
  82413. return features;
  82414. }
  82415. /**
  82416. * @private
  82417. * @description 将 csv 和 xls 文件内容转换成 geojson
  82418. * @function ChartModel.prototype._excelData2Feature
  82419. * @param content 文件内容
  82420. * @param layerInfo 图层信息
  82421. * @returns {Array} feature的数组集合
  82422. */
  82423. }, {
  82424. key: "_excelData2Feature",
  82425. value: function _excelData2Feature(dataContent) {
  82426. var fieldCaptions = dataContent.colTitles;
  82427. //位置属性处理
  82428. var xfieldIndex = -1,
  82429. yfieldIndex = -1;
  82430. for (var i = 0, len = fieldCaptions.length; i < len; i++) {
  82431. if (FileReaderUtil.isXField(fieldCaptions[i])) {
  82432. xfieldIndex = i;
  82433. }
  82434. if (FileReaderUtil.isYField(fieldCaptions[i])) {
  82435. yfieldIndex = i;
  82436. }
  82437. }
  82438. // feature 构建后期支持坐标系 4326/3857
  82439. var features = [];
  82440. for (var _i2 = 0, _len2 = dataContent.rows.length; _i2 < _len2; _i2++) {
  82441. var row = dataContent.rows[_i2];
  82442. var x = Number(row[xfieldIndex]),
  82443. y = Number(row[yfieldIndex]);
  82444. //属性信息
  82445. var attributes = {};
  82446. for (var index in dataContent.colTitles) {
  82447. var key = dataContent.colTitles[index];
  82448. attributes[key] = dataContent.rows[_i2][index];
  82449. }
  82450. attributes['index'] = _i2 + '';
  82451. //目前csv 只支持处理点,所以先生成点类型的 geojson
  82452. var feature = {
  82453. type: 'Feature',
  82454. geometry: {
  82455. type: 'Point',
  82456. coordinates: [x, y]
  82457. },
  82458. properties: attributes
  82459. };
  82460. features.push(feature);
  82461. }
  82462. return features;
  82463. }
  82464. /**
  82465. * @private
  82466. * @description 请求数据失败的事件
  82467. * @function ChartModel.prototype._fireFailedEvent
  82468. * @param {Object} error 错误信息
  82469. */
  82470. }, {
  82471. key: "_fireFailedEvent",
  82472. value: function _fireFailedEvent(error) {
  82473. var errorData = error ? {
  82474. error: error,
  82475. message: Lang.i18n('msg_getdatafailed')
  82476. } : {
  82477. message: Lang.i18n('msg_getdatafailed')
  82478. };
  82479. /**
  82480. * @event ChartModel#getdatafailed
  82481. * @description 监听到获取数据失败事件后触发
  82482. * @property {Object} error - 事件对象。
  82483. */
  82484. this.events.triggerEvent('getdatafailed', errorData);
  82485. }
  82486. }]);
  82487. return ChartModel;
  82488. }();
  82489. ;// CONCATENATED MODULE: ./src/common/components/chart/ChartViewModel.js
  82490. function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = ChartViewModel_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
  82491. function ChartViewModel_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return ChartViewModel_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ChartViewModel_arrayLikeToArray(o, minLen); }
  82492. function ChartViewModel_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  82493. function ChartViewModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  82494. function ChartViewModel_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  82495. function ChartViewModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartViewModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartViewModel_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  82496. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  82497. * This program are made available under the terms of the Apache License, Version 2.0
  82498. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  82499. /**
  82500. * @class ChartViewModel
  82501. * @aliasclass Components.ChartViewModel
  82502. * @deprecatedclass SuperMap.Components.ChartViewModel
  82503. * @classdesc 图表组件功能类。
  82504. * @category Components Chart
  82505. * @version 10.0.0
  82506. * @param {Object} options - 可选参数。
  82507. * @param {string} options.type - 图表类型。
  82508. * @param {ChartView.Datasets} options.datasets - 数据来源。
  82509. * @param {Array.<Object>} options.chartOptions - 图表可选配置。
  82510. * @param {Array.<Object>} options.chartOptions.xAxis - X轴可选参数。
  82511. * @param {string} options.chartOptions.xAxis.field - X轴字段名。
  82512. * @param {string} options.chartOptions.xAxis.name - X轴名称。
  82513. * @param {Array.<Object>} options.chartOptions.yAxis - Y轴可选参数。
  82514. * @param {string} options.chartOptions.yAxis.field - Y轴字段名。
  82515. * @param {string} options.chartOptions.yAxis.name - Y轴名称。
  82516. * @fires ChartViewModel#getdatafailed
  82517. * @usage
  82518. */
  82519. var ChartViewModel = /*#__PURE__*/function () {
  82520. function ChartViewModel(options) {
  82521. ChartViewModel_classCallCheck(this, ChartViewModel);
  82522. this.datasets = options.datasets;
  82523. this.xField = [];
  82524. this.yField = [];
  82525. this.grid = {
  82526. top: "50px",
  82527. bottom: "50px",
  82528. left: "50px",
  82529. right: "60px"
  82530. };
  82531. this.chartType = options.type || "bar";
  82532. this._initXYField(options.chartOptions);
  82533. this.EVENT_TYPES = ["getdatafailed"];
  82534. this.events = new Events(this, null, this.EVENT_TYPES);
  82535. }
  82536. /**
  82537. * @function ChartViewModel.prototype._initXYField
  82538. * @description 初始化XY字段。
  82539. * @private
  82540. * @param {Object} chartOptions - options里的图表参数。
  82541. */
  82542. ChartViewModel_createClass(ChartViewModel, [{
  82543. key: "_initXYField",
  82544. value: function _initXYField(chartOptions) {
  82545. var me = this;
  82546. if (chartOptions && chartOptions.length > 0) {
  82547. chartOptions.forEach(function (option) {
  82548. if (option.xAxis) {
  82549. me.xField.push({
  82550. field: option.xAxis.field,
  82551. name: option.xAxis.name
  82552. });
  82553. }
  82554. if (option.yAxis) {
  82555. me.yField.push({
  82556. field: option.yAxis.field,
  82557. name: option.yAxis.name
  82558. });
  82559. }
  82560. });
  82561. }
  82562. }
  82563. /**
  82564. * @function ChartViewModel.prototype.getDatasetInfo
  82565. * @description 获得数据集数据。
  82566. * @param {function} success - 成功回调函数。
  82567. */
  82568. }, {
  82569. key: "getDatasetInfo",
  82570. value: function getDatasetInfo(success) {
  82571. var _this = this;
  82572. this.createChart = success;
  82573. if (this.datasets && this._checkUrl(this.datasets.url)) {
  82574. this.chartModel = new ChartModel(this.datasets);
  82575. if (this.datasets.type === 'iServer') {
  82576. this.chartModel.getDatasetInfo(this._getDatasetInfoSuccess.bind(this));
  82577. } else if (this.datasets.type === 'iPortal') {
  82578. this.chartModel.getDataInfoByIptl(this._getDataInfoSuccess.bind(this));
  82579. }
  82580. /**
  82581. * @event ChartViewModel#getdatafailed
  82582. * @description 监听到获取数据失败事件后触发。
  82583. * @property {Object} error - 事件对象。
  82584. */
  82585. this.chartModel.events.on({
  82586. "getdatafailed": function getdatafailed(error) {
  82587. _this.events.triggerEvent("getdatafailed", error);
  82588. }
  82589. });
  82590. }
  82591. }
  82592. /**
  82593. * @function ChartViewModel.prototype._getDatasetInfoSuccess
  82594. * @description 成功回调函数。
  82595. * @private
  82596. * @param {Object} results - 数据集信息。
  82597. */
  82598. }, {
  82599. key: "_getDatasetInfoSuccess",
  82600. value: function _getDatasetInfoSuccess(results) {
  82601. var datasetUrl = this.datasets.url;
  82602. //判断服务为地图服务 或者 数据服务
  82603. var restIndex = datasetUrl.indexOf("rest");
  82604. if (restIndex > 0) {
  82605. var index = datasetUrl.indexOf("/", restIndex + 5);
  82606. var type = datasetUrl.substring(restIndex + 5, index);
  82607. var dataUrl = datasetUrl.substring(0, restIndex + 4) + "/data";
  82608. if (type === "maps") {
  82609. var mapIndex = datasetUrl.indexOf("/", index + 1);
  82610. var mapName = datasetUrl.substring(index + 1, mapIndex);
  82611. dataUrl = datasetUrl.substring(0, restIndex + 4) + "/maps/" + mapName;
  82612. results.result.dataUrl = dataUrl;
  82613. this._getLayerFeatures(results);
  82614. } else if (type === "data") {
  82615. results.result.dataUrl = dataUrl;
  82616. this._getDataFeatures(results);
  82617. }
  82618. }
  82619. }
  82620. /**
  82621. * @function ChartViewModel.prototype._getDataInfoSuccess
  82622. * @description 请求iportal数据成功之后的回调。
  82623. * @private
  82624. */
  82625. }, {
  82626. key: "_getDataInfoSuccess",
  82627. value: function _getDataInfoSuccess(results, type) {
  82628. var me = this;
  82629. if (type === 'RESTMAP') {
  82630. me._getChartDatasFromLayer(results);
  82631. } else {
  82632. me._getChartDatas(results);
  82633. }
  82634. }
  82635. /**
  82636. * @function ChartViewModel.prototype._getDataFeatures
  82637. * @description 请求数据集的数据信息
  82638. * @private
  82639. * @param {Object} results - 数据集信息
  82640. */
  82641. }, {
  82642. key: "_getDataFeatures",
  82643. value: function _getDataFeatures(results) {
  82644. this.chartModel.getDataFeatures(results, this._getChartDatas.bind(this));
  82645. }
  82646. /**
  82647. * @function ChartViewModel.prototype._getLayerFeatures
  82648. * @description 请求图层的数据信息。
  82649. * @private
  82650. * @param {Object} results - 数据集信息。
  82651. */
  82652. }, {
  82653. key: "_getLayerFeatures",
  82654. value: function _getLayerFeatures(results) {
  82655. this.chartModel.getLayerFeatures(results, this._getChartDatasFromLayer.bind(this));
  82656. }
  82657. /**
  82658. * @function ChartViewModel.prototype._getChartDatas
  82659. * @description 将请求回来的数据转换为图表所需的数据格式。
  82660. * @private
  82661. * @param {Object} results - 数据要素信息。
  82662. */
  82663. }, {
  82664. key: "_getChartDatas",
  82665. value: function _getChartDatas(results) {
  82666. if (results) {
  82667. // 数据来自restdata---results.result.features
  82668. this.features = results.result.features;
  82669. var features = this.features.features;
  82670. var data = {};
  82671. if (features.length) {
  82672. var feature = features[0];
  82673. var attrFields = [],
  82674. itemTypes = [];
  82675. for (var attr in feature.properties) {
  82676. attrFields.push(attr);
  82677. itemTypes.push(this._getDataType(feature.properties[attr]));
  82678. }
  82679. data = {
  82680. features: features,
  82681. fieldCaptions: attrFields,
  82682. fieldTypes: itemTypes,
  82683. fieldValues: []
  82684. };
  82685. for (var m in itemTypes) {
  82686. var fieldValue = [];
  82687. for (var j in features) {
  82688. var _feature = features[j];
  82689. var caption = data.fieldCaptions[m];
  82690. var value = _feature.properties[caption];
  82691. fieldValue.push(value);
  82692. }
  82693. data.fieldValues.push(fieldValue);
  82694. }
  82695. this.createChart(data);
  82696. }
  82697. }
  82698. }
  82699. /**
  82700. * @function ChartViewModel.prototype._getChartDatasFromLayer
  82701. * @description 将请求回来的数据转换为图表所需的数据格式。
  82702. * @private
  82703. * @param {Object} results - 图层数据要素信息。
  82704. */
  82705. }, {
  82706. key: "_getChartDatasFromLayer",
  82707. value: function _getChartDatasFromLayer(results) {
  82708. if (results.result.recordsets) {
  82709. var recordsets = results.result.recordsets[0];
  82710. var features = recordsets.features.features;
  82711. this.features = recordsets.features;
  82712. var data = {};
  82713. if (features.length) {
  82714. data = {
  82715. features: recordsets.features,
  82716. fieldCaptions: recordsets.fieldCaptions,
  82717. fieldTypes: recordsets.fieldTypes,
  82718. fieldValues: []
  82719. };
  82720. for (var m in data.fieldCaptions) {
  82721. var fieldValue = [];
  82722. for (var j in features) {
  82723. var feature = features[j];
  82724. var caption = data.fieldCaptions[m];
  82725. var value = feature.properties[caption];
  82726. fieldValue.push(value);
  82727. }
  82728. data.fieldValues.push(fieldValue);
  82729. }
  82730. this.createChart(data);
  82731. }
  82732. }
  82733. }
  82734. /**
  82735. * @function ChartViewModel.prototype._createChartOptions
  82736. * @description 创建图表所需参数。
  82737. * @private
  82738. * @param {Object} data - 图表数据。
  82739. */
  82740. }, {
  82741. key: "_createChartOptions",
  82742. value: function _createChartOptions(data) {
  82743. this.calculatedData = this._createChartDatas(data);
  82744. return this.updateChartOptions(this.chartType);
  82745. }
  82746. /**
  82747. * @function ChartViewModel.prototype.changeType
  82748. * @description 改变图表类型。
  82749. * @param {string} type - 图表类型。
  82750. */
  82751. }, {
  82752. key: "changeType",
  82753. value: function changeType(type) {
  82754. if (type !== this.chartType) {
  82755. this.chartType = type;
  82756. return this.updateChartOptions(this.chartType);
  82757. }
  82758. }
  82759. /**
  82760. * @function ChartViewModel.prototype.updateData
  82761. * @description 改变图表类型。
  82762. * @param {ChartView.Datasets} datasets - 数据来源。
  82763. * @param {function} success 成功回调函数。
  82764. */
  82765. }, {
  82766. key: "updateData",
  82767. value: function updateData(datasets, chartOption, success) {
  82768. this.updateChart = success;
  82769. this.xField = [];
  82770. this.yField = [];
  82771. this._initXYField(chartOption);
  82772. // type的设置默认值
  82773. datasets.type = datasets.type || 'iServer';
  82774. // withCredentials的设置默认值
  82775. datasets.withCredentials = datasets.withCredentials || false;
  82776. this.datasets = datasets;
  82777. this.getDatasetInfo(this._updateDataSuccess.bind(this));
  82778. }
  82779. /**
  82780. * @function ChartViewModel.prototype._updateDataSuccess
  82781. * @description 改变图表类型。
  82782. * @private
  82783. * @param {Object} data - 图表数据。
  82784. */
  82785. }, {
  82786. key: "_updateDataSuccess",
  82787. value: function _updateDataSuccess(data) {
  82788. var options = this._createChartOptions(data);
  82789. this.updateChart(options);
  82790. }
  82791. /**
  82792. * @function ChartViewModel.prototype.updateChartOptions
  82793. * @description 更新图表所需参数。
  82794. * @param {string} type - 图表类型。
  82795. * @param {Object} style - 图表样式。
  82796. */
  82797. }, {
  82798. key: "updateChartOptions",
  82799. value: function updateChartOptions(type, style) {
  82800. if (this.calculatedData) {
  82801. var grid = this.grid;
  82802. var series = this._createChartSeries(this.calculatedData, type);
  82803. var datas = [];
  82804. for (var i in this.calculatedData.XData) {
  82805. datas.push({
  82806. value: this.calculatedData.XData[i].fieldsData
  82807. });
  82808. }
  82809. var xAxis = {
  82810. type: "category",
  82811. name: this.xField[0].name || "X",
  82812. data: datas,
  82813. nameTextStyle: {
  82814. color: '#fff',
  82815. fontSize: 14
  82816. },
  82817. splitLine: {
  82818. show: false
  82819. },
  82820. axisLine: {
  82821. lineStyle: {
  82822. color: '#eee'
  82823. }
  82824. }
  82825. };
  82826. var yAxis = {
  82827. type: "value",
  82828. name: this.yFieldName || "Y",
  82829. data: {},
  82830. nameTextStyle: {
  82831. color: '#fff',
  82832. fontSize: 14
  82833. },
  82834. splitLine: {
  82835. show: false
  82836. },
  82837. axisLine: {
  82838. lineStyle: {
  82839. color: '#eee'
  82840. }
  82841. }
  82842. };
  82843. var tooltip = {
  82844. formatter: '{b0}: {c0}'
  82845. };
  82846. var backgroundColor = '#404a59';
  82847. if (style) {
  82848. if (style.grid) {
  82849. grid = style.grid;
  82850. }
  82851. if (style.tooltip) {
  82852. tooltip = style.tooltip;
  82853. }
  82854. if (style.backgroundColor) {
  82855. backgroundColor = style.backgroundColor;
  82856. }
  82857. }
  82858. return {
  82859. backgroundColor: backgroundColor,
  82860. grid: grid,
  82861. series: series,
  82862. xAxis: xAxis,
  82863. yAxis: yAxis,
  82864. tooltip: tooltip
  82865. };
  82866. }
  82867. }
  82868. /**
  82869. * @function ChartViewModel.prototype._createChartDatas
  82870. * @description 构建图表数据。
  82871. * @private
  82872. * @param {Object} data - 源数据。
  82873. */
  82874. }, {
  82875. key: "_createChartDatas",
  82876. value: function _createChartDatas(data) {
  82877. var fieldIndex = 0,
  82878. yfieldIndexs = [];
  82879. var fieldCaptions = data.fieldCaptions;
  82880. var me = this;
  82881. //X
  82882. fieldCaptions.forEach(function (field, index) {
  82883. if (me.xField[0] && field === me.xField[0].field) {
  82884. fieldIndex = index;
  82885. }
  82886. });
  82887. //Y
  82888. this.yFieldName = "";
  82889. this.yField.forEach(function (value, index) {
  82890. if (index !== 0) {
  82891. me.yFieldName = me.yFieldName + ",";
  82892. }
  82893. me.yFieldName = me.yFieldName + value.name;
  82894. fieldCaptions.forEach(function (field, index) {
  82895. if (field === value.field) {
  82896. yfieldIndexs.push(index);
  82897. }
  82898. });
  82899. });
  82900. var datas = this._getAttrData(data, fieldIndex);
  82901. var yDatas = [];
  82902. if (yfieldIndexs.length > 0) {
  82903. yfieldIndexs.forEach(function (yfieldIndex) {
  82904. var yData = [];
  82905. for (var i in data.fieldValues[yfieldIndex]) {
  82906. yData.push({
  82907. value: data.fieldValues[yfieldIndex][i]
  82908. });
  82909. }
  82910. yDatas.push(yData);
  82911. });
  82912. } else {
  82913. //未指定Y字段时,y轴计数
  82914. var YData = [],
  82915. XData = [],
  82916. len = datas.length;
  82917. //计算X轴,Y轴数据,并去重
  82918. for (var i = 0; i < len; i++) {
  82919. var isSame = false;
  82920. for (var j = 0, leng = XData.length; j < leng; j++) {
  82921. if (datas[i].fieldsData === XData[j].fieldsData) {
  82922. YData[j].value++;
  82923. XData[j].recordIndexs.push(i);
  82924. isSame = true;
  82925. break;
  82926. }
  82927. }
  82928. if (!isSame) {
  82929. if (datas[i].fieldsData) {
  82930. XData.push({
  82931. fieldsData: datas[i].fieldsData,
  82932. recordIndexs: [i]
  82933. });
  82934. YData.push({
  82935. value: 1
  82936. });
  82937. }
  82938. }
  82939. }
  82940. datas = XData;
  82941. yDatas = [YData];
  82942. }
  82943. return {
  82944. XData: datas,
  82945. YData: yDatas
  82946. };
  82947. }
  82948. /**
  82949. * @function ChartViewModel.prototype._getAttrData
  82950. * @description 选中字段数据。
  82951. * @private
  82952. * @param {Object} datacontent - 图表数据。
  82953. * @param {number} index - 字段索引。
  82954. */
  82955. }, {
  82956. key: "_getAttrData",
  82957. value: function _getAttrData(datacontent, index) {
  82958. if (index === 0) {
  82959. this.xField = [{
  82960. field: datacontent.fieldCaptions[index],
  82961. name: datacontent.fieldCaptions[index]
  82962. }];
  82963. }
  82964. var fieldsDatas = [];
  82965. for (var i = 0, len = datacontent.fieldValues[index].length; i < len; i++) {
  82966. var value = datacontent.fieldValues[index][i];
  82967. fieldsDatas.push({
  82968. recordIndexs: i,
  82969. fieldsData: value
  82970. });
  82971. }
  82972. return fieldsDatas;
  82973. }
  82974. /**
  82975. * @function ChartViewModel.prototype._createChartSeries
  82976. * @description 图表数据。
  82977. * @private
  82978. * @param {Object} calculatedData - 图表数据。
  82979. * @param {string} chartType - 图表类型。
  82980. */
  82981. }, {
  82982. key: "_createChartSeries",
  82983. value: function _createChartSeries(calculatedData, chartType) {
  82984. var series = [];
  82985. var yDatas = calculatedData.YData;
  82986. yDatas.forEach(function (yData) {
  82987. var value = 0;
  82988. var serieData = [];
  82989. var _iterator = _createForOfIteratorHelper(yData),
  82990. _step;
  82991. try {
  82992. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  82993. var data = _step.value;
  82994. value = data.value;
  82995. serieData.push({
  82996. value: value
  82997. });
  82998. }
  82999. } catch (err) {
  83000. _iterator.e(err);
  83001. } finally {
  83002. _iterator.f();
  83003. }
  83004. var serie = {
  83005. type: chartType,
  83006. data: serieData,
  83007. name: "y"
  83008. };
  83009. series.push(serie);
  83010. });
  83011. return series;
  83012. }
  83013. /**
  83014. * @function ChartViewModel.prototype._isDate
  83015. * @description 判断是否为日期。
  83016. * @private
  83017. * @param {string} data - 字符串。
  83018. */
  83019. }, {
  83020. key: "_isDate",
  83021. value: function _isDate(data) {
  83022. var reg = /((^((1[8-9]\d{2})|([2-9]\d{3}))([-\/\._])(10|12|0?[13578])([-\/\._])(3[01]|[12][0-9]|0?[1-9])$)|(^((1[8-9]\d{2})|([2-9]\d{3}))([-\/\._])(11|0?[469])([-\/\._])(30|[12][0-9]|0?[1-9])$)|(^((1[8-9]\d{2})|([2-9]\d{3}))([-\/\._])(0?2)([-\/\._])(2[0-8]|1[0-9]|0?[1-9])$)|(^([2468][048]00)([-\/\._])(0?2)([-\/\._])(29)$)|(^([3579][26]00)([-\/\._])(0?2)([-\/\._])(29)$)|(^([1][89][0][48])([-\/\._])(0?2)([-\/\._])(29)$)|(^([2-9][0-9][0][48])([-\/\._])(0?2)([-\/\._])(29)$)|(^([1][89][2468][048])([-\/\._])(0?2)([-\/\._])(29)$)|(^([2-9][0-9][2468][048])([-\/\._])(0?2)([-\/\._])(29)$)|(^([1][89][13579][26])([-\/\._])(0?2)([-\/\._])(29)$)|(^([2-9][0-9][13579][26])([-\/\._])(0?2)([-\/\._])(29)$))/ig;
  83023. return reg.test(data);
  83024. }
  83025. /**
  83026. * @function ChartViewModel.prototype._isNumber
  83027. * @description 判断是否为数值。
  83028. * @private
  83029. * @param {string} data - 字符串。
  83030. */
  83031. }, {
  83032. key: "_isNumber",
  83033. value: function _isNumber(data) {
  83034. var mdata = Number(data);
  83035. if (mdata === 0) {
  83036. return true;
  83037. }
  83038. return !isNaN(mdata);
  83039. }
  83040. /**
  83041. * @function ChartViewModel.prototype._getDataType
  83042. * @description 判断数据的类型。
  83043. * @private
  83044. * @param {string} data - 字符串。
  83045. */
  83046. }, {
  83047. key: "_getDataType",
  83048. value: function _getDataType(data) {
  83049. if (data !== null && data !== undefined && data !== '') {
  83050. if (this._isDate(data)) {
  83051. return "DATE";
  83052. }
  83053. if (this._isNumber(data)) {
  83054. return "NUMBER";
  83055. }
  83056. }
  83057. return "STRING";
  83058. }
  83059. /**
  83060. * @function ChartViewModel.prototype._checkUrl
  83061. * @description 检查url是否符合要求。
  83062. * @private
  83063. * @param {string} url。
  83064. */
  83065. }, {
  83066. key: "_checkUrl",
  83067. value: function _checkUrl(url) {
  83068. var match;
  83069. if (url === '' || !this._isMatchUrl(url)) {
  83070. match = false;
  83071. } else if (/^http[s]?:\/\/localhost/.test(url) || /^http[s]?:\/\/127.0.0.1/.test(url)) {
  83072. //不是实际域名
  83073. match = false;
  83074. } else {
  83075. match = true;
  83076. }
  83077. return match;
  83078. }
  83079. /**
  83080. * @function ChartViewModel.prototype._isMatchUrl
  83081. * @description 判断输入的地址是否符合地址格式。
  83082. * @private
  83083. * @param {string} str - url。
  83084. */
  83085. }, {
  83086. key: "_isMatchUrl",
  83087. value: function _isMatchUrl(str) {
  83088. var reg = new RegExp('(https?|http|file|ftp)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]');
  83089. return reg.test(str);
  83090. }
  83091. /**
  83092. * @function ChartViewModel.prototype.getStyle
  83093. * @description 获取图表样式。
  83094. */
  83095. }, {
  83096. key: "getStyle",
  83097. value: function getStyle() {
  83098. var style = {
  83099. grid: this.grid,
  83100. tooltip: this.tooltip,
  83101. backgroundColor: this.backgroundColor
  83102. };
  83103. return style;
  83104. }
  83105. /**
  83106. * @function ChartViewModel.prototype.getFeatures
  83107. * @description 获取地图服务,数据服务请求返回的数据。
  83108. */
  83109. }, {
  83110. key: "getFeatures",
  83111. value: function getFeatures() {
  83112. return this.features;
  83113. }
  83114. /**
  83115. * @function ChartViewModel.prototype.setStyle
  83116. * @description 设置图表样式。
  83117. * @param {Object} style - 图表样式
  83118. */
  83119. }, {
  83120. key: "setStyle",
  83121. value: function setStyle(style) {
  83122. return this.updateChartOptions(this.chartType, style);
  83123. }
  83124. }]);
  83125. return ChartViewModel;
  83126. }();
  83127. ;// CONCATENATED MODULE: ./src/common/components/chart/ChartView.js
  83128. function ChartView_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  83129. function ChartView_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  83130. function ChartView_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartView_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartView_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  83131. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  83132. * This program are made available under the terms of the Apache License, Version 2.0
  83133. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  83134. /**
  83135. * @class ChartView
  83136. * @aliasclass Components.ChartView
  83137. * @deprecatedclass SuperMap.Components.Chart
  83138. * @classdesc 图表组件。
  83139. * @modulecategory Components
  83140. * @version 9.1.2
  83141. * @param {string} domID - 图表dom元素ID。
  83142. * @param {Object} options - 可选参数。
  83143. * @param {string} options.type - 图表类型。
  83144. * @param {ChartView.Datasets} options.datasets - 数据来源。
  83145. * @param {Array.<Object>} options.chartOptions - 图表可选参数。
  83146. * @param {Array.<Object>} options.chartOptions.xAxis - 图表X轴。
  83147. * @param {string} options.chartOptions.xAxis.field - 图表X轴字段名。
  83148. * @param {string} options.chartOptions.xAxis.name - 图表X轴名称。
  83149. * @param {Array.<Object>} options.chartOptions.yAxis - 图表Y轴。
  83150. * @param {string} options.chartOptions.yAxis.field - 图表Y轴字段名。
  83151. * @param {string} options.chartOptions.yAxis.name - 图表Y轴名称。
  83152. * @category Components Chart
  83153. * @usage
  83154. */
  83155. /**
  83156. * @typedef {Object} ChartView.Datasets - 数据来源。
  83157. * @property {string} [type = 'iServer'] - 服务类型 iServer, iPortal。
  83158. * @property {string} url - 服务地址。
  83159. * @property {boolean} [withCredentials = false] - 设置请求是否带cookie。
  83160. * @property {FilterParameter} queryInfo - 查询条件。
  83161. */
  83162. var ChartView = /*#__PURE__*/function () {
  83163. function ChartView(domID, options) {
  83164. ChartView_classCallCheck(this, ChartView);
  83165. this.domID = domID;
  83166. this.chartType = options.type || "bar";
  83167. // 设置options.datasets.type的默认值是iServer
  83168. options.datasets.type = options.datasets.type || 'iServer';
  83169. // 设置withCredentials的默认值为false
  83170. options.datasets.withCredentials = options.datasets.withCredentials || false;
  83171. this.viewModel = new ChartViewModel(options);
  83172. //添加控件。
  83173. this._fillDataToView();
  83174. }
  83175. /**
  83176. * @function ChartView.prototype.onAdd
  83177. * @description 创建图表之后成功回调。
  83178. * @param {function} addChart - 回调函数。
  83179. */
  83180. ChartView_createClass(ChartView, [{
  83181. key: "onAdd",
  83182. value: function onAdd(addChart) {
  83183. this.addChart = addChart;
  83184. }
  83185. /**
  83186. * @function ChartView.prototype._fillDataToView
  83187. * @description 填充数据到 view。
  83188. * @private
  83189. */
  83190. }, {
  83191. key: "_fillDataToView",
  83192. value: function _fillDataToView() {
  83193. var messageboxs = new MessageBox();
  83194. //iclient 绑定createChart事件成功回调
  83195. this.viewModel.getDatasetInfo(this._createChart.bind(this));
  83196. this.viewModel.events.on({
  83197. "getdatafailed": function getdatafailed(error) {
  83198. messageboxs.showView(error.message);
  83199. }
  83200. });
  83201. }
  83202. /**
  83203. * @function ChartView.prototype.getStyle
  83204. * @description 获取图表样式。
  83205. */
  83206. }, {
  83207. key: "getStyle",
  83208. value: function getStyle() {
  83209. return this.viewModel.getStyle();
  83210. }
  83211. /**
  83212. * @function ChartView.prototype.getFeatures
  83213. * @description 获取地图服务,数据服务请求返回的数据。
  83214. */
  83215. }, {
  83216. key: "getFeatures",
  83217. value: function getFeatures() {
  83218. return this.viewModel.getFeatures();
  83219. }
  83220. /**
  83221. * @function ChartView.prototype.setStyle
  83222. * @description 设置图表样式。
  83223. * @param {Object} style - 图表样式,参考Echarts-options样式设置。
  83224. */
  83225. }, {
  83226. key: "setStyle",
  83227. value: function setStyle(style) {
  83228. var newOptions = this.viewModel.setStyle(style);
  83229. this._updateChart(newOptions);
  83230. }
  83231. /**
  83232. * @function ChartView.prototype.changeType
  83233. * @description 改变图表类型。
  83234. * @param {string} type - 图表类型。
  83235. */
  83236. }, {
  83237. key: "changeType",
  83238. value: function changeType(type) {
  83239. if (this.chartType !== type) {
  83240. this.chartType = type;
  83241. var newOptions = this.viewModel.changeType(type);
  83242. this._updateChart(newOptions);
  83243. }
  83244. }
  83245. /**
  83246. * @function ChartView.prototype.updateData
  83247. * @description 更新图表数据。
  83248. * @param {ChartView.Datasets} datasets - 数据来源。
  83249. * @param {Object} chartOption - X,Y轴信息。
  83250. */
  83251. }, {
  83252. key: "updateData",
  83253. value: function updateData(datasets, chartOption) {
  83254. var me = this;
  83255. this.viewModel.updateData(datasets, chartOption, function (options) {
  83256. me._updateChart(options);
  83257. if (me.addChart) {
  83258. me.addChart();
  83259. }
  83260. });
  83261. }
  83262. /**
  83263. * @function ChartView.prototype._createChart
  83264. * @description 创建图表。
  83265. * @private
  83266. * @param {Object} data - 图表数据。
  83267. */
  83268. }, {
  83269. key: "_createChart",
  83270. value: function _createChart(data) {
  83271. this.echart = external_function_try_return_echarts_catch_e_return_namespaceObject.init(document.getElementById(this.domID), null, {
  83272. renderer: "canvas"
  83273. });
  83274. var options = this.viewModel._createChartOptions(data);
  83275. this.echart.setOption(options);
  83276. if (this.addChart) {
  83277. this.addChart();
  83278. }
  83279. }
  83280. /**
  83281. * @function ChartView.prototype._updateChart
  83282. * @description 更新图表。
  83283. * @private
  83284. * @param {Object} options - 图表参数。
  83285. */
  83286. }, {
  83287. key: "_updateChart",
  83288. value: function _updateChart(options) {
  83289. if (this.echart) {
  83290. this.echart.clear();
  83291. this.echart.setOption(options);
  83292. }
  83293. }
  83294. }]);
  83295. return ChartView;
  83296. }();
  83297. ;// CONCATENATED MODULE: ./src/common/components/templates/TemplateBase.js
  83298. function TemplateBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  83299. function TemplateBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  83300. function TemplateBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) TemplateBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) TemplateBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  83301. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  83302. * This program are made available under the terms of the Apache License, Version 2.0
  83303. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  83304. /**
  83305. * @class TemplateBase
  83306. * @aliasclass Components.TemplateBase
  83307. * @deprecatedclass SuperMap.Components.TemplateBase
  83308. * @classdesc 组件公用组件父类,用于约束统一封装的公用组件结构。
  83309. * @version 9.1.1
  83310. * @param {Object} options - 组件配置参数。
  83311. * @param {string} options.id - 组件 dom 元素 id。
  83312. * @category Components Common
  83313. * @usage
  83314. */
  83315. var TemplateBase = /*#__PURE__*/function () {
  83316. function TemplateBase(options) {
  83317. TemplateBase_classCallCheck(this, TemplateBase);
  83318. options = options ? options : {};
  83319. /**
  83320. * @member {string} [TemplateBase.prototype.id=null]
  83321. * @description 组件 dom 元素 id。
  83322. */
  83323. this.id = options.id ? options.id : null;
  83324. /**
  83325. * @member {HTMLElement} [TemplateBase.prototype.rootContainer=null]
  83326. * @description 组件 dom 元素对象。
  83327. */
  83328. this.rootContainer = null;
  83329. }
  83330. /**
  83331. * @function TemplateBase.prototype.getElement
  83332. * @description 获取当前组件元素对象。
  83333. * @return {HTMLElement} 组件 dom 元素对象
  83334. */
  83335. TemplateBase_createClass(TemplateBase, [{
  83336. key: "getElement",
  83337. value: function getElement() {
  83338. //todo 其实感觉再这里给组件设置不太合理
  83339. if (this.id) {
  83340. this.rootContainer.id = this.id;
  83341. }
  83342. return this.rootContainer;
  83343. }
  83344. /**
  83345. * @function TemplateBase.prototype._initView
  83346. * @private
  83347. * @description 初始化模板。
  83348. */
  83349. }, {
  83350. key: "_initView",
  83351. value: function _initView() {
  83352. //子类实现此方法
  83353. }
  83354. /**
  83355. * @function TemplateBase.prototype.showView
  83356. * @description 显示组件。
  83357. */
  83358. }, {
  83359. key: "showView",
  83360. value: function showView() {
  83361. this.rootContainer.hidden = false;
  83362. }
  83363. /**
  83364. * @function TemplateBase.prototype.closeView
  83365. * @description 隐藏组件。
  83366. */
  83367. }, {
  83368. key: "closeView",
  83369. value: function closeView() {
  83370. this.rootContainer.hidden = true;
  83371. }
  83372. }]);
  83373. return TemplateBase;
  83374. }();
  83375. ;// CONCATENATED MODULE: ./src/common/components/templates/CommonContainer.js
  83376. function CommonContainer_typeof(obj) { "@babel/helpers - typeof"; return CommonContainer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, CommonContainer_typeof(obj); }
  83377. function CommonContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  83378. function CommonContainer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  83379. function CommonContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) CommonContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) CommonContainer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  83380. function CommonContainer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) CommonContainer_setPrototypeOf(subClass, superClass); }
  83381. function CommonContainer_setPrototypeOf(o, p) { CommonContainer_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return CommonContainer_setPrototypeOf(o, p); }
  83382. function CommonContainer_createSuper(Derived) { var hasNativeReflectConstruct = CommonContainer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = CommonContainer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = CommonContainer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return CommonContainer_possibleConstructorReturn(this, result); }; }
  83383. function CommonContainer_possibleConstructorReturn(self, call) { if (call && (CommonContainer_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return CommonContainer_assertThisInitialized(self); }
  83384. function CommonContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  83385. function CommonContainer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  83386. function CommonContainer_getPrototypeOf(o) { CommonContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return CommonContainer_getPrototypeOf(o); }
  83387. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  83388. * This program are made available under the terms of the Apache License, Version 2.0
  83389. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  83390. /**
  83391. * @class CommonContainer
  83392. * @aliasclass Components.CommonContainer
  83393. * @deprecatedclass SuperMap.Components.CommonContainer
  83394. * @classdesc 组件统一外框。
  83395. * @version 9.1.1
  83396. * @param {Object} options - 组件配置参数。
  83397. * @param {string} options.id - 组件 dom 元素 id。
  83398. * @param {string} options.title - 标题。
  83399. * @category Components Common
  83400. * @extends {TemplateBase}
  83401. * @usage
  83402. */
  83403. var CommonContainer = /*#__PURE__*/function (_TemplateBase) {
  83404. CommonContainer_inherits(CommonContainer, _TemplateBase);
  83405. var _super = CommonContainer_createSuper(CommonContainer);
  83406. function CommonContainer(options) {
  83407. var _this;
  83408. CommonContainer_classCallCheck(this, CommonContainer);
  83409. _this = _super.call(this, options);
  83410. var title = options.title ? options.title : "";
  83411. _this._initView(title);
  83412. return _this;
  83413. }
  83414. /**
  83415. * @private
  83416. * @override
  83417. */
  83418. CommonContainer_createClass(CommonContainer, [{
  83419. key: "_initView",
  83420. value: function _initView(title) {
  83421. var container = document.createElement("div");
  83422. container.setAttribute("class", "component-container");
  83423. //title
  83424. var titleContainer = document.createElement("div");
  83425. titleContainer.setAttribute("class", "component-title");
  83426. var titleContent = document.createElement("div");
  83427. titleContent.innerHTML = title;
  83428. titleContainer.appendChild(titleContent);
  83429. container.appendChild(titleContainer);
  83430. //container
  83431. var componentContent = document.createElement("div");
  83432. componentContent.setAttribute("class", "component-content");
  83433. container.appendChild(componentContent);
  83434. this.content = componentContent;
  83435. this.rootContainer = container;
  83436. return container;
  83437. }
  83438. /**
  83439. * @function CommonContainer.prototype.getContentElement
  83440. * @description 获取内容元素容器。
  83441. */
  83442. }, {
  83443. key: "getContentElement",
  83444. value: function getContentElement() {
  83445. return this.content;
  83446. }
  83447. /**
  83448. * @function CommonContainer.prototype.appendContent
  83449. * @description 填充内容元素。
  83450. */
  83451. }, {
  83452. key: "appendContent",
  83453. value: function appendContent(element) {
  83454. this.content.appendChild(element);
  83455. }
  83456. }]);
  83457. return CommonContainer;
  83458. }(TemplateBase);
  83459. ;// CONCATENATED MODULE: ./src/common/components/templates/Select.js
  83460. function Select_typeof(obj) { "@babel/helpers - typeof"; return Select_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Select_typeof(obj); }
  83461. function Select_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  83462. function Select_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  83463. function Select_createClass(Constructor, protoProps, staticProps) { if (protoProps) Select_defineProperties(Constructor.prototype, protoProps); if (staticProps) Select_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  83464. function Select_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Select_setPrototypeOf(subClass, superClass); }
  83465. function Select_setPrototypeOf(o, p) { Select_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Select_setPrototypeOf(o, p); }
  83466. function Select_createSuper(Derived) { var hasNativeReflectConstruct = Select_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Select_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Select_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Select_possibleConstructorReturn(this, result); }; }
  83467. function Select_possibleConstructorReturn(self, call) { if (call && (Select_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Select_assertThisInitialized(self); }
  83468. function Select_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  83469. function Select_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  83470. function Select_getPrototypeOf(o) { Select_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Select_getPrototypeOf(o); }
  83471. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  83472. * This program are made available under the terms of the Apache License, Version 2.0
  83473. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  83474. /**
  83475. * @class Select
  83476. * @aliasclass Components.Select
  83477. * @deprecatedclass SuperMap.Components.Select
  83478. * @classdesc 组件统一的文字下拉框。
  83479. * @version 9.1.1
  83480. * @param {Array.<string|Array>} options - 组件配置参数数组。
  83481. * @param {string} options.id - 组件 dom 元素 id。
  83482. * @param {string} [options.labelName] - label 名称。
  83483. * @param {Array.<string>} options.optionsArr - 需要创建的 option 数据数组。
  83484. * @param {function} [options.optionsClickCb] - option 点击事件回调函数。
  83485. * @extends {TemplateBase}
  83486. * @category Components Common
  83487. * @usage
  83488. */
  83489. var Select = /*#__PURE__*/function (_TemplateBase) {
  83490. Select_inherits(Select, _TemplateBase);
  83491. var _super = Select_createSuper(Select);
  83492. function Select(options) {
  83493. var _this;
  83494. Select_classCallCheck(this, Select);
  83495. _this = _super.call(this, options);
  83496. _this._initView(options);
  83497. return _this;
  83498. }
  83499. Select_createClass(Select, [{
  83500. key: "_initView",
  83501. value: function _initView(options) {
  83502. var selectTool = this._createElement('div', "component-selecttool");
  83503. if (options.labelName) {
  83504. var label = this._createElement('label', 'component-selecttool__lable--describe', selectTool);
  83505. label.innerHTML = options.labelName;
  83506. }
  83507. var chartSelect = this._createElement('div', 'component-selecttool--chart', selectTool);
  83508. chartSelect.setAttribute('tabindex', '1');
  83509. var selectName = this._createElement('div', "component-selecttool__name", chartSelect);
  83510. selectName.title = options.optionsArr[0];
  83511. selectName.innerHTML = options.optionsArr[0];
  83512. var chartTriangleBtn = this._createElement('div', 'component-selecttool__trianglebtn--chart', chartSelect);
  83513. var triangleBtn = this._createElement('div', 'component-triangle-down-img', chartTriangleBtn);
  83514. var selectContent = this._createElement('div', 'component-selecttool__content', chartSelect);
  83515. var scrollarea = this._createElement('div', 'component-selecttool__content--chart', selectContent);
  83516. var scrollareaContent = this._createElement('div', 'component-selecttool__scrollarea__content', scrollarea);
  83517. scrollareaContent.setAttribute('tabindex', '1');
  83518. this.createOptions(scrollareaContent, options.optionsArr);
  83519. this.optionClickEvent(scrollareaContent, selectName, options.optionsClickCb);
  83520. // 下拉框显示 & 隐藏事件
  83521. this._selectClickEvent(chartSelect, selectContent, triangleBtn);
  83522. this.rootContainer = selectTool;
  83523. }
  83524. /**
  83525. * @function Select.prototype.createOptions
  83526. * @description 创建所属下拉框选项。
  83527. */
  83528. }, {
  83529. key: "createOptions",
  83530. value: function createOptions(container, optionsArr) {
  83531. for (var i in optionsArr) {
  83532. var option = this._createElement('div', 'component-selecttool__option', container);
  83533. option.title = optionsArr[i];
  83534. option.innerHTML = optionsArr[i];
  83535. }
  83536. }
  83537. /**
  83538. * @function Select.prototype._selectClickEvent
  83539. * @description select 点击显示&隐藏事件。
  83540. * @private
  83541. */
  83542. }, {
  83543. key: "_selectClickEvent",
  83544. value: function _selectClickEvent(eventElement, contentElement, triangleBtn) {
  83545. eventElement.onclick = function (e) {
  83546. if (contentElement.style.display === "block") {
  83547. contentElement.style.display = "none";
  83548. triangleBtn.className = "component-triangle-down-img";
  83549. } else {
  83550. contentElement.style.display = "block";
  83551. triangleBtn.className = "triangle-up-img";
  83552. }
  83553. e.preventDefault();
  83554. e.stopPropagation();
  83555. };
  83556. eventElement.onmousedown = function (evt) {
  83557. //console.log('dropdownbox onmousedown '+evt.target.className);
  83558. if (evt.target !== this) {
  83559. this.focus();
  83560. evt.preventDefault();
  83561. evt.stopPropagation();
  83562. }
  83563. };
  83564. eventElement.onblur = function () {
  83565. contentElement.style.display = "none";
  83566. triangleBtn.className = "component-triangle-down-img";
  83567. };
  83568. }
  83569. /**
  83570. * @function Select.prototype._createElement
  83571. * @description 通用创建元素。
  83572. * @private
  83573. */
  83574. }, {
  83575. key: "_createElement",
  83576. value: function _createElement(tagName, className, parentEle) {
  83577. var ele = document.createElement(tagName || 'div');
  83578. className && (ele.className = className);
  83579. parentEle && parentEle.appendChild(ele);
  83580. return ele;
  83581. }
  83582. /**
  83583. * @function Select.prototype.optionClickEvent
  83584. * @description 下拉框的 option 的点击事件。
  83585. */
  83586. }, {
  83587. key: "optionClickEvent",
  83588. value: function optionClickEvent(optionEleArr, selectNameEle, optionsClickCb) {
  83589. var _loop = function _loop() {
  83590. var childEle = optionEleArr.children[i];
  83591. childEle.onclick = function () {
  83592. selectNameEle.innerHTML = childEle.innerHTML;
  83593. selectNameEle.title = childEle.title;
  83594. if (childEle.getAttribute('data-value')) {
  83595. selectNameEle.setAttribute('data-value', childEle.getAttribute('data-value'));
  83596. }
  83597. optionsClickCb && optionsClickCb(childEle);
  83598. };
  83599. };
  83600. for (var i = 0; i < optionEleArr.children.length; i++) {
  83601. _loop();
  83602. }
  83603. }
  83604. }]);
  83605. return Select;
  83606. }(TemplateBase);
  83607. ;// CONCATENATED MODULE: ./src/common/components/templates/DropDownBox.js
  83608. function DropDownBox_typeof(obj) { "@babel/helpers - typeof"; return DropDownBox_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, DropDownBox_typeof(obj); }
  83609. function DropDownBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  83610. function DropDownBox_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  83611. function DropDownBox_createClass(Constructor, protoProps, staticProps) { if (protoProps) DropDownBox_defineProperties(Constructor.prototype, protoProps); if (staticProps) DropDownBox_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  83612. function DropDownBox_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) DropDownBox_setPrototypeOf(subClass, superClass); }
  83613. function DropDownBox_setPrototypeOf(o, p) { DropDownBox_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DropDownBox_setPrototypeOf(o, p); }
  83614. function DropDownBox_createSuper(Derived) { var hasNativeReflectConstruct = DropDownBox_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DropDownBox_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DropDownBox_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DropDownBox_possibleConstructorReturn(this, result); }; }
  83615. function DropDownBox_possibleConstructorReturn(self, call) { if (call && (DropDownBox_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return DropDownBox_assertThisInitialized(self); }
  83616. function DropDownBox_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  83617. function DropDownBox_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  83618. function DropDownBox_getPrototypeOf(o) { DropDownBox_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DropDownBox_getPrototypeOf(o); }
  83619. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  83620. * This program are made available under the terms of the Apache License, Version 2.0
  83621. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  83622. /**
  83623. * @class DropDownBox
  83624. * @aliasclass Components.DropDownBox
  83625. * @deprecatedclass SuperMap.Components.DropDownBox
  83626. * @classdesc 组件统一的图片下拉框。
  83627. * @version 9.1.1
  83628. * @param {Array.<Object>} options - 组件配置参数数组。
  83629. * @param {string} options.id - 组件 dom 元素 id。
  83630. * @param {string} options.title - 下拉框 title。
  83631. * @param {string} options.remark - 下拉框解释标记文本。
  83632. * @param {string} [options.dataValue] - 下拉框 attribute 名为 data-value 的值 。
  83633. * @param {string} [options.icon] - 下拉框图标。
  83634. * @param {string} [options.icon.className] - 下拉框图标类名。
  83635. * @param {string} [options.icon.background] - 下拉框图标背景 url。
  83636. * @category Components Common
  83637. * @extends {TemplateBase}
  83638. * @usage
  83639. */
  83640. var DropDownBox = /*#__PURE__*/function (_TemplateBase) {
  83641. DropDownBox_inherits(DropDownBox, _TemplateBase);
  83642. var _super = DropDownBox_createSuper(DropDownBox);
  83643. function DropDownBox(optionsArr) {
  83644. var _this;
  83645. DropDownBox_classCallCheck(this, DropDownBox);
  83646. _this = _super.call(this, optionsArr);
  83647. _this._initView(optionsArr);
  83648. return _this;
  83649. }
  83650. /**
  83651. * @function DropDownBox.prototype._initView
  83652. * @description 初始化下拉框。
  83653. * @private
  83654. * @override
  83655. */
  83656. DropDownBox_createClass(DropDownBox, [{
  83657. key: "_initView",
  83658. value: function _initView(optionsArr) {
  83659. var dropDownContainer = document.createElement('div');
  83660. dropDownContainer.className = 'component-dropdownbox--container';
  83661. var dropDownBox = document.createElement('div');
  83662. dropDownBox.setAttribute('tabindex', '1');
  83663. dropDownBox.className = "component-dropdownbox";
  83664. dropDownContainer.appendChild(dropDownBox);
  83665. var dropDownTopContainer = document.createElement('div');
  83666. dropDownBox.appendChild(dropDownTopContainer);
  83667. this._createDropDownOption(optionsArr[0], dropDownTopContainer);
  83668. var triangleBtnContainer = document.createElement('div');
  83669. triangleBtnContainer.className = 'component-dropdownbox__triangle-btn';
  83670. dropDownBox.appendChild(triangleBtnContainer);
  83671. var triangleBtn = document.createElement('div');
  83672. triangleBtn.className = 'component-triangle-down-img';
  83673. triangleBtnContainer.appendChild(triangleBtn);
  83674. var createDropDownBoxParam = {
  83675. "parentEle": dropDownBox,
  83676. "dropDownContent": ['component-dropdownbox__content component-dropdownbox__content--chart', 'dropDownContent'],
  83677. "scrollareaContent": 'component-selecttool__scrollarea__content',
  83678. "optionsArr": optionsArr,
  83679. "triangleBtn": triangleBtn,
  83680. "dropDownTopContainer": dropDownTopContainer
  83681. };
  83682. this._createDropDownBox(createDropDownBoxParam);
  83683. this.rootContainer = dropDownContainer;
  83684. }
  83685. /**
  83686. * @function DropDownBox.prototype._createDropDownBox
  83687. * @description 创建下拉框。
  83688. * @private
  83689. */
  83690. }, {
  83691. key: "_createDropDownBox",
  83692. value: function _createDropDownBox(createDropDownBoxParam) {
  83693. var dropDownBox = createDropDownBoxParam.parentEle;
  83694. var dropDownTopContainer = createDropDownBoxParam.dropDownTopContainer;
  83695. var dropDownContent = document.createElement('div');
  83696. dropDownContent.className = createDropDownBoxParam.dropDownContent[0];
  83697. dropDownBox.appendChild(dropDownContent);
  83698. var scrollareaContent = document.createElement('div');
  83699. scrollareaContent.className = createDropDownBoxParam.scrollareaContent;
  83700. dropDownContent.appendChild(scrollareaContent);
  83701. var optionsArr = createDropDownBoxParam.optionsArr;
  83702. for (var i = 0; i < optionsArr.length; i++) {
  83703. this._createDropDownOption(optionsArr[i], scrollareaContent);
  83704. }
  83705. // 下拉框显示 & 隐藏事件
  83706. var triangleBtn = createDropDownBoxParam.triangleBtn;
  83707. this._dropDownClickEvent(dropDownBox, dropDownContent, triangleBtn);
  83708. this._eleOnblur(dropDownBox, dropDownContent, triangleBtn);
  83709. // 下拉框 options 点击事件
  83710. var scrollareaOptions = scrollareaContent.children;
  83711. var _loop = function _loop(_i) {
  83712. scrollareaOptions[_i].onclick = function () {
  83713. dropDownTopContainer.innerHTML = scrollareaOptions[_i].outerHTML;
  83714. //evt.stopPropagation();
  83715. };
  83716. };
  83717. for (var _i2 = 0; _i2 < scrollareaOptions.length; _i2++) {
  83718. _loop(_i2);
  83719. }
  83720. }
  83721. /**
  83722. * @function DropDownBox.prototype._createDropDownOption
  83723. * @description 创建下拉框子元素。
  83724. * @private
  83725. */
  83726. }, {
  83727. key: "_createDropDownOption",
  83728. value: function _createDropDownOption(data, parentElement) {
  83729. var ele = document.createElement('div');
  83730. ele.className = 'component-dropdownbox__item';
  83731. var dataItem = data;
  83732. if (dataItem['dataValue']) {
  83733. ele.setAttribute('data-value', dataItem['dataValue']);
  83734. }
  83735. parentElement.appendChild(ele);
  83736. var imgContainer = document.createElement('div');
  83737. imgContainer.className = 'component-dropdownbox__item__img';
  83738. ele.appendChild(imgContainer);
  83739. var img = document.createElement('div');
  83740. if (dataItem.icon.className) {
  83741. img.className = dataItem.icon.className;
  83742. }
  83743. if (dataItem.icon.background) {
  83744. img.style.background = dataItem.icon.background;
  83745. }
  83746. imgContainer.appendChild(img);
  83747. var title = document.createElement('div');
  83748. title.className = 'component-dropdownbox__item__title';
  83749. title.title = dataItem.title;
  83750. title.innerHTML = dataItem.title;
  83751. ele.appendChild(title);
  83752. var remark = document.createElement('div');
  83753. remark.className = 'component-dropdownbox__item__remark';
  83754. remark.title = dataItem.remark;
  83755. remark.innerHTML = dataItem.remark;
  83756. ele.appendChild(remark);
  83757. }
  83758. /**
  83759. * @function DropDownBox.prototype._dropDownClickEvent
  83760. * @description 下拉框点击事件。
  83761. * @private
  83762. */
  83763. }, {
  83764. key: "_dropDownClickEvent",
  83765. value: function _dropDownClickEvent(eventElement, contentElement, triangleBtn) {
  83766. eventElement.onclick = function (e) {
  83767. if (contentElement.style.display === "block") {
  83768. contentElement.style.display = "none";
  83769. triangleBtn.className = "component-triangle-down-img";
  83770. } else {
  83771. contentElement.style.display = "block";
  83772. triangleBtn.className = "triangle-up-img";
  83773. }
  83774. e.preventDefault();
  83775. e.stopPropagation();
  83776. };
  83777. eventElement.onmousedown = function (evt) {
  83778. //console.log('dropdownbox onmousedown '+evt.target.className);
  83779. if (evt.target !== this) {
  83780. this.focus();
  83781. evt.preventDefault();
  83782. evt.stopPropagation();
  83783. }
  83784. };
  83785. }
  83786. /**
  83787. * @function DropDownBox.prototype._eleOnblur
  83788. * @description 下拉框失焦事件。
  83789. * @private
  83790. */
  83791. }, {
  83792. key: "_eleOnblur",
  83793. value: function _eleOnblur(eventElement, contentElement, triangleBtn) {
  83794. eventElement.onblur = function () {
  83795. contentElement.style.display = "none";
  83796. triangleBtn.className = "component-triangle-down-img";
  83797. };
  83798. }
  83799. /**
  83800. * @function DropDownBox.prototype._createElement
  83801. * @description 通用创建元素。
  83802. * @private
  83803. */
  83804. }, {
  83805. key: "_createElement",
  83806. value: function _createElement(tagName, className, parentEle) {
  83807. var ele = document.createElement(tagName || 'div');
  83808. className && (ele.className = className);
  83809. parentEle && parentEle.appendChild(ele);
  83810. return ele;
  83811. }
  83812. }]);
  83813. return DropDownBox;
  83814. }(TemplateBase);
  83815. ;// CONCATENATED MODULE: ./src/common/components/templates/PopContainer.js
  83816. function PopContainer_typeof(obj) { "@babel/helpers - typeof"; return PopContainer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, PopContainer_typeof(obj); }
  83817. function PopContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  83818. function PopContainer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  83819. function PopContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) PopContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) PopContainer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  83820. function PopContainer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) PopContainer_setPrototypeOf(subClass, superClass); }
  83821. function PopContainer_setPrototypeOf(o, p) { PopContainer_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return PopContainer_setPrototypeOf(o, p); }
  83822. function PopContainer_createSuper(Derived) { var hasNativeReflectConstruct = PopContainer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = PopContainer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = PopContainer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return PopContainer_possibleConstructorReturn(this, result); }; }
  83823. function PopContainer_possibleConstructorReturn(self, call) { if (call && (PopContainer_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return PopContainer_assertThisInitialized(self); }
  83824. function PopContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  83825. function PopContainer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  83826. function PopContainer_getPrototypeOf(o) { PopContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return PopContainer_getPrototypeOf(o); }
  83827. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  83828. * This program are made available under the terms of the Apache License, Version 2.0
  83829. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  83830. /**
  83831. * @class PopContainer
  83832. * @aliasclass Components.PopContainer
  83833. * @deprecatedclass SuperMap.Components.PopContainer
  83834. * @classdesc 弹框组件。
  83835. * @version 9.1.1
  83836. * @param {Object} options - 组件配置参数。
  83837. * @param {string} options.id - 组件 dom 元素 id。
  83838. * @param {string} options.title - 弹框组件名称。
  83839. * @extends {TemplateBase}
  83840. * @category Components Common
  83841. * @usage
  83842. */
  83843. var PopContainer = /*#__PURE__*/function (_TemplateBase) {
  83844. PopContainer_inherits(PopContainer, _TemplateBase);
  83845. var _super = PopContainer_createSuper(PopContainer);
  83846. function PopContainer(options) {
  83847. var _this;
  83848. PopContainer_classCallCheck(this, PopContainer);
  83849. options = options ? options : {};
  83850. _this = _super.call(this, options);
  83851. options.title = options.title ? options.title : "";
  83852. _this._initView(options.title);
  83853. return _this;
  83854. }
  83855. /**
  83856. * @private
  83857. * @override
  83858. */
  83859. PopContainer_createClass(PopContainer, [{
  83860. key: "_initView",
  83861. value: function _initView(titile) {
  83862. var container = document.createElement("div");
  83863. container.setAttribute("class", "component-popcontainer");
  83864. //header
  83865. var header = document.createElement("div");
  83866. header.setAttribute("class", "component-popcontainer__header");
  83867. var title = document.createElement("label");
  83868. title.setAttribute("class", "component-popcontainer__header__title");
  83869. title.innerHTML = titile;
  83870. header.appendChild(title);
  83871. var closeBtn = document.createElement("span");
  83872. closeBtn.setAttribute("class", "supermapol-icons-clear component-popcontainer__header__close");
  83873. closeBtn.onclick = this.closeView.bind(this);
  83874. container.appendChild(closeBtn);
  83875. container.appendChild(header);
  83876. //content
  83877. var content = document.createElement("div");
  83878. content.setAttribute("class", "component-popcontainer__content");
  83879. this.content = content;
  83880. container.appendChild(content);
  83881. this.rootContainer = container;
  83882. }
  83883. /**
  83884. * @function PopContainer.prototype.appendContent
  83885. * @description 追加内容。
  83886. * @param {HTMLElement} dom - 内容元素。
  83887. */
  83888. }, {
  83889. key: "appendContent",
  83890. value: function appendContent(dom) {
  83891. this.content.appendChild(dom);
  83892. }
  83893. }]);
  83894. return PopContainer;
  83895. }(TemplateBase);
  83896. ;// CONCATENATED MODULE: ./src/common/components/templates/AttributesPopContainer.js
  83897. function AttributesPopContainer_typeof(obj) { "@babel/helpers - typeof"; return AttributesPopContainer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, AttributesPopContainer_typeof(obj); }
  83898. function AttributesPopContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  83899. function AttributesPopContainer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  83900. function AttributesPopContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) AttributesPopContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) AttributesPopContainer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  83901. function AttributesPopContainer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) AttributesPopContainer_setPrototypeOf(subClass, superClass); }
  83902. function AttributesPopContainer_setPrototypeOf(o, p) { AttributesPopContainer_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return AttributesPopContainer_setPrototypeOf(o, p); }
  83903. function AttributesPopContainer_createSuper(Derived) { var hasNativeReflectConstruct = AttributesPopContainer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = AttributesPopContainer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = AttributesPopContainer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return AttributesPopContainer_possibleConstructorReturn(this, result); }; }
  83904. function AttributesPopContainer_possibleConstructorReturn(self, call) { if (call && (AttributesPopContainer_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return AttributesPopContainer_assertThisInitialized(self); }
  83905. function AttributesPopContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  83906. function AttributesPopContainer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  83907. function AttributesPopContainer_getPrototypeOf(o) { AttributesPopContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AttributesPopContainer_getPrototypeOf(o); }
  83908. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  83909. * This program are made available under the terms of the Apache License, Version 2.0
  83910. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  83911. /**
  83912. * @class AttributesPopContainer
  83913. * @aliasclass Components.AttributesPopContainer
  83914. * @deprecatedclass SuperMap.Components.AttributesPopContainer
  83915. * @classdesc 属性弹框组件
  83916. * @version 9.1.1
  83917. * @param {Object} options - 组件配置参数。
  83918. * @param {string} options.id - 组件 dom 元素 id。
  83919. * @param {Object} options.title - 属性弹框组件名称。
  83920. * @param {Object} options.attributes - 组件需要显示的属性内容。
  83921. * @extends {PopContainer}
  83922. * @category Components Common
  83923. * @usage
  83924. */
  83925. var AttributesPopContainer = /*#__PURE__*/function (_PopContainer) {
  83926. AttributesPopContainer_inherits(AttributesPopContainer, _PopContainer);
  83927. var _super = AttributesPopContainer_createSuper(AttributesPopContainer);
  83928. function AttributesPopContainer(options) {
  83929. var _this;
  83930. AttributesPopContainer_classCallCheck(this, AttributesPopContainer);
  83931. //默认为属性:
  83932. options.title = options.title ? options.title : "属性";
  83933. _this = _super.call(this, options);
  83934. _this.rootContainer.firstChild.hidden = true;
  83935. options.attributes = options.attributes ? options.attributes : [];
  83936. _this._createAttributesTable(options.attributes);
  83937. return _this;
  83938. }
  83939. AttributesPopContainer_createClass(AttributesPopContainer, [{
  83940. key: "_createAttributesTable",
  83941. value: function _createAttributesTable(attributes) {
  83942. var table = document.createElement("table");
  83943. table.setAttribute("class", "component-popcontainer__content__table");
  83944. var tbody = document.createElement("tbody");
  83945. var single = true;
  83946. for (var name in attributes) {
  83947. var tr = document.createElement("tr");
  83948. if (single) {
  83949. tr.setAttribute("class", "component-popcontainer__content__td--color");
  83950. }
  83951. var title = document.createElement("td");
  83952. var titleSpan = document.createElement("Span");
  83953. titleSpan.innerHTML = name;
  83954. title.appendChild(titleSpan);
  83955. var value = document.createElement("td");
  83956. value.innerHTML = attributes[name];
  83957. tr.appendChild(title);
  83958. tr.appendChild(value);
  83959. tbody.appendChild(tr);
  83960. single = !single;
  83961. }
  83962. table.appendChild(tbody);
  83963. this.appendContent(table);
  83964. }
  83965. }]);
  83966. return AttributesPopContainer;
  83967. }(PopContainer);
  83968. ;// CONCATENATED MODULE: ./src/common/components/templates/IndexTabsPageContainer.js
  83969. function IndexTabsPageContainer_typeof(obj) { "@babel/helpers - typeof"; return IndexTabsPageContainer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, IndexTabsPageContainer_typeof(obj); }
  83970. function IndexTabsPageContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  83971. function IndexTabsPageContainer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  83972. function IndexTabsPageContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) IndexTabsPageContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) IndexTabsPageContainer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  83973. function IndexTabsPageContainer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) IndexTabsPageContainer_setPrototypeOf(subClass, superClass); }
  83974. function IndexTabsPageContainer_setPrototypeOf(o, p) { IndexTabsPageContainer_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return IndexTabsPageContainer_setPrototypeOf(o, p); }
  83975. function IndexTabsPageContainer_createSuper(Derived) { var hasNativeReflectConstruct = IndexTabsPageContainer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = IndexTabsPageContainer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = IndexTabsPageContainer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return IndexTabsPageContainer_possibleConstructorReturn(this, result); }; }
  83976. function IndexTabsPageContainer_possibleConstructorReturn(self, call) { if (call && (IndexTabsPageContainer_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return IndexTabsPageContainer_assertThisInitialized(self); }
  83977. function IndexTabsPageContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  83978. function IndexTabsPageContainer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  83979. function IndexTabsPageContainer_getPrototypeOf(o) { IndexTabsPageContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return IndexTabsPageContainer_getPrototypeOf(o); }
  83980. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  83981. * This program are made available under the terms of the Apache License, Version 2.0
  83982. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  83983. /**
  83984. * @class IndexTabsPageContainer
  83985. * @aliasclass Components.IndexTabsPageContainer
  83986. * @deprecatedclass SuperMap.Components.IndexTabsPageContainer
  83987. * @classdesc 标签索引组件。
  83988. * @version 9.1.1
  83989. * @param {Object} options - 组件配置参数。
  83990. * @param {string} options.id - 组件 dom 元素 id。
  83991. * @category Components Common
  83992. * @extends {TemplateBase}
  83993. * @usage
  83994. */
  83995. var IndexTabsPageContainer = /*#__PURE__*/function (_TemplateBase) {
  83996. IndexTabsPageContainer_inherits(IndexTabsPageContainer, _TemplateBase);
  83997. var _super = IndexTabsPageContainer_createSuper(IndexTabsPageContainer);
  83998. function IndexTabsPageContainer(options) {
  83999. var _this;
  84000. IndexTabsPageContainer_classCallCheck(this, IndexTabsPageContainer);
  84001. _this = _super.call(this, options);
  84002. _this._initView();
  84003. return _this;
  84004. }
  84005. /**
  84006. * @private
  84007. * @override
  84008. */
  84009. IndexTabsPageContainer_createClass(IndexTabsPageContainer, [{
  84010. key: "_initView",
  84011. value: function _initView() {
  84012. var container = document.createElement("div");
  84013. container.setAttribute("class", "component-tabpage");
  84014. var header = document.createElement("ul");
  84015. this.header = header;
  84016. var content = document.createElement("div");
  84017. content.setAttribute("class", "component-tabpage__content");
  84018. this.content = content;
  84019. container.appendChild(header);
  84020. container.appendChild(content);
  84021. this.rootContainer = container;
  84022. }
  84023. /**
  84024. * @function IndexTabsPageContainer.prototype.setTabs
  84025. * @description 设置标签元素。
  84026. * @param {Array.<HTMLElement>} tabs
  84027. */
  84028. }, {
  84029. key: "setTabs",
  84030. value: function setTabs(tabs) {
  84031. this.removeAllTabs();
  84032. this.appendTabs(tabs);
  84033. }
  84034. /**
  84035. * @function IndexTabsPageContainer.prototype.appendTabs
  84036. * @description 追加标签元素。
  84037. * @param {Array.<HTMLElement>} tabs
  84038. */
  84039. }, {
  84040. key: "appendTabs",
  84041. value: function appendTabs(tabs) {
  84042. for (var i = 0; i < tabs.length; i++) {
  84043. var title = document.createElement("span");
  84044. title.index = i;
  84045. title.appendChild(document.createTextNode(tabs[i].title));
  84046. //绑定标签切换对应页面:
  84047. title.onclick = this._changeTabsPage.bind(this);
  84048. var content = tabs[i].content;
  84049. content.index = i;
  84050. content.hidden = true;
  84051. this.header.appendChild(title);
  84052. this.content.appendChild(content);
  84053. }
  84054. //todo 确认是否两个子元素的 index 相互对应
  84055. //默认显示第一个标签对象
  84056. this.header.firstChild.setAttribute("class", "on");
  84057. this.content.firstChild.hidden = false;
  84058. }
  84059. /**
  84060. * @function IndexTabsPageContainer.prototype.removeTab
  84061. * @description 删除某个标签页面。
  84062. * @param {number} index - 标签索引号。
  84063. */
  84064. }, {
  84065. key: "removeTab",
  84066. value: function removeTab(index) {
  84067. this.header.removeChild(this.header.children[index]);
  84068. this.content.removeChild(this.content.children[index]);
  84069. }
  84070. /**
  84071. * @function IndexTabsPageContainer.prototype.removeAllTabs
  84072. * @description 删除所有标签。
  84073. */
  84074. }, {
  84075. key: "removeAllTabs",
  84076. value: function removeAllTabs() {
  84077. for (var i = this.header.children.length; i > 0; i--) {
  84078. this.header.removeChild(this.header.children[i]);
  84079. this.content.removeChild(this.content.children[i]);
  84080. }
  84081. }
  84082. }, {
  84083. key: "_changeTabsPage",
  84084. value: function _changeTabsPage(e) {
  84085. var index = e.target.index;
  84086. for (var i = 0; i < this.header.children.length; i++) {
  84087. this.header.children[i].setAttribute("class", "");
  84088. this.content.children[i].hidden = true;
  84089. if (i === index) {
  84090. this.header.children[i].setAttribute("class", "on");
  84091. this.content.children[i].hidden = false;
  84092. }
  84093. }
  84094. }
  84095. }]);
  84096. return IndexTabsPageContainer;
  84097. }(TemplateBase);
  84098. ;// CONCATENATED MODULE: ./src/common/components/templates/CityTabsPage.js
  84099. function CityTabsPage_typeof(obj) { "@babel/helpers - typeof"; return CityTabsPage_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, CityTabsPage_typeof(obj); }
  84100. function CityTabsPage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  84101. function CityTabsPage_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  84102. function CityTabsPage_createClass(Constructor, protoProps, staticProps) { if (protoProps) CityTabsPage_defineProperties(Constructor.prototype, protoProps); if (staticProps) CityTabsPage_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  84103. function CityTabsPage_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) CityTabsPage_setPrototypeOf(subClass, superClass); }
  84104. function CityTabsPage_setPrototypeOf(o, p) { CityTabsPage_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return CityTabsPage_setPrototypeOf(o, p); }
  84105. function CityTabsPage_createSuper(Derived) { var hasNativeReflectConstruct = CityTabsPage_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = CityTabsPage_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = CityTabsPage_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return CityTabsPage_possibleConstructorReturn(this, result); }; }
  84106. function CityTabsPage_possibleConstructorReturn(self, call) { if (call && (CityTabsPage_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return CityTabsPage_assertThisInitialized(self); }
  84107. function CityTabsPage_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  84108. function CityTabsPage_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  84109. function CityTabsPage_getPrototypeOf(o) { CityTabsPage_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return CityTabsPage_getPrototypeOf(o); }
  84110. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  84111. * This program are made available under the terms of the Apache License, Version 2.0
  84112. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  84113. /**
  84114. * @class CityTabsPage
  84115. * @aliasclass Components.CityTabsPage
  84116. * @deprecatedclass SuperMap.Components.CityTabsPage
  84117. * @classdesc 城市地址匹配组件模板
  84118. * @version 9.1.1
  84119. * @param {Object} options - 组件配置参数。
  84120. * @param {string} options.id - 组件 dom 元素 id。
  84121. * @param {Object|Array.<string>} options.config - 城市名称配置列表,支持两种格式:{key1:{A:[],B:[]}, key2:{C:[],D:[]}} 或
  84122. * ["成都市","北京市"],用户可根据自己的项目需求进行配置
  84123. * @extends {IndexTabsPageContainer}
  84124. * @category Components Common
  84125. * @usage
  84126. */
  84127. var CityTabsPage = /*#__PURE__*/function (_IndexTabsPageContain) {
  84128. CityTabsPage_inherits(CityTabsPage, _IndexTabsPageContain);
  84129. var _super = CityTabsPage_createSuper(CityTabsPage);
  84130. function CityTabsPage(options) {
  84131. var _this;
  84132. CityTabsPage_classCallCheck(this, CityTabsPage);
  84133. _this = _super.call(this, options);
  84134. //去掉默认的边框阴影样式:
  84135. _this.rootContainer.classList.add("component-citytabpage--noneBoxShadow");
  84136. _this.config = options.config;
  84137. //header,若 config为城市名称数组,则直接加载内容
  84138. if (Util_Util.isArray(_this.config)) {
  84139. _this.header.hidden = true;
  84140. _this._createCityItem("城市", _this.config);
  84141. _this.content.style.border = "none";
  84142. } else {
  84143. _this._createTabs();
  84144. _this.header.onclick = function (e) {
  84145. //关闭所有元素 是否有更简化的写法?
  84146. for (var i = 0; i < _this.header.children.length; i++) {
  84147. _this.header.children[i].setAttribute("class", "");
  84148. }
  84149. //打开点击内容元素
  84150. e.target.setAttribute("class", "on");
  84151. _this._createCityContent(e.target.innerHTML);
  84152. };
  84153. }
  84154. return _this;
  84155. }
  84156. /**
  84157. * @function CityTabsPage.prototype._createTabs
  84158. * @description 创建 Tabs
  84159. * @private
  84160. */
  84161. CityTabsPage_createClass(CityTabsPage, [{
  84162. key: "_createTabs",
  84163. value: function _createTabs() {
  84164. //header
  84165. if (Util_Util.isArray(this.config)) {
  84166. for (var i = 0; i < this.config.length; i++) {
  84167. var innerHTML = "";
  84168. for (var key in this.config[i]) {
  84169. innerHTML += key;
  84170. }
  84171. var li = document.createElement("li");
  84172. li.innerHTML = innerHTML;
  84173. this.header.appendChild(li);
  84174. }
  84175. } else {
  84176. for (var _key2 in this.config) {
  84177. var _li = document.createElement("li");
  84178. _li.innerHTML = _key2;
  84179. this.header.appendChild(_li);
  84180. }
  84181. }
  84182. this.header.firstChild.setAttribute("class", "on");
  84183. this._createCityContent(this.header.firstChild.innerHTML);
  84184. }
  84185. /**
  84186. * @function CityTabsPage.prototype._createCityContent
  84187. * @description 创建列表容器
  84188. * @private
  84189. */
  84190. }, {
  84191. key: "_createCityContent",
  84192. value: function _createCityContent(keyName) {
  84193. //清除元素:
  84194. for (var i = this.content.children.length; i > 0; i--) {
  84195. this.content.removeChild(this.content.children[i - 1]);
  84196. }
  84197. //创建对应元素
  84198. var cities = this.config[keyName];
  84199. for (var key in cities) {
  84200. this._createCityItem(key, cities[key]);
  84201. }
  84202. }
  84203. /**
  84204. * @function CityTabsPage.prototype._createCityContent
  84205. * @description 创建列表容器
  84206. * @private
  84207. */
  84208. }, {
  84209. key: "_createCityItem",
  84210. value: function _createCityItem(key, cities) {
  84211. var city = document.createElement("div");
  84212. var cityClass = document.createElement("div");
  84213. cityClass.setAttribute("class", "component-citytabpag__py-key");
  84214. cityClass.innerHTML = key;
  84215. city.appendChild(cityClass);
  84216. var cityContent = document.createElement("div");
  84217. cityContent.setAttribute("class", "component-citytabpag__content");
  84218. for (var i = 0; i < cities.length; i++) {
  84219. var span = document.createElement("span");
  84220. span.innerHTML = cities[i];
  84221. cityContent.appendChild(span);
  84222. }
  84223. //HOT 元素长度单独微调:
  84224. if (key === "HOT") {
  84225. cityContent.style.width = "428px";
  84226. }
  84227. city.appendChild(cityContent);
  84228. this.content.appendChild(city);
  84229. }
  84230. }]);
  84231. return CityTabsPage;
  84232. }(IndexTabsPageContainer);
  84233. ;// CONCATENATED MODULE: ./src/common/components/templates/NavTabsPage.js
  84234. function NavTabsPage_typeof(obj) { "@babel/helpers - typeof"; return NavTabsPage_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, NavTabsPage_typeof(obj); }
  84235. function NavTabsPage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  84236. function NavTabsPage_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  84237. function NavTabsPage_createClass(Constructor, protoProps, staticProps) { if (protoProps) NavTabsPage_defineProperties(Constructor.prototype, protoProps); if (staticProps) NavTabsPage_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  84238. function NavTabsPage_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) NavTabsPage_setPrototypeOf(subClass, superClass); }
  84239. function NavTabsPage_setPrototypeOf(o, p) { NavTabsPage_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NavTabsPage_setPrototypeOf(o, p); }
  84240. function NavTabsPage_createSuper(Derived) { var hasNativeReflectConstruct = NavTabsPage_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = NavTabsPage_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = NavTabsPage_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return NavTabsPage_possibleConstructorReturn(this, result); }; }
  84241. function NavTabsPage_possibleConstructorReturn(self, call) { if (call && (NavTabsPage_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return NavTabsPage_assertThisInitialized(self); }
  84242. function NavTabsPage_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  84243. function NavTabsPage_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  84244. function NavTabsPage_getPrototypeOf(o) { NavTabsPage_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NavTabsPage_getPrototypeOf(o); }
  84245. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  84246. * This program are made available under the terms of the Apache License, Version 2.0
  84247. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  84248. /**
  84249. * @class NavTabsPage
  84250. * @aliasclass Components.NavTabsPage
  84251. * @deprecatedclass SuperMap.Components.NavTabsPage
  84252. * @classdesc 标签页面组件。
  84253. * @version 9.1.1
  84254. * @param {Object} options - 组件配置参数。
  84255. * @param {string} options.id - 组件 dom 元素 id。
  84256. * @param {Array.<Object>} [options.tabs=[]] - 标签对象数组,形如:[{title: "",content: HTMLElement}],初始时,传入则创建页面。
  84257. * @extends {TemplateBase}
  84258. * @category Components Common
  84259. * @usage
  84260. */
  84261. // todo 思考拆分的控件应该以哪种方式使用
  84262. var NavTabsPage = /*#__PURE__*/function (_TemplateBase) {
  84263. NavTabsPage_inherits(NavTabsPage, _TemplateBase);
  84264. var _super = NavTabsPage_createSuper(NavTabsPage);
  84265. function NavTabsPage(options) {
  84266. var _this;
  84267. NavTabsPage_classCallCheck(this, NavTabsPage);
  84268. _this = _super.call(this, options);
  84269. _this.navTabsTitle = null;
  84270. _this.navTabsContent = null;
  84271. options.tabs = options.tabs ? options.tabs : [];
  84272. _this._initView(options.tabs);
  84273. return _this;
  84274. }
  84275. /**
  84276. * @override
  84277. * @private
  84278. */
  84279. NavTabsPage_createClass(NavTabsPage, [{
  84280. key: "_initView",
  84281. value: function _initView(tabs) {
  84282. var navTabsPage = document.createElement("div");
  84283. navTabsPage.setAttribute("class", "component-navtabspage");
  84284. //关闭按钮
  84285. var closeBtn = document.createElement("span");
  84286. closeBtn.setAttribute("class", "supermapol-icons-close");
  84287. closeBtn.onclick = this.closeView.bind(this);
  84288. navTabsPage.appendChild(closeBtn);
  84289. //标签
  84290. var navTabsTitle = document.createElement("div");
  84291. this.navTabsTitle = navTabsTitle;
  84292. navTabsTitle.setAttribute("class", "component-navtabspage__title");
  84293. navTabsPage.appendChild(navTabsTitle);
  84294. //内容
  84295. var navTabsContent = document.createElement("div");
  84296. this.navTabsContent = navTabsContent;
  84297. navTabsContent.setAttribute("class", "component-navtabspage__content");
  84298. navTabsPage.appendChild(navTabsContent);
  84299. //若 tabs 初始传入值,则
  84300. if (tabs.length > 0) {
  84301. this.appendTabs(tabs);
  84302. }
  84303. this.rootContainer = navTabsPage;
  84304. }
  84305. /**
  84306. * @function NavTabsPage.prototype.setTabs
  84307. * @description 设置标签。
  84308. * @param {Array.<Object>} tabs - 标签对象数组,形如:[{title: "",content: {}}]。
  84309. */
  84310. }, {
  84311. key: "setTabs",
  84312. value: function setTabs(tabs) {
  84313. this.removeAllTabs();
  84314. this.appendTabs(tabs);
  84315. }
  84316. /**
  84317. * @function NavTabsPage.prototype.appendTabs
  84318. * @description 添加标签页面。
  84319. * @param {Array.<Object>} tabs - 标签对象数组,形如:[{title: "",content: {}}]。
  84320. */
  84321. }, {
  84322. key: "appendTabs",
  84323. value: function appendTabs(tabs) {
  84324. for (var i = 0; i < tabs.length; i++) {
  84325. var title = document.createElement("span");
  84326. title.index = i;
  84327. title.appendChild(document.createTextNode(tabs[i].title));
  84328. //绑定标签切换对应页面:
  84329. title.onclick = this._changeTabsPage.bind(this);
  84330. var content = tabs[i].content;
  84331. content.index = i;
  84332. content.hidden = true;
  84333. this.navTabsTitle.appendChild(title);
  84334. this.navTabsContent.appendChild(content);
  84335. }
  84336. //todo 确认是否两个子元素的 index 相互对应
  84337. //默认显示第一个标签对象
  84338. this.navTabsTitle.firstChild.setAttribute("class", "component-navtabspage__tabs--select");
  84339. this.navTabsContent.firstChild.hidden = false;
  84340. }
  84341. /**
  84342. * @function NavTabsPage.prototype.removeTab
  84343. * @description 删除某个标签页面。
  84344. * @param {number} index - 标签索引号。
  84345. */
  84346. }, {
  84347. key: "removeTab",
  84348. value: function removeTab(index) {
  84349. this.navTabsTitle.removeChild(this.navTabsTitle.children[index]);
  84350. this.navTabsContent.removeChild(this.navTabsContent.children[index]);
  84351. }
  84352. /**
  84353. * @function NavTabsPage.prototype.removeAllTabs
  84354. * @description 删除所有标签。
  84355. */
  84356. }, {
  84357. key: "removeAllTabs",
  84358. value: function removeAllTabs() {
  84359. for (var i = this.navTabsTitle.children.length; i > 0; i--) {
  84360. this.navTabsTitle.removeChild(this.navTabsTitle.children[i]);
  84361. this.navTabsContent.removeChild(this.navTabsContent.children[i]);
  84362. }
  84363. }
  84364. }, {
  84365. key: "_changeTabsPage",
  84366. value: function _changeTabsPage(e) {
  84367. var index = e.target.index;
  84368. for (var i = 0; i < this.navTabsTitle.children.length; i++) {
  84369. this.navTabsTitle.children[i].setAttribute("class", "");
  84370. this.navTabsContent.children[i].hidden = true;
  84371. if (i === index) {
  84372. this.navTabsTitle.children[i].setAttribute("class", "component-navtabspage__tabs--select");
  84373. this.navTabsContent.children[i].hidden = false;
  84374. }
  84375. }
  84376. }
  84377. }]);
  84378. return NavTabsPage;
  84379. }(TemplateBase);
  84380. ;// CONCATENATED MODULE: ./src/common/components/templates/PaginationContainer.js
  84381. function PaginationContainer_typeof(obj) { "@babel/helpers - typeof"; return PaginationContainer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, PaginationContainer_typeof(obj); }
  84382. function PaginationContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  84383. function PaginationContainer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  84384. function PaginationContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) PaginationContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) PaginationContainer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  84385. function PaginationContainer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) PaginationContainer_setPrototypeOf(subClass, superClass); }
  84386. function PaginationContainer_setPrototypeOf(o, p) { PaginationContainer_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return PaginationContainer_setPrototypeOf(o, p); }
  84387. function PaginationContainer_createSuper(Derived) { var hasNativeReflectConstruct = PaginationContainer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = PaginationContainer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = PaginationContainer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return PaginationContainer_possibleConstructorReturn(this, result); }; }
  84388. function PaginationContainer_possibleConstructorReturn(self, call) { if (call && (PaginationContainer_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return PaginationContainer_assertThisInitialized(self); }
  84389. function PaginationContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  84390. function PaginationContainer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  84391. function PaginationContainer_getPrototypeOf(o) { PaginationContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return PaginationContainer_getPrototypeOf(o); }
  84392. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  84393. * This program are made available under the terms of the Apache License, Version 2.0
  84394. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  84395. /**
  84396. * @class PaginationContainer
  84397. * @aliasclass Components.PaginationContainer
  84398. * @deprecatedclass SuperMap.Components.PaginationContainer
  84399. * @classdesc 分页组件模板。
  84400. * @version 9.1.1
  84401. * @param {Object} options - 组件配置参数。
  84402. * @param {string} options.id - 组件 dom 元素 id。
  84403. * @param {HTMLElement} options.contents - 页面填充的 DOM 元素对象。
  84404. * @param {number} options.pageCounts - 页数。
  84405. * @extends {TemplateBase}
  84406. * @category Components Common
  84407. * @usage
  84408. */
  84409. var PaginationContainer = /*#__PURE__*/function (_TemplateBase) {
  84410. PaginationContainer_inherits(PaginationContainer, _TemplateBase);
  84411. var _super = PaginationContainer_createSuper(PaginationContainer);
  84412. function PaginationContainer(options) {
  84413. var _this;
  84414. PaginationContainer_classCallCheck(this, PaginationContainer);
  84415. options = options ? options : {};
  84416. _this = _super.call(this, options);
  84417. _this.currentPage = 0;
  84418. _this.pageNumberLis = [];
  84419. _this.currentPageNumberLis = [];
  84420. _this.linkageEvent = null;
  84421. options.contents = options.contents ? options.contents : null;
  84422. options.pageCounts = options.pageCounts ? options.pageCounts : 0;
  84423. _this._initView(options.contents, options.pageCounts);
  84424. return _this;
  84425. }
  84426. /**
  84427. * @function PaginationContainer.prototype.setLinkageEvent
  84428. * @description 设置页面联动方法。
  84429. * @param {function} linkageEvent - 联动方法,实现指定功能。
  84430. */
  84431. PaginationContainer_createClass(PaginationContainer, [{
  84432. key: "setLinkageEvent",
  84433. value: function setLinkageEvent(linkageEvent) {
  84434. this.linkageEvent = linkageEvent;
  84435. }
  84436. /**
  84437. * @private
  84438. * @override
  84439. */
  84440. }, {
  84441. key: "_initView",
  84442. value: function _initView(contents, pageCounts) {
  84443. var container = document.createElement("div");
  84444. container.setAttribute("class", "component-pagination");
  84445. //content
  84446. var content = document.createElement("div");
  84447. content.setAttribute("class", "component-pagination__content");
  84448. container.appendChild(content);
  84449. this.content = content;
  84450. //link
  84451. var link = document.createElement("ul");
  84452. link.setAttribute("class", "component-pagination__link");
  84453. link.onclick = this._changePageEvent.bind(this);
  84454. container.appendChild(link);
  84455. this._createLink(link);
  84456. this.link = link;
  84457. //填充内容:
  84458. if (contents) {
  84459. this.setContent(contents);
  84460. }
  84461. if (pageCounts !== 0) {
  84462. this.setPageLink(pageCounts);
  84463. }
  84464. this.rootContainer = container;
  84465. }
  84466. /**---------以下是页面相关操作 **/
  84467. /**
  84468. * @function PaginationContainer.prototype.setContent
  84469. * @description 设置页面内容。
  84470. * @param {HTMLElement} element - 页面内容元素。
  84471. */
  84472. }, {
  84473. key: "setContent",
  84474. value: function setContent(element) {
  84475. this.clearContent();
  84476. this.appendContent(element);
  84477. }
  84478. /**
  84479. * @function PaginationContainer.prototype.appendContent
  84480. * @description 追加内容。
  84481. * @param {HTMLElement} element - 页面内容元素。
  84482. */
  84483. }, {
  84484. key: "appendContent",
  84485. value: function appendContent(element) {
  84486. this.content.appendChild(element);
  84487. }
  84488. /**
  84489. * @function PaginationContainer.prototype.clearContent
  84490. * @description 清空内容元素。
  84491. */
  84492. }, {
  84493. key: "clearContent",
  84494. value: function clearContent() {
  84495. for (var i = this.content.children.length - 1; i >= 0; i--) {
  84496. this.content.removeChild(this.content.children[i]);
  84497. }
  84498. }
  84499. /** -----以下是页码相关的操作:**/
  84500. /**
  84501. * @function PaginationContainer.prototype.setPageLink
  84502. * @description 设置页码数。
  84503. * @param {number} pageNumber - 页码数。
  84504. */
  84505. }, {
  84506. key: "setPageLink",
  84507. value: function setPageLink(pageNumber) {
  84508. //清空当前页码
  84509. this.pageNumberLis = [];
  84510. this.currentPageNumberLis = [];
  84511. this.clearPageLink();
  84512. //创建页码
  84513. this._createPageLi(pageNumber);
  84514. //添加页码到页码列表
  84515. this._appendPageLink();
  84516. }
  84517. /**
  84518. * @description 创建页码。
  84519. * @param pageNumber
  84520. * @private
  84521. */
  84522. }, {
  84523. key: "_createPageLi",
  84524. value: function _createPageLi(pageNumber) {
  84525. for (var i = 0; i < pageNumber; i++) {
  84526. var pageLi = document.createElement("li");
  84527. pageLi.innerHTML = i + 1;
  84528. /*const liContent = document.createElement("span");
  84529. liContent.innerHTML = i + 1;*/
  84530. // pageLi.appendChild(liContent);
  84531. this.pageNumberLis.push(pageLi);
  84532. }
  84533. this.pageNumberLis[0].setAttribute("class", "active");
  84534. this.currentPage = 1;
  84535. if (pageNumber < 5) {
  84536. this.currentPageNumberLis = this.pageNumberLis;
  84537. } else {
  84538. for (var _i2 = 0; _i2 < 5; _i2++) {
  84539. this.currentPageNumberLis.push(this.pageNumberLis[_i2]);
  84540. }
  84541. }
  84542. }
  84543. /**
  84544. * @description 添加页码到页码列表。
  84545. * @private
  84546. */
  84547. }, {
  84548. key: "_appendPageLink",
  84549. value: function _appendPageLink() {
  84550. //todo 如何插入中间
  84551. for (var i = 0; i < this.currentPageNumberLis.length; i++) {
  84552. this.link.insertBefore(this.currentPageNumberLis[i], this.link.childNodes[this.link.children.length - 2]);
  84553. }
  84554. for (var _i4 = 0; _i4 < this.currentPageNumberLis.length; _i4++) {
  84555. //清空 active 状态
  84556. this.currentPageNumberLis[_i4].setAttribute("class", "");
  84557. //给当前选中的 li 赋值 active 状态
  84558. if (Number(this.currentPageNumberLis[_i4].innerHTML) === this.currentPage) {
  84559. this.currentPageNumberLis[_i4].setAttribute("class", "active");
  84560. }
  84561. }
  84562. //根据 currentPage 改变按钮状态
  84563. this._changeDisableState();
  84564. if (this.linkageEvent) {
  84565. this.linkageEvent(this.currentPage);
  84566. }
  84567. }
  84568. /**
  84569. * @function PaginationContainer.prototype.clearPageLink
  84570. * @description 清除页码列表。
  84571. */
  84572. }, {
  84573. key: "clearPageLink",
  84574. value: function clearPageLink() {
  84575. for (var i = this.link.children.length - 3; i > 1; i--) {
  84576. this.link.removeChild(this.link.children[i]);
  84577. }
  84578. }
  84579. /**
  84580. * @description 创建页码按钮。
  84581. * @param ul
  84582. * @private
  84583. */
  84584. }, {
  84585. key: "_createLink",
  84586. value: function _createLink(ul) {
  84587. for (var i = 0; i < 4; i++) {
  84588. var li = document.createElement("li");
  84589. li.setAttribute("class", "disable");
  84590. var liContent = document.createElement("span");
  84591. li.appendChild(liContent);
  84592. if (i === 0) {
  84593. liContent.id = "first";
  84594. liContent.setAttribute("class", "supermapol-icons-first");
  84595. } else if (i === 1) {
  84596. liContent.id = "prev";
  84597. liContent.setAttribute("class", "supermapol-icons-prev");
  84598. } else if (i === 2) {
  84599. liContent.id = "next";
  84600. liContent.setAttribute("class", "supermapol-icons-next");
  84601. } else if (i === 3) {
  84602. liContent.id = "last";
  84603. liContent.setAttribute("class", "supermapol-icons-last");
  84604. }
  84605. ul.appendChild(li);
  84606. }
  84607. }
  84608. /**
  84609. * @description 点击页码事件。
  84610. * @param e
  84611. * @private
  84612. */
  84613. }, {
  84614. key: "_changePageEvent",
  84615. value: function _changePageEvent(e) {
  84616. //todo
  84617. var trigger = e.target;
  84618. //若列表禁用,点击无效
  84619. if (trigger.parentElement.classList[0] === "disable") {
  84620. return;
  84621. }
  84622. var targetLi;
  84623. if (trigger.id) {
  84624. targetLi = trigger.id;
  84625. } else if (Number(trigger.innerHTML)) {
  84626. targetLi = Number(trigger.innerHTML);
  84627. } else {
  84628. return;
  84629. }
  84630. //页码预处理:
  84631. this._prePageNum(targetLi);
  84632. //根据 currentPageNumberLis 创建页码列表
  84633. this.clearPageLink();
  84634. this._appendPageLink();
  84635. }
  84636. /**
  84637. * @description 根据 currentPage 改变按钮状态。
  84638. * @private
  84639. */
  84640. }, {
  84641. key: "_changeDisableState",
  84642. value: function _changeDisableState() {
  84643. this.link.children[0].setAttribute("class", "");
  84644. this.link.children[1].setAttribute("class", "");
  84645. this.link.children[this.link.children.length - 1].setAttribute("class", "");
  84646. this.link.children[this.link.children.length - 2].setAttribute("class", "");
  84647. if (this.currentPage === 1) {
  84648. this.link.children[0].setAttribute("class", "disable");
  84649. this.link.children[1].setAttribute("class", "disable");
  84650. }
  84651. if (this.currentPage === this.pageNumberLis.length) {
  84652. this.link.children[this.link.children.length - 1].setAttribute("class", "disable");
  84653. this.link.children[this.link.children.length - 2].setAttribute("class", "disable");
  84654. }
  84655. }
  84656. /**
  84657. * @description 根据点击页码列表事件准备需展现的页码列表。
  84658. * @param {string|number} targetLi - 被点击的列表对象 id 或 被点击的页码值。
  84659. * @private
  84660. */
  84661. }, {
  84662. key: "_prePageNum",
  84663. value: function _prePageNum(targetLi) {
  84664. var currentPageNumberLis = [];
  84665. if (targetLi === "first") {
  84666. this.currentPage = 1;
  84667. } else if (targetLi === "last") {
  84668. this.currentPage = this.pageNumberLis.length;
  84669. } else if (targetLi === "prev") {
  84670. this.currentPage = this.currentPage - 1;
  84671. } else if (targetLi === "next") {
  84672. this.currentPage = this.currentPage + 1;
  84673. } else {
  84674. this.currentPage = targetLi;
  84675. }
  84676. if (this.pageNumberLis.length <= 5) {
  84677. for (var i = 0; i < this.pageNumberLis.length; i++) {
  84678. currentPageNumberLis.push(this.pageNumberLis[i]);
  84679. }
  84680. } else {
  84681. //当前点击前三,都取前五
  84682. if (this.currentPage <= 3) {
  84683. for (var _i6 = 0; _i6 < 5; _i6++) {
  84684. currentPageNumberLis.push(this.pageNumberLis[_i6]);
  84685. }
  84686. } else if (this.currentPage >= this.pageNumberLis.length - 3) {
  84687. //点击后三,都取后5
  84688. for (var _i8 = this.pageNumberLis.length - 5; _i8 < this.pageNumberLis.length; _i8++) {
  84689. currentPageNumberLis.push(this.pageNumberLis[_i8]);
  84690. }
  84691. } else {
  84692. //其他,取中间:
  84693. for (var _i10 = this.currentPage - 3; _i10 <= this.currentPage + 1; _i10++) {
  84694. currentPageNumberLis.push(this.pageNumberLis[_i10]);
  84695. }
  84696. }
  84697. }
  84698. if (currentPageNumberLis.length > 0) {
  84699. this.currentPageNumberLis = currentPageNumberLis;
  84700. }
  84701. }
  84702. }]);
  84703. return PaginationContainer;
  84704. }(TemplateBase);
  84705. ;// CONCATENATED MODULE: ./src/common/components/util/Util.js
  84706. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  84707. * This program are made available under the terms of the Apache License, Version 2.0
  84708. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  84709. /**
  84710. * @name ComponentsUtil
  84711. * @namespace
  84712. * @category BaseTypes Util
  84713. * @description 获取文件类型工具类。
  84714. * @usage
  84715. * ```
  84716. * // 浏览器
  84717. * <script type="text/javascript" src="{cdn}"></script>
  84718. * <script>
  84719. * const result = {namespace}.ComponentsUtil.getFileType(fileName);
  84720. *
  84721. * </script>
  84722. * // ES6 Import
  84723. * import { ComponentsUtil } from '{npm}';
  84724. *
  84725. * const result = ComponentsUtil.getFileType(fileName);
  84726. * ```
  84727. */
  84728. var ComponentsUtil = {
  84729. /**
  84730. * @function ComponentsUtil.getFileType
  84731. * @description 获取上传文件类型。
  84732. * @param {string} fileName - 文件名称。
  84733. */
  84734. getFileType: function getFileType(fileName) {
  84735. var regCSV = /^.*\.(?:csv)$/i;
  84736. var regExcel = /^.*\.(?:xls|xlsx)$/i; //文件名可以带空格
  84737. var regGeojson = /^.*\.(?:geojson|json)$/i;
  84738. if (regExcel.test(fileName)) {
  84739. //校验不通过
  84740. return CommonTypes_FileTypes.EXCEL;
  84741. } else if (regCSV.test(fileName)) {
  84742. return CommonTypes_FileTypes.CSV;
  84743. } else if (regGeojson.test(fileName)) {
  84744. return CommonTypes_FileTypes.GEOJSON;
  84745. }
  84746. return null;
  84747. }
  84748. };
  84749. ;// CONCATENATED MODULE: ./src/common/components/util/index.js
  84750. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  84751. * This program are made available under the terms of the Apache License, Version 2.0
  84752. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  84753. ;// CONCATENATED MODULE: ./src/common/components/index.js
  84754. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  84755. * This program are made available under the terms of the Apache License, Version 2.0
  84756. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  84757. //数据
  84758. //组件
  84759. //提示框组件
  84760. //图表组件
  84761. //公用模板:
  84762. //工具类
  84763. ;// CONCATENATED MODULE: ./src/common/lang/index.js
  84764. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  84765. * This program are made available under the terms of the Apache License, Version 2.0
  84766. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  84767. // EXTERNAL MODULE: ./node_modules/lodash.uniqby/index.js
  84768. var lodash_uniqby = __webpack_require__(9819);
  84769. var lodash_uniqby_default = /*#__PURE__*/__webpack_require__.n(lodash_uniqby);
  84770. ;// CONCATENATED MODULE: ./src/common/overlay/knowledge-graph/format.js
  84771. function format_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  84772. function format_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? format_ownKeys(Object(source), !0).forEach(function (key) { format_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : format_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  84773. function format_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  84774. function format_toConsumableArray(arr) { return format_arrayWithoutHoles(arr) || format_iterableToArray(arr) || format_unsupportedIterableToArray(arr) || format_nonIterableSpread(); }
  84775. function format_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  84776. function format_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return format_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return format_arrayLikeToArray(o, minLen); }
  84777. function format_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
  84778. function format_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return format_arrayLikeToArray(arr); }
  84779. function format_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  84780. function transformGraphMap(data, graphMap) {
  84781. var style = graphMap && graphMap.styles && graphMap.styles.style;
  84782. var captionField = graphMap && graphMap.captionFields && graphMap.captionFields.captionField;
  84783. var rst = {
  84784. nodes: [],
  84785. edges: []
  84786. };
  84787. data.forEach(function (item) {
  84788. var pathData = item.path;
  84789. if (pathData) {
  84790. var _rst$nodes, _rst$edges;
  84791. var _transformPath2 = transformPath(pathData, style, captionField),
  84792. nodes = _transformPath2.nodes,
  84793. edges = _transformPath2.edges;
  84794. (_rst$nodes = rst.nodes).push.apply(_rst$nodes, format_toConsumableArray(nodes));
  84795. (_rst$edges = rst.edges).push.apply(_rst$edges, format_toConsumableArray(edges));
  84796. } else if (isEdge(item)) {
  84797. var edge = edgeFromGraphMap(item, style);
  84798. rst.edges.push(edge);
  84799. } else {
  84800. var node = nodeFromGraphMap(item, style, captionField);
  84801. rst.nodes.push(node);
  84802. }
  84803. });
  84804. return {
  84805. nodes: uniqData(rst.nodes),
  84806. edges: uniqData(rst.edges, 'edgeId')
  84807. };
  84808. }
  84809. function uniqData(data) {
  84810. var paramName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'id';
  84811. return lodash_uniqby_default()(data, paramName);
  84812. }
  84813. function isEdge(entity) {
  84814. return entity.hasOwnProperty('start') && entity.hasOwnProperty('end');
  84815. }
  84816. function transformPath(pathData, style, captionField) {
  84817. var rst = {
  84818. nodes: [],
  84819. edges: []
  84820. };
  84821. pathData.forEach(function (item) {
  84822. if (isEdge(item)) {
  84823. var edge = edgeFromGraphMap(item, style);
  84824. rst.edges.push(edge);
  84825. } else {
  84826. var node = nodeFromGraphMap(item, style, captionField);
  84827. rst.nodes.push(node);
  84828. }
  84829. });
  84830. return rst;
  84831. }
  84832. function nodeFromGraphMap(entity, style, captionField) {
  84833. var id = entity.id,
  84834. properties = entity.properties,
  84835. lables = entity.lables;
  84836. var styleData = style ? getNodeStyle(entity, style) : {};
  84837. var label = getNodeLabel(entity, captionField);
  84838. var fillColor = styleData.fillColor || '';
  84839. var node = {
  84840. id: id + '',
  84841. label: label,
  84842. properties: properties,
  84843. lables: lables
  84844. };
  84845. if (styleData.size) {
  84846. node.size = styleData.size;
  84847. delete styleData.size;
  84848. }
  84849. if (styleData.fillColor) {
  84850. node.style = {
  84851. fill: fillColor,
  84852. stroke: fillColor
  84853. };
  84854. delete styleData.fillColor;
  84855. }
  84856. if (Object.keys(styleData).length !== 0) {
  84857. node.labelCfg = {
  84858. style: styleData
  84859. };
  84860. }
  84861. return node;
  84862. }
  84863. function edgeFromGraphMap(entity, style) {
  84864. var start = entity.start,
  84865. end = entity.end,
  84866. id = entity.id,
  84867. type = entity.type,
  84868. properties = entity.properties;
  84869. var styleData = style ? getEdgeStyle(entity, style) : {};
  84870. return {
  84871. source: start + '',
  84872. target: end + '',
  84873. edgeId: id + '',
  84874. label: type,
  84875. labelCfg: {
  84876. style: styleData
  84877. },
  84878. properties: properties
  84879. };
  84880. }
  84881. function getEdgeStyle(entity, style) {
  84882. if (!style) {
  84883. return {};
  84884. }
  84885. var id = entity.id,
  84886. type = entity.type;
  84887. var data = style.filter(function (item) {
  84888. return item.type === 'relationShip';
  84889. });
  84890. for (var i = 0; i < data.length; i++) {
  84891. var _data$i2 = data[i],
  84892. textColor = _data$i2.textColor,
  84893. font = _data$i2.font,
  84894. relationTypes = _data$i2.relationTypes,
  84895. relationIds = _data$i2.relationIds;
  84896. var ids = JSON.parse(relationIds || '[]');
  84897. var types = JSON.parse(relationTypes || '[]');
  84898. if (ids.includes(id) || types.includes(type)) {
  84899. return format_objectSpread({
  84900. fontSize: compileFontSize(font.fontSize),
  84901. fontFamily: font.fontName,
  84902. fill: textColor
  84903. }, formatFontStyle(font.fontStyle));
  84904. }
  84905. }
  84906. return {};
  84907. }
  84908. function getNodeStyle(entity, style) {
  84909. if (!style) {
  84910. return {};
  84911. }
  84912. var id = entity.id,
  84913. labels = entity.labels;
  84914. var data = style.filter(function (item) {
  84915. return item.type === 'entity';
  84916. });
  84917. for (var i = 0; i < data.length; i++) {
  84918. var _data$i4 = data[i],
  84919. color = _data$i4.color,
  84920. textColor = _data$i4.textColor,
  84921. font = _data$i4.font,
  84922. size = _data$i4.size,
  84923. entityTypes = _data$i4.entityTypes,
  84924. entityIds = _data$i4.entityIds;
  84925. var ids = JSON.parse(entityIds || '[]');
  84926. var types = JSON.parse(entityTypes || '[]');
  84927. if (ids.includes(id) || types.includes(labels[0])) {
  84928. return format_objectSpread({
  84929. fillColor: color,
  84930. fontSize: compileFontSize(font.fontSize),
  84931. fontFamily: font.fontName,
  84932. fill: textColor,
  84933. size: size
  84934. }, formatFontStyle(font.fontStyle));
  84935. }
  84936. }
  84937. return {};
  84938. }
  84939. function getNodeLabel(entity, captionField) {
  84940. var id = entity.id,
  84941. labels = entity.labels,
  84942. properties = entity.properties;
  84943. if (captionField) {
  84944. var data = captionField instanceof Array ? captionField : [captionField];
  84945. for (var i = 0; i < data.length; i++) {
  84946. var _data$i6 = data[i],
  84947. name = _data$i6.name,
  84948. entityTypes = _data$i6.entityTypes,
  84949. entityIds = _data$i6.entityIds;
  84950. var ids = JSON.parse(entityIds || '[]');
  84951. var types = JSON.parse(entityTypes || '[]');
  84952. if (ids.includes(id) || types.includes(labels[0])) {
  84953. return properties[name] || '';
  84954. }
  84955. }
  84956. }
  84957. return properties[properties._labelfieldname] || '';
  84958. }
  84959. function formatFontStyle(fontStyle) {
  84960. if (fontStyle === 1) {
  84961. return {
  84962. fontWeight: 600
  84963. };
  84964. }
  84965. if (fontStyle === 2) {
  84966. return {
  84967. fontStyle: 'italic'
  84968. };
  84969. }
  84970. return {};
  84971. }
  84972. function compileFontSize(fontSize) {
  84973. return fontSize * 0.8;
  84974. }
  84975. // 处理graphMap数据的展开 折叠 隐藏的实体数据
  84976. function transformExpandCollapseHiddenData(graphMap) {
  84977. var _graphMap$dataContent = graphMap.dataContent,
  84978. expand = _graphMap$dataContent.expand,
  84979. collapse = _graphMap$dataContent.collapse,
  84980. hidden = _graphMap$dataContent.hidden;
  84981. return {
  84982. expand: expand && JSON.parse(expand),
  84983. collapse: collapse && JSON.parse(collapse),
  84984. hidden: hidden && JSON.parse(hidden)
  84985. };
  84986. }
  84987. ;// CONCATENATED MODULE: external "function(){try{return G6}catch(e){return {}}}()"
  84988. var external_function_try_return_G6_catch_e_return_namespaceObject = function(){try{return G6}catch(e){return {}}}();
  84989. var external_function_try_return_G6_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_G6_catch_e_return_namespaceObject);
  84990. // EXTERNAL MODULE: ./node_modules/insert-css/index.js
  84991. var insert_css = __webpack_require__(8813);
  84992. var insert_css_default = /*#__PURE__*/__webpack_require__.n(insert_css);
  84993. ;// CONCATENATED MODULE: ./src/common/overlay/knowledge-graph/G6Render.js
  84994. function G6Render_toConsumableArray(arr) { return G6Render_arrayWithoutHoles(arr) || G6Render_iterableToArray(arr) || G6Render_unsupportedIterableToArray(arr) || G6Render_nonIterableSpread(); }
  84995. function G6Render_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  84996. function G6Render_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return G6Render_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return G6Render_arrayLikeToArray(o, minLen); }
  84997. function G6Render_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
  84998. function G6Render_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return G6Render_arrayLikeToArray(arr); }
  84999. function G6Render_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  85000. function G6Render_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  85001. function G6Render_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? G6Render_ownKeys(Object(source), !0).forEach(function (key) { G6Render_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : G6Render_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  85002. function G6Render_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  85003. function G6Render_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  85004. function G6Render_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  85005. function G6Render_createClass(Constructor, protoProps, staticProps) { if (protoProps) G6Render_defineProperties(Constructor.prototype, protoProps); if (staticProps) G6Render_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  85006. /**
  85007. * @private
  85008. * @class G6Render
  85009. * @category iServer G6Render
  85010. * @classdesc G6Render
  85011. * @param {KnowledgeGraph.Data} data - 创建graph实例的数据项。
  85012. * @param {KnowledgeGraph.Config} [config] - 创建graph实例的配置项。
  85013. * @private
  85014. */
  85015. var G6Render = /*#__PURE__*/function () {
  85016. function G6Render() {
  85017. G6Render_classCallCheck(this, G6Render);
  85018. this.config = null;
  85019. this.graph = null;
  85020. this.data = null;
  85021. this.collpasedData = {};
  85022. this.importG6();
  85023. this.CLASS_NAME = 'SuperMap.G6Render';
  85024. }
  85025. G6Render_createClass(G6Render, [{
  85026. key: "importG6",
  85027. value: function importG6() {
  85028. if (!(external_function_try_return_G6_catch_e_return_default())) {
  85029. console.log('please import g6, eg:https://gw.alipayobjects.com/os/lib/antv/g6/4.3.2/dist/g6.min.js');
  85030. }
  85031. }
  85032. /**
  85033. * @function G6Render.prototype.initGraph
  85034. * @description 创建KnowledgeGraph实例
  85035. * @param {KnowledgeGraph.Config} config - graph配置项。
  85036. * @returns {Object} graph实例。
  85037. */
  85038. }, {
  85039. key: "initGraph",
  85040. value: function initGraph(config) {
  85041. var graph = new (external_function_try_return_G6_catch_e_return_default()).Graph(config);
  85042. this.graph = graph;
  85043. if (!config || config.highlightNode !== false) {
  85044. this.highlightNode(graph);
  85045. }
  85046. if (!config || config.highlightEdge !== false) {
  85047. this.highlightEdge(graph);
  85048. }
  85049. if (config.dragCanvas !== false || config.dragNode !== false) {
  85050. // 阻止事件冒泡
  85051. this.stopDefaultEventPropagation();
  85052. }
  85053. return graph;
  85054. }
  85055. }, {
  85056. key: "_getContextMenu",
  85057. value: function _getContextMenu() {
  85058. var _this = this;
  85059. var contextMenu = new (external_function_try_return_G6_catch_e_return_default()).Menu({
  85060. shouldBegin: function shouldBegin(evt) {
  85061. if (evt.target && evt.target.isCanvas && evt.target.isCanvas()) {
  85062. return true;
  85063. }
  85064. if (evt.item) {
  85065. return true;
  85066. }
  85067. return false;
  85068. },
  85069. getContent: function getContent(evt) {
  85070. var item = evt.item;
  85071. if (evt.target && evt.target.isCanvas && evt.target.isCanvas()) {
  85072. return;
  85073. }
  85074. if (!item) {
  85075. return;
  85076. }
  85077. var itemType = item.getType();
  85078. var model = item.getModel();
  85079. if (itemType && model) {
  85080. if (itemType === 'node') {
  85081. if (_this.isCollpased(model.id)) {
  85082. return "<ul>\n <li id='expand'>\u5C55\u5F00</li>\n <li id='hide'>\u9690\u85CF</li>\n </ul>";
  85083. } else {
  85084. return "<ul>\n <li id='collapse'>\u6298\u53E0</li>\n <li id='hide'>\u9690\u85CF</li>\n </ul>";
  85085. }
  85086. }
  85087. }
  85088. },
  85089. handleMenuClick: function handleMenuClick(target, item) {
  85090. var liIdStrs = target.id.split('-');
  85091. switch (liIdStrs[0]) {
  85092. case 'hide':
  85093. _this.hideItem(item);
  85094. break;
  85095. case 'expand':
  85096. _this.expandNode(item);
  85097. break;
  85098. case 'collapse':
  85099. _this.collapseNode(item);
  85100. break;
  85101. case 'show':
  85102. _this.showItem(item);
  85103. break;
  85104. default:
  85105. break;
  85106. }
  85107. },
  85108. // 需要加上父级容器的 padding-left 16 与自身偏移量 10
  85109. offsetX: 16 + 10,
  85110. // 需要加上父级容器的 padding-top 24 、画布兄弟元素高度、与自身偏移量 10
  85111. offsetY: 0,
  85112. // 在哪些类型的元素上响应
  85113. itemTypes: ['node', 'edge', 'canvas']
  85114. });
  85115. return contextMenu;
  85116. }
  85117. }, {
  85118. key: "_getGraphConfig",
  85119. value: function _getGraphConfig(config) {
  85120. var _this2 = this;
  85121. var animateConfig = {
  85122. speed: 120,
  85123. maxIteration: 83,
  85124. tick: function tick() {
  85125. _this2.refreshPositions();
  85126. }
  85127. };
  85128. var defaultLayout = {
  85129. type: 'fruchterman',
  85130. gravity: 5
  85131. };
  85132. var defaultNode = {};
  85133. var defaultEdge = {
  85134. type: 'line',
  85135. style: {
  85136. endArrow: {
  85137. path: 'M 0,0 L 2,1 L 2,-1 Z'
  85138. },
  85139. lineWidth: 0.5
  85140. },
  85141. labelCfg: {
  85142. autoRotate: true,
  85143. style: {
  85144. fontSize: 4,
  85145. fill: '#333'
  85146. }
  85147. }
  85148. };
  85149. var defaultMode = {
  85150. "default": ['drag-canvas', 'zoom-canvas', 'drag-node']
  85151. };
  85152. var contextMenu = this._getContextMenu();
  85153. var defaultPlugins = [new (external_function_try_return_G6_catch_e_return_default()).ToolBar(), contextMenu];
  85154. var hoverColor = '#b4d6ff';
  85155. var defaultNodeHighlightStyle = {
  85156. lineWidth: 3,
  85157. stroke: hoverColor
  85158. };
  85159. var defaultEdgeHighlightStyle = {
  85160. stroke: hoverColor,
  85161. lineWidth: 2,
  85162. endArrow: {
  85163. path: 'M 0,0 L 2,1 L 2,-1 Z',
  85164. fill: hoverColor
  85165. }
  85166. };
  85167. var defaultGraphConfig = function defaultGraphConfig() {
  85168. var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'knowledgeGraph';
  85169. var dom = document.querySelector("#".concat(container));
  85170. return {
  85171. container: container,
  85172. // String | HTMLElement,必须,在 Step 1 中创建的容器 id 或容器本身
  85173. width: dom.scrollWidth,
  85174. // Number,必须,图的宽度
  85175. height: dom.scrollHeight,
  85176. // Number,必须,图的高度
  85177. plugins: defaultPlugins,
  85178. modes: defaultMode,
  85179. layout: G6Render_objectSpread(G6Render_objectSpread({}, defaultLayout), animateConfig),
  85180. defaultNode: defaultNode,
  85181. defaultEdge: defaultEdge,
  85182. nodeStateStyles: {
  85183. hover: defaultNodeHighlightStyle
  85184. },
  85185. edgeStateStyles: {
  85186. hover: defaultEdgeHighlightStyle
  85187. }
  85188. };
  85189. };
  85190. if (!config) {
  85191. this._setToolBarStyle();
  85192. return defaultGraphConfig();
  85193. }
  85194. config.container = config.container || 'knowledgeGraph';
  85195. var dom = typeof config.container === 'string' ? document.querySelector("#".concat(config.container)) : config.container;
  85196. config.width = config.width || dom.scrollWidth;
  85197. config.height = config.height || dom.scrollHeight;
  85198. config.layout = G6Render_objectSpread(G6Render_objectSpread(G6Render_objectSpread({}, defaultLayout), config.layout || {}), config.animate !== false ? animateConfig : {});
  85199. config.defaultNode = G6Render_objectSpread(G6Render_objectSpread({}, defaultNode), config.defaultNode || {});
  85200. config.defaultEdge = G6Render_objectSpread(G6Render_objectSpread({}, defaultEdge), config.defaultEdge || {});
  85201. config.modes = {
  85202. "default": [config.dragCanvas !== false && 'drag-canvas', config.zoomCanvas !== false && 'zoom-canvas', config.dragNode !== false && 'drag-node']
  85203. };
  85204. config.nodeStateStyles = {
  85205. hover: G6Render_objectSpread(G6Render_objectSpread({}, defaultNodeHighlightStyle), config.nodeHighlightStyle || {})
  85206. };
  85207. config.edgeStateStyles = {
  85208. hover: G6Render_objectSpread(G6Render_objectSpread({}, defaultEdgeHighlightStyle), config.edgeHighlightStyle || {})
  85209. };
  85210. if (config.showToolBar !== false) {
  85211. config.plugins = [new (external_function_try_return_G6_catch_e_return_default()).ToolBar()];
  85212. this._setToolBarStyle();
  85213. }
  85214. if (config.showContextMenu !== false) {
  85215. config.plugins = [].concat(G6Render_toConsumableArray(config.plugins || []), [contextMenu]);
  85216. this._setToolBarStyle();
  85217. }
  85218. return config;
  85219. }
  85220. /**
  85221. * @function KnowledgeGraph.prototype.changeSize
  85222. * @description 当源数据中现有节点/边 的数据项发生配置的变更时,根据新数据刷新视图。
  85223. * @param {number} width - 宽度。
  85224. * @param {number} height - 高度。
  85225. */
  85226. }, {
  85227. key: "changeSize",
  85228. value: function changeSize(width, height) {
  85229. return this.graph.changeSize(width, height);
  85230. }
  85231. /**
  85232. * @function G6Render.prototype.autoResize
  85233. * @description 浏览器窗口大小发生改变时,重新渲染;
  85234. */
  85235. }, {
  85236. key: "autoResize",
  85237. value: function autoResize() {
  85238. var _this3 = this;
  85239. var dom = this.getContainer();
  85240. window.addEventListener('resize', function () {
  85241. var width = dom.scrollWidth;
  85242. var height = dom.scrollHeight;
  85243. _this3.graph.changeSize(width, height);
  85244. _this3.graph.refresh();
  85245. });
  85246. }
  85247. /**
  85248. * @function G6Render.prototype.zoom
  85249. * @description 改变视口的缩放比例,在当前画布比例下缩放,是相对比例。
  85250. * @param {number} ratio 缩放比例。
  85251. * @param {Object} [center] 以 center 的 x、y 坐标为中心缩放,如果省略了 center 参数,则以元素当前位置为中心缩放。
  85252. * @param {boolean} [animate] 是否开启动画。
  85253. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画。若未配置,则跟随 graph 的 animateCfg 参数。
  85254. */
  85255. }, {
  85256. key: "zoom",
  85257. value: function zoom(ratio, center, animate, animateCfg) {
  85258. this.graph.zoom(ratio, center, animate, animateCfg);
  85259. }
  85260. /**
  85261. * @function G6Render.prototype.zoomTo
  85262. * @description 改变视口的缩放比例,在当前画布比例下缩放,是相对比例。
  85263. * @param {number} ratio 缩放比例。
  85264. * @param {Object} [center] 以 center 的 x、y 坐标为中心缩放,如果省略了 center 参数,则以元素当前位置为中心缩放。
  85265. * @param {boolean} [animate] 是否开启动画。
  85266. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画。若未配置,则跟随 graph 的 animateCfg 参数。
  85267. */
  85268. }, {
  85269. key: "zoomTo",
  85270. value: function zoomTo(ratio, center, animate, animateCfg) {
  85271. this.graph.zoomTo(ratio, center, animate, animateCfg);
  85272. }
  85273. /**
  85274. * @function G6Render.prototype.fitView
  85275. * @description 让画布内容适应视口。
  85276. * @param {Array.<number>|number} [padding] [top, right, bottom, left] 四个方向上的间距值。
  85277. * @param {Object} [rules] fitView 的规则,参数如下:{ onlyOutOfViewPort?: boolean; direction?: 'x' / 'y' / 'both'; ratioRule?: 'max' / 'min}。
  85278. * @param {boolean} [animate] 是否开启动画。
  85279. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画。若未配置,则跟随 graph 的 animateCfg 参数。
  85280. */
  85281. }, {
  85282. key: "fitView",
  85283. value: function fitView(padding, rules, animate, animateCfg) {
  85284. this.graph.fitView(padding, rules, animate, animateCfg);
  85285. }
  85286. /**
  85287. * @function G6Render.prototype.fitCenter
  85288. * @description 平移图到中心将对齐到画布中心,但不缩放。优先级低于 fitView。
  85289. * @param {boolean} [animate] 是否开启动画。
  85290. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画,参见基础动画教程。若未配置,则跟随 graph 的 animateCfg 参数。
  85291. */
  85292. }, {
  85293. key: "fitCenter",
  85294. value: function fitCenter(animate, animateCfg) {
  85295. this.graph.fitCenter(animate, animateCfg);
  85296. }
  85297. /**
  85298. * @function G6Render.prototype.getGraphCenterPoint
  85299. * @description 获取图内容的中心绘制坐标。
  85300. * @return {Object} 包含的属性:x 和 y 属性,分别表示渲染坐标下的 x、y 值。
  85301. */
  85302. }, {
  85303. key: "getGraphCenterPoint",
  85304. value: function getGraphCenterPoint() {
  85305. return this.graph.getGraphCenterPoint();
  85306. }
  85307. /**
  85308. * @function G6Render.prototype.getViewPortCenterPoint
  85309. * @description 获取视口中心绘制坐标。
  85310. * @return {Object} 包含的属性:x 和 y 属性,分别表示渲染坐标下的 x、y 值。
  85311. */
  85312. }, {
  85313. key: "getViewPortCenterPoint",
  85314. value: function getViewPortCenterPoint() {
  85315. return this.graph.getViewPortCenterPoint();
  85316. }
  85317. /**
  85318. * @function G6Render.prototype.getZoom
  85319. * @description 获取当前视口的缩放比例。
  85320. * @return {number} 返回值表示当前视口的缩放比例, 默认值为 1。
  85321. */
  85322. }, {
  85323. key: "getZoom",
  85324. value: function getZoom() {
  85325. return this.graph.getZoom();
  85326. }
  85327. /**
  85328. * @function G6Render.prototype.getMinZoom
  85329. * @description 获取 graph 当前允许的最小缩放比例。
  85330. * @return {number} 返回值表示当前视口的最小缩放比例。
  85331. */
  85332. }, {
  85333. key: "getMinZoom",
  85334. value: function getMinZoom() {
  85335. return this.graph.getMinZoom();
  85336. }
  85337. /**
  85338. * @function G6Render.prototype.setMinZoom
  85339. * @description 设置 graph 当前允许的最小缩放比例。
  85340. * @param {number} ratio 缩放比例。
  85341. */
  85342. }, {
  85343. key: "setMinZoom",
  85344. value: function setMinZoom(ratio) {
  85345. this.graph.setMinZoom(ratio);
  85346. }
  85347. /**
  85348. * @function G6Render.prototype.getMaxZoom
  85349. * @description 获取 graph 当前允许的最大缩放比例。
  85350. * @return {number} 返回值表示当前视口的最大缩放比例。
  85351. */
  85352. }, {
  85353. key: "getMaxZoom",
  85354. value: function getMaxZoom() {
  85355. return this.graph.getMaxZoom();
  85356. }
  85357. /**
  85358. * @function G6Render.prototype.setMaxZoom
  85359. * @description 设置 graph 当前允许的最大缩放比例。
  85360. * @param {number} ratio 缩放比例。
  85361. */
  85362. }, {
  85363. key: "setMaxZoom",
  85364. value: function setMaxZoom(ratio) {
  85365. this.graph.setMaxZoom(ratio);
  85366. }
  85367. /**
  85368. * @function G6Render.prototype.getWidth
  85369. * @description获取 graph 当前的宽度。
  85370. * @return {number} graph 当前的宽度。
  85371. */
  85372. }, {
  85373. key: "getWidth",
  85374. value: function getWidth() {
  85375. return this.graph.getWidth();
  85376. }
  85377. /**
  85378. * @function G6Render.prototype.getHeight
  85379. * @description 获取 graph 当前的高度。
  85380. * @return {number} graph 当前的高度。
  85381. */
  85382. }, {
  85383. key: "getHeight",
  85384. value: function getHeight() {
  85385. return this.graph.getHeight();
  85386. }
  85387. }, {
  85388. key: "setCenter",
  85389. value: function setCenter(centerDrawPoint) {
  85390. var centerCanvasPointX = this.graph.getWidth() / 2;
  85391. var centerCanvasPointY = this.graph.getHeight() / 2;
  85392. var centerCanvasPointNew = this.graph.getCanvasByPoint(centerDrawPoint.x, centerDrawPoint.y);
  85393. this.graph.translate(centerCanvasPointX - centerCanvasPointNew.x, centerCanvasPointY - centerCanvasPointNew.y);
  85394. }
  85395. /**
  85396. * @function G6Render.prototype._setToolBarStyle
  85397. * @description 隐藏工具栏的redo undo realZoom按钮
  85398. * @private
  85399. */
  85400. }, {
  85401. key: "_setToolBarStyle",
  85402. value: function _setToolBarStyle() {
  85403. insert_css_default()("\n .g6-component-toolbar li[code='redo'],\n .g6-component-toolbar li[code='undo'],\n .g6-component-toolbar li[code='realZoom'] {\n display: none;\n }\n .g6-component-contextmenu {\n position: absolute;\n z-index: 2;\n list-style-type: none;\n border-radius: 6px;\n font-size: 14px;\n width: fit-content;\n transition: opacity .2s;\n text-align: center;\n box-shadow: 0 5px 18px 0 rgba(0, 0, 0, 0.6);\n border: 0px;\n }\n .g6-component-contextmenu ul {\n padding-left: 0px;\n margin: 0;\n }\n .g6-component-contextmenu li {\n cursor: pointer;\n list-style-type: none;\n list-style: none;\n margin-left: 0;\n line-height: 38px;\n padding: 0px 35px;\n }\n .g6-component-contextmenu li:hover {\n color: #333;\n background: #aaaaaa45;\n }\n ");
  85404. }
  85405. /**
  85406. * @function G6Render.prototype.highlightNode
  85407. * @description 鼠标移入节点,节点高亮
  85408. * @param {Object} graph - graph实例。
  85409. */
  85410. }, {
  85411. key: "highlightNode",
  85412. value: function highlightNode() {
  85413. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  85414. function clearAllStats() {
  85415. graph.setAutoPaint(false);
  85416. graph.getNodes().forEach(function (node) {
  85417. graph.clearItemStates(node);
  85418. });
  85419. graph.paint();
  85420. graph.setAutoPaint(true);
  85421. }
  85422. graph.on('node:mouseenter', function (e) {
  85423. var item = e.item;
  85424. graph.setAutoPaint(false);
  85425. graph.getNodes().forEach(function (node) {
  85426. graph.clearItemStates(node);
  85427. });
  85428. graph.setItemState(item, 'hover', true);
  85429. graph.paint();
  85430. graph.setAutoPaint(true);
  85431. });
  85432. graph.on('node:mouseleave', clearAllStats);
  85433. }
  85434. /**
  85435. * @function G6Render.prototype.highlightNode
  85436. * @description 鼠标移入节点,节点高亮
  85437. * @param {Object} graph - graph实例。
  85438. */
  85439. }, {
  85440. key: "highlightEdge",
  85441. value: function highlightEdge() {
  85442. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  85443. function clearAllStats() {
  85444. graph.setAutoPaint(false);
  85445. graph.getEdges().forEach(function (edge) {
  85446. graph.clearItemStates(edge);
  85447. });
  85448. graph.paint();
  85449. graph.setAutoPaint(true);
  85450. }
  85451. graph.on('edge:mouseenter', function (e) {
  85452. var item = e.item;
  85453. graph.setAutoPaint(false);
  85454. graph.getNodes().forEach(function (node) {
  85455. graph.clearItemStates(node);
  85456. });
  85457. graph.setItemState(item, 'hover', true);
  85458. graph.paint();
  85459. graph.setAutoPaint(true);
  85460. });
  85461. graph.on('edge:mouseleave', clearAllStats);
  85462. }
  85463. /**
  85464. * @function G6Render.prototype.setData
  85465. * @description 设置数据
  85466. * @param {KnowledgeGraph.Data} data - graph数据。
  85467. * @param {Object} [graph] - graph实例。
  85468. */
  85469. }, {
  85470. key: "setData",
  85471. value: function setData(data) {
  85472. var graph = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.graph;
  85473. if (!this.data) {
  85474. graph.data(data);
  85475. } else {
  85476. graph.changeData(data);
  85477. }
  85478. this.data = data;
  85479. }
  85480. /**
  85481. * @function G6Render.prototype.render
  85482. * @description 根据提供的数据渲染视图。
  85483. */
  85484. }, {
  85485. key: "render",
  85486. value: function render() {
  85487. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  85488. return graph.render();
  85489. }
  85490. /**
  85491. * @function G6Render.prototype.updateGraph
  85492. * @description 更新数据
  85493. * @param {Object} graph - graph实例。
  85494. * @param {KnowledgeGraph.Data} data - graph数据。
  85495. */
  85496. }, {
  85497. key: "updateGraph",
  85498. value: function updateGraph(data) {
  85499. var graph = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.graph;
  85500. this.data = data;
  85501. graph.changeData(data);
  85502. }
  85503. /**
  85504. * @function G6Render.prototype.refresh
  85505. * @description 当源数据中现有节点/边的数据项发生配置的变更时,根据新数据刷新视图。
  85506. * @param {Object} graph - graph实例。
  85507. */
  85508. }, {
  85509. key: "refresh",
  85510. value: function refresh() {
  85511. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  85512. graph.refresh();
  85513. }
  85514. /**
  85515. * @function G6Render.prototype.getContainer
  85516. * @description 获取 Graph 的 DOM 容器。
  85517. * @param {Object} graph - graph实例。
  85518. * @return {HTMLElement} DOM 容器。
  85519. */
  85520. }, {
  85521. key: "getContainer",
  85522. value: function getContainer() {
  85523. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  85524. return graph.getContainer();
  85525. }
  85526. /**
  85527. * @function G6Render.prototype.getCanvas
  85528. * @description 获取canvas。
  85529. * @param {Object} graph - graph实例。
  85530. * @return {HTMLElement} canvas。
  85531. */
  85532. }, {
  85533. key: "getCanvas",
  85534. value: function getCanvas() {
  85535. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  85536. return graph.get('canvas');
  85537. }
  85538. /**
  85539. * @function G6Render.prototype.getNodes
  85540. * @description 获取图中所有节点的实例。
  85541. * @param {Object} graph - graph实例。
  85542. * @return {Array} 返回值表示图中所有节点的实例。
  85543. */
  85544. }, {
  85545. key: "getNodes",
  85546. value: function getNodes() {
  85547. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  85548. return graph.getNodes();
  85549. }
  85550. /**
  85551. * @function G6Render.prototype.getEdges
  85552. * @description 获取图中所有节点的实例。这里返回的是边的实例,而不是边的数据项。
  85553. * @param {Object} graph - graph实例。
  85554. * @return {Array} 返回值表示图中所有边的实例。
  85555. */
  85556. }, {
  85557. key: "getEdges",
  85558. value: function getEdges() {
  85559. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  85560. return graph.getEdges();
  85561. }
  85562. /**
  85563. * @function G6Render.prototype.getNeighbors
  85564. * @description 获取邻居节点数组。
  85565. * @param {Object} graph - graph实例。
  85566. * @param {string | INode} node - 节点 ID 或节点实例。
  85567. * @param {string|undefined} type -['source'| 'target' |undefined] 邻居类型, 'source' 只获取当前节点的源节点,'target' 只获取当前节点指向的目标节点, 若不指定则返回所有类型的邻居。
  85568. * @return {Array} 返回值符合要求的节点数组。
  85569. */
  85570. }, {
  85571. key: "getNeighbors",
  85572. value: function getNeighbors(node, type) {
  85573. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  85574. return graph.getNeighbors(node, type);
  85575. }
  85576. /**
  85577. * @function G6Render.prototype.findById
  85578. * @description 根据 ID,查询对应的元素实例。
  85579. * @param {Object} graph - graph实例。
  85580. * @param {string} id - 元素 ID
  85581. * @return {Object} 如果有符合规则的元素实例,则返回第一个匹配的元素实例,否则返回 undefined 。
  85582. */
  85583. }, {
  85584. key: "findById",
  85585. value: function findById(id) {
  85586. var graph = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.graph;
  85587. return graph.findById(id);
  85588. }
  85589. /**
  85590. * @function G6Render.prototype.find
  85591. * @description 获取邻居节点数组。
  85592. * @param {Object} graph - graph实例。
  85593. * @param {string} type - 元素类型,可选值为 'node'、'edge'
  85594. * @param {Function} fn - 查找的规则。
  85595. * @return {Object} 如果有符合规则的元素实例,则返回第一个匹配的元素实例,否则返回 undefined 。
  85596. */
  85597. }, {
  85598. key: "find",
  85599. value: function find(type, fn) {
  85600. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  85601. return graph.find(type, fn);
  85602. }
  85603. /**
  85604. * @function G6Render.prototype.findAll
  85605. * @description 获取邻居节点数组。
  85606. * @param {Object} graph - graph实例。
  85607. * @param {string} type - 元素类型,可选值为 'node'、'edge'
  85608. * @param {Function} fn - 查找的规则。
  85609. * @return {Object} 如果有符合规则的元素实例,则返回所有元素实例,否则返回 undefined。
  85610. */
  85611. }, {
  85612. key: "findAll",
  85613. value: function findAll(type, fn) {
  85614. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  85615. return graph.findAll(type, fn);
  85616. }
  85617. /**
  85618. * @function G6Render.prototype.getEdgesByNode
  85619. * @description 获取与当前节点有关联的所有边。
  85620. * @param {Object} node - node实例。
  85621. * @return {Array} edge实例数组。
  85622. */
  85623. }, {
  85624. key: "getEdgesByNode",
  85625. value: function getEdgesByNode(node) {
  85626. return node.getEdges();
  85627. }
  85628. /**
  85629. * @function G6Render.prototype.getEdgesByNode
  85630. * @description 获取与当前节点关联的所有入边。
  85631. * @param {Object} node - node实例。
  85632. * @return {Array} edge实例数组。
  85633. */
  85634. }, {
  85635. key: "getInEdges",
  85636. value: function getInEdges(node) {
  85637. return node.getInEdges();
  85638. }
  85639. /**
  85640. * @function G6Render.prototype.getEdgesByNode
  85641. * @description 获取与当前节点关联的所有出边。
  85642. * @param {Object} node - node实例。
  85643. * @return {Array} edge实例数组。
  85644. */
  85645. }, {
  85646. key: "getOutEdges",
  85647. value: function getOutEdges(node) {
  85648. return node.getOutEdges();
  85649. }
  85650. /**
  85651. * @function G6Render.prototype.getSourceByEdge
  85652. * @description 获取当前边的起始节点
  85653. * @param {Object} edge - node实例。
  85654. * @return {Object} 返回值为起始节点的实例。
  85655. */
  85656. }, {
  85657. key: "getSourceByEdge",
  85658. value: function getSourceByEdge(edge) {
  85659. return edge.getSource();
  85660. }
  85661. /**
  85662. * @function G6Render.prototype.getTargetByEdge
  85663. * @description 获取当前边的终止节点。
  85664. * @param {Object} edge - node实例。
  85665. * @return {Object} 终止节点的实例。
  85666. */
  85667. }, {
  85668. key: "getTargetByEdge",
  85669. value: function getTargetByEdge(edge) {
  85670. return edge.getTarget();
  85671. }
  85672. /**
  85673. * @function G6Render.prototype.expandNode
  85674. * @description 展开当前节点。
  85675. * @param {Object} item - 元素 ID 或元素实例。
  85676. */
  85677. }, {
  85678. key: "expandNode",
  85679. value: function expandNode(item) {
  85680. var id = item.getModel().id;
  85681. this._expandCollapseNode(this.collpasedData[id], 'show');
  85682. delete this.collpasedData[id];
  85683. }
  85684. /**
  85685. * @function G6Render.prototype.collapseNode
  85686. * @description 收起当前节点。
  85687. * @param {Object} item - 元素 ID 或元素实例。
  85688. * @param {Object} graph - graph实例。
  85689. */
  85690. }, {
  85691. key: "collapseNode",
  85692. value: function collapseNode(item) {
  85693. var id = item.getModel().id;
  85694. var result = [];
  85695. this._collapseFunc(item, result);
  85696. this.collpasedData[id] = result;
  85697. this._expandCollapseNode(result);
  85698. }
  85699. }, {
  85700. key: "isCollpased",
  85701. value: function isCollpased(id) {
  85702. return !!this.collpasedData[id];
  85703. }
  85704. }, {
  85705. key: "_collapseFunc",
  85706. value: function _collapseFunc(item) {
  85707. var res = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  85708. var sourceNodes = this.getNeighbors(item, 'target');
  85709. var targetNodes = this.getNeighbors(item, 'source');
  85710. // 指出节点, 如果没有其他链接,隐藏
  85711. for (var i = 0; i < sourceNodes.length; i++) {
  85712. var sourceNode = sourceNodes[i];
  85713. var model = sourceNode.getModel();
  85714. var nodes = this.getNeighbors(sourceNode);
  85715. // if (nodes && exceptNode) {
  85716. // nodes = nodes.filter((item) => item.id !== exceptNode);
  85717. // }
  85718. if (nodes.length === 1) {
  85719. res.push({
  85720. id: model.id
  85721. });
  85722. }
  85723. }
  85724. // 指入节点, 如果没有其他链接或者没有指入节点隐藏,隐藏
  85725. for (var _i2 = 0; _i2 < targetNodes.length; _i2++) {
  85726. var targetNode = targetNodes[_i2];
  85727. var _model = targetNode.getModel();
  85728. var _nodes = this.getNeighbors(targetNode);
  85729. var targetNodeNodes = this.getNeighbors(targetNode, 'source');
  85730. // if (nodes && exceptNode) {
  85731. // nodes = nodes.filter((item) => item.id !== exceptNode);
  85732. // }
  85733. // if (targetNodeNodes && exceptNode) {
  85734. // targetNodeNodes = targetNodeNodes.filter((item) => item.id !== exceptNode);
  85735. // }
  85736. if (_nodes.length === 1 || targetNodeNodes.length === 0) {
  85737. res.push({
  85738. id: _model.id
  85739. });
  85740. } else {
  85741. var result = [];
  85742. this._collapseFunc(targetNode, result);
  85743. res.push({
  85744. id: _model.id,
  85745. children: result
  85746. });
  85747. }
  85748. }
  85749. return res;
  85750. }
  85751. }, {
  85752. key: "_expandCollapseNode",
  85753. value: function _expandCollapseNode(data) {
  85754. var _this4 = this;
  85755. var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'hide';
  85756. if (!data) {
  85757. return;
  85758. }
  85759. data.forEach(function (item) {
  85760. if (type === 'hide') {
  85761. _this4.hideItem(item.id);
  85762. } else {
  85763. _this4.showItem(item.id);
  85764. // 如果是把之前的折叠也展开了, 就要把之前的折叠数据删除
  85765. if (_this4.isCollpased(item.id)) {
  85766. delete _this4.collpasedData[item.id];
  85767. }
  85768. }
  85769. if (item.children) {
  85770. _this4._expandCollapseNode(item.children, type);
  85771. }
  85772. });
  85773. }
  85774. /**
  85775. * @function G6Render.prototype.showItem
  85776. * @description 显示指定的元素。若 item 为节点,则相关边也会随之显示。而show() 则将只显示自身。
  85777. * @param {string|Object} item - 元素 ID 或元素实例。
  85778. * @param {boolean} [stack] - 操作是否入 undo & redo 栈,当实例化 Graph 时设置 enableStack 为 true 时,默认情况下会自动入栈,入栈以后,就支持 undo & redo 操作,如果不需要,则设置该参数为 false 即可。
  85779. * @param {Object} graph - graph实例。
  85780. */
  85781. }, {
  85782. key: "showItem",
  85783. value: function showItem(item, stack) {
  85784. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  85785. graph.showItem(item, stack);
  85786. }
  85787. /**
  85788. * @function G6Render.prototype.showItem
  85789. * @description 隐藏指定元素。若 item 为节点,则相关边也会随之隐藏。而 hide() 则将只隐藏自身。
  85790. * @param {string|Object} item - 元素 ID 或元素实例。
  85791. * @param {boolean} [stack] -操作是否入 undo & redo 栈,当实例化 Graph 时设置 enableStack 为 true 时,默认情况下会自动入栈,入栈以后,就支持 undo & redo 操作,如果不需要,则设置该参数为 false 即可。
  85792. * @param {Object} graph - graph实例。
  85793. */
  85794. }, {
  85795. key: "hideItem",
  85796. value: function hideItem(item, stack) {
  85797. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  85798. graph.hideItem(item, stack);
  85799. }
  85800. /**
  85801. * @function G6Render.prototype.show
  85802. * @description 显示元素。只显示 item 自身,若需要在显示节点的同时显示相关边,应调用showItem(item)。
  85803. * @param {Object} item - 元素实例。
  85804. */
  85805. }, {
  85806. key: "show",
  85807. value: function show(item) {
  85808. item.show();
  85809. }
  85810. /**
  85811. * @function G6Render.prototype.hide
  85812. * @description 隐藏元素。只隐藏 item 自身,若需要在隐藏节点的同时隐藏相关边,应调用 hideItem(item)。
  85813. * @param {Object} item - 元素实例。
  85814. */
  85815. }, {
  85816. key: "hide",
  85817. value: function hide(item) {
  85818. item.hide();
  85819. }
  85820. /**
  85821. * @function G6Render.prototype.changeVisibility
  85822. * @description 更改元素是否显示。
  85823. * @param {Object} item - 元素实例。
  85824. * @param {boolean} visible - 是否显示元素,true 为显示,false 为隐藏。
  85825. */
  85826. }, {
  85827. key: "changeVisibility",
  85828. value: function changeVisibility(item, visible) {
  85829. item.changeVisibility(visible);
  85830. }
  85831. /**
  85832. * @function G6Render.prototype.isVisible
  85833. * @description 查询元素显示状态。
  85834. * @param {Object} item - 元素实例。
  85835. * @return {boolean} - 返回值为 true,则表示当前元素处于显示状态,否则处于隐藏状态。
  85836. */
  85837. }, {
  85838. key: "isVisible",
  85839. value: function isVisible(item) {
  85840. return item.isVisible();
  85841. }
  85842. /**
  85843. * @function G6Render.prototype.getModel
  85844. * @description 获取元素的数据模型。
  85845. * @param {Object} item - 元素实例。
  85846. * @return {KnowledgeGraph.Data} - 返回值为节点的数据模型。
  85847. */
  85848. }, {
  85849. key: "getModel",
  85850. value: function getModel(item) {
  85851. return item.getModel();
  85852. }
  85853. /**
  85854. * @function G6Render.prototype.addItem
  85855. * @description 新增元素(节点和边)。
  85856. * @param {Object} graph - graph实例。
  85857. * @param {string} type - 元素类型,可选值为 'node'、'edge'
  85858. * @param {Object} model - 元素的数据模型,具体内容参见元素配置项。
  85859. */
  85860. }, {
  85861. key: "addItem",
  85862. value: function addItem(type, model) {
  85863. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  85864. graph.addItem(type, model);
  85865. }
  85866. /**
  85867. * @function G6Render.prototype.addItem
  85868. * @description 删除元素。
  85869. * @param {string|Object} item - 元素 ID 或元素实例
  85870. * @param {Object} graph - graph实例。
  85871. */
  85872. }, {
  85873. key: "removeItem",
  85874. value: function removeItem(item) {
  85875. var graph = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.graph;
  85876. graph.removeItem(item);
  85877. }
  85878. /**
  85879. * @function G6Render.prototype.updateItem
  85880. * @description 更新元素,包括更新数据、样式等。
  85881. * @param {Object} graph - graph实例。
  85882. * @param {string|Object} item - 元素 ID 或元素实例。
  85883. * @param {Object} model - 元素的数据模型,具体内容参见元素配置项。
  85884. */
  85885. }, {
  85886. key: "updateItem",
  85887. value: function updateItem(item, model) {
  85888. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  85889. graph.updateItem(item, model);
  85890. }
  85891. /**
  85892. * @function G6Render.prototype.refreshItem
  85893. * @description 刷新指定元素。
  85894. * @param {Object} graph - graph实例。
  85895. * @param {string|Object} item - 元素 ID 或元素实例。
  85896. */
  85897. }, {
  85898. key: "refreshItem",
  85899. value: function refreshItem(item) {
  85900. var graph = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.graph;
  85901. graph.refreshItem(item);
  85902. }
  85903. /**
  85904. * @function G6Render.prototype.refreshPositions
  85905. * @description 当节点位置发生变化时,刷新所有节点位置,并重计算边的位置。
  85906. * @param {Object} graph - graph实例。
  85907. */
  85908. }, {
  85909. key: "refreshPositions",
  85910. value: function refreshPositions() {
  85911. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  85912. graph.refreshPositions();
  85913. }
  85914. /**
  85915. * @function G6Render.prototype.on
  85916. * @description graph监听事件
  85917. * @param {Object} graph - graph实例。
  85918. * @param {string} eventName - 事件名,可选事件名参见 Event。
  85919. * @param {Function} handler - 监听函数。
  85920. */
  85921. }, {
  85922. key: "on",
  85923. value: function on(eventName, handler) {
  85924. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  85925. graph.on(eventName, handler);
  85926. }
  85927. /**
  85928. * @function G6Render.prototype.off
  85929. * @description graph关闭事件
  85930. * @param {Object} graph - graph实例。
  85931. * @param {string} eventName - 事件名,可选事件名参见 Event。
  85932. * @param {Function} handler - 监听函数。
  85933. */
  85934. }, {
  85935. key: "off",
  85936. value: function off(eventName, handler) {
  85937. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  85938. graph.off(eventName, handler);
  85939. }
  85940. /**
  85941. * @function G6Render.prototype.toDataURL
  85942. * @description 转换成图片
  85943. * @param {Object} graph - graph实例。
  85944. * @param {string} type - 图片类型 'image/png' / 'image/jpeg' / 'image/webp' / 'image/bmp'。
  85945. * @param {string} [backgroundColor] - 图片的背景色,可选,不传值时将导出透明背景的图片。
  85946. * @return {string} 返回值表示生成的图片的 URL。
  85947. */
  85948. }, {
  85949. key: "toDataURL",
  85950. value: function toDataURL(type, backgroundColor) {
  85951. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  85952. graph.toDataURL(type, backgroundColor);
  85953. }
  85954. /**
  85955. * @function G6Render.prototype.bindNodeDefaultDragEvent
  85956. * @description 给graph的节点绑定默认的拖拽事件
  85957. *
  85958. * @param {Object} graph - graph实例。
  85959. */
  85960. }, {
  85961. key: "bindNodeDefaultDragEvent",
  85962. value: function bindNodeDefaultDragEvent() {
  85963. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  85964. graph.on('node:dragstart', function (e) {
  85965. refreshDragedNodePosition(e);
  85966. });
  85967. graph.on('node:drag', function (e) {
  85968. refreshDragedNodePosition(e);
  85969. });
  85970. graph.on('node:dragend', function (e) {
  85971. e.item.get('model').fx = null;
  85972. e.item.get('model').fy = null;
  85973. });
  85974. }
  85975. /**
  85976. * @function G6Render.prototype.stopDefaultEventPropagation
  85977. * @description 阻止点击事件冒泡
  85978. * @param {Object} graph - graph实例。
  85979. */
  85980. }, {
  85981. key: "stopDefaultEventPropagation",
  85982. value: function stopDefaultEventPropagation() {
  85983. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  85984. graph.on('click', function (e) {
  85985. e.stopPropagation();
  85986. });
  85987. graph.on('mousedown', function (e) {
  85988. e.stopPropagation();
  85989. });
  85990. graph.on('mouseover', function (e) {
  85991. e.stopPropagation();
  85992. });
  85993. graph.on('mouseout', function (e) {
  85994. e.stopPropagation();
  85995. });
  85996. }
  85997. /**
  85998. * @function G6Render.prototype.clear
  85999. * @description 清除画布元素
  86000. * @param {Object} graph - graph实例。
  86001. */
  86002. }, {
  86003. key: "clear",
  86004. value: function clear() {
  86005. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  86006. graph.clear();
  86007. }
  86008. /**
  86009. * @function G6Render.prototype.destroy
  86010. * @description 销毁画布
  86011. * @param {Object} graph - graph实例。
  86012. */
  86013. }, {
  86014. key: "destroy",
  86015. value: function destroy() {
  86016. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  86017. graph.destroy();
  86018. }
  86019. }]);
  86020. return G6Render;
  86021. }();
  86022. /**
  86023. * @description 更新拖拽后节点的x ,y
  86024. */
  86025. function refreshDragedNodePosition(e) {
  86026. var model = e.item.get('model');
  86027. model.fx = e.x;
  86028. model.fy = e.y;
  86029. model.x = e.x;
  86030. model.y = e.y;
  86031. return model;
  86032. }
  86033. // EXTERNAL MODULE: ./node_modules/lodash.clonedeep/index.js
  86034. var lodash_clonedeep = __webpack_require__(2138);
  86035. var lodash_clonedeep_default = /*#__PURE__*/__webpack_require__.n(lodash_clonedeep);
  86036. ;// CONCATENATED MODULE: ./src/common/overlay/KnowledgeGraph.js
  86037. function KnowledgeGraph_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  86038. function KnowledgeGraph_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  86039. function KnowledgeGraph_createClass(Constructor, protoProps, staticProps) { if (protoProps) KnowledgeGraph_defineProperties(Constructor.prototype, protoProps); if (staticProps) KnowledgeGraph_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  86040. /**
  86041. * @class KnowledgeGraph
  86042. * @category iServer KnowledgeGraph
  86043. * @classdesc KnowledgeGraph知识图谱
  86044. * @version 11.1.0
  86045. * @param { KnowledgeGraph.Config } config - 创建graph实例的配置项。
  86046. * @usage
  86047. */
  86048. /**
  86049. * @typedef {Object} KnowledgeGraph.Data - 创建graph实例的数据项。
  86050. * @property {Array.<KnowledgeGraph.Node>} data.nodes - 创建graph节点。
  86051. * @property {Array.<KnowledgeGraph.Edge>} data.edges - 创建graph边。
  86052. */
  86053. /**
  86054. * @typedef {Object} KnowledgeGraph.Config - 创建graph实例的配置项。
  86055. * @property {string | HTMLElement} container - 创建的容器 id 或容器本身, 默认是'knowledgeGraph'。
  86056. * @property {number} width - 图的宽度, 默认是container的width。
  86057. * @property {number} height - 图的高度,默认是container的height。
  86058. * @property {Array.<number>} [center] - 中心点的渲染坐标。可以通过KnowledgeGraph.prototype.getViewPortCenterPoint获取。
  86059. * @property {number} [zoom] - 缩放比例。
  86060. * @property {number} [minZoom] - 最小缩放比例。若 fitView、zoom、zoomTo 等操作导致图的缩放比例小于该值,则将使用该值进行缩放,并返回 false。
  86061. * @property {number} [maxZoom] - 最大缩放比例。若 fitView、zoom、zoomTo 等操作导致图的缩放比例大于该值,则将使用该值进行缩放,并返回 false。
  86062. * @property {KnowledgeGraph.Layout} [layout] - 布局。
  86063. * @property {boolean} [animate=true] - 是否开启动画。
  86064. * @property {boolean} [autoResize=true] - 当视口变换时,是否自动重绘。
  86065. * @property {KnowledgeGraph.NodeStyle} [defaultNode] - 默认状态下节点的配置,比如 type, size, color。会被写入的 data 覆盖。
  86066. * @property {KnowledgeGraph.EdgeStyle} [defaultEdge] - 默认状态下边的配置,比如 type, size, color。会被写入的 data 覆盖。
  86067. * @property {KnowledgeGraph.NodeStyle} [nodeHighlightStyle] - 鼠标移入节点高亮样式。默认样式:{strokeColor: 'blue',stroke: 10, opacity: 0.8}。
  86068. * @property {KnowledgeGraph.EdgeStyle} [edgeHighlightStyle] - 鼠标移入边高亮样式。默认样式:{strokeColor: 'blue',stroke: 10, opacity: 0.8}。
  86069. * @property {boolean} [highlightNode = true] - 鼠标移入是否高亮节点。
  86070. * @property {boolean} [highlightEdge = true] - 鼠标移入是否高亮边。
  86071. * @property {boolean} [showToolBar = true] - 是否打开工具条, 包含放大,缩小,切换到实际大小功能。
  86072. * @property {boolean} [showContextMenu = true] - 是否打开节点的右键菜单, 包含展开\折叠、隐藏功能。
  86073. * @property {boolean} [dragCanvas = true] - 是否可以拖拽canvas。
  86074. * @property {boolean} [zoomCanvas = true] - 是否可以缩放canvas。
  86075. * @property {boolean} [dragNode = true] - 是否可以拖拽node节点。
  86076. * @property {number} [nodeLabelMaxWidth] - node节点的标签开启省略号配置项,大于该宽度使用省略号。
  86077. */
  86078. /**
  86079. * @typedef {Object} KnowledgeGraph.Layout - 布局。
  86080. * @property {string} [type='fruchterman'] - 布局类型, 可选值:['fruchterman']。 默认'fruchterman'。
  86081. */
  86082. /**
  86083. * @typedef {Object} KnowledgeGraph.Node - node节点配置项。
  86084. * @property {string} id - 元素的标识 ID,必须是唯一的 string
  86085. * @property {string} [category] - 分类。
  86086. * @property {number} [x] - x坐标。
  86087. * @property {number} [y] - y坐标。
  86088. * @property {number} [size=20] - 节点的大小。
  86089. * @property {Array.<number>|number} [anchorPoints=20] - 指定边连入节点的连接点的位置(相对于该节点而言),可以为空。例如: [0, 0],代表节点左上角的锚点,[1, 1],代表节点右下角的锚点。
  86090. * @property {string} [type] - 元素的类型,不传则使用默认值,节点默认类型为 'circle'。可选值['circle','rect','ellipse','diamond', 'image']
  86091. * @property {string} [label] - 元素的文本标签,有该字段时默认会渲染 label 。
  86092. * @property {KnowledgeGraph.NodeLabelCfg} [labelCfg] - 元素文本标签的配置项,详见各子模块内容。
  86093. * @property {KnowledgeGraph.NodeStyle} [style] - 样式属性。
  86094. */
  86095. /**
  86096. * @typedef {Object} KnowledgeGraph.Edge - edge边配置项。
  86097. * @property {string} [source] -起始点 id 。
  86098. * @property {string} [target] - 结束点 id 。
  86099. * @property {number} [sourceAnchor] - 边的起始节点上的锚点的索引值。
  86100. * @property {number} [targetAnchor] - 边的终止节点上的锚点的索引值。
  86101. * @property {string} [type='line'] - 指定边的类型,可以是内置边的类型名称,也可以是自定义边的名称。默认为 'line'。可选值['line','arc','polyline','quadratic']。
  86102. * @property {string} [label] - 文本文字,如果没有则不会显示。
  86103. * @property {KnowledgeGraph.EdgeLabelCfg} [labelCfg] - 配置标签文本。
  86104. * @property {KnowledgeGraph.EdgeStyle} [style] - 通过 style 配置来修改边的填充色、边框颜色、阴影等属性,具体配置属性见:图形样式属性。
  86105. */
  86106. /**
  86107. * @typedef {Object} KnowledgeGraph.NodeLabelCfg - node节点配置项。
  86108. * @property {string} [position] - 文本相对于节点的位置,目前支持的位置有:'center','top','left','right','bottom'。默认为 'center'。modelRect 节点不支持该属性。
  86109. * @property {KnowledgeGraph.TextStyle} [style] - 标签的样式属性。
  86110. * @property {number} [offset] - 文本的偏移,position 为 'bottom' 时,文本的上方偏移量;position 为 'left' 时,文本的右方偏移量;以此类推在其他 position 时的情况。modelRect 节点的 offset 为左边距。
  86111. */
  86112. /**
  86113. * @typedef {Object} KnowledgeGraph.NodeStyle - 节点样式通用配置项。
  86114. * @property {string} [fill] - 节点填充色。
  86115. * @property {string} [stroke] - 节点的描边颜色。
  86116. * @property {number} [lineWidth] - 描边宽度。
  86117. * @property {Array.<number>} [lineDash] -描边虚线,数组代表实、虚长度。
  86118. * @property {number} [fillOpacity] - 设置填充的 alpha 或透明值。
  86119. * @property {string} [shadowColor] - 阴影颜色。
  86120. * @property {number} [shadowBlur] - 阴影范围。
  86121. * @property {number} [shadowOffsetX] - 阴影 x 方向偏移量。
  86122. * @property {number} [shadowOffsetY] - 阴影 y 方向偏移量。
  86123. * @property {number} [opacity] - 设置绘图的当前 alpha 或透明值。
  86124. * @property {string} [cursor] - 鼠标在该边上时的鼠标样式,CSS 的 cursor 选项都支持。
  86125. */
  86126. /**
  86127. * @typedef {Object} KnowledgeGraph.TextStyle - 文本样式。
  86128. * @property {string} [textAlign] - 设置文本内容的当前对齐方式。支持的属性:center / end / left / right / start,默认值为 start。
  86129. * @property {string} [textBaseline] - 设置在绘制文本时使用的当前文本基线。支持的属性:top / middle / bottom / alphabetic / hanging。默认值为 bottom。
  86130. * @property {string} [fontStyle] - 字体样式。对应 font-style。
  86131. * @property {string} [fontVariant] - 设置为小型大写字母字体。对应 font-variant。
  86132. * @property {number} [fontWeight] - 字体粗细。对应 font-weight。
  86133. * @property {number} [fontSize] - 字体大小。对应 font-size, 边标签文本默认大小是7。
  86134. * @property {string} [fontFamily] - 字体系列。对应 font-family。
  86135. * @property {number} [lineHeight] - 行高。对应 line-height。
  86136. */
  86137. /**
  86138. * @typedef {Object} KnowledgeGraph.EdgeLabelCfg - node节点配置项。
  86139. * @property {string} [position] - 文本相对于边的位置,目前支持的位置有:'start','middle','end'。默认为'middle'。
  86140. * @property {number} [refX] - 标签在 x 方向的偏移量。
  86141. * @property {number} [refY] -标签在 y 方向的偏移量。
  86142. * @property {boolean} [autoRotate=true] - 标签文字是否跟随边旋转,默认: true。
  86143. * @property { KnowledgeGraph.TextStyle} [style] - 标签的样式属性,默认: {fontSize: 3,fill: '#333'}。
  86144. */
  86145. /**
  86146. * @typedef {Object} KnowledgeGraph.EdgeStyle - 边样式通用配置项。
  86147. * @property {string} [stroke] - 边的颜色。
  86148. * @property {number} [lineWidth] - 边宽度。
  86149. * @property {number} [lineAppendWidth] -边响应鼠标事件时的检测宽度,当 lineWidth 太小而不易选中时,可以通过该参数提升击中范围。
  86150. * @property {boolean|Object} [endArrow=true] - 为 true 时在边的结束端绘制默认箭头,为 false 时不绘制结束端箭头, 默认值{path: 'M 0,0 L 2,1 L 2,-1 Z'}
  86151. * @property {boolean|Object} [startArrow] - 为 true 时在边的开始端绘制默认箭头,为 false 时不绘制结束端箭头。
  86152. * @property {number} [strokeOpacity] - 边透明度。
  86153. * @property {string} [shadowColor] - 阴影颜色。
  86154. * @property {number} [shadowBlur] - 阴影模糊程度。
  86155. * @property {number} [shadowOffsetX] - 阴影 x 方向偏移量。
  86156. * @property {number} [shadowOffsetY] - 阴影 y 方向偏移量。
  86157. * @property {Array.<number>} [lineDash] - 设置线的虚线样式,可以指定一个数组。一组描述交替绘制线段和间距(坐标空间单位)长度的数字。 如果数组元素的数量是奇数, 数组的元素会被复制并重复。例如, [5, 15, 25] 会变成 [5, 15, 25, 5, 15, 25]。
  86158. * @property {string} [cursor] - 鼠标在该边上时的鼠标样式,CSS 的 cursor 选项都支持。
  86159. */
  86160. /**
  86161. * @typedef {Object} KnowledgeGraph.AnimateConfig - 动画配置项。
  86162. * @property {number} [duration= 500] - 一次动画的时长。
  86163. * @property {string} [easing='linearEasing'] - 动画函数。
  86164. * @property {number} [delay=0] - 是否重复执行动画。
  86165. * @property {boolean} [repeat=false] - 边透明度。
  86166. * @property {string} [shadowColor] - 阴影颜色。
  86167. */
  86168. var KnowledgeGraph = /*#__PURE__*/function () {
  86169. function KnowledgeGraph(config) {
  86170. var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'G6';
  86171. KnowledgeGraph_classCallCheck(this, KnowledgeGraph);
  86172. /**
  86173. * @member {string} KnowledgeGraph.prototype.graph
  86174. * @description graph实例。
  86175. */
  86176. this.graph = null;
  86177. this.config = lodash_clonedeep_default()(config);
  86178. this.graphRender = null;
  86179. this.type = type;
  86180. this.createGraphRender(this.type);
  86181. this.config = this.graphRender._getGraphConfig(this.config);
  86182. this.createGraph(this.config);
  86183. this.CLASS_NAME = 'SuperMap.KnowledgeGraph';
  86184. }
  86185. /**
  86186. * @function KnowledgeGraph.dataFromGraphMap
  86187. * @description 将iServer GraphMap数据转换成KnowledgeGraph数据。
  86188. * @param {Object} queryResult - iServer知识图谱服务query数据。
  86189. * @param {Object} graphMap - iServer知识图谱服务GraphMap数据(data.graphMap)。
  86190. * @return {KnowledgeGraph.Data} 返回数据。
  86191. */
  86192. KnowledgeGraph_createClass(KnowledgeGraph, [{
  86193. key: "handleNodeStatus",
  86194. value:
  86195. /**
  86196. * @function KnowledgeGraph.prototype.handleNodeStatus
  86197. * @description 展开、折叠、隐藏节点
  86198. * @param {Object} data - 展开 折叠 隐藏的对象, eg: {expand:['id1'], collapse:['id2'], hidden:['id3']}
  86199. */
  86200. function handleNodeStatus(data) {
  86201. var expand = data.expand,
  86202. collapse = data.collapse,
  86203. hidden = data.hidden;
  86204. // 解析expand参数,里面的节点再执行一次查询显示出来
  86205. this.expandNodes(expand);
  86206. // 解析collapse参数,折叠这个里面的节点
  86207. this.collapseNodes(collapse);
  86208. // 解析hidden,隐藏这个里面额的节点
  86209. this.hideNodes(hidden);
  86210. }
  86211. /**
  86212. * @function KnowledgeGraph.prototype.expandNodes
  86213. * @description 展开节点。
  86214. * @param {Array.<string>} expandData - 元素 ID 数组。
  86215. */
  86216. }, {
  86217. key: "expandNodes",
  86218. value: function expandNodes(expandData) {
  86219. var _this = this;
  86220. if (!expandData) {
  86221. return;
  86222. }
  86223. expandData.forEach(function (item) {
  86224. _this.expandNode(item + '');
  86225. });
  86226. }
  86227. /**
  86228. * @function KnowledgeGraph.prototype.collapseNodes
  86229. * @description 折叠节点。
  86230. * @param {Array.<string>} collapseData - 元素 ID 数组。
  86231. */
  86232. }, {
  86233. key: "collapseNodes",
  86234. value: function collapseNodes(collapseData) {
  86235. var _this2 = this;
  86236. if (!collapseData) {
  86237. return;
  86238. }
  86239. collapseData.forEach(function (item) {
  86240. _this2.collapseNode(item + '');
  86241. });
  86242. }
  86243. /**
  86244. * @function KnowledgeGraph.prototype.hideNodes
  86245. * @description 隐藏节点。
  86246. * @param {Array.<string>} hiddenData - 元素 ID 数组。
  86247. */
  86248. }, {
  86249. key: "hideNodes",
  86250. value: function hideNodes(hiddenData) {
  86251. var _this3 = this;
  86252. if (!hiddenData) {
  86253. return;
  86254. }
  86255. hiddenData.forEach(function (item) {
  86256. _this3.hideItem(item + '');
  86257. });
  86258. }
  86259. /**
  86260. * @function KnowledgeGraph.prototype.createGraphRender
  86261. * @description 创建KnowledgeGraphRender
  86262. * @param {string} type -类型, 默认是G6。
  86263. * @private
  86264. */
  86265. }, {
  86266. key: "createGraphRender",
  86267. value: function createGraphRender(type) {
  86268. if (type === 'G6') {
  86269. this.graphRender = new G6Render();
  86270. }
  86271. }
  86272. /**
  86273. * @function KnowledgeGraph.prototype.createGraph
  86274. * @description 创建KnowledgeGraph的guaph实例。
  86275. * @param {Object} config - graph配置项。
  86276. * @returns {Object} graph实例。
  86277. */
  86278. }, {
  86279. key: "createGraph",
  86280. value: function createGraph(config) {
  86281. var graph = this.initGraph(config);
  86282. this.graph = graph;
  86283. this.autoResize();
  86284. return graph;
  86285. }
  86286. /**
  86287. * @function KnowledgeGraph.prototype.getGraph
  86288. * @description 获取KnowledgeGraph的guaph实例。
  86289. * @returns {Object} graph实例。
  86290. */
  86291. }, {
  86292. key: "getGraph",
  86293. value: function getGraph() {
  86294. return this.graph;
  86295. }
  86296. /**
  86297. * @function KnowledgeGraph.prototype.autoResize
  86298. * @description 浏览器窗口大小发生改变时,重新设置canvas画布的大小,重新渲染。
  86299. */
  86300. }, {
  86301. key: "autoResize",
  86302. value: function autoResize() {
  86303. if (this.config && this.config.autoResize !== false) {
  86304. this.graphRender.autoResize();
  86305. }
  86306. }
  86307. /**
  86308. * @function KnowledgeGraph.prototype.zoom
  86309. * @description 改变视口的缩放比例,在当前画布比例下缩放,是相对比例。
  86310. * @param {number} ratio 缩放比例。
  86311. * @param {Object} [center] 以 center 的 x、y 坐标为中心缩放,如果省略了 center 参数,则以元素当前位置为中心缩放。
  86312. * @param {boolean} [animate] 是否开启动画。
  86313. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画。若未配置,则跟随 graph 的 animateCfg 参数。
  86314. */
  86315. }, {
  86316. key: "zoom",
  86317. value: function zoom(ratio, center, animate, animateCfg) {
  86318. this.graphRender.zoom(ratio, center, animate, animateCfg);
  86319. }
  86320. /**
  86321. * @function KnowledgeGraph.prototype.zoomTo
  86322. * @description 改变视口的缩放比例,在当前画布比例下缩放,是相对比例。
  86323. * @param {number} ratio 缩放比例。
  86324. * @param {Object} [center] 以 center 的 x、y 坐标为中心缩放,如果省略了 center 参数,则以元素当前位置为中心缩放。
  86325. * @param {boolean} [animate] 是否开启动画。
  86326. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画。若未配置,则跟随 graph 的 animateCfg 参数。
  86327. */
  86328. }, {
  86329. key: "zoomTo",
  86330. value: function zoomTo(ratio, center, animate, animateCfg) {
  86331. this.graphRender.zoomTo(ratio, center, animate, animateCfg);
  86332. }
  86333. /**
  86334. * @function KnowledgeGraph.prototype.fitView
  86335. * @description 让画布内容适应视口。
  86336. * @param {Array.<number>|number} [padding] [top, right, bottom, left] 四个方向上的间距值。
  86337. * @param {Object} [rules] fitView 的规则,参数如下:{ onlyOutOfViewPort?: boolean; direction?: 'x' / 'y' / 'both'; ratioRule?: 'max' / 'min}。
  86338. * @param {boolean} [animate] 是否开启动画。
  86339. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画。若未配置,则跟随 graph 的 animateCfg 参数。
  86340. */
  86341. }, {
  86342. key: "fitView",
  86343. value: function fitView(padding, rules, animate, animateCfg) {
  86344. this.graphRender.fitView(padding, rules, animate, animateCfg);
  86345. }
  86346. /**
  86347. * @function KnowledgeGraph.prototype.fitCenter
  86348. * @description 平移图到中心将对齐到画布中心,但不缩放。优先级低于 fitView。
  86349. * @param {boolean} [animate] 是否开启动画。
  86350. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画,参见基础动画教程。若未配置,则跟随 graph 的 animateCfg 参数。
  86351. */
  86352. }, {
  86353. key: "fitCenter",
  86354. value: function fitCenter(animate, animateCfg) {
  86355. this.graphRender.fitCenter(animate, animateCfg);
  86356. }
  86357. /**
  86358. * @function KnowledgeGraph.prototype.getGraphCenterPoint
  86359. * @description 获取图内容的中心绘制坐标。
  86360. * @return {Object} 包含的属性:x 和 y 属性,分别表示渲染坐标下的 x、y 值。
  86361. */
  86362. }, {
  86363. key: "getGraphCenterPoint",
  86364. value: function getGraphCenterPoint() {
  86365. return this.graphRender.getGraphCenterPoint();
  86366. }
  86367. /**
  86368. * @function KnowledgeGraph.prototype.getViewPortCenterPoint
  86369. * @description 获取窗口的中心绘制坐标。
  86370. * @return {Object} 包含的属性:x 和 y 属性,分别表示渲染坐标下的 x、y 值。
  86371. */
  86372. }, {
  86373. key: "getViewPortCenterPoint",
  86374. value: function getViewPortCenterPoint() {
  86375. return this.graphRender.getViewPortCenterPoint();
  86376. }
  86377. /**
  86378. * @function KnowledgeGraph.prototype.getZoom
  86379. * @description 获取当前视口的缩放比例。
  86380. * @return {number} 返回值表示当前视口的缩放比例, 默认值为 1。
  86381. */
  86382. }, {
  86383. key: "getZoom",
  86384. value: function getZoom() {
  86385. return this.graphRender.getZoom();
  86386. }
  86387. /**
  86388. * @function KnowledgeGraph.prototype.getMinZoom
  86389. * @description 获取 graph 当前允许的最小缩放比例。
  86390. * @return {number} 返回值表示当前视口的最小缩放比例。
  86391. */
  86392. }, {
  86393. key: "getMinZoom",
  86394. value: function getMinZoom() {
  86395. return this.graphRender.getMinZoom();
  86396. }
  86397. /**
  86398. * @function KnowledgeGraph.prototype.setMinZoom
  86399. * @description 设置 graph 当前允许的最小缩放比例。
  86400. * @param {number} ratio 缩放比例。
  86401. */
  86402. }, {
  86403. key: "setMinZoom",
  86404. value: function setMinZoom(ratio) {
  86405. this.graphRender.setMinZoom(ratio);
  86406. }
  86407. /**
  86408. * @function KnowledgeGraph.prototype.getMaxZoom
  86409. * @description 获取 graph 当前允许的最大缩放比例。
  86410. * @return {number} 返回值表示当前视口的最大缩放比例。
  86411. */
  86412. }, {
  86413. key: "getMaxZoom",
  86414. value: function getMaxZoom() {
  86415. return this.graphRender.getMaxZoom();
  86416. }
  86417. /**
  86418. * @function KnowledgeGraph.prototype.setMaxZoom
  86419. * @description 设置 graph 当前允许的最大缩放比例。
  86420. * @param {number} ratio 缩放比例。
  86421. */
  86422. }, {
  86423. key: "setMaxZoom",
  86424. value: function setMaxZoom(ratio) {
  86425. this.graphRender.setMaxZoom(ratio);
  86426. }
  86427. /**
  86428. * @function KnowledgeGraph.prototype.getWidth
  86429. * @description获取 graph 当前的宽度。
  86430. * @return {number} graph 当前的宽度。
  86431. */
  86432. }, {
  86433. key: "getWidth",
  86434. value: function getWidth() {
  86435. return this.graphRender.getWidth();
  86436. }
  86437. /**
  86438. * @function KnowledgeGraph.prototype.getHeight
  86439. * @description 获取 graph 当前的高度。
  86440. * @return {number} graph 当前的高度。
  86441. */
  86442. }, {
  86443. key: "getHeight",
  86444. value: function getHeight() {
  86445. return this.graphRender.getHeight();
  86446. }
  86447. /**
  86448. * @function KnowledgeGraph.prototype.initGraph
  86449. * @description 创建KnowledgeGraph实例
  86450. * @param {Object} config - graph配置项。
  86451. * @returns {Object} graph实例。
  86452. */
  86453. }, {
  86454. key: "initGraph",
  86455. value: function initGraph(config) {
  86456. var _this4 = this;
  86457. var graph = this.graphRender.initGraph(config);
  86458. this.graph = graph;
  86459. var cb = function cb() {
  86460. if (_this4.config.zoom !== undefined) {
  86461. _this4.zoom(_this4.config.zoom);
  86462. }
  86463. if (_this4.config.center !== undefined) {
  86464. _this4.graphRender.setCenter({
  86465. x: _this4.config.center[0],
  86466. y: _this4.config.center[1]
  86467. });
  86468. }
  86469. };
  86470. this.graph.on('beforelayout', cb);
  86471. return graph;
  86472. }
  86473. /**
  86474. * @function KnowledgeGraph.prototype.setData
  86475. * @description 设置默认数据
  86476. * @param {KnowledgeGraph.Data} data - graph数据。
  86477. * @param {Object} [graph = this.graph] - graph实例。
  86478. */
  86479. }, {
  86480. key: "setData",
  86481. value: function setData(data) {
  86482. var graph = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.graph;
  86483. data = data || {
  86484. nodes: [],
  86485. edges: []
  86486. };
  86487. if (this.config && this.config.nodeLabelMaxWidth) {
  86488. data.nodes = this.nodeLabelOpenEllipsis(this.config.nodeLabelMaxWidth, data.nodes);
  86489. }
  86490. this.graphRender.setData(data, graph);
  86491. this.render(graph); // 渲染图
  86492. this.data = data;
  86493. }
  86494. /**
  86495. * @function KnowledgeGraph.prototype.render
  86496. * @description 根据提供的数据渲染视图。
  86497. * @param {Object} [graph = this.graph] - graph实例。
  86498. */
  86499. }, {
  86500. key: "render",
  86501. value: function render() {
  86502. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  86503. graph && this.graphRender.render(graph);
  86504. }
  86505. /**
  86506. * @function KnowledgeGraph.prototype.updateGraph
  86507. * @description 更新数据
  86508. * @param {KnowledgeGraph.Data} data - graph数据。
  86509. * @param {Object} [graph = this.graph] - graph实例。
  86510. */
  86511. }, {
  86512. key: "updateGraph",
  86513. value: function updateGraph(data) {
  86514. var graph = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.graph;
  86515. graph && this.graphRender.updateGraph(data, graph);
  86516. }
  86517. /**
  86518. * @function KnowledgeGraph.prototype.refresh
  86519. * @description 改变画布大小。
  86520. */
  86521. }, {
  86522. key: "refresh",
  86523. value: function refresh() {
  86524. return this.graphRender.refresh();
  86525. }
  86526. /**
  86527. * @function KnowledgeGraph.prototype.changeSize
  86528. * @description 改变画布大小。
  86529. * @param {number} width - 宽度。
  86530. * @param {number} height - 高度。
  86531. */
  86532. }, {
  86533. key: "changeSize",
  86534. value: function changeSize(width, height) {
  86535. return this.graphRender.changeSize(width, height);
  86536. }
  86537. /**
  86538. * @function KnowledgeGraph.prototype.resize
  86539. * @description 改变画布大小后,重新渲染。
  86540. * @param {number} width - 宽度。
  86541. * @param {number} height - 高度。
  86542. */
  86543. }, {
  86544. key: "resize",
  86545. value: function resize(width, height) {
  86546. this.graphRender.changeSize(width, height);
  86547. this.graphRender.refresh();
  86548. }
  86549. /**
  86550. * @function KnowledgeGraph.prototype.getContainer
  86551. * @description 获取 Graph 的 DOM 容器。
  86552. * @return {HTMLElement} DOM 容器。
  86553. */
  86554. }, {
  86555. key: "getContainer",
  86556. value: function getContainer() {
  86557. return this.graphRender.getContainer();
  86558. }
  86559. /**
  86560. * @function KnowledgeGraph.prototype.getCanvas
  86561. * @description 获取canvas。
  86562. * @return {HTMLElement} canvas。
  86563. */
  86564. }, {
  86565. key: "getCanvas",
  86566. value: function getCanvas() {
  86567. return this.graphRender.getCanvas();
  86568. }
  86569. /**
  86570. * @function KnowledgeGraph.prototype.getNodes
  86571. * @description 获取图中所有节点的实例。
  86572. * @return {Array} 返回值表示图中所有节点的实例。
  86573. */
  86574. }, {
  86575. key: "getNodes",
  86576. value: function getNodes() {
  86577. return this.graphRender.getNodes();
  86578. }
  86579. /**
  86580. * @function KnowledgeGraph.prototype.getEdges
  86581. * @description 获取图中所有节点的实例。这里返回的是边的实例,而不是边的数据项。
  86582. * @return {Array} 返回值表示图中所有边的实例。
  86583. */
  86584. }, {
  86585. key: "getEdges",
  86586. value: function getEdges() {
  86587. return this.graphRender.getEdges();
  86588. }
  86589. /**
  86590. * @function KnowledgeGraph.prototype.getNeighbors
  86591. * @description 获取邻居节点数组。
  86592. * @param {string | INode} node - 节点 ID 或节点实例。
  86593. * @param {string | undefined} type - ['source'| 'target' | undefined] 邻居类型, 'source' 只获取当前节点的源节点,'target' 只获取当前节点指向的目标节点, 若不指定则返回所有类型的邻居。
  86594. * @return {Array} 返回值符合要求的节点数组。
  86595. */
  86596. }, {
  86597. key: "getNeighbors",
  86598. value: function getNeighbors(node, type) {
  86599. return this.graphRender.getNeighbors(node, type);
  86600. }
  86601. /**
  86602. * @function KnowledgeGraph.prototype.findById
  86603. * @description 根据 ID,查询对应的元素实例。
  86604. * @param {string} id - 元素 ID。
  86605. * @return {Object} 如果有符合规则的元素实例,则返回第一个匹配的元素实例,否则返回 undefined 。
  86606. */
  86607. }, {
  86608. key: "findById",
  86609. value: function findById(id) {
  86610. return this.graphRender.findById(id);
  86611. }
  86612. /**
  86613. * @function KnowledgeGraph.prototype.find
  86614. * @description 获取邻居节点数组。
  86615. * @param {string} type - 元素类型,可选值为 'node'、'edge'
  86616. * @param {Function} fn - 查找的规则。
  86617. * @return {Object} 如果有符合规则的元素实例,则返回第一个匹配的元素实例,否则返回 undefined 。
  86618. */
  86619. }, {
  86620. key: "find",
  86621. value: function find(type, fn) {
  86622. return this.graphRender.find(type, fn);
  86623. }
  86624. /**
  86625. * @function KnowledgeGraph.prototype.findAll
  86626. * @description 获取邻居节点数组。
  86627. * @param {string} type - 元素类型,可选值为 'node'、'edge'。
  86628. * @param {Function} fn - 查找的规则。
  86629. * @return {Object} 如果有符合规则的元素实例,则返回所有元素实例,否则返回 undefined。
  86630. */
  86631. }, {
  86632. key: "findAll",
  86633. value: function findAll(type, fn) {
  86634. return this.graphRender.findAll(type, fn);
  86635. }
  86636. /**
  86637. * @function KnowledgeGraph.prototype.getEdgesByNode
  86638. * @description 获取与当前节点有关联的所有边。
  86639. * @param {Object} node - node实例。
  86640. * @return {Array} edge实例数组。
  86641. */
  86642. }, {
  86643. key: "getEdgesByNode",
  86644. value: function getEdgesByNode(node) {
  86645. return this.graphRender.getEdgesByNode(node);
  86646. }
  86647. /**
  86648. * @function KnowledgeGraph.prototype.getInEdges
  86649. * @description 获取与当前节点关联的所有入边。
  86650. * @param {Object} node - node实例。
  86651. * @return {Array} edge实例数组。
  86652. */
  86653. }, {
  86654. key: "getInEdges",
  86655. value: function getInEdges(node) {
  86656. return this.graphRender.getInEdges(node);
  86657. }
  86658. /**
  86659. * @function KnowledgeGraph.prototype.getOutEdges
  86660. * @description 获取与当前节点关联的所有出边。
  86661. * @param {Object} node - node实例。
  86662. * @return {Array} edge实例数组。
  86663. */
  86664. }, {
  86665. key: "getOutEdges",
  86666. value: function getOutEdges(node) {
  86667. return this.graphRender.getOutEdges(node);
  86668. }
  86669. /**
  86670. * @function KnowledgeGraph.prototype.getSourceByEdge
  86671. * @description 获取当前边的起始节点
  86672. * @param {Object} edge - node实例。
  86673. * @return {Object} 返回值为起始节点的实例。
  86674. */
  86675. }, {
  86676. key: "getSourceByEdge",
  86677. value: function getSourceByEdge(edge) {
  86678. return this.graphRender.getSourceByEdge(edge);
  86679. }
  86680. /**
  86681. * @function KnowledgeGraph.prototype.getTargetByEdge
  86682. * @description 获取当前边的终止节点。
  86683. * @param {Object} edge - node实例。
  86684. * @return {Object} 终止节点的实例。
  86685. */
  86686. }, {
  86687. key: "getTargetByEdge",
  86688. value: function getTargetByEdge(edge) {
  86689. return this.graphRender.getTargetByEdge(edge);
  86690. }
  86691. /**
  86692. * @function KnowledgeGraph.prototype.expandNode
  86693. * @description 展开当前节点。
  86694. * @param {string} id - 元素 ID。
  86695. */
  86696. }, {
  86697. key: "expandNode",
  86698. value: function expandNode(id) {
  86699. var item = this.findById(id);
  86700. item && this.graphRender.expandNode(item);
  86701. }
  86702. /**
  86703. * @function KnowledgeGraph.prototype.collapseNode
  86704. * @description 收起当前节点。
  86705. * @param {string} id - 元素 ID。
  86706. */
  86707. }, {
  86708. key: "collapseNode",
  86709. value: function collapseNode(id) {
  86710. var item = this.findById(id);
  86711. item && this.graphRender.collapseNode(item);
  86712. }
  86713. /**
  86714. * @function KnowledgeGraph.prototype.showItem
  86715. * @description 显示指定的元素。若 item 为节点,则相关边也会随之显示。而show() 则将只显示自身。
  86716. * @param {string|Object} item - 元素 ID 或元素实例。
  86717. * @param {boolean} [stack] - 操作是否入 undo & redo 栈,当实例化 Graph 时设置 enableStack 为 true 时,默认情况下会自动入栈,入栈以后,就支持 undo & redo 操作,如果不需要,则设置该参数为 false 即可。
  86718. */
  86719. }, {
  86720. key: "showItem",
  86721. value: function showItem(item, stack) {
  86722. this.graphRender.showItem(item, stack);
  86723. }
  86724. /**
  86725. * @function KnowledgeGraph.prototype.showItem
  86726. * @description 隐藏指定元素。若 item 为节点,则相关边也会随之隐藏。而 hide() 则将只隐藏自身。
  86727. * @param {string|Object} item - 元素 ID 或元素实例。
  86728. * @param {boolean} [stack] -操作是否入 undo & redo 栈,当实例化 Graph 时设置 enableStack 为 true 时,默认情况下会自动入栈,入栈以后,就支持 undo & redo 操作,如果不需要,则设置该参数为 false 即可。
  86729. */
  86730. }, {
  86731. key: "hideItem",
  86732. value: function hideItem(item, stack) {
  86733. this.graphRender.hideItem(item, stack);
  86734. }
  86735. /**
  86736. * @function KnowledgeGraph.prototype.show
  86737. * @description 显示元素。只显示 item 自身,若需要在显示节点的同时显示相关边,应调用showItem(item)。
  86738. * @param {Object} item - 元素实例。
  86739. */
  86740. }, {
  86741. key: "show",
  86742. value: function show(item) {
  86743. this.graphRender.show(item);
  86744. }
  86745. /**
  86746. * @function KnowledgeGraph.prototype.hide
  86747. * @description 隐藏元素。只隐藏 item 自身,若需要在隐藏节点的同时隐藏相关边,应调用 hideItem(item)。
  86748. * @param {Object} item - 元素实例。
  86749. */
  86750. }, {
  86751. key: "hide",
  86752. value: function hide(item) {
  86753. this.graphRender.hide(item);
  86754. }
  86755. /**
  86756. * @function KnowledgeGraph.prototype.changeVisibility
  86757. * @description 更改元素是否显示。
  86758. * @param {Object} item - 元素实例。
  86759. * @param {boolean} visible - 是否显示元素,true 为显示,false 为隐藏。
  86760. */
  86761. }, {
  86762. key: "changeVisibility",
  86763. value: function changeVisibility(item, visible) {
  86764. this.graphRender.changeVisibility(item, visible);
  86765. }
  86766. /**
  86767. * @function KnowledgeGraph.prototype.isVisible
  86768. * @description 查询元素显示状态。
  86769. * @param {Object} item - 元素实例。
  86770. * @return {boolean} - 返回值为 true,则表示当前元素处于显示状态,否则处于隐藏状态。
  86771. */
  86772. }, {
  86773. key: "isVisible",
  86774. value: function isVisible(item) {
  86775. return this.graphRender.isVisible(item);
  86776. }
  86777. /**
  86778. * @function KnowledgeGraph.prototype.getModel
  86779. * @description 获取元素的数据模型。
  86780. * @param {Object} item - 元素实例。
  86781. * @return {Object} - 返回值为节点的数据模型。
  86782. */
  86783. }, {
  86784. key: "getModel",
  86785. value: function getModel(item) {
  86786. return this.graphRender.getModel(item);
  86787. }
  86788. /**
  86789. * @function KnowledgeGraph.prototype.addItem
  86790. * @description 新增元素(节点和边)。
  86791. * @param {string} type - 元素类型,可选值为 'node'、'edge'。
  86792. * @param {Object} model - 元素的数据模型,具体内容参见元素配置项。
  86793. */
  86794. }, {
  86795. key: "addItem",
  86796. value: function addItem(type, model) {
  86797. return this.graphRender.addItem(type, model);
  86798. }
  86799. /**
  86800. * @function KnowledgeGraph.prototype.removeItem
  86801. * @description 删除元素。
  86802. * @param {string|Object} item - 元素 ID 或元素实例。
  86803. */
  86804. }, {
  86805. key: "removeItem",
  86806. value: function removeItem(item) {
  86807. return this.graphRender.removeItem(item);
  86808. }
  86809. /**
  86810. * @function KnowledgeGraph.prototype.updateItem
  86811. * @description 更新元素,包括更新数据、样式等。
  86812. * @param {string|Object} item - 元素 ID 或元素实例。
  86813. * @param {Object} model - 元素的数据模型,具体内容参见元素配置项。
  86814. */
  86815. }, {
  86816. key: "updateItem",
  86817. value: function updateItem(item, model) {
  86818. return this.graphRender.updateItem(item, model);
  86819. }
  86820. /**
  86821. * @function KnowledgeGraph.prototype.refreshItem
  86822. * @description 刷新指定元素。
  86823. * @param {string|Object} item - 元素 ID 或元素实例。
  86824. */
  86825. }, {
  86826. key: "refreshItem",
  86827. value: function refreshItem(item) {
  86828. return this.graphRender.refreshItem(item);
  86829. }
  86830. /**
  86831. * @function KnowledgeGraph.prototype.refreshPositions
  86832. * @description 当节点位置发生变化时,刷新所有节点位置,并重计算边的位置。
  86833. */
  86834. }, {
  86835. key: "refreshPositions",
  86836. value: function refreshPositions() {
  86837. return this.graphRender.refreshPositions();
  86838. }
  86839. /**
  86840. * @function KnowledgeGraph.prototype.on
  86841. * @description graph监听事件
  86842. * @param {string} eventName - 事件名,可选事件名参见: Node交互事件名、Edge交互事件名、Canvas交互事件名 时机事件
  86843. * 通用事件名: click dbclick mouseenter mousemove mouseout mouseover mouseleave mousedown mouseup contextmenu dragstart drag dragend dragenter dragleave drop keydown keyup wheel touchstart touchmove touchend
  86844. * Node交互事件名: node:通用事件名, 例如 node:click
  86845. * Edge交互事件名: edge:通用事件名, 例如 edge:click
  86846. * Canvas交互事件名: canvas:通用事件名,例如 canvas:click
  86847. * 时机事件:用于监听图的某方法调用前后的时机。
  86848. * beforerender 调用 render 方法之前触发
  86849. * afterrender 调用 render 方法之后触发
  86850. * beforeadditem 调用 addItem 方法之前触发
  86851. * afteradditem 调用 addItem 方法之后触发
  86852. * beforeremoveitem 调用 removeItem 方法之前触发
  86853. * afterremoveitem 调用 removeItem 方法之后触发
  86854. * beforeupdateitem 调用 updateItem 方法之前触发
  86855. * afterupdateitem 调用 updateItem 方法之后触发
  86856. * beforegraphrefresh 调用 refresh 方法之前触发
  86857. * aftergraphrefresh 调用 refresh 方法之后触发
  86858. * beforelayout 布局前触发。调用 graph.render 时会进行布局,因此 render 时会触发。或用户主动调用图的 graph.layout 时触发
  86859. * afterlayout 布局完成后触发。调用 graph.render 时会进行布局,因此 render 时布局完成后会触发。或用户主动调用图的 graph.layout 时布局完成后触发
  86860. * viewportchange 调用 graph.moveTo 或 graph.zoom 均会触发该事件
  86861. * @param {Function} handler - 监听函数。
  86862. */
  86863. }, {
  86864. key: "on",
  86865. value: function on(eventName, handler) {
  86866. this.graphRender.on(eventName, handler);
  86867. }
  86868. /**
  86869. * @function KnowledgeGraph.prototype.off
  86870. * @description graph关闭事件。
  86871. * @param {string} eventName - 事件名,参考on方法的事件名。
  86872. * @param {Function} handler - 监听函数。
  86873. */
  86874. }, {
  86875. key: "off",
  86876. value: function off(eventName, handler) {
  86877. this.graphRender.off(eventName, handler);
  86878. }
  86879. /**
  86880. * @function KnowledgeGraph.prototype.toDataURL
  86881. * @description 转换成图片。
  86882. * @param {string} type - 图片类型 'image/png' / 'image/jpeg' / 'image/webp' / 'image/bmp'。
  86883. * @param {string} [backgroundColor] - 图片的背景色,可选,不传值时将导出透明背景的图片。
  86884. * @return {string} 返回值表示生成的图片的 URL。
  86885. */
  86886. }, {
  86887. key: "toDataURL",
  86888. value: function toDataURL(type, backgroundColor) {
  86889. this.graphRender.toDataURL(type, backgroundColor);
  86890. }
  86891. /**
  86892. * @function KnowledgeGraph.prototype.nodeLabelOpenEllipsis
  86893. * @description 转换label的省略号。
  86894. * @param {Object} nodeLabelMaxWidth - node节点标签是否开启省略号
  86895. * @param {Object} nodes - graph的nodes数据。
  86896. * @return {Array} nodes
  86897. */
  86898. }, {
  86899. key: "nodeLabelOpenEllipsis",
  86900. value: function nodeLabelOpenEllipsis(nodeLabelMaxWidth, nodes) {
  86901. var _this5 = this;
  86902. if (!nodes) {
  86903. return [];
  86904. }
  86905. if (!nodeLabelMaxWidth) {
  86906. return nodes;
  86907. }
  86908. return nodes.map(function (node) {
  86909. var fontSize = node.labelCfg && node.labelCfg.fontSize || _this5.defaultNode && _this5.defaultNode.labelCfg && _this5.defaultNode.labelCfg.fontSize || 14;
  86910. node.label = fittingStr(node.label, nodeLabelMaxWidth, fontSize);
  86911. return node;
  86912. });
  86913. }
  86914. /**
  86915. * @function KnowledgeGraph.prototype.clear
  86916. * @description 清除画布元素。
  86917. * @param {Object} [graph = this.graph] - graph实例。
  86918. */
  86919. }, {
  86920. key: "clear",
  86921. value: function clear() {
  86922. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  86923. graph && graph.clear();
  86924. }
  86925. /**
  86926. * @function KnowledgeGraph.prototype.destroy
  86927. * @description 销毁画布。
  86928. * @param {Object} [graph = this.graph] - graph实例。
  86929. */
  86930. }, {
  86931. key: "destroy",
  86932. value: function destroy() {
  86933. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  86934. graph && graph.destroy();
  86935. }
  86936. }], [{
  86937. key: "dataFromGraphMap",
  86938. value: function dataFromGraphMap(queryResult, graphMap) {
  86939. return transformGraphMap(queryResult, graphMap);
  86940. }
  86941. /**
  86942. * @function KnowledgeGraph.dataFromKnowledgeGraphQuery
  86943. * @description 将iServer KnowledgeGraphService query数据转换成KnowledgeGraph数据。
  86944. * @param {Object} queryResult - iServer知识图谱服务query数据。
  86945. * @return {KnowledgeGraph.Data} 返回数据。
  86946. */
  86947. }, {
  86948. key: "dataFromKnowledgeGraphQuery",
  86949. value: function dataFromKnowledgeGraphQuery(queryResult) {
  86950. return transformGraphMap(queryResult);
  86951. }
  86952. }]);
  86953. return KnowledgeGraph;
  86954. }();
  86955. /**
  86956. * @private
  86957. * @description 大于最大宽度的字符串会返回带有省略号的字符串 xxx...。
  86958. * @param {string} label - 需要处理的字符串。
  86959. * @param {number} maxWidth - 最大宽度。
  86960. * @param {number} fontSize - 字体大小。
  86961. * @returns {string} 处理之后的字符串。
  86962. */
  86963. function fittingStr(label, maxWidth, fontSize) {
  86964. var calcLabelLength = function calcLabelLength(label) {
  86965. var len = 0;
  86966. for (var i = 0; i < label.length; i++) {
  86967. if (label.charCodeAt(i) > 0 && label.charCodeAt(i) < 128) {
  86968. len++;
  86969. } else {
  86970. len += 2;
  86971. }
  86972. }
  86973. return len;
  86974. };
  86975. var fontWidth = fontSize * 1; //字号+边距
  86976. maxWidth = maxWidth * 1.6; // 需要根据自己项目调整
  86977. var width = calcLabelLength(label) * fontWidth;
  86978. var ellipsis = '…';
  86979. if (width > maxWidth) {
  86980. var len = Math.floor((maxWidth - 20) / fontWidth);
  86981. var result = label.substring(0, len);
  86982. if ((label.substring(len).length + ellipsis.length) * fontWidth > maxWidth) {
  86983. return result + '\n' + label.substring(len, len + len - 2) + ellipsis;
  86984. } else if (label.substring(len).length == 0) {
  86985. return result;
  86986. } else {
  86987. return result + '\n' + label.substring(len);
  86988. }
  86989. } else {
  86990. return label;
  86991. }
  86992. }
  86993. ;// CONCATENATED MODULE: ./src/common/index.common.js
  86994. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  86995. * This program are made available under the terms of the Apache License, Version 2.0
  86996. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  86997. ;// CONCATENATED MODULE: ./src/common/index.all.js
  86998. ;// CONCATENATED MODULE: ./src/common/namespace.js
  86999. function namespace_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  87000. function namespace_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? namespace_ownKeys(Object(source), !0).forEach(function (key) { namespace_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : namespace_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  87001. function namespace_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  87002. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  87003. * This program are made available under the terms of the Apache License, Version 2.0
  87004. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  87005. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  87006. * This program are made available under the terms of the Apache License, Version 2.0
  87007. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  87008. // Lang
  87009. SuperMap.Lang = Lang;
  87010. SuperMap.i18n = SuperMap.Lang.i18n;
  87011. // CommonUtil
  87012. SuperMap.Util = namespace_objectSpread(namespace_objectSpread({}, SuperMap.Util), Util_Util);
  87013. SuperMap.Browser = Browser;
  87014. SuperMap.INCHES_PER_UNIT = INCHES_PER_UNIT;
  87015. SuperMap.METERS_PER_INCH = METERS_PER_INCH;
  87016. SuperMap.DOTS_PER_INCH = DOTS_PER_INCH;
  87017. SuperMap.IS_GECKO = IS_GECKO;
  87018. // FetchRequest
  87019. SuperMap.setCORS = setCORS;
  87020. SuperMap.isCORS = isCORS;
  87021. SuperMap.setRequestTimeout = setRequestTimeout;
  87022. SuperMap.getRequestTimeout = getRequestTimeout;
  87023. SuperMap.FetchRequest = FetchRequest;
  87024. // commontypes
  87025. SuperMap.inherit = inheritExt;
  87026. SuperMap.mixin = mixinExt;
  87027. SuperMap.String = StringExt;
  87028. SuperMap.Number = NumberExt;
  87029. SuperMap.Function = FunctionExt;
  87030. SuperMap.Array = ArrayExt;
  87031. SuperMap.Date = DateExt;
  87032. SuperMap.Event = Event;
  87033. SuperMap.Bounds = Bounds;
  87034. SuperMap.Credential = Credential;
  87035. SuperMap.Events = Events;
  87036. SuperMap.Feature = Feature_Feature;
  87037. SuperMap.Geometry = Geometry_Geometry;
  87038. SuperMap.Pixel = Pixel;
  87039. SuperMap.Size = Size;
  87040. SuperMap.Feature.Vector = Vector;
  87041. SuperMap.Geometry.Collection = Collection;
  87042. SuperMap.Geometry.Curve = Curve;
  87043. SuperMap.Geometry.GeoText = GeoText;
  87044. SuperMap.Geometry.LinearRing = LinearRing_LinearRing;
  87045. SuperMap.Geometry.LineString = LineString;
  87046. SuperMap.Geometry.MultiLineString = MultiLineString;
  87047. SuperMap.Geometry.MultiPoint = MultiPoint;
  87048. SuperMap.Geometry.MultiPolygon = MultiPolygon;
  87049. SuperMap.Geometry.Point = Point;
  87050. SuperMap.Geometry.Polygon = Polygon_Polygon;
  87051. SuperMap.Geometry.Rectangle = Rectangle;
  87052. // Components
  87053. SuperMap.Components.Chart = ChartView;
  87054. SuperMap.Components.ChartViewModel = ChartViewModel;
  87055. SuperMap.Components.MessageBox = MessageBox;
  87056. SuperMap.Components.AttributesPopContainer = AttributesPopContainer;
  87057. SuperMap.Components.CityTabsPage = CityTabsPage;
  87058. SuperMap.Components.CommonContainer = CommonContainer;
  87059. SuperMap.Components.DropDownBox = DropDownBox;
  87060. SuperMap.Components.IndexTabsPageContainer = IndexTabsPageContainer;
  87061. SuperMap.Components.NavTabsPage = NavTabsPage;
  87062. SuperMap.Components.PaginationContainer = PaginationContainer;
  87063. SuperMap.Components.PopContainer = PopContainer;
  87064. SuperMap.Components.Select = Select;
  87065. SuperMap.Components.TemplateBase = TemplateBase;
  87066. SuperMap.Components.FileReaderUtil = FileReaderUtil;
  87067. // control
  87068. SuperMap.TimeControlBase = TimeControlBase;
  87069. SuperMap.TimeFlowControl = TimeFlowControl;
  87070. // Format
  87071. SuperMap.Format = SuperMap.Format || Format;
  87072. SuperMap.Format.GeoJSON = GeoJSON;
  87073. SuperMap.Format.JSON = JSONFormat;
  87074. SuperMap.Format.WKT = WKT;
  87075. // iManager
  87076. SuperMap.iManager = IManager;
  87077. SuperMap.iManagerCreateNodeParam = IManagerCreateNodeParam;
  87078. SuperMap.iManagerServiceBase = IManagerServiceBase;
  87079. // iPortal
  87080. SuperMap.iPortal = IPortal;
  87081. SuperMap.iPortalAddDataParam = IPortalAddDataParam;
  87082. SuperMap.iPortalAddResourceParam = IPortalAddResourceParam;
  87083. SuperMap.iPortalDataConnectionInfoParam = IPortalDataConnectionInfoParam;
  87084. SuperMap.iPortalDataMetaInfoParam = IPortalDataMetaInfoParam;
  87085. SuperMap.iPortalDataStoreInfoParam = IPortalDataStoreInfoParam;
  87086. SuperMap.iPortalQueryParam = IPortalQueryParam;
  87087. SuperMap.iPortalQueryResult = IPortalQueryResult;
  87088. SuperMap.iPortalRegisterServiceParam = IPortalRegisterServiceParam;
  87089. SuperMap.iPortalResource = IPortalResource;
  87090. SuperMap.iPortalServiceBase = IPortalServiceBase;
  87091. SuperMap.iPortalShareEntity = IPortalShareEntity;
  87092. SuperMap.iPortalShareParam = IPortalShareParam;
  87093. SuperMap.iPortalUser = IPortalUser;
  87094. // iServer
  87095. SuperMap.AddressMatchService = AddressMatchService_AddressMatchService;
  87096. SuperMap.AggregationParameter = AggregationParameter;
  87097. SuperMap.AreaSolarRadiationParameters = AreaSolarRadiationParameters;
  87098. SuperMap.AreaSolarRadiationService = AreaSolarRadiationService;
  87099. SuperMap.BucketAggParameter = BucketAggParameter;
  87100. SuperMap.BufferAnalystParameters = BufferAnalystParameters;
  87101. SuperMap.BufferAnalystService = BufferAnalystService;
  87102. SuperMap.BufferDistance = BufferDistance;
  87103. SuperMap.BuffersAnalystJobsParameter = BuffersAnalystJobsParameter;
  87104. SuperMap.BuffersAnalystJobsService = BuffersAnalystJobsService;
  87105. SuperMap.BufferSetting = BufferSetting;
  87106. SuperMap.BurstPipelineAnalystParameters = BurstPipelineAnalystParameters;
  87107. SuperMap.BurstPipelineAnalystService = BurstPipelineAnalystService;
  87108. SuperMap.ChartFeatureInfoSpecsService = ChartFeatureInfoSpecsService;
  87109. SuperMap.ChartQueryFilterParameter = ChartQueryFilterParameter;
  87110. SuperMap.ChartQueryParameters = ChartQueryParameters;
  87111. SuperMap.ChartQueryService = ChartQueryService;
  87112. SuperMap.ClipParameter = ClipParameter;
  87113. SuperMap.ColorDictionary = ColorDictionary;
  87114. SuperMap.CommonServiceBase = CommonServiceBase;
  87115. SuperMap.ComputeWeightMatrixParameters = ComputeWeightMatrixParameters;
  87116. SuperMap.ComputeWeightMatrixService = ComputeWeightMatrixService;
  87117. SuperMap.CreateDatasetParameters = CreateDatasetParameters;
  87118. SuperMap.DataFlowService = DataFlowService_DataFlowService;
  87119. SuperMap.DataReturnOption = DataReturnOption;
  87120. SuperMap.DatasetBufferAnalystParameters = DatasetBufferAnalystParameters;
  87121. SuperMap.DatasetInfo = DatasetInfo;
  87122. SuperMap.DatasetOverlayAnalystParameters = DatasetOverlayAnalystParameters;
  87123. SuperMap.DatasetService = DatasetService_DatasetService;
  87124. SuperMap.DatasetSurfaceAnalystParameters = DatasetSurfaceAnalystParameters;
  87125. SuperMap.DatasetThiessenAnalystParameters = DatasetThiessenAnalystParameters;
  87126. SuperMap.DatasourceConnectionInfo = DatasourceConnectionInfo;
  87127. SuperMap.DatasourceService = DatasourceService_DatasourceService;
  87128. SuperMap.DensityAnalystService = DensityAnalystService;
  87129. SuperMap.DensityKernelAnalystParameters = DensityKernelAnalystParameters;
  87130. SuperMap.EditFeaturesParameters = EditFeaturesParameters;
  87131. SuperMap.EditFeaturesService = EditFeaturesService;
  87132. SuperMap.FacilityAnalyst3DParameters = FacilityAnalyst3DParameters;
  87133. SuperMap.FacilityAnalystSinks3DParameters = FacilityAnalystSinks3DParameters;
  87134. SuperMap.FacilityAnalystSinks3DService = FacilityAnalystSinks3DService;
  87135. SuperMap.FacilityAnalystSources3DParameters = FacilityAnalystSources3DParameters;
  87136. SuperMap.FacilityAnalystSources3DService = FacilityAnalystSources3DService;
  87137. SuperMap.FacilityAnalystStreamParameters = FacilityAnalystStreamParameters;
  87138. SuperMap.FacilityAnalystStreamService = FacilityAnalystStreamService;
  87139. SuperMap.FacilityAnalystTracedown3DParameters = FacilityAnalystTracedown3DParameters;
  87140. SuperMap.FacilityAnalystTracedown3DService = FacilityAnalystTracedown3DService;
  87141. SuperMap.FacilityAnalystTraceup3DParameters = FacilityAnalystTraceup3DParameters;
  87142. SuperMap.FacilityAnalystTraceup3DService = FacilityAnalystTraceup3DService;
  87143. SuperMap.FacilityAnalystUpstream3DParameters = FacilityAnalystUpstream3DParameters;
  87144. SuperMap.FacilityAnalystUpstream3DService = FacilityAnalystUpstream3DService;
  87145. SuperMap.FieldParameters = FieldParameters;
  87146. SuperMap.FieldsFilter = FieldsFilter;
  87147. SuperMap.FieldStatisticService = FieldStatisticService;
  87148. SuperMap.FieldStatisticsParameters = FieldStatisticsParameters;
  87149. SuperMap.FilterParameter = FilterParameter;
  87150. SuperMap.FindClosestFacilitiesParameters = FindClosestFacilitiesParameters;
  87151. SuperMap.FindClosestFacilitiesService = FindClosestFacilitiesService;
  87152. SuperMap.FindLocationParameters = FindLocationParameters;
  87153. SuperMap.FindLocationService = FindLocationService;
  87154. SuperMap.FindMTSPPathsParameters = FindMTSPPathsParameters;
  87155. SuperMap.FindMTSPPathsService = FindMTSPPathsService;
  87156. SuperMap.FindPathParameters = FindPathParameters;
  87157. SuperMap.FindPathService = FindPathService;
  87158. SuperMap.FindServiceAreasParameters = FindServiceAreasParameters;
  87159. SuperMap.FindServiceAreasService = FindServiceAreasService;
  87160. SuperMap.FindTSPPathsParameters = FindTSPPathsParameters;
  87161. SuperMap.FindTSPPathsService = FindTSPPathsService;
  87162. SuperMap.GenerateSpatialDataParameters = GenerateSpatialDataParameters;
  87163. SuperMap.GenerateSpatialDataService = GenerateSpatialDataService;
  87164. SuperMap.GeoCodingParameter = GeoCodingParameter;
  87165. SuperMap.GeoDecodingParameter = GeoDecodingParameter;
  87166. SuperMap.GeoHashGridAggParameter = GeoHashGridAggParameter;
  87167. SuperMap.GeometryBatchAnalystService = GeometryBatchAnalystService;
  87168. SuperMap.GeometryBufferAnalystParameters = GeometryBufferAnalystParameters;
  87169. SuperMap.GeometryOverlayAnalystParameters = GeometryOverlayAnalystParameters;
  87170. SuperMap.GeometrySurfaceAnalystParameters = GeometrySurfaceAnalystParameters;
  87171. SuperMap.GeometryThiessenAnalystParameters = GeometryThiessenAnalystParameters;
  87172. SuperMap.GeoprocessingService = GeoprocessingService_GeoprocessingService;
  87173. SuperMap.GeoRelationAnalystParameters = GeoRelationAnalystParameters;
  87174. SuperMap.GeoRelationAnalystService = GeoRelationAnalystService;
  87175. SuperMap.GetFeaturesByBoundsParameters = GetFeaturesByBoundsParameters;
  87176. SuperMap.GetFeaturesByBoundsService = GetFeaturesByBoundsService;
  87177. SuperMap.GetFeaturesByBufferParameters = GetFeaturesByBufferParameters;
  87178. SuperMap.GetFeaturesByBufferService = GetFeaturesByBufferService;
  87179. SuperMap.GetFeaturesByGeometryParameters = GetFeaturesByGeometryParameters;
  87180. SuperMap.GetFeaturesByGeometryService = GetFeaturesByGeometryService;
  87181. SuperMap.GetFeaturesByIDsParameters = GetFeaturesByIDsParameters;
  87182. SuperMap.GetFeaturesByIDsService = GetFeaturesByIDsService;
  87183. SuperMap.GetFeaturesBySQLParameters = GetFeaturesBySQLParameters;
  87184. SuperMap.GetFeaturesBySQLService = GetFeaturesBySQLService;
  87185. SuperMap.GetFeaturesParametersBase = GetFeaturesParametersBase;
  87186. SuperMap.GetFeaturesServiceBase = GetFeaturesServiceBase;
  87187. SuperMap.GetFieldsService = GetFieldsService;
  87188. SuperMap.GetGridCellInfosParameters = GetGridCellInfosParameters;
  87189. SuperMap.GetGridCellInfosService = GetGridCellInfosService;
  87190. SuperMap.GetLayersInfoService = GetLayersInfoService;
  87191. SuperMap.Grid = Grid;
  87192. SuperMap.HillshadeParameter = HillshadeParameter;
  87193. SuperMap.Image = UGCImage;
  87194. SuperMap.ImageCollectionService = ImageCollectionService_ImageCollectionService;
  87195. SuperMap.ImageGFAspect = ImageGFAspect;
  87196. SuperMap.ImageGFHillShade = ImageGFHillShade;
  87197. SuperMap.ImageGFOrtho = ImageGFOrtho;
  87198. SuperMap.ImageGFSlope = ImageGFSlope;
  87199. SuperMap.ImageRenderingRule = ImageRenderingRule;
  87200. SuperMap.ImageSearchParameter = ImageSearchParameter;
  87201. SuperMap.ImageService = ImageService_ImageService;
  87202. SuperMap.ImageStretchOption = ImageStretchOption;
  87203. SuperMap.InterpolationAnalystParameters = InterpolationAnalystParameters;
  87204. SuperMap.InterpolationAnalystService = InterpolationAnalystService;
  87205. SuperMap.InterpolationDensityAnalystParameters = InterpolationDensityAnalystParameters;
  87206. SuperMap.InterpolationIDWAnalystParameters = InterpolationIDWAnalystParameters;
  87207. SuperMap.InterpolationKrigingAnalystParameters = InterpolationKrigingAnalystParameters;
  87208. SuperMap.InterpolationRBFAnalystParameters = InterpolationRBFAnalystParameters;
  87209. SuperMap.JoinItem = JoinItem;
  87210. SuperMap.KernelDensityJobParameter = KernelDensityJobParameter;
  87211. SuperMap.KernelDensityJobsService = KernelDensityJobsService;
  87212. SuperMap.LabelImageCell = LabelImageCell;
  87213. SuperMap.LabelMatrixCell = LabelMatrixCell;
  87214. SuperMap.LabelMixedTextStyle = LabelMixedTextStyle;
  87215. SuperMap.LabelSymbolCell = LabelSymbolCell;
  87216. SuperMap.LabelThemeCell = LabelThemeCell;
  87217. SuperMap.LayerStatus = LayerStatus;
  87218. SuperMap.LinkItem = LinkItem;
  87219. SuperMap.MappingParameters = MappingParameters;
  87220. SuperMap.MapService = MapService_MapService;
  87221. SuperMap.MathExpressionAnalysisParameters = MathExpressionAnalysisParameters;
  87222. SuperMap.MathExpressionAnalysisService = MathExpressionAnalysisService;
  87223. SuperMap.MeasureParameters = MeasureParameters;
  87224. SuperMap.MeasureService = MeasureService_MeasureService;
  87225. SuperMap.MetricsAggParameter = MetricsAggParameter;
  87226. SuperMap.NDVIParameter = NDVIParameter;
  87227. SuperMap.NetworkAnalystServiceBase = NetworkAnalystServiceBase;
  87228. SuperMap.OutputSetting = OutputSetting;
  87229. SuperMap.OverlapDisplayedOptions = OverlapDisplayedOptions;
  87230. SuperMap.OverlayAnalystParameters = OverlayAnalystParameters;
  87231. SuperMap.OverlayAnalystService = OverlayAnalystService;
  87232. SuperMap.OverlayGeoJobParameter = OverlayGeoJobParameter;
  87233. SuperMap.OverlayGeoJobsService = OverlayGeoJobsService;
  87234. SuperMap.PointWithMeasure = PointWithMeasure;
  87235. SuperMap.ProcessingServiceBase = ProcessingServiceBase;
  87236. SuperMap.QueryByBoundsParameters = QueryByBoundsParameters;
  87237. SuperMap.QueryByBoundsService = QueryByBoundsService;
  87238. SuperMap.QueryByDistanceParameters = QueryByDistanceParameters;
  87239. SuperMap.QueryByDistanceService = QueryByDistanceService;
  87240. SuperMap.QueryByGeometryParameters = QueryByGeometryParameters;
  87241. SuperMap.QueryByGeometryService = QueryByGeometryService;
  87242. SuperMap.QueryBySQLParameters = QueryBySQLParameters;
  87243. SuperMap.QueryBySQLService = QueryBySQLService;
  87244. SuperMap.QueryParameters = QueryParameters;
  87245. SuperMap.QueryService = QueryService_QueryService;
  87246. SuperMap.RasterFunctionParameter = RasterFunctionParameter;
  87247. SuperMap.Route = Route;
  87248. SuperMap.RouteCalculateMeasureParameters = RouteCalculateMeasureParameters;
  87249. SuperMap.RouteCalculateMeasureService = RouteCalculateMeasureService;
  87250. SuperMap.RouteLocatorParameters = RouteLocatorParameters;
  87251. SuperMap.RouteLocatorService = RouteLocatorService;
  87252. SuperMap.ServerColor = ServerColor;
  87253. SuperMap.ServerFeature = ServerFeature;
  87254. SuperMap.ServerGeometry = ServerGeometry;
  87255. SuperMap.ServerStyle = ServerStyle;
  87256. SuperMap.ServerTextStyle = ServerTextStyle;
  87257. SuperMap.ServerTheme = ServerTheme;
  87258. SuperMap.SetDatasourceParameters = SetDatasourceParameters;
  87259. SuperMap.SetLayerInfoParameters = SetLayerInfoParameters;
  87260. SuperMap.SetLayerInfoService = SetLayerInfoService;
  87261. SuperMap.SetLayersInfoParameters = SetLayersInfoParameters;
  87262. SuperMap.SetLayersInfoService = SetLayersInfoService;
  87263. SuperMap.SetLayerStatusParameters = SetLayerStatusParameters;
  87264. SuperMap.SetLayerStatusService = SetLayerStatusService;
  87265. SuperMap.SingleObjectQueryJobsParameter = SingleObjectQueryJobsParameter;
  87266. SuperMap.SingleObjectQueryJobsService = SingleObjectQueryJobsService;
  87267. SuperMap.Sortby = Sortby;
  87268. SuperMap.SpatialAnalystBase = SpatialAnalystBase;
  87269. SuperMap.StopQueryParameters = StopQueryParameters;
  87270. SuperMap.StopQueryService = StopQueryService;
  87271. SuperMap.SummaryAttributesJobsParameter = SummaryAttributesJobsParameter;
  87272. SuperMap.SummaryAttributesJobsService = SummaryAttributesJobsService;
  87273. SuperMap.SummaryMeshJobParameter = SummaryMeshJobParameter;
  87274. SuperMap.SummaryMeshJobsService = SummaryMeshJobsService;
  87275. SuperMap.SummaryRegionJobParameter = SummaryRegionJobParameter;
  87276. SuperMap.SummaryRegionJobsService = SummaryRegionJobsService;
  87277. SuperMap.SupplyCenter = SupplyCenter;
  87278. SuperMap.SurfaceAnalystParameters = SurfaceAnalystParameters;
  87279. SuperMap.SurfaceAnalystParametersSetting = SurfaceAnalystParametersSetting;
  87280. SuperMap.SurfaceAnalystService = SurfaceAnalystService;
  87281. SuperMap.TerrainCurvatureCalculationParameters = TerrainCurvatureCalculationParameters;
  87282. SuperMap.TerrainCurvatureCalculationService = TerrainCurvatureCalculationService;
  87283. SuperMap.Theme = Theme;
  87284. SuperMap.ThemeDotDensity = ThemeDotDensity;
  87285. SuperMap.ThemeFlow = ThemeFlow;
  87286. SuperMap.ThemeGraduatedSymbol = ThemeGraduatedSymbol;
  87287. SuperMap.ThemeGraduatedSymbolStyle = ThemeGraduatedSymbolStyle;
  87288. SuperMap.ThemeGraph = ThemeGraph;
  87289. SuperMap.ThemeGraphAxes = ThemeGraphAxes;
  87290. SuperMap.ThemeGraphItem = ThemeGraphItem;
  87291. SuperMap.ThemeGraphSize = ThemeGraphSize;
  87292. SuperMap.ThemeGraphText = ThemeGraphText;
  87293. SuperMap.ThemeGridRange = ThemeGridRange;
  87294. SuperMap.ThemeGridRangeItem = ThemeGridRangeItem;
  87295. SuperMap.ThemeGridUnique = ThemeGridUnique;
  87296. SuperMap.ThemeGridUniqueItem = ThemeGridUniqueItem;
  87297. SuperMap.ThemeLabel = ThemeLabel;
  87298. SuperMap.ThemeLabelAlongLine = ThemeLabelAlongLine;
  87299. SuperMap.ThemeLabelBackground = ThemeLabelBackground;
  87300. SuperMap.ThemeLabelItem = ThemeLabelItem;
  87301. SuperMap.ThemeLabelText = ThemeLabelText;
  87302. SuperMap.ThemeLabelUniqueItem = ThemeLabelUniqueItem;
  87303. SuperMap.ThemeMemoryData = ThemeMemoryData;
  87304. SuperMap.ThemeOffset = ThemeOffset;
  87305. SuperMap.ThemeParameters = ThemeParameters;
  87306. SuperMap.ThemeRange = ThemeRange;
  87307. SuperMap.ThemeRangeItem = ThemeRangeItem;
  87308. SuperMap.ThemeService = ThemeService_ThemeService;
  87309. SuperMap.ThemeUnique = ThemeUnique;
  87310. SuperMap.ThemeUniqueItem = ThemeUniqueItem;
  87311. SuperMap.ThiessenAnalystParameters = ThiessenAnalystParameters;
  87312. SuperMap.ThiessenAnalystService = ThiessenAnalystService;
  87313. SuperMap.TilesetsService = TilesetsService;
  87314. SuperMap.TopologyValidatorJobsParameter = TopologyValidatorJobsParameter;
  87315. SuperMap.TopologyValidatorJobsService = TopologyValidatorJobsService;
  87316. SuperMap.TransferLine = TransferLine;
  87317. SuperMap.TransferPathParameters = TransferPathParameters;
  87318. SuperMap.TransferPathService = TransferPathService;
  87319. SuperMap.TransferSolutionParameters = TransferSolutionParameters;
  87320. SuperMap.TransferSolutionService = TransferSolutionService;
  87321. SuperMap.TransportationAnalystParameter = TransportationAnalystParameter;
  87322. SuperMap.TransportationAnalystResultSetting = TransportationAnalystResultSetting;
  87323. SuperMap.UGCLayer = UGCLayer;
  87324. SuperMap.UGCMapLayer = UGCMapLayer;
  87325. SuperMap.UGCSubLayer = UGCSubLayer;
  87326. SuperMap.UpdateDatasetParameters = UpdateDatasetParameters;
  87327. SuperMap.UpdateEdgeWeightParameters = UpdateEdgeWeightParameters;
  87328. SuperMap.UpdateEdgeWeightService = UpdateEdgeWeightService;
  87329. SuperMap.UpdateTurnNodeWeightParameters = UpdateTurnNodeWeightParameters;
  87330. SuperMap.UpdateTurnNodeWeightService = UpdateTurnNodeWeightService;
  87331. SuperMap.Vector = Vector_Vector;
  87332. SuperMap.VectorClipJobsParameter = VectorClipJobsParameter;
  87333. SuperMap.VectorClipJobsService = VectorClipJobsService;
  87334. SuperMap.WebPrintingJobContent = WebPrintingJobContent;
  87335. SuperMap.WebPrintingJobCustomItems = WebPrintingJobCustomItems;
  87336. SuperMap.WebPrintingJobExportOptions = WebPrintingJobExportOptions;
  87337. SuperMap.WebPrintingJobImage = WebPrintingJobImage;
  87338. SuperMap.WebPrintingJobLayers = WebPrintingJobLayers;
  87339. SuperMap.WebPrintingJobLayoutOptions = WebPrintingJobLayoutOptions;
  87340. SuperMap.WebPrintingJobLegendOptions = WebPrintingJobLegendOptions;
  87341. SuperMap.WebPrintingJobLittleMapOptions = WebPrintingJobLittleMapOptions;
  87342. SuperMap.WebPrintingJobNorthArrowOptions = WebPrintingJobNorthArrowOptions;
  87343. SuperMap.WebPrintingJobParameters = WebPrintingJobParameters;
  87344. SuperMap.WebPrintingJobScaleBarOptions = WebPrintingJobScaleBarOptions;
  87345. SuperMap.WebPrintingService = WebPrintingService;
  87346. //Online
  87347. SuperMap.Online = Online;
  87348. SuperMap.OnlineData = OnlineData;
  87349. SuperMap.OnlineQueryDatasParameter = OnlineQueryDatasParameter;
  87350. SuperMap.ServiceStatus = ServiceStatus;
  87351. // 包含online中的DataItemType数据类型
  87352. SuperMap.DataItemType = DataItemType;
  87353. SuperMap.DataItemOrderBy = DataItemOrderBy;
  87354. SuperMap.FilterField = FilterField;
  87355. SuperMap.OnlineServiceBase = OnlineServiceBase;
  87356. // overlay
  87357. SuperMap.Feature = SuperMap.Feature || {};
  87358. SuperMap.Feature.Theme = Theme_Theme;
  87359. SuperMap.Feature.Theme.Bar = Bar;
  87360. SuperMap.Feature.Theme.Bar3D = Bar3D;
  87361. SuperMap.Feature.Theme.Circle = Circle;
  87362. SuperMap.Feature.Theme.Graph = Graph;
  87363. SuperMap.Feature.Theme.Line = Line;
  87364. SuperMap.Feature.Theme.Pie = Pie;
  87365. SuperMap.Feature.Theme.Point = overlay_Point_Point;
  87366. SuperMap.Feature.Theme.RankSymbol = RankSymbol;
  87367. SuperMap.Feature.Theme.Ring = Ring;
  87368. SuperMap.Feature.Theme.ThemeVector = ThemeVector;
  87369. SuperMap.Feature.ShapeParameters = ShapeParameters;
  87370. SuperMap.Feature.ShapeParameters.Circle = Circle_Circle;
  87371. SuperMap.Feature.ShapeParameters.Image = Image_Image;
  87372. SuperMap.Feature.ShapeParameters.Label = Label;
  87373. SuperMap.Feature.ShapeParameters.Line = Line_Line;
  87374. SuperMap.Feature.ShapeParameters.Point = Point_Point;
  87375. SuperMap.Feature.ShapeParameters.Polygon = feature_Polygon_Polygon;
  87376. SuperMap.Feature.ShapeParameters.Rectangle = Rectangle_Rectangle;
  87377. SuperMap.Feature.ShapeParameters.Sector = Sector;
  87378. SuperMap.Feature.ShapeFactory = ShapeFactory;
  87379. // LevelRenderer
  87380. SuperMap.LevelRenderer = LevelRenderer;
  87381. // security
  87382. SuperMap.KeyServiceParameter = KeyServiceParameter;
  87383. SuperMap.SecurityManager = SecurityManager;
  87384. SuperMap.ServerInfo = ServerInfo;
  87385. SuperMap.TokenServiceParameter = TokenServiceParameter;
  87386. // style
  87387. SuperMap.ThemeStyle = ThemeStyle;
  87388. SuperMap.CartoCSS = CartoCSS;
  87389. // thirdparty
  87390. // SuperMap.BinaryClassification = BinaryClassification;
  87391. // SuperMap.LandcoverClassification = LandcoverClassification;
  87392. // SuperMap.ObjectDetection = ObjectDetection;
  87393. // SuperMap.WebMachineLearning = WebMachineLearning;
  87394. SuperMap.ElasticSearch = ElasticSearch;
  87395. // util
  87396. SuperMap.ArrayStatistic = ArrayStatistic;
  87397. SuperMap.ColorsPickerUtil = ColorsPickerUtil;
  87398. // REST
  87399. SuperMap.DataFormat = DataFormat;
  87400. SuperMap.ServerType = ServerType;
  87401. SuperMap.GeometryType = REST_GeometryType;
  87402. SuperMap.QueryOption = QueryOption;
  87403. SuperMap.JoinType = JoinType;
  87404. SuperMap.SpatialQueryMode = SpatialQueryMode;
  87405. SuperMap.SpatialRelationType = SpatialRelationType;
  87406. SuperMap.MeasureMode = MeasureMode;
  87407. SuperMap.Unit = Unit;
  87408. SuperMap.BufferRadiusUnit = BufferRadiusUnit;
  87409. SuperMap.EngineType = EngineType;
  87410. SuperMap.ThemeGraphTextFormat = ThemeGraphTextFormat;
  87411. SuperMap.ThemeGraphType = ThemeGraphType;
  87412. SuperMap.GraphAxesTextDisplayMode = GraphAxesTextDisplayMode;
  87413. SuperMap.GraduatedMode = GraduatedMode;
  87414. SuperMap.RangeMode = RangeMode;
  87415. SuperMap.ThemeType = ThemeType;
  87416. SuperMap.ColorGradientType = ColorGradientType;
  87417. SuperMap.TextAlignment = TextAlignment;
  87418. SuperMap.FillGradientMode = FillGradientMode;
  87419. SuperMap.AlongLineDirection = AlongLineDirection;
  87420. SuperMap.LabelBackShape = LabelBackShape;
  87421. SuperMap.LabelOverLengthMode = LabelOverLengthMode;
  87422. SuperMap.DirectionType = DirectionType;
  87423. SuperMap.OverlayOperationType = OverlayOperationType;
  87424. SuperMap.OutputType = OutputType;
  87425. SuperMap.SideType = SideType;
  87426. SuperMap.SupplyCenterType = SupplyCenterType;
  87427. SuperMap.TurnType = TurnType;
  87428. SuperMap.BufferEndType = BufferEndType;
  87429. SuperMap.SmoothMethod = SmoothMethod;
  87430. SuperMap.SurfaceAnalystMethod = SurfaceAnalystMethod;
  87431. SuperMap.DataReturnMode = DataReturnMode;
  87432. SuperMap.EditType = EditType;
  87433. SuperMap.TransferTactic = TransferTactic;
  87434. SuperMap.TransferPreference = TransferPreference;
  87435. SuperMap.GridType = GridType;
  87436. SuperMap.ColorSpaceType = ColorSpaceType;
  87437. SuperMap.LayerType = LayerType;
  87438. SuperMap.UGCLayerType = UGCLayerType;
  87439. SuperMap.StatisticMode = StatisticMode;
  87440. SuperMap.PixelFormat = PixelFormat;
  87441. SuperMap.SearchMode = SearchMode;
  87442. SuperMap.InterpolationAlgorithmType = InterpolationAlgorithmType;
  87443. SuperMap.VariogramMode = VariogramMode;
  87444. SuperMap.Exponent = Exponent;
  87445. SuperMap.ClientType = ClientType;
  87446. SuperMap.ChartType = ChartType;
  87447. SuperMap.ClipAnalystMode = ClipAnalystMode;
  87448. SuperMap.AnalystAreaUnit = AnalystAreaUnit;
  87449. SuperMap.AnalystSizeUnit = AnalystSizeUnit;
  87450. SuperMap.StatisticAnalystMode = StatisticAnalystMode;
  87451. SuperMap.SummaryType = SummaryType;
  87452. SuperMap.TopologyValidatorRule = TopologyValidatorRule;
  87453. SuperMap.BucketAggType = BucketAggType;
  87454. SuperMap.MetricsAggType = MetricsAggType;
  87455. SuperMap.GetFeatureMode = GetFeatureMode;
  87456. SuperMap.RasterFunctionType = RasterFunctionType;
  87457. SuperMap.ResourceType = ResourceType;
  87458. SuperMap.OrderBy = OrderBy;
  87459. SuperMap.OrderType = OrderType;
  87460. SuperMap.SearchType = SearchType;
  87461. SuperMap.AggregationTypes = AggregationTypes;
  87462. SuperMap.PermissionType = PermissionType;
  87463. SuperMap.EntityType = EntityType;
  87464. SuperMap.WebExportFormatType = WebExportFormatType;
  87465. SuperMap.WebScaleOrientationType = WebScaleOrientationType;
  87466. SuperMap.WebScaleType = WebScaleType;
  87467. SuperMap.WebScaleUnit = WebScaleUnit;
  87468. SuperMap.KnowledgeGraph = KnowledgeGraph;
  87469. ;// CONCATENATED MODULE: external "ol.Observable"
  87470. var external_ol_Observable_namespaceObject = ol.Observable;
  87471. var external_ol_Observable_default = /*#__PURE__*/__webpack_require__.n(external_ol_Observable_namespaceObject);
  87472. ;// CONCATENATED MODULE: ./src/openlayers/services/ServiceBase.js
  87473. function ServiceBase_typeof(obj) { "@babel/helpers - typeof"; return ServiceBase_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ServiceBase_typeof(obj); }
  87474. function ServiceBase_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  87475. function ServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServiceBase_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  87476. function ServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  87477. function ServiceBase_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ServiceBase_setPrototypeOf(subClass, superClass); }
  87478. function ServiceBase_setPrototypeOf(o, p) { ServiceBase_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ServiceBase_setPrototypeOf(o, p); }
  87479. function ServiceBase_createSuper(Derived) { var hasNativeReflectConstruct = ServiceBase_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ServiceBase_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ServiceBase_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ServiceBase_possibleConstructorReturn(this, result); }; }
  87480. function ServiceBase_possibleConstructorReturn(self, call) { if (call && (ServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ServiceBase_assertThisInitialized(self); }
  87481. function ServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  87482. function ServiceBase_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  87483. function ServiceBase_getPrototypeOf(o) { ServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ServiceBase_getPrototypeOf(o); }
  87484. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  87485. * This program are made available under the terms of the Apache License, Version 2.0
  87486. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  87487. /**
  87488. * @class ServiceBase
  87489. * @category iServer Core
  87490. * @classdesc ol.supermap 的服务基类。
  87491. * @param {string} url - 服务地址。
  87492. * @param {Object} options - 参数。
  87493. * @param {string} [options.proxy] - 服务代理地址。
  87494. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  87495. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  87496. * @param {Object} [options.headers] - 请求头。
  87497. * @extends {ol.Observable}
  87498. * @usage
  87499. */
  87500. var ServiceBase = /*#__PURE__*/function (_Observable) {
  87501. ServiceBase_inherits(ServiceBase, _Observable);
  87502. var _super = ServiceBase_createSuper(ServiceBase);
  87503. function ServiceBase(url, options) {
  87504. var _this;
  87505. ServiceBase_classCallCheck(this, ServiceBase);
  87506. _this = _super.call(this, url, options);
  87507. _this.options = options || {};
  87508. _this.url = url;
  87509. _this.dispatchEvent({
  87510. type: 'initialized',
  87511. value: ServiceBase_assertThisInitialized(_this)
  87512. });
  87513. return _this;
  87514. }
  87515. return ServiceBase_createClass(ServiceBase);
  87516. }((external_ol_Observable_default()));
  87517. ;// CONCATENATED MODULE: ./src/openlayers/services/MapService.js
  87518. function services_MapService_typeof(obj) { "@babel/helpers - typeof"; return services_MapService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, services_MapService_typeof(obj); }
  87519. function services_MapService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  87520. function services_MapService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  87521. function services_MapService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_MapService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_MapService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  87522. function services_MapService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) services_MapService_setPrototypeOf(subClass, superClass); }
  87523. function services_MapService_setPrototypeOf(o, p) { services_MapService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_MapService_setPrototypeOf(o, p); }
  87524. function services_MapService_createSuper(Derived) { var hasNativeReflectConstruct = services_MapService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_MapService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_MapService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_MapService_possibleConstructorReturn(this, result); }; }
  87525. function services_MapService_possibleConstructorReturn(self, call) { if (call && (services_MapService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return services_MapService_assertThisInitialized(self); }
  87526. function services_MapService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  87527. function services_MapService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  87528. function services_MapService_getPrototypeOf(o) { services_MapService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_MapService_getPrototypeOf(o); }
  87529. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  87530. * This program are made available under the terms of the Apache License, Version 2.0
  87531. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  87532. /**
  87533. * @class MapService
  87534. * @category iServer Map
  87535. * @classdesc 地图信息服务类。
  87536. * @modulecategory Services
  87537. * @extends {ServiceBase}
  87538. * @param {string} url - 服务地址。
  87539. * @param {Object} options - 参数。
  87540. * @param {string} [options.proxy] - 服务代理地址。
  87541. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  87542. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  87543. * @param {Object} [options.headers] - 请求头。
  87544. * @example
  87545. * new MapService(url).getMapInfo(function(result){
  87546. * //doSomething
  87547. * })
  87548. * @usage
  87549. */
  87550. var MapService = /*#__PURE__*/function (_ServiceBase) {
  87551. services_MapService_inherits(MapService, _ServiceBase);
  87552. var _super = services_MapService_createSuper(MapService);
  87553. function MapService(url, options) {
  87554. services_MapService_classCallCheck(this, MapService);
  87555. return _super.call(this, url, options);
  87556. }
  87557. /**
  87558. * @function MapService.prototype.getMapInfo
  87559. * @description 地图信息查询服务。
  87560. * @param {RequestCallback} callback - 回调函数。
  87561. * @returns {MapService} 获取服务信息。
  87562. */
  87563. services_MapService_createClass(MapService, [{
  87564. key: "getMapInfo",
  87565. value: function getMapInfo(callback) {
  87566. var me = this;
  87567. var getMapStatusService = new MapService_MapService(me.url, {
  87568. proxy: me.options.proxy,
  87569. withCredentials: me.options.withCredentials,
  87570. crossOrigin: me.options.crossOrigin,
  87571. headers: me.options.headers,
  87572. projection: me.options.projection
  87573. });
  87574. getMapStatusService.processAsync(callback);
  87575. }
  87576. /**
  87577. * @function MapService.prototype.getWkt
  87578. * @description 获取WKT。
  87579. * @param {RequestCallback} callback - 回调函数。
  87580. */
  87581. }, {
  87582. key: "getWkt",
  87583. value: function getWkt(callback) {
  87584. var me = this;
  87585. var getMapStatusService = new MapService_MapService("".concat(me.url, "/prjCoordSys.wkt"), {
  87586. proxy: me.options.proxy,
  87587. withCredentials: me.options.withCredentials,
  87588. withoutFormatSuffix: true,
  87589. crossOrigin: me.options.crossOrigin,
  87590. headers: me.options.headers,
  87591. projection: me.options.projection
  87592. });
  87593. getMapStatusService.processAsync(callback);
  87594. }
  87595. /**
  87596. * @function MapService.prototype.getTilesets
  87597. * @description 切片列表信息查询服务。
  87598. * @param {RequestCallback} callback - 回调函数。
  87599. * @returns {MapService} 获取服务信息。
  87600. */
  87601. }, {
  87602. key: "getTilesets",
  87603. value: function getTilesets(callback) {
  87604. var me = this;
  87605. var tilesetsService = new TilesetsService(me.url, {
  87606. proxy: me.options.proxy,
  87607. withCredentials: me.options.withCredentials,
  87608. crossOrigin: me.options.crossOrigin,
  87609. headers: me.options.headers,
  87610. eventListeners: {
  87611. scope: me,
  87612. processCompleted: callback,
  87613. processFailed: callback
  87614. }
  87615. });
  87616. tilesetsService.processAsync();
  87617. }
  87618. }]);
  87619. return MapService;
  87620. }(ServiceBase);
  87621. ;// CONCATENATED MODULE: external "ol.control.Control"
  87622. var external_ol_control_Control_namespaceObject = ol.control.Control;
  87623. var external_ol_control_Control_default = /*#__PURE__*/__webpack_require__.n(external_ol_control_Control_namespaceObject);
  87624. ;// CONCATENATED MODULE: ./src/openlayers/control/ChangeTileVersion.js
  87625. function ChangeTileVersion_typeof(obj) { "@babel/helpers - typeof"; return ChangeTileVersion_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ChangeTileVersion_typeof(obj); }
  87626. function ChangeTileVersion_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  87627. function ChangeTileVersion_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  87628. function ChangeTileVersion_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChangeTileVersion_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChangeTileVersion_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  87629. function ChangeTileVersion_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ChangeTileVersion_setPrototypeOf(subClass, superClass); }
  87630. function ChangeTileVersion_setPrototypeOf(o, p) { ChangeTileVersion_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ChangeTileVersion_setPrototypeOf(o, p); }
  87631. function ChangeTileVersion_createSuper(Derived) { var hasNativeReflectConstruct = ChangeTileVersion_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ChangeTileVersion_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ChangeTileVersion_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ChangeTileVersion_possibleConstructorReturn(this, result); }; }
  87632. function ChangeTileVersion_possibleConstructorReturn(self, call) { if (call && (ChangeTileVersion_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ChangeTileVersion_assertThisInitialized(self); }
  87633. function ChangeTileVersion_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  87634. function ChangeTileVersion_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  87635. function ChangeTileVersion_getPrototypeOf(o) { ChangeTileVersion_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ChangeTileVersion_getPrototypeOf(o); }
  87636. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  87637. * This program are made available under the terms of the Apache License, Version 2.0
  87638. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  87639. /**
  87640. * @class ChangeTileVersion
  87641. * @aliasclass control.ChangeTileVersion
  87642. * @category Control
  87643. * @classdesc 版本切换控件(目前仅支持 IE10 及以上)暂时不支持自定义位置。
  87644. * @modulecategory Control
  87645. * @extends {ol.control.Control}
  87646. * @param {Object} options -参数。
  87647. * @param {string} [options.title='switch tile version'] - 提示信息。
  87648. * @param {string} [options.tooltip='top'] - 提示显示位置 top | right | bottom | left。
  87649. * @param {boolean} [options.collapsed=true] - 是否折叠。
  87650. * @param {string} [options.lastText='-'] - 上一个版本的按钮布局。
  87651. * @param {string} [options.nextText='+'] - 下一个版本的按钮布局。
  87652. * @param {string} [options.ico='V'] - 控件显示的logo。
  87653. * @param {string} [options.orientation='horizontal'] - 方向 horizontal|vertical。
  87654. * @param {boolean} [options.switch=true] - 是否显示上/下一个版本切换控件。
  87655. * @example
  87656. * var control = new ChangeTileVersion({
  87657. * layer: baseLayer,
  87658. * orientation: "horizontal"
  87659. * });
  87660. * map.addControl(control)
  87661. * @usage
  87662. */
  87663. var ChangeTileVersion = /*#__PURE__*/function (_Control) {
  87664. ChangeTileVersion_inherits(ChangeTileVersion, _Control);
  87665. var _super = ChangeTileVersion_createSuper(ChangeTileVersion);
  87666. function ChangeTileVersion(options) {
  87667. var _this;
  87668. ChangeTileVersion_classCallCheck(this, ChangeTileVersion);
  87669. options = options || {};
  87670. //鼠标滑过时提示
  87671. if (!options.title) {
  87672. options.title = 'switch tile version';
  87673. }
  87674. //tooltip提示显示位置 top | right | bottom | left
  87675. if (!options.tooltip) {
  87676. options.tooltip = 'top';
  87677. }
  87678. //是否折叠
  87679. if (!options.collapsed) {
  87680. options.collapsed = true;
  87681. }
  87682. //上一个版本的按钮布局
  87683. if (!options.lastText) {
  87684. options.lastText = '-';
  87685. }
  87686. //下一个版本的按钮布局
  87687. if (!options.nextText) {
  87688. options.nextText = '+';
  87689. }
  87690. //控件显示的logo
  87691. if (!options.ico) {
  87692. options.ico = 'V';
  87693. }
  87694. //方向horizontal|vertical
  87695. if (options.orientation !== 'vertical') {
  87696. options.orientation = 'horizontal';
  87697. }
  87698. //是否显示上/下一个版本切换控件
  87699. if (!options["switch"]) {
  87700. options["switch"] = true;
  87701. }
  87702. _this = _super.call(this, options);
  87703. _this.options = options;
  87704. _this.element = options.element = initLayout.call(ChangeTileVersion_assertThisInitialized(_this));
  87705. if (options.layer) {
  87706. _this.setLayer(options.layer);
  87707. }
  87708. /**
  87709. * @function ChangeTileVersion.prototype.initLayout
  87710. * @description 初始化。
  87711. */
  87712. function initLayout() {
  87713. var className = 'ol-control-ctv';
  87714. this._container = createElement('div', className + ' ' + className + '-' + options.orientation + ' ol-unselectable ol-control');
  87715. //正常情况下显示btn
  87716. this._sliderBtn = createElement('button', className + '-toggle', this._container);
  87717. this._sliderBtn.setAttribute('title', options.title);
  87718. this._sliderBtn.innerHTML = options.ico;
  87719. //滑块拖动时值显示区域
  87720. this._sliderValue = createElement('p', className + '-value', this._container);
  87721. this._sliderValue.innerHTML = options.ico;
  87722. this._sliderValue.setAttribute('title', options.title);
  87723. var sliderClassName = 'ol-ctv-slider';
  87724. this._sliderContent = createElement('div', sliderClassName + '-main' + ' tooltip', this._container);
  87725. //tooltip提示框
  87726. if (options.orientation === 'vertical' && options.tooltip === 'top') {
  87727. options.tooltip = 'right';
  87728. }
  87729. this.tooltip = createElement('span', 'tooltip-text' + ' ' + 'tooltip-' + options.tooltip, this._sliderContent);
  87730. this.tooltip.innerHTML = options.ico;
  87731. //加控件
  87732. if (options["switch"]) {
  87733. this._next = createElement('a', sliderClassName + '-incdec' + ' ' + sliderClassName + '-next', this._sliderContent);
  87734. this._next.innerHTML = options.nextText;
  87735. addDomEvent(this._next, 'click', this.nextTilesVersion, this);
  87736. this._container.classList.add(className + '-incdec');
  87737. }
  87738. //滑块
  87739. this._sliderContainer = createElement('div', sliderClassName + '-container', this._sliderContent);
  87740. this.slider = createElement('input', sliderClassName, this._sliderContainer);
  87741. this.min = this.min == null || isNaN(this.min) ? 0 : parseInt(this.min);
  87742. this.slider.setAttribute('title', options.title);
  87743. this.slider.setAttribute('id', 'slider');
  87744. this.slider.setAttribute('type', 'range');
  87745. this.slider.setAttribute('min', this.min);
  87746. this.slider.setAttribute('max', 0);
  87747. this.slider.setAttribute('step', 1);
  87748. this.slider.setAttribute('value', 0);
  87749. // //判断浏览器是否支持Range滑动条
  87750. // if (this.slider.type == "text") {
  87751. // console.error("抱歉,您的浏览器不支持HTML5 range滑动条,请使用高版本浏览器");
  87752. // }
  87753. this.firstLoad = true;
  87754. if ('oninput' in this.slider || 'onchange' in this.slider) {
  87755. addDomEvent(this.slider, 'change', tilesVersion, this);
  87756. } else {
  87757. this.slider.onpropertychange = tilesVersion;
  87758. }
  87759. //减控件
  87760. if (options["switch"]) {
  87761. this._last = createElement('a', sliderClassName + '-incdec' + ' ' + sliderClassName + '-last', this._sliderContent);
  87762. this._last.innerHTML = options.lastText;
  87763. addDomEvent(this._last, 'click', this.lastTilesVersion, this);
  87764. }
  87765. // if (window.matchMedia("screen and (-webkit-min-device-pixel-ratio:0)").matches && options.orientation == 'vertical') {
  87766. if (options.orientation == 'vertical') {
  87767. this.slider.style.width = 170 + 'px';
  87768. this._sliderContainer.style.height = 170 + 'px';
  87769. } else {
  87770. this._sliderContainer.style.width = 150 + 'px';
  87771. }
  87772. addDomEvent(this._container, 'click', function (e) {
  87773. e.preventDefault();
  87774. e.stopPropagation();
  87775. }, this);
  87776. if (options.collapsed) {
  87777. addDomEvent(this._container, 'mouseenter', expand, this);
  87778. addDomEvent(this._container, 'mouseleave', collapse, this);
  87779. addDomEvent(this._sliderBtn, 'click', function (e) {
  87780. e.preventDefault();
  87781. e.stopPropagation();
  87782. });
  87783. addDomEvent(this._sliderBtn, 'click', expand, this);
  87784. addDomEvent(this._sliderBtn, 'focus', expand, this);
  87785. } else {
  87786. expand();
  87787. }
  87788. return this._container;
  87789. }
  87790. /**
  87791. * @function ChangeTileVersion.prototype.createElement
  87792. * @description 新建元素。
  87793. * @param {string} tagName - 标签名。
  87794. * @param {string} className - 类名。
  87795. * @param {Object} container - 容器。
  87796. * @returns {object|HTMLElement} 元素。
  87797. */
  87798. function createElement(tagName, className, container) {
  87799. var el = document.createElement(tagName);
  87800. el.className = className || '';
  87801. if (container) {
  87802. container.appendChild(el);
  87803. }
  87804. return el;
  87805. }
  87806. /**
  87807. * @function ChangeTileVersion.prototype.addDomEvent
  87808. * @description 为元素添加事件。
  87809. * @param {Object} obj - 事件对象集。
  87810. * @param {string} type - 事件类型。
  87811. * @param {Object} fn -容器。
  87812. * @param {Object} context -当前环境。
  87813. * @returns {function} 添加的事件。
  87814. */
  87815. function addDomEvent(obj, type, fn, context) {
  87816. var handler = function handler(e) {
  87817. if (fn) {
  87818. return fn.call(context || obj, e || window.event);
  87819. }
  87820. };
  87821. var originalHandler = handler;
  87822. if ('addEventListener' in obj) {
  87823. if (type === 'mousewheel') {
  87824. obj.addEventListener('onwheel' in obj ? 'wheel' : 'mousewheel', handler, false);
  87825. } else if (type === 'mouseenter' || type === 'mouseleave') {
  87826. handler = function handler(e) {
  87827. e = e || window.event;
  87828. if (isExternalTarget(obj, e)) {
  87829. originalHandler(e);
  87830. }
  87831. };
  87832. obj.addEventListener(type === 'mouseenter' ? 'mouseover' : 'mouseout', handler, false);
  87833. } else {
  87834. obj.addEventListener(type, handler, false);
  87835. }
  87836. } else if ('attachEvent' in obj) {
  87837. obj.attachEvent('on' + type, handler);
  87838. }
  87839. return this;
  87840. }
  87841. function isExternalTarget(el, e) {
  87842. var related = e.relatedTarget;
  87843. if (!related) {
  87844. return true;
  87845. }
  87846. try {
  87847. while (related && related !== el) {
  87848. related = related.parentNode;
  87849. }
  87850. } catch (err) {
  87851. return false;
  87852. }
  87853. return related !== el;
  87854. }
  87855. function expand() {
  87856. this._container.classList.add('ol-control-ctv-expanded');
  87857. }
  87858. function collapse() {
  87859. this._container.classList.remove('ol-control-ctv-expanded');
  87860. }
  87861. function tilesVersion() {
  87862. var version = this.getVersion();
  87863. this.tilesVersion(version);
  87864. }
  87865. return _this;
  87866. }
  87867. /**
  87868. * @function ChangeTileVersion.prototype.setContent
  87869. * @description 设置版本相关信息。
  87870. * @param {Object} version - 版本信息。
  87871. */
  87872. ChangeTileVersion_createClass(ChangeTileVersion, [{
  87873. key: "setContent",
  87874. value: function setContent(version) {
  87875. var content = version || {};
  87876. this.setVersionName(content.desc).setToolTip(content.desc);
  87877. }
  87878. /**
  87879. * @function ChangeTileVersion.prototype.setVersionName
  87880. * @description 设置版本号
  87881. * @param {string} content -版本内容。
  87882. */
  87883. }, {
  87884. key: "setVersionName",
  87885. value: function setVersionName(content) {
  87886. var value = content;
  87887. if (!content) {
  87888. value = this.getValue();
  87889. }
  87890. this._sliderValue.innerHTML = value;
  87891. return this;
  87892. }
  87893. /**
  87894. * @function ChangeTileVersion.prototype.setToolTip
  87895. * @description 设置提示信息。
  87896. * @param {string} tooltip - 提示信息。
  87897. * @returns {ChangeTileVersion} ChangeTileVersion的实例对象。
  87898. */
  87899. }, {
  87900. key: "setToolTip",
  87901. value: function setToolTip(tooltip) {
  87902. this.tooltip.innerHTML = tooltip;
  87903. return this;
  87904. }
  87905. /**
  87906. * @function ChangeTileVersion.prototype.updateLength
  87907. * @description 更新进度条长度。
  87908. * @param {number} length - 进度条长度。
  87909. */
  87910. }, {
  87911. key: "updateLength",
  87912. value: function updateLength(length) {
  87913. if (length > 0) {
  87914. this.length = length;
  87915. this.max = this.length - 1;
  87916. this.slider.setAttribute('max', this.max);
  87917. }
  87918. }
  87919. /**
  87920. * @function ChangeTileVersion.prototype.setLayer
  87921. * @description 绑定图层。
  87922. * @param {Object} layer - 图层。
  87923. */
  87924. }, {
  87925. key: "setLayer",
  87926. value: function setLayer(layer) {
  87927. if (layer) {
  87928. this.options.layer = layer;
  87929. }
  87930. var me = this;
  87931. var tileLayer = me.options.layer;
  87932. tileLayer.on('tilesetsinfoloaded', function (evt) {
  87933. var tileVersions = evt.value && evt.value.tileVersions;
  87934. me.update(tileVersions);
  87935. });
  87936. tileLayer.on('tileversionschanged', function (evt) {
  87937. var tileVersions = evt.value && evt.value.tileVersion;
  87938. me.setContent(tileVersions);
  87939. });
  87940. me.getTileSetsInfo();
  87941. }
  87942. /**
  87943. * @function ChangeTileVersion.prototype.update
  87944. * @description 更新缓存切片集及进度条长度。
  87945. * @param {Object} tileVersions - 待更新的切片版本。
  87946. */
  87947. }, {
  87948. key: "update",
  87949. value: function update(tileVersions) {
  87950. this.tileVersions = tileVersions || [];
  87951. this.updateLength(this.tileVersions.length);
  87952. }
  87953. /**
  87954. * @function ChangeTileVersion.prototype.getTileSetsInfo
  87955. * @description 请求获取切片集信息。
  87956. */
  87957. }, {
  87958. key: "getTileSetsInfo",
  87959. value: function getTileSetsInfo() {
  87960. var me = this;
  87961. if (me.options.layer) {
  87962. new MapService(me.options.layer._url).getTilesets(function getTilesInfoSucceed(info) {
  87963. me.options.layer.setTileSetsInfo(info.result);
  87964. });
  87965. }
  87966. }
  87967. /**
  87968. * @function ChangeTileVersion.prototype.removeLayer
  87969. * @description 移除绑定的地图图层。
  87970. */
  87971. }, {
  87972. key: "removeLayer",
  87973. value: function removeLayer() {
  87974. this.options.layer = null;
  87975. }
  87976. /**
  87977. * @function ChangeTileVersion.prototype.nextTilesVersion
  87978. * @description 下一个版本,第一次不进行加减,是无版本的状态。
  87979. * @returns {ChangeTileVersion} ChangeTileVersion的实例对象。
  87980. */
  87981. }, {
  87982. key: "nextTilesVersion",
  87983. value: function nextTilesVersion() {
  87984. if (this.firstLoad) {
  87985. this.options.layer.nextTilesVersion();
  87986. this.firstLoad = !!0;
  87987. return this;
  87988. }
  87989. if (parseInt(this.slider.value) > this.max - 1) {
  87990. return this;
  87991. }
  87992. this.slider.value = parseInt(this.slider.value) + 1;
  87993. this.options.layer.nextTilesVersion();
  87994. return this;
  87995. }
  87996. /**
  87997. * @function ChangeTileVersion.prototype.lastTilesVersion
  87998. * @description 获取上一个版本信息。
  87999. * @returns {ChangeTileVersion} ChangeTileVersion的实例对象。
  88000. */
  88001. }, {
  88002. key: "lastTilesVersion",
  88003. value: function lastTilesVersion() {
  88004. if (parseInt(this.slider.value) < this.min + 1) {
  88005. return this;
  88006. }
  88007. this.slider.value = parseInt(this.slider.value) - 1;
  88008. this.options.layer.lastTilesVersion();
  88009. return this;
  88010. }
  88011. /**
  88012. * @function ChangeTileVersion.prototype.tilesVersion
  88013. * @description 根据指定版本号请求版本。
  88014. * @param {Object} version - 版本信息。
  88015. */
  88016. }, {
  88017. key: "tilesVersion",
  88018. value: function tilesVersion(version) {
  88019. var layer = this.options.layer,
  88020. tileVersions = this.tileVersions;
  88021. var len = tileVersions.length;
  88022. for (var i = 0; i < len; i++) {
  88023. if (tileVersions[i].name == version) {
  88024. layer.updateCurrentTileSetsIndex(i);
  88025. layer.changeTilesVersion();
  88026. break;
  88027. }
  88028. }
  88029. }
  88030. /**
  88031. * @function ChangeTileVersion.prototype.getValue
  88032. * @description 获取进度条的值。注:(进度条的值并不是版本号)。
  88033. */
  88034. }, {
  88035. key: "getValue",
  88036. value: function getValue() {
  88037. return this.slider.value;
  88038. }
  88039. /**
  88040. * @function ChangeTileVersion.prototype.getVersion
  88041. * @description 获取当前进度条值对应的版本号。
  88042. */
  88043. }, {
  88044. key: "getVersion",
  88045. value: function getVersion() {
  88046. var version = this.tileVersions[this.getValue()];
  88047. return version && version.name;
  88048. }
  88049. }]);
  88050. return ChangeTileVersion;
  88051. }((external_ol_control_Control_default()));
  88052. ;// CONCATENATED MODULE: external "ol.control.ScaleLine"
  88053. var external_ol_control_ScaleLine_namespaceObject = ol.control.ScaleLine;
  88054. var external_ol_control_ScaleLine_default = /*#__PURE__*/__webpack_require__.n(external_ol_control_ScaleLine_namespaceObject);
  88055. ;// CONCATENATED MODULE: external "ol.proj"
  88056. var external_ol_proj_namespaceObject = ol.proj;
  88057. ;// CONCATENATED MODULE: external "ol.AssertionError"
  88058. var external_ol_AssertionError_namespaceObject = ol.AssertionError;
  88059. var external_ol_AssertionError_default = /*#__PURE__*/__webpack_require__.n(external_ol_AssertionError_namespaceObject);
  88060. ;// CONCATENATED MODULE: ./src/openlayers/control/ScaleLine.js
  88061. function ScaleLine_typeof(obj) { "@babel/helpers - typeof"; return ScaleLine_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ScaleLine_typeof(obj); }
  88062. function ScaleLine_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  88063. function ScaleLine_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  88064. function ScaleLine_createClass(Constructor, protoProps, staticProps) { if (protoProps) ScaleLine_defineProperties(Constructor.prototype, protoProps); if (staticProps) ScaleLine_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  88065. function ScaleLine_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ScaleLine_setPrototypeOf(subClass, superClass); }
  88066. function ScaleLine_setPrototypeOf(o, p) { ScaleLine_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ScaleLine_setPrototypeOf(o, p); }
  88067. function ScaleLine_createSuper(Derived) { var hasNativeReflectConstruct = ScaleLine_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ScaleLine_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ScaleLine_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ScaleLine_possibleConstructorReturn(this, result); }; }
  88068. function ScaleLine_possibleConstructorReturn(self, call) { if (call && (ScaleLine_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ScaleLine_assertThisInitialized(self); }
  88069. function ScaleLine_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  88070. function ScaleLine_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  88071. function ScaleLine_getPrototypeOf(o) { ScaleLine_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ScaleLine_getPrototypeOf(o); }
  88072. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  88073. * This program are made available under the terms of the Apache License, Version 2.0
  88074. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  88075. /**
  88076. * @class ScaleLine
  88077. * @aliasclass control.ScaleLine
  88078. * @category Control
  88079. * @version 9.1.2
  88080. * @classdesc 比例尺控件。
  88081. * <div style="padding: 20px;border: 1px solid #eee;border-left-width: 5px;border-radius: 3px;border-left-color: #ce4844;">
  88082. * <p style="color: #ce4844">Notice</p>
  88083. * <p style="font-size: 13px">该功能继承 {@link ol.control.ScaleLine },与 {@link ol.control.ScaleLine } 功能完全相同。仅为修复 `openlayers` v4.6.5 版本中 WGS84 等地理坐标系比例尺数值错误的问题。
  88084. * </div>
  88085. * @modulecategory Control
  88086. * @extends {ol.control.ScaleLine}
  88087. * @param {Object} options -参数。
  88088. * @param {string} [options.className='ol-scale-line'] - CSS Class name.。
  88089. * @param {number} [options.minWidth=64] - 最小像素宽度。
  88090. * @param {(HTMLElement|string) } [options.target] - 指定比例尺控件目标容器。
  88091. * @param {(ol.control.ScaleLine.Units|string)} [options.units='metric'] - 上一个版本的按钮布局。
  88092. * @example
  88093. * var control = new ScaleLine();
  88094. * map.addControl(control)
  88095. * @usage
  88096. */
  88097. var ScaleLine = /*#__PURE__*/function (_Scale) {
  88098. ScaleLine_inherits(ScaleLine, _Scale);
  88099. var _super = ScaleLine_createSuper(ScaleLine);
  88100. function ScaleLine(options) {
  88101. ScaleLine_classCallCheck(this, ScaleLine);
  88102. options = options || {};
  88103. //需在super之前定义render,真正的调用是在初始化完成后
  88104. options.render = function (mapEvent) {
  88105. var frameState = mapEvent.frameState;
  88106. if (!frameState) {
  88107. this.viewState_ = null; //NOSONAR
  88108. } else {
  88109. this.viewState_ = frameState.viewState; //NOSONAR
  88110. }
  88111. this.updateElementRepair(); //NOSONAR
  88112. };
  88113. return _super.call(this, options); //NOSONAR
  88114. }
  88115. ScaleLine_createClass(ScaleLine, [{
  88116. key: "updateElementRepair",
  88117. value: function updateElementRepair() {
  88118. var viewState = this.viewState_ || this.o || this.Om;
  88119. if (!viewState) {
  88120. this.renderedVisible_ = this.renderedVisible_ || this.j || this.yn;
  88121. if (this.renderedVisible_) {
  88122. this.element_ = this.element_ || this.c;
  88123. this.element.style.display = 'none';
  88124. this.renderedVisible_ = false;
  88125. }
  88126. return;
  88127. }
  88128. var center = viewState.center;
  88129. var projection = viewState.projection;
  88130. var units = this.getUnits();
  88131. var pointResolutionUnits = units == "degrees" ? "degrees" : "m";
  88132. var pointResolution = external_ol_proj_namespaceObject.getPointResolution(projection, viewState.resolution, center, pointResolutionUnits);
  88133. this.minWidth_ = this.minWidth_ || this.v || this.Em;
  88134. var nominalCount = this.minWidth_ * pointResolution;
  88135. var suffix = '';
  88136. if (units == "degrees") {
  88137. var metersPerDegree = external_ol_proj_namespaceObject.METERS_PER_UNIT["degrees"];
  88138. nominalCount *= metersPerDegree;
  88139. if (nominalCount < metersPerDegree / 60) {
  88140. suffix = "\u2033"; // seconds
  88141. pointResolution *= 3600;
  88142. } else if (nominalCount < metersPerDegree) {
  88143. suffix = "\u2032"; // minutes
  88144. pointResolution *= 60;
  88145. } else {
  88146. suffix = "\xB0"; // degrees
  88147. }
  88148. } else if (units == "imperial") {
  88149. if (nominalCount < 0.9144) {
  88150. suffix = 'in';
  88151. pointResolution /= 0.0254;
  88152. } else if (nominalCount < 1609.344) {
  88153. suffix = 'ft';
  88154. pointResolution /= 0.3048;
  88155. } else {
  88156. suffix = 'mi';
  88157. pointResolution /= 1609.344;
  88158. }
  88159. } else if (units == "nautical") {
  88160. pointResolution /= 1852;
  88161. suffix = 'nm';
  88162. } else if (units == "metric") {
  88163. if (nominalCount < 0.001) {
  88164. suffix = 'μm';
  88165. pointResolution *= 1000000;
  88166. } else if (nominalCount < 1) {
  88167. suffix = 'mm';
  88168. pointResolution *= 1000;
  88169. } else if (nominalCount < 1000) {
  88170. suffix = 'm';
  88171. } else {
  88172. suffix = 'km';
  88173. pointResolution /= 1000;
  88174. }
  88175. } else if (units == "us") {
  88176. if (nominalCount < 0.9144) {
  88177. suffix = 'in';
  88178. pointResolution *= 39.37;
  88179. } else if (nominalCount < 1609.344) {
  88180. suffix = 'ft';
  88181. pointResolution /= 0.30480061;
  88182. } else {
  88183. suffix = 'mi';
  88184. pointResolution /= 1609.3472;
  88185. }
  88186. } else {
  88187. throw new (external_ol_AssertionError_default())(33); // Invalid units
  88188. }
  88189. var DIGITS = [1, 2, 5];
  88190. var i = 3 * Math.floor(Math.log(this.minWidth_ * pointResolution) / Math.log(10));
  88191. var count, width, decimalCount;
  88192. while (true) {
  88193. //eslint-disable-line no-constant-condition
  88194. decimalCount = Math.floor(i / 3);
  88195. var decimal = Math.pow(10, decimalCount);
  88196. count = DIGITS[(i % 3 + 3) % 3] * decimal;
  88197. width = Math.round(count / pointResolution);
  88198. if (isNaN(width)) {
  88199. this.element.style.display = 'none';
  88200. this.renderedVisible_ = false;
  88201. return;
  88202. } else if (width >= this.minWidth_) {
  88203. break;
  88204. }
  88205. ++i;
  88206. }
  88207. this.renderedHTML_ = this.renderedHTML_ || this.D || this.am;
  88208. this.innerElement_ = this.innerElement_ || this.l || this.Tm;
  88209. this.renderedWidth_ = this.renderedWidth_ || this.B || this.Am;
  88210. this.renderedVisible_ = this.renderedVisible_ || this.j || this.yn;
  88211. this.element_ = this.element_ || this.c;
  88212. var html = count.toFixed(decimalCount < 0 ? -decimalCount : 0) + ' ' + suffix;
  88213. if (this.renderedHTML_ != html) {
  88214. this.innerElement_.innerHTML = html;
  88215. this.renderedHTML_ = html;
  88216. }
  88217. if (this.renderedWidth_ != width) {
  88218. this.innerElement_.style.width = width + 'px';
  88219. this.renderedWidth_ = width;
  88220. }
  88221. if (!this.renderedVisible_) {
  88222. this.element.style.display = '';
  88223. this.renderedVisible_ = true;
  88224. }
  88225. }
  88226. }]);
  88227. return ScaleLine;
  88228. }((external_ol_control_ScaleLine_default()));
  88229. ;// CONCATENATED MODULE: ./src/common/control/img/Logo.js
  88230. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  88231. * This program are made available under the terms of the Apache License, Version 2.0
  88232. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  88233. var LogoBase64 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF4AAAAdCAYAAAAjHtusAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDY3IDc5LjE1Nzc0NywgMjAxNS8wMy8zMC0yMzo0MDo0MiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozYWZlOGIwMi01MWE3LTRiZjYtYWVkYS05MGQ2ZTQ4YjZiMmUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODg0NkFBQUE3RjEzMTFFNzhFRjJFQkY4RjcxQjc1NjIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODg0NkFBQTk3RjEzMTFFNzhFRjJFQkY4RjcxQjc1NjIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4MWI3NzdhNC1lZmEyLTQ1MzUtOGQzNi03MmRjNDkyODMzN2UiIHN0UmVmOmRvY3VtZW50SUQ9ImFkb2JlOmRvY2lkOnBob3Rvc2hvcDpjYTYzODVjMi1jNDQ1LTExN2EtYTc0ZC1lM2I5MzJlMGE4Y2QiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5q1HM0AAAF/ElEQVR42tSabYhUVRjHZ7W01C1uaCRW4F3oi9SXCUnwQ9gsGUFvOEtQH1bLu5VS9sbYh5KicjYt29qiGQwVg2xWWKgocob91AvC+CWsoJqB3qHMSdTMpZyeU/+Df07n3pk7997Z6cBv99z7nHvOvf/z/pxJNZvNVI/jCKXmv6EquAmVkxPSlvtp2GItr0/96fFQForChJAWDiVYTkMYMu4XBFcYjLOwWS3sNwmn8NGzZ0h4Flv/zwIdchAnh/slCGmmKUNIBzYPaXOUr0vPuEjD71JAPh7l61embzinhV3V8nnCGmGT8LwlzSL8/yUh4Tfjo9T/CgnCIYNKycA2Qq21AcHU/VHE80Idoo3Qs0W6p0UtUnkZvEMDeVcCyqxEafF7hL8Qf0oYsIj+lfC9cH1CwhchWAGCtZO+AooQOkdC1Km1VtCb63StW73uFSzgKFUkNwBbmZGGmqowhvg8ZNpH9oXChcIcYRdeNomgxLkaH+S1SGubAxyIpFv+Zp+0DYjrAS00j/dem2VGEl6FJ4Qa4quEu8j2hTCJ+GJhe4JjfQMf6JCYPPbysMPxBlp0BUKOogEF9Rg9/heNvNKYfM0KsZUZaYxX4STGrzJa+zbhPeFH2DcK10KItcI+pI0rVElwXl1ULaKnIJhDw0oRQpTQc1zcbwRU8ATy4DR6yMlTzwkqMziEWHvubJ4Nk4ZtHdnqwvwY17xq3Z4FjrG+z2Kdrdf2ZSGD+xlLPh6t1R0jP9fI22ZzKI92yvQl7EbmBxI4S7Y+vIAOL87QZqsc5uNnssxZIcfYjXT9snCR7jjobidp+FkxA2v+Cq1QervMDmp4P7Xs3YZtE9kOC3P/By6JGaETl8ElwueYTNTDq4UDsKnd7YfCNbT239LF1udS72xYJt1UWxNfN4IIP4bWuTpEja01JtMFZFsm/AHbtHBlDE6yasA4moYTrUbvdBTXHqUrAH4uSadbyzF+vbBM2IsNkS3MNa5305JxqfA02T4TnkX8XOH1mPw8ruVejpxbI9hZD2Cz1U7LdrrUvjP/WfZinNZhr6V27hP+FPZh9aLvLxVO4DllX0G2OcKnlO/DCblxaz6uXBtmi+8mBaP3/SP8IuEIiTRoPPQm2TaEmEyXo0JU+F0YiPFD0hhOsiE/vqeEVwyTgF8L51OilcIZ2I4Ll5NttvAJPfukUeB2sk0ZPSbKIUUJpCII7+DasWy08uhNNazT0wGHI7mAtB7KqMKm38HhDdAUibTVKGicbB8YAqrJ9DRsp43JdB4qUof1HQrPE6XTQWu3Ce/inVzjXhXpMiTwUYugNVQ+p80jrUsV5EH0POKeuXO9QjhFq5GryNYvfEMCDhsftYVsB9ETtG0V9ZjfhCURhbcJFpfwVZ9jvhxsLHwTYtp2svlWQw3vXL8UnqHVSIG8l8ex+tHhBXgjddgqHEZ8ufAA2aaEnYgrF/KrPXrEmMUqZ9THLW06xhoBaVueQpkug+ewOUphE3Qv2Q5gGamXYa+QbVq4O+DQ5FHyZqrjxNt7UHh9uuRa0F7HjCF8o9PCTOGnscM7g2u1Hl9C9oeEnxC/1ajZg8JLiM9Hj9GHJseMShwL2DO0G5yEWn3Zh1QUods5CPkIoqlwAZxhXMsb6HrcEPBxchhdJ6wj29vCW4hfLOzo8J3rltYX50nXQAATSf/K4DEaGlTLvplsk/QCpoD60EQ7gLYZc8H9wq+I3yncEOEcNhuz6HWf3XEiwU/4Y8YEqVp2P10rt+8REvBGw026i4aDcbL9jF8r8Blmf4fCOzhViiscskygXRdehf3CO4hfigmTBXyQrl8TFtD1IzQX3CbcQrY3hPcRv4z8OmHPXwchVNln2MmE7BX6VwIFi/he6uxvb6JM3m0fdqvx/ATidxg2JeC7VDErAw5NzGfvwRJVheEIQ8Mg/pdwIM+UOmi9Q8ivCsrIy0tF+wVbEcLrd3Pb2XisEb4Tdlhsi4WP4RBbaLGrHfC3PrvMIezy9rTpGm5lz9LOMG15xvFxD/j5gjzjjDbMOzk+9zzt3v5bgAEAibzFeFHVgYkAAAAASUVORK5CYII=";
  88234. ;// CONCATENATED MODULE: ./src/openlayers/control/Logo.js
  88235. function Logo_typeof(obj) { "@babel/helpers - typeof"; return Logo_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Logo_typeof(obj); }
  88236. function Logo_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  88237. function Logo_createClass(Constructor, protoProps, staticProps) { if (protoProps) Logo_defineProperties(Constructor.prototype, protoProps); if (staticProps) Logo_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  88238. function Logo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  88239. function Logo_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Logo_setPrototypeOf(subClass, superClass); }
  88240. function Logo_setPrototypeOf(o, p) { Logo_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Logo_setPrototypeOf(o, p); }
  88241. function Logo_createSuper(Derived) { var hasNativeReflectConstruct = Logo_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Logo_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Logo_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Logo_possibleConstructorReturn(this, result); }; }
  88242. function Logo_possibleConstructorReturn(self, call) { if (call && (Logo_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Logo_assertThisInitialized(self); }
  88243. function Logo_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  88244. function Logo_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  88245. function Logo_getPrototypeOf(o) { Logo_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Logo_getPrototypeOf(o); }
  88246. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  88247. * This program are made available under the terms of the Apache License, Version 2.0
  88248. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  88249. /**
  88250. * @class Logo
  88251. * @aliasclass control.Logo
  88252. * @category Control
  88253. * @classdesc Logo控件。默认不显示,需手动添加控件。
  88254. * @modulecategory Control
  88255. * @extends {ol.control.Control}
  88256. * @example
  88257. * var control = new Logo();
  88258. * map.addControl(control);
  88259. * @param {Object} options - 参数。
  88260. * @param {string} [options.imageUrl] - logo 图片地址。
  88261. * @param {number} [options.width] - logo 图片宽。
  88262. * @param {number} [options.height] - logo 图片高。
  88263. * @param {string} [options.link='https://iclient.supermap.io'] - 跳转链接。
  88264. * @param {string} [options.alt='SuperMap iClient'] - logo 图片失效时显示文本。
  88265. * @usage
  88266. */
  88267. var Logo = /*#__PURE__*/function (_Control) {
  88268. Logo_inherits(Logo, _Control);
  88269. var _super = Logo_createSuper(Logo);
  88270. function Logo(options) {
  88271. var _this;
  88272. Logo_classCallCheck(this, Logo);
  88273. options = options || {};
  88274. options.imageUrl = options.imageUrl || null;
  88275. options.width = options.width || null;
  88276. options.height = options.height || null;
  88277. options.alt = options.alt || "SuperMap iClient";
  88278. _this = _super.call(this, options);
  88279. _this.options = options;
  88280. _this.element = options.element = initLayerout.call(Logo_assertThisInitialized(_this));
  88281. /**
  88282. * @function Logo.prototype.initLayerout
  88283. * @description 初始化图层信息。
  88284. */
  88285. function initLayerout() {
  88286. var className = 'ol-control-logo ol-unselectable ol-control';
  88287. var div = document.createElement("div");
  88288. div.className = className;
  88289. setDivStyle.call(this, div);
  88290. var imgSrc = LogoBase64;
  88291. if (this.options.imageUrl) {
  88292. imgSrc = this.options.imageUrl;
  88293. }
  88294. var alt = this.options.alt;
  88295. var link = this.options.link;
  88296. var imageWidth = "94px";
  88297. var imageHeight = "29px";
  88298. var styleSize = "width:" + imageWidth + ";height:" + imageHeight + ";";
  88299. if (this.options.imageUrl) {
  88300. imageWidth = this.options.width;
  88301. imageHeight = this.options.height;
  88302. styleSize = "width:" + imageWidth + ";height:" + imageHeight + ";";
  88303. if (!imageWidth || !imageHeight) {
  88304. styleSize = "";
  88305. }
  88306. }
  88307. div.innerHTML = "<a href='" + link + "' target='_blank' style='border: none;display: block;'>" + "<img src=" + imgSrc + " alt='" + alt + "' style='border: none;" + styleSize + "white-space: nowrap;margin-bottom: 2px'></a>";
  88308. return div;
  88309. }
  88310. /**
  88311. * @function Logo.prototype.setDivStyle
  88312. * @description 设置对象 style。
  88313. * @param {HTMLElement} div - 待设置的 div。
  88314. */
  88315. function setDivStyle(div) {
  88316. var attributionsElem = document.getElementsByClassName('ol-attribution');
  88317. attributionsElem = attributionsElem && attributionsElem[0];
  88318. var attrHeight = attributionsElem && attributionsElem.clientHeight || 29;
  88319. div.style.bottom = parseInt(attrHeight) + 6 + "px";
  88320. div.style.right = "4px";
  88321. div.style.marginTop = 0;
  88322. div.style.marginLeft = 0;
  88323. div.style.marginBottom = 0;
  88324. div.style.marginRight = 0;
  88325. var logoStyle = document.createElement('style');
  88326. logoStyle.type = 'text/css';
  88327. logoStyle.innerHTML = '.ol-control-logo,.ol-control-logo:hover {' + 'background-color: rgba(255,255,255,0);' + '}';
  88328. document.getElementsByTagName('head')[0].appendChild(logoStyle);
  88329. }
  88330. return _this;
  88331. }
  88332. return Logo_createClass(Logo);
  88333. }((external_ol_control_Control_default()));
  88334. ;// CONCATENATED MODULE: ./src/openlayers/control/index.js
  88335. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  88336. * This program are made available under the terms of the Apache License, Version 2.0
  88337. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  88338. ;// CONCATENATED MODULE: ./src/openlayers/overlay/vectortile/StyleMap.js
  88339. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  88340. * This program are made available under the terms of the Apache License, Version 2.0
  88341. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  88342. /**
  88343. * @constant pointMap
  88344. * @description 点图。
  88345. * @private
  88346. */
  88347. var pointMap = {
  88348. "point-file": "pointFile",
  88349. "point-fill": "fillStyle",
  88350. "point-radius": "pointRadius",
  88351. "point-halo-radius": "pointHaloRadius",
  88352. "point-halo-color": "pointHaloColor",
  88353. "point-dx": "offsetX",
  88354. "point-dy": "offsetY",
  88355. "point-opacity": "globalAlpha",
  88356. "point-comp-op": "globalCompositeOperation"
  88357. };
  88358. /**
  88359. * @constant lineMap
  88360. * @description 线图。
  88361. * @private
  88362. */
  88363. var lineMap = {
  88364. "line-color": "strokeStyle",
  88365. "line-width": "lineWidth",
  88366. "line-cap": "lineCap",
  88367. "line-join": "lineJoin",
  88368. "line-miterlimit": "miterLimit",
  88369. "line-dash-offset": "lineDashOffset",
  88370. /*expand*/
  88371. "line-opacity": "strokeOpacity",
  88372. "line-dasharray": "lineDasharray",
  88373. "line-offset": "offset",
  88374. "line-comp-op": "globalCompositeOperation"
  88375. };
  88376. /**
  88377. * @constant polygonMap
  88378. * @description 面图。
  88379. * @private
  88380. */
  88381. var polygonMap = {
  88382. /*包括LINE的部分,用以设置面的外围边界*/
  88383. "line-color": "strokeStyle",
  88384. "line-width": "lineWidth",
  88385. "line-cap": "lineCap",
  88386. "line-join": "lineJoin",
  88387. "line-miterlimit": "miterLimit",
  88388. "line-dash-offset": "lineDashOffset",
  88389. /*expand*/
  88390. "line-opacity": "strokeOpacity",
  88391. "line-dasharray": "lineDasharray",
  88392. /*以下为面的特性*/
  88393. "polygon-fill": "fillStyle",
  88394. "polygon-dx": "offsetX",
  88395. "polygon-dy": "offsetY",
  88396. "polygon-opacity": "fillOpacity",
  88397. "polygon-comp-op": "globalCompositeOperation"
  88398. };
  88399. /**
  88400. * @enum StyleMap {Object}
  88401. * @description 地图样式。
  88402. * @category BaseTypes Constant
  88403. * @usage
  88404. * ```
  88405. * // 浏览器
  88406. * <script type="text/javascript" src="{cdn}"></script>
  88407. * <script>
  88408. * const result = {namespace}.StyleMap.CartoStyleMap;
  88409. *
  88410. * </script>
  88411. * // ES6 Import
  88412. * import { StyleMap } from '{npm}';
  88413. *
  88414. * const result = StyleMap.CartoStyleMap;
  88415. * ```
  88416. */
  88417. var StyleMap = {
  88418. /** CartoCSS 中的 style 属性名与 Canvas 的 style 属性名的对应表 */
  88419. CartoStyleMap: {
  88420. "TEXT": {
  88421. //前两个属性值组成font
  88422. "text-size": "fontSize",
  88423. "text-face-name": "fontFamily",
  88424. "text-align": "textAlign",
  88425. "text-vertical-alignment": "textBaseline",
  88426. "text-horizontal-alignment": "textAlign",
  88427. /*expand*/
  88428. 'text-bold': 'bold',
  88429. 'text-weight': 'fontWeight',
  88430. "text-name": "textName",
  88431. "text-halo-radius": "haloRadius",
  88432. "text-halo-color": "backColor",
  88433. "text-fill": "foreColor",
  88434. "text-opacity": "globalAlpha",
  88435. "text-dx": "offsetX",
  88436. "text-dy": "offsetY",
  88437. "text-comp-op": "globalCompositeOperation"
  88438. },
  88439. /*expand*/
  88440. "POINT": pointMap,
  88441. "MULTIPOINT": pointMap,
  88442. "LINE": lineMap,
  88443. "LINESTRING": lineMap,
  88444. "MULTILINESTRING": lineMap,
  88445. "REGION": polygonMap,
  88446. "POLYGON": polygonMap,
  88447. "MULTIPOLYGON": polygonMap
  88448. },
  88449. /** 服务端传过来的 style 属性名与 Canvas 的 style 属性名的对应表。 */
  88450. ServerStyleMap: {
  88451. fillBackOpaque: {
  88452. canvasStyle: "",
  88453. type: "bool",
  88454. defaultValue: true
  88455. },
  88456. lineWidth: {
  88457. canvasStyle: "lineWidth",
  88458. type: "number",
  88459. unit: "mm",
  88460. defaultValue: 0.1
  88461. },
  88462. fillBackColor: {
  88463. canvasStyle: "",
  88464. type: "color",
  88465. defaultValue: "rgba(0,0,0,0)"
  88466. },
  88467. markerWidth: {
  88468. canvasStyle: "",
  88469. type: "number",
  88470. unit: "mm",
  88471. defaultValue: ""
  88472. },
  88473. markerAngle: {
  88474. canvasStyle: "",
  88475. type: "number",
  88476. unit: "degree",
  88477. defaultValue: ""
  88478. },
  88479. fillForeColor: {
  88480. canvasStyle: "fillStyle",
  88481. type: "color",
  88482. defaultValue: "rgba(0,0,0,0)"
  88483. },
  88484. foreColor: {
  88485. canvasStyle: "fillStyle",
  88486. type: "color",
  88487. defaultValue: "rgba(0,0,0,0)"
  88488. },
  88489. markerSize: {
  88490. canvasStyle: "markerSize",
  88491. type: "number",
  88492. unit: "mm",
  88493. defaultValue: 2.4
  88494. },
  88495. fillGradientOffsetRatioX: {
  88496. canvasStyle: "",
  88497. type: "number",
  88498. defaultValue: 0
  88499. },
  88500. fillGradientOffsetRatioY: {
  88501. canvasStyle: "",
  88502. type: "number",
  88503. defaultValue: 0
  88504. },
  88505. lineColor: {
  88506. canvasStyle: "strokeStyle",
  88507. type: "color",
  88508. defaultValue: "rgba(0,0,0,0)"
  88509. },
  88510. fillOpaqueRate: {
  88511. canvasStyle: "",
  88512. type: "number",
  88513. defaultValue: 100
  88514. },
  88515. markerHeight: {
  88516. canvasStyle: "",
  88517. type: "number",
  88518. unit: "mm",
  88519. defaultValue: 0
  88520. },
  88521. fillGradientMode: {
  88522. canvasStyle: "",
  88523. type: "string",
  88524. defaultValue: "NONE"
  88525. },
  88526. fillSymbolID: {
  88527. canvasStyle: "",
  88528. type: "number",
  88529. defaultValue: 0
  88530. },
  88531. fillGradientAngle: {
  88532. canvasStyle: "",
  88533. type: "number",
  88534. unit: "degree",
  88535. defaultValue: 0
  88536. },
  88537. markerSymbolID: {
  88538. canvasStyle: "",
  88539. type: "number",
  88540. defaultValue: 0
  88541. },
  88542. lineSymbolID: {
  88543. canvasStyle: "",
  88544. type: "number",
  88545. defaultValue: 0
  88546. }
  88547. },
  88548. /** Canvas 中的 globalCompositeOperation 属性值与 CartoCSS 中的 CompOp 属性值对照表。 */
  88549. CartoCompOpMap: {
  88550. "clear": "",
  88551. "src": "",
  88552. "dst": "",
  88553. "src-over": "source-over",
  88554. "dst-over": "destination-over",
  88555. "src-in": "source-in",
  88556. "dst-in": "destination-in",
  88557. "src-out": "source-out",
  88558. "dst-out": "destination-out",
  88559. "src-atop": "source-atop",
  88560. "dst-atop": "destination-atop",
  88561. "xor": "xor",
  88562. "plus": "lighter",
  88563. "minus": "",
  88564. "multiply": "",
  88565. "screen": "",
  88566. "overlay": "",
  88567. "darken": "",
  88568. "lighten": "lighter",
  88569. "color-dodge": "",
  88570. "color-burn": "",
  88571. "hard-light": "",
  88572. "soft-light": "",
  88573. "difference": "",
  88574. "exclusion": "",
  88575. "contrast": "",
  88576. "invert": "",
  88577. "invert-rgb": "",
  88578. "grain-merge": "",
  88579. "grain-extract": "",
  88580. "hue": "",
  88581. "saturation": "",
  88582. "color": "",
  88583. "value": ""
  88584. }
  88585. };
  88586. ;// CONCATENATED MODULE: ./src/openlayers/overlay/vectortile/DeafultCanvasStyle.js
  88587. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  88588. * This program are made available under the terms of the Apache License, Version 2.0
  88589. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  88590. /**
  88591. * @constant pointStyle
  88592. * @description 点属性名的对应表。
  88593. * @private
  88594. */
  88595. var pointStyle = {
  88596. pointFile: "",
  88597. /*expand*/
  88598. pointRadius: 3,
  88599. pointHaloRadius: 1,
  88600. pointHaloColor: "#c33",
  88601. offsetX: 0,
  88602. offsetY: 0,
  88603. fillStyle: "#fc0",
  88604. globalAlpha: 1,
  88605. globalCompositeOperation: "source-over",
  88606. imageSmoothingEnabled: true
  88607. };
  88608. /**
  88609. * @constant lineStyle
  88610. * @description 线属性名的对应表。
  88611. * @private
  88612. */
  88613. var lineStyle = {
  88614. strokeStyle: "rgba(0,0,0,0)",
  88615. lineWidth: 1,
  88616. lineCap: "butt",
  88617. lineJoin: "round",
  88618. miterLimit: 10,
  88619. lineDashOffset: 0,
  88620. /*expand*/
  88621. lineDasharray: [],
  88622. strokeOpacity: 1,
  88623. offset: 0,
  88624. globalAlpha: 1,
  88625. globalCompositeOperation: "source-over",
  88626. imageSmoothingEnabled: true
  88627. };
  88628. /**
  88629. * @constant polygonStyle
  88630. * @description 面属性名的对应表。
  88631. * @private
  88632. */
  88633. var polygonStyle = {
  88634. /*包含LINE的部分*/
  88635. strokeStyle: "rgba(0,0,0,0)",
  88636. lineWidth: 1,
  88637. lineCap: "butt",
  88638. lineJoin: "round",
  88639. miterLimit: 10,
  88640. lineDashOffset: 0,
  88641. /*expand*/
  88642. lineOpacity: 1,
  88643. fillOpacity: 1,
  88644. lineDasharray: [],
  88645. fillStyle: "rgba(0,0,0,0)",
  88646. polygonOpacity: 1,
  88647. /*expand*/
  88648. offsetX: 0,
  88649. offsetY: 0,
  88650. globalAlpha: 1,
  88651. globalCompositeOperation: "source-over",
  88652. imageSmoothingEnabled: true
  88653. };
  88654. /**
  88655. * @constant DeafultCanvasStyle
  88656. * @description 默认画布属性名的对应表。
  88657. * @private
  88658. */
  88659. var DeafultCanvasStyle = {
  88660. /**
  88661. * @constant DeafultCanvasStyle.prototype.TEXT
  88662. * @description 默认文本样式。
  88663. */
  88664. "TEXT": {
  88665. font: "10px sans-serif",
  88666. textAlign: "middle",
  88667. textBaseline: "center",
  88668. direction: "ltr",
  88669. /*expand*/
  88670. bold: false,
  88671. haloRadius: 0,
  88672. backColor: "rgba(255,255,255,1)",
  88673. foreColor: "rgba(0,0,0,1)",
  88674. // foreColor: "rgba(0,0,0,0)",
  88675. offsetX: 0,
  88676. offsetY: 0,
  88677. textHeight: 0,
  88678. globalAlpha: 1,
  88679. globalCompositeOperation: "source-over",
  88680. imageSmoothingEnabled: true
  88681. },
  88682. "POINT": pointStyle,
  88683. "MULTIPOINT": pointStyle,
  88684. "LINE": lineStyle,
  88685. "LINESTRING": lineStyle,
  88686. "MULTILINESTRING": lineStyle,
  88687. "REGION": polygonStyle,
  88688. "POLYGON": polygonStyle,
  88689. "MULTIPOLYGON": polygonStyle,
  88690. "SHADOW": {
  88691. shadowBlur: 0,
  88692. shadowColor: "rgba(0,0,0,0)",
  88693. shadowOffsetX: 0,
  88694. shadowOffsetY: 0
  88695. },
  88696. "GLOBAL": {
  88697. globalAlpha: 1,
  88698. globalCompositeOperation: "source-over",
  88699. imageSmoothingEnabled: true
  88700. }
  88701. };
  88702. ;// CONCATENATED MODULE: external "ol.util"
  88703. var external_ol_util_namespaceObject = ol.util;
  88704. ;// CONCATENATED MODULE: external "ol.geom.Geometry"
  88705. var external_ol_geom_Geometry_namespaceObject = ol.geom.Geometry;
  88706. var external_ol_geom_Geometry_default = /*#__PURE__*/__webpack_require__.n(external_ol_geom_Geometry_namespaceObject);
  88707. ;// CONCATENATED MODULE: external "ol.render"
  88708. var external_ol_render_namespaceObject = ol.render;
  88709. ;// CONCATENATED MODULE: external "ol.source.Vector"
  88710. var external_ol_source_Vector_namespaceObject = ol.source.Vector;
  88711. var external_ol_source_Vector_default = /*#__PURE__*/__webpack_require__.n(external_ol_source_Vector_namespaceObject);
  88712. ;// CONCATENATED MODULE: external "ol.layer.Vector"
  88713. var external_ol_layer_Vector_namespaceObject = ol.layer.Vector;
  88714. var external_ol_layer_Vector_default = /*#__PURE__*/__webpack_require__.n(external_ol_layer_Vector_namespaceObject);
  88715. ;// CONCATENATED MODULE: external "ol.style"
  88716. var external_ol_style_namespaceObject = ol.style;
  88717. ;// CONCATENATED MODULE: external "ol.Feature"
  88718. var external_ol_Feature_namespaceObject = ol.Feature;
  88719. var external_ol_Feature_default = /*#__PURE__*/__webpack_require__.n(external_ol_Feature_namespaceObject);
  88720. ;// CONCATENATED MODULE: external "ol.proj.Projection"
  88721. var external_ol_proj_Projection_namespaceObject = ol.proj.Projection;
  88722. var external_ol_proj_Projection_default = /*#__PURE__*/__webpack_require__.n(external_ol_proj_Projection_namespaceObject);
  88723. ;// CONCATENATED MODULE: ./src/openlayers/core/Util.js
  88724. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  88725. * This program are made available under the terms of the Apache License, Version 2.0
  88726. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  88727. /**
  88728. * @name Util
  88729. * @namespace
  88730. * @category BaseTypes Util
  88731. * @classdesc 工具类。
  88732. * @usage
  88733. * ```
  88734. * // 浏览器
  88735. * <script type="text/javascript" src="{cdn}"></script>
  88736. * <script>
  88737. * const result = {namespace}.Util.getOlVersion();
  88738. *
  88739. * </script>
  88740. *
  88741. * // ES6 Import
  88742. * import { Util } from '{npm}';
  88743. *
  88744. * const result = Util.getOlVersion();
  88745. * ```
  88746. */
  88747. var core_Util_Util = {
  88748. getOlVersion: function getOlVersion() {
  88749. if (external_ol_util_namespaceObject && external_ol_util_namespaceObject.VERSION) {
  88750. return external_ol_util_namespaceObject.VERSION.split('.')[0];
  88751. }
  88752. if (window && window.ol) {
  88753. if (window.ol.util) {
  88754. return '6';
  88755. }
  88756. if (window.ol.WebGLMap) {
  88757. return '5';
  88758. }
  88759. }
  88760. return '4';
  88761. },
  88762. /**
  88763. * @function Util.toGeoJSON
  88764. * @description 将传入对象转为 GeoJSON 格式。
  88765. * @param {Object} smObj - 待转参数。
  88766. */
  88767. toGeoJSON: function toGeoJSON(smObj) {
  88768. if (!smObj) {
  88769. return null;
  88770. }
  88771. return new GeoJSON().toGeoJSON(smObj);
  88772. },
  88773. /**
  88774. * @function Util.toSuperMapGeometry
  88775. * @description 将 GeoJSON 对象转为 SuperMap 几何图形。
  88776. * @param {GeoJSONObject} geoJSON - GeoJSON 对象。
  88777. */
  88778. toSuperMapGeometry: function toSuperMapGeometry(geoJSON) {
  88779. if (!geoJSON || !geoJSON.type) {
  88780. return null;
  88781. }
  88782. var result = new GeoJSON().read(geoJSON, 'FeatureCollection');
  88783. return result[0].geometry;
  88784. },
  88785. /**
  88786. * @function Util.resolutionToScale
  88787. * @description 通过分辨率计算比例尺。
  88788. * @param {number} resolution - 分辨率。
  88789. * @param {number} dpi - 屏幕分辨率。
  88790. * @param {string} mapUnit - 地图单位。
  88791. * @returns {number} 比例尺。
  88792. */
  88793. resolutionToScale: function resolutionToScale(resolution, dpi, mapUnit) {
  88794. var inchPerMeter = 1 / 0.0254;
  88795. // 地球半径。
  88796. var meterPerMapUnit = getMeterPerMapUnit(mapUnit);
  88797. var scale = 1 / (resolution * dpi * inchPerMeter * meterPerMapUnit);
  88798. return scale;
  88799. },
  88800. /**
  88801. * @function Util.toSuperMapBounds
  88802. * @description 转为 SuperMapBounds 格式。
  88803. * @param {Array.<number>} bounds - bounds 数组。
  88804. * @returns {Bounds} 返回 SuperMap 的 Bounds 对象。
  88805. */
  88806. toSuperMapBounds: function toSuperMapBounds(bounds) {
  88807. return new Bounds(bounds[0], bounds[1], bounds[2], bounds[3]);
  88808. },
  88809. /**
  88810. * @function Util.toProcessingParam
  88811. * @description 将 Region 节点数组转为 Processing 服务需要的分析参数。
  88812. * @param {Array} points - Region 各个节点数组。
  88813. * @returns processing 服务裁剪、查询分析的分析参数。
  88814. */
  88815. toProcessingParam: function toProcessingParam(points) {
  88816. if (points.length < 1) {
  88817. return '';
  88818. }
  88819. var geometryParam = {};
  88820. var results = [];
  88821. for (var i = 0; i < points.length; i++) {
  88822. var point = {
  88823. x: points[i][0],
  88824. y: points[i][1]
  88825. };
  88826. results.push(point);
  88827. }
  88828. results.push(results[0]);
  88829. geometryParam.type = 'REGION';
  88830. geometryParam.points = results;
  88831. return geometryParam;
  88832. },
  88833. /**
  88834. * @function Util.scaleToResolution
  88835. * @description 通过比例尺计算分辨率。
  88836. * @param {number} scale - 比例尺。
  88837. * @param {number} dpi - 屏幕分辨率。
  88838. * @param {string} mapUnit - 地图单位。
  88839. * @returns {number} 分辨率。
  88840. */
  88841. scaleToResolution: function scaleToResolution(scale, dpi, mapUnit) {
  88842. var inchPerMeter = 1 / 0.0254;
  88843. var meterPerMapUnitValue = getMeterPerMapUnit(mapUnit);
  88844. var resolution = 1 / (scale * dpi * inchPerMeter * meterPerMapUnitValue);
  88845. return resolution;
  88846. },
  88847. /**
  88848. * @private
  88849. * @function Util.getMeterPerMapUnit
  88850. * @description 获取每地图单位多少米。
  88851. * @param {string} mapUnit - 地图单位。
  88852. * @returns {number} 返回每地图单位多少米。
  88853. */
  88854. getMeterPerMapUnit: getMeterPerMapUnit,
  88855. /**
  88856. * @function Util.isArray
  88857. * @description 判断是否为数组格式。
  88858. * @param {Object} obj - 待判断对象。
  88859. * @returns {boolean} 是否是数组。
  88860. */
  88861. isArray: isArray,
  88862. /**
  88863. * @function Util.Csv2GeoJSON
  88864. * @description 将 csv 格式转为 GeoJSON。
  88865. * @param {Object} csv - csv 对象。
  88866. * @param {Object} options - 转换参数。
  88867. */
  88868. Csv2GeoJSON: function Csv2GeoJSON(csv, options) {
  88869. var defaultOptions = {
  88870. titles: ['lon', 'lat'],
  88871. latitudeTitle: 'lat',
  88872. longitudeTitle: 'lon',
  88873. fieldSeparator: ',',
  88874. lineSeparator: '\n',
  88875. deleteDoubleQuotes: true,
  88876. firstLineTitles: false
  88877. };
  88878. options = options || defaultOptions;
  88879. var _propertiesNames = [];
  88880. if (typeof csv === 'string') {
  88881. var titulos = options.titles;
  88882. if (options.firstLineTitles) {
  88883. csv = csv.split(options.lineSeparator);
  88884. if (csv.length < 2) {
  88885. return;
  88886. }
  88887. titulos = csv[0];
  88888. csv.splice(0, 1);
  88889. csv = csv.join(options.lineSeparator);
  88890. titulos = titulos.trim().split(options.fieldSeparator);
  88891. for (var i = 0; i < titulos.length; i++) {
  88892. titulos[i] = _deleteDoubleQuotes(titulos[i]);
  88893. }
  88894. options.titles = titulos;
  88895. }
  88896. for (var _i2 = 0; _i2 < titulos.length; _i2++) {
  88897. var prop = titulos[_i2].toLowerCase().replace(/[^\w ]+/g, '').replace(/ +/g, '_');
  88898. if (prop === '' || prop === '_') {
  88899. prop = "prop-".concat(_i2);
  88900. }
  88901. _propertiesNames[_i2] = prop;
  88902. }
  88903. csv = _csv2json(csv);
  88904. }
  88905. return csv;
  88906. function _deleteDoubleQuotes(cadena) {
  88907. if (options.deleteDoubleQuotes) {
  88908. cadena = cadena.trim().replace(/^"/, '').replace(/"$/, '');
  88909. }
  88910. return cadena;
  88911. }
  88912. function _csv2json(csv) {
  88913. var json = {};
  88914. json['type'] = 'FeatureCollection';
  88915. json['features'] = [];
  88916. var titulos = options.titles;
  88917. csv = csv.split(options.lineSeparator);
  88918. for (var num_linea = 0; num_linea < csv.length; num_linea++) {
  88919. var campos = csv[num_linea].trim().split(options.fieldSeparator),
  88920. lng = parseFloat(campos[titulos.indexOf(options.longitudeTitle)]),
  88921. lat = parseFloat(campos[titulos.indexOf(options.latitudeTitle)]);
  88922. var isInRange = lng < 180 && lng > -180 && lat < 90 && lat > -90;
  88923. if (!(campos.length === titulos.length && isInRange)) {
  88924. continue;
  88925. }
  88926. var feature = {};
  88927. feature['type'] = 'Feature';
  88928. feature['geometry'] = {};
  88929. feature['properties'] = {};
  88930. feature['geometry']['type'] = 'Point';
  88931. feature['geometry']['coordinates'] = [lng, lat];
  88932. for (var _i4 = 0; _i4 < titulos.length; _i4++) {
  88933. if (titulos[_i4] !== options.latitudeTitle && titulos[_i4] !== options.longitudeTitle) {
  88934. feature['properties'][_propertiesNames[_i4]] = _deleteDoubleQuotes(campos[_i4]);
  88935. }
  88936. }
  88937. json['features'].push(feature);
  88938. }
  88939. return json;
  88940. }
  88941. },
  88942. /**
  88943. * @function Util.createCanvasContext2D
  88944. * @description 创建 2D 画布。
  88945. * @param {number} opt_width - 画布宽度。
  88946. * @param {number} opt_height - 画布高度。
  88947. */
  88948. createCanvasContext2D: function createCanvasContext2D(opt_width, opt_height) {
  88949. var canvas = document.createElement('CANVAS');
  88950. if (opt_width) {
  88951. canvas.width = opt_width;
  88952. }
  88953. if (opt_height) {
  88954. canvas.height = opt_height;
  88955. }
  88956. return canvas.getContext('2d');
  88957. },
  88958. /**
  88959. * @function Util.supportWebGL2
  88960. * @description 是否支持 webgl2。
  88961. */
  88962. supportWebGL2: function supportWebGL2() {
  88963. var canvas = document.createElement('canvas');
  88964. return Boolean(canvas && canvas.getContext('webgl2'));
  88965. },
  88966. /**
  88967. * @function Util.isString
  88968. * @description 是否为字符串
  88969. * @param {string} str - 需要判断的内容
  88970. * @returns {boolean}
  88971. */
  88972. isString: isString,
  88973. /**
  88974. * @function Util.isObject
  88975. * @description 是否为对象
  88976. * @param {any} obj - 需要判断的内容
  88977. * @returns {boolean}
  88978. */
  88979. isObject: function isObject(obj) {
  88980. return Object.prototype.toString.call(obj) === '[object Object]';
  88981. },
  88982. /**
  88983. * @function Util.trim
  88984. * @description 字符串裁剪两边的空格
  88985. * @param {string} str - 需要裁剪的字符串
  88986. * @returns {boolean}
  88987. */
  88988. trim: function trim() {
  88989. var str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  88990. return str.replace(/(^\s*)|(\s*$)/g, '');
  88991. },
  88992. /**
  88993. * @function Util.newGuid
  88994. * @description 随机生成id
  88995. * @param {string} attr - 几位数字的id
  88996. * @returns {string}
  88997. */
  88998. newGuid: function newGuid(attr) {
  88999. var len = attr || 32;
  89000. var guid = '';
  89001. for (var i = 1; i < len; i++) {
  89002. var n = Math.floor(Math.random() * 16.0).toString(16);
  89003. guid += n;
  89004. }
  89005. return guid;
  89006. },
  89007. /**
  89008. * @function Util.isNumber
  89009. * @description 检测数据是否为number
  89010. * @param {string} value - 值,未知数据类型
  89011. * @returns {boolean}
  89012. */
  89013. isNumber: function isNumber(value) {
  89014. if (value === '') {
  89015. return false;
  89016. }
  89017. var mdata = Number(value);
  89018. if (mdata === 0) {
  89019. return true;
  89020. }
  89021. return !isNaN(mdata);
  89022. },
  89023. /**
  89024. * @function Util.isMatchAdministrativeName
  89025. * @param {string} featureName 原始数据中的地名
  89026. * @param {string} fieldName 需要匹配的地名
  89027. * @returns {boolean} 是否匹配
  89028. */
  89029. isMatchAdministrativeName: isMatchAdministrativeName,
  89030. /**
  89031. * @function Util.getHighestMatchAdministration
  89032. * @param {string} featureName 初始匹配的要素数组
  89033. * @param {string} fieldName 要匹配的地名
  89034. * @returns {boolean} 是否匹配
  89035. */
  89036. getHighestMatchAdministration: function getHighestMatchAdministration(features, fieldName) {
  89037. var filterFeatures = features.filter(function (item) {
  89038. return isMatchAdministrativeName(item.properties.Name, fieldName);
  89039. });
  89040. var maxMatchPercent = 0,
  89041. maxMatchFeature = null;
  89042. filterFeatures.forEach(function (feature) {
  89043. var count = 0;
  89044. Array.from(new Set(feature.properties.Name.split(''))).forEach(function (_char) {
  89045. if (fieldName.includes(_char)) {
  89046. count++;
  89047. }
  89048. });
  89049. if (count > maxMatchPercent) {
  89050. maxMatchPercent = count;
  89051. maxMatchFeature = feature;
  89052. }
  89053. });
  89054. return maxMatchFeature;
  89055. },
  89056. /**
  89057. * @function Util.setMask
  89058. * @description 为图层设置掩膜。
  89059. * @version 10.1.0
  89060. * @param {ol.layer.Layer|Array.<ol.layer.Layer>} layers 图层
  89061. * @param {ol.geom.Geometry|ol.Feature} polygon 掩膜矢量要素,支持面类型的要素。
  89062. */
  89063. setMask: function setMask(layers, polygon) {
  89064. if (!polygon) {
  89065. return;
  89066. }
  89067. var geo = polygon instanceof (external_ol_Feature_default()) ? polygon.getGeometry() : polygon;
  89068. if (!(geo instanceof (external_ol_geom_Geometry_default())) && ['MultiPolygon', 'Polygon'].indexOf(polygon.getType()) < 0) {
  89069. return;
  89070. }
  89071. var feature = polygon instanceof (external_ol_Feature_default()) ? polygon : new (external_ol_Feature_default())(polygon);
  89072. var style = new external_ol_style_namespaceObject.Style({
  89073. fill: new external_ol_style_namespaceObject.Fill({
  89074. color: 'black'
  89075. })
  89076. });
  89077. var clipLayer = new (external_ol_layer_Vector_default())({
  89078. source: new (external_ol_source_Vector_default())({
  89079. features: [feature],
  89080. wrapX: false
  89081. })
  89082. });
  89083. var clipRender = function clipRender(e) {
  89084. var vectorContext = (0,external_ol_render_namespaceObject.getVectorContext)(e);
  89085. e.context.globalCompositeOperation = 'destination-in';
  89086. clipLayer.getSource().forEachFeature(function (feature) {
  89087. vectorContext.drawFeature(feature, style);
  89088. e.context.globalCompositeOperation = 'source-over';
  89089. });
  89090. };
  89091. var todoLayers = Array.isArray(layers) ? layers : [layers];
  89092. unsetMask(todoLayers);
  89093. todoLayers.forEach(function (layer) {
  89094. layer.classNameBak_ = layer.className_;
  89095. layer.className_ = "ol_mask_layer_".concat(layer.ol_uid);
  89096. layer.clipRender = clipRender;
  89097. layer.extentBak_ = layer.getExtent();
  89098. layer.setExtent(clipLayer.getSource().getExtent());
  89099. layer.on('postrender', clipRender);
  89100. layer.changed();
  89101. });
  89102. },
  89103. /**
  89104. * @function Util.unsetMask
  89105. * @description 取消图层掩膜。
  89106. * @version 10.1.0
  89107. * @param {ol.layer.Layer|Array.<ol.layer.Layer>} layers 图层
  89108. */
  89109. unsetMask: unsetMask,
  89110. getZoomByResolution: function getZoomByResolution(scale, scales) {
  89111. return MapCalculateUtil_getZoomByResolution(scale, scales);
  89112. },
  89113. scalesToResolutions: function scalesToResolutions(scales, bounds, dpi, unit, mapobj, level) {
  89114. return MapCalculateUtil_scalesToResolutions(scales, bounds, dpi, unit, mapobj, level);
  89115. },
  89116. getProjection: function getProjection(prjCoordSys, extent) {
  89117. var projection = (0,external_ol_proj_namespaceObject.get)("EPSG:".concat(prjCoordSys.epsgCode));
  89118. if (prjCoordSys.type == 'PCS_NON_EARTH') {
  89119. projection = new (external_ol_proj_Projection_default())({
  89120. extent: extent,
  89121. units: 'm',
  89122. code: '0'
  89123. });
  89124. }
  89125. if (!projection) {
  89126. console.error("The projection of EPSG:".concat(prjCoordSys.epsgCode, " is missing, please register the projection of EPSG:").concat(prjCoordSys.epsgCode, " first, refer to the documentation: https://iclient.supermap.io/web/introduction/leafletDevelop.html#multiProjection"));
  89127. }
  89128. return projection;
  89129. }
  89130. };
  89131. function isString(str) {
  89132. return typeof str === 'string' && str.constructor === String;
  89133. }
  89134. function isArray(obj) {
  89135. return Object.prototype.toString.call(obj) === '[object Array]';
  89136. }
  89137. function unsetMask(layers) {
  89138. var todoLayers = Array.isArray(layers) ? layers : [layers];
  89139. for (var index = 0; index < todoLayers.length; index++) {
  89140. var layer = todoLayers[index];
  89141. if (!layer.clipRender) {
  89142. continue;
  89143. }
  89144. layer.un('postrender', layer.clipRender);
  89145. layer.className_ = layer.classNameBak_;
  89146. layer.setExtent(layer.extentBak);
  89147. delete layer.classNameBak_;
  89148. delete layer.clipRender;
  89149. delete layer.extentBak_;
  89150. layer.changed();
  89151. }
  89152. }
  89153. function isMatchAdministrativeName(featureName, fieldName) {
  89154. if (isString(fieldName)) {
  89155. var shortName = featureName.substr(0, 2);
  89156. // 张家口市和张家界市 特殊处理
  89157. if (shortName === '张家') {
  89158. shortName = featureName.substr(0, 3);
  89159. }
  89160. return !!fieldName.match(new RegExp(shortName));
  89161. }
  89162. return false;
  89163. }
  89164. ;// CONCATENATED MODULE: external "function(){try{return canvg}catch(e){return {}}}()"
  89165. var external_function_try_return_canvg_catch_e_return_namespaceObject = function(){try{return canvg}catch(e){return {}}}();
  89166. var external_function_try_return_canvg_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_canvg_catch_e_return_namespaceObject);
  89167. ;// CONCATENATED MODULE: external "ol.style.Style"
  89168. var external_ol_style_Style_namespaceObject = ol.style.Style;
  89169. var external_ol_style_Style_default = /*#__PURE__*/__webpack_require__.n(external_ol_style_Style_namespaceObject);
  89170. ;// CONCATENATED MODULE: external "ol.style.Icon"
  89171. var external_ol_style_Icon_namespaceObject = ol.style.Icon;
  89172. var external_ol_style_Icon_default = /*#__PURE__*/__webpack_require__.n(external_ol_style_Icon_namespaceObject);
  89173. ;// CONCATENATED MODULE: external "ol.style.Circle"
  89174. var external_ol_style_Circle_namespaceObject = ol.style.Circle;
  89175. var external_ol_style_Circle_default = /*#__PURE__*/__webpack_require__.n(external_ol_style_Circle_namespaceObject);
  89176. ;// CONCATENATED MODULE: external "ol.style.Fill"
  89177. var external_ol_style_Fill_namespaceObject = ol.style.Fill;
  89178. var external_ol_style_Fill_default = /*#__PURE__*/__webpack_require__.n(external_ol_style_Fill_namespaceObject);
  89179. ;// CONCATENATED MODULE: external "ol.style.Stroke"
  89180. var external_ol_style_Stroke_namespaceObject = ol.style.Stroke;
  89181. var external_ol_style_Stroke_default = /*#__PURE__*/__webpack_require__.n(external_ol_style_Stroke_namespaceObject);
  89182. ;// CONCATENATED MODULE: external "ol.style.Text"
  89183. var external_ol_style_Text_namespaceObject = ol.style.Text;
  89184. var external_ol_style_Text_default = /*#__PURE__*/__webpack_require__.n(external_ol_style_Text_namespaceObject);
  89185. ;// CONCATENATED MODULE: ./src/openlayers/core/StyleUtils.js
  89186. function StyleUtils_typeof(obj) { "@babel/helpers - typeof"; return StyleUtils_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, StyleUtils_typeof(obj); }
  89187. function StyleUtils_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ StyleUtils_regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == StyleUtils_typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
  89188. function StyleUtils_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
  89189. function StyleUtils_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { StyleUtils_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { StyleUtils_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
  89190. function StyleUtils_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  89191. function StyleUtils_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  89192. function StyleUtils_createClass(Constructor, protoProps, staticProps) { if (protoProps) StyleUtils_defineProperties(Constructor.prototype, protoProps); if (staticProps) StyleUtils_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  89193. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  89194. * This program are made available under the terms of the Apache License, Version 2.0
  89195. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  89196. var padding = 8,
  89197. doublePadding = padding * 2;
  89198. var ZERO = 0.0000001;
  89199. /**
  89200. * @class StyleUtils
  89201. * @classdesc 样式工具类。
  89202. * @private
  89203. */
  89204. var StyleUtils = /*#__PURE__*/function () {
  89205. function StyleUtils() {
  89206. StyleUtils_classCallCheck(this, StyleUtils);
  89207. }
  89208. StyleUtils_createClass(StyleUtils, null, [{
  89209. key: "getValidStyleFromLayerInfo",
  89210. value:
  89211. /**
  89212. * @function StyleUtils.getValidStyleFromLayerInfo
  89213. * @description 通过图层信息获取有效的样式。
  89214. * @param {Object} layerInfo - 图层信息。
  89215. * @param {ol.Feature} feature - 要素。
  89216. * @param {string} url - 图层数据地址。
  89217. * @returns {ol.style.Style} 返回图层样式。
  89218. */
  89219. function getValidStyleFromLayerInfo(layerInfo, feature, url) {
  89220. var type = feature.getGeometry().getType().toUpperCase(),
  89221. shader = layerInfo.layerStyle,
  89222. style = this.getDefaultStyle(type);
  89223. if ((type === "POINT" || type === 'MULTIPOINT') && !feature.getProperties().textStyle && layerInfo.type !== 'LABEL' && !feature.getProperties().TEXT_FEATURE_CONTENT) {
  89224. if (shader) {
  89225. var symbolParameters = {
  89226. "transparent": true,
  89227. "resourceType": "SYMBOLMARKER",
  89228. "picWidth": Math.ceil(shader.markerSize * DOTS_PER_INCH * INCHES_PER_UNIT["mm"]) || 13,
  89229. "picHeight": Math.ceil(shader.markerSize * DOTS_PER_INCH * INCHES_PER_UNIT["mm"]) || 13,
  89230. "style": JSON.stringify(shader)
  89231. };
  89232. var imageUrl = Util_Util.urlAppend(url + "/symbol.png", Util_Util.getParameterString(symbolParameters));
  89233. style.pointFile = imageUrl;
  89234. return new (external_ol_style_Style_default())({
  89235. image: new (external_ol_style_Icon_default())({
  89236. src: style.pointFile
  89237. })
  89238. });
  89239. }
  89240. return this.toOLPointStyle(style);
  89241. } else if ((type === "POINT" || type === 'MULTIPOINT') && (feature.getProperties().textStyle || layerInfo.type === 'LABEL' || feature.getProperties().TEXT_STYLE_INFO)) {
  89242. style = this.getDefaultStyle('TEXT');
  89243. if (feature.getProperties().textStyle) {
  89244. shader = feature.getProperties().textStyle;
  89245. }
  89246. if (feature.getProperties().TEXT_STYLE_INFO) {
  89247. shader = JSON.parse(feature.getProperties().TEXT_STYLE_INFO).textStyle;
  89248. }
  89249. if (shader && shader !== "{}") {
  89250. var fontStr = "";
  89251. //设置文本是否倾斜
  89252. style.fontStyle = shader.italic ? "italic" : "normal";
  89253. //设置文本是否使用粗体
  89254. style.fontWeight = shader.bold ? shader.fontWeight : "normal";
  89255. //设置文本的尺寸(对应fontHeight属性)和行高,行高iserver不支持,默认5像素
  89256. //固定大小的时候单位是毫米
  89257. var text_h = shader.fontHeight * DOTS_PER_INCH * INCHES_PER_UNIT["mm"] * 0.85; //毫米转像素,服务端的字体貌似要稍微小一点
  89258. style.fontSize = text_h + "px";
  89259. //设置文本字体类型
  89260. //在桌面字体钱加@时为了解决对联那种形式,但是在canvas不支持,并且添加了@会导致
  89261. //字体大小被固定,这里需要去掉
  89262. if (shader.fontName.indexOf("@")) {
  89263. fontStr = shader.fontName.replace(/@/g, "");
  89264. } else {
  89265. fontStr = shader.fontName;
  89266. }
  89267. style.fontFamily = fontStr;
  89268. style.textHeight = text_h;
  89269. //设置对齐方式
  89270. var alignStr = shader.align.replace(/TOP|MIDDLE|BASELINE|BOTTOM/, "");
  89271. style.textAlign = alignStr.toLowerCase();
  89272. var baselineStr = shader.align.replace(/LEFT|RIGHT|CENTER/, "");
  89273. if (baselineStr === "BASELINE") {
  89274. baselineStr = "alphabetic";
  89275. }
  89276. style.textBaseline = baselineStr.toLowerCase();
  89277. /*//首先判定是否需要绘制阴影,如果需要绘制,阴影应该在最下面
  89278. if(shader.shadow)
  89279. {
  89280. //桌面里面的阴影没有做模糊处理,这里统一设置为0,
  89281. style.shadowBlur=0;
  89282. //和桌面统一,往右下角偏移阴影,默认3像素
  89283. style.shadowOffsetX=3;
  89284. style.shadowOffsetY=3;
  89285. //颜色取一个灰色,调成半透明
  89286. style.shadowColor="rgba(50,50,50,0.5)";
  89287. }else{
  89288. style.shadowOffsetX=0;
  89289. style.shadowOffsetY=0;
  89290. }*/
  89291. style.haloRadius = shader.outline ? shader.outlineWidth : 0;
  89292. style.backColor = "rgba(" + shader.backColor.red + "," + shader.backColor.green + "," + shader.backColor.blue + ",1)";
  89293. style.foreColor = "rgba(" + shader.foreColor.red + "," + shader.foreColor.green + "," + shader.foreColor.blue + ",1)";
  89294. style.rotation = shader.rotation;
  89295. }
  89296. var text;
  89297. if (feature.getProperties().textStyle && feature.getProperties().texts) {
  89298. text = feature.getProperties().texts[0];
  89299. }
  89300. if (layerInfo.type === 'LABEL') {
  89301. var textField = layerInfo.textField;
  89302. if (textField && textField.indexOf('.')) {
  89303. var arr = textField.split('.');
  89304. textField = arr && arr.length > 0 && arr[arr.length - 1];
  89305. }
  89306. text = feature.getProperties().attributes ? feature.getProperties().attributes[textField] : feature.getProperties()[textField];
  89307. }
  89308. if (feature.getProperties().TEXT_FEATURE_CONTENT) {
  89309. text = feature.getProperties().TEXT_FEATURE_CONTENT;
  89310. }
  89311. if (!text) {
  89312. return this.toOLPointStyle(this.getDefaultStyle('POINT'));
  89313. }
  89314. return this.toOLTextStyle(style, text);
  89315. } else if (shader) {
  89316. //目前只实现桌面系统默认的几种symbolID,非系统默认的面用颜色填充替代,线则用实线来替代
  89317. var fillSymbolID = shader["fillSymbolID"] > 7 ? 0 : shader["fillSymbolID"];
  89318. var lineSymbolID = shader["lineSymbolID"] > 5 ? 0 : shader["lineSymbolID"];
  89319. for (var attr in shader) {
  89320. var obj = StyleMap.ServerStyleMap[attr];
  89321. var canvasStyle = obj.canvasStyle;
  89322. if (canvasStyle && canvasStyle != "") {
  89323. var value;
  89324. switch (obj.type) {
  89325. case "number":
  89326. value = shader[attr];
  89327. if (obj.unit) {
  89328. //将单位转换为像素单位
  89329. value = value * DOTS_PER_INCH * INCHES_PER_UNIT[obj.unit] * 2.5;
  89330. }
  89331. style[canvasStyle] = value;
  89332. break;
  89333. case "color":
  89334. var color = shader[attr];
  89335. var backColor = shader["fillBackColor"];
  89336. var alpha = 1;
  89337. if (canvasStyle === "fillStyle") {
  89338. if (fillSymbolID === 0 || fillSymbolID === 1) {
  89339. //当fillSymbolID为0时,用颜色填充,为1是无填充,即为透明填充,alpha通道为0
  89340. alpha = 1 - fillSymbolID;
  89341. value = "rgba(" + color.red + "," + color.green + "," + color.blue + "," + alpha + ")";
  89342. } else {
  89343. //当fillSymbolID为2~7时,用的纹理填充,但要按照前景色修改其颜色
  89344. try {
  89345. var tempCvs = document.createElement("canvas");
  89346. tempCvs.height = 8;
  89347. tempCvs.width = 8;
  89348. var tempCtx = tempCvs.getContext("2d");
  89349. var image = new Image();
  89350. if (this.layer && this.layer.fillImages) {
  89351. tempCtx.drawImage(this.layer.fillImages["System " + fillSymbolID], 0, 0);
  89352. }
  89353. var imageData = tempCtx.getImageData(0, 0, tempCvs.width, tempCvs.height);
  89354. var pix = imageData.data;
  89355. for (var i = 0, len = pix.length; i < len; i += 4) {
  89356. var r = pix[i],
  89357. g = pix[i + 1],
  89358. b = pix[i + 2];
  89359. //将符号图片中的灰色或者黑色的部分替换为前景色,其余为后景色
  89360. if (r < 225 && g < 225 && b < 225) {
  89361. pix[i] = color.red;
  89362. pix[i + 1] = color.green;
  89363. pix[i + 2] = color.blue;
  89364. } else if (backColor) {
  89365. pix[i] = backColor.red;
  89366. pix[i + 1] = backColor.green;
  89367. pix[i + 2] = backColor.blue;
  89368. }
  89369. }
  89370. tempCtx.putImageData(imageData, 0, 0);
  89371. image.src = tempCvs.toDataURL();
  89372. if (this.context) {
  89373. value = this.context.createPattern(image, "repeat");
  89374. }
  89375. } catch (e) {
  89376. throw Error(e.message);
  89377. }
  89378. }
  89379. } else if (canvasStyle === "strokeStyle") {
  89380. if (lineSymbolID === 0 || lineSymbolID === 5) {
  89381. //对于lineSymbolID为0时,线为实线,为lineSymbolID为5时,为无线模式,即线为透明,即alpha通道为0
  89382. alpha = lineSymbolID === 0 ? 1 : 0;
  89383. } else {
  89384. //以下几种linePattern分别模拟了桌面的SymbolID为1~4几种符号的linePattern
  89385. var linePattern = [1, 0];
  89386. switch (lineSymbolID) {
  89387. case 1:
  89388. linePattern = [9.7, 3.7];
  89389. break;
  89390. case 2:
  89391. linePattern = [3.7, 3.7];
  89392. break;
  89393. case 3:
  89394. linePattern = [9.7, 3.7, 2.3, 3.7];
  89395. break;
  89396. case 4:
  89397. linePattern = [9.7, 3.7, 2.3, 3.7, 2.3, 3.7];
  89398. break;
  89399. default:
  89400. break;
  89401. }
  89402. style.lineDasharray = linePattern;
  89403. }
  89404. value = "rgba(" + color.red + "," + color.green + "," + color.blue + "," + alpha + ")";
  89405. }
  89406. style[canvasStyle] = value;
  89407. break;
  89408. default:
  89409. break;
  89410. }
  89411. }
  89412. }
  89413. }
  89414. if (type === 'LINESTRING' || type === 'MULTILINESTRING') {
  89415. return this.toOLLineStyle(style);
  89416. }
  89417. if (type === 'POLYGON' || type === 'MULTIPOLYGON') {
  89418. return this.toOLPolygonStyle(style);
  89419. }
  89420. }
  89421. /**
  89422. * @function StyleUtils.getStyleFromCarto
  89423. * @description 从 Carto 中获取有效的样式。
  89424. * @param {number} zoom -缩放级别。
  89425. * @param {number} scale - 比例尺。
  89426. * @param {Array.<Object>} shader - 渲染器对象数组。
  89427. * @param {Object} feature - 要素。
  89428. * @param {string} fromServer - 服务源。
  89429. * @param {string} url - 地址。
  89430. */
  89431. }, {
  89432. key: "getStyleFromCarto",
  89433. value: function getStyleFromCarto(zoom, scale, shader, feature, fromServer, url) {
  89434. var type = feature.getGeometry().getType().toUpperCase(),
  89435. attributes = {},
  89436. style = this.getDefaultStyle(type);
  89437. attributes.FEATUREID = feature.getProperties().id;
  89438. attributes.SCALE = scale;
  89439. var cartoStyleType = feature.getProperties().type === "TEXT" ? "TEXT" : type;
  89440. var cartoStyleMap = StyleMap.CartoStyleMap[cartoStyleType];
  89441. var fontSize, fontName;
  89442. if (shader) {
  89443. for (var i = 0, len = shader.length; i < len; i++) {
  89444. var _shader = shader[i];
  89445. var prop = cartoStyleMap[_shader.property];
  89446. var value = _shader.getValue(attributes, zoom, true);
  89447. if (value !== null && prop) {
  89448. if (prop === "fontSize") {
  89449. if (fromServer) {
  89450. value *= 0.8;
  89451. }
  89452. //斜杠后面为行间距,默认为0.5倍行间距
  89453. fontSize = value + "px";
  89454. style.fontSize = fontSize;
  89455. } else if (prop === "fontName") {
  89456. fontName = value;
  89457. style.fontName = fontName;
  89458. } else {
  89459. if (prop === "globalCompositeOperation") {
  89460. value = StyleMap.CartoCompOpMap[value];
  89461. if (!value) {
  89462. continue;
  89463. }
  89464. } else if (fromServer && prop === 'pointFile') {
  89465. value = url + '/tileFeature/symbols/' + value.replace(/(___)/gi, '@');
  89466. value = value.replace(/(__0__0__)/gi, '__8__8__');
  89467. }
  89468. if (prop === 'lineWidth' && value < 1) {
  89469. value = Math.ceil(value);
  89470. }
  89471. style[prop] = value;
  89472. }
  89473. }
  89474. }
  89475. }
  89476. if (feature.getProperties().type === 'TEXT') {
  89477. var text;
  89478. if (feature.getProperties().texts) {
  89479. text = feature.getProperties().texts[0];
  89480. }
  89481. if (text == null && style.textName) {
  89482. var textName = style.textName.substring(1, style.textName.length - 1);
  89483. text = feature.getProperties().attributes ? feature.getProperties().attributes[textName] : feature.getProperties()[textName];
  89484. if (text != null) {
  89485. var texts = feature.getProperties().texts || [];
  89486. texts.push(text);
  89487. feature.setProperties({
  89488. texts: texts
  89489. });
  89490. }
  89491. }
  89492. return this.toOLTextStyle(style, text);
  89493. }
  89494. if (type === 'POINT' || type === 'MULTIPOINT') {
  89495. return this.toOLPointStyle(style);
  89496. }
  89497. if (type === 'LINESTRING' || type === 'MULTILINESTRING') {
  89498. return this.toOLLineStyle(style);
  89499. }
  89500. if (type === 'POLYGON' || type === 'MULTIPOLYGON') {
  89501. return this.toOLPolygonStyle(style);
  89502. }
  89503. }
  89504. /**
  89505. * @function StyleUtils.toOLPointStyle
  89506. * @description 点样式。
  89507. * @param {Object} style - 样式参数。
  89508. * @returns {ol.style.Style} 获取点样式。
  89509. */
  89510. }, {
  89511. key: "toOLPointStyle",
  89512. value: function toOLPointStyle(style) {
  89513. if (style.pointFile !== '') {
  89514. return new (external_ol_style_Style_default())({
  89515. image: new (external_ol_style_Icon_default())({
  89516. src: style.pointFile
  89517. })
  89518. });
  89519. }
  89520. return new (external_ol_style_Style_default())({
  89521. image: new (external_ol_style_Circle_default())({
  89522. radius: style.pointRadius,
  89523. fill: new (external_ol_style_Fill_default())({
  89524. color: style.fillStyle
  89525. }),
  89526. stroke: new (external_ol_style_Stroke_default())({
  89527. color: style.pointHaloColor,
  89528. width: style.pointHaloRadius
  89529. })
  89530. })
  89531. });
  89532. }
  89533. /**
  89534. * @function StyleUtils.toOLLineStyle
  89535. * @description 线样式。
  89536. * @param {Object} style - 样式参数。
  89537. * @returns {ol.style.Style} 获取线的样式。
  89538. */
  89539. }, {
  89540. key: "toOLLineStyle",
  89541. value: function toOLLineStyle(style) {
  89542. return new (external_ol_style_Style_default())({
  89543. stroke: new (external_ol_style_Stroke_default())({
  89544. color: style.strokeStyle,
  89545. width: style.lineWidth,
  89546. lineCap: style.lineCap,
  89547. lineDash: style.lineDasharray,
  89548. lineDashOffset: style.lineDashOffset,
  89549. lineJoin: style.lineJoin,
  89550. miterLimit: style.miterLimit
  89551. })
  89552. });
  89553. }
  89554. /**
  89555. * @function StyleUtils.toOLPolygonStyle
  89556. * @description 面样式。
  89557. * @param {Object} style - 样式参数。
  89558. * @returns {ol.style.Style} 获取面的样式。
  89559. */
  89560. }, {
  89561. key: "toOLPolygonStyle",
  89562. value: function toOLPolygonStyle(style) {
  89563. var fill = new (external_ol_style_Fill_default())({
  89564. color: style.fillStyle
  89565. });
  89566. var stroke = new (external_ol_style_Stroke_default())({
  89567. color: style.strokeStyle,
  89568. width: style.lineWidth,
  89569. lineCap: style.lineCap,
  89570. lineDash: style.lineDasharray,
  89571. lineDashOffset: style.lineDashOffset,
  89572. lineJoin: style.lineJoin,
  89573. miterLimit: style.miterLimit
  89574. });
  89575. return new (external_ol_style_Style_default())({
  89576. fill: fill,
  89577. stroke: stroke
  89578. });
  89579. }
  89580. /**
  89581. * @function StyleUtils.toOLTextStyle
  89582. * @description 文本样式。
  89583. * @param {Object} style - 样式对象。
  89584. * @param {string} text - 文本参数。
  89585. * @returns {ol.style.Style} 获取的文本样式。
  89586. */
  89587. }, {
  89588. key: "toOLTextStyle",
  89589. value: function toOLTextStyle(style, text) {
  89590. return new (external_ol_style_Style_default())({
  89591. text: new (external_ol_style_Text_default())({
  89592. font: (style.fontStyle || '') + ' ' + (style.fontWeight || '') + ' ' + (style.fontSize || '') + ' ' + style.fontFamily,
  89593. text: text,
  89594. textAlign: style.textAlign,
  89595. textBaseline: style.textBaseline,
  89596. fill: new (external_ol_style_Fill_default())({
  89597. color: style.foreColor
  89598. }),
  89599. stroke: new (external_ol_style_Stroke_default())({
  89600. color: style.backColor
  89601. }),
  89602. offsetX: style.offsetX,
  89603. offsetY: style.offsetY
  89604. })
  89605. });
  89606. }
  89607. /**
  89608. * @function StyleUtils.dashStyle
  89609. * @description 符号样式。
  89610. * @param {Object} style - 样式参数。
  89611. * @param {number} widthFactor - 宽度系数。
  89612. */
  89613. }, {
  89614. key: "dashStyle",
  89615. value: function dashStyle(style, widthFactor) {
  89616. if (!style) {
  89617. return [];
  89618. }
  89619. var w = style.strokeWidth * widthFactor;
  89620. var str = style.strokeDashstyle || style.lineDash;
  89621. switch (str) {
  89622. case 'solid':
  89623. return [0];
  89624. case 'dot':
  89625. return [1, 4 * w];
  89626. case 'dash':
  89627. return [4 * w, 4 * w];
  89628. case 'dashdot':
  89629. return [4 * w, 4 * w, 1, 4 * w];
  89630. case 'longdash':
  89631. return [8 * w, 4 * w];
  89632. case 'longdashdot':
  89633. return [8 * w, 4 * w, 1, 4 * w];
  89634. default:
  89635. if (!str) {
  89636. return [];
  89637. }
  89638. if (Util_Util.isArray(str)) {
  89639. return str;
  89640. }
  89641. str = StringExt.trim(str).replace(/\s+/g, ",");
  89642. return str.replace(/\[|\]/gi, "").split(",");
  89643. }
  89644. }
  89645. /**
  89646. * @function StyleUtils.getStyleFromiPortalMarker
  89647. * @description 从 iPortal 标记获取样式。
  89648. * @param {Object} icon - 图标参数。
  89649. */
  89650. }, {
  89651. key: "getStyleFromiPortalMarker",
  89652. value: function getStyleFromiPortalMarker(icon) {
  89653. if (icon.indexOf("./") == 0) {
  89654. return null;
  89655. }
  89656. //兼容iportal示例的问题
  89657. // if (icon.indexOf("http://support.supermap.com.cn:8092/static/portal") == 0) {
  89658. // icon = icon.replace("http://support.supermap.com.cn:8092/static/portal", "http://support.supermap.com.cn:8092/apps/viewer/static");
  89659. // }
  89660. return new (external_ol_style_Style_default())({
  89661. image: new (external_ol_style_Icon_default())({
  89662. src: icon,
  89663. opacity: 1,
  89664. size: [48, 43],
  89665. anchor: [0.5, 1]
  89666. })
  89667. });
  89668. }
  89669. /**
  89670. * @function StyleUtils.getStyleFromiPortalStyle
  89671. * @description 从 iPortal 标记获取样式。
  89672. * @param {Object} iPortalStyle - iportal 样式。
  89673. * @param {string} type - 样式类型。
  89674. * @param {Object} fStyle - 要素样式。
  89675. */
  89676. }, {
  89677. key: "getStyleFromiPortalStyle",
  89678. value: function getStyleFromiPortalStyle(iPortalStyle, type, fStyle) {
  89679. var featureStyle = fStyle ? JSON.parse(fStyle) : null;
  89680. var me = this;
  89681. if (type === 'Point' || type === 'MultiPoint') {
  89682. var pointStyle = featureStyle || iPortalStyle.pointStyle;
  89683. if (pointStyle.externalGraphic) {
  89684. if (pointStyle.externalGraphic.indexOf("./") == 0) {
  89685. return null;
  89686. }
  89687. //兼容iportal示例的问题
  89688. // if (pointStyle.externalGraphic.indexOf("http://support.supermap.com.cn:8092/static/portal") == 0) {
  89689. // pointStyle.externalGraphic = pointStyle.externalGraphic.replace("http://support.supermap.com.cn:8092/static/portal", "http://support.supermap.com.cn:8092/apps/viewer/static");
  89690. // }
  89691. return new (external_ol_style_Style_default())({
  89692. image: new (external_ol_style_Icon_default())({
  89693. src: pointStyle.externalGraphic,
  89694. opacity: pointStyle.graphicOpacity,
  89695. size: [pointStyle.graphicWidth, pointStyle.graphicHeight]
  89696. //anchor: [-pointStyle.graphicXOffset / pointStyle.graphicWidth, -pointStyle.graphicYOffset / pointStyle.graphicHeight]
  89697. })
  89698. });
  89699. }
  89700. return new (external_ol_style_Style_default())({
  89701. image: new (external_ol_style_Circle_default())({
  89702. fill: new (external_ol_style_Fill_default())({
  89703. color: me.hexToRgba(pointStyle.fillColor, pointStyle.fillOpacity)
  89704. }),
  89705. stroke: new (external_ol_style_Stroke_default())({
  89706. color: me.hexToRgba(pointStyle.strokeColor, pointStyle.strokeOpacity),
  89707. lineCap: pointStyle.strokeLineCap,
  89708. lineDash: this.dashStyle(pointStyle, 1),
  89709. width: pointStyle.strokeWidth
  89710. }),
  89711. radius: pointStyle.pointRadius
  89712. })
  89713. });
  89714. }
  89715. if (type === 'LineString' || type === 'MultiLineString' || type === 'Box') {
  89716. var lineStyle = featureStyle || iPortalStyle.lineStyle;
  89717. return new (external_ol_style_Style_default())({
  89718. stroke: new (external_ol_style_Stroke_default())({
  89719. color: me.hexToRgba(lineStyle.strokeColor, lineStyle.strokeOpacity),
  89720. lineCap: lineStyle.strokeLineCap,
  89721. lineDash: this.dashStyle(lineStyle, 1),
  89722. width: lineStyle.strokeWidth
  89723. })
  89724. });
  89725. }
  89726. if (type === 'Polygon' || type === 'MultiPolygon') {
  89727. var polygonStyle = featureStyle || iPortalStyle.polygonStyle;
  89728. return new (external_ol_style_Style_default())({
  89729. fill: new (external_ol_style_Fill_default())({
  89730. color: me.hexToRgba(polygonStyle.fillColor, polygonStyle.fillOpacity)
  89731. }),
  89732. stroke: new (external_ol_style_Stroke_default())({
  89733. color: me.hexToRgba(polygonStyle.strokeColor, polygonStyle.strokeOpacity),
  89734. lineCap: polygonStyle.strokeLineCap,
  89735. lineDash: this.dashStyle(polygonStyle, 1),
  89736. width: polygonStyle.strokeWidth
  89737. })
  89738. });
  89739. }
  89740. }
  89741. /**
  89742. * @function StyleUtils.hexToRgba
  89743. * @description 十六进制转 RGBA 格式。
  89744. * @param {Object} hex - 十六进制格式参数。
  89745. * @param {number} opacity -Alpha 参数。
  89746. * @returns {string} 生成的 RGBA 格式。
  89747. */
  89748. }, {
  89749. key: "hexToRgba",
  89750. value: function hexToRgba(hex, opacity) {
  89751. var color = [],
  89752. rgba = [];
  89753. hex = hex.replace(/#/, "");
  89754. if (hex.length == 3) {
  89755. var tmp = [];
  89756. for (var i = 0; i < 3; i++) {
  89757. tmp.push(hex.charAt(i) + hex.charAt(i));
  89758. }
  89759. hex = tmp.join("");
  89760. }
  89761. for (var _i2 = 0; _i2 < 6; _i2 += 2) {
  89762. color[_i2] = "0x" + hex.substr(_i2, 2);
  89763. rgba.push(parseInt(Number(color[_i2])));
  89764. }
  89765. rgba.push(opacity);
  89766. return "rgba(" + rgba.join(",") + ")";
  89767. }
  89768. /**
  89769. * @function StyleUtils.getDefaultStyle
  89770. * @description 获取默认风格
  89771. * @param {string} type - 类型参数。
  89772. * @returns {string}
  89773. */
  89774. }, {
  89775. key: "getDefaultStyle",
  89776. value: function getDefaultStyle(type) {
  89777. var style = {};
  89778. var canvasStyle = DeafultCanvasStyle[type];
  89779. for (var prop in canvasStyle) {
  89780. var val = canvasStyle[prop];
  89781. style[prop] = val;
  89782. }
  89783. return style;
  89784. }
  89785. /**
  89786. * @function StyleUtils.getDefaultStyle
  89787. * @description 将样式对象转换成openlayer要求的ol.style
  89788. * @param {string} style - 样式对象
  89789. * @param {string} type - feature的类型
  89790. * @returns {Promise<ol.style.Style>}
  89791. */
  89792. }, {
  89793. key: "toOpenLayersStyle",
  89794. value: function () {
  89795. var _toOpenLayersStyle = StyleUtils_asyncToGenerator( /*#__PURE__*/StyleUtils_regeneratorRuntime().mark(function _callee(style, type) {
  89796. var olStyle, newImage, newFill, newStroke, _style, fillColor, fillOpacity, strokeColor, strokeWidth, strokeOpacity, radius, lineCap, src, scale, offsetX, offsetY, anchor, fillColorArray, strokeColorArray, result;
  89797. return StyleUtils_regeneratorRuntime().wrap(function _callee$(_context) {
  89798. while (1) switch (_context.prev = _context.next) {
  89799. case 0:
  89800. style = style || this.getDefaultStyle();
  89801. olStyle = new (external_ol_style_Style_default())();
  89802. _style = style, fillColor = _style.fillColor, fillOpacity = _style.fillOpacity, strokeColor = _style.strokeColor, strokeWidth = _style.strokeWidth, strokeOpacity = _style.strokeOpacity, radius = _style.radius, lineCap = _style.lineCap, src = _style.src, scale = _style.scale, offsetX = _style.offsetX, offsetY = _style.offsetY, anchor = _style.anchor;
  89803. fillColorArray = this.hexToRgb(fillColor);
  89804. if (fillColorArray) {
  89805. fillColorArray.push(fillOpacity);
  89806. }
  89807. strokeColorArray = this.hexToRgb(strokeColor);
  89808. if (strokeColorArray) {
  89809. strokeColorArray.push(strokeOpacity);
  89810. }
  89811. if (!(type === "POINT")) {
  89812. _context.next = 22;
  89813. break;
  89814. }
  89815. if (!src) {
  89816. _context.next = 18;
  89817. break;
  89818. }
  89819. if (!/.+(\.svg$)/.test(src)) {
  89820. _context.next = 15;
  89821. break;
  89822. }
  89823. if (!this.svgDiv) {
  89824. this.svgDiv = document.createElement('div');
  89825. document.body.appendChild(this.svgDiv);
  89826. }
  89827. _context.next = 13;
  89828. return this.getCanvasFromSVG(src, this.svgDiv, function (canvas) {
  89829. newImage = new (external_ol_style_Icon_default())({
  89830. img: canvas,
  89831. scale: radius / canvas.width,
  89832. imgSize: [canvas.width, canvas.height],
  89833. anchor: [0.5, 0.5]
  89834. });
  89835. });
  89836. case 13:
  89837. _context.next = 16;
  89838. break;
  89839. case 15:
  89840. newImage = new (external_ol_style_Icon_default())({
  89841. src: src,
  89842. scale: scale,
  89843. anchor: anchor
  89844. });
  89845. case 16:
  89846. _context.next = 19;
  89847. break;
  89848. case 18:
  89849. newImage = new (external_ol_style_Circle_default())({
  89850. radius: radius,
  89851. fill: new (external_ol_style_Fill_default())({
  89852. color: fillColorArray
  89853. }),
  89854. stroke: new (external_ol_style_Stroke_default())({
  89855. width: strokeWidth || ZERO,
  89856. color: strokeColorArray
  89857. }),
  89858. displacement: this.getCircleDisplacement(radius, offsetX, offsetY)
  89859. });
  89860. case 19:
  89861. olStyle.setImage(newImage);
  89862. _context.next = 23;
  89863. break;
  89864. case 22:
  89865. if (type === "LINE" || type === "LINESTRING" || type === 'MULTILINESTRING' || type === 'LINEARRING') {
  89866. newStroke = new (external_ol_style_Stroke_default())({
  89867. width: strokeWidth || ZERO,
  89868. color: strokeColorArray,
  89869. lineCap: lineCap || 'round',
  89870. lineDash: this.dashStyle(style, 1)
  89871. });
  89872. olStyle.setStroke(newStroke);
  89873. } else if (type === 'POLYGON' || type === 'MULTIPOLYGON' || type === 'REGION') {
  89874. newFill = new (external_ol_style_Fill_default())({
  89875. color: fillColorArray
  89876. });
  89877. newStroke = new (external_ol_style_Stroke_default())({
  89878. width: strokeWidth || ZERO,
  89879. color: strokeColorArray,
  89880. lineCap: lineCap || 'round',
  89881. lineDash: this.dashStyle(style, 1)
  89882. });
  89883. olStyle.setFill(newFill);
  89884. olStyle.setStroke(newStroke);
  89885. } else {
  89886. result = this.getCanvas(style);
  89887. newImage = new (external_ol_style_Icon_default())({
  89888. img: result.canvas,
  89889. imgSize: [result.width, result.height],
  89890. scale: 1,
  89891. anchor: [0.5, 0.5]
  89892. });
  89893. olStyle.setImage(newImage);
  89894. }
  89895. case 23:
  89896. return _context.abrupt("return", olStyle);
  89897. case 24:
  89898. case "end":
  89899. return _context.stop();
  89900. }
  89901. }, _callee, this);
  89902. }));
  89903. function toOpenLayersStyle(_x, _x2) {
  89904. return _toOpenLayersStyle.apply(this, arguments);
  89905. }
  89906. return toOpenLayersStyle;
  89907. }()
  89908. /**
  89909. * @function StyleUtils.getIconAnchor
  89910. * @description 获取图标的锚点
  89911. * @param {number} offsetX - X方向偏移分数
  89912. * @param {number} offsetY - Y方向偏移分数
  89913. * @returns {Array.<number>}
  89914. */
  89915. }, {
  89916. key: "getIconAnchor",
  89917. value: function getIconAnchor() {
  89918. var offsetX = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.5;
  89919. var offsetY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.5;
  89920. return [offsetX, offsetY];
  89921. }
  89922. /**
  89923. * @function StyleUtils.getCircleDisplacement
  89924. * @description 获取圆圈的偏移
  89925. * @param {number} radius - 圆圈半径
  89926. * @param {number} offsetX - X方向偏移分数
  89927. * @param {number} offsetY - Y方向偏移分数
  89928. * @returns {Array.<number>}
  89929. */
  89930. }, {
  89931. key: "getCircleDisplacement",
  89932. value: function getCircleDisplacement(radius) {
  89933. var offsetX = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  89934. var offsetY = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  89935. var dispX = radius * offsetX,
  89936. dispY = radius * offsetY;
  89937. return [dispX, -dispY];
  89938. }
  89939. /**
  89940. * @function StyleUtils.getTextOffset
  89941. * @description 获取字体图标的偏移值
  89942. * @param {string} fontSize - 字体大小,如12px
  89943. * @param {number} offsetX - X方向偏移分数
  89944. * @param {number} offsetY - Y方向偏移分数
  89945. * @returns {Object}
  89946. */
  89947. }, {
  89948. key: "getTextOffset",
  89949. value: function getTextOffset(fontSize) {
  89950. var offsetX = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  89951. var offsetY = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  89952. var radius = fontSize.substr(0, fontSize.length - 2) / 2;
  89953. return {
  89954. x: radius * offsetX,
  89955. y: radius * offsetY
  89956. };
  89957. }
  89958. /**
  89959. * 获取文字标注对应的canvas
  89960. * @param style
  89961. * @returns {{canvas: *, width: number, height: number}}
  89962. */
  89963. }, {
  89964. key: "getCanvas",
  89965. value: function getCanvas(style) {
  89966. var canvas;
  89967. if (style.canvas) {
  89968. if (document.querySelector("#" + style.canvas)) {
  89969. canvas = document.getElemntById(style.canvas);
  89970. } else {
  89971. canvas = this.createCanvas(style);
  89972. }
  89973. } else {
  89974. //不存在canvas,当前feature
  89975. canvas = this.createCanvas(style);
  89976. style.canvas = canvas.id;
  89977. }
  89978. canvas.style.display = "none";
  89979. var ctx = canvas.getContext("2d");
  89980. //行高
  89981. var lineHeight = Number(style.font.replace(/[^0-9]/ig, ""));
  89982. var textArray = style.text.split('\r\n');
  89983. var lenght = textArray.length;
  89984. //在改变canvas大小后再绘制。否则会被清除
  89985. ctx.font = style.font;
  89986. var size = this.drawRect(ctx, style, textArray, lineHeight, canvas);
  89987. this.positionY = padding;
  89988. if (lenght > 1) {
  89989. textArray.forEach(function (text, i) {
  89990. if (i !== 0) {
  89991. this.positionY = this.positionY + lineHeight;
  89992. }
  89993. this.canvasTextAutoLine(text, style, ctx, lineHeight, size.width);
  89994. }, this);
  89995. } else {
  89996. this.canvasTextAutoLine(textArray[0], style, ctx, lineHeight, size.width);
  89997. }
  89998. return {
  89999. canvas: canvas,
  90000. width: size.width,
  90001. height: size.height
  90002. };
  90003. }
  90004. /**
  90005. * 创建当前feature对应的canvas
  90006. * @param {Object} style
  90007. * @returns {HTMLElement}
  90008. */
  90009. }, {
  90010. key: "createCanvas",
  90011. value: function createCanvas(style) {
  90012. var div = document.createElement('div');
  90013. document.body.appendChild(div);
  90014. var canvas = document.createElement('canvas');
  90015. canvas.id = style.canvas ? style.canvas : 'textCanvas' + core_Util_Util.newGuid(8);
  90016. div.appendChild(canvas);
  90017. return canvas;
  90018. }
  90019. /**
  90020. * 绘制矩形边框背景
  90021. * @param ctx
  90022. * @param style
  90023. * @param textArray
  90024. * @param lineHeight
  90025. * @param canvas
  90026. * @returns {{width: number, height: number}}
  90027. */
  90028. }, {
  90029. key: "drawRect",
  90030. value: function drawRect(ctx, style, textArray, lineHeight, canvas) {
  90031. var backgroundFill = style.backgroundFill,
  90032. maxWidth = style.maxWidth - doublePadding;
  90033. var width,
  90034. height = 0,
  90035. lineCount = 0,
  90036. lineWidths = [];
  90037. //100的宽度,去掉左右两边3padding
  90038. textArray.forEach(function (arrText) {
  90039. var line = '',
  90040. isOverMax;
  90041. lineCount++;
  90042. for (var n = 0; n < arrText.length; n++) {
  90043. var textLine = line + arrText[n];
  90044. var metrics = ctx.measureText(textLine);
  90045. var textWidth = metrics.width;
  90046. if (textWidth > maxWidth && n > 0 || arrText[n] === '\n') {
  90047. line = arrText[n];
  90048. lineCount++;
  90049. //有换行,记录当前换行的width
  90050. isOverMax = true;
  90051. } else {
  90052. line = textLine;
  90053. width = textWidth;
  90054. }
  90055. }
  90056. if (isOverMax) {
  90057. lineWidths.push(maxWidth);
  90058. } else {
  90059. lineWidths.push(width);
  90060. }
  90061. }, this);
  90062. width = this.getCanvasWidth(lineWidths, maxWidth);
  90063. height = lineCount * lineHeight;
  90064. height += doublePadding;
  90065. canvas.width = width;
  90066. canvas.height = height;
  90067. ctx.fillStyle = backgroundFill;
  90068. ctx.fillRect(0, 0, width, height);
  90069. return {
  90070. width: width,
  90071. height: height
  90072. };
  90073. }
  90074. /**
  90075. * 获取自适应的宽度(如果没有超过最大宽度,就用文字的宽度)
  90076. * @param lineWidths
  90077. * @param maxWidth
  90078. * @returns {number}
  90079. */
  90080. }, {
  90081. key: "getCanvasWidth",
  90082. value: function getCanvasWidth(lineWidths, maxWidth) {
  90083. var width = 0;
  90084. for (var i = 0; i < lineWidths.length; i++) {
  90085. var lineW = lineWidths[i];
  90086. if (lineW >= maxWidth) {
  90087. //有任何一行超过最大高度,就用最大高度
  90088. return maxWidth + doublePadding;
  90089. } else if (lineW > width) {
  90090. //自己换行,就要比较每行的最大宽度
  90091. width = lineW;
  90092. }
  90093. }
  90094. return width + doublePadding;
  90095. }
  90096. /**
  90097. * 绘制文字,解决换行问题
  90098. * @param text
  90099. * @param style
  90100. * @param ctx
  90101. * @param lineHeight
  90102. */
  90103. }, {
  90104. key: "canvasTextAutoLine",
  90105. value: function canvasTextAutoLine(text, style, ctx, lineHeight, canvasWidth) {
  90106. // 字符分隔为数组
  90107. ctx.font = style.font;
  90108. var textAlign = style.textAlign;
  90109. var x = this.getPositionX(textAlign, canvasWidth);
  90110. var arrText = text.split('');
  90111. var line = '',
  90112. fillColor = style.fillColor;
  90113. //每一行限制的高度
  90114. var maxWidth = style.maxWidth - doublePadding;
  90115. for (var n = 0; n < arrText.length; n++) {
  90116. var testLine = line + arrText[n];
  90117. var metrics = ctx.measureText(testLine);
  90118. var testWidth = metrics.width;
  90119. if (testWidth > maxWidth && n > 0 || arrText[n] === '\n') {
  90120. ctx.fillStyle = fillColor;
  90121. ctx.textAlign = textAlign;
  90122. ctx.textBaseline = "top";
  90123. ctx.fillText(line, x, this.positionY);
  90124. line = arrText[n];
  90125. this.positionY += lineHeight;
  90126. } else {
  90127. line = testLine;
  90128. }
  90129. }
  90130. ctx.fillStyle = fillColor;
  90131. ctx.textAlign = textAlign;
  90132. ctx.textBaseline = "top";
  90133. ctx.fillText(line, x, this.positionY);
  90134. }
  90135. /**
  90136. * 得到绘制的起点位置,根据align不同,位置也不同
  90137. * @param textAlign
  90138. * @returns {number}
  90139. */
  90140. }, {
  90141. key: "getPositionX",
  90142. value: function getPositionX(textAlign, canvasWidth) {
  90143. var x;
  90144. var width = canvasWidth - doublePadding; //减去padding
  90145. switch (textAlign) {
  90146. case 'center':
  90147. x = width / 2;
  90148. break;
  90149. case 'right':
  90150. x = width;
  90151. break;
  90152. default:
  90153. x = 8;
  90154. break;
  90155. }
  90156. return x;
  90157. }
  90158. /**
  90159. * @function StyleUtils.hexToRgb
  90160. * @description 将16进制的颜色,转换成rgb格式
  90161. * @param {string} hexColor 16进制颜色
  90162. * @returns {string} rgb格式的颜色
  90163. */
  90164. }, {
  90165. key: "hexToRgb",
  90166. value: function hexToRgb(hexColor) {
  90167. if (!hexColor) {
  90168. return;
  90169. }
  90170. var s = hexColor.replace('#', '').split('');
  90171. var rgb = [s[0] + s[1], s[2] + s[3], s[4] + s[5]];
  90172. rgb = rgb.map(function (hex) {
  90173. return parseInt(hex, 16);
  90174. });
  90175. return rgb;
  90176. }
  90177. /**
  90178. * @function StyleUtils.formatRGB
  90179. * @description 将颜色数组转换成标准的rgb颜色格式
  90180. * @param {Array} colorArray - 颜色数组
  90181. * @returns {string} 'rgb(0,0,0)'或者 'rgba(0,0,0,0)'
  90182. */
  90183. }, {
  90184. key: "formatRGB",
  90185. value: function formatRGB(colorArray) {
  90186. var rgb;
  90187. if (colorArray.length === 3) {
  90188. rgb = 'rgb(';
  90189. colorArray.forEach(function (color, index) {
  90190. index === 2 ? rgb += color : rgb += color + ',';
  90191. });
  90192. } else {
  90193. rgb = 'rgba(';
  90194. colorArray.forEach(function (color, index) {
  90195. index === 3 ? rgb += color : rgb += color + ',';
  90196. });
  90197. }
  90198. rgb += ")";
  90199. return rgb;
  90200. }
  90201. /**
  90202. * @function StyleUtils.getCanvasFromSVG
  90203. * @description 将SVG转换成Canvas
  90204. * @param {string} svgUrl - 颜色数组
  90205. * @param {Object} divDom - div的dom对象
  90206. * @param {function} callBack - 转换成功执行的回调函数
  90207. */
  90208. }, {
  90209. key: "getCanvasFromSVG",
  90210. value: function () {
  90211. var _getCanvasFromSVG = StyleUtils_asyncToGenerator( /*#__PURE__*/StyleUtils_regeneratorRuntime().mark(function _callee2(svgUrl, divDom, callBack) {
  90212. var canvgs, canvas, ctx, v;
  90213. return StyleUtils_regeneratorRuntime().wrap(function _callee2$(_context2) {
  90214. while (1) switch (_context2.prev = _context2.next) {
  90215. case 0:
  90216. //一个图层对应一个canvas
  90217. canvgs = window.canvg && window.canvg["default"] ? window.canvg["default"] : (external_function_try_return_canvg_catch_e_return_default());
  90218. canvas = document.createElement('canvas');
  90219. canvas.id = 'dataviz-canvas-' + core_Util_Util.newGuid(8);
  90220. canvas.style.display = "none";
  90221. divDom.appendChild(canvas);
  90222. _context2.prev = 5;
  90223. ctx = canvas.getContext('2d');
  90224. _context2.next = 9;
  90225. return canvgs.from(ctx, svgUrl, {
  90226. ignoreMouse: true,
  90227. ignoreAnimation: true,
  90228. forceRedraw: function forceRedraw() {
  90229. return false;
  90230. }
  90231. });
  90232. case 9:
  90233. v = _context2.sent;
  90234. v.start();
  90235. if (!(canvas.width > 300 || canvas.height > 300)) {
  90236. _context2.next = 13;
  90237. break;
  90238. }
  90239. return _context2.abrupt("return");
  90240. case 13:
  90241. callBack(canvas);
  90242. _context2.next = 19;
  90243. break;
  90244. case 16:
  90245. _context2.prev = 16;
  90246. _context2.t0 = _context2["catch"](5);
  90247. return _context2.abrupt("return");
  90248. case 19:
  90249. case "end":
  90250. return _context2.stop();
  90251. }
  90252. }, _callee2, null, [[5, 16]]);
  90253. }));
  90254. function getCanvasFromSVG(_x3, _x4, _x5) {
  90255. return _getCanvasFromSVG.apply(this, arguments);
  90256. }
  90257. return getCanvasFromSVG;
  90258. }()
  90259. /**
  90260. * @function StyleUtils.stopCanvg
  90261. * @description 调用Canvg实例的stop();
  90262. */
  90263. }, {
  90264. key: "stopCanvg",
  90265. value: function stopCanvg() {
  90266. this.canvgsV.forEach(function (v) {
  90267. return v.stop();
  90268. });
  90269. this.canvgsV = [];
  90270. }
  90271. /**
  90272. * @function StyleUtils.getMarkerDefaultStyle 获取默认标注图层feature的样式
  90273. * @param {string} featureType feature的类型
  90274. * @param {string} server 当前地图前缀
  90275. * @returns {Object} style对象
  90276. */
  90277. }, {
  90278. key: "getMarkerDefaultStyle",
  90279. value: function getMarkerDefaultStyle(featureType, server) {
  90280. var style;
  90281. switch (featureType) {
  90282. case 'POINT':
  90283. style = {
  90284. src: "".concat(server, "apps/dataviz/static/imgs/markers/mark_red.png"),
  90285. scale: 1,
  90286. anchor: [0.5, 1]
  90287. };
  90288. break;
  90289. case 'LINE':
  90290. case 'LINESTRING':
  90291. case 'MULTILINESTRING':
  90292. style = {
  90293. strokeColor: '#3498db',
  90294. strokeOpacity: 1,
  90295. strokeWidth: 5,
  90296. lineCap: 'round',
  90297. lineDash: 'solid'
  90298. };
  90299. break;
  90300. case 'REGION':
  90301. case 'POLYGON':
  90302. case 'MULTIPOLYGON':
  90303. style = {
  90304. fillColor: '#1abd9c',
  90305. fillOpacity: 1,
  90306. strokeColor: '#3498db',
  90307. strokeOpacity: 1,
  90308. strokeWidth: 3,
  90309. lineCap: 'round',
  90310. lineDash: 'solid'
  90311. };
  90312. break;
  90313. }
  90314. return style;
  90315. }
  90316. /**
  90317. * @function StyleUtils.getOpenlayerStyle 获取专题图对应的openlayers格式的style
  90318. * @param {string} styleParams 样式参数
  90319. * @param {string} featureType feature类型
  90320. * @param {boolean} isRank 是否为等级符号
  90321. * @returns {Promise<ol.style.Style>}
  90322. */
  90323. }, {
  90324. key: "getOpenlayersStyle",
  90325. value: function () {
  90326. var _getOpenlayersStyle = StyleUtils_asyncToGenerator( /*#__PURE__*/StyleUtils_regeneratorRuntime().mark(function _callee3(styleParams, featureType, isRank) {
  90327. var style;
  90328. return StyleUtils_regeneratorRuntime().wrap(function _callee3$(_context3) {
  90329. while (1) switch (_context3.prev = _context3.next) {
  90330. case 0:
  90331. if (!(styleParams.type === "BASIC_POINT")) {
  90332. _context3.next = 6;
  90333. break;
  90334. }
  90335. _context3.next = 3;
  90336. return this.toOpenLayersStyle(styleParams, featureType);
  90337. case 3:
  90338. style = _context3.sent;
  90339. _context3.next = 17;
  90340. break;
  90341. case 6:
  90342. if (!(styleParams.type === "SYMBOL_POINT")) {
  90343. _context3.next = 10;
  90344. break;
  90345. }
  90346. style = this.getSymbolStyle(styleParams, isRank);
  90347. _context3.next = 17;
  90348. break;
  90349. case 10:
  90350. if (!(styleParams.type === "SVG_POINT")) {
  90351. _context3.next = 16;
  90352. break;
  90353. }
  90354. _context3.next = 13;
  90355. return this.getSVGStyle(styleParams);
  90356. case 13:
  90357. style = _context3.sent;
  90358. _context3.next = 17;
  90359. break;
  90360. case 16:
  90361. if (styleParams.type === 'IMAGE_POINT') {
  90362. style = this.getImageStyle(styleParams);
  90363. }
  90364. case 17:
  90365. return _context3.abrupt("return", style);
  90366. case 18:
  90367. case "end":
  90368. return _context3.stop();
  90369. }
  90370. }, _callee3, this);
  90371. }));
  90372. function getOpenlayersStyle(_x6, _x7, _x8) {
  90373. return _getOpenlayersStyle.apply(this, arguments);
  90374. }
  90375. return getOpenlayersStyle;
  90376. }()
  90377. /**
  90378. * @function StyleUtils.getSymbolStyle 获取符号样式
  90379. * @param {Object} parameters - 样式参数
  90380. * @returns {Object} style对象
  90381. */
  90382. }, {
  90383. key: "getSymbolStyle",
  90384. value: function getSymbolStyle(parameters, isRank) {
  90385. var text = '';
  90386. if (parameters.unicode) {
  90387. text = String.fromCharCode(parseInt(parameters.unicode.replace(/^&#x/, ''), 16));
  90388. }
  90389. // 填充色 + 透明度
  90390. var fillColor = StyleUtils.hexToRgb(parameters.fillColor);
  90391. fillColor.push(parameters.fillOpacity);
  90392. // 边框充色 + 透明度
  90393. var strokeColor = StyleUtils.hexToRgb(parameters.strokeColor);
  90394. strokeColor.push(parameters.strokeOpacity);
  90395. var fontSize = isRank ? 2 * parameters.radius + "px" : parameters.fontSize;
  90396. var offsetX = parameters.offsetX,
  90397. offsetY = parameters.offsetY,
  90398. _parameters$rotation = parameters.rotation,
  90399. rotation = _parameters$rotation === void 0 ? 0 : _parameters$rotation;
  90400. var offset = StyleUtils.getTextOffset(fontSize, offsetX, offsetY);
  90401. return new (external_ol_style_Style_default())({
  90402. text: new (external_ol_style_Text_default())({
  90403. text: text,
  90404. font: fontSize + " supermapol-icons",
  90405. placement: 'point',
  90406. textAlign: 'center',
  90407. fill: new (external_ol_style_Fill_default())({
  90408. color: fillColor
  90409. }),
  90410. backgroundFill: new (external_ol_style_Fill_default())({
  90411. color: [0, 0, 0, 0]
  90412. }),
  90413. stroke: new (external_ol_style_Stroke_default())({
  90414. width: parameters.strokeWidth || 0.000001,
  90415. color: strokeColor
  90416. }),
  90417. offsetX: offset.x,
  90418. offsetY: offset.y,
  90419. rotation: rotation
  90420. })
  90421. });
  90422. }
  90423. /**
  90424. * @function StyleUtils.getSVGStyle 获取svg的样式
  90425. * @param {Object} styleParams - 样式参数
  90426. * @returns {Promise<ol.style.Style>}
  90427. */
  90428. }, {
  90429. key: "getSVGStyle",
  90430. value: function () {
  90431. var _getSVGStyle = StyleUtils_asyncToGenerator( /*#__PURE__*/StyleUtils_regeneratorRuntime().mark(function _callee4(styleParams) {
  90432. var style, that, url, radius, offsetX, offsetY, fillOpacity, rotation, anchor;
  90433. return StyleUtils_regeneratorRuntime().wrap(function _callee4$(_context4) {
  90434. while (1) switch (_context4.prev = _context4.next) {
  90435. case 0:
  90436. that = this;
  90437. if (!that.svgDiv) {
  90438. that.svgDiv = document.createElement('div');
  90439. document.body.appendChild(that.svgDiv);
  90440. }
  90441. url = styleParams.url, radius = styleParams.radius, offsetX = styleParams.offsetX, offsetY = styleParams.offsetY, fillOpacity = styleParams.fillOpacity, rotation = styleParams.rotation;
  90442. anchor = this.getIconAnchor(offsetX, offsetY);
  90443. _context4.next = 6;
  90444. return StyleUtils.getCanvasFromSVG(url, that.svgDiv, function (canvas) {
  90445. style = new (external_ol_style_Style_default())({
  90446. image: new (external_ol_style_Icon_default())({
  90447. img: that.setColorToCanvas(canvas, styleParams),
  90448. scale: 2 * radius / canvas.width,
  90449. imgSize: [canvas.width, canvas.height],
  90450. anchor: anchor || [0.5, 0.5],
  90451. opacity: fillOpacity,
  90452. anchorOrigin: 'bottom-right',
  90453. rotation: rotation
  90454. })
  90455. });
  90456. });
  90457. case 6:
  90458. return _context4.abrupt("return", style);
  90459. case 7:
  90460. case "end":
  90461. return _context4.stop();
  90462. }
  90463. }, _callee4, this);
  90464. }));
  90465. function getSVGStyle(_x9) {
  90466. return _getSVGStyle.apply(this, arguments);
  90467. }
  90468. return getSVGStyle;
  90469. }()
  90470. /**
  90471. * @function StyleUtils.setColorToCanvas 将颜色,透明度等样式设置到canvas上
  90472. * @param {Object} canvas - 渲染的canvas对象
  90473. * @param {Object} parameters - 样式参数
  90474. * @returns {Object} style对象
  90475. */
  90476. }, {
  90477. key: "setColorToCanvas",
  90478. value: function setColorToCanvas(canvas, parameters) {
  90479. var context = canvas.getContext('2d');
  90480. var fillColor = StyleUtils.hexToRgb(parameters.fillColor);
  90481. fillColor && fillColor.push(parameters.fillOpacity);
  90482. var strokeColor = StyleUtils.hexToRgb(parameters.strokeColor);
  90483. strokeColor && strokeColor.push(parameters.strokeOpacity);
  90484. context.fillStyle = StyleUtils.formatRGB(fillColor);
  90485. context.fill();
  90486. context.strokeStyle = StyleUtils.formatRGB(strokeColor);
  90487. context.lineWidth = parameters.strokeWidth;
  90488. context.stroke();
  90489. return canvas;
  90490. }
  90491. /**
  90492. * @function StyleUtils.getImageStyle 获取图片样式
  90493. * @param {Object} styleParams - 样式参数
  90494. * @returns {Object} style对象
  90495. */
  90496. }, {
  90497. key: "getImageStyle",
  90498. value: function getImageStyle(styleParams) {
  90499. var size = styleParams.imageInfo.size,
  90500. scale = 2 * styleParams.radius / size.w;
  90501. var imageInfo = styleParams.imageInfo;
  90502. var imgDom = imageInfo.img;
  90503. if (!imgDom || !imgDom.src) {
  90504. imgDom = new Image();
  90505. //要组装成完整的url
  90506. imgDom.src = imageInfo.url;
  90507. }
  90508. var offsetX = styleParams.offsetX,
  90509. offsetY = styleParams.offsetY,
  90510. rotation = styleParams.rotation;
  90511. var anchor = this.getIconAnchor(offsetX, offsetY);
  90512. return new (external_ol_style_Style_default())({
  90513. image: new (external_ol_style_Icon_default())({
  90514. img: imgDom,
  90515. scale: scale,
  90516. imgSize: [size.w, size.h],
  90517. anchor: anchor || [0.5, 0.5],
  90518. anchorOrigin: 'bottom-right',
  90519. rotation: rotation
  90520. })
  90521. });
  90522. }
  90523. /**
  90524. * @function StyleUtils.getRoadPath 获取道路样式
  90525. * @param {Object} style - 样式参数
  90526. * @param {Object} outlineStyle - 轮廓样式参数
  90527. * @returns {Object} style对象
  90528. */
  90529. }, {
  90530. key: "getRoadPath",
  90531. value: function getRoadPath(style, outlineStyle) {
  90532. var _style$strokeWidth = style.strokeWidth,
  90533. strokeWidth = _style$strokeWidth === void 0 ? ZERO : _style$strokeWidth,
  90534. lineCap = style.lineCap,
  90535. strokeColor = style.strokeColor,
  90536. strokeOpacity = style.strokeOpacity;
  90537. // 道路线都是solid
  90538. var strokeColorArray = this.hexToRgb(strokeColor);
  90539. strokeColorArray && strokeColorArray.push(strokeOpacity);
  90540. var stroke = new (external_ol_style_Style_default())({
  90541. stroke: new (external_ol_style_Stroke_default())({
  90542. width: strokeWidth || ZERO,
  90543. color: strokeColorArray,
  90544. lineCap: lineCap || 'round',
  90545. lineDash: [0]
  90546. })
  90547. });
  90548. var outlineColor = outlineStyle.strokeColor;
  90549. var outlineColorArray = this.hexToRgb(outlineColor);
  90550. // opacity使用style的透明度。保持两根线透明度一致
  90551. outlineColorArray && outlineColorArray.push(strokeOpacity);
  90552. var outlineWidth = outlineStyle.strokeWidth || (strokeWidth === 0 ? ZERO : strokeWidth + 2); //外部宽度=内部样式宽度 + 2
  90553. var outlineStroke = new (external_ol_style_Style_default())({
  90554. stroke: new (external_ol_style_Stroke_default())({
  90555. width: outlineWidth,
  90556. //外部宽度=内部样式宽度 + 2
  90557. color: outlineColorArray,
  90558. lineCap: lineCap || 'round',
  90559. lineDash: [0]
  90560. })
  90561. });
  90562. return [outlineStroke, stroke];
  90563. }
  90564. /**
  90565. * @function StyleUtils.getPathway 获取铁路样式
  90566. * @param {Object} style - 样式参数
  90567. * @param {Object} outlineStyle - 轮廓样式参数
  90568. * @returns {Object} style对象
  90569. */
  90570. }, {
  90571. key: "getPathway",
  90572. value: function getPathway(style, outlineStyle) {
  90573. var _style$strokeWidth2 = style.strokeWidth,
  90574. strokeWidth = _style$strokeWidth2 === void 0 ? ZERO : _style$strokeWidth2,
  90575. strokeColor = style.strokeColor,
  90576. strokeOpacity = style.strokeOpacity;
  90577. // 道路线都是solid, lineCap都是直角
  90578. var lineDash = function (w) {
  90579. return [w, w + strokeWidth * 2];
  90580. }(4 * strokeWidth),
  90581. lineCap = 'square';
  90582. var strokeColorArray = this.hexToRgb(strokeColor);
  90583. strokeColorArray && strokeColorArray.push(strokeOpacity);
  90584. var stroke = new (external_ol_style_Style_default())({
  90585. stroke: new (external_ol_style_Stroke_default())({
  90586. width: strokeWidth * 0.5 || ZERO,
  90587. color: strokeColorArray,
  90588. lineCap: lineCap,
  90589. lineDash: lineDash
  90590. })
  90591. });
  90592. var outlineColor = outlineStyle.strokeColor;
  90593. var outlineColorArray = this.hexToRgb(outlineColor);
  90594. // opacity使用style的透明度。保持两根线透明度一致
  90595. outlineColorArray && outlineColorArray.push(strokeOpacity);
  90596. var outlineStroke = new (external_ol_style_Style_default())({
  90597. stroke: new (external_ol_style_Stroke_default())({
  90598. width: strokeWidth || ZERO,
  90599. color: outlineColorArray,
  90600. lineCap: lineCap
  90601. })
  90602. });
  90603. return [outlineStroke, stroke];
  90604. }
  90605. }]);
  90606. return StyleUtils;
  90607. }();
  90608. ;// CONCATENATED MODULE: external "ol.Map"
  90609. var external_ol_Map_namespaceObject = ol.Map;
  90610. var external_ol_Map_default = /*#__PURE__*/__webpack_require__.n(external_ol_Map_namespaceObject);
  90611. ;// CONCATENATED MODULE: external "ol.layer.Group"
  90612. var external_ol_layer_Group_namespaceObject = ol.layer.Group;
  90613. var external_ol_layer_Group_default = /*#__PURE__*/__webpack_require__.n(external_ol_layer_Group_namespaceObject);
  90614. ;// CONCATENATED MODULE: ./src/openlayers/core/MapExtend.js
  90615. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  90616. * This program are made available under the terms of the Apache License, Version 2.0
  90617. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  90618. /**
  90619. * @function MapExtend
  90620. * @description 扩展 OpenLayers 的一些原始方法。
  90621. * @private
  90622. */
  90623. var MapExtend = function () {
  90624. var fun = function fun(layer, coordinate, resolution, callback, pixel, e) {
  90625. if (layer instanceof (external_ol_layer_Group_default())) {
  90626. layer.getLayers().forEach(function (subLayer) {
  90627. fun(subLayer, coordinate, resolution, callback, pixel, e);
  90628. });
  90629. } else {
  90630. //当前高效率点图层满足筛选条件/并且可视时,可被选中:
  90631. if (layer.getSource()._forEachFeatureAtCoordinate) {
  90632. layer.getSource()._forEachFeatureAtCoordinate(coordinate, resolution, function (feature) {
  90633. callback(feature, layer);
  90634. }, pixel, e);
  90635. }
  90636. }
  90637. };
  90638. (external_ol_Map_default()).prototype.forEachFeatureAtPixelDefault = (external_ol_Map_default()).prototype.forEachFeatureAtPixel;
  90639. (external_ol_Map_default()).prototype.forEachFeatureAtPixel = (external_ol_Map_default()).prototype.Tc = function (pixel, callback, opt_options, e) {
  90640. //如果满足高效率图层选取要求优先返回高效率图层选中结果
  90641. var layerFilter = opt_options && opt_options.layerFilter ? opt_options.layerFilter : function () {
  90642. return true;
  90643. };
  90644. var layers = this.getLayers().getArray();
  90645. var resolution = this.getView().getResolution();
  90646. var coordinate = this.getCoordinateFromPixel(pixel);
  90647. for (var i = 0; i < layers.length; i++) {
  90648. var layer = layers[i];
  90649. if (layer.getVisible() && layerFilter.call(null, layer)) {
  90650. fun(layer, coordinate, resolution, callback, pixel, e);
  90651. }
  90652. }
  90653. return this.forEachFeatureAtPixelDefault(pixel, callback, opt_options);
  90654. };
  90655. }();
  90656. ;// CONCATENATED MODULE: ./src/openlayers/core/index.js
  90657. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  90658. * This program are made available under the terms of the Apache License, Version 2.0
  90659. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  90660. ;// CONCATENATED MODULE: external "ol.source.TileImage"
  90661. var external_ol_source_TileImage_namespaceObject = ol.source.TileImage;
  90662. var external_ol_source_TileImage_default = /*#__PURE__*/__webpack_require__.n(external_ol_source_TileImage_namespaceObject);
  90663. ;// CONCATENATED MODULE: external "ol.asserts"
  90664. var external_ol_asserts_namespaceObject = ol.asserts;
  90665. ;// CONCATENATED MODULE: external "ol.tilegrid.TileGrid"
  90666. var external_ol_tilegrid_TileGrid_namespaceObject = ol.tilegrid.TileGrid;
  90667. var external_ol_tilegrid_TileGrid_default = /*#__PURE__*/__webpack_require__.n(external_ol_tilegrid_TileGrid_namespaceObject);
  90668. ;// CONCATENATED MODULE: ./src/openlayers/mapping/BaiduMap.js
  90669. function BaiduMap_typeof(obj) { "@babel/helpers - typeof"; return BaiduMap_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, BaiduMap_typeof(obj); }
  90670. function BaiduMap_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  90671. function BaiduMap_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  90672. function BaiduMap_createClass(Constructor, protoProps, staticProps) { if (protoProps) BaiduMap_defineProperties(Constructor.prototype, protoProps); if (staticProps) BaiduMap_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  90673. function BaiduMap_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) BaiduMap_setPrototypeOf(subClass, superClass); }
  90674. function BaiduMap_setPrototypeOf(o, p) { BaiduMap_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return BaiduMap_setPrototypeOf(o, p); }
  90675. function BaiduMap_createSuper(Derived) { var hasNativeReflectConstruct = BaiduMap_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = BaiduMap_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = BaiduMap_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return BaiduMap_possibleConstructorReturn(this, result); }; }
  90676. function BaiduMap_possibleConstructorReturn(self, call) { if (call && (BaiduMap_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return BaiduMap_assertThisInitialized(self); }
  90677. function BaiduMap_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  90678. function BaiduMap_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  90679. function BaiduMap_getPrototypeOf(o) { BaiduMap_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BaiduMap_getPrototypeOf(o); }
  90680. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  90681. * This program are made available under the terms of the Apache License, Version 2.0
  90682. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  90683. /**
  90684. * @class BaiduMap
  90685. * @browsernamespace ol.source
  90686. * @category ThirdPartyMap
  90687. * @classdesc 百度地图图层源。
  90688. * @modulecategory Mapping
  90689. * @param {Object} opt_options - 参数。
  90690. * @param {string} [opt_options.url='http://online1.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles={styles}&udt=20170408'] - 服务地址。
  90691. * @param {string} [opt_options.tileProxy] - 代理地址。
  90692. * @param {boolean} [hidpi = false] - 是否使用高分辨率地图。
  90693. * @extends {ol.source.TileImage}
  90694. * @usage
  90695. */
  90696. var BaiduMap = /*#__PURE__*/function (_TileImage) {
  90697. BaiduMap_inherits(BaiduMap, _TileImage);
  90698. var _super = BaiduMap_createSuper(BaiduMap);
  90699. function BaiduMap(opt_options) {
  90700. var _this;
  90701. BaiduMap_classCallCheck(this, BaiduMap);
  90702. var options = opt_options || {};
  90703. var attributions = options.attributions || "Map Data © 2018 Baidu - GS(2016)2089号 - Data © 长地万方 with <span>© SuperMap iClient</span>";
  90704. var tileGrid = BaiduMap.defaultTileGrid();
  90705. var crossOrigin = options.crossOrigin !== undefined ? options.crossOrigin : 'anonymous';
  90706. var url = options.url !== undefined ? options.url : 'http://online1.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles={styles}&udt=20170408';
  90707. var hidpi = options.hidpi || (window.devicePixelRatio || window.screen.deviceXDPI / window.screen.logicalXDPI) > 1;
  90708. url = url.replace('{styles}', hidpi ? 'ph' : 'pl');
  90709. _this = _super.call(this, {
  90710. attributions: attributions,
  90711. cacheSize: options.cacheSize,
  90712. crossOrigin: crossOrigin,
  90713. opaque: options.opaque !== undefined ? options.opaque : true,
  90714. maxZoom: options.maxZoom !== undefined ? options.maxZoom : 19,
  90715. reprojectionErrorThreshold: options.reprojectionErrorThreshold,
  90716. tileLoadFunction: options.tileLoadFunction,
  90717. projection: 'EPSG:3857',
  90718. wrapX: options.wrapX,
  90719. tilePixelRatio: hidpi ? 2 : 1,
  90720. tileGrid: tileGrid,
  90721. tileUrlFunction: tileUrlFunction
  90722. });
  90723. if (options.tileProxy) {
  90724. _this.tileProxy = options.tileProxy;
  90725. }
  90726. var me = BaiduMap_assertThisInitialized(_this);
  90727. // eslint-disable-next-line no-unused-vars
  90728. function tileUrlFunction(tileCoord, pixelRatio, projection) {
  90729. var tempUrl = url.replace('{z}', tileCoord[0].toString()).replace('{x}', tileCoord[1].toString()).replace('{y}', function () {
  90730. console.log(core_Util_Util.getOlVersion());
  90731. var y = ['4', '5'].indexOf(core_Util_Util.getOlVersion()) > -1 ? tileCoord[2] : -tileCoord[2] - 1;
  90732. return y.toString();
  90733. }).replace('{-y}', function () {
  90734. var z = tileCoord[0];
  90735. var range = tileGrid.getFullTileRange(z);
  90736. external_ol_asserts_namespaceObject.assert(range, 55); // The {-y} placeholder requires a tile grid with extent
  90737. var y = range.getHeight() + tileCoord[2];
  90738. return y.toString();
  90739. });
  90740. //支持代理
  90741. if (me.tileProxy) {
  90742. tempUrl = me.tileProxy + encodeURIComponent(tempUrl);
  90743. }
  90744. return tempUrl;
  90745. }
  90746. return _this;
  90747. }
  90748. // TODO 确认这个方法是否要开出去
  90749. /**
  90750. * @function BaiduMap.defaultTileGrid
  90751. * @description 获取默认瓦片格网。
  90752. * @returns {ol.tilegrid.TileGrid} 返回瓦片格网对象。
  90753. */
  90754. BaiduMap_createClass(BaiduMap, null, [{
  90755. key: "defaultTileGrid",
  90756. value: function defaultTileGrid() {
  90757. var tileGird = new (external_ol_tilegrid_TileGrid_default())({
  90758. extent: [-33554432, -33554432, 33554432, 33554432],
  90759. resolutions: [131072 * 2, 131072, 65536, 32768, 16284, 8192, 4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5],
  90760. origin: [0, 0],
  90761. minZoom: 3
  90762. });
  90763. return tileGird;
  90764. }
  90765. }]);
  90766. return BaiduMap;
  90767. }((external_ol_source_TileImage_default()));
  90768. ;// CONCATENATED MODULE: external "ol.source.Image"
  90769. var external_ol_source_Image_namespaceObject = ol.source.Image;
  90770. var external_ol_source_Image_default = /*#__PURE__*/__webpack_require__.n(external_ol_source_Image_namespaceObject);
  90771. ;// CONCATENATED MODULE: external "ol.Image"
  90772. var external_ol_Image_namespaceObject = ol.Image;
  90773. var external_ol_Image_default = /*#__PURE__*/__webpack_require__.n(external_ol_Image_namespaceObject);
  90774. ;// CONCATENATED MODULE: external "ol.format.GeoJSON"
  90775. var external_ol_format_GeoJSON_namespaceObject = ol.format.GeoJSON;
  90776. var external_ol_format_GeoJSON_default = /*#__PURE__*/__webpack_require__.n(external_ol_format_GeoJSON_namespaceObject);
  90777. ;// CONCATENATED MODULE: external "ol.extent"
  90778. var external_ol_extent_namespaceObject = ol.extent;
  90779. ;// CONCATENATED MODULE: ./src/openlayers/mapping/ImageSuperMapRest.js
  90780. function ImageSuperMapRest_typeof(obj) { "@babel/helpers - typeof"; return ImageSuperMapRest_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ImageSuperMapRest_typeof(obj); }
  90781. function ImageSuperMapRest_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  90782. function ImageSuperMapRest_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  90783. function ImageSuperMapRest_createClass(Constructor, protoProps, staticProps) { if (protoProps) ImageSuperMapRest_defineProperties(Constructor.prototype, protoProps); if (staticProps) ImageSuperMapRest_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  90784. function ImageSuperMapRest_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ImageSuperMapRest_setPrototypeOf(subClass, superClass); }
  90785. function ImageSuperMapRest_setPrototypeOf(o, p) { ImageSuperMapRest_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ImageSuperMapRest_setPrototypeOf(o, p); }
  90786. function ImageSuperMapRest_createSuper(Derived) { var hasNativeReflectConstruct = ImageSuperMapRest_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ImageSuperMapRest_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ImageSuperMapRest_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ImageSuperMapRest_possibleConstructorReturn(this, result); }; }
  90787. function ImageSuperMapRest_possibleConstructorReturn(self, call) { if (call && (ImageSuperMapRest_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ImageSuperMapRest_assertThisInitialized(self); }
  90788. function ImageSuperMapRest_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  90789. function ImageSuperMapRest_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  90790. function ImageSuperMapRest_getPrototypeOf(o) { ImageSuperMapRest_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ImageSuperMapRest_getPrototypeOf(o); }
  90791. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  90792. * This program are made available under the terms of the Apache License, Version 2.0
  90793. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  90794. /**
  90795. * @class ImageSuperMapRest
  90796. * @browsernamespace ol.source
  90797. * @category iServer Map Tile
  90798. * @classdesc SuperMap iServer Image 图层源。
  90799. * @modulecategory Mapping
  90800. * @param {Object} options - 参数。
  90801. * @param {string} options.url - 地图服务地址,例如: http://{ip}:{port}/iserver/services/map-world/rest/maps/World。
  90802. * @param {ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务类型 ISERVER|IPORTAL|ONLINE。
  90803. * @param {boolean} [options.redirect=false] - 是否重定向。
  90804. * @param {boolean} [options.transparent=true] - 瓦片是否透明。
  90805. * @param {boolean} [options.antialias=false] - 是否反走样地图。
  90806. * @param {boolean} [options.cacheEnabled=true] - 是否使用服务端的缓存,true 表示使用服务端的缓存。
  90807. * @param {Object} [options.prjCoordSys] - 请求的地图的坐标参考系统。当此参数设置的坐标系统不同于地图的原有坐标系统时,系统会进行动态投影,并返回动态投影后的地图瓦片。例如:{"epsgCode":3857}。
  90808. * @param {string} [options.layersID] - 获取进行切片的地图图层 ID,即指定进行地图切片的图层,可以是临时图层集,也可以是当前地图中图层的组合。
  90809. * @param {boolean} [options.clipRegionEnabled = false] - 是否地图只显示该区域覆盖的部分。true 表示地图只显示该区域覆盖的部分。
  90810. * @param {ol.geom.Geometry} [options.clipRegion] - 地图显示裁剪的区域。是一个面对象,当 clipRegionEnabled = true 时有效,即地图只显示该区域覆盖的部分。
  90811. * @param {boolean} [options.overlapDisplayed=false] - 地图对象在同一范围内时,是否重叠显示。如果为 true,则同一范围内的对象会直接压盖;如果为 false 则通过 overlapDisplayedOptions 控制对象不压盖显示。
  90812. * @param {OverlapDisplayedOptions} [options.overlapDisplayedOptions] - 避免地图对象压盖显示的过滤选项,当 overlapDisplayed 为 false 时有效,用来增强对地图对象压盖时的处理。
  90813. * @param {boolean} [options.markerAngleFixed=false] - 指定点状符号的角度是否固定。
  90814. * @param {boolean} [options.textAngleFixed=false] - 文本角度是否固定。
  90815. * @param {boolean} [options.textOrientationFixed=false] - 文本朝向是否固定。
  90816. * @param {boolean} [options.paintBackground=false] - 是否绘制地图背景。
  90817. * @param {boolean} [options.maxVisibleTextSize] - 文本的最大可见尺寸,单位为像素。
  90818. * @param {boolean} [options.maxVisibleVertex] - 最大几何对象可见节点数。如果几何对象的节点数超过指定的个数,则超过的那部分节点不显示。
  90819. * @param {boolean} [options.minVisibleTextSize] - 文本的最小可见尺寸,单位为像素。
  90820. * @param {string} [options.tileversion] - 切片版本名称,_cache 为 true 时有效。
  90821. * @param {string} [options.tileProxy] - 代理地址。
  90822. * @param {NDVIParameter|HillshadeParameter} [options.rasterfunction] - 栅格分析参数。
  90823. * @param {string} [options.format = 'png'] - 瓦片表述类型,支持 "png" 、"webp"、"bmp" 、"jpg"、"gif" 等图片类型。
  90824. * @param {Function} [options.imageLoadFunction] - 加载图片的方法。默认为function(imageTile, src) {imageTile.getImage().src = src;};
  90825. * @param {string} [options.ratio=1.5] - 请求图片大小比例。 1 表示请求图片大小和地图视窗范围一致,2 表示请求图片大小是地图视窗范围的2倍,以此类推。
  90826. * @extends {ol.source.Image}
  90827. * @usage
  90828. */
  90829. var ImageSuperMapRest = /*#__PURE__*/function (_ImageSource) {
  90830. ImageSuperMapRest_inherits(ImageSuperMapRest, _ImageSource);
  90831. var _super = ImageSuperMapRest_createSuper(ImageSuperMapRest);
  90832. function ImageSuperMapRest(options) {
  90833. var _this;
  90834. ImageSuperMapRest_classCallCheck(this, ImageSuperMapRest);
  90835. _this = _super.call(this, {
  90836. attributions: options.attributions,
  90837. imageSmoothing: options.imageSmoothing,
  90838. projection: options.projection,
  90839. resolutions: options.resolutions
  90840. });
  90841. if (options.url === undefined) {
  90842. return ImageSuperMapRest_possibleConstructorReturn(_this);
  90843. }
  90844. _this.imageLoadFunction_ = options.imageLoadFunction !== undefined ? options.imageLoadFunction : external_ol_source_Image_namespaceObject.defaultImageLoadFunction;
  90845. _this._image = null;
  90846. _this.renderedRevision_ = 0;
  90847. _this._crossOrigin = options.crossOrigin !== undefined ? options.crossOrigin : null;
  90848. _this._url = options.url;
  90849. _this.ratio_ = options.ratio !== undefined ? options.ratio : 1.5;
  90850. options.attributions = options.attributions || "Map Data <span>© SuperMap iServer</span> with © SuperMap iClient";
  90851. options.format = options.format ? options.format : 'png';
  90852. _this._layerUrl = Util_Util.urlPathAppend(options.url, 'image.' + options.format);
  90853. //为url添加安全认证信息片段
  90854. _this._layerUrl = SecurityManager.appendCredential(_this._layerUrl);
  90855. var params = {};
  90856. //切片是否透明
  90857. var transparent = options.transparent !== undefined ? options.transparent : true;
  90858. params['transparent'] = transparent;
  90859. //是否使用缓存吗,默认为true
  90860. var cacheEnabled = options.cacheEnabled !== undefined ? options.cacheEnabled : true;
  90861. params['cacheEnabled'] = cacheEnabled;
  90862. //如果有layersID,则是在使用专题图
  90863. if (options.layersID !== undefined) {
  90864. params['layersID'] = options.layersID;
  90865. }
  90866. //是否重定向,默认为false
  90867. var redirect = false;
  90868. if (options.redirect !== undefined) {
  90869. redirect = options.redirect;
  90870. }
  90871. params['redirect'] = redirect;
  90872. if (options.prjCoordSys) {
  90873. params['prjCoordSys'] = JSON.stringify(options.prjCoordSys);
  90874. }
  90875. if (options.clipRegionEnabled && options.clipRegion instanceof (external_ol_geom_Geometry_default())) {
  90876. options.clipRegion = core_Util_Util.toSuperMapGeometry(new (external_ol_format_GeoJSON_default())().writeGeometryObject(options.clipRegion));
  90877. options.clipRegion = Util_Util.toJSON(ServerGeometry.fromGeometry(options.clipRegion));
  90878. params['clipRegionEnabled'] = options.clipRegionEnabled;
  90879. params['clipRegion'] = JSON.stringify(options.clipRegion);
  90880. }
  90881. if (!!options.overlapDisplayed && options.overlapDisplayedOptions) {
  90882. // options.overlapDisplayedOptions = options.overlapDisplayedOptions;
  90883. params['overlapDisplayed'] = options.overlapDisplayed;
  90884. params['overlapDisplayedOptions'] = options.overlapDisplayedOptions.toString();
  90885. }
  90886. if (cacheEnabled === true && options.tileversion) {
  90887. params['tileversion'] = options.tileversion;
  90888. }
  90889. if (options.rasterfunction) {
  90890. params['rasterfunction'] = JSON.stringify(options.rasterfunction);
  90891. }
  90892. //是否反走样地图,默认为false
  90893. if (options.antialias !== undefined) {
  90894. params['antialias'] = options.antialias;
  90895. }
  90896. if (options.markerAngleFixed !== undefined) {
  90897. params['markerAngleFixed'] = options.markerAngleFixed;
  90898. }
  90899. if (options.textAngleFixed !== undefined) {
  90900. params['textAngleFixed'] = options.textAngleFixed;
  90901. }
  90902. if (options.textOrientationFixed !== undefined) {
  90903. params['textOrientationFixed'] = options.textOrientationFixed;
  90904. }
  90905. if (options.paintBackground !== undefined) {
  90906. params['paintBackground'] = options.paintBackground;
  90907. }
  90908. if (!isNaN(options.maxVisibleTextSize)) {
  90909. params['maxVisibleTextSize'] = +options.maxVisibleTextSize;
  90910. }
  90911. if (!isNaN(options.minVisibleTextSize)) {
  90912. params['maxVisibleTextSize'] = +options.minVisibleTextSize;
  90913. }
  90914. if (!isNaN(options.maxVisibleVertex)) {
  90915. params['maxVisibleVertex'] = Math.round(+options.maxVisibleVertex);
  90916. }
  90917. _this._layerUrl = Util_Util.urlAppend(_this._layerUrl, Util_Util.getParameterString(params));
  90918. //存储一个cacheEnabled
  90919. _this.cacheEnabled = cacheEnabled;
  90920. if (options.tileProxy) {
  90921. _this.tileProxy = options.tileProxy;
  90922. }
  90923. return _this;
  90924. }
  90925. ImageSuperMapRest_createClass(ImageSuperMapRest, [{
  90926. key: "getImageInternal",
  90927. value: function getImageInternal(extent, resolution, pixelRatio) {
  90928. resolution = this.findNearestResolution(resolution);
  90929. var imageResolution = resolution / pixelRatio;
  90930. var center = (0,external_ol_extent_namespaceObject.getCenter)(extent);
  90931. var viewWidth = Math.ceil((0,external_ol_extent_namespaceObject.getWidth)(extent) / imageResolution);
  90932. var viewHeight = Math.ceil((0,external_ol_extent_namespaceObject.getHeight)(extent) / imageResolution);
  90933. var viewExtent = (0,external_ol_extent_namespaceObject.getForViewAndSize)(center, imageResolution, 0, [viewWidth, viewHeight]);
  90934. var requestWidth = Math.ceil(this.ratio_ * (0,external_ol_extent_namespaceObject.getWidth)(extent) / imageResolution);
  90935. var requestHeight = Math.ceil(this.ratio_ * (0,external_ol_extent_namespaceObject.getHeight)(extent) / imageResolution);
  90936. var requestExtent = (0,external_ol_extent_namespaceObject.getForViewAndSize)(center, imageResolution, 0, [requestWidth, requestHeight]);
  90937. var image = this._image;
  90938. if (image && this.renderedRevision_ === this.getRevision() && image.getResolution() === resolution && image.getPixelRatio() === pixelRatio && (0,external_ol_extent_namespaceObject.containsExtent)(image.getExtent(), viewExtent)) {
  90939. return image;
  90940. }
  90941. var imageSize = [Math.round((0,external_ol_extent_namespaceObject.getWidth)(requestExtent) / imageResolution), Math.round((0,external_ol_extent_namespaceObject.getHeight)(requestExtent) / imageResolution)];
  90942. var imageUrl = this._getRequestUrl(requestExtent, imageSize);
  90943. this._image = new (external_ol_Image_default())(requestExtent, resolution, pixelRatio, imageUrl, this._crossOrigin, this.imageLoadFunction_);
  90944. this.renderedRevision_ = this.getRevision();
  90945. this._image.addEventListener('change', this.handleImageChange.bind(this));
  90946. return this._image;
  90947. }
  90948. }, {
  90949. key: "_getRequestUrl",
  90950. value: function _getRequestUrl(extent, imageSize) {
  90951. var params = {
  90952. width: imageSize[0],
  90953. height: imageSize[1],
  90954. viewBounds: {
  90955. leftBottom: {
  90956. x: extent[0],
  90957. y: extent[1]
  90958. },
  90959. rightTop: {
  90960. x: extent[2],
  90961. y: extent[3]
  90962. }
  90963. }
  90964. };
  90965. //不启用缓存时启用时间戳
  90966. if (!this.cacheEnabled) {
  90967. params['_t'] = new Date().getTime();
  90968. }
  90969. var imageUrl = Util_Util.urlAppend(this._layerUrl, Util_Util.getParameterString(params));
  90970. //支持代理
  90971. if (this.tileProxy) {
  90972. imageUrl = this.tileProxy + encodeURIComponent(imageUrl);
  90973. }
  90974. return imageUrl;
  90975. }
  90976. /**
  90977. * @function ImageSuperMapRest.optionsFromMapJSON
  90978. * @param {string} url - 地址。
  90979. * @param {Object} mapJSONObj - 地图 JSON。
  90980. * @description 获取地图 JSON 信息。
  90981. */
  90982. }], [{
  90983. key: "optionsFromMapJSON",
  90984. value: function optionsFromMapJSON(url, mapJSONObj) {
  90985. var extent = [mapJSONObj.bounds.left, mapJSONObj.bounds.bottom, mapJSONObj.bounds.right, mapJSONObj.bounds.top];
  90986. var resolutions = getResolutions();
  90987. function getResolutions() {
  90988. var level = 28;
  90989. var dpi = 96;
  90990. var width = extent[2] - extent[0];
  90991. var height = extent[3] - extent[1];
  90992. var tileSize = width >= height ? width : height;
  90993. var maxReolution;
  90994. if (tileSize === width) {
  90995. maxReolution = tileSize / mapJSONObj.viewer.width;
  90996. } else {
  90997. maxReolution = tileSize / mapJSONObj.viewer.height;
  90998. }
  90999. var resolutions = [];
  91000. var unit = Unit.METER;
  91001. if (mapJSONObj.coordUnit === Unit.DEGREE) {
  91002. unit = Unit.DEGREE;
  91003. }
  91004. if (mapJSONObj.visibleScales.length > 0) {
  91005. for (var i = 0; i < mapJSONObj.visibleScales.length; i++) {
  91006. resolutions.push(core_Util_Util.scaleToResolution(mapJSONObj.visibleScales[i], dpi, unit));
  91007. }
  91008. } else {
  91009. for (var _i2 = 0; _i2 < level; _i2++) {
  91010. resolutions.push(maxReolution / Math.pow(2, _i2));
  91011. }
  91012. }
  91013. function sortNumber(a, b) {
  91014. return b - a;
  91015. }
  91016. return resolutions.sort(sortNumber);
  91017. }
  91018. return {
  91019. url: url,
  91020. resolutions: resolutions
  91021. };
  91022. }
  91023. }]);
  91024. return ImageSuperMapRest;
  91025. }((external_ol_source_Image_default()));
  91026. ;// CONCATENATED MODULE: external "ol.source.XYZ"
  91027. var external_ol_source_XYZ_namespaceObject = ol.source.XYZ;
  91028. var external_ol_source_XYZ_default = /*#__PURE__*/__webpack_require__.n(external_ol_source_XYZ_namespaceObject);
  91029. ;// CONCATENATED MODULE: ./src/openlayers/mapping/SuperMapCloud.js
  91030. function SuperMapCloud_typeof(obj) { "@babel/helpers - typeof"; return SuperMapCloud_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SuperMapCloud_typeof(obj); }
  91031. function SuperMapCloud_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  91032. function SuperMapCloud_createClass(Constructor, protoProps, staticProps) { if (protoProps) SuperMapCloud_defineProperties(Constructor.prototype, protoProps); if (staticProps) SuperMapCloud_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  91033. function SuperMapCloud_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  91034. function SuperMapCloud_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SuperMapCloud_setPrototypeOf(subClass, superClass); }
  91035. function SuperMapCloud_setPrototypeOf(o, p) { SuperMapCloud_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SuperMapCloud_setPrototypeOf(o, p); }
  91036. function SuperMapCloud_createSuper(Derived) { var hasNativeReflectConstruct = SuperMapCloud_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SuperMapCloud_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SuperMapCloud_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SuperMapCloud_possibleConstructorReturn(this, result); }; }
  91037. function SuperMapCloud_possibleConstructorReturn(self, call) { if (call && (SuperMapCloud_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SuperMapCloud_assertThisInitialized(self); }
  91038. function SuperMapCloud_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  91039. function SuperMapCloud_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  91040. function SuperMapCloud_getPrototypeOf(o) { SuperMapCloud_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SuperMapCloud_getPrototypeOf(o); }
  91041. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  91042. * This program are made available under the terms of the Apache License, Version 2.0
  91043. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  91044. /**
  91045. * @class SuperMapCloud
  91046. * @browsernamespace ol.source
  91047. * @category ThirdPartyMap
  91048. * @classdesc 超图云地图图层源。
  91049. * @modulecategory Mapping
  91050. * @param {Object} opt_options - 参数。
  91051. * @param {string} [opt_options.url='http://t2.dituhui.com/FileService/image?map={mapName}&type={type}&x={x}&y={y}&z={z}'] - 服务地址。
  91052. * @param {string} [opt_options.tileProxy] - 代理地址。
  91053. * @extends {ol.source.XYZ}
  91054. * @usage
  91055. */
  91056. var SuperMapCloud = /*#__PURE__*/function (_XYZ) {
  91057. SuperMapCloud_inherits(SuperMapCloud, _XYZ);
  91058. var _super = SuperMapCloud_createSuper(SuperMapCloud);
  91059. function SuperMapCloud(opt_options) {
  91060. var _this;
  91061. SuperMapCloud_classCallCheck(this, SuperMapCloud);
  91062. var options = opt_options || {};
  91063. var attributions = options.attributions || "Map Data ©2014 SuperMap - GS(2014)6070号-data©Navinfo with <span>© SuperMap iClient</span>";
  91064. var mapName = options.mapName || 'quanguo';
  91065. var mapType = options.mapType || 'web';
  91066. var url = options.url || 'http://t2.dituhui.com/FileService/image?map={mapName}&type={type}&x={x}&y={y}&z={z}';
  91067. url = url.replace('{mapName}', mapName).replace('{type}', mapType);
  91068. var superOptions = {
  91069. attributions: attributions,
  91070. cacheSize: options.cacheSize,
  91071. crossOrigin: options.crossOrigin,
  91072. opaque: options.opaque === undefined ? true : options.opaque,
  91073. maxZoom: options.maxZoom || 18,
  91074. reprojectionErrorThreshold: options.reprojectionErrorThreshold,
  91075. url: url,
  91076. wrapX: options.wrapX
  91077. };
  91078. //需要代理时走自定义 tileLoadFunction,否则走默认的tileLoadFunction
  91079. if (options.tileProxy) {
  91080. superOptions.tileLoadFunction = tileLoadFunction;
  91081. }
  91082. _this = _super.call(this, superOptions);
  91083. if (options.tileProxy) {
  91084. _this.tileProxy = options.tileProxy;
  91085. }
  91086. //需要代理时,走以下代码
  91087. var me = SuperMapCloud_assertThisInitialized(_this);
  91088. function tileLoadFunction(imageTile, src) {
  91089. //支持代理
  91090. imageTile.getImage().src = me.tileProxy + encodeURIComponent(src);
  91091. }
  91092. return _this;
  91093. }
  91094. return SuperMapCloud_createClass(SuperMapCloud);
  91095. }((external_ol_source_XYZ_default()));
  91096. ;// CONCATENATED MODULE: external "ol.source.WMTS"
  91097. var external_ol_source_WMTS_namespaceObject = ol.source.WMTS;
  91098. var external_ol_source_WMTS_default = /*#__PURE__*/__webpack_require__.n(external_ol_source_WMTS_namespaceObject);
  91099. ;// CONCATENATED MODULE: external "ol.tilegrid.WMTS"
  91100. var external_ol_tilegrid_WMTS_namespaceObject = ol.tilegrid.WMTS;
  91101. var external_ol_tilegrid_WMTS_default = /*#__PURE__*/__webpack_require__.n(external_ol_tilegrid_WMTS_namespaceObject);
  91102. ;// CONCATENATED MODULE: ./src/openlayers/mapping/Tianditu.js
  91103. function Tianditu_typeof(obj) { "@babel/helpers - typeof"; return Tianditu_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Tianditu_typeof(obj); }
  91104. function Tianditu_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  91105. function Tianditu_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  91106. function Tianditu_createClass(Constructor, protoProps, staticProps) { if (protoProps) Tianditu_defineProperties(Constructor.prototype, protoProps); if (staticProps) Tianditu_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  91107. function Tianditu_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Tianditu_setPrototypeOf(subClass, superClass); }
  91108. function Tianditu_setPrototypeOf(o, p) { Tianditu_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Tianditu_setPrototypeOf(o, p); }
  91109. function Tianditu_createSuper(Derived) { var hasNativeReflectConstruct = Tianditu_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Tianditu_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Tianditu_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Tianditu_possibleConstructorReturn(this, result); }; }
  91110. function Tianditu_possibleConstructorReturn(self, call) { if (call && (Tianditu_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Tianditu_assertThisInitialized(self); }
  91111. function Tianditu_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  91112. function Tianditu_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  91113. function Tianditu_getPrototypeOf(o) { Tianditu_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Tianditu_getPrototypeOf(o); }
  91114. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  91115. * This program are made available under the terms of the Apache License, Version 2.0
  91116. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  91117. /**
  91118. * @class Tianditu
  91119. * @browsernamespace ol.source
  91120. * @category ThirdPartyMap
  91121. * @classdesc 天地图图层源。
  91122. * @modulecategory Mapping
  91123. * @param {Object} opt_options - 参数。
  91124. * @param {string} [opt_options.url='http://t{0-7}.tianditu.gov.cn/{layer}_{proj}/wmts?'] - 服务地址。
  91125. * @param {string} opt_options.key - 天地图服务密钥。详见{@link http://lbs.tianditu.gov.cn/server/MapService.html}
  91126. * @param {string} [opt_options.layerType='vec'] - 图层类型。(vec:矢量图层,img:影像图层,ter:地形图层)
  91127. * @param {string} [opt_options.attributions] - 版权描述信息。
  91128. * @param {number} [opt_options.cacheSize = 2048] - 缓冲大小。
  91129. * @param {function} [opt_options.tileLoadFunction] - 切片加载完成后执行函数。
  91130. * @param {string} [opt_options.style] - 图层风格。
  91131. * @param {string} [opt_options.format='tiles'] - 格式。
  91132. * @param {boolean} [opt_options.isLabel] - 是否是标注图层。
  91133. * @param {boolean} [opt_options.opaque=true] - 是否透明。
  91134. * @param {string} [opt_options.tileProxy] - 代理地址。
  91135. * @extends {ol.source.WMTS}
  91136. * @usage
  91137. */
  91138. var Tianditu = /*#__PURE__*/function (_WMTS) {
  91139. Tianditu_inherits(Tianditu, _WMTS);
  91140. var _super = Tianditu_createSuper(Tianditu);
  91141. function Tianditu(opt_options) {
  91142. var _this;
  91143. Tianditu_classCallCheck(this, Tianditu);
  91144. var layerLabelMap = {
  91145. "vec": "cva",
  91146. "ter": "cta",
  91147. "img": "cia"
  91148. };
  91149. var layerZoomMap = {
  91150. "vec": 18,
  91151. "ter": 14,
  91152. "img": 18
  91153. };
  91154. var options = opt_options || {};
  91155. var attributions = options.attributions || "Map Data <a href='http://www.tianditu.gov.cn' target='_blank'><img style='background-color:transparent;bottom:2px;opacity:1;' " + "src='http://api.tianditu.gov.cn/img/map/logo.png' width='53px' height='22px' opacity='0'></a> with " + "<span>© SuperMap iClient</span>";
  91156. options.layerType = options.layerType || "vec";
  91157. options.layerType = options.isLabel ? layerLabelMap[options.layerType] : options.layerType;
  91158. options.matrixSet = options.projection === 'EPSG:4326' || options.projection === 'EPSG:4490' ? "c" : "w";
  91159. if (!options.url && !options.urls) {
  91160. options.url = "http://t{0-7}.tianditu.gov.cn/{layer}_{proj}/wmts?";
  91161. }
  91162. if (options.key) {
  91163. options.url = "".concat(options.url, "tk=").concat(options.key);
  91164. }
  91165. options.url = options.url.replace("{layer}", options.layerType).replace("{proj}", options.matrixSet);
  91166. var tileGrid = options.tileGrid || Tianditu.getTileGrid(options.projection || 'EPSG:3857');
  91167. var crossOrigin = options.crossOrigin !== undefined ? options.crossOrigin : 'anonymous';
  91168. var superOptions = {
  91169. version: options.version || '1.0.0',
  91170. format: options.format || 'tiles',
  91171. dimensions: options.dimensions || {},
  91172. layer: options.layerType,
  91173. matrixSet: options.matrixSet,
  91174. tileGrid: tileGrid,
  91175. style: options.style || 'default',
  91176. attributions: attributions,
  91177. cacheSize: options.cacheSize,
  91178. crossOrigin: crossOrigin,
  91179. opaque: options.opaque === undefined ? true : options.opaque,
  91180. maxZoom: layerZoomMap[options.layerType],
  91181. reprojectionErrorThreshold: options.reprojectionErrorThreshold,
  91182. url: options.url,
  91183. urls: options.urls,
  91184. projection: options.projection || 'EPSG:3857',
  91185. wrapX: options.wrapX
  91186. };
  91187. //需要代理时走自定义 tileLoadFunction,否则走默认的tileLoadFunction
  91188. if (options.tileProxy) {
  91189. superOptions.tileLoadFunction = tileLoadFunction;
  91190. }
  91191. _this = _super.call(this, superOptions);
  91192. if (options.tileProxy) {
  91193. _this.tileProxy = options.tileProxy;
  91194. }
  91195. //需要代理时,走以下代码
  91196. var me = Tianditu_assertThisInitialized(_this);
  91197. function tileLoadFunction(imageTile, src) {
  91198. //支持代理
  91199. imageTile.getImage().src = me.tileProxy + encodeURIComponent(src);
  91200. }
  91201. return _this;
  91202. }
  91203. /**
  91204. * @function Tianditu.getTileGrid
  91205. * @description 获取瓦片网格。
  91206. * @param {string} projection - 投影参考对象。
  91207. * @returns {ol.tilegrid.WMTS} 返回瓦片网格对象。
  91208. */
  91209. Tianditu_createClass(Tianditu, null, [{
  91210. key: "getTileGrid",
  91211. value: function getTileGrid(projection) {
  91212. if (projection === "EPSG:4326" || projection === "EPSG:4490") {
  91213. return Tianditu.default4326TileGrid();
  91214. }
  91215. return Tianditu.default3857TileGrid();
  91216. }
  91217. /**
  91218. * @function Tianditu.default4326TileGrid
  91219. * @description 获取默认 4326 网格瓦片。
  91220. * @returns {ol.tilegrid.WMTS} 返回默认 4326 网格瓦片对象。
  91221. */
  91222. }, {
  91223. key: "default4326TileGrid",
  91224. value: function default4326TileGrid() {
  91225. var tdt_WGS84_resolutions = [];
  91226. var matrixIds = [];
  91227. for (var i = 1; i < 19; i++) {
  91228. tdt_WGS84_resolutions.push(0.703125 * 2 / Math.pow(2, i));
  91229. matrixIds.push(i);
  91230. }
  91231. var tileGird = new (external_ol_tilegrid_WMTS_default())({
  91232. extent: [-180, -90, 180, 90],
  91233. resolutions: tdt_WGS84_resolutions,
  91234. origin: [-180, 90],
  91235. matrixIds: matrixIds,
  91236. minZoom: 1
  91237. });
  91238. return tileGird;
  91239. }
  91240. /**
  91241. * @function Tianditu.default3857TileGrid
  91242. * @description 获取默认 3857 网格瓦片。
  91243. * @returns {ol.tilegrid.WMTS} 返回默认 3857 网格瓦片对象。
  91244. */
  91245. }, {
  91246. key: "default3857TileGrid",
  91247. value: function default3857TileGrid() {
  91248. var tdt_Mercator_resolutions = [];
  91249. var matrixIds = [];
  91250. for (var i = 1; i < 19; i++) {
  91251. tdt_Mercator_resolutions.push(78271.5169640203125 * 2 / Math.pow(2, i));
  91252. matrixIds.push(i);
  91253. }
  91254. var tileGird = new (external_ol_tilegrid_WMTS_default())({
  91255. extent: [-20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892],
  91256. resolutions: tdt_Mercator_resolutions,
  91257. matrixIds: matrixIds,
  91258. origin: [-20037508.3427892, 20037508.3427892],
  91259. minZoom: 1
  91260. });
  91261. return tileGird;
  91262. }
  91263. }]);
  91264. return Tianditu;
  91265. }((external_ol_source_WMTS_default()));
  91266. ;// CONCATENATED MODULE: external "ol.size"
  91267. var external_ol_size_namespaceObject = ol.size;
  91268. ;// CONCATENATED MODULE: external "ol.tilegrid"
  91269. var external_ol_tilegrid_namespaceObject = ol.tilegrid;
  91270. ;// CONCATENATED MODULE: ./src/openlayers/mapping/TileSuperMapRest.js
  91271. function TileSuperMapRest_typeof(obj) { "@babel/helpers - typeof"; return TileSuperMapRest_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, TileSuperMapRest_typeof(obj); }
  91272. function TileSuperMapRest_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  91273. function TileSuperMapRest_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  91274. function TileSuperMapRest_createClass(Constructor, protoProps, staticProps) { if (protoProps) TileSuperMapRest_defineProperties(Constructor.prototype, protoProps); if (staticProps) TileSuperMapRest_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  91275. function TileSuperMapRest_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) TileSuperMapRest_setPrototypeOf(subClass, superClass); }
  91276. function TileSuperMapRest_setPrototypeOf(o, p) { TileSuperMapRest_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TileSuperMapRest_setPrototypeOf(o, p); }
  91277. function TileSuperMapRest_createSuper(Derived) { var hasNativeReflectConstruct = TileSuperMapRest_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = TileSuperMapRest_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = TileSuperMapRest_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return TileSuperMapRest_possibleConstructorReturn(this, result); }; }
  91278. function TileSuperMapRest_possibleConstructorReturn(self, call) { if (call && (TileSuperMapRest_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return TileSuperMapRest_assertThisInitialized(self); }
  91279. function TileSuperMapRest_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  91280. function TileSuperMapRest_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  91281. function TileSuperMapRest_getPrototypeOf(o) { TileSuperMapRest_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TileSuperMapRest_getPrototypeOf(o); }
  91282. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  91283. * This program are made available under the terms of the Apache License, Version 2.0
  91284. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  91285. /**
  91286. * @class TileSuperMapRest
  91287. * @browsernamespace ol.source
  91288. * @category iServer Map Tile
  91289. * @modulecategory Mapping
  91290. * @classdesc SuperMap iServer TileImage 图层源。
  91291. * @param {Object} options - 参数。
  91292. * @param {string} options.url - 服务地址,例如: http://{ip}:{port}/iserver/services/map-world/rest/maps/World。
  91293. * @param {ol.tilegrid.TileGrid} [options.tileGrid] - 瓦片网格对象。当不指定时,会通过 options.extent 或投影范围生成。
  91294. * @param {boolean} [options.redirect = false] - 是否重定向。
  91295. * @param {boolean} [options.transparent = true] - 瓦片是否透明。
  91296. * @param {boolean} [options.cacheEnabled = true] - 是否使用服务端的缓存。
  91297. * @param {Object} [options.prjCoordSys] - 请求的地图的坐标参考系统。当此参数设置的坐标系统不同于地图的原有坐标系统时,系统会进行动态投影,并返回动态投影后的地图瓦片。例如:{"epsgCode":3857}。
  91298. * @param {string} [options.layersID] - 获取进行切片的地图图层 ID,即指定进行地图切片的图层,可以是临时图层集,也可以是当前地图中图层的组合。
  91299. * @param {boolean} [options.clipRegionEnabled = false] - 是否只地图只显示该区域覆盖的部分。true 表示地图只显示该区域覆盖的部分。
  91300. * @param {ol.geom.Geometry} [options.clipRegion] - 地图显示裁剪的区域。是一个面对象,当 clipRegionEnabled = true 时有效,即地图只显示该区域覆盖的部分。
  91301. * @param {boolean} [options.overlapDisplayed = false] - 地图对象在同一范围内时,是否重叠显示。如果为 true,则同一范围内的对象会直接压盖;如果为 false 则通过 overlapDisplayedOptions 控制对象不压盖显示。
  91302. * @param {OverlapDisplayedOptions} [options.overlapDisplayedOptions] - 避免地图对象压盖显示的过滤选项,当 overlapDisplayed 为 false 时有效,用来增强对地图对象压盖时的处理。
  91303. * @param {string} [options.tileversion] - 切片版本名称,_cache 为 true 时有效。
  91304. * @param {string} [options.tileProxy] - 服务代理地址。
  91305. * @param {string} [options.format = 'png'] - 瓦片表述类型,支持 "png" 、"webp"、"bmp" 、"jpg"、"gif" 等图片类型。
  91306. * @param {(NDVIParameter|HillshadeParameter)} [options.rasterfunction] - 栅格分析参数。
  91307. * @extends {ol.source.TileImage}
  91308. * @usage
  91309. */
  91310. var TileSuperMapRest = /*#__PURE__*/function (_TileImage) {
  91311. TileSuperMapRest_inherits(TileSuperMapRest, _TileImage);
  91312. var _super = TileSuperMapRest_createSuper(TileSuperMapRest);
  91313. function TileSuperMapRest(options) {
  91314. var _this;
  91315. TileSuperMapRest_classCallCheck(this, TileSuperMapRest);
  91316. options = options || {};
  91317. options.attributions = options.attributions || "Map Data <span>© SuperMap iServer</span> with <span>© SuperMap iClient</span>";
  91318. options.format = options.format ? options.format : 'png';
  91319. _this = _super.call(this, {
  91320. attributions: options.attributions,
  91321. cacheSize: options.cacheSize,
  91322. crossOrigin: options.crossOrigin,
  91323. logo: core_Util_Util.getOlVersion() === '4' ? options.logo : null,
  91324. opaque: options.opaque,
  91325. projection: options.projection,
  91326. reprojectionErrorThreshold: options.reprojectionErrorThreshold,
  91327. state: options.state,
  91328. tileClass: options.tileClass,
  91329. tileGrid: options.tileGrid,
  91330. tileLoadFunction: options.tileLoadFunction,
  91331. tilePixelRatio: options.tilePixelRatio,
  91332. tileUrlFunction: tileUrlFunction,
  91333. wrapX: options.wrapX !== undefined ? options.wrapX : false,
  91334. cacheEnabled: options.cacheEnabled,
  91335. layersID: options.layersID
  91336. });
  91337. if (options.tileProxy) {
  91338. _this.tileProxy = options.tileProxy;
  91339. }
  91340. _this.options = options;
  91341. _this._url = options.url;
  91342. //当前切片在切片集中的index
  91343. _this.tileSetsIndex = -1;
  91344. _this.tempIndex = -1;
  91345. _this.dpi = _this.options.dpi || 96;
  91346. var me = TileSuperMapRest_assertThisInitialized(_this);
  91347. var layerUrl = Util_Util.urlPathAppend(options.url, 'tileImage.' + options.format);
  91348. /**
  91349. * @function TileSuperMapRest.prototype.getAllRequestParams
  91350. * @description 获取全部请求参数。
  91351. */
  91352. function getAllRequestParams() {
  91353. var me = this,
  91354. params = {};
  91355. params['redirect'] = options.redirect !== undefined ? options.redirect : false;
  91356. //切片是否透明
  91357. params['transparent'] = options.transparent !== undefined ? options.transparent : true;
  91358. params['cacheEnabled'] = !(options.cacheEnabled === false);
  91359. //存储一个cacheEnabled参数
  91360. me.cacheEnabled = params['cacheEnabled'];
  91361. params['_cache'] = params['cacheEnabled'];
  91362. //设置切片原点
  91363. if (this.origin) {
  91364. params['origin'] = JSON.stringify({
  91365. x: this.origin[0],
  91366. y: this.origin[1]
  91367. });
  91368. }
  91369. if (options.prjCoordSys) {
  91370. params['prjCoordSys'] = JSON.stringify(options.prjCoordSys);
  91371. }
  91372. if (options.layersID) {
  91373. params['layersID'] = options.layersID.toString();
  91374. }
  91375. if (options.clipRegion instanceof (external_ol_geom_Geometry_default())) {
  91376. options.clipRegionEnabled = true;
  91377. options.clipRegion = core_Util_Util.toSuperMapGeometry(new (external_ol_format_GeoJSON_default())().writeGeometryObject(options.clipRegion));
  91378. options.clipRegion = Util_Util.toJSON(ServerGeometry.fromGeometry(options.clipRegion));
  91379. params['clipRegionEnabled'] = options.clipRegionEnabled;
  91380. params['clipRegion'] = JSON.stringify(options.clipRegion);
  91381. }
  91382. if (!options.overlapDisplayed) {
  91383. params['overlapDisplayed'] = false;
  91384. if (options.overlapDisplayedOptions) {
  91385. params['overlapDisplayedOptions'] = me.overlapDisplayedOptions.toString();
  91386. }
  91387. } else {
  91388. params['overlapDisplayed'] = true;
  91389. }
  91390. if (params.cacheEnabled && options.tileversion) {
  91391. params['tileversion'] = options.tileversion.toString();
  91392. }
  91393. if (options.rasterfunction) {
  91394. params['rasterfunction'] = JSON.stringify(options.rasterfunction);
  91395. }
  91396. return params;
  91397. }
  91398. /**
  91399. * @function TileSuperMapRest.prototype.getFullRequestUrl
  91400. * @description 获取完整的请求地址。
  91401. */
  91402. function getFullRequestUrl() {
  91403. if (this._paramsChanged) {
  91404. this._layerUrl = createLayerUrl.call(this);
  91405. this._paramsChanged = false;
  91406. }
  91407. return this._layerUrl || createLayerUrl.call(this);
  91408. }
  91409. /**
  91410. * @function TileSuperMapRest.prototype.createLayerUrl
  91411. * @description 获取新建图层地址。
  91412. */
  91413. function createLayerUrl() {
  91414. this.requestParams = this.requestParams || getAllRequestParams.call(this);
  91415. this._layerUrl = Util_Util.urlAppend(layerUrl, Util_Util.getParameterString(this.requestParams));
  91416. //为url添加安全认证信息片段
  91417. this._layerUrl = SecurityManager.appendCredential(this._layerUrl);
  91418. return this._layerUrl;
  91419. }
  91420. function tileUrlFunction(tileCoord, pixelRatio, projection) {
  91421. if (!me.tileGrid) {
  91422. if (options.extent) {
  91423. me.tileGrid = TileSuperMapRest.createTileGrid(options.extent);
  91424. if (me.resolutions) {
  91425. me.tileGrid.resolutions = me.resolutions;
  91426. }
  91427. } else {
  91428. if (projection.getCode() === 'EPSG:3857') {
  91429. me.tileGrid = TileSuperMapRest.createTileGrid([-20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892]);
  91430. me.extent = [-20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892];
  91431. }
  91432. if (projection.getCode() === 'EPSG:4326') {
  91433. me.tileGrid = TileSuperMapRest.createTileGrid([-180, -90, 180, 90]);
  91434. me.extent = [-180, -90, 180, 90];
  91435. }
  91436. }
  91437. }
  91438. me.origin = me.tileGrid.getOrigin(0);
  91439. var z = tileCoord[0];
  91440. var x = tileCoord[1];
  91441. var y = ['4', '5'].indexOf(core_Util_Util.getOlVersion()) > -1 ? -tileCoord[2] - 1 : tileCoord[2];
  91442. var resolution = me.tileGrid.getResolution(z);
  91443. var dpi = me.dpi || 96;
  91444. var unit = projection.getUnits() || Unit.DEGREE;
  91445. // OGC WKT 解析出单位是 degree
  91446. if (unit === 'degrees' || unit === 'degree') {
  91447. unit = Unit.DEGREE;
  91448. }
  91449. //通过wkt方式自定义坐标系的时候,是meter
  91450. if (unit === 'm' || unit === 'meter') {
  91451. unit = Unit.METER;
  91452. }
  91453. var scale = core_Util_Util.resolutionToScale(resolution, dpi, unit);
  91454. var tileSize = external_ol_size_namespaceObject.toSize(me.tileGrid.getTileSize(z, me.tmpSize));
  91455. var layerUrl = getFullRequestUrl.call(me);
  91456. var url = layerUrl + encodeURI('&x=' + x + '&y=' + y + '&width=' + tileSize[0] + '&height=' + tileSize[1] + '&scale=' + scale);
  91457. //支持代理
  91458. if (me.tileProxy) {
  91459. url = me.tileProxy + encodeURIComponent(url);
  91460. }
  91461. if (!me.cacheEnabled) {
  91462. url += '&_t=' + new Date().getTime();
  91463. }
  91464. return url;
  91465. }
  91466. return _this;
  91467. }
  91468. /**
  91469. * @function TileSuperMapRest.prototype.setTileSetsInfo
  91470. * @description 设置瓦片集信息。
  91471. * @param {Object} tileSets - 瓦片集合。
  91472. */
  91473. TileSuperMapRest_createClass(TileSuperMapRest, [{
  91474. key: "setTileSetsInfo",
  91475. value: function setTileSetsInfo(tileSets) {
  91476. this.tileSets = tileSets;
  91477. if (core_Util_Util.isArray(this.tileSets)) {
  91478. this.tileSets = tileSets[0];
  91479. }
  91480. if (!this.tileSets) {
  91481. return;
  91482. }
  91483. this.dispatchEvent({
  91484. type: 'tilesetsinfoloaded',
  91485. value: {
  91486. tileVersions: this.tileSets.tileVersions
  91487. }
  91488. });
  91489. this.changeTilesVersion();
  91490. }
  91491. /**
  91492. * @function TileSuperMapRest.prototype.lastTilesVersion
  91493. * @description 请求上一个版本切片,并重新绘制。
  91494. */
  91495. }, {
  91496. key: "lastTilesVersion",
  91497. value: function lastTilesVersion() {
  91498. this.tempIndex = this.tileSetsIndex - 1;
  91499. this.changeTilesVersion();
  91500. }
  91501. /**
  91502. * @function TileSuperMapRest.prototype.nextTilesVersion
  91503. * @description 请求下一个版本切片,并重新绘制。
  91504. */
  91505. }, {
  91506. key: "nextTilesVersion",
  91507. value: function nextTilesVersion() {
  91508. this.tempIndex = this.tileSetsIndex + 1;
  91509. this.changeTilesVersion();
  91510. }
  91511. /**
  91512. * @function TileSuperMapRest.prototype.changeTilesVersion
  91513. * @description 切换到某一版本的切片,并重绘。通过 this.tempIndex 保存需要切换的版本索引。
  91514. */
  91515. }, {
  91516. key: "changeTilesVersion",
  91517. value: function changeTilesVersion() {
  91518. var me = this;
  91519. //切片版本集信息是否存在
  91520. if (me.tileSets == null) {
  91521. return;
  91522. }
  91523. if (me.tempIndex === me.tileSetsIndex || this.tempIndex < 0) {
  91524. return;
  91525. }
  91526. //检测index是否可用
  91527. var tileVersions = me.tileSets.tileVersions;
  91528. if (tileVersions && me.tempIndex < tileVersions.length && me.tempIndex >= 0) {
  91529. var name = tileVersions[me.tempIndex].name;
  91530. var result = me.mergeTileVersionParam(name);
  91531. if (result) {
  91532. me.tileSetsIndex = me.tempIndex;
  91533. me.dispatchEvent({
  91534. type: 'tileversionschanged',
  91535. value: {
  91536. tileVersion: tileVersions[me.tempIndex]
  91537. }
  91538. });
  91539. }
  91540. }
  91541. }
  91542. /**
  91543. * @function TileSuperMapRest.prototype.updateCurrentTileSetsIndex
  91544. * @description 更新当前切片集索引,目前主要提供给控件使用。
  91545. * @param {number} index - 索引号。
  91546. */
  91547. }, {
  91548. key: "updateCurrentTileSetsIndex",
  91549. value: function updateCurrentTileSetsIndex(index) {
  91550. this.tempIndex = index;
  91551. }
  91552. /**
  91553. * @function TileSuperMapRest.prototype.mergeTileVersionParam
  91554. * @description 更改 URL 请求参数中的切片版本号,并重绘。
  91555. * @param {Object} version - 版本信息。
  91556. * @returns {boolean} 是否成功。
  91557. */
  91558. }, {
  91559. key: "mergeTileVersionParam",
  91560. value: function mergeTileVersionParam(version) {
  91561. if (version) {
  91562. this.requestParams['tileversion'] = version;
  91563. this._paramsChanged = true;
  91564. this.refresh();
  91565. return true;
  91566. }
  91567. return false;
  91568. }
  91569. /**
  91570. * @function TileSuperMapRest.optionsFromMapJSON
  91571. * @description 从 MapJSON 中获取参数对象。
  91572. * @param {string} url - 服务地址。
  91573. * @param {Object} mapJSONObj - 地图 JSON 对象。
  91574. */
  91575. }], [{
  91576. key: "optionsFromMapJSON",
  91577. value: function optionsFromMapJSON(url, mapJSONObj) {
  91578. var options = {};
  91579. options.url = url;
  91580. options.crossOrigin = 'anonymous';
  91581. var extent = [mapJSONObj.bounds.left, mapJSONObj.bounds.bottom, mapJSONObj.bounds.right, mapJSONObj.bounds.top];
  91582. var visibleScales = mapJSONObj.visibleScales,
  91583. bounds = mapJSONObj.bounds,
  91584. dpi = mapJSONObj.dpi,
  91585. coordUnit = mapJSONObj.coordUnit;
  91586. var resolutions = core_Util_Util.scalesToResolutions(visibleScales, bounds, dpi, coordUnit);
  91587. options.tileGrid = new (external_ol_tilegrid_TileGrid_default())({
  91588. extent: extent,
  91589. resolutions: resolutions
  91590. });
  91591. return options;
  91592. }
  91593. /**
  91594. * @function TileSuperMapRest.createTileGrid
  91595. * @description 创建切片网格。
  91596. * @param {number} extent - 长度。
  91597. * @param {number} maxZoom - 最大的放大级别。
  91598. * @param {number} minZoom - 最小的放大级别。
  91599. * @param {number} tileSize - 瓦片的尺寸。
  91600. * @param {number} origin - 原点。
  91601. * */
  91602. }, {
  91603. key: "createTileGrid",
  91604. value: function createTileGrid(extent, maxZoom, minZoom, tileSize, origin) {
  91605. var tilegrid = external_ol_tilegrid_namespaceObject.createXYZ({
  91606. extent: extent,
  91607. maxZoom: maxZoom,
  91608. minZoom: minZoom,
  91609. tileSize: tileSize
  91610. });
  91611. return new (external_ol_tilegrid_TileGrid_default())({
  91612. extent: extent,
  91613. minZoom: minZoom,
  91614. origin: origin,
  91615. resolutions: tilegrid.getResolutions(),
  91616. tileSize: tilegrid.getTileSize()
  91617. });
  91618. }
  91619. }]);
  91620. return TileSuperMapRest;
  91621. }((external_ol_source_TileImage_default()));
  91622. // EXTERNAL MODULE: ./node_modules/proj4/dist/proj4-src.js
  91623. var proj4_src = __webpack_require__(4689);
  91624. var proj4_src_default = /*#__PURE__*/__webpack_require__.n(proj4_src);
  91625. ;// CONCATENATED MODULE: ./src/common/util/FilterCondition.js
  91626. function getParseSpecialCharacter() {
  91627. // 特殊字符字典
  91628. var directory = ['(', ')', '(', ')', ',', ','];
  91629. var res = {};
  91630. directory.forEach(function (item, index) {
  91631. res[item] = "$".concat(index);
  91632. });
  91633. return res;
  91634. }
  91635. function parseSpecialCharacter(str) {
  91636. var directory = getParseSpecialCharacter();
  91637. for (var key in directory) {
  91638. var replaceValue = directory[key];
  91639. var pattern = new RegExp("\\".concat(key), 'g');
  91640. // eslint-disable-next-line
  91641. while (pattern.test(str)) {
  91642. str = str.replace(pattern, replaceValue);
  91643. }
  91644. }
  91645. return str;
  91646. }
  91647. function parseCondition(filterCondition, keys) {
  91648. var str = filterCondition.replace(/&|\||>|<|=|!/g, ' ');
  91649. var arr = str.split(' ').filter(function (item) {
  91650. return item;
  91651. });
  91652. var result = filterCondition;
  91653. arr.forEach(function (item) {
  91654. var key = keys.find(function (val) {
  91655. return val === item;
  91656. });
  91657. if (startsWithNumber(item) && key) {
  91658. result = result.replace(key, '$' + key);
  91659. }
  91660. if (key) {
  91661. var res = parseSpecialCharacter(key);
  91662. result = result.replace(key, res);
  91663. }
  91664. });
  91665. return result;
  91666. }
  91667. // 处理jsonsqlfeature, 加前缀
  91668. function parseConditionFeature(feature) {
  91669. var copyValue = {};
  91670. for (var key in feature) {
  91671. var copyKey = key;
  91672. if (startsWithNumber(key)) {
  91673. copyKey = '$' + key;
  91674. }
  91675. copyKey = parseSpecialCharacter(copyKey);
  91676. copyValue[copyKey] = feature[key];
  91677. }
  91678. return copyValue;
  91679. }
  91680. function startsWithNumber(str) {
  91681. return /^\d/.test(str);
  91682. }
  91683. ;// CONCATENATED MODULE: external "ol.geom.Point"
  91684. var external_ol_geom_Point_namespaceObject = ol.geom.Point;
  91685. var external_ol_geom_Point_default = /*#__PURE__*/__webpack_require__.n(external_ol_geom_Point_namespaceObject);
  91686. ;// CONCATENATED MODULE: ./src/openlayers/services/QueryService.js
  91687. function QueryService_typeof(obj) { "@babel/helpers - typeof"; return QueryService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, QueryService_typeof(obj); }
  91688. function services_QueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  91689. function services_QueryService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  91690. function services_QueryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_QueryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_QueryService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  91691. function QueryService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) QueryService_setPrototypeOf(subClass, superClass); }
  91692. function QueryService_setPrototypeOf(o, p) { QueryService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryService_setPrototypeOf(o, p); }
  91693. function QueryService_createSuper(Derived) { var hasNativeReflectConstruct = QueryService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = QueryService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = QueryService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return QueryService_possibleConstructorReturn(this, result); }; }
  91694. function QueryService_possibleConstructorReturn(self, call) { if (call && (QueryService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return QueryService_assertThisInitialized(self); }
  91695. function QueryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  91696. function QueryService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  91697. function QueryService_getPrototypeOf(o) { QueryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryService_getPrototypeOf(o); }
  91698. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  91699. * This program are made available under the terms of the Apache License, Version 2.0
  91700. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  91701. /**
  91702. * @class QueryService
  91703. * @category iServer Map QueryResults
  91704. * @classdesc 地图查询服务类。
  91705. * 提供:范围查询,SQL 查询,几何查询,距离查询。
  91706. * @modulecategory Services
  91707. * @extends {ServiceBase}
  91708. * @param {string} url - 服务地址。
  91709. * @param {Object} options - 参数。
  91710. * @param {string} [options.proxy] - 服务代理地址。
  91711. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  91712. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  91713. * @param {Object} [options.headers] - 请求头。
  91714. * @example
  91715. * new QueryService(url)
  91716. * .queryByBounds(param,function(result){
  91717. * //doSomething
  91718. * })
  91719. * @usage
  91720. */
  91721. var QueryService = /*#__PURE__*/function (_ServiceBase) {
  91722. QueryService_inherits(QueryService, _ServiceBase);
  91723. var _super = QueryService_createSuper(QueryService);
  91724. function QueryService(url, options) {
  91725. var _this;
  91726. services_QueryService_classCallCheck(this, QueryService);
  91727. _this = _super.call(this, url, options);
  91728. _this._queryService = new QueryService_QueryService(url, options);
  91729. return _this;
  91730. }
  91731. /**
  91732. * @function QueryService.prototype.queryByBounds
  91733. * @description bounds 查询地图服务。
  91734. * @param {QueryByBoundsParameters} params - Bounds 查询参数类。
  91735. * @param {RequestCallback} callback - 回调函数。
  91736. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  91737. * @returns {QueryService}
  91738. */
  91739. services_QueryService_createClass(QueryService, [{
  91740. key: "queryByBounds",
  91741. value: function queryByBounds(params, callback, resultFormat) {
  91742. params = this._processParams(params);
  91743. this._queryService.queryByBounds(params, callback, resultFormat);
  91744. }
  91745. /**
  91746. * @function QueryService.prototype.queryByDistance
  91747. * @description 地图距离查询服务。
  91748. * @param {QueryByDistanceParameters} params - Distance 查询参数类。
  91749. * @param {RequestCallback} callback 回调函数。
  91750. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  91751. */
  91752. }, {
  91753. key: "queryByDistance",
  91754. value: function queryByDistance(params, callback, resultFormat) {
  91755. params = this._processParams(params);
  91756. this._queryService.queryByDistance(params, callback, resultFormat);
  91757. }
  91758. /**
  91759. * @function QueryService.prototype.queryBySQL
  91760. * @description 地图 SQL 查询服务。
  91761. * @param {QueryBySQLParameters} params - SQL 查询参数类。
  91762. * @param {RequestCallback} callback 回调函数。
  91763. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  91764. */
  91765. }, {
  91766. key: "queryBySQL",
  91767. value: function queryBySQL(params, callback, resultFormat) {
  91768. params = this._processParams(params);
  91769. this._queryService.queryBySQL(params, callback, resultFormat);
  91770. }
  91771. /**
  91772. * @function QueryService.prototype.queryByGeometry
  91773. * @description 地图几何查询服务。
  91774. * @param {QueryByGeometryParameters} params - Geometry 查询参数类。
  91775. * @param {RequestCallback} callback 回调函数。
  91776. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  91777. */
  91778. }, {
  91779. key: "queryByGeometry",
  91780. value: function queryByGeometry(params, callback, resultFormat) {
  91781. params = this._processParams(params);
  91782. this._queryService.queryByGeometry(params, callback, resultFormat);
  91783. }
  91784. }, {
  91785. key: "_processParams",
  91786. value: function _processParams(params) {
  91787. if (!params) {
  91788. return {};
  91789. }
  91790. params.returnContent = params.returnContent == null ? true : params.returnContent;
  91791. if (params.queryParams && !core_Util_Util.isArray(params.queryParams)) {
  91792. params.queryParams = [params.queryParams];
  91793. }
  91794. if (params.bounds) {
  91795. params.bounds = new Bounds(params.bounds[0], params.bounds[1], params.bounds[2], params.bounds[3]);
  91796. }
  91797. if (params.geometry) {
  91798. if (params.geometry instanceof (external_ol_geom_Point_default())) {
  91799. params.geometry = new Point(params.geometry.getCoordinates()[0], params.geometry.getCoordinates()[1]);
  91800. } else {
  91801. params.geometry = core_Util_Util.toSuperMapGeometry(JSON.parse(new (external_ol_format_GeoJSON_default())().writeGeometry(params.geometry)));
  91802. }
  91803. }
  91804. return params;
  91805. }
  91806. }]);
  91807. return QueryService;
  91808. }(ServiceBase);
  91809. ;// CONCATENATED MODULE: ./src/common/iServer/FeatureService.js
  91810. function FeatureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  91811. function FeatureService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  91812. function FeatureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FeatureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FeatureService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  91813. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  91814. * This program are made available under the terms of the Apache License, Version 2.0
  91815. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  91816. /**
  91817. * @class FeatureService
  91818. * @constructs FeatureService
  91819. * @category iServer Data Feature
  91820. * @classdesc 数据集类。提供:ID 查询,范围查询,SQL查询,几何查询,bounds 查询,缓冲区查询,地物编辑。
  91821. * @example
  91822. * new FeatureService(url).getFeaturesByIDs(param,function(result){
  91823. * //doSomething
  91824. * })
  91825. * @param {string} url - 服务地址。
  91826. * @param {Object} options - 参数。
  91827. * @param {string} [options.proxy] - 服务代理地址。
  91828. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  91829. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  91830. * @param {Object} [options.headers] - 请求头。
  91831. * @extends {ServiceBase}
  91832. * @usage
  91833. */
  91834. var FeatureService_FeatureService = /*#__PURE__*/function () {
  91835. function FeatureService(url, options) {
  91836. FeatureService_classCallCheck(this, FeatureService);
  91837. this.url = url;
  91838. this.options = options || {};
  91839. }
  91840. /**
  91841. * @function FeatureService.prototype.getFeaturesByIDs
  91842. * @description 数据集 ID 查询服务。
  91843. * @param {GetFeaturesByIDsParameters} params - ID查询参数类。
  91844. * @param {RequestCallback} callback - 回调函数。
  91845. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  91846. */
  91847. FeatureService_createClass(FeatureService, [{
  91848. key: "getFeaturesByIDs",
  91849. value: function getFeaturesByIDs(params, callback, resultFormat) {
  91850. var me = this;
  91851. var getFeaturesByIDsService = new GetFeaturesByIDsService(me.url, {
  91852. proxy: me.options.proxy,
  91853. withCredentials: me.options.withCredentials,
  91854. crossOrigin: me.options.crossOrigin,
  91855. headers: me.options.headers,
  91856. eventListeners: {
  91857. processCompleted: callback,
  91858. processFailed: callback
  91859. },
  91860. format: resultFormat
  91861. });
  91862. getFeaturesByIDsService.processAsync(params);
  91863. }
  91864. /**
  91865. * @function FeatureService.prototype.getFeaturesByBounds
  91866. * @description 数据集 Bounds 查询服务。
  91867. * @param {GetFeaturesByBoundsParameters} params - 数据集范围查询参数类。
  91868. * @param {RequestCallback} callback - 回调函数。
  91869. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  91870. */
  91871. }, {
  91872. key: "getFeaturesByBounds",
  91873. value: function getFeaturesByBounds(params, callback, resultFormat) {
  91874. var me = this;
  91875. var getFeaturesByBoundsService = new GetFeaturesByBoundsService(me.url, {
  91876. proxy: me.options.proxy,
  91877. withCredentials: me.options.withCredentials,
  91878. crossOrigin: me.options.crossOrigin,
  91879. headers: me.options.headers,
  91880. eventListeners: {
  91881. processCompleted: callback,
  91882. processFailed: callback
  91883. },
  91884. format: me._processFormat(resultFormat)
  91885. });
  91886. getFeaturesByBoundsService.processAsync(params);
  91887. }
  91888. /**
  91889. * @function FeatureService.prototype.getFeaturesByBuffer
  91890. * @description 数据集 Buffer 查询服务。
  91891. * @param {GetFeaturesByBufferParameters} params - 数据集缓冲区查询参数类。
  91892. * @param {RequestCallback} callback - 回调函数。
  91893. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  91894. */
  91895. }, {
  91896. key: "getFeaturesByBuffer",
  91897. value: function getFeaturesByBuffer(params, callback, resultFormat) {
  91898. var me = this;
  91899. var getFeatureService = new GetFeaturesByBufferService(me.url, {
  91900. proxy: me.options.proxy,
  91901. withCredentials: me.options.withCredentials,
  91902. crossOrigin: me.options.crossOrigin,
  91903. headers: me.options.headers,
  91904. eventListeners: {
  91905. processCompleted: callback,
  91906. processFailed: callback
  91907. },
  91908. format: me._processFormat(resultFormat)
  91909. });
  91910. getFeatureService.processAsync(params);
  91911. }
  91912. /**
  91913. * @function FeatureService.prototype.getFeaturesBySQL
  91914. * @description 数据集 SQL 查询服务。
  91915. * @param {GetFeaturesBySQLParameters} params - 数据集 SQL 查询参数类。
  91916. * @param {RequestCallback} callback - 回调函数。
  91917. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  91918. */
  91919. }, {
  91920. key: "getFeaturesBySQL",
  91921. value: function getFeaturesBySQL(params, callback, resultFormat) {
  91922. var me = this;
  91923. var getFeatureBySQLService = new GetFeaturesBySQLService(me.url, {
  91924. proxy: me.options.proxy,
  91925. withCredentials: me.options.withCredentials,
  91926. crossOrigin: me.options.crossOrigin,
  91927. headers: me.options.headers,
  91928. eventListeners: {
  91929. processCompleted: callback,
  91930. processFailed: callback
  91931. },
  91932. format: me._processFormat(resultFormat)
  91933. });
  91934. getFeatureBySQLService.processAsync(params);
  91935. }
  91936. /**
  91937. * @function FeatureService.prototype.getFeaturesByGeometry
  91938. * @description 数据集几何查询服务类。
  91939. * @param {GetFeaturesByGeometryParameters} params - 数据集几何查询参数类。
  91940. * @param {RequestCallback} callback - 回调函数。
  91941. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  91942. */
  91943. }, {
  91944. key: "getFeaturesByGeometry",
  91945. value: function getFeaturesByGeometry(params, callback, resultFormat) {
  91946. var me = this;
  91947. var getFeaturesByGeometryService = new GetFeaturesByGeometryService(me.url, {
  91948. proxy: me.options.proxy,
  91949. withCredentials: me.options.withCredentials,
  91950. crossOrigin: me.options.crossOrigin,
  91951. headers: me.options.headers,
  91952. eventListeners: {
  91953. processCompleted: callback,
  91954. processFailed: callback
  91955. },
  91956. format: me._processFormat(resultFormat)
  91957. });
  91958. getFeaturesByGeometryService.processAsync(params);
  91959. }
  91960. /**
  91961. * @function FeatureService.prototype.editFeatures
  91962. * @description 地物编辑服务。
  91963. * @param {EditFeaturesParameters} params - 数据服务中数据集添加、修改、删除参数类。
  91964. * @param {RequestCallback} callback - 回调函数。
  91965. */
  91966. }, {
  91967. key: "editFeatures",
  91968. value: function editFeatures(params, callback) {
  91969. if (!params || !params.dataSourceName || !params.dataSetName) {
  91970. return;
  91971. }
  91972. var me = this,
  91973. url = me.url,
  91974. dataSourceName = params.dataSourceName,
  91975. dataSetName = params.dataSetName;
  91976. url = Util_Util.urlPathAppend(url, "datasources/" + dataSourceName + "/datasets/" + dataSetName);
  91977. var editFeatureService = new EditFeaturesService(url, {
  91978. proxy: me.options.proxy,
  91979. withCredentials: me.options.withCredentials,
  91980. crossOrigin: me.options.crossOrigin,
  91981. headers: me.options.headers,
  91982. eventListeners: {
  91983. processCompleted: callback,
  91984. processFailed: callback
  91985. }
  91986. });
  91987. editFeatureService.processAsync(params);
  91988. }
  91989. }, {
  91990. key: "_processFormat",
  91991. value: function _processFormat(resultFormat) {
  91992. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  91993. }
  91994. }]);
  91995. return FeatureService;
  91996. }();
  91997. ;// CONCATENATED MODULE: ./src/openlayers/services/FeatureService.js
  91998. function FeatureService_typeof(obj) { "@babel/helpers - typeof"; return FeatureService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FeatureService_typeof(obj); }
  91999. function services_FeatureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  92000. function services_FeatureService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  92001. function services_FeatureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_FeatureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_FeatureService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  92002. function FeatureService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FeatureService_setPrototypeOf(subClass, superClass); }
  92003. function FeatureService_setPrototypeOf(o, p) { FeatureService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FeatureService_setPrototypeOf(o, p); }
  92004. function FeatureService_createSuper(Derived) { var hasNativeReflectConstruct = FeatureService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FeatureService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FeatureService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FeatureService_possibleConstructorReturn(this, result); }; }
  92005. function FeatureService_possibleConstructorReturn(self, call) { if (call && (FeatureService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FeatureService_assertThisInitialized(self); }
  92006. function FeatureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  92007. function FeatureService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  92008. function FeatureService_getPrototypeOf(o) { FeatureService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FeatureService_getPrototypeOf(o); }
  92009. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  92010. * This program are made available under the terms of the Apache License, Version 2.0
  92011. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  92012. /**
  92013. * @class FeatureService
  92014. * @constructs FeatureService
  92015. * @category iServer Data Feature
  92016. * @classdesc 数据集类。提供:ID 查询,范围查询,SQL查询,几何查询,bounds 查询,缓冲区查询,地物编辑。
  92017. * @modulecategory Services
  92018. * @example
  92019. * new FeatureService(url).getFeaturesByIDs(param,function(result){
  92020. * //doSomething
  92021. * })
  92022. * @param {string} url - 服务地址。
  92023. * @param {Object} options - 参数。
  92024. * @param {string} [options.proxy] - 服务代理地址。
  92025. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  92026. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  92027. * @param {Object} [options.headers] - 请求头。
  92028. * @extends {ServiceBase}
  92029. * @usage
  92030. */
  92031. var FeatureService = /*#__PURE__*/function (_ServiceBase) {
  92032. FeatureService_inherits(FeatureService, _ServiceBase);
  92033. var _super = FeatureService_createSuper(FeatureService);
  92034. function FeatureService(url, options) {
  92035. var _this;
  92036. services_FeatureService_classCallCheck(this, FeatureService);
  92037. _this = _super.call(this, url, options);
  92038. _this._featureService = new FeatureService_FeatureService(url, options);
  92039. return _this;
  92040. }
  92041. /**
  92042. * @function FeatureService.prototype.getFeaturesByIDs
  92043. * @description 数据集 ID 查询服务。
  92044. * @param {GetFeaturesByIDsParameters} params - ID查询参数类。
  92045. * @param {RequestCallback} callback - 回调函数。
  92046. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  92047. */
  92048. services_FeatureService_createClass(FeatureService, [{
  92049. key: "getFeaturesByIDs",
  92050. value: function getFeaturesByIDs(params, callback, resultFormat) {
  92051. params = this._processParams(params);
  92052. this._featureService.getFeaturesByIDs(params, callback, resultFormat);
  92053. }
  92054. /**
  92055. * @function FeatureService.prototype.getFeaturesByBounds
  92056. * @description 数据集 Bounds 查询服务。
  92057. * @param {GetFeaturesByBoundsParameters} params - 数据集范围查询参数类。
  92058. * @param {RequestCallback} callback - 回调函数。
  92059. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  92060. */
  92061. }, {
  92062. key: "getFeaturesByBounds",
  92063. value: function getFeaturesByBounds(params, callback, resultFormat) {
  92064. params = this._processParams(params);
  92065. this._featureService.getFeaturesByBounds(params, callback, resultFormat);
  92066. }
  92067. /**
  92068. * @function FeatureService.prototype.getFeaturesByBuffer
  92069. * @description 数据集 Buffer 查询服务。
  92070. * @param {GetFeaturesByBufferParameters} params - 数据集缓冲区查询参数类。
  92071. * @param {RequestCallback} callback - 回调函数。
  92072. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  92073. */
  92074. }, {
  92075. key: "getFeaturesByBuffer",
  92076. value: function getFeaturesByBuffer(params, callback, resultFormat) {
  92077. params = this._processParams(params);
  92078. this._featureService.getFeaturesByBuffer(params, callback, resultFormat);
  92079. }
  92080. /**
  92081. * @function FeatureService.prototype.getFeaturesBySQL
  92082. * @description 数据集 SQL 查询服务。
  92083. * @param {GetFeaturesBySQLParameters} params - 数据集 SQL 查询参数类。
  92084. * @param {RequestCallback} callback - 回调函数。
  92085. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  92086. */
  92087. }, {
  92088. key: "getFeaturesBySQL",
  92089. value: function getFeaturesBySQL(params, callback, resultFormat) {
  92090. params = this._processParams(params);
  92091. this._featureService.getFeaturesBySQL(params, callback, resultFormat);
  92092. }
  92093. /**
  92094. * @function FeatureService.prototype.getFeaturesByGeometry
  92095. * @description 数据集几何查询服务类。
  92096. * @param {GetFeaturesByGeometryParameters} params - 数据集几何查询参数类。
  92097. * @param {RequestCallback} callback - 回调函数。
  92098. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  92099. */
  92100. }, {
  92101. key: "getFeaturesByGeometry",
  92102. value: function getFeaturesByGeometry(params, callback, resultFormat) {
  92103. params = this._processParams(params);
  92104. this._featureService.getFeaturesByGeometry(params, callback, resultFormat);
  92105. }
  92106. /**
  92107. * @function FeatureService.prototype.editFeatures
  92108. * @description 地物编辑服务。
  92109. * @param {EditFeaturesParameters} params - 数据服务中数据集添加、修改、删除参数类。
  92110. * @param {RequestCallback} callback - 回调函数。
  92111. */
  92112. }, {
  92113. key: "editFeatures",
  92114. value: function editFeatures(params, callback) {
  92115. if (!params || !params.dataSourceName || !params.dataSetName) {
  92116. return;
  92117. }
  92118. var me = this,
  92119. url = me.url,
  92120. dataSourceName = params.dataSourceName,
  92121. dataSetName = params.dataSetName;
  92122. url = Util_Util.urlPathAppend(url, 'datasources/' + dataSourceName + '/datasets/' + dataSetName);
  92123. var editFeatureService = new EditFeaturesService(url, {
  92124. proxy: me.options.proxy,
  92125. withCredentials: me.options.withCredentials,
  92126. crossOrigin: me.options.crossOrigin,
  92127. headers: me.options.headers,
  92128. eventListeners: {
  92129. processCompleted: callback,
  92130. processFailed: callback
  92131. }
  92132. });
  92133. editFeatureService.processAsync(me._processParams(params));
  92134. }
  92135. }, {
  92136. key: "_processParams",
  92137. value: function _processParams(params) {
  92138. if (!params) {
  92139. return {};
  92140. }
  92141. var me = this;
  92142. params.returnContent = params.returnContent == null ? true : params.returnContent;
  92143. params.fromIndex = params.fromIndex ? params.fromIndex : 0;
  92144. params.toIndex = params.toIndex ? params.toIndex : -1;
  92145. if (params.bounds) {
  92146. params.bounds = core_Util_Util.toSuperMapBounds(params.bounds);
  92147. }
  92148. if (params.geometry) {
  92149. params.geometry = core_Util_Util.toSuperMapGeometry(JSON.parse(new (external_ol_format_GeoJSON_default())().writeGeometry(params.geometry)));
  92150. }
  92151. if (params.editType) {
  92152. params.editType = params.editType.toLowerCase();
  92153. }
  92154. if (params.features) {
  92155. var features = [];
  92156. if (core_Util_Util.isArray(params.features)) {
  92157. params.features.map(function (feature) {
  92158. features.push(me._createServerFeature(feature));
  92159. return feature;
  92160. });
  92161. } else {
  92162. features.push(me._createServerFeature(params.features));
  92163. }
  92164. params.features = features;
  92165. }
  92166. return params;
  92167. }
  92168. }, {
  92169. key: "_createServerFeature",
  92170. value: function _createServerFeature(geoFeature) {
  92171. var feature = {},
  92172. fieldNames = [],
  92173. fieldValues = [];
  92174. var properties = geoFeature.getProperties();
  92175. for (var key in properties) {
  92176. if (key === geoFeature.getGeometryName()) {
  92177. continue;
  92178. }
  92179. fieldNames.push(key);
  92180. fieldValues.push(properties[key]);
  92181. }
  92182. feature.fieldNames = fieldNames;
  92183. feature.fieldValues = fieldValues;
  92184. if (geoFeature.getId()) {
  92185. feature.id = geoFeature.getId();
  92186. }
  92187. feature.geometry = core_Util_Util.toSuperMapGeometry(new (external_ol_format_GeoJSON_default())().writeFeatureObject(geoFeature));
  92188. return feature;
  92189. }
  92190. }, {
  92191. key: "_processFormat",
  92192. value: function _processFormat(resultFormat) {
  92193. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  92194. }
  92195. }]);
  92196. return FeatureService;
  92197. }(ServiceBase);
  92198. ;// CONCATENATED MODULE: ./src/openlayers/mapping/webmap/Util.js
  92199. function getFeatureProperties(features) {
  92200. var properties = [];
  92201. if (Util_isArray(features) && features.length) {
  92202. features.forEach(function (feature) {
  92203. var property = feature.get('attributes');
  92204. property && properties.push(property);
  92205. });
  92206. }
  92207. return properties;
  92208. }
  92209. function getFeatureBySQL(url, datasetNames, serviceOptions, processCompleted, processFaild, targetEpsgCode, restDataSingleRequestCount) {
  92210. getFeatureBySQLWithConcurrent(url, datasetNames, processCompleted, processFaild, serviceOptions, targetEpsgCode, restDataSingleRequestCount);
  92211. }
  92212. function queryFeatureBySQL(url, layerName, attributeFilter, fields, epsgCode, processCompleted, processFaild, startRecord, recordLength, onlyAttribute) {
  92213. var queryParam = new FilterParameter({
  92214. name: layerName,
  92215. attributeFilter: attributeFilter
  92216. });
  92217. if (fields) {
  92218. queryParam.fields = fields;
  92219. }
  92220. var params = {
  92221. queryParams: [queryParam]
  92222. };
  92223. if (onlyAttribute) {
  92224. params.queryOption = QueryOption.ATTRIBUTE;
  92225. }
  92226. startRecord && (params.startRecord = startRecord);
  92227. recordLength && (params.expectCount = recordLength);
  92228. if (epsgCode) {
  92229. params.prjCoordSys = {
  92230. epsgCode: epsgCode
  92231. };
  92232. }
  92233. var queryBySQLParams = new QueryBySQLParameters(params);
  92234. var queryBySQLService = new QueryService(url);
  92235. queryBySQLService.queryBySQL(queryBySQLParams, function (data) {
  92236. data.type === 'processCompleted' ? processCompleted(data) : processFaild(data);
  92237. });
  92238. }
  92239. function getFeatureBySQLWithConcurrent(url, datasetNames, processCompleted, processFailed, serviceOptions, targetEpsgCode, restDataSingleRequestCount) {
  92240. var queryParameter = new FilterParameter({
  92241. name: datasetNames.join().replace(':', '@')
  92242. });
  92243. var maxFeatures = restDataSingleRequestCount || 1000,
  92244. // 每次请求数据量
  92245. firstResult,
  92246. // 存储每次请求的结果
  92247. allRequest = []; // 存储发出的请求Promise
  92248. // 发送请求获取获取总数据量
  92249. _getReasult(url, queryParameter, datasetNames, 0, 1, 1, serviceOptions, targetEpsgCode).then(function (result) {
  92250. firstResult = result;
  92251. var totalCount = result.result.totalCount;
  92252. if (totalCount > 1) {
  92253. // 开始并发请求
  92254. for (var i = 1; i < totalCount;) {
  92255. allRequest.push(_getReasult(url, queryParameter, datasetNames, i, i + maxFeatures, maxFeatures, serviceOptions, targetEpsgCode));
  92256. i += maxFeatures;
  92257. }
  92258. // 所有请求结束
  92259. Promise.all(allRequest).then(function (results) {
  92260. // 结果合并
  92261. results.forEach(function (result) {
  92262. if (result.type === 'processCompleted' && result.result.features && result.result.features.features) {
  92263. result.result.features.features.forEach(function (feature) {
  92264. firstResult.result.features.features.push(feature);
  92265. });
  92266. } else {
  92267. // todo 提示 部分数据请求失败
  92268. firstResult.someRequestFailed = true;
  92269. }
  92270. });
  92271. processCompleted(firstResult);
  92272. })["catch"](function (error) {
  92273. processFailed(error);
  92274. });
  92275. } else {
  92276. processCompleted(result);
  92277. }
  92278. })["catch"](function (error) {
  92279. processFailed(error);
  92280. });
  92281. }
  92282. function _getFeaturesBySQLParameters(queryParameter, datasetNames, fromIndex, toIndex, maxFeatures, targetEpsgCode) {
  92283. return new GetFeaturesBySQLParameters({
  92284. queryParameter: queryParameter,
  92285. datasetNames: datasetNames,
  92286. fromIndex: fromIndex,
  92287. toIndex: toIndex,
  92288. maxFeatures: maxFeatures,
  92289. returnContent: true,
  92290. targetEpsgCode: targetEpsgCode
  92291. });
  92292. }
  92293. function _getReasult(url, queryParameter, datasetNames, fromIndex, toIndex, maxFeatures, serviceOptions, targetEpsgCode) {
  92294. return new Promise(function (resolve, reject) {
  92295. new FeatureService(url, serviceOptions).getFeaturesBySQL(_getFeaturesBySQLParameters(queryParameter, datasetNames, fromIndex, toIndex, maxFeatures, targetEpsgCode), function (result) {
  92296. var featuresResult = result.result;
  92297. //[bug] wt任务编号: 5223
  92298. if (result.type === 'processCompleted' && featuresResult && featuresResult.features) {
  92299. resolve(result);
  92300. } else {
  92301. reject(result);
  92302. }
  92303. });
  92304. });
  92305. }
  92306. function Util_isArray(obj) {
  92307. return Object.prototype.toString.call(obj) === '[object Array]';
  92308. }
  92309. ;// CONCATENATED MODULE: ./src/openlayers/services/DataFlowService.js
  92310. function services_DataFlowService_typeof(obj) { "@babel/helpers - typeof"; return services_DataFlowService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, services_DataFlowService_typeof(obj); }
  92311. function services_DataFlowService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  92312. function services_DataFlowService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  92313. function services_DataFlowService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_DataFlowService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_DataFlowService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  92314. function services_DataFlowService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) services_DataFlowService_setPrototypeOf(subClass, superClass); }
  92315. function services_DataFlowService_setPrototypeOf(o, p) { services_DataFlowService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_DataFlowService_setPrototypeOf(o, p); }
  92316. function services_DataFlowService_createSuper(Derived) { var hasNativeReflectConstruct = services_DataFlowService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_DataFlowService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_DataFlowService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_DataFlowService_possibleConstructorReturn(this, result); }; }
  92317. function services_DataFlowService_possibleConstructorReturn(self, call) { if (call && (services_DataFlowService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return services_DataFlowService_assertThisInitialized(self); }
  92318. function services_DataFlowService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  92319. function services_DataFlowService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  92320. function services_DataFlowService_getPrototypeOf(o) { services_DataFlowService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_DataFlowService_getPrototypeOf(o); }
  92321. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  92322. * This program are made available under the terms of the Apache License, Version 2.0
  92323. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  92324. /**
  92325. * @class DataFlowService
  92326. * @category iServer DataFlow
  92327. * @classdesc 数据流服务。
  92328. * @modulecategory Services
  92329. * @extends {ServiceBase}
  92330. * @example
  92331. * new DataFlowService(url).queryChart(param,function(result){
  92332. * //doSomething
  92333. * })
  92334. * @param {string} url - 服务地址。
  92335. * @param {Object} options - 参数。
  92336. * @param {string} [options.proxy] - 服务代理地址。
  92337. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  92338. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  92339. * @param {Object} [options.headers] - 请求头。
  92340. * @param {GeoJSONObject} [options.geometry] - 指定几何范围,该范围内的要素才能被订阅。
  92341. * @param {Object} [options.excludeField] - 排除字段。
  92342. * @usage
  92343. */
  92344. var DataFlowService = /*#__PURE__*/function (_ServiceBase) {
  92345. services_DataFlowService_inherits(DataFlowService, _ServiceBase);
  92346. var _super = services_DataFlowService_createSuper(DataFlowService);
  92347. function DataFlowService(url, options) {
  92348. var _this;
  92349. services_DataFlowService_classCallCheck(this, DataFlowService);
  92350. options = options || {};
  92351. if (options.projection) {
  92352. options.prjCoordSys = options.projection;
  92353. }
  92354. _this = _super.call(this, url, options);
  92355. _this.dataFlow = new DataFlowService_DataFlowService(url, options);
  92356. _this.dataFlow.events.on({
  92357. "broadcastSocketConnected": _this._defaultEvent,
  92358. "broadcastSocketError": _this._defaultEvent,
  92359. "broadcastFailed": _this._defaultEvent,
  92360. "broadcastSucceeded": _this._defaultEvent,
  92361. "subscribeSocketConnected": _this._defaultEvent,
  92362. "subscribeSocketError": _this._defaultEvent,
  92363. "messageSucceeded": _this._defaultEvent,
  92364. "setFilterParamSucceeded": _this._defaultEvent,
  92365. scope: services_DataFlowService_assertThisInitialized(_this)
  92366. });
  92367. return _this;
  92368. }
  92369. /**
  92370. * @function DataFlowService.prototype.initBroadcast
  92371. * @description 初始化广播。
  92372. * @returns {DataFlowService}
  92373. */
  92374. services_DataFlowService_createClass(DataFlowService, [{
  92375. key: "initBroadcast",
  92376. value: function initBroadcast() {
  92377. this.dataFlow.initBroadcast();
  92378. return this;
  92379. }
  92380. /**
  92381. * @function DataFlowService.prototype.broadcast
  92382. * @description 加载广播数据。
  92383. * @param {JSONObject} obj - JSON 格式的要素数据。
  92384. */
  92385. }, {
  92386. key: "broadcast",
  92387. value: function broadcast(obj) {
  92388. this.dataFlow.broadcast(obj);
  92389. }
  92390. /**
  92391. * @function DataFlowService.prototype.initSubscribe
  92392. * @description 初始化订阅数据。
  92393. */
  92394. }, {
  92395. key: "initSubscribe",
  92396. value: function initSubscribe() {
  92397. this.dataFlow.initSubscribe();
  92398. return this;
  92399. }
  92400. /**
  92401. * @function DataFlowService.prototype.setExcludeField
  92402. * @description 设置排除字段。
  92403. * @param {Object} excludeField - 排除字段。
  92404. */
  92405. }, {
  92406. key: "setExcludeField",
  92407. value: function setExcludeField(excludeField) {
  92408. this.dataFlow.setExcludeField(excludeField);
  92409. this.options.excludeField = excludeField;
  92410. return this;
  92411. }
  92412. /**
  92413. * @function DataFlowService.prototype.setGeometry
  92414. * @description 设置添加的几何要素数据。
  92415. * @param {GeoJSONObject} geometry - 指定几何范围,该范围内的要素才能被订阅。
  92416. */
  92417. }, {
  92418. key: "setGeometry",
  92419. value: function setGeometry(geometry) {
  92420. this.dataFlow.setGeometry(geometry);
  92421. this.options.geometry = geometry;
  92422. return this;
  92423. }
  92424. /**
  92425. * @function DataFlowService.prototype.unSubscribe
  92426. * @description 结束订阅数据。
  92427. */
  92428. }, {
  92429. key: "unSubscribe",
  92430. value: function unSubscribe() {
  92431. this.dataFlow.unSubscribe();
  92432. }
  92433. /**
  92434. * @function DataFlowService.prototype.unBroadcast
  92435. * @description 结束加载广播。
  92436. */
  92437. }, {
  92438. key: "unBroadcast",
  92439. value: function unBroadcast() {
  92440. this.dataFlow.unBroadcast();
  92441. }
  92442. }, {
  92443. key: "_defaultEvent",
  92444. value: function _defaultEvent(e) {
  92445. this.dispatchEvent({
  92446. type: e.eventType || e.type,
  92447. value: e
  92448. });
  92449. }
  92450. }]);
  92451. return DataFlowService;
  92452. }(ServiceBase);
  92453. ;// CONCATENATED MODULE: ./src/openlayers/overlay/DataFlow.js
  92454. function DataFlow_typeof(obj) { "@babel/helpers - typeof"; return DataFlow_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, DataFlow_typeof(obj); }
  92455. function DataFlow_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  92456. function DataFlow_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  92457. function DataFlow_createClass(Constructor, protoProps, staticProps) { if (protoProps) DataFlow_defineProperties(Constructor.prototype, protoProps); if (staticProps) DataFlow_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  92458. function DataFlow_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) DataFlow_setPrototypeOf(subClass, superClass); }
  92459. function DataFlow_setPrototypeOf(o, p) { DataFlow_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DataFlow_setPrototypeOf(o, p); }
  92460. function DataFlow_createSuper(Derived) { var hasNativeReflectConstruct = DataFlow_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DataFlow_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DataFlow_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DataFlow_possibleConstructorReturn(this, result); }; }
  92461. function DataFlow_possibleConstructorReturn(self, call) { if (call && (DataFlow_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return DataFlow_assertThisInitialized(self); }
  92462. function DataFlow_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  92463. function DataFlow_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  92464. function DataFlow_getPrototypeOf(o) { DataFlow_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DataFlow_getPrototypeOf(o); }
  92465. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  92466. * This program are made available under the terms of the Apache License, Version 2.0
  92467. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  92468. /**
  92469. * @class DataFlow
  92470. * @browsernamespace ol.source
  92471. * @category iServer DataFlow
  92472. * @classdesc 数据流图层源。订阅SuperMap iServer 数据流服务,并将订阅得到的数据根据 `options.idField` 自动更新。与 {@link ol.layer.Vector} 结合使用可以实现SuperMap iServer 数据流上图、根据`options.idField`自动更新。
  92473. * @param {Object} opt_options - 参数。
  92474. * @param {string} opt_options.ws - SuperMap iServer 数据流服务地址,例如:http://localhost:8090/iserver/services/dataflowTest/dataflow。
  92475. * @param {string} [opt_options.idField = 'id'] - 要素属性中表示唯一标识的字段。
  92476. * @param {GeoJSONObject} [opt_options.geometry] - 指定几何范围,该范围内的要素才能被订阅。
  92477. * @param {Object} [opt_options.prjCoordSys] - 请求的地图的坐标参考系统。当此参数设置的坐标系统不同于地图的原有坐标系统时,系统会进行动态投影,并返回动态投影后的地图瓦片。例如:{"epsgCode":3857}。
  92478. * @param {Object} [opt_options.excludeField] - 排除字段。
  92479. * @extends {ol.source.Vector}
  92480. * @example
  92481. * var source = new DataFlow({
  92482. * ws: urlDataFlow,
  92483. * idField:"objectId"
  92484. * });
  92485. * var layer = new ol.layer.Vector({
  92486. * source: source,
  92487. * });
  92488. * @usage
  92489. */
  92490. var DataFlow = /*#__PURE__*/function (_VectorSource) {
  92491. DataFlow_inherits(DataFlow, _VectorSource);
  92492. var _super = DataFlow_createSuper(DataFlow);
  92493. function DataFlow(opt_options) {
  92494. var _this;
  92495. DataFlow_classCallCheck(this, DataFlow);
  92496. var options = opt_options ? opt_options : {};
  92497. _this = _super.call(this, options);
  92498. _this.idField = options.idField || "id";
  92499. _this.dataService = new DataFlowService(options.ws, {
  92500. geometry: options.geometry,
  92501. prjCoordSys: options.prjCoordSys,
  92502. excludeField: options.excludeField
  92503. }).initSubscribe();
  92504. var me = DataFlow_assertThisInitialized(_this);
  92505. me.dataService.on("subscribeSocketConnected", function (e) {
  92506. me.dispatchEvent({
  92507. type: "subscribeSucceeded",
  92508. value: e
  92509. });
  92510. });
  92511. me.dataService.on("messageSucceeded", function (msg) {
  92512. me._onMessageSuccessed(msg);
  92513. });
  92514. me.dataService.on("setFilterParamSucceeded", function (msg) {
  92515. me.dispatchEvent({
  92516. type: "setFilterParamSucceeded",
  92517. value: msg
  92518. });
  92519. });
  92520. _this.featureCache = {};
  92521. return _this;
  92522. }
  92523. // /**
  92524. // * @function DataFlow.prototype.setPrjCoordSys
  92525. // * @description 设置坐标参考系。
  92526. // * @param {Object} prjCoordSys - 参考系。
  92527. // */
  92528. // setPrjCoordSys(prjCoordSys) {
  92529. // this.dataService.setPrjCoordSys(prjCoordSys);
  92530. // this.prjCoordSys = prjCoordSys;
  92531. // return this;
  92532. // }
  92533. /**
  92534. * @function DataFlow.prototype.setExcludeField
  92535. * @description 设置唯一字段。
  92536. * @param {Object} excludeField - 排除字段。
  92537. */
  92538. DataFlow_createClass(DataFlow, [{
  92539. key: "setExcludeField",
  92540. value: function setExcludeField(excludeField) {
  92541. this.dataService.setExcludeField(excludeField);
  92542. this.excludeField = excludeField;
  92543. return this;
  92544. }
  92545. /**
  92546. * @function DataFlow.prototype.setGeometry
  92547. * @description 设置几何图形。
  92548. * @param {Object} geometry - 要素图形。
  92549. */
  92550. }, {
  92551. key: "setGeometry",
  92552. value: function setGeometry(geometry) {
  92553. this.dataService.setGeometry(geometry);
  92554. this.geometry = geometry;
  92555. return this;
  92556. }
  92557. }, {
  92558. key: "_onMessageSuccessed",
  92559. value: function _onMessageSuccessed(msg) {
  92560. //this.clear();
  92561. var feature = new (external_ol_format_GeoJSON_default())().readFeature(msg.value.featureResult);
  92562. var geoID = feature.get(this.idField);
  92563. if (geoID !== undefined && this.featureCache[geoID]) {
  92564. this.featureCache[geoID].setGeometry(feature.getGeometry());
  92565. this.featureCache[geoID].setProperties(feature.getProperties());
  92566. this.changed();
  92567. } else {
  92568. this.addFeature(feature);
  92569. this.featureCache[geoID] = feature;
  92570. }
  92571. this.dispatchEvent({
  92572. type: "dataupdated",
  92573. value: {
  92574. source: this,
  92575. data: feature
  92576. }
  92577. });
  92578. }
  92579. }]);
  92580. return DataFlow;
  92581. }((external_ol_source_Vector_default()));
  92582. ;// CONCATENATED MODULE: ./src/openlayers/overlay/theme/ThemeFeature.js
  92583. function ThemeFeature_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  92584. function ThemeFeature_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  92585. function ThemeFeature_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeFeature_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeFeature_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  92586. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  92587. * This program are made available under the terms of the Apache License, Version 2.0
  92588. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  92589. /**
  92590. * @class ThemeFeature
  92591. * @category Visualization Theme
  92592. * @classdesc 专题图要素类。
  92593. * @modulecategory Overlay
  92594. * @param {Object} geometry - 要量算的几何对象,支持 {@link ol.geom.Geometry} 和 GeometryGeoText 标签数组类型 geometry = [x,y,text]。
  92595. * @param {Object} [attributes] - 属性。
  92596. * @usage
  92597. */
  92598. var ThemeFeature = /*#__PURE__*/function () {
  92599. function ThemeFeature(geometry, attributes) {
  92600. ThemeFeature_classCallCheck(this, ThemeFeature);
  92601. this.geometry = geometry;
  92602. this.attributes = attributes;
  92603. }
  92604. /**
  92605. * @function ThemeFeature.prototype.toFeature
  92606. * @description 转为矢量要素。
  92607. */
  92608. ThemeFeature_createClass(ThemeFeature, [{
  92609. key: "toFeature",
  92610. value: function toFeature() {
  92611. var geometry = this.geometry;
  92612. if (geometry instanceof (external_ol_geom_Geometry_default())) {
  92613. //先把数据属性与要素合并
  92614. var featureOption = this.attributes;
  92615. featureOption.geometry = geometry;
  92616. var olFeature = new (external_ol_Feature_default())(featureOption);
  92617. return new GeoJSON().read(new (external_ol_format_GeoJSON_default())().writeFeature(olFeature), "Feature");
  92618. } else if (geometry.length === 3) {
  92619. geometry = new GeoText(geometry[0], geometry[1], geometry[2]);
  92620. return new Vector(geometry, this.attributes);
  92621. }
  92622. }
  92623. }]);
  92624. return ThemeFeature;
  92625. }();
  92626. ;// CONCATENATED MODULE: external "ol.source.ImageCanvas"
  92627. var external_ol_source_ImageCanvas_namespaceObject = ol.source.ImageCanvas;
  92628. var external_ol_source_ImageCanvas_default = /*#__PURE__*/__webpack_require__.n(external_ol_source_ImageCanvas_namespaceObject);
  92629. ;// CONCATENATED MODULE: ./src/openlayers/overlay/theme/Theme.js
  92630. function Theme_typeof(obj) { "@babel/helpers - typeof"; return Theme_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Theme_typeof(obj); }
  92631. function theme_Theme_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  92632. function theme_Theme_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  92633. function theme_Theme_createClass(Constructor, protoProps, staticProps) { if (protoProps) theme_Theme_defineProperties(Constructor.prototype, protoProps); if (staticProps) theme_Theme_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  92634. function Theme_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Theme_setPrototypeOf(subClass, superClass); }
  92635. function Theme_setPrototypeOf(o, p) { Theme_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Theme_setPrototypeOf(o, p); }
  92636. function Theme_createSuper(Derived) { var hasNativeReflectConstruct = Theme_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Theme_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Theme_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Theme_possibleConstructorReturn(this, result); }; }
  92637. function Theme_possibleConstructorReturn(self, call) { if (call && (Theme_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Theme_assertThisInitialized(self); }
  92638. function Theme_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  92639. function Theme_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  92640. function Theme_getPrototypeOf(o) { Theme_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Theme_getPrototypeOf(o); }
  92641. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  92642. * This program are made available under the terms of the Apache License, Version 2.0
  92643. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  92644. /**
  92645. * @class Theme
  92646. * @browsernamespace ol.source
  92647. * @category Visualization Theme
  92648. * @classdesc 专题图基类。
  92649. * @modulecategory Overlay
  92650. * @param {string} name - 专题图图层名称。
  92651. * @param {Object} opt_option - 参数。
  92652. * @param {ol.Map} opt_option.map - 当前 openlayers 的 Map 对象。
  92653. * @param {string} [opt_option.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  92654. * @param {number} [opt_option.opacity=1] - 图层透明度。
  92655. * @param {string} [opt_option.logo] - Logo(openLayers 5.0.0 及更高版本不再支持此参数)。
  92656. * @param {ol.proj.Projection} [opt_option.projection] - 投影信息。
  92657. * @param {number} [opt_option.ratio=1.5] - 视图比,1 表示画布是地图视口的大小,2 表示地图视口的宽度和高度的两倍,依此类推。必须是 1 或更高。
  92658. * @param {Array} [opt_option.resolutions] - 分辨率数组。
  92659. * @param {ol.source.State} [opt_option.state] - 资源状态。
  92660. * @param {(string|Object)} [opt_option.attributions='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>'] - 版权信息。
  92661. * @extends {ol.source.ImageCanvas}
  92662. * @usage
  92663. */
  92664. var theme_Theme_Theme = /*#__PURE__*/function (_ImageCanvasSource) {
  92665. Theme_inherits(Theme, _ImageCanvasSource);
  92666. var _super = Theme_createSuper(Theme);
  92667. function Theme(name, opt_options) {
  92668. var _this;
  92669. theme_Theme_classCallCheck(this, Theme);
  92670. var options = opt_options ? opt_options : {};
  92671. _this = _super.call(this, {
  92672. attributions: options.attributions || "Map Data <span>© SuperMap iServer</span> with <span>© SuperMap iClient</span>",
  92673. canvasFunction: canvasFunctionInternal_,
  92674. logo: core_Util_Util.getOlVersion() === '4' ? options.logo : null,
  92675. projection: options.projection,
  92676. ratio: options.ratio,
  92677. resolutions: options.resolutions,
  92678. state: options.state
  92679. });
  92680. /**
  92681. * @function Theme.prototype.on
  92682. * @description 添加专题要素事件监听。支持的事件包括: click、mousedown、mousemove、mouseout、mouseover、mouseup。
  92683. * @param {string} event - 事件名称。
  92684. * @param {RequestCallback} callback - 事件回调函数。
  92685. */
  92686. _this.on = _this.onInternal;
  92687. _this.id = options.id ? options.id : Util_Util.createUniqueID("themeLayer_");
  92688. function canvasFunctionInternal_(extent, resolution, pixelRatio, size, projection) {
  92689. // eslint-disable-line no-unused-vars
  92690. var mapWidth = size[0] * pixelRatio;
  92691. var mapHeight = size[1] * pixelRatio;
  92692. if (!this.context) {
  92693. this.context = core_Util_Util.createCanvasContext2D(mapWidth, mapHeight);
  92694. }
  92695. if (!this.features) {
  92696. return this.context.canvas;
  92697. }
  92698. this.pixelRatio = pixelRatio;
  92699. var width = this.map.getSize()[0] * pixelRatio;
  92700. var height = this.map.getSize()[1] * pixelRatio;
  92701. this.offset = [(mapWidth - width) / 2 / pixelRatio, (mapHeight - height) / 2 / pixelRatio];
  92702. if (!this.notFirst) {
  92703. this.redrawThematicFeatures(extent);
  92704. this.notFirst = true;
  92705. }
  92706. this.div.id = this.id;
  92707. this.div.className = "themeLayer";
  92708. this.div.style.width = mapWidth + "px";
  92709. this.div.style.height = mapHeight + "px";
  92710. this.map.getViewport().appendChild(this.div);
  92711. this.renderer.resize();
  92712. this.map.getViewport().removeChild(this.div);
  92713. this.themeCanvas = this.renderer.painter.root.getElementsByTagName('canvas')[0];
  92714. this.themeCanvas.width = mapWidth;
  92715. this.themeCanvas.height = mapHeight;
  92716. this.themeCanvas.style.width = mapWidth + "px";
  92717. this.themeCanvas.style.height = mapHeight + "px";
  92718. this.themeCanvas.getContext('2d').clearRect(0, 0, mapWidth, mapHeight);
  92719. var highLightContext = this.renderer.painter._layers.hover.ctx;
  92720. var highlightCanvas = highLightContext.canvas;
  92721. var copyHighLightContext = core_Util_Util.createCanvasContext2D(mapWidth, mapHeight);
  92722. copyHighLightContext.drawImage(highlightCanvas, 0, 0, highlightCanvas.width, highlightCanvas.height, 0, 0, mapWidth, mapHeight);
  92723. this.redrawThematicFeatures(extent);
  92724. var canvas = this.context.canvas;
  92725. this.context.clearRect(0, 0, canvas.width, canvas.height);
  92726. canvas.width = mapWidth;
  92727. canvas.height = mapHeight;
  92728. canvas.style.width = mapWidth + "px";
  92729. canvas.style.height = mapHeight + "px";
  92730. this.context.drawImage(this.themeCanvas, 0, 0);
  92731. this.context.drawImage(copyHighLightContext.canvas, 0, 0);
  92732. return this.context.canvas;
  92733. }
  92734. _this.canvasFunctionInternal_ = canvasFunctionInternal_;
  92735. _this.EVENT_TYPES = ["loadstart", "loadend", "loadcancel", "visibilitychanged", "move", "moveend", "added", "removed", "tileloaded", "beforefeaturesadded", "featuresadded", "featuresremoved"];
  92736. _this.features = [];
  92737. _this.TFEvents = options.TFEvents || [];
  92738. _this.map = options.map;
  92739. var size = _this.map.getSize();
  92740. _this.div = document.createElement('div');
  92741. _this.map.getViewport().appendChild(_this.div);
  92742. _this.div.style.width = size[0] + "px";
  92743. _this.div.style.height = size[1] + "px";
  92744. _this.setOpacity(options.opacity);
  92745. _this.levelRenderer = new LevelRenderer();
  92746. _this.movingOffset = [0, 0];
  92747. _this.renderer = _this.levelRenderer.init(_this.div);
  92748. _this.map.getViewport().removeChild(_this.div);
  92749. _this.renderer.clear();
  92750. //处理用户预先(在图层添加到 map 前)监听的事件
  92751. _this.addTFEvents();
  92752. return _this;
  92753. }
  92754. /**
  92755. * @function Theme.prototype.destroy
  92756. * @description 释放资源,将引用资源的属性置空。
  92757. */
  92758. theme_Theme_createClass(Theme, [{
  92759. key: "destroy",
  92760. value: function destroy() {
  92761. this.EVENT_TYPES = null;
  92762. this.isBaseLayer = null;
  92763. this.TFEvents = null;
  92764. this.destroyFeatures();
  92765. this.features = null;
  92766. if (this.renderer) {
  92767. this.renderer.dispose();
  92768. }
  92769. this.renderer = null;
  92770. this.levelRenderer = null;
  92771. this.movingOffset = null;
  92772. this.currentMousePosition = null;
  92773. }
  92774. /**
  92775. * @function Theme.prototype.destroyFeatures
  92776. * @description 销毁要素。
  92777. * @param {Array.<FeatureVector>|FeatureVector} features - 将被销毁的要素。
  92778. */
  92779. }, {
  92780. key: "destroyFeatures",
  92781. value: function destroyFeatures(features) {
  92782. var all = features == undefined;
  92783. if (all) {
  92784. features = this.features;
  92785. }
  92786. if (features) {
  92787. this.removeFeatures(features);
  92788. if (!Array.isArray(features)) {
  92789. features = [features];
  92790. }
  92791. for (var i = features.length - 1; i >= 0; i--) {
  92792. features[i].destroy();
  92793. }
  92794. }
  92795. }
  92796. /**
  92797. * @function Theme.prototype.setOpacity
  92798. * @description 设置图层的不透明度,取值[0-1]之间。
  92799. * @param {number} opacity - 不透明度。
  92800. */
  92801. }, {
  92802. key: "setOpacity",
  92803. value: function setOpacity(opacity) {
  92804. if (opacity !== this.opacity) {
  92805. this.opacity = opacity;
  92806. var element = this.div;
  92807. Util_Util.modifyDOMElement(element, null, null, null, null, null, null, opacity);
  92808. if (this.map !== null) {
  92809. this.dispatchEvent({
  92810. type: 'changelayer',
  92811. value: {
  92812. layer: this,
  92813. property: "opacity"
  92814. }
  92815. });
  92816. }
  92817. }
  92818. }
  92819. /**
  92820. * @function Theme.prototype.addFeatures
  92821. * @param {(Array.<ThemeFeature>|Array.<GeoJSONObject>|Array.<ol.Feature>|ThemeFeature|GeoJSONObject|ol.Feature)} features - 待添加要素。
  92822. * @description 抽象方法,可实例化子类必须实现此方法。向专题图图层中添加数据,
  92823. * 专题图仅接收 FeatureVector 类型数据,
  92824. * feature 将储存于 features 属性中,其存储形式为数组。
  92825. */
  92826. }, {
  92827. key: "addFeatures",
  92828. value: function addFeatures(features) {// eslint-disable-line no-unused-vars
  92829. }
  92830. /**
  92831. * @function Theme.prototype.removeFeatures
  92832. * @param {(Array.<FeatureVector>|FeatureVector|Function)} features - 要删除 feature 的数组或用来过滤的回调函数。
  92833. * @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。
  92834. * 参数中的 features 数组中的每一项,必须是已经添加到当前图层中的 feature,
  92835. * 如果无法确定 feature 数组,则可以调用 removeAllFeatures 来删除所有 feature。
  92836. * 如果要删除的 feature 数组中的元素特别多,推荐使用 removeAllFeatures,
  92837. * 删除所有 feature 后再重新添加。这样效率会更高。
  92838. */
  92839. }, {
  92840. key: "removeFeatures",
  92841. value: function removeFeatures(features) {
  92842. var me = this;
  92843. if (!features) {
  92844. return;
  92845. }
  92846. if (features === me.features) {
  92847. return me.removeAllFeatures();
  92848. }
  92849. if (!Util_Util.isArray(features) && !(typeof features === 'function')) {
  92850. features = [features];
  92851. }
  92852. var featuresFailRemoved = [];
  92853. for (var i = 0; i < me.features.length; i++) {
  92854. var feature = me.features[i];
  92855. //如果我们传入的feature在features数组中没有的话,则不进行删除,
  92856. //并将其放入未删除的数组中。
  92857. if (features && typeof features === 'function') {
  92858. if (features(feature)) {
  92859. me.features.splice(i--, 1);
  92860. }
  92861. } else {
  92862. var findex = Util_Util.indexOf(features, feature);
  92863. if (findex === -1) {
  92864. featuresFailRemoved.push(feature);
  92865. } else {
  92866. me.features.splice(i--, 1);
  92867. }
  92868. }
  92869. }
  92870. var drawFeatures = [];
  92871. for (var hex = 0, len = this.features.length; hex < len; hex++) {
  92872. feature = this.features[hex];
  92873. drawFeatures.push(feature);
  92874. }
  92875. this.features = [];
  92876. this.addFeatures(drawFeatures);
  92877. //绘制专题要素
  92878. if (this.renderer) {
  92879. this.redrawThematicFeatures(this.map.getView().calculateExtent());
  92880. }
  92881. var succeed = featuresFailRemoved.length == 0 ? true : false;
  92882. this.dispatchEvent({
  92883. type: "featuresremoved",
  92884. value: {
  92885. features: featuresFailRemoved,
  92886. succeed: succeed
  92887. }
  92888. });
  92889. }
  92890. /**
  92891. * @function Theme.prototype.removeAllFeatures
  92892. * @description 清除当前图层所有的矢量要素。
  92893. */
  92894. }, {
  92895. key: "removeAllFeatures",
  92896. value: function removeAllFeatures() {
  92897. if (this.renderer) {
  92898. this.renderer.clear();
  92899. }
  92900. this.features = [];
  92901. this.dispatchEvent({
  92902. type: 'featuresremoved',
  92903. value: {
  92904. features: [],
  92905. succeed: true
  92906. }
  92907. });
  92908. }
  92909. /**
  92910. * @function Theme.prototype.getFeatures
  92911. * @description 查看当前图层中的有效数据。
  92912. * @param {Function} [filter] - 根据条件过滤要素的回调函数。
  92913. * @returns {Array.<FeatureVector>} 用户加入图层的有效数据。
  92914. */
  92915. }, {
  92916. key: "getFeatures",
  92917. value: function getFeatures(filter) {
  92918. var len = this.features.length;
  92919. var clonedFeatures = [];
  92920. for (var i = 0; i < len; ++i) {
  92921. if (!filter || filter && typeof filter === 'function' && filter(this.features[i])) {
  92922. clonedFeatures.push(this.features[i]);
  92923. }
  92924. }
  92925. return clonedFeatures;
  92926. }
  92927. /**
  92928. * @function Theme.prototype.getFeatureBy
  92929. * @description 在专题图的要素数组 features 里面遍历每一个 feature,当 feature[property] === value 时,
  92930. * 返回此 feature(并且只返回第一个)。
  92931. * @param {string} property - feature 的某个属性名称。
  92932. * @param {string} value - property 所对应的值。
  92933. * @returns {FeatureVector} 第一个匹配属性和值的矢量要素。
  92934. */
  92935. }, {
  92936. key: "getFeatureBy",
  92937. value: function getFeatureBy(property, value) {
  92938. var feature = null;
  92939. for (var id in this.features) {
  92940. if (this.features[id][property] === value) {
  92941. feature = this.features[id];
  92942. //feature = this.features[id].clone();
  92943. break;
  92944. }
  92945. }
  92946. return feature;
  92947. }
  92948. /**
  92949. * @function Theme.prototype.getFeatureById
  92950. * @description 通过给定一个 ID,返回对应的矢量要素。
  92951. * @param {string} featureId - 矢量要素的属性 ID。
  92952. * @returns {FeatureVector} 对应 ID 的 feature,如果不存在则返回 null。
  92953. */
  92954. }, {
  92955. key: "getFeatureById",
  92956. value: function getFeatureById(featureId) {
  92957. return this.getFeatureBy('id', featureId);
  92958. }
  92959. /**
  92960. * @function Theme.prototype.getFeaturesByAttribute
  92961. * @description 通过给定一个属性的 key 值和 value 值,返回所有匹配的要素数组。
  92962. * @param {string} attrName - 属性的 key。
  92963. * @param {string} attrValue - 矢量要素的属性 ID。
  92964. * @returns {Array.<FeatureVector>} 一个匹配的 feature 数组。
  92965. */
  92966. }, {
  92967. key: "getFeaturesByAttribute",
  92968. value: function getFeaturesByAttribute(attrName, attrValue) {
  92969. var feature,
  92970. foundFeatures = [];
  92971. for (var id in this.features) {
  92972. feature = this.features[id];
  92973. //feature = this.features[id].clone();
  92974. if (feature && feature.attributes) {
  92975. if (feature.attributes[attrName] === attrValue) {
  92976. foundFeatures.push(feature);
  92977. }
  92978. }
  92979. }
  92980. return foundFeatures;
  92981. }
  92982. /**
  92983. * @function Theme.prototype.redrawThematicFeatures
  92984. * @description 抽象方法,可实例化子类必须实现此方法。重绘专题要素。
  92985. * @param {Array} extent - 当前级别下计算出的地图范围。
  92986. */
  92987. }, {
  92988. key: "redrawThematicFeatures",
  92989. value: function redrawThematicFeatures(extent) {//eslint-disable-line no-unused-vars
  92990. }
  92991. /**
  92992. * @private
  92993. * @function Theme.prototype.onInternal
  92994. * @description 添加专题要素事件监听。支持的事件包括: click、mousedown、mousemove、mouseout、mouseover、mouseup。
  92995. * @param {string} event - 事件名称。
  92996. * @param {RequestCallback} callback - 事件回调函数。
  92997. */
  92998. }, {
  92999. key: "onInternal",
  93000. value: function onInternal(event, callback) {
  93001. var cb = callback;
  93002. if (!this.renderer) {
  93003. var evn = [];
  93004. evn.push(event);
  93005. evn.push(cb);
  93006. this.TFEvents.push(evn);
  93007. } else {
  93008. this.renderer.on(event, cb);
  93009. }
  93010. }
  93011. /**
  93012. * @function Theme.prototype.fire
  93013. * @description 添加专题要素事件监听。
  93014. * @param {string} type - 事件类型。
  93015. * @param {string} event - 事件名称。
  93016. */
  93017. }, {
  93018. key: "fire",
  93019. value: function fire(type, event) {
  93020. if (!this.offset) {
  93021. return;
  93022. }
  93023. event = event.originalEvent;
  93024. var x = this.getX(event);
  93025. var y = this.getY(event);
  93026. var rotation = -this.map.getView().getRotation();
  93027. var center = this.map.getPixelFromCoordinate(this.map.getView().getCenter());
  93028. var scaledP = this.scale([x, y], center, this.pixelRatio);
  93029. var rotatedP = this.rotate(scaledP, rotation, center);
  93030. var resultP = [rotatedP[0] + this.offset[0], rotatedP[1] + this.offset[1]];
  93031. var offsetEvent = document.createEvent('Event');
  93032. offsetEvent.initEvent('pointermove', true, true);
  93033. offsetEvent.offsetX = resultP[0];
  93034. offsetEvent.offsetY = resultP[1];
  93035. offsetEvent.layerX = resultP[0];
  93036. offsetEvent.layerY = resultP[1];
  93037. offsetEvent.clientX = resultP[0];
  93038. offsetEvent.clientY = resultP[1];
  93039. offsetEvent.x = x;
  93040. offsetEvent.y = y;
  93041. if (type === 'click') {
  93042. this.renderer.handler._clickHandler(offsetEvent);
  93043. }
  93044. if (type === 'dblclick') {
  93045. this.renderer.handler._dblclickHandler(offsetEvent);
  93046. }
  93047. if (type === 'onmousewheel') {
  93048. this.renderer.handler._mousewheelHandler(offsetEvent);
  93049. }
  93050. if (type === 'mousemove') {
  93051. this.renderer.handler._mousemoveHandler(offsetEvent);
  93052. this.changed();
  93053. }
  93054. if (type === 'onmouseout') {
  93055. this.renderer.handler._mouseoutHandler(offsetEvent);
  93056. }
  93057. if (type === 'onmousedown') {
  93058. this.renderer.handler._mousedownHandler(offsetEvent);
  93059. }
  93060. if (type === 'onmouseup') {
  93061. this.renderer.handler._mouseupHandler(offsetEvent);
  93062. }
  93063. }
  93064. }, {
  93065. key: "getX",
  93066. value: function getX(e) {
  93067. return typeof e.zrenderX != 'undefined' && e.zrenderX || typeof e.offsetX != 'undefined' && e.offsetX || typeof e.layerX != 'undefined' && e.layerX || typeof e.clientX != 'undefined' && e.clientX;
  93068. }
  93069. }, {
  93070. key: "getY",
  93071. value: function getY(e) {
  93072. return typeof e.zrenderY != 'undefined' && e.zrenderY || typeof e.offsetY != 'undefined' && e.offsetY || typeof e.layerY != 'undefined' && e.layerY || typeof e.clientY != 'undefined' && e.clientY;
  93073. }
  93074. /**
  93075. * @function Theme.prototype.un
  93076. * @description 移除专题要素事件监听。
  93077. * @param {string} event - 事件名称。
  93078. * @param {RequestCallback} callback - 事件回调函数。
  93079. */
  93080. }, {
  93081. key: "un",
  93082. value: function un(event, callback) {
  93083. var cb = callback;
  93084. if (!this.renderer) {
  93085. var tfEs = this.TFEvents;
  93086. var len = tfEs.length;
  93087. var newtfEs = [];
  93088. for (var i = 0; i < len; i++) {
  93089. var tfEs_i = tfEs[i];
  93090. if (!(tfEs_i[0] === event && tfEs_i[1] === cb)) {
  93091. newtfEs.push(tfEs_i);
  93092. }
  93093. }
  93094. this.TFEvents = newtfEs;
  93095. } else {
  93096. this.renderer.un(event, cb);
  93097. }
  93098. }
  93099. /**
  93100. * @function Theme.prototype.addTFEvents
  93101. * @description 将图层添加到地图上之前用户要求添加的事件监听添加到图层。
  93102. * @private
  93103. */
  93104. }, {
  93105. key: "addTFEvents",
  93106. value: function addTFEvents() {
  93107. var tfEs = this.TFEvents;
  93108. var len = tfEs.length;
  93109. for (var i = 0; i < len; i++) {
  93110. this.renderer.on(tfEs[i][0], tfEs[i][1]);
  93111. }
  93112. }
  93113. /**
  93114. * @function Theme.prototype.getLocalXY
  93115. * @description 获取坐标系统。
  93116. * @param {Object} coordinate - 坐标位置。
  93117. * @returns {Array.<number>} 像素坐标数组。
  93118. */
  93119. }, {
  93120. key: "getLocalXY",
  93121. value: function getLocalXY(coordinate) {
  93122. var pixelP,
  93123. map = this.map;
  93124. if (coordinate instanceof Point || coordinate instanceof GeoText) {
  93125. pixelP = map.getPixelFromCoordinate([coordinate.x, coordinate.y]);
  93126. }
  93127. if (coordinate instanceof LonLat) {
  93128. pixelP = map.getPixelFromCoordinate([coordinate.lon, coordinate.lat]);
  93129. }
  93130. var rotation = -map.getView().getRotation();
  93131. var center = map.getPixelFromCoordinate(map.getView().getCenter());
  93132. var rotatedP = pixelP;
  93133. if (this.pixelRatio) {
  93134. rotatedP = this.scale(pixelP, center, this.pixelRatio);
  93135. }
  93136. if (pixelP && center) {
  93137. rotatedP = this.rotate(rotatedP, rotation, center);
  93138. }
  93139. if (this.offset && rotatedP) {
  93140. return [rotatedP[0] + this.offset[0], rotatedP[1] + this.offset[1]];
  93141. }
  93142. return rotatedP;
  93143. }
  93144. /**
  93145. * @function Theme.prototype.rotate
  93146. * @description 获取某像素坐标点 pixelP 绕中心 center 逆时针旋转 rotation 弧度后的像素点坐标。
  93147. * @param {number} pixelP - 像素坐标点位置。
  93148. * @param {number} rotation - 旋转角度。
  93149. * @param {number} center - 中心位置。
  93150. * @returns {Array.<number>} 旋转后的像素坐标数组。
  93151. */
  93152. }, {
  93153. key: "rotate",
  93154. value: function rotate(pixelP, rotation, center) {
  93155. var x = Math.cos(rotation) * (pixelP[0] - center[0]) - Math.sin(rotation) * (pixelP[1] - center[1]) + center[0];
  93156. var y = Math.sin(rotation) * (pixelP[0] - center[0]) + Math.cos(rotation) * (pixelP[1] - center[1]) + center[1];
  93157. return [x, y];
  93158. }
  93159. /**
  93160. * @function Theme.prototype.scale
  93161. * @description 获取某像素坐标点 pixelP 相对于中心 center 进行缩放 scaleRatio 倍后的像素点坐标。
  93162. * @param {Object} pixelP - 像素点。
  93163. * @param {Object} center - 中心点。
  93164. * @param {number} scaleRatio - 缩放倍数。
  93165. * @returns {Array.<number>} 返回数组型比例。
  93166. */
  93167. }, {
  93168. key: "scale",
  93169. value: function scale(pixelP, center, scaleRatio) {
  93170. var x = (pixelP[0] - center[0]) * scaleRatio + center[0];
  93171. var y = (pixelP[1] - center[1]) * scaleRatio + center[1];
  93172. return [x, y];
  93173. }
  93174. /**
  93175. * @function Theme.prototype.toiClientFeature
  93176. * @description 转为 iClient 要素。
  93177. * @param {(Array.<ThemeFeature>|Array.<GeoJSONObject>|Array.<ol.Feature>|ThemeFeature|GeoJSONObject|ol.Feature)} features - 待转要素。
  93178. * @returns {Array.<FeatureVector>} 转换后的 iClient 要素。
  93179. */
  93180. }, {
  93181. key: "toiClientFeature",
  93182. value: function toiClientFeature(features) {
  93183. if (!Util_Util.isArray(features)) {
  93184. features = [features];
  93185. }
  93186. var featuresTemp = [];
  93187. for (var i = 0; i < features.length; i++) {
  93188. if (features[i] instanceof ThemeFeature) {
  93189. // ThemeFeature 类型
  93190. featuresTemp.push(features[i].toFeature());
  93191. continue;
  93192. } else if (features[i] instanceof (external_ol_Feature_default())) {
  93193. //ol.Feature 数据类型
  93194. //_toFeature 统一处理 ol.Feature 所有 geometry 类型
  93195. featuresTemp.push(this._toFeature(features[i]));
  93196. continue;
  93197. } else if (features[i] instanceof Vector) {
  93198. // 若是 FeatureVector 直接返回
  93199. featuresTemp.push(features[i]);
  93200. continue;
  93201. } else if (features[i].geometry && features[i].geometry.parts) {
  93202. //iServer服务器返回数据格式
  93203. featuresTemp.push(ServerFeature.fromJson(features[i]).toFeature());
  93204. } else if (["FeatureCollection", "Feature", "Geometry"].indexOf(features[i].type) != -1) {
  93205. //GeoJSON 规范数据类型
  93206. var format = new GeoJSON();
  93207. featuresTemp = featuresTemp.concat(format.read(features[i]));
  93208. } else {
  93209. throw new Error("features[".concat(i, "]'s type is not be supported."));
  93210. }
  93211. }
  93212. return featuresTemp;
  93213. }
  93214. /**
  93215. * @function Theme.prototype.toFeature
  93216. * @deprecated
  93217. * @description 转为 iClient 要素,该方法将被弃用,由 {@link Theme#toiClientFeature} 代替。
  93218. * @param {(Array.<ThemeFeature>|Array.<GeoJSONObject>|Array.<ol.Feature>|ThemeFeature|GeoJSONObject|ol.Feature)} features - 待转要素。
  93219. * @returns {Array.<FeatureVector>} 转换后的 iClient 要素。
  93220. */
  93221. }, {
  93222. key: "toFeature",
  93223. value: function toFeature(features) {
  93224. return this.toiClientFeature(features);
  93225. }
  93226. //统一处理 ol.feature所有 geometry 类型
  93227. }, {
  93228. key: "_toFeature",
  93229. value: function _toFeature(feature) {
  93230. var geoFeature = new (external_ol_format_GeoJSON_default())().writeFeature(feature);
  93231. return new GeoJSON().read(geoFeature, "Feature");
  93232. }
  93233. }]);
  93234. return Theme;
  93235. }((external_ol_source_ImageCanvas_default()));
  93236. ;// CONCATENATED MODULE: ./src/openlayers/overlay/Graph.js
  93237. function overlay_Graph_typeof(obj) { "@babel/helpers - typeof"; return overlay_Graph_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, overlay_Graph_typeof(obj); }
  93238. function overlay_Graph_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  93239. function overlay_Graph_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  93240. function overlay_Graph_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Graph_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Graph_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  93241. function overlay_Graph_get() { if (typeof Reflect !== "undefined" && Reflect.get) { overlay_Graph_get = Reflect.get.bind(); } else { overlay_Graph_get = function _get(target, property, receiver) { var base = overlay_Graph_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return overlay_Graph_get.apply(this, arguments); }
  93242. function overlay_Graph_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Graph_getPrototypeOf(object); if (object === null) break; } return object; }
  93243. function overlay_Graph_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) overlay_Graph_setPrototypeOf(subClass, superClass); }
  93244. function overlay_Graph_setPrototypeOf(o, p) { overlay_Graph_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return overlay_Graph_setPrototypeOf(o, p); }
  93245. function overlay_Graph_createSuper(Derived) { var hasNativeReflectConstruct = overlay_Graph_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = overlay_Graph_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = overlay_Graph_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return overlay_Graph_possibleConstructorReturn(this, result); }; }
  93246. function overlay_Graph_possibleConstructorReturn(self, call) { if (call && (overlay_Graph_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return overlay_Graph_assertThisInitialized(self); }
  93247. function overlay_Graph_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  93248. function overlay_Graph_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  93249. function overlay_Graph_getPrototypeOf(o) { overlay_Graph_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return overlay_Graph_getPrototypeOf(o); }
  93250. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  93251. * This program are made available under the terms of the Apache License, Version 2.0
  93252. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  93253. /**
  93254. * @class Graph
  93255. * @browsernamespace ol.source
  93256. * @category Visualization Theme
  93257. * @classdesc 统计专题图图层基类。
  93258. * @modulecategory Overlay
  93259. * @param {string} chartsType - 图表类别。
  93260. * @param {string} name - 图层名称。
  93261. * @param {Object} opt_options - 参数。
  93262. * @param {ol.Map} opt_options.map - 当前 Map 对象。
  93263. * @param {string} opt_options.chartsType - 图表类型。目前可用:"Bar","Bar3D","Line","Point","Pie","Ring"。
  93264. * @param {Object} opt_options.chartsSetting - 各类型图表的 chartsSetting 对象可设属性请参考具体图表模型类的注释中对 chartsSetting 对象可设属性的描述。chartsSetting 对象通常都具有以下几个基础可设属性。
  93265. * @param {number} opt_options.chartsSetting.width - 专题要素(图表)宽度。
  93266. * @param {number} opt_options.chartsSetting.height - 专题要素(图表)高度。
  93267. * @param {Array.<number>} opt_options.chartsSetting.codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  93268. * @param {number} [opt_options.chartsSetting.XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  93269. * @param {number} [opt_options.chartsSetting.YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  93270. * @param {Array.<number>} [opt_options.chartsSetting.dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox(由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值,长度为 4 的一维数组。
  93271. * @param {number} [opt_options.chartsSetting.decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  93272. * @param {string} opt_options.themeFields - 指定创建专题图字段。
  93273. * @param {string} [opt_options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  93274. * @param {number} [opt_options.opacity = 1] - 图层透明度。
  93275. * @param {string} [opt_options.logo] - Logo(openLayers 5.0.0 及更高版本不再支持此参数)。
  93276. * @param {ol.proj.Projection} [opt_options.projection] - {@link ol.proj.Projection} 投影信息。
  93277. * @param {number} [opt_options.ratio=1.5] - 视图比, 1 表示画布是地图视口的大小,2 表示地图视口的宽度和高度的两倍,依此类推。必须是 1 或更高。
  93278. * @param {Array.<number>} [opt_options.resolutions] - 分辨率数组。
  93279. * @param {boolean} [opt_options.isOverLay=true] - 是否进行压盖处理,如果设为 true,图表绘制过程中将隐藏对已在图层中绘制的图表产生压盖的图表。
  93280. * @param {ol.source.State} [opt_options.state] - 资源状态。
  93281. * @param {(string|Object)} [opt_options.attributions='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>'] - 版权信息。
  93282. * @extends {Theme}
  93283. * @usage
  93284. */
  93285. var Graph_Graph = /*#__PURE__*/function (_Theme) {
  93286. overlay_Graph_inherits(Graph, _Theme);
  93287. var _super = overlay_Graph_createSuper(Graph);
  93288. function Graph(name, chartsType, opt_options) {
  93289. var _this;
  93290. overlay_Graph_classCallCheck(this, Graph);
  93291. _this = _super.call(this, name, opt_options);
  93292. _this.chartsSetting = opt_options.chartsSetting || {};
  93293. _this.themeFields = opt_options.themeFields || null;
  93294. _this.overlayWeightField = opt_options.overlayWeightField || null;
  93295. _this.isOverLay = opt_options.isOverLay === undefined ? true : opt_options.isOverLay;
  93296. _this.charts = opt_options.charts || [];
  93297. _this.cache = opt_options.cache || {};
  93298. _this.chartsType = chartsType;
  93299. return _this;
  93300. }
  93301. /**
  93302. * @function Graph.prototype.destroy
  93303. * @description 释放资源,将引用资源的属性置空。
  93304. */
  93305. overlay_Graph_createClass(Graph, [{
  93306. key: "destroy",
  93307. value: function destroy() {
  93308. this.chartsType = null;
  93309. this.chartsSetting = null;
  93310. this.themeFields = null;
  93311. this.overlayWeightField = null;
  93312. this.isOverLay = null;
  93313. theme_Theme_Theme.prototype.destroy.apply(this, arguments);
  93314. // charts cache 为缓存,需要在父类destory后置为null(父类destory中有方法会初始化缓存参数)
  93315. this.charts = null;
  93316. this.cache = null;
  93317. }
  93318. /**
  93319. * @function Graph.prototype.setChartsType
  93320. * @description 设置图表类型,此函数可动态改变图表类型。在调用此函数前请通过 chartsSetting 为新类型的图表做相关配置。
  93321. * @param {string} chartsType - 图表类型。目前可用:"Bar","Bar3D","Line","Point","Pie","Ring"。
  93322. */
  93323. }, {
  93324. key: "setChartsType",
  93325. value: function setChartsType(chartsType) {
  93326. this.chartsType = chartsType;
  93327. this.redraw();
  93328. }
  93329. /**
  93330. * @function Graph.prototype.addFeatures
  93331. * @description 向专题图图层中添加数据。
  93332. * @param {(ServerFeature|ThemeFeature)} features - 待添加的要素。
  93333. */
  93334. }, {
  93335. key: "addFeatures",
  93336. value: function addFeatures(features) {
  93337. var ret = this.dispatchEvent({
  93338. type: 'beforefeaturesadded',
  93339. value: {
  93340. features: features
  93341. }
  93342. });
  93343. if (ret === false) {
  93344. return;
  93345. }
  93346. //转换 features 形式
  93347. this.features = this.toiClientFeature(features);
  93348. //绘制专题要素
  93349. if (this.renderer) {
  93350. this.changed();
  93351. }
  93352. }
  93353. /**
  93354. * @function Graph.prototype.redrawThematicFeatures
  93355. * @description 重绘所有专题要素。
  93356. * 此方法包含绘制专题要素的所有步骤,包含用户数据到专题要素的转换,抽稀,缓存等步骤。
  93357. * 地图漫游时调用此方法进行图层刷新。
  93358. * @param {Object} extent - 重绘的范围。
  93359. *
  93360. */
  93361. }, {
  93362. key: "redrawThematicFeatures",
  93363. value: function redrawThematicFeatures(extent) {
  93364. //清除当前所有可视元素
  93365. this.renderer.clearAll();
  93366. var features = this.features;
  93367. for (var i = 0, len = features.length; i < len; i++) {
  93368. var feature = features[i];
  93369. // 要素范围判断
  93370. var feaBounds = feature.geometry.getBounds();
  93371. //剔除当前视图(地理)范围以外的数据
  93372. if (extent) {
  93373. var bounds = new Bounds(extent[0], extent[1], extent[2], extent[3]);
  93374. if (!bounds.intersectsBounds(feaBounds)) {
  93375. continue;
  93376. }
  93377. }
  93378. var cache = this.cache;
  93379. // 用 feature id 做缓存标识
  93380. var cacheField = feature.id;
  93381. // 数据对应的图表是否已缓存,没缓存则重新创建图表
  93382. if (cache[cacheField]) {
  93383. continue;
  93384. }
  93385. cache[cacheField] = cacheField;
  93386. var chart = this.createThematicFeature(feature);
  93387. // 压盖处理权重值
  93388. if (chart && this.overlayWeightField) {
  93389. if (feature.attributes[this.overlayWeightField] && !isNaN(feature.attributes[this.overlayWeightField])) {
  93390. chart["__overlayWeight"] = feature.attributes[this.overlayWeightField];
  93391. }
  93392. }
  93393. if (chart) {
  93394. this.charts.push(chart);
  93395. }
  93396. }
  93397. this.drawCharts();
  93398. }
  93399. /**
  93400. * @function Graph.prototype.createThematicFeature
  93401. * @description 向专题图图层中添加数据, 支持的 feature 类型为:iServer 返回的 feature JSON 对象。
  93402. * @param {ServerFeature} feature - 待添加的要素。
  93403. *
  93404. */
  93405. }, {
  93406. key: "createThematicFeature",
  93407. value: function createThematicFeature(feature) {
  93408. var thematicFeature;
  93409. // 检查图表创建条件并创建图形
  93410. if (Theme_Theme[this.chartsType] && this.themeFields && this.chartsSetting) {
  93411. thematicFeature = new Theme_Theme[this.chartsType](feature, this, this.themeFields, this.chartsSetting);
  93412. }
  93413. // thematicFeature 是否创建成功
  93414. if (!thematicFeature) {
  93415. return false;
  93416. }
  93417. // 对专题要素执行图形装载
  93418. thematicFeature.assembleShapes();
  93419. return thematicFeature;
  93420. }
  93421. /**
  93422. * @function Graph.prototype.drawCharts
  93423. * @description 绘制图表。包含压盖处理。
  93424. *
  93425. */
  93426. }, {
  93427. key: "drawCharts",
  93428. value: function drawCharts() {
  93429. // 判断 rendere r就绪
  93430. if (!this.renderer) {
  93431. return;
  93432. }
  93433. var charts = this.charts;
  93434. // 图表权重值处理
  93435. if (this.overlayWeightField) {
  93436. charts.sort(function (cs, ce) {
  93437. if (typeof cs["__overlayWeight"] == "undefined" && typeof ce["__overlayWeight"] == "undefined") {
  93438. return 0;
  93439. } else if (typeof cs["__overlayWeight"] != "undefined" && typeof ce["__overlayWeight"] == "undefined") {
  93440. return -1;
  93441. } else if (typeof cs["__overlayWeight"] == "undefined" && typeof ce["__overlayWeight"] != "undefined") {
  93442. return 1;
  93443. } else if (typeof cs["__overlayWeight"] != "undefined" && typeof ce["__overlayWeight"] != "undefined") {
  93444. if (parseFloat(cs["__overlayWeight"]) < parseFloat(ce["__overlayWeight"])) {
  93445. return 1;
  93446. } else {
  93447. return -1;
  93448. }
  93449. }
  93450. return 0;
  93451. });
  93452. }
  93453. // 不进行避让
  93454. if (!this.isOverLay) {
  93455. for (var m = 0, len_m = charts.length; m < len_m; m++) {
  93456. var chart_m = charts[m];
  93457. // 图形参考位置 (reSetLocation 会更新 chartBounds)
  93458. var shapeROP_m = chart_m.resetLocation();
  93459. // 添加图形
  93460. var shapes_m = chart_m.shapes;
  93461. for (var n = 0, slen_n = shapes_m.length; n < slen_n; n++) {
  93462. shapes_m[n].refOriginalPosition = shapeROP_m;
  93463. this.renderer.addShape(shapes_m[n]);
  93464. }
  93465. }
  93466. } else {
  93467. // 压盖判断所需 chartsBounds 集合
  93468. var chartsBounds = [];
  93469. var extent = this.map.getView().calculateExtent();
  93470. var mapBounds = new Bounds(extent[0], extent[1], extent[2], extent[3]);
  93471. // 获取地图像素 bounds
  93472. var mapPxLT = this.getLocalXY(new LonLat(mapBounds.left, mapBounds.top));
  93473. var mapPxRB = this.getLocalXY(new LonLat(mapBounds.right, mapBounds.bottom));
  93474. var mBounds = new Bounds(mapPxLT[0], mapPxRB[1], mapPxRB[0], mapPxLT[1]);
  93475. // 压盖处理 & 添加图形
  93476. for (var i = 0, len = charts.length; i < len; i++) {
  93477. var chart = charts[i];
  93478. // 图形参考位置 (reSetLocation 会更新 chartBounds)
  93479. var shapeROP = chart.resetLocation();
  93480. // 图表框
  93481. var cbs = chart.chartBounds;
  93482. var cBounds = [{
  93483. "x": cbs.left,
  93484. "y": cbs.top
  93485. }, {
  93486. "x": cbs.left,
  93487. "y": cbs.bottom
  93488. }, {
  93489. "x": cbs.right,
  93490. "y": cbs.bottom
  93491. }, {
  93492. "x": cbs.right,
  93493. "y": cbs.top
  93494. }, {
  93495. "x": cbs.left,
  93496. "y": cbs.top
  93497. }];
  93498. // 地图范围外不绘制
  93499. if (mBounds) {
  93500. if (!this.isChartInMap(mBounds, cBounds)) {
  93501. continue;
  93502. }
  93503. }
  93504. // 是否压盖
  93505. var isOL = false;
  93506. if (i !== 0) {
  93507. for (var j = 0; j < chartsBounds.length; j++) {
  93508. //压盖判断
  93509. if (this.isQuadrilateralOverLap(cBounds, chartsBounds[j])) {
  93510. isOL = true;
  93511. break;
  93512. }
  93513. }
  93514. }
  93515. if (isOL) {
  93516. continue;
  93517. } else {
  93518. chartsBounds.push(cBounds);
  93519. }
  93520. // 添加图形
  93521. var shapes = chart.shapes;
  93522. for (var _j2 = 0, slen = shapes.length; _j2 < slen; _j2++) {
  93523. shapes[_j2].refOriginalPosition = shapeROP;
  93524. this.renderer.addShape(shapes[_j2]);
  93525. }
  93526. }
  93527. }
  93528. // 绘制图形
  93529. this.renderer.render();
  93530. }
  93531. /**
  93532. * @function Graph.prototype.getShapesByFeatureID
  93533. * @description 通过 FeatureID 获取 feature 关联的所有图形。如果不传入此参数,函数将返回所有图形。
  93534. * @param {number} featureID - 要素 ID。
  93535. */
  93536. }, {
  93537. key: "getShapesByFeatureID",
  93538. value: function getShapesByFeatureID(featureID) {
  93539. var list = [];
  93540. var shapeList = this.renderer.getAllShapes();
  93541. if (!featureID) {
  93542. return shapeList;
  93543. }
  93544. for (var i = 0, len = shapeList.length; i < len; i++) {
  93545. var si = shapeList[i];
  93546. if (si.refDataID && featureID === si.refDataID) {
  93547. list.push(si);
  93548. }
  93549. }
  93550. return list;
  93551. }
  93552. /**
  93553. * @function Graph.prototype.isQuadrilateralOverLap
  93554. * @description 判断两个四边形是否有压盖。
  93555. * @param {Array.<Object>} quadrilateral - 四边形节点数组。
  93556. * @param {Array.<Object>} quadrilateral2 - 第二个四边形节点数组。
  93557. */
  93558. }, {
  93559. key: "isQuadrilateralOverLap",
  93560. value: function isQuadrilateralOverLap(quadrilateral, quadrilateral2) {
  93561. var quadLen = quadrilateral.length,
  93562. quad2Len = quadrilateral2.length;
  93563. if (quadLen !== 5 || quad2Len !== 5) {
  93564. return null;
  93565. } //不是四边形
  93566. var OverLap = false;
  93567. //如果两四边形互不包含对方的节点,则两个四边形不相交
  93568. for (var i = 0; i < quadLen; i++) {
  93569. if (this.isPointInPoly(quadrilateral[i], quadrilateral2)) {
  93570. OverLap = true;
  93571. break;
  93572. }
  93573. }
  93574. for (var _i2 = 0; _i2 < quad2Len; _i2++) {
  93575. if (this.isPointInPoly(quadrilateral2[_i2], quadrilateral)) {
  93576. OverLap = true;
  93577. break;
  93578. }
  93579. }
  93580. //加上两矩形十字相交的情况
  93581. for (var _i4 = 0; _i4 < quadLen - 1; _i4++) {
  93582. if (OverLap) {
  93583. break;
  93584. }
  93585. for (var j = 0; j < quad2Len - 1; j++) {
  93586. var isLineIn = Util_Util.lineIntersection(quadrilateral[_i4], quadrilateral[_i4 + 1], quadrilateral2[j], quadrilateral2[j + 1]);
  93587. if (isLineIn.CLASS_NAME === "SuperMap.Geometry.Point") {
  93588. OverLap = true;
  93589. break;
  93590. }
  93591. }
  93592. }
  93593. return OverLap;
  93594. }
  93595. /**
  93596. * @function Graph.prototype.isPointInPoly
  93597. * @description 判断一个点是否在多边形里面(射线法)。
  93598. * @param {Object} pt - 需要判定的点对象,该对象含有属性 x(横坐标),属性 y(纵坐标)。
  93599. * @param {Array.<Object>} poly - 多边形节点数组。
  93600. */
  93601. }, {
  93602. key: "isPointInPoly",
  93603. value: function isPointInPoly(pt, poly) {
  93604. for (var isIn = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i) {
  93605. (poly[i].y <= pt.y && pt.y < poly[j].y || poly[j].y <= pt.y && pt.y < poly[i].y) && pt.x < (poly[j].x - poly[i].x) * (pt.y - poly[i].y) / (poly[j].y - poly[i].y) + poly[i].x && (isIn = !isIn);
  93606. }
  93607. return isIn;
  93608. }
  93609. /**
  93610. * @function Graph.prototype.isChartInMap
  93611. * @description 判断图表是否在地图里。
  93612. * @param {Bounds} mapPxBounds - 地图像素范围。
  93613. * @param {Array.<Object>} chartPxBounds - 图表范围的四边形节点数组。
  93614. */
  93615. }, {
  93616. key: "isChartInMap",
  93617. value: function isChartInMap(mapPxBounds, chartPxBounds) {
  93618. var mb = mapPxBounds;
  93619. var isIn = false;
  93620. for (var i = 0, len = chartPxBounds.length; i < len; i++) {
  93621. var cb = chartPxBounds[i];
  93622. if (cb.x >= mb.left && cb.x <= mb.right && cb.y >= mb.top && cb.y <= mb.bottom) {
  93623. isIn = true;
  93624. break;
  93625. }
  93626. }
  93627. return isIn;
  93628. }
  93629. /**
  93630. * @function Graph.prototype.clearCache
  93631. * @description 清除缓存。
  93632. */
  93633. }, {
  93634. key: "clearCache",
  93635. value: function clearCache() {
  93636. this.cache = {};
  93637. this.charts = [];
  93638. }
  93639. /**
  93640. * @function Graph.prototype.removeFeatures
  93641. * @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。参数中的 features 数组中的每一项,必须是已经添加到当前图层中的 feature。
  93642. * @param {Array.<FeatureVector>|FeatureVector|Function} features - 要删除的要素。
  93643. */
  93644. }, {
  93645. key: "removeFeatures",
  93646. value: function removeFeatures(features) {
  93647. this.clearCache();
  93648. overlay_Graph_get(overlay_Graph_getPrototypeOf(Graph.prototype), "removeFeatures", this).call(this, features);
  93649. }
  93650. /**
  93651. * @function Graph.prototype.removeAllFeatures
  93652. * @description 移除所有的要素。
  93653. */
  93654. }, {
  93655. key: "removeAllFeatures",
  93656. value: function removeAllFeatures() {
  93657. this.clearCache();
  93658. overlay_Graph_get(overlay_Graph_getPrototypeOf(Graph.prototype), "removeAllFeatures", this).call(this);
  93659. }
  93660. /**
  93661. * @function Graph.prototype.redraw
  93662. * @description 重绘该图层。
  93663. */
  93664. }, {
  93665. key: "redraw",
  93666. value: function redraw() {
  93667. this.clearCache();
  93668. if (this.renderer) {
  93669. this.redrawThematicFeatures(this.map.getView().calculateExtent());
  93670. return true;
  93671. }
  93672. return false;
  93673. }
  93674. /**
  93675. * @function Graph.prototype.clear
  93676. * @description 清除的内容包括数据(features)、专题要素、缓存。
  93677. */
  93678. }, {
  93679. key: "clear",
  93680. value: function clear() {
  93681. if (this.renderer) {
  93682. this.renderer.clearAll();
  93683. this.renderer.refresh();
  93684. }
  93685. this.removeAllFeatures();
  93686. this.clearCache();
  93687. }
  93688. }, {
  93689. key: "canvasFunctionInternal_",
  93690. value: function canvasFunctionInternal_(extent, resolution, pixelRatio, size, projection) {
  93691. // eslint-disable-line no-unused-vars
  93692. return theme_Theme_Theme.prototype.canvasFunctionInternal_.apply(this, arguments);
  93693. }
  93694. }]);
  93695. return Graph;
  93696. }(theme_Theme_Theme);
  93697. ;// CONCATENATED MODULE: external "ol.style.RegularShape"
  93698. var external_ol_style_RegularShape_namespaceObject = ol.style.RegularShape;
  93699. var external_ol_style_RegularShape_default = /*#__PURE__*/__webpack_require__.n(external_ol_style_RegularShape_namespaceObject);
  93700. ;// CONCATENATED MODULE: ./src/openlayers/overlay/graphic/CloverShape.js
  93701. function CloverShape_typeof(obj) { "@babel/helpers - typeof"; return CloverShape_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, CloverShape_typeof(obj); }
  93702. function CloverShape_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  93703. function CloverShape_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  93704. function CloverShape_createClass(Constructor, protoProps, staticProps) { if (protoProps) CloverShape_defineProperties(Constructor.prototype, protoProps); if (staticProps) CloverShape_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  93705. function CloverShape_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) CloverShape_setPrototypeOf(subClass, superClass); }
  93706. function CloverShape_setPrototypeOf(o, p) { CloverShape_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return CloverShape_setPrototypeOf(o, p); }
  93707. function CloverShape_createSuper(Derived) { var hasNativeReflectConstruct = CloverShape_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = CloverShape_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = CloverShape_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return CloverShape_possibleConstructorReturn(this, result); }; }
  93708. function CloverShape_possibleConstructorReturn(self, call) { if (call && (CloverShape_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return CloverShape_assertThisInitialized(self); }
  93709. function CloverShape_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  93710. function CloverShape_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  93711. function CloverShape_getPrototypeOf(o) { CloverShape_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return CloverShape_getPrototypeOf(o); }
  93712. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  93713. * This program are made available under the terms of the Apache License, Version 2.0
  93714. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  93715. /**
  93716. * @class CloverShape
  93717. * @browsernamespace ol.style
  93718. * @category Visualization Graphic
  93719. * @classdesc 三叶草要素风格。
  93720. * @modulecategory Overlay
  93721. * @extends {ol.style.RegularShape}
  93722. * @param {Object} options - 三叶草形要素风格参数。
  93723. * @param {number} [options.angle=30] - 三叶草每个扇叶的圆心角,单位弧度。
  93724. * @param {number} [options.count=3] - 扇叶数量。
  93725. * @param {ol.style.Fill} [options.fill] - 填充样式。
  93726. * @param {number} [options.strokeOpacity] - 透明度。
  93727. * @param {number} [options.fillOpacity] - 填充透明度。
  93728. * @param {number} [options.radius] - 半径。
  93729. * @param {ol.style.Stroke} [options.stroke] - 边框样式。
  93730. * @param {string} [options.stroke.color='#3388ff'] - 边框颜色。
  93731. * @param {number} [options.stroke.width=1] - 边框宽度。
  93732. * @usage
  93733. */
  93734. var CloverShape = /*#__PURE__*/function (_RegularShape) {
  93735. CloverShape_inherits(CloverShape, _RegularShape);
  93736. var _super = CloverShape_createSuper(CloverShape);
  93737. function CloverShape(options) {
  93738. var _this;
  93739. CloverShape_classCallCheck(this, CloverShape);
  93740. if (options.stroke) {
  93741. options.stroke.color = options.stroke.getColor() || "#3388ff";
  93742. options.stroke.width = options.stroke.getWidth() || 1;
  93743. } else {
  93744. options.stroke = new (external_ol_style_Stroke_default())({
  93745. color: "#3388ff",
  93746. width: 1
  93747. });
  93748. }
  93749. if (options.fill) {
  93750. options.fill.color = options.fill.getColor() || "#66ccff";
  93751. } else {
  93752. options.fill = new (external_ol_style_Fill_default())({
  93753. color: "#66ccff"
  93754. });
  93755. }
  93756. _this = _super.call(this, {
  93757. angle: options.angle || 60,
  93758. stroke: options.stroke,
  93759. fill: options.fill,
  93760. radius: options.radius || 10,
  93761. rotation: options.rotation || 0
  93762. });
  93763. _this.count_ = options.count || 3;
  93764. _this.strokeOpacity = options.strokeOpacity || 1;
  93765. _this.fillOpacity = options.fillOpacity || 1;
  93766. _this._pixelRatio = window ? window.devicePixelRatio : 1;
  93767. _this._canvas = _this.getImage(_this._pixelRatio);
  93768. _this._ctx = _this._canvas.getContext('2d');
  93769. _this._render();
  93770. return _this;
  93771. }
  93772. CloverShape_createClass(CloverShape, [{
  93773. key: "_render",
  93774. value: function _render() {
  93775. //起始角度
  93776. var sAngle = 0;
  93777. var eAngle = this.getAngle();
  93778. this.spaceAngle = 360 / this.count_ - this.getAngle();
  93779. if (this.spaceAngle < 0) {
  93780. return;
  93781. }
  93782. this._ctx.setTransform(this._pixelRatio, 0, 0, this._pixelRatio, 0, 0);
  93783. this._ctx.translate(0, 0);
  93784. this._ctx.beginPath();
  93785. for (var i = 0; i < this.count_; i++) {
  93786. this._drawSector(this._ctx, this.getAnchor()[0], this.getAnchor()[1], this.getRadius(), sAngle, eAngle);
  93787. sAngle = eAngle + this.spaceAngle;
  93788. eAngle = sAngle + this.getAngle();
  93789. }
  93790. this._fillStroke();
  93791. this._ctx.closePath();
  93792. }
  93793. /**
  93794. * @function CloverShape.prototype.drawSector
  93795. * @description 绘制扇形。
  93796. * @param {CanvasRenderingContext2D} ctx - context 对象。
  93797. * @param {number} x - 中心点 x。
  93798. * @param {number} y - 中心点 y。
  93799. * @param {number} r - 中心点 r。
  93800. * @param {number} sAngle - 扇叶起始角度。
  93801. * @param {number} eAngle - 扇叶终止角度。
  93802. */
  93803. }, {
  93804. key: "_drawSector",
  93805. value: function _drawSector(ctx, x, y, r, sAngle, eAngle) {
  93806. //角度转换
  93807. sAngle = sAngle / 180 * Math.PI;
  93808. eAngle = eAngle / 180 * Math.PI;
  93809. ctx.moveTo(x, y);
  93810. ctx.lineTo(x + r * Math.cos(sAngle), y + r * Math.sin(sAngle));
  93811. ctx.arc(x, y, r, sAngle, eAngle);
  93812. ctx.lineTo(x, y);
  93813. }
  93814. }, {
  93815. key: "_fillStroke",
  93816. value: function _fillStroke() {
  93817. if (this.getFill()) {
  93818. this._ctx.globalAlpha = this.fillOpacity;
  93819. this._ctx.fillStyle = this.getFill().color;
  93820. this._ctx.fill();
  93821. }
  93822. if (this.getStroke() && this.weight !== 0) {
  93823. this._ctx.globalAlpha = this.strokeOpacity;
  93824. this._ctx.lineWidth = this.getStroke().width;
  93825. this._ctx.strokeStyle = this.getStroke().color;
  93826. this._ctx.lineCap = this.getStroke().lineCap;
  93827. this._ctx.lineJoin = this.getStroke().lineJoin;
  93828. this._ctx.stroke();
  93829. }
  93830. }
  93831. /**
  93832. * @function CloverShape.prototype.getCount
  93833. * @description 获取扇叶数量。
  93834. */
  93835. }, {
  93836. key: "getCount",
  93837. value: function getCount() {
  93838. return this.count_;
  93839. }
  93840. /**
  93841. * @function CloverShape.prototype.getSpaceAngle
  93842. * @description 获取扇叶间隔角度。
  93843. */
  93844. }, {
  93845. key: "getSpaceAngle",
  93846. value: function getSpaceAngle() {
  93847. return this.spaceAngle;
  93848. }
  93849. }]);
  93850. return CloverShape;
  93851. }((external_ol_style_RegularShape_default()));
  93852. ;// CONCATENATED MODULE: ./src/openlayers/overlay/graphic/HitCloverShape.js
  93853. function HitCloverShape_typeof(obj) { "@babel/helpers - typeof"; return HitCloverShape_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, HitCloverShape_typeof(obj); }
  93854. function HitCloverShape_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  93855. function HitCloverShape_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  93856. function HitCloverShape_createClass(Constructor, protoProps, staticProps) { if (protoProps) HitCloverShape_defineProperties(Constructor.prototype, protoProps); if (staticProps) HitCloverShape_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  93857. function HitCloverShape_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) HitCloverShape_setPrototypeOf(subClass, superClass); }
  93858. function HitCloverShape_setPrototypeOf(o, p) { HitCloverShape_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return HitCloverShape_setPrototypeOf(o, p); }
  93859. function HitCloverShape_createSuper(Derived) { var hasNativeReflectConstruct = HitCloverShape_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = HitCloverShape_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = HitCloverShape_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return HitCloverShape_possibleConstructorReturn(this, result); }; }
  93860. function HitCloverShape_possibleConstructorReturn(self, call) { if (call && (HitCloverShape_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return HitCloverShape_assertThisInitialized(self); }
  93861. function HitCloverShape_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  93862. function HitCloverShape_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  93863. function HitCloverShape_getPrototypeOf(o) { HitCloverShape_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return HitCloverShape_getPrototypeOf(o); }
  93864. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  93865. * This program are made available under the terms of the Apache License, Version 2.0
  93866. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  93867. /**
  93868. * @class HitCloverShape
  93869. * @browsernamespace ol.style
  93870. * @category Visualization Graphic
  93871. * @classdesc 三叶草要素高亮风格。
  93872. * @modulecategory Overlay
  93873. * @extends {CloverShape}
  93874. * @param {Object} options - 三叶草形要素风格参数。
  93875. * @param {number} options.sAngle - 扇叶起始角度。
  93876. * @param {number} options.eAngle - 扇叶终止角度。
  93877. * @param {number} [options.angle = 30] - 三叶草每个扇叶的圆心角,单位弧度。
  93878. * @param {ol.style.Fill} [options.fill] - 填充样式。
  93879. * @param {ol.style.Stroke} [options.stroke] - 边框样式。
  93880. * @param {number} [options.strokeOpacity] - 透明度。
  93881. * @param {number} [options.fillOpacity] - 填充透明度。
  93882. * @param {number} [options.radius] - 半径。
  93883. * @usage
  93884. */
  93885. var HitCloverShape = /*#__PURE__*/function (_CloverShape) {
  93886. HitCloverShape_inherits(HitCloverShape, _CloverShape);
  93887. var _super = HitCloverShape_createSuper(HitCloverShape);
  93888. function HitCloverShape(options) {
  93889. var _this;
  93890. HitCloverShape_classCallCheck(this, HitCloverShape);
  93891. _this = _super.call(this, options);
  93892. _this.sAngle = options.sAngle;
  93893. _this.eAngle = options.eAngle;
  93894. _this._render();
  93895. return _this;
  93896. }
  93897. HitCloverShape_createClass(HitCloverShape, [{
  93898. key: "_render",
  93899. value: function _render() {
  93900. // draw the circle on the canvas
  93901. this._ctx.clearRect(0, 0, this.getImage().width, this.getImage().height);
  93902. // reset transform
  93903. this._ctx.setTransform(this._pixelRatio, 0, 0, this._pixelRatio, 0, 0);
  93904. this._ctx.translate(0, 0);
  93905. this._ctx.beginPath();
  93906. this._drawSector(this._ctx, this.getAnchor()[0], this.getAnchor()[1], this.getRadius(), this.sAngle, this.eAngle);
  93907. this._fillStroke();
  93908. this._ctx.closePath();
  93909. }
  93910. /**
  93911. * @function HitCloverShape.prototype.getSAngle
  93912. * @description 获取扇叶起始角度。
  93913. */
  93914. }, {
  93915. key: "getSAngle",
  93916. value: function getSAngle() {
  93917. return this.sAngle;
  93918. }
  93919. /**
  93920. * @function HitCloverShape.prototype.getEAngle
  93921. * @description 获取扇叶终止角度。
  93922. */
  93923. }, {
  93924. key: "getEAngle",
  93925. value: function getEAngle() {
  93926. return this.eAngle;
  93927. }
  93928. }]);
  93929. return HitCloverShape;
  93930. }(CloverShape);
  93931. ;// CONCATENATED MODULE: external "ol.Object"
  93932. var external_ol_Object_namespaceObject = ol.Object;
  93933. var external_ol_Object_default = /*#__PURE__*/__webpack_require__.n(external_ol_Object_namespaceObject);
  93934. ;// CONCATENATED MODULE: ./src/openlayers/overlay/graphic/WebGLRenderer.js
  93935. function WebGLRenderer_typeof(obj) { "@babel/helpers - typeof"; return WebGLRenderer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, WebGLRenderer_typeof(obj); }
  93936. function WebGLRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  93937. function WebGLRenderer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  93938. function WebGLRenderer_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebGLRenderer_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebGLRenderer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  93939. function WebGLRenderer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) WebGLRenderer_setPrototypeOf(subClass, superClass); }
  93940. function WebGLRenderer_setPrototypeOf(o, p) { WebGLRenderer_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return WebGLRenderer_setPrototypeOf(o, p); }
  93941. function WebGLRenderer_createSuper(Derived) { var hasNativeReflectConstruct = WebGLRenderer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = WebGLRenderer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = WebGLRenderer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return WebGLRenderer_possibleConstructorReturn(this, result); }; }
  93942. function WebGLRenderer_possibleConstructorReturn(self, call) { if (call && (WebGLRenderer_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return WebGLRenderer_assertThisInitialized(self); }
  93943. function WebGLRenderer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  93944. function WebGLRenderer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  93945. function WebGLRenderer_getPrototypeOf(o) { WebGLRenderer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WebGLRenderer_getPrototypeOf(o); }
  93946. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  93947. * This program are made available under the terms of the Apache License, Version 2.0
  93948. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  93949. var emptyFunc = function emptyFunc() {
  93950. return false;
  93951. };
  93952. var CSS_TRANSFORM = function () {
  93953. var div = document.createElement('div');
  93954. var props = ['transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform'];
  93955. for (var i = 0; i < props.length; i++) {
  93956. var prop = props[i];
  93957. if (div.style[prop] !== undefined) {
  93958. return prop;
  93959. }
  93960. }
  93961. return props[0];
  93962. }();
  93963. /**
  93964. * @private
  93965. * @class GraphicWebGLRenderer
  93966. * @classdesc 高效率点图层 webgl 渲染器。
  93967. * @category Visualization Graphic
  93968. * @extends {ol.Object}
  93969. * @param {ol.source.Graphic} layer - 高效率点图层。
  93970. * @param {Object} options - 图层参数。
  93971. * @param {number} options.width - 地图宽度。
  93972. * @param {number} options.height - 地图高度。
  93973. * @param {HTMLElement} options.container - 放置渲染器的父元素。
  93974. * @param {Array.<number>} [options.color=[0, 0, 0, 255]] - 颜色,目前只支持 rgba 数组。
  93975. * @param {number} [options.radius=10] - 半径。
  93976. * @param {number} [options.opacity=0.8] - 不透明度。
  93977. * @param {Array} [options.highlightColor] - 高亮颜色,目前只支持 rgba 数组。
  93978. * @param {number} [options.radiusScale = 1] - 点放大倍数。
  93979. * @param {number} [options.radiusMinPixels = 0] - 半径最小值(像素)。
  93980. * @param {number} [options.radiusMaxPixels = Number.MAX_SAFE_INTEGER] - 半径最大值(像素)。
  93981. * @param {number} [options.strokeWidth = 1] - 边框大小。
  93982. * @param {boolean} [options.outline = false] - 是否显示边框。
  93983. * @param {function} [options.onClick] - 点击事件。
  93984. * @param {function} [options.onHover] - 悬停事件。
  93985. */
  93986. var GraphicWebGLRenderer = /*#__PURE__*/function (_BaseObject) {
  93987. WebGLRenderer_inherits(GraphicWebGLRenderer, _BaseObject);
  93988. var _super = WebGLRenderer_createSuper(GraphicWebGLRenderer);
  93989. function GraphicWebGLRenderer(layer, options) {
  93990. var _this;
  93991. WebGLRenderer_classCallCheck(this, GraphicWebGLRenderer);
  93992. _this = _super.call(this);
  93993. _this.layer = layer;
  93994. _this.map = layer.map;
  93995. var opt = options || {};
  93996. Util_Util.extend(WebGLRenderer_assertThisInitialized(_this), opt);
  93997. var pixelRatio = _this.pixelRatio = window ? window.devicePixelRatio : 1;
  93998. _this.width = _this.map.getSize()[0] * pixelRatio;
  93999. _this.height = _this.map.getSize()[1] * pixelRatio;
  94000. _this.center = _this.map.getView().getCenter();
  94001. _this._initContainer();
  94002. _this._registerEvents();
  94003. return _this;
  94004. }
  94005. WebGLRenderer_createClass(GraphicWebGLRenderer, [{
  94006. key: "_registerEvents",
  94007. value: function _registerEvents() {
  94008. var map = this.map;
  94009. var view = map.getView();
  94010. map.on('change:size', this._resizeEvent.bind(this), this);
  94011. view.on('change:resolution', this._moveEndEvent.bind(this), this);
  94012. view.on('change:center', this._moveEvent.bind(this), this);
  94013. view.on('change:rotation', this._moveEndEvent.bind(this), this);
  94014. map.on('moveend', this._moveEndEvent.bind(this), this);
  94015. }
  94016. }, {
  94017. key: "_resizeEvent",
  94018. value: function _resizeEvent() {
  94019. this._resize();
  94020. this._clearAndRedraw();
  94021. }
  94022. }, {
  94023. key: "_moveEvent",
  94024. value: function _moveEvent() {
  94025. var oldCenterPixel = this.map.getPixelFromCoordinate(this.center);
  94026. var newCenterPixel = this.map.getPixelFromCoordinate(this.map.getView().getCenter());
  94027. var offset = [oldCenterPixel[0] - newCenterPixel[0], oldCenterPixel[1] - newCenterPixel[1]];
  94028. this._canvas.style[CSS_TRANSFORM] = 'translate(' + Math.round(offset[0]) + 'px,' + Math.round(offset[1]) + 'px)';
  94029. }
  94030. }, {
  94031. key: "_moveEndEvent",
  94032. value: function _moveEndEvent() {
  94033. this._canvas.style[CSS_TRANSFORM] = 'translate(0,0)';
  94034. this.center = this.map.getView().getCenter();
  94035. this._clearAndRedraw();
  94036. }
  94037. }, {
  94038. key: "_clearAndRedraw",
  94039. value: function _clearAndRedraw() {
  94040. this._clearBuffer();
  94041. this.layer.changed();
  94042. }
  94043. }, {
  94044. key: "_resize",
  94045. value: function _resize() {
  94046. var size = this.map.getSize();
  94047. var width = size[0] * this.pixelRatio;
  94048. var height = size[1] * this.pixelRatio;
  94049. this._canvas.width = width;
  94050. this._canvas.height = height;
  94051. this._canvas.style.width = width + 'px';
  94052. this._canvas.style.height = height + 'px';
  94053. }
  94054. }, {
  94055. key: "_clearBuffer",
  94056. value: function _clearBuffer() {
  94057. if (!this.deckGL) {
  94058. return;
  94059. }
  94060. var lm = this.deckGL.layerManager;
  94061. lm && lm.context.gl.clear(lm.context.gl.COLOR_BUFFER_BIT);
  94062. return this;
  94063. }
  94064. /**
  94065. * @private
  94066. * @function GraphicWebGLRenderer.prototype.getCanvas
  94067. * @description 返回画布。
  94068. * @returns {HTMLCanvasElement} canvas 对象。
  94069. */
  94070. }, {
  94071. key: "getCanvas",
  94072. value: function getCanvas() {
  94073. return this._canvas;
  94074. }
  94075. /**
  94076. * @private
  94077. * @function GraphicWebGLRenderer.prototype.update
  94078. * @description 更新图层,数据或者样式改变后调用。
  94079. */
  94080. }, {
  94081. key: "update",
  94082. value: function update(graphics) {
  94083. if (graphics && graphics.length > -1) {
  94084. this._data = graphics;
  94085. }
  94086. if (!this._renderLayer) {
  94087. return;
  94088. }
  94089. this._renderLayer.setChangeFlags({
  94090. dataChanged: true,
  94091. propsChanged: true,
  94092. viewportChanged: true,
  94093. updateTriggersChanged: true
  94094. });
  94095. this._refreshData();
  94096. var state = this._getLayerState();
  94097. state.data = this._data || [];
  94098. this._renderLayer.setNeedsRedraw(true);
  94099. this._renderLayer.setState(state);
  94100. }
  94101. /**
  94102. * @private
  94103. * @function GraphicWebGLRenderer.prototype.drawGraphics
  94104. * @description 绘制点要素。
  94105. */
  94106. }, {
  94107. key: "drawGraphics",
  94108. value: function drawGraphics(graphics) {
  94109. this._data = graphics ? graphics : this._data ? this._data : [];
  94110. if (!this._renderLayer) {
  94111. this._createInnerRender();
  94112. }
  94113. this._clearBuffer();
  94114. this._draw();
  94115. }
  94116. }, {
  94117. key: "_initContainer",
  94118. value: function _initContainer() {
  94119. this._canvas = this._createCanvas(this.width, this.height);
  94120. this._layerContainer = this.container;
  94121. this._wrapper = document.createElement('div');
  94122. this._wrapper.className = "deck-wrapper";
  94123. this._wrapper.style.position = "absolute";
  94124. this._wrapper.style.top = "0";
  94125. this._wrapper.style.left = "0";
  94126. this._wrapper.appendChild(this._canvas);
  94127. this._layerContainer && this._layerContainer.appendChild(this._wrapper);
  94128. }
  94129. }, {
  94130. key: "_createCanvas",
  94131. value: function _createCanvas(width, height) {
  94132. var canvas = document.createElement('canvas');
  94133. canvas.oncontextmenu = emptyFunc;
  94134. canvas.width = width;
  94135. canvas.height = height;
  94136. canvas.style.width = width + "px";
  94137. canvas.style.height = height + "px";
  94138. return canvas;
  94139. }
  94140. }, {
  94141. key: "_createInnerRender",
  94142. value: function _createInnerRender() {
  94143. var me = this;
  94144. var state = this._getLayerState();
  94145. var color = state.color,
  94146. radius = state.radius,
  94147. opacity = state.opacity,
  94148. highlightColor = state.highlightColor,
  94149. radiusScale = state.radiusScale,
  94150. radiusMinPixels = state.radiusMinPixels,
  94151. radiusMaxPixels = state.radiusMaxPixels,
  94152. strokeWidth = state.strokeWidth,
  94153. outline = state.outline;
  94154. radius = this._pixelToMeter(radius);
  94155. var innerLayerOptions = {
  94156. id: 'scatter-plot',
  94157. data: [],
  94158. pickable: Boolean(this.onClick) || Boolean(this.onHover),
  94159. autoHighlight: true,
  94160. color: color,
  94161. opacity: opacity,
  94162. radius: radius,
  94163. radiusScale: radiusScale,
  94164. highlightColor: highlightColor,
  94165. radiusMinPixels: radiusMinPixels,
  94166. radiusMaxPixels: radiusMaxPixels,
  94167. strokeWidth: strokeWidth,
  94168. outline: outline,
  94169. getPosition: function getPosition(point) {
  94170. if (!point) {
  94171. return [0, 0, 0];
  94172. }
  94173. var geometry = point.getGeometry();
  94174. var coordinates = geometry && geometry.getCoordinates();
  94175. coordinates = me._project(coordinates);
  94176. return coordinates && [coordinates[0], coordinates[1], 0];
  94177. },
  94178. getColor: function getColor(point) {
  94179. var defaultStyle = me._getLayerDefaultStyle();
  94180. var style = point && point.getStyle();
  94181. return style && style.getColor && style.getColor() || defaultStyle.color;
  94182. },
  94183. getRadius: function getRadius(point) {
  94184. var defaultStyle = me._getLayerDefaultStyle();
  94185. var style = point && point.getStyle();
  94186. return style && style.getRadius && style.getRadius() || defaultStyle.radius;
  94187. },
  94188. updateTriggers: {
  94189. getColor: [color],
  94190. getRadius: [radius]
  94191. }
  94192. };
  94193. me._renderLayer = new window.DeckGL.ScatterplotLayer(innerLayerOptions);
  94194. }
  94195. }, {
  94196. key: "_getLayerDefaultStyle",
  94197. value: function _getLayerDefaultStyle() {
  94198. var _this$_getLayerState = this._getLayerState(),
  94199. color = _this$_getLayerState.color,
  94200. opacity = _this$_getLayerState.opacity,
  94201. radius = _this$_getLayerState.radius,
  94202. radiusScale = _this$_getLayerState.radiusScale,
  94203. radiusMinPixels = _this$_getLayerState.radiusMinPixels,
  94204. radiusMaxPixels = _this$_getLayerState.radiusMaxPixels,
  94205. strokeWidth = _this$_getLayerState.strokeWidth,
  94206. outline = _this$_getLayerState.outline;
  94207. radius = this._pixelToMeter(radius);
  94208. return {
  94209. color: color,
  94210. opacity: opacity,
  94211. radius: radius,
  94212. radiusScale: radiusScale,
  94213. radiusMinPixels: radiusMinPixels,
  94214. radiusMaxPixels: radiusMaxPixels,
  94215. strokeWidth: strokeWidth,
  94216. outline: outline
  94217. };
  94218. }
  94219. }, {
  94220. key: "_getLayerState",
  94221. value: function _getLayerState() {
  94222. var state = this.layer.getLayerState();
  94223. var view = this.map.getView();
  94224. var projection = view.getProjection().getCode();
  94225. var center = external_ol_proj_namespaceObject.transform([state.longitude, state.latitude], projection, 'EPSG:4326');
  94226. state.longitude = center[0];
  94227. state.latitude = center[1];
  94228. state.zoom = state.zoom - 1;
  94229. return state;
  94230. }
  94231. }, {
  94232. key: "_draw",
  94233. value: function _draw() {
  94234. this._refreshData();
  94235. var state = this._getLayerState();
  94236. state.data = this._data || [];
  94237. var deckOptions = {};
  94238. for (var key in state) {
  94239. deckOptions[key] = state[key];
  94240. }
  94241. this._renderLayer.setNeedsRedraw(true);
  94242. deckOptions.layers = [this._renderLayer];
  94243. deckOptions.canvas = this._canvas;
  94244. if (this.onBeforeRender) {
  94245. deckOptions.onBeforeRender = this.onBeforeRender.bind(this);
  94246. }
  94247. if (this.onAfterRender) {
  94248. deckOptions.onAfterRender = this.onAfterRender.bind(this);
  94249. }
  94250. if (!this.deckGL) {
  94251. this.deckGL = new window.DeckGL.experimental.DeckGLJS(deckOptions);
  94252. } else {
  94253. this.deckGL.setProps(deckOptions);
  94254. }
  94255. }
  94256. }, {
  94257. key: "_refreshData",
  94258. value: function _refreshData() {
  94259. var graphics = this._data || [];
  94260. var sGraphics = !core_Util_Util.isArray(graphics) ? [graphics] : [].concat(graphics);
  94261. //this.layer.props.data不能被重新赋值,只能在原数组上进行操作
  94262. if (!this._renderLayer.props.data) {
  94263. this._renderLayer.props.data = [];
  94264. }
  94265. this._renderLayer.props.data.length = 0;
  94266. for (var j = 0; j < sGraphics.length; j++) {
  94267. this._renderLayer.props.data.push(sGraphics[j]);
  94268. }
  94269. this._data = this._renderLayer.props.data;
  94270. }
  94271. }, {
  94272. key: "_project",
  94273. value: function _project(coordinates) {
  94274. var view = this.map.getView();
  94275. var projection = view.getProjection().getCode();
  94276. if ("EPSG:4326" === projection) {
  94277. return coordinates;
  94278. }
  94279. return external_ol_proj_namespaceObject.transform(coordinates, projection, 'EPSG:4326');
  94280. }
  94281. }, {
  94282. key: "_pixelToMeter",
  94283. value: function _pixelToMeter(pixel) {
  94284. var view = this.map.getView();
  94285. var projection = view.getProjection();
  94286. var unit = projection.getUnits() || 'degrees';
  94287. if (unit === 'degrees') {
  94288. unit = Unit.DEGREE;
  94289. }
  94290. if (unit === 'm') {
  94291. unit = Unit.METER;
  94292. }
  94293. var res = view.getResolution();
  94294. if (unit === Unit.DEGREE) {
  94295. var meterRes = res * (Math.PI * 6378137 / 180);
  94296. return pixel * meterRes;
  94297. } else {
  94298. return pixel * res;
  94299. }
  94300. }
  94301. }]);
  94302. return GraphicWebGLRenderer;
  94303. }((external_ol_Object_default()));
  94304. ;// CONCATENATED MODULE: ./src/openlayers/overlay/graphic/CanvasRenderer.js
  94305. function CanvasRenderer_typeof(obj) { "@babel/helpers - typeof"; return CanvasRenderer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, CanvasRenderer_typeof(obj); }
  94306. function CanvasRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  94307. function CanvasRenderer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  94308. function CanvasRenderer_createClass(Constructor, protoProps, staticProps) { if (protoProps) CanvasRenderer_defineProperties(Constructor.prototype, protoProps); if (staticProps) CanvasRenderer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  94309. function CanvasRenderer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) CanvasRenderer_setPrototypeOf(subClass, superClass); }
  94310. function CanvasRenderer_setPrototypeOf(o, p) { CanvasRenderer_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return CanvasRenderer_setPrototypeOf(o, p); }
  94311. function CanvasRenderer_createSuper(Derived) { var hasNativeReflectConstruct = CanvasRenderer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = CanvasRenderer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = CanvasRenderer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return CanvasRenderer_possibleConstructorReturn(this, result); }; }
  94312. function CanvasRenderer_possibleConstructorReturn(self, call) { if (call && (CanvasRenderer_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return CanvasRenderer_assertThisInitialized(self); }
  94313. function CanvasRenderer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  94314. function CanvasRenderer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  94315. function CanvasRenderer_getPrototypeOf(o) { CanvasRenderer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return CanvasRenderer_getPrototypeOf(o); }
  94316. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  94317. * This program are made available under the terms of the Apache License, Version 2.0
  94318. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  94319. //获取某像素坐标点pixelP相对于中心center进行缩放scaleRatio倍后的像素点坐标。
  94320. function scale(pixelP, center, scaleRatio) {
  94321. var x = (pixelP[0] - center[0]) * scaleRatio + center[0];
  94322. var y = (pixelP[1] - center[1]) * scaleRatio + center[1];
  94323. return [x, y];
  94324. }
  94325. /**
  94326. * @private
  94327. * @class GraphicCanvasRenderer
  94328. * @classdesc 高效率点图层 canvas 渲染器。
  94329. * @category Visualization Graphic
  94330. * @extends {ol.Object}
  94331. * @param {Graphic} layer - 高效率点图层。
  94332. * @param {Object} options - 图层参数。
  94333. * @param {number} options.width - 地图宽度。
  94334. * @param {number} options.height - 地图高度。
  94335. * @param {HTMLElement} options.container - 放置渲染器的父元素。
  94336. * @param {Array.<number>} [options.colo=[0, 0, 0, 255]] - 颜色,目前只支持rgba数组。默认[0, 0, 0, 255],
  94337. * @param {number} [options.radius=10] - 半径。
  94338. * @param {number} [options.opacity=0.8] - 不透明度。
  94339. * @param {Array} [options.highlightColor] - 高亮颜色,目前只支持rgba数组。
  94340. * @param {number} [options.radiusScale] - 点放大倍数。
  94341. * @param {number} [options.radiusMinPixels] - 半径最小值(像素)。
  94342. * @param {number} [options.radiusMaxPixels] - 半径最大值(像素)。
  94343. * @param {number} [options.strokeWidth] - 边框大小。
  94344. * @param {boolean} [options.outline] - 是否显示边框。
  94345. * @param {function} [options.onClick] - 点击事件。
  94346. * @param {function} [options.onHover] - 悬停事件。
  94347. */
  94348. var GraphicCanvasRenderer = /*#__PURE__*/function (_olObject) {
  94349. CanvasRenderer_inherits(GraphicCanvasRenderer, _olObject);
  94350. var _super = CanvasRenderer_createSuper(GraphicCanvasRenderer);
  94351. function GraphicCanvasRenderer(layer, options) {
  94352. var _this;
  94353. CanvasRenderer_classCallCheck(this, GraphicCanvasRenderer);
  94354. _this = _super.call(this);
  94355. _this.layer = layer;
  94356. _this.map = layer.map;
  94357. var opt = options || {};
  94358. Util_Util.extend(CanvasRenderer_assertThisInitialized(_this), opt);
  94359. _this.highLightStyle = _this.layer.highLightStyle;
  94360. _this.mapWidth = _this.size[0] / _this.pixelRatio;
  94361. _this.mapHeight = _this.size[1] / _this.pixelRatio;
  94362. _this.width = _this.map.getSize()[0];
  94363. _this.height = _this.map.getSize()[1];
  94364. _this.context = core_Util_Util.createCanvasContext2D(_this.mapWidth, _this.mapHeight);
  94365. _this.context.scale(_this.pixelRatio, _this.pixelRatio);
  94366. _this.canvas = _this.context.canvas;
  94367. _this.canvas.style.width = _this.width + 'px';
  94368. _this.canvas.style.height = _this.height + 'px';
  94369. _this._registerEvents();
  94370. return _this;
  94371. }
  94372. CanvasRenderer_createClass(GraphicCanvasRenderer, [{
  94373. key: "_registerEvents",
  94374. value: function _registerEvents() {
  94375. this.map.on('change:size', this._resizeEvent.bind(this), this);
  94376. }
  94377. }, {
  94378. key: "_resizeEvent",
  94379. value: function _resizeEvent() {
  94380. this._resize();
  94381. this._clearAndRedraw();
  94382. }
  94383. }, {
  94384. key: "_resize",
  94385. value: function _resize() {
  94386. var size = this.map.getSize();
  94387. var width = size[0];
  94388. var height = size[1];
  94389. var xRatio = width / this.width;
  94390. var yRatio = height / this.height;
  94391. this.width = width;
  94392. this.height = height;
  94393. this.mapWidth = this.mapWidth * xRatio;
  94394. this.mapHeight = this.mapHeight * yRatio;
  94395. this.canvas.width = this.mapWidth;
  94396. this.canvas.height = this.mapHeight;
  94397. this.canvas.style.width = this.width + 'px';
  94398. this.canvas.style.height = this.height + 'px';
  94399. }
  94400. }, {
  94401. key: "_clearAndRedraw",
  94402. value: function _clearAndRedraw() {
  94403. this._clearBuffer();
  94404. this.layer.changed();
  94405. }
  94406. }, {
  94407. key: "update",
  94408. value: function update() {
  94409. this.layer.changed();
  94410. }
  94411. }, {
  94412. key: "_clearBuffer",
  94413. value: function _clearBuffer() {}
  94414. /**
  94415. * @private
  94416. * @function GraphicCanvasRenderer.prototype.getCanvas
  94417. * @description 返回画布。
  94418. * @returns {HTMLCanvasElement} canvas 对象。
  94419. */
  94420. }, {
  94421. key: "getCanvas",
  94422. value: function getCanvas() {
  94423. return this.canvas;
  94424. }
  94425. /**
  94426. * @private
  94427. * @function GraphicCanvasRenderer.prototype.drawGraphics
  94428. * @description 绘制点要素。
  94429. */
  94430. }, {
  94431. key: "drawGraphics",
  94432. value: function drawGraphics(graphics) {
  94433. this.graphics_ = graphics || [];
  94434. var mapWidth = this.mapWidth;
  94435. var mapHeight = this.mapHeight;
  94436. var vectorContext = external_ol_render_namespaceObject.toContext(this.context, {
  94437. size: [mapWidth, mapHeight],
  94438. pixelRatio: this.pixelRatio
  94439. });
  94440. var defaultStyle = this.layer._getDefaultStyle();
  94441. var me = this,
  94442. layer = me.layer,
  94443. map = layer.map;
  94444. graphics.map(function (graphic) {
  94445. var style = graphic.getStyle() || defaultStyle;
  94446. if (me.selected === graphic) {
  94447. var defaultHighLightStyle = style;
  94448. if (style instanceof external_ol_style_namespaceObject.Circle) {
  94449. defaultHighLightStyle = new external_ol_style_namespaceObject.Circle({
  94450. radius: style.getRadius(),
  94451. fill: new external_ol_style_namespaceObject.Fill({
  94452. color: 'rgba(0, 153, 255, 1)'
  94453. }),
  94454. stroke: style.getStroke(),
  94455. snapToPixel: core_Util_Util.getOlVersion() === '4' ? style.getSnapToPixel() : null
  94456. });
  94457. } else if (style instanceof external_ol_style_namespaceObject.RegularShape) {
  94458. defaultHighLightStyle = new external_ol_style_namespaceObject.RegularShape({
  94459. radius: style.getRadius(),
  94460. radius2: style.getRadius2(),
  94461. points: style.getPoints(),
  94462. angle: style.getAngle(),
  94463. snapToPixel: core_Util_Util.getOlVersion() === '4' ? style.getSnapToPixel() : null,
  94464. rotation: style.getRotation(),
  94465. rotateWithView: style.getRotateWithView(),
  94466. fill: new external_ol_style_namespaceObject.Fill({
  94467. color: 'rgba(0, 153, 255, 1)'
  94468. }),
  94469. stroke: style.getStroke()
  94470. });
  94471. }
  94472. style = me.highLightStyle || defaultHighLightStyle;
  94473. }
  94474. vectorContext.setStyle(new external_ol_style_namespaceObject.Style({
  94475. image: style
  94476. }));
  94477. var geometry = graphic.getGeometry();
  94478. var coordinate = geometry.getCoordinates();
  94479. var center = map.getView().getCenter();
  94480. var mapCenterPx = map.getPixelFromCoordinate(center);
  94481. var resolution = map.getView().getResolution();
  94482. var x = (coordinate[0] - center[0]) / resolution;
  94483. var y = (center[1] - coordinate[1]) / resolution;
  94484. var scaledP = [x + mapCenterPx[0], y + mapCenterPx[1]];
  94485. scaledP = scale(scaledP, mapCenterPx, 1);
  94486. //处理放大或缩小级别*/
  94487. var result = [scaledP[0] + me.offset[0], scaledP[1] + me.offset[1]];
  94488. var pixelGeometry = new (external_ol_geom_Point_default())(result);
  94489. vectorContext.drawGeometry(pixelGeometry);
  94490. return graphic;
  94491. });
  94492. }
  94493. }]);
  94494. return GraphicCanvasRenderer;
  94495. }((external_ol_Object_default()));
  94496. ;// CONCATENATED MODULE: ./src/openlayers/overlay/graphic/Graphic.js
  94497. function Graphic_typeof(obj) { "@babel/helpers - typeof"; return Graphic_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Graphic_typeof(obj); }
  94498. function Graphic_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  94499. function Graphic_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  94500. function Graphic_createClass(Constructor, protoProps, staticProps) { if (protoProps) Graphic_defineProperties(Constructor.prototype, protoProps); if (staticProps) Graphic_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  94501. function Graphic_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Graphic_setPrototypeOf(subClass, superClass); }
  94502. function Graphic_setPrototypeOf(o, p) { Graphic_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Graphic_setPrototypeOf(o, p); }
  94503. function Graphic_createSuper(Derived) { var hasNativeReflectConstruct = Graphic_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Graphic_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Graphic_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Graphic_possibleConstructorReturn(this, result); }; }
  94504. function Graphic_possibleConstructorReturn(self, call) { if (call && (Graphic_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Graphic_assertThisInitialized(self); }
  94505. function Graphic_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  94506. function Graphic_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  94507. function Graphic_getPrototypeOf(o) { Graphic_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Graphic_getPrototypeOf(o); }
  94508. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  94509. * This program are made available under the terms of the Apache License, Version 2.0
  94510. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  94511. /**
  94512. * @class OverlayGraphic
  94513. * @browsernamespace ol
  94514. * @aliasclass Graphic
  94515. * @category Visualization Graphic
  94516. * @classdesc 高效率点图层点要素类。
  94517. * @modulecategory Overlay
  94518. * @param {ol.geom.Point} geometry - 几何对象。
  94519. * @param {Object} [attributes] - 要素属性。
  94520. * @extends {ol.Object}
  94521. * @usage
  94522. */
  94523. var Graphic_Graphic = /*#__PURE__*/function (_BaseObject) {
  94524. Graphic_inherits(Graphic, _BaseObject);
  94525. var _super = Graphic_createSuper(Graphic);
  94526. function Graphic(geometry, attributes) {
  94527. var _this;
  94528. Graphic_classCallCheck(this, Graphic);
  94529. _this = _super.call(this);
  94530. if (geometry instanceof (external_ol_geom_Geometry_default())) {
  94531. _this.geometry_ = geometry;
  94532. }
  94533. _this.attributes = attributes;
  94534. _this.setStyle();
  94535. return _this;
  94536. }
  94537. /**
  94538. * @function OverlayGraphic.prototype.clone
  94539. * @description 克隆当前要素。
  94540. * @returns {OverlayGraphic} 克隆后的要素。
  94541. */
  94542. Graphic_createClass(Graphic, [{
  94543. key: "clone",
  94544. value: function clone() {
  94545. var clone = new Graphic();
  94546. clone.setId(this.id);
  94547. clone.setGeometry(this.geometry_);
  94548. clone.setAttributes(this.attributes);
  94549. clone.setStyle(this.style_);
  94550. return clone;
  94551. }
  94552. /**
  94553. * @function OverlayGraphic.prototype.getId
  94554. * @description 获取当前 ID。
  94555. * @returns {string} ID。
  94556. */
  94557. }, {
  94558. key: "getId",
  94559. value: function getId() {
  94560. return this.id;
  94561. }
  94562. /**
  94563. * @function OverlayGraphic.prototype.setId
  94564. * @description 设置当前要素 ID。
  94565. * @param {string} id - 要素 ID。
  94566. */
  94567. }, {
  94568. key: "setId",
  94569. value: function setId(id) {
  94570. this.id = id;
  94571. }
  94572. /**
  94573. * @function OverlayGraphic.prototype.getGeometry
  94574. * @description 获取当前要素几何信息。
  94575. * @returns {ol.geom.Point} 要素几何信息。
  94576. */
  94577. }, {
  94578. key: "getGeometry",
  94579. value: function getGeometry() {
  94580. return this.geometry_;
  94581. }
  94582. /**
  94583. * @function OverlayGraphic.prototype.setGeometry
  94584. * @description 设置当前要素几何信息。
  94585. * @param {ol.geom.Point} geometry - 要素几何信息。
  94586. */
  94587. }, {
  94588. key: "setGeometry",
  94589. value: function setGeometry(geometry) {
  94590. this.geometry_ = geometry;
  94591. }
  94592. /**
  94593. * @function OverlayGraphic.prototype.setAttributes
  94594. * @description 设置要素属性。
  94595. * @param {Object} attributes - 属性对象。
  94596. */
  94597. }, {
  94598. key: "setAttributes",
  94599. value: function setAttributes(attributes) {
  94600. this.attributes = attributes;
  94601. }
  94602. /**
  94603. * @function OverlayGraphic.prototype.getAttributes
  94604. * @description 获取要素属性。
  94605. * @returns {Object} 要素属性。
  94606. */
  94607. }, {
  94608. key: "getAttributes",
  94609. value: function getAttributes() {
  94610. return this.attributes;
  94611. }
  94612. /**
  94613. * @function OverlayGraphic.prototype.getStyle
  94614. * @description 获取样式。
  94615. * @returns {ol.style.Image} ol.style.Image 子类样式对象。
  94616. */
  94617. }, {
  94618. key: "getStyle",
  94619. value: function getStyle() {
  94620. return this.style_;
  94621. }
  94622. /**
  94623. * @function OverlayGraphic.prototype.setStyle
  94624. * @description 设置样式。
  94625. * @param {ol.style.Image} style - 样式,ol/style/Image 子类样式对象。
  94626. */
  94627. }, {
  94628. key: "setStyle",
  94629. value: function setStyle(style) {
  94630. if (!this.style && !style) {
  94631. return;
  94632. }
  94633. this.style_ = style;
  94634. this.styleFunction_ = !style ? undefined : Graphic.createStyleFunction(new (external_ol_style_Style_default())({
  94635. image: style
  94636. }));
  94637. this.changed();
  94638. }
  94639. /**
  94640. * @function OverlayGraphic.prototype.getStyleFunction
  94641. * @description 获取样式函数。
  94642. * @returns {function} 样式函数。
  94643. */
  94644. }, {
  94645. key: "getStyleFunction",
  94646. value: function getStyleFunction() {
  94647. return this.styleFunction_;
  94648. }
  94649. /**
  94650. * @function OverlayGraphic.createStyleFunction
  94651. * @description 新建样式函数。
  94652. * @param {Object} obj - 对象参数。
  94653. */
  94654. }, {
  94655. key: "destroy",
  94656. value:
  94657. /**
  94658. * @function OverlayGraphic.prototype.destroy
  94659. * @description 清除参数值。
  94660. */
  94661. function destroy() {
  94662. this.id = null;
  94663. this.geometry_ = null;
  94664. this.attributes = null;
  94665. this.style_ = null;
  94666. }
  94667. }], [{
  94668. key: "createStyleFunction",
  94669. value: function createStyleFunction(obj) {
  94670. var styleFunction;
  94671. if (typeof obj === 'function') {
  94672. if (obj.length == 2) {
  94673. styleFunction = function styleFunction(resolution) {
  94674. return obj(this, resolution);
  94675. };
  94676. } else {
  94677. styleFunction = obj;
  94678. }
  94679. } else {
  94680. var styles;
  94681. if (Array.isArray(obj)) {
  94682. styles = obj;
  94683. } else {
  94684. styles = [obj];
  94685. }
  94686. styleFunction = function styleFunction() {
  94687. return styles;
  94688. };
  94689. }
  94690. return styleFunction;
  94691. }
  94692. }]);
  94693. return Graphic;
  94694. }((external_ol_Object_default()));
  94695. ;// CONCATENATED MODULE: external "ol.geom.Polygon"
  94696. var external_ol_geom_Polygon_namespaceObject = ol.geom.Polygon;
  94697. var external_ol_geom_Polygon_default = /*#__PURE__*/__webpack_require__.n(external_ol_geom_Polygon_namespaceObject);
  94698. ;// CONCATENATED MODULE: external "ol.layer.Image"
  94699. var external_ol_layer_Image_namespaceObject = ol.layer.Image;
  94700. var external_ol_layer_Image_default = /*#__PURE__*/__webpack_require__.n(external_ol_layer_Image_namespaceObject);
  94701. ;// CONCATENATED MODULE: ./src/openlayers/overlay/Graphic.js
  94702. function overlay_Graphic_typeof(obj) { "@babel/helpers - typeof"; return overlay_Graphic_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, overlay_Graphic_typeof(obj); }
  94703. function overlay_Graphic_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  94704. function overlay_Graphic_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  94705. function overlay_Graphic_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Graphic_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Graphic_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  94706. function overlay_Graphic_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) overlay_Graphic_setPrototypeOf(subClass, superClass); }
  94707. function overlay_Graphic_setPrototypeOf(o, p) { overlay_Graphic_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return overlay_Graphic_setPrototypeOf(o, p); }
  94708. function overlay_Graphic_createSuper(Derived) { var hasNativeReflectConstruct = overlay_Graphic_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = overlay_Graphic_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = overlay_Graphic_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return overlay_Graphic_possibleConstructorReturn(this, result); }; }
  94709. function overlay_Graphic_possibleConstructorReturn(self, call) { if (call && (overlay_Graphic_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return overlay_Graphic_assertThisInitialized(self); }
  94710. function overlay_Graphic_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  94711. function overlay_Graphic_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  94712. function overlay_Graphic_getPrototypeOf(o) { overlay_Graphic_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return overlay_Graphic_getPrototypeOf(o); }
  94713. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  94714. * This program are made available under the terms of the Apache License, Version 2.0
  94715. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  94716. var defaultProps = {
  94717. color: [0, 0, 0, 255],
  94718. opacity: 0.8,
  94719. radius: 10,
  94720. radiusScale: 1,
  94721. radiusMinPixels: 0,
  94722. radiusMaxPixels: Number.MAX_SAFE_INTEGER,
  94723. strokeWidth: 1,
  94724. outline: false
  94725. };
  94726. var Renderer = ['canvas', 'webgl'];
  94727. /**
  94728. * @class Graphic
  94729. * @browsernamespace ol.source
  94730. * @category Visualization Graphic
  94731. * @classdesc 高效率点图层源。
  94732. * @param {Object} options - 参数。
  94733. * @param {ol.Map} options.map - openlayers 地图对象。
  94734. * @param {OverlayGraphic} options.graphics - 高效率点图层点要素。
  94735. * @param {string} [options.render ='canvas'] - 指定使用的渲染器。可选值:"webgl","canvas"(webgl 渲染目前只支持散点)。
  94736. * @param {boolean} [options.isHighLight=true] - 事件响应是否支持要素高亮。
  94737. * @param {ol.style.Style} [options.highLightStyle=defaultHighLightStyle] - 高亮风格。
  94738. * @param {Array.<number>} [options.color=[0, 0, 0, 255]] - 要素颜色。当 {@link OverlayGraphic} 的 style 参数传入设置了 fill 的 {@link HitCloverShape} 或 {@link CloverShape},此参数无效。
  94739. * @param {Array.<number>} [options.highlightColor] - webgl 渲染时要素高亮颜色。
  94740. * @param {number} [options.opacity=0.8] - 要素透明度。当 {@link OverlayGraphic} 的 style 参数传入设置了 fillOpacity 或 strokeOpacity 的 {@link HitCloverShape} 或 {@link CloverShape},此参数无效。
  94741. * @param {number} [options.radius=10] - 要素半径,单位像素。当 {@link OverlayGraphic} 的 style 参数传入设置了 radius 的 {@link HitCloverShape} 或 {@link CloverShape},此参数无效。
  94742. * @param {number} [options.radiusScale=1] - webgl 渲染时的要素放大倍数。
  94743. * @param {number} [options.radiusMinPixels=0] - webgl 渲染时的要素半径最小值(像素)。
  94744. * @param {number} [options.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - webgl 渲染时的要素半径最大值(像素)。
  94745. * @param {number} [options.strokeWidth=1] - 边框大小。
  94746. * @param {boolean} [options.outline=false] - 是否显示边框。
  94747. * @param {function} [options.onHover] - 图层鼠标悬停响应事件(只有 webgl 渲染时有用)。
  94748. * @param {function} [options.onClick] - 图层鼠标点击响应事件(webgl、canvas 渲染时都有用)。
  94749. * @extends {ol.source.ImageCanvas}
  94750. * @usage
  94751. */
  94752. var Graphic = /*#__PURE__*/function (_ImageCanvasSource) {
  94753. overlay_Graphic_inherits(Graphic, _ImageCanvasSource);
  94754. var _super = overlay_Graphic_createSuper(Graphic);
  94755. function Graphic(options) {
  94756. var _this;
  94757. overlay_Graphic_classCallCheck(this, Graphic);
  94758. _this = _super.call(this, {
  94759. attributions: options.attributions,
  94760. canvasFunction: canvasFunctionInternal_,
  94761. logo: core_Util_Util.getOlVersion() === '4' ? options.logo : null,
  94762. projection: options.projection,
  94763. ratio: options.ratio,
  94764. resolutions: options.resolutions,
  94765. state: options.state
  94766. });
  94767. _this.graphics = [].concat(options.graphics);
  94768. _this.map = options.map;
  94769. Util_Util.extend(overlay_Graphic_assertThisInitialized(_this), options);
  94770. _this.render = options.render || Renderer[0];
  94771. if (!core_Util_Util.supportWebGL2()) {
  94772. _this.render = Renderer[0];
  94773. }
  94774. _this.highLightStyle = options.highLightStyle;
  94775. //是否支持高亮,默认支持
  94776. _this.isHighLight = typeof options.isHighLight === 'undefined' ? true : options.isHighLight;
  94777. _this.hitGraphicLayer = null;
  94778. _this._forEachFeatureAtCoordinate = _forEachFeatureAtCoordinate;
  94779. _this._options = options;
  94780. var me = overlay_Graphic_assertThisInitialized(_this);
  94781. if (options.onClick) {
  94782. me.map.on('click', function (e) {
  94783. if (me.isDeckGLRender) {
  94784. var params = me.renderer.deckGL.pickObject({
  94785. x: e.pixel[0],
  94786. y: e.pixel[1]
  94787. });
  94788. options.onClick(params);
  94789. return;
  94790. }
  94791. var graphic = me.findGraphicByPixel(e, me);
  94792. if (graphic) {
  94793. options.onClick(graphic, e);
  94794. if (me.isHighLight) {
  94795. me._highLight(graphic.getGeometry().getCoordinates(), new (external_ol_style_Style_default())({
  94796. image: graphic.getStyle()
  94797. }).getImage(), graphic, e.pixel);
  94798. }
  94799. }
  94800. });
  94801. }
  94802. me.map.on('pointermove', function (e) {
  94803. if (me.isDeckGLRender) {
  94804. var params = me.renderer.deckGL.pickObject({
  94805. x: e.pixel[0],
  94806. y: e.pixel[1]
  94807. });
  94808. if (options.onHover) {
  94809. options.onHover(params);
  94810. }
  94811. }
  94812. });
  94813. //eslint-disable-next-line no-unused-vars
  94814. function canvasFunctionInternal_(extent, resolution, pixelRatio, size, projection) {
  94815. var mapWidth = size[0] / pixelRatio;
  94816. var mapHeight = size[1] / pixelRatio;
  94817. var width = me.map.getSize()[0];
  94818. var height = me.map.getSize()[1];
  94819. if (!me.renderer) {
  94820. me.renderer = createRenderer(size, pixelRatio);
  94821. }
  94822. me.renderer.mapWidth = mapWidth;
  94823. me.renderer.mapHeight = mapHeight;
  94824. me.renderer.pixelRatio = pixelRatio;
  94825. me.renderer.offset = [(mapWidth - width) / 2, (mapHeight - height) / 2];
  94826. var graphics = this.getGraphicsInExtent(extent);
  94827. me.renderer._clearBuffer();
  94828. me.renderer.selected = this.selected;
  94829. me.renderer.drawGraphics(graphics);
  94830. me.isDeckGLRender = me.renderer instanceof GraphicWebGLRenderer;
  94831. if (me.isDeckGLRender) {
  94832. if (!me.context) {
  94833. me.context = core_Util_Util.createCanvasContext2D(mapWidth, mapHeight);
  94834. }
  94835. return me.context.canvas;
  94836. }
  94837. return me.renderer.getCanvas();
  94838. }
  94839. function createRenderer(size, pixelRatio) {
  94840. var renderer;
  94841. if (me.render === Renderer[0]) {
  94842. renderer = new GraphicCanvasRenderer(me, {
  94843. size: size,
  94844. pixelRatio: pixelRatio
  94845. });
  94846. } else {
  94847. var optDefault = Util_Util.extend({}, defaultProps);
  94848. var opt = Util_Util.extend(optDefault, {
  94849. color: me.color,
  94850. opacity: me.opacity,
  94851. radius: me.radius,
  94852. radiusScale: me.radiusScale,
  94853. radiusMinPixels: me.radiusMinPixels,
  94854. radiusMaxPixels: me.radiusMaxPixels,
  94855. strokeWidth: me.strokeWidth,
  94856. outline: me.outline,
  94857. onClick: me.onClick,
  94858. onHover: me.onHover
  94859. });
  94860. opt = Util_Util.extend(me, opt);
  94861. opt.pixelRatio = pixelRatio;
  94862. opt.container = me.map.getViewport().getElementsByClassName('ol-overlaycontainer')[0];
  94863. opt.onBeforeRender = function () {
  94864. return false;
  94865. };
  94866. opt.onAfterRender = function () {
  94867. return false;
  94868. };
  94869. renderer = new GraphicWebGLRenderer(me, opt);
  94870. }
  94871. return renderer;
  94872. }
  94873. /**
  94874. * @private
  94875. * @function Graphic.prototype._forEachFeatureAtCoordinate
  94876. * @description 获取在视图上的要素。
  94877. * @param {string} coordinate -坐标。
  94878. * @param {number} resolution -分辨率。
  94879. * @param {RequestCallback} callback -回调函数。
  94880. * @param {ol.Pixel} evtPixel - 当前选中的屏幕像素坐标。
  94881. */
  94882. function _forEachFeatureAtCoordinate(coordinate, resolution, callback, evtPixel, e) {
  94883. var graphics = me.getGraphicsInExtent();
  94884. // FIX 无法高亮元素
  94885. me._highLightClose();
  94886. for (var i = graphics.length - 1; i >= 0; i--) {
  94887. var style = graphics[i].getStyle();
  94888. if (!style) {
  94889. return;
  94890. }
  94891. //已经被高亮的graphics 不被选选中
  94892. if (style instanceof HitCloverShape) {
  94893. continue;
  94894. }
  94895. var center = graphics[i].getGeometry().getCoordinates();
  94896. var image = new (external_ol_style_Style_default())({
  94897. image: style
  94898. }).getImage();
  94899. var contain = false;
  94900. //icl-1047 当只有一个叶片的时候,判断是否选中的逻辑处理的更准确一点
  94901. if (image instanceof CloverShape && image.getCount() === 1) {
  94902. var ratation = image.getRotation() * 180 / Math.PI;
  94903. var angle = Number.parseFloat(image.getAngle());
  94904. var r = image.getRadius() * resolution;
  94905. //if(image.getAngle() )
  94906. var geo = null;
  94907. if (angle > 355) {
  94908. geo = new (external_ol_style_Circle_default())(center, r);
  94909. } else {
  94910. var coors = [];
  94911. coors.push(center);
  94912. var perAngle = angle / 8;
  94913. for (var index = 0; index < 8; index++) {
  94914. var radian = (ratation + index * perAngle) / 180 * Math.PI;
  94915. coors.push([center[0] + r * Math.cos(radian), center[1] - r * Math.sin(radian)]);
  94916. }
  94917. coors.push(center);
  94918. geo = new (external_ol_geom_Polygon_default())([coors]);
  94919. }
  94920. if (geo.intersectsCoordinate(this.map.getCoordinateFromPixel(evtPixel))) {
  94921. contain = true;
  94922. }
  94923. } else {
  94924. var extent = [];
  94925. extent[0] = center[0] - image.getAnchor()[0] * resolution;
  94926. extent[2] = center[0] + image.getAnchor()[0] * resolution;
  94927. extent[1] = center[1] - image.getAnchor()[1] * resolution;
  94928. extent[3] = center[1] + image.getAnchor()[1] * resolution;
  94929. if (external_ol_extent_namespaceObject.containsCoordinate(extent, coordinate)) {
  94930. contain = true;
  94931. }
  94932. }
  94933. if (contain === true) {
  94934. if (callback) {
  94935. callback(graphics[i], e);
  94936. }
  94937. continue;
  94938. }
  94939. // if (me.isHighLight) {
  94940. // // me._highLightClose();
  94941. // }
  94942. }
  94943. return undefined;
  94944. }
  94945. return _this;
  94946. }
  94947. overlay_Graphic_createClass(Graphic, [{
  94948. key: "findGraphicByPixel",
  94949. value: function findGraphicByPixel(e, me) {
  94950. var features = me.map.getFeaturesAtPixel(e.pixel) || [];
  94951. for (var index = 0; index < features.length; index++) {
  94952. var graphic = features[index];
  94953. if (me.graphics.indexOf(graphic) > -1) {
  94954. return graphic;
  94955. }
  94956. }
  94957. return undefined;
  94958. }
  94959. /**
  94960. * @function Graphic.prototype.setGraphics
  94961. * @description 设置绘制的点要素,会覆盖之前的所有要素。
  94962. * @param {Array.<OverlayGraphic>} graphics - 点要素对象数组。
  94963. */
  94964. }, {
  94965. key: "setGraphics",
  94966. value: function setGraphics(graphics) {
  94967. this.graphics = this.graphics || [];
  94968. this.graphics.length = 0;
  94969. var sGraphics = !core_Util_Util.isArray(graphics) ? [graphics] : [].concat(graphics);
  94970. this.graphics = [].concat(sGraphics);
  94971. this.update();
  94972. }
  94973. /**
  94974. * @function Graphic.prototype.addGraphics
  94975. * @description 追加点要素,不会覆盖之前的要素。
  94976. * @param {Array.<OverlayGraphic>} graphics - 点要素对象数组。
  94977. */
  94978. }, {
  94979. key: "addGraphics",
  94980. value: function addGraphics(graphics) {
  94981. this.graphics = this.graphics || [];
  94982. var sGraphics = !core_Util_Util.isArray(graphics) ? [graphics] : [].concat(graphics);
  94983. this.graphics = this.graphics.concat(sGraphics);
  94984. this.update();
  94985. }
  94986. /**
  94987. * @function Graphic.prototype.getGraphicBy
  94988. * @description 在 Vector 的要素数组 graphics 里面遍历每一个 graphic,当 graphic[property]===value 时,返回此 graphic(并且只返回第一个)。
  94989. * @param {string} property - graphic 的属性名称。
  94990. * @param {string} value - property 所对应的值。
  94991. * @returns {OverlayGraphic} 一个匹配的 graphic。
  94992. */
  94993. }, {
  94994. key: "getGraphicBy",
  94995. value: function getGraphicBy(property, value) {
  94996. var graphic = null;
  94997. for (var index in this.graphics) {
  94998. if (this.graphics[index][property] === value) {
  94999. graphic = this.graphics[index];
  95000. break;
  95001. }
  95002. }
  95003. return graphic;
  95004. }
  95005. /**
  95006. * @function Graphic.prototype.getGraphicById
  95007. * @description 通过给定一个 ID,返回对应的矢量要素。
  95008. * @param {string} graphicId - 矢量要素的属性 ID。
  95009. * @returns {OverlayGraphic} 一个匹配的 graphic。
  95010. */
  95011. }, {
  95012. key: "getGraphicById",
  95013. value: function getGraphicById(graphicId) {
  95014. return this.getGraphicBy('id', graphicId);
  95015. }
  95016. /**
  95017. * @function Graphic.prototype.getGraphicsByAttribute
  95018. * @description 通过给定一个属性的 key 值和 value 值,返回所有匹配的要素数组。
  95019. * @param {string} attrName - graphic 的某个属性名称。
  95020. * @param {string} attrValue - property 所对应的值。
  95021. * @returns {Array.<OverlayGraphic>} 一个匹配的 graphic 数组。
  95022. */
  95023. }, {
  95024. key: "getGraphicsByAttribute",
  95025. value: function getGraphicsByAttribute(attrName, attrValue) {
  95026. var graphic,
  95027. foundgraphics = [];
  95028. for (var index in this.graphics) {
  95029. graphic = this.graphics[index];
  95030. if (graphic && graphic.attributes) {
  95031. if (graphic.attributes[attrName] === attrValue) {
  95032. foundgraphics.push(graphic);
  95033. }
  95034. }
  95035. }
  95036. return foundgraphics;
  95037. }
  95038. /**
  95039. * @function Graphic.prototype.removeGraphics
  95040. * @description 删除要素数组,默认将删除所有要素。
  95041. * @param {Array.<OverlayGraphic>} [graphics] - 删除的 graphics 数组。
  95042. */
  95043. }, {
  95044. key: "removeGraphics",
  95045. value: function removeGraphics() {
  95046. var graphics = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  95047. //当 graphics 为 null 、为空数组,或 === this.graphics,则清除所有要素
  95048. if (!graphics || graphics.length === 0 || graphics === this.graphics) {
  95049. this.graphics.length = 0;
  95050. this.update();
  95051. return;
  95052. }
  95053. if (!Util_Util.isArray(graphics)) {
  95054. graphics = [graphics];
  95055. }
  95056. for (var i = graphics.length - 1; i >= 0; i--) {
  95057. var graphic = graphics[i];
  95058. //如果我们传入的grapchic在graphics数组中没有的话,则不进行删除,
  95059. //并将其放入未删除的数组中。
  95060. var findex = Util_Util.indexOf(this.graphics, graphic);
  95061. if (findex === -1) {
  95062. continue;
  95063. }
  95064. this.graphics.splice(findex, 1);
  95065. }
  95066. //删除完成后重新设置 setGraphics,以更新
  95067. this.update();
  95068. }
  95069. /**
  95070. * @function Graphic.prototype.clear
  95071. * @description 释放图层资源。
  95072. */
  95073. }, {
  95074. key: "clear",
  95075. value: function clear() {
  95076. this.removeGraphics();
  95077. }
  95078. /**
  95079. * @function Graphic.prototype.update
  95080. * @description 更新图层。
  95081. */
  95082. }, {
  95083. key: "update",
  95084. value: function update() {
  95085. this.renderer.update(this.graphics, this._getDefaultStyle());
  95086. }
  95087. }, {
  95088. key: "_getDefaultStyle",
  95089. value: function _getDefaultStyle() {
  95090. var target = {};
  95091. if (this.color) {
  95092. target.fill = new (external_ol_style_Fill_default())({
  95093. color: this.toRGBA(this.color)
  95094. });
  95095. }
  95096. if (this.radius) {
  95097. target.radius = this.radius;
  95098. }
  95099. if (this.outline) {
  95100. target.stroke = new (external_ol_style_Fill_default())({
  95101. color: this.toRGBA(this.color),
  95102. width: this.strokeWidth
  95103. });
  95104. }
  95105. return new (external_ol_style_Circle_default())(target);
  95106. }
  95107. }, {
  95108. key: "toRGBA",
  95109. value: function toRGBA(colorArray) {
  95110. return "rgba(".concat(colorArray[0], ",").concat(colorArray[1], ",").concat(colorArray[2], ",").concat((colorArray[3] || 255) / 255, ")");
  95111. }
  95112. /**
  95113. * @function Graphic.prototype.setStyle
  95114. * @description 设置图层要素整体样式(接口仅在 webgl 渲染时有用)。
  95115. * @param {Object} styleOptions - 样式对象。
  95116. * @param {Array.<number>} [styleOptions.color=[0, 0, 0, 255]] - 点颜色。
  95117. * @param {number} [styleOptions.radius=10] - 点半径。
  95118. * @param {number} [styleOptions.opacity=0.8] - 不透明度。
  95119. * @param {Array} [styleOptions.highlightColor] - 高亮颜色,目前只支持 rgba 数组。
  95120. * @param {number} [styleOptions.radiusScale=1] - 点放大倍数。
  95121. * @param {number} [styleOptions.radiusMinPixels=0] - 半径最小值(像素)。
  95122. * @param {number} [styleOptions.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - 半径最大值(像素)。
  95123. * @param {number} [styleOptions.strokeWidth=1] - 边框大小。
  95124. * @param {boolean} [styleOptions.outline=false] - 是否显示边框。
  95125. */
  95126. }, {
  95127. key: "setStyle",
  95128. value: function setStyle(styleOptions) {
  95129. var self = this;
  95130. var styleOpt = {
  95131. color: self.color,
  95132. radius: self.radius,
  95133. opacity: self.opacity,
  95134. highlightColor: self.highlightColor,
  95135. radiusScale: self.radiusScale,
  95136. radiusMinPixels: self.radiusMinPixels,
  95137. radiusMaxPixels: self.radiusMaxPixels,
  95138. strokeWidth: self.strokeWidth,
  95139. outline: self.outline
  95140. };
  95141. Util_Util.extend(self, Util_Util.extend(styleOpt, styleOptions));
  95142. self.update();
  95143. }
  95144. /**
  95145. * @function Graphic.prototype.getLayerState
  95146. * @description 获取当前地图及图层状态。
  95147. * @returns {Object} 地图及图层状态,包含地图状态信息和本图层相关状态。
  95148. */
  95149. }, {
  95150. key: "getLayerState",
  95151. value: function getLayerState() {
  95152. var map = this.map;
  95153. var width = map.getSize()[0];
  95154. var height = map.getSize()[1];
  95155. var view = map.getView();
  95156. var center = view.getCenter();
  95157. var longitude = center[0];
  95158. var latitude = center[1];
  95159. var zoom = view.getZoom();
  95160. var maxZoom = view.getMaxZoom();
  95161. var rotationRadians = view.getRotation();
  95162. var rotation = -rotationRadians * 180 / Math.PI;
  95163. var mapViewport = {
  95164. longitude: longitude,
  95165. latitude: latitude,
  95166. zoom: zoom,
  95167. maxZoom: maxZoom,
  95168. pitch: 0,
  95169. bearing: rotation
  95170. };
  95171. var state = {};
  95172. for (var key in mapViewport) {
  95173. state[key] = mapViewport[key];
  95174. }
  95175. state.width = width;
  95176. state.height = height;
  95177. state.color = this.color;
  95178. state.radius = this.radius;
  95179. state.opacity = this.opacity;
  95180. state.highlightColor = this.highlightColor;
  95181. state.radiusScale = this.radiusScale;
  95182. state.radiusMinPixels = this.radiusMinPixels;
  95183. state.radiusMaxPixels = this.radiusMaxPixels;
  95184. state.strokeWidth = this.strokeWidth;
  95185. state.outline = this.outline;
  95186. return state;
  95187. }
  95188. /**
  95189. * @function Graphic.prototype._highLightClose
  95190. * @description 关闭高亮要素显示。
  95191. * @private
  95192. */
  95193. }, {
  95194. key: "_highLightClose",
  95195. value: function _highLightClose() {
  95196. this.selected = null;
  95197. if (this.hitGraphicLayer) {
  95198. this.map.removeLayer(this.hitGraphicLayer);
  95199. this.hitGraphicLayer = null;
  95200. }
  95201. this.changed();
  95202. }
  95203. /**
  95204. * @function Graphic.prototype._highLight
  95205. * @description 高亮显示选中要素。
  95206. * @param {Array.<number>} center - 中心点。
  95207. * @param {ol.style.Style} image - 点样式。
  95208. * @param {OverlayGraphic} selectGraphic - 高效率点图层点要素。
  95209. * @param {ol.Pixel} evtPixel - 当前选中的屏幕像素坐标。
  95210. * @private
  95211. */
  95212. }, {
  95213. key: "_highLight",
  95214. value: function _highLight(center, image, selectGraphic, evtPixel) {
  95215. if (selectGraphic.getStyle() instanceof CloverShape) {
  95216. if (this.hitGraphicLayer) {
  95217. this.map.removeLayer(this.hitGraphicLayer);
  95218. this.hitGraphicLayer = null;
  95219. }
  95220. var pixel = this.map.getPixelFromCoordinate([center[0], center[1]]);
  95221. //点击点与中心点的角度
  95222. evtPixel = evtPixel || [0, 0];
  95223. var angle = Math.atan2(evtPixel[1] - pixel[1], evtPixel[0] - pixel[0]) / Math.PI * 180;
  95224. angle = angle > 0 ? angle : 360 + angle;
  95225. //确定扇叶
  95226. var index = Math.ceil(angle / (image.getAngle() + image.getSpaceAngle()));
  95227. //扇叶的起始角度
  95228. var sAngle = (index - 1) * (image.getAngle() + image.getSpaceAngle());
  95229. //渲染参数
  95230. var opts = {
  95231. stroke: new (external_ol_style_Stroke_default())({
  95232. color: '#ff0000',
  95233. width: 1
  95234. }),
  95235. fill: new (external_ol_style_Fill_default())({
  95236. color: '#0099ff'
  95237. }),
  95238. radius: image.getRadius(),
  95239. angle: image.getAngle(),
  95240. eAngle: sAngle + image.getAngle(),
  95241. sAngle: sAngle,
  95242. rotation: image.getRotation()
  95243. };
  95244. if (this.highLightStyle && this.highLightStyle instanceof HitCloverShape) {
  95245. opts.stroke = this.highLightStyle.getStroke();
  95246. opts.fill = this.highLightStyle.getFill();
  95247. opts.radius = this.highLightStyle.getRadius();
  95248. opts.angle = this.highLightStyle.getAngle();
  95249. }
  95250. var hitGraphic = new Graphic_Graphic(new (external_ol_geom_Point_default())(center));
  95251. hitGraphic.setStyle(new HitCloverShape(opts));
  95252. this.hitGraphicLayer = new (external_ol_layer_Image_default())({
  95253. source: new Graphic({
  95254. map: this.map,
  95255. graphics: [hitGraphic]
  95256. })
  95257. });
  95258. this.map.addLayer(this.hitGraphicLayer);
  95259. } else {
  95260. this.selected = selectGraphic;
  95261. this.changed();
  95262. }
  95263. }
  95264. /**
  95265. * @function Graphic.prototype.getGraphicsInExtent
  95266. * @description 在指定范围中获取几何要素面积。
  95267. * @param {Object} extent - 长度范围。
  95268. */
  95269. }, {
  95270. key: "getGraphicsInExtent",
  95271. value: function getGraphicsInExtent(extent) {
  95272. var graphics = [];
  95273. if (!extent) {
  95274. this.graphics.forEach(function (graphic) {
  95275. graphics.push(graphic);
  95276. });
  95277. return graphics;
  95278. }
  95279. this.graphics.forEach(function (graphic) {
  95280. if (external_ol_extent_namespaceObject.containsExtent(extent, graphic.getGeometry().getExtent())) {
  95281. graphics.push(graphic);
  95282. }
  95283. });
  95284. return graphics;
  95285. }
  95286. }]);
  95287. return Graphic;
  95288. }((external_ol_source_ImageCanvas_default()));
  95289. ;// CONCATENATED MODULE: ./src/openlayers/overlay/theme/GeoFeature.js
  95290. function GeoFeature_typeof(obj) { "@babel/helpers - typeof"; return GeoFeature_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GeoFeature_typeof(obj); }
  95291. function GeoFeature_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  95292. function GeoFeature_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  95293. function GeoFeature_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoFeature_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoFeature_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  95294. function GeoFeature_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GeoFeature_setPrototypeOf(subClass, superClass); }
  95295. function GeoFeature_setPrototypeOf(o, p) { GeoFeature_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoFeature_setPrototypeOf(o, p); }
  95296. function GeoFeature_createSuper(Derived) { var hasNativeReflectConstruct = GeoFeature_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeoFeature_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeoFeature_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeoFeature_possibleConstructorReturn(this, result); }; }
  95297. function GeoFeature_possibleConstructorReturn(self, call) { if (call && (GeoFeature_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GeoFeature_assertThisInitialized(self); }
  95298. function GeoFeature_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  95299. function GeoFeature_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  95300. function GeoFeature_getPrototypeOf(o) { GeoFeature_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoFeature_getPrototypeOf(o); }
  95301. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  95302. * This program are made available under the terms of the Apache License, Version 2.0
  95303. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  95304. /**
  95305. * @class GeoFeature
  95306. * @browsernamespace ol.source
  95307. * @category Visualization Theme
  95308. * @classdesc 地理几何专题要素型专题图层基类。
  95309. * @param {string} name - 图层名称。
  95310. * @param {Object} opt_options - 参数。
  95311. * @param {ol.Map} opt_options.map - 当前 OpenLayers Map 对象。
  95312. * @param {string} [opt_options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  95313. * @param {number} [opt_options.opacity=1] - 图层透明度。
  95314. * @param {string} [opt_options.logo] - Logo(openLayers 5.0.0 及更高版本不再支持此参数)。
  95315. * @param {ol.proj.Projection} [opt_options.projection] - 投影信息。
  95316. * @param {number} [opt_options.ratio=1.5] - 视图比,1 表示画布是地图视口的大小,2 表示地图视口的宽度和高度的两倍,依此类推。必须是 1 或更高。
  95317. * @param {Array} [opt_options.resolutions] - 分辨率数组。
  95318. * @param {ol.source.State} [opt_options.state] - 资源状态。
  95319. * @param {Object} [opt_options.style] - 专题图样式。
  95320. * @param {Object} [opt_options.styleGroups] - 各专题类型样式组。
  95321. * @param {boolean} [opt_options.isHoverAble=false] - 是否开启 hover 事件。
  95322. * @param {Object} [opt_options.highlightStyle] - 开启 hover 事件后,触发的样式风格。
  95323. * @param {(string|Object)} [opt_options.attributions='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>'] - 版权信息。
  95324. * @extends {Theme}
  95325. * @usage
  95326. */
  95327. var GeoFeature = /*#__PURE__*/function (_Theme) {
  95328. GeoFeature_inherits(GeoFeature, _Theme);
  95329. var _super = GeoFeature_createSuper(GeoFeature);
  95330. function GeoFeature(name, opt_options) {
  95331. var _this;
  95332. GeoFeature_classCallCheck(this, GeoFeature);
  95333. _this = _super.call(this, name, opt_options);
  95334. _this.cache = opt_options.cache || {};
  95335. _this.cacheFields = opt_options.cacheFields || [];
  95336. _this.style = opt_options.style || {};
  95337. _this.maxCacheCount = opt_options.maxCacheCount || 0;
  95338. _this.isCustomSetMaxCacheCount = opt_options.isCustomSetMaxCacheCount === undefined ? false : opt_options.isCustomSetMaxCacheCount;
  95339. _this.nodesClipPixel = opt_options.nodesClipPixel || 2;
  95340. _this.isHoverAble = opt_options.isHoverAble === undefined ? false : opt_options.isHoverAble;
  95341. _this.isMultiHover = opt_options.isMultiHover === undefined ? false : opt_options.isMultiHover;
  95342. _this.isClickAble = opt_options.isClickAble === undefined ? true : opt_options.isClickAble;
  95343. _this.highlightStyle = opt_options.highlightStyle || null;
  95344. _this.isAllowFeatureStyle = opt_options.isAllowFeatureStyle === undefined ? false : opt_options.isAllowFeatureStyle;
  95345. return _this;
  95346. }
  95347. /**
  95348. * @function GeoFeature.prototype.destroy
  95349. * @description 释放资源,将引用资源的属性置空。
  95350. */
  95351. GeoFeature_createClass(GeoFeature, [{
  95352. key: "destroy",
  95353. value: function destroy() {
  95354. this.maxCacheCount = null;
  95355. this.isCustomSetMaxCacheCount = null;
  95356. this.nodesClipPixel = null;
  95357. this.isHoverAble = null;
  95358. this.isMultiHover = null;
  95359. this.isClickAble = null;
  95360. this.cache = null;
  95361. this.cacheFields = null;
  95362. this.style = null;
  95363. this.highlightStyle = null;
  95364. this.isAllowFeatureStyle = null;
  95365. }
  95366. /**
  95367. * @function GeoFeature.prototype.addFeatures
  95368. * @description 添加要素。
  95369. * @param {(Array.<ThemeFeature>|Array.<GeoJSONObject>|Array.<ol.Feature>|ThemeFeature|GeoJSONObject|ol.Feature)} features - 要素对象。
  95370. */
  95371. }, {
  95372. key: "addFeatures",
  95373. value: function addFeatures(features) {
  95374. this.dispatchEvent({
  95375. type: 'beforefeaturesadded',
  95376. value: {
  95377. features: features
  95378. }
  95379. });
  95380. //转换 features 形式
  95381. this.features = this.toiClientFeature(features);
  95382. if (!this.isCustomSetMaxCacheCount) {
  95383. this.maxCacheCount = this.features.length * 5;
  95384. }
  95385. //绘制专题要素
  95386. if (this.renderer) {
  95387. this.changed();
  95388. }
  95389. }
  95390. /**
  95391. * @function GeoFeature.prototype.removeFeatures
  95392. * @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。
  95393. * @param {(Array.<FeatureVector>|FeatureVector|Function)} features - 待删除的要素对象或用于过滤的回调函数。
  95394. */
  95395. }, {
  95396. key: "removeFeatures",
  95397. value: function removeFeatures(features) {
  95398. // eslint-disable-line no-unused-vars
  95399. this.clearCache();
  95400. theme_Theme_Theme.prototype.removeFeatures.call(this, features);
  95401. }
  95402. /**
  95403. * @function GeoFeature.prototype.removeAllFeatures
  95404. * @description 清除当前图层所有的矢量要素。
  95405. */
  95406. }, {
  95407. key: "removeAllFeatures",
  95408. value: function removeAllFeatures() {
  95409. this.clearCache();
  95410. theme_Theme_Theme.prototype.removeAllFeatures.apply(this, arguments);
  95411. }
  95412. /**
  95413. * @function GeoFeature.prototype.redrawThematicFeatures
  95414. * @description 重绘所有专题要素。
  95415. * @param {Object} extent - 视图范围数据。
  95416. */
  95417. }, {
  95418. key: "redrawThematicFeatures",
  95419. value: function redrawThematicFeatures(extent) {
  95420. //获取高亮专题要素对应的用户 id
  95421. var hoverone = this.renderer.getHoverOne();
  95422. var hoverFid = null;
  95423. if (hoverone && hoverone.refDataID) {
  95424. hoverFid = hoverone.refDataID;
  95425. }
  95426. //清除当前所有可视元素
  95427. this.renderer.clearAll();
  95428. var features = this.features;
  95429. var cache = this.cache;
  95430. var cacheFields = this.cacheFields;
  95431. var cmZoom = this.map.getView().getZoom();
  95432. var maxCC = this.maxCacheCount;
  95433. for (var i = 0, len = features.length; i < len; i++) {
  95434. var feature = features[i];
  95435. if (!feature.geometry) {
  95436. continue;
  95437. }
  95438. var feaBounds = feature.geometry.getBounds();
  95439. //剔除当前视图(地理)范围以外的数据
  95440. if (extent) {
  95441. var bounds = new Bounds(extent[0], extent[1], extent[2], extent[3]);
  95442. if (!bounds.intersectsBounds(feaBounds)) {
  95443. continue;
  95444. }
  95445. }
  95446. //缓存字段
  95447. var fields = feature.id + "_zoom_" + cmZoom.toString();
  95448. var thematicFeature;
  95449. //判断专题要素缓存是否存在
  95450. if (cache[fields]) {
  95451. cache[fields].updateAndAddShapes();
  95452. } else {
  95453. //如果专题要素缓存不存在,创建专题要素
  95454. thematicFeature = this.createThematicFeature(features[i]);
  95455. //检查 thematicFeature 是否有可视化图形
  95456. if (thematicFeature.getShapesCount() < 1) {
  95457. continue;
  95458. }
  95459. //加入缓存
  95460. cache[fields] = thematicFeature;
  95461. cacheFields.push(fields);
  95462. //缓存数量限制
  95463. if (cacheFields.length > maxCC) {
  95464. var fieldsTemp = cacheFields[0];
  95465. cacheFields.splice(0, 1);
  95466. delete cache[fieldsTemp];
  95467. }
  95468. }
  95469. }
  95470. this.renderer.render();
  95471. //地图漫游后,重新高亮图形
  95472. if (hoverFid && this.isHoverAble && this.isMultiHover) {
  95473. var hShapes = this.getShapesByFeatureID(hoverFid);
  95474. this.renderer.updateHoverShapes(hShapes);
  95475. }
  95476. }
  95477. /**
  95478. * @function GeoFeature.prototype.createThematicFeature
  95479. * @description 创建专题要素。
  95480. * @param {Object} feature - 要素对象。
  95481. * @returns {Array.<FeatureVector>} 返回矢量要素。
  95482. */
  95483. }, {
  95484. key: "createThematicFeature",
  95485. value: function createThematicFeature(feature) {
  95486. var style = Util_Util.copyAttributesWithClip(this.style);
  95487. if (feature.style && this.isAllowFeatureStyle === true) {
  95488. style = Util_Util.copyAttributesWithClip(feature.style);
  95489. }
  95490. //创建专题要素时的可选参数
  95491. var options = {};
  95492. options.nodesClipPixel = this.nodesClipPixel;
  95493. options.isHoverAble = this.isHoverAble;
  95494. options.isMultiHover = this.isMultiHover;
  95495. options.isClickAble = this.isClickAble;
  95496. options.highlightStyle = ShapeFactory.transformStyle(this.highlightStyle);
  95497. //将数据转为专题要素(Vector)
  95498. var thematicFeature = new ThemeVector(feature, this, ShapeFactory.transformStyle(style), options);
  95499. //直接添加图形到渲染器
  95500. for (var m = 0; m < thematicFeature.shapes.length; m++) {
  95501. this.renderer.addShape(thematicFeature.shapes[m]);
  95502. }
  95503. return thematicFeature;
  95504. }
  95505. }, {
  95506. key: "canvasFunctionInternal_",
  95507. value: function canvasFunctionInternal_(extent, resolution, pixelRatio, size, projection) {
  95508. // eslint-disable-line no-unused-vars
  95509. return theme_Theme_Theme.prototype.canvasFunctionInternal_.apply(this, arguments);
  95510. }
  95511. /**
  95512. * @function GeoFeature.prototype.clearCache
  95513. * @description 清除缓存。
  95514. */
  95515. }, {
  95516. key: "clearCache",
  95517. value: function clearCache() {
  95518. this.cache = {};
  95519. this.cacheFields = [];
  95520. }
  95521. /**
  95522. * @function GeoFeature.prototype.clear
  95523. * @description 清除的内容包括数据(features)、专题要素、缓存。
  95524. */
  95525. }, {
  95526. key: "clear",
  95527. value: function clear() {
  95528. this.renderer.clearAll();
  95529. this.renderer.refresh();
  95530. this.removeAllFeatures();
  95531. this.clearCache();
  95532. }
  95533. /**
  95534. * @function GeoFeature.prototype.getCacheCount
  95535. * @description 获取当前缓存数量。
  95536. * @returns {number} 返回当前缓存数量。
  95537. */
  95538. }, {
  95539. key: "getCacheCount",
  95540. value: function getCacheCount() {
  95541. return this.cacheFields.length;
  95542. }
  95543. /**
  95544. * @function GeoFeature.prototype.setMaxCacheCount
  95545. * @param {number} cacheCount - 缓存总数。
  95546. * @description 设置最大缓存条数。
  95547. */
  95548. }, {
  95549. key: "setMaxCacheCount",
  95550. value: function setMaxCacheCount(cacheCount) {
  95551. if (!isNaN(cacheCount)) {
  95552. this.maxCacheCount = cacheCount;
  95553. this.isCustomSetMaxCacheCount = true;
  95554. }
  95555. }
  95556. /**
  95557. * @function GeoFeature.prototype.getShapesByFeatureID
  95558. * @param {number} featureID - 要素 ID。
  95559. * @description 通过 FeatureID 获取 feature 关联的所有图形。如果不传入此参数,函数将返回所有图形。
  95560. * @returns {Array} 返回图形数组。
  95561. */
  95562. }, {
  95563. key: "getShapesByFeatureID",
  95564. value: function getShapesByFeatureID(featureID) {
  95565. var list = [];
  95566. var shapeList = this.renderer.getAllShapes();
  95567. if (!featureID) {
  95568. return shapeList;
  95569. }
  95570. for (var i = 0, len = shapeList.length; i < len; i++) {
  95571. var si = shapeList[i];
  95572. if (si.refDataID && featureID === si.refDataID) {
  95573. list.push(si);
  95574. }
  95575. }
  95576. return list;
  95577. }
  95578. }]);
  95579. return GeoFeature;
  95580. }(theme_Theme_Theme);
  95581. ;// CONCATENATED MODULE: ./src/openlayers/overlay/Label.js
  95582. function overlay_Label_typeof(obj) { "@babel/helpers - typeof"; return overlay_Label_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, overlay_Label_typeof(obj); }
  95583. function overlay_Label_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  95584. function overlay_Label_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  95585. function overlay_Label_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Label_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Label_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  95586. function overlay_Label_get() { if (typeof Reflect !== "undefined" && Reflect.get) { overlay_Label_get = Reflect.get.bind(); } else { overlay_Label_get = function _get(target, property, receiver) { var base = overlay_Label_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return overlay_Label_get.apply(this, arguments); }
  95587. function overlay_Label_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Label_getPrototypeOf(object); if (object === null) break; } return object; }
  95588. function overlay_Label_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) overlay_Label_setPrototypeOf(subClass, superClass); }
  95589. function overlay_Label_setPrototypeOf(o, p) { overlay_Label_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return overlay_Label_setPrototypeOf(o, p); }
  95590. function overlay_Label_createSuper(Derived) { var hasNativeReflectConstruct = overlay_Label_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = overlay_Label_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = overlay_Label_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return overlay_Label_possibleConstructorReturn(this, result); }; }
  95591. function overlay_Label_possibleConstructorReturn(self, call) { if (call && (overlay_Label_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return overlay_Label_assertThisInitialized(self); }
  95592. function overlay_Label_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  95593. function overlay_Label_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  95594. function overlay_Label_getPrototypeOf(o) { overlay_Label_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return overlay_Label_getPrototypeOf(o); }
  95595. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  95596. * This program are made available under the terms of the Apache License, Version 2.0
  95597. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  95598. /**
  95599. * @class Label
  95600. * @browsernamespace ol.source
  95601. * @category Visualization Theme
  95602. * @classdesc 标签专题图图层源。
  95603. * @modulecategory Overlay
  95604. * @param {string} name - 名称。
  95605. * @param {Object} opt_options - 参数。
  95606. * @param {ol.Map} opt_options.map - 当前 Map 对象。
  95607. * @param {string} [opt_options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  95608. * @param {number} [opt_options.opacity=1] - 图层透明度。
  95609. * @param {string|Object} [opt_options.attributions] - 版权信息。
  95610. * @param {string} [opt_options.logo] - Logo(openLayers 5.0.0 及更高版本不再支持此参数)。
  95611. * @param {ol.proj.Projection} [opt_options.projection] - 投影信息。
  95612. * @param {number} [opt_options.ratio=1.5] - 视图比,1 表示画布是地图视口的大小,2 表示地图视口的宽度和高度的两倍,依此类推。必须是1或更高。
  95613. * @param {Array.<number>} [opt_options.resolutions] - 分辨率数组。
  95614. * @param {ol.source.State} [opt_options.state] - 资源状态。
  95615. * @param {string} [opt_options.themeField] - 指定创建专题图字段。
  95616. * @param {Object} [opt_options.style] - 专题图样式。
  95617. * @param {Object} [opt_options.styleGroups] - 各专题类型样式组。
  95618. * @param {boolean} [opt_options.isHoverAble = false] - 是否开启 hover 事件。
  95619. * @param {Object} [opt_options.highlightStyle] - 开启 hover 事件后,触发的样式风格。
  95620. * @extends {GeoFeature}
  95621. * @usage
  95622. */
  95623. var Label_Label = /*#__PURE__*/function (_GeoFeature) {
  95624. overlay_Label_inherits(Label, _GeoFeature);
  95625. var _super = overlay_Label_createSuper(Label);
  95626. function Label(name, opt_options) {
  95627. var _this;
  95628. overlay_Label_classCallCheck(this, Label);
  95629. _this = _super.call(this, name, opt_options);
  95630. _this.isOverLay = opt_options.isOverLay != null ? opt_options.isOverLay : true;
  95631. _this.isAvoid = opt_options.isAvoid != null ? opt_options.isAvoid : true;
  95632. _this.style = opt_options.style;
  95633. _this.themeField = opt_options.themeField;
  95634. _this.styleGroups = opt_options.styleGroups;
  95635. _this.defaultStyle = {
  95636. //默认文本样式
  95637. fontColor: "#000000",
  95638. fontOpacity: 1,
  95639. fontSize: "12px",
  95640. fontStyle: "normal",
  95641. fontWeight: "normal",
  95642. labelAlign: "cm",
  95643. labelXOffset: 0,
  95644. labelYOffset: 0,
  95645. labelRotation: 0,
  95646. //默认背景框样式
  95647. fill: false,
  95648. fillColor: "#ee9900",
  95649. fillOpacity: 0.4,
  95650. stroke: false,
  95651. strokeColor: "#ee9900",
  95652. strokeOpacity: 1,
  95653. strokeWidth: 1,
  95654. strokeLinecap: "round",
  95655. strokeDashstyle: "solid",
  95656. //对用户隐藏但必须保持此值的属性
  95657. //cursor: "pointer",
  95658. labelSelect: true,
  95659. //用 _isGeoTextStrategyStyle 标记此style,携带此类style的要素特指GeoText策略中的标签要素
  95660. _isGeoTextStrategyStyle: true
  95661. };
  95662. //获取标签像素 bounds 的方式。0 - 表示通过文本类容和文本风格计算获取像素范围,现在支持中文、英文; 1 - 表示通过绘制的文本标签获取像素范围,支持各个语种的文字范围获取,但性能消耗较大(尤其是采用SVG渲染)。默认值为0。
  95663. _this.getPxBoundsMode = 0;
  95664. _this.labelFeatures = [];
  95665. return _this;
  95666. }
  95667. /**
  95668. * @function Label.prototype.destroy
  95669. * @description 释放资源,将引用资源的属性置空。
  95670. */
  95671. overlay_Label_createClass(Label, [{
  95672. key: "destroy",
  95673. value: function destroy() {
  95674. this.style = null;
  95675. this.themeField = null;
  95676. this.styleGroups = null;
  95677. overlay_Label_get(overlay_Label_getPrototypeOf(Label.prototype), "destroy", this).call(this);
  95678. }
  95679. /**
  95680. * @private
  95681. * @function Label.prototype.createThematicFeature
  95682. * @description 创建专题要素。
  95683. * @param {FeatureVector} feature - 矢量要素。
  95684. * @returns {FeatureThemeVector} 专题图矢量要素。
  95685. */
  95686. }, {
  95687. key: "createThematicFeature",
  95688. value: function createThematicFeature(feature) {
  95689. //赋 style
  95690. var style = this.getStyleByData(feature);
  95691. //创建专题要素时的可选参数
  95692. var options = {};
  95693. options.nodesClipPixel = this.nodesClipPixel;
  95694. options.isHoverAble = this.isHoverAble;
  95695. options.isMultiHover = this.isMultiHover;
  95696. options.isClickAble = this.isClickAble;
  95697. options.highlightStyle = ShapeFactory.transformStyle(this.highlightStyle);
  95698. //将数据转为专题要素(Vector)
  95699. var thematicFeature = new ThemeVector(feature, this, ShapeFactory.transformStyle(style), options);
  95700. //直接添加图形到渲染器
  95701. for (var m = 0; m < thematicFeature.shapes.length; m++) {
  95702. this.renderer.addShape(thematicFeature.shapes[m]);
  95703. }
  95704. return thematicFeature;
  95705. }
  95706. /**
  95707. * @function Label.prototype.redrawThematicFeatures
  95708. * @description 重绘所有专题要素。
  95709. * 此方法包含绘制专题要素的所有步骤,包含用户数据到专题要素的转换,抽稀,缓存等步骤。
  95710. * 地图漫游时调用此方法进行图层刷新。
  95711. * @param {Array.<number>} bounds - 重绘范围。
  95712. */
  95713. }, {
  95714. key: "redrawThematicFeatures",
  95715. value: function redrawThematicFeatures(bounds) {
  95716. if (this.features.length > 0 && this.labelFeatures.length === 0) {
  95717. var feats = this.setLabelsStyle(this.features);
  95718. for (var i = 0, len = feats.length; i < len; i++) {
  95719. this.labelFeatures.push(feats[i]);
  95720. }
  95721. }
  95722. this.features = this.getDrawnLabels(this.labelFeatures);
  95723. overlay_Label_get(overlay_Label_getPrototypeOf(Label.prototype), "redrawThematicFeatures", this).call(this, bounds);
  95724. }
  95725. /**
  95726. * @function Label.prototype.removeFeatures
  95727. * @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。
  95728. * @param {(Array.<FeatureVector>|FeatureVector|Function)} features - 待删除的要素对象或用于过滤的回调函数。
  95729. */
  95730. }, {
  95731. key: "removeFeatures",
  95732. value: function removeFeatures(features) {
  95733. // eslint-disable-line no-unused-vars
  95734. this.labelFeatures = [];
  95735. overlay_Label_get(overlay_Label_getPrototypeOf(Label.prototype), "removeFeatures", this).call(this, features);
  95736. }
  95737. /**
  95738. * @function Label.prototype.removeAllFeatures
  95739. * @description 清除当前图层所有的矢量要素。
  95740. */
  95741. }, {
  95742. key: "removeAllFeatures",
  95743. value: function removeAllFeatures() {
  95744. this.labelFeatures = [];
  95745. overlay_Label_get(overlay_Label_getPrototypeOf(Label.prototype), "removeAllFeatures", this).call(this, arguments);
  95746. }
  95747. /**
  95748. * @function Label.prototype.getDrawnLabels
  95749. * @description 获取经(压盖)处理后将要绘制在图层上的标签要素。
  95750. * @param {Array.<FeatureVector>} labelFeatures - 所有标签要素的数组。
  95751. * @returns {Array.<FeatureVector>} 最终要绘制的标签要素数组。
  95752. */
  95753. }, {
  95754. key: "getDrawnLabels",
  95755. value: function getDrawnLabels(labelFeatures) {
  95756. var feas = [],
  95757. //最终要绘制的标签要素集
  95758. fea,
  95759. //最终要绘制的标签要素
  95760. fi,
  95761. //临时标签要素,用户的第i个标签
  95762. labelsB = [],
  95763. //不产生压盖的标签要素范围集
  95764. styTmp,
  95765. //用于临时存储要素style的变量
  95766. feaSty,
  95767. //标签要素最终的style
  95768. // styleTemp用于屏蔽文本style中带有偏移性质style属性,偏移已经在计算bounds的过程中参与了运算,
  95769. // 所以在最终按照bounds来绘制标签时,需屏蔽style中带有偏移性质属性,否则文本的偏移量将扩大一倍。
  95770. styleTemp = {
  95771. labelAlign: "cm",
  95772. labelXOffset: 0,
  95773. labelYOffset: 0
  95774. };
  95775. var map = this.map;
  95776. var mapSize = map.getSize();
  95777. mapSize = {
  95778. x: mapSize[0],
  95779. y: mapSize[1]
  95780. };
  95781. var zoom = map.getView().getZoom();
  95782. //对用户的每个标签要素进行处理与判断
  95783. for (var i = 0, len = labelFeatures.length; i < len; i++) {
  95784. fi = labelFeatures[i];
  95785. //检查fi的style在避让中是否被改变,如果改变,重新设置要素的style
  95786. if (fi.isStyleChange) {
  95787. fi = this.setStyle(fi);
  95788. }
  95789. //标签最终的中心点像素位置 (偏移后)
  95790. var loc = this.getLabelPxLocation(fi);
  95791. //过滤掉地图范围外的标签 (偏移后)
  95792. if (loc.x >= 0 && loc.x <= mapSize.x && loc.y >= 0 && loc.y <= mapSize.y) {
  95793. //根据当前地图缩放级别过滤标签
  95794. if (fi.style.minZoomLevel > -1) {
  95795. if (zoom <= fi.style.minZoomLevel) {
  95796. continue;
  95797. }
  95798. }
  95799. if (fi.style.maxZoomLevel > -1) {
  95800. if (zoom > fi.style.maxZoomLevel) {
  95801. continue;
  95802. }
  95803. }
  95804. //计算标签bounds
  95805. var boundsQuad = null;
  95806. if (fi.isStyleChange) {
  95807. fi.isStyleChange = null;
  95808. boundsQuad = this.calculateLabelBounds(fi, loc);
  95809. } else {
  95810. if (fi.geometry.bsInfo.w && fi.geometry.bsInfo.h) {
  95811. //使用calculateLabelBounds2可以提高bounds的计算效率,尤其是在getPxBoundsMode = 1时
  95812. boundsQuad = this.calculateLabelBounds2(fi, loc);
  95813. } else {
  95814. boundsQuad = this.calculateLabelBounds(fi, loc);
  95815. }
  95816. }
  95817. //避让处理 -start
  95818. var mapViewBounds = new Bounds(0, mapSize.y, mapSize.x, 0),
  95819. //地图像素范围
  95820. quadlen = boundsQuad.length;
  95821. if (this.isAvoid) {
  95822. var avoidInfo = this.getAvoidInfo(mapViewBounds, boundsQuad); //避让信息
  95823. if (avoidInfo) {
  95824. //横向(x方向)上的避让
  95825. if (avoidInfo.aspectW === "left") {
  95826. fi.style.labelXOffset += avoidInfo.offsetX;
  95827. for (var j = 0; j < quadlen; j++) {
  95828. boundsQuad[j].x += avoidInfo.offsetX;
  95829. }
  95830. } else if (avoidInfo.aspectW === "right") {
  95831. fi.style.labelXOffset += -avoidInfo.offsetX;
  95832. for (var _j2 = 0; _j2 < quadlen; _j2++) {
  95833. boundsQuad[_j2].x += -avoidInfo.offsetX;
  95834. }
  95835. }
  95836. //纵向(y方向)上的避让
  95837. if (avoidInfo.aspectH === "top") {
  95838. fi.style.labelYOffset += avoidInfo.offsetY;
  95839. for (var _j4 = 0; _j4 < quadlen; _j4++) {
  95840. boundsQuad[_j4].y += avoidInfo.offsetY;
  95841. }
  95842. } else if (avoidInfo.aspectH === "bottom") {
  95843. fi.style.labelYOffset += -avoidInfo.offsetY;
  95844. for (var _j6 = 0; _j6 < quadlen; _j6++) {
  95845. boundsQuad[_j6].y += -avoidInfo.offsetY;
  95846. }
  95847. }
  95848. //如果style发生变化,记录下来
  95849. fi.isStyleChange = true;
  95850. }
  95851. }
  95852. //避让处理 -end
  95853. //压盖处理 -start
  95854. if (this.isOverLay) {
  95855. //是否压盖
  95856. var isOL = false;
  95857. if (i != 0) {
  95858. for (var _j8 = 0; _j8 < labelsB.length; _j8++) {
  95859. //压盖判断
  95860. if (this.isQuadrilateralOverLap(boundsQuad, labelsB[_j8])) {
  95861. isOL = true;
  95862. break;
  95863. }
  95864. }
  95865. }
  95866. if (isOL) {
  95867. continue;
  95868. } else {
  95869. labelsB.push(boundsQuad);
  95870. }
  95871. }
  95872. //压盖处理 -end
  95873. //将标签像素范围转为地理范围
  95874. var geoBs = [];
  95875. for (var _j10 = 0; _j10 < quadlen - 1; _j10++) {
  95876. geoBs.push(map.getCoordinateFromPixel([boundsQuad[_j10].x, boundsQuad[_j10].y]));
  95877. }
  95878. //屏蔽有偏移性质的style属性,偏移量在算bounds时已经加入计算
  95879. var bounds = new Bounds(geoBs[3][0], geoBs[3][1], geoBs[1][0], [geoBs[1][1]]);
  95880. var center = bounds.getCenterLonLat();
  95881. var label = new GeoText(center.lon, center.lat, fi.attributes[this.themeField]);
  95882. label.calculateBounds();
  95883. styTmp = Util_Util.cloneObject(fi.style);
  95884. feaSty = Util_Util.cloneObject(Util_Util.copyAttributes(styTmp, styleTemp));
  95885. fea = new Vector(label, fi.attributes, feaSty);
  95886. //赋予id
  95887. fea.id = fi.id;
  95888. fea.fid = fi.fid;
  95889. feas.push(fea);
  95890. }
  95891. }
  95892. //返回最终要绘制的标签要素
  95893. return feas;
  95894. }
  95895. /**
  95896. * @function Label.prototype.getStyleByData
  95897. * @description 根据用户数据(feature)设置专题要素的 Style。
  95898. * @param {FeatureVector} feat - 矢量要素对象。
  95899. * @returns {Array.<ThemeStyle>} 专题要素的 Style。
  95900. */
  95901. }, {
  95902. key: "getStyleByData",
  95903. value: function getStyleByData(feat) {
  95904. var feature = feat;
  95905. feature.style = Util_Util.copyAttributes(feature.style, this.defaultStyle);
  95906. //将style赋给标签
  95907. if (this.style && this.style.fontSize && parseFloat(this.style.fontSize) < 12) {
  95908. this.style.fontSize = "12px";
  95909. }
  95910. feature.style = Util_Util.copyAttributes(feature.style, this.style);
  95911. if (this.themeField && this.styleGroups && feature.attributes) {
  95912. var Sf = this.themeField;
  95913. var attributes = feature.attributes;
  95914. var groups = this.styleGroups;
  95915. var isSfInAttrs = false; //指定的 groupField 是否是geotext的属性字段之一
  95916. var attr = null; //属性值
  95917. for (var property in attributes) {
  95918. if (Sf === property) {
  95919. isSfInAttrs = true;
  95920. attr = attributes[property];
  95921. break;
  95922. }
  95923. }
  95924. //判断属性值是否属于styleGroups的某一个范围,以便对标签分组
  95925. if (isSfInAttrs) {
  95926. for (var i = 0, len = groups.length; i < len; i++) {
  95927. if (attr >= groups[i].start && attr < groups[i].end) {
  95928. var sty1 = groups[i].style;
  95929. if (sty1 && sty1.fontSize && parseFloat(sty1.fontSize) < 12) {
  95930. sty1.fontSize = "12px";
  95931. }
  95932. feature.style = Util_Util.copyAttributes(feature.style, sty1);
  95933. }
  95934. }
  95935. }
  95936. feature.style.label = feature.attributes[this.themeField];
  95937. }
  95938. return feature.style;
  95939. }
  95940. /**
  95941. * @function Label.prototype.setLabelsStyle
  95942. * @description 设置标签要素的 Style。
  95943. * @param {Array.<FeatureVector>} labelFeatures - 需要设置 Style 的标签要素数组。
  95944. * @returns {Array.<FeatureVector>} 赋予 Style 后的标签要素数组。
  95945. */
  95946. }, {
  95947. key: "setLabelsStyle",
  95948. value: function setLabelsStyle(labelFeatures) {
  95949. var fea,
  95950. labelFeas = [];
  95951. for (var i = 0, len = labelFeatures.length; i < len; i++) {
  95952. var feature = labelFeatures[i];
  95953. if (feature.geometry.CLASS_NAME === "SuperMap.Geometry.GeoText") {
  95954. //设置标签的Style
  95955. if (feature.geometry.bsInfo.w || feature.geometry.bsInfo.h) {
  95956. feature.geometry.bsInfo.w = null;
  95957. feature.geometry.bsInfo.h = null;
  95958. feature.geometry.labelWTmp = null;
  95959. }
  95960. fea = this.setStyle(feature);
  95961. //为标签要素指定图层
  95962. fea.layer = this.layer;
  95963. labelFeas.push(fea);
  95964. } else {
  95965. return labelFeatures;
  95966. }
  95967. }
  95968. return labelFeas;
  95969. }
  95970. /**
  95971. * @function Label.prototype.setStyle
  95972. * @description 设置标签要素的 Style。
  95973. * @param {FeatureVector} feat - 需要赋予 style 的要素。
  95974. */
  95975. }, {
  95976. key: "setStyle",
  95977. value: function setStyle(feat) {
  95978. var feature = feat;
  95979. feature.style = Util_Util.copyAttributes(feature.style, this.defaultStyle);
  95980. //将style赋给标签
  95981. if (this.style && this.style.fontSize && parseFloat(this.style.fontSize) < 12) {
  95982. this.style.fontSize = "12px";
  95983. }
  95984. feature.style = Util_Util.copyAttributes(feature.style, this.style);
  95985. if (this.groupField && this.styleGroups && feature.attributes) {
  95986. var Sf = this.groupField;
  95987. var attributes = feature.attributes;
  95988. var groups = this.styleGroups;
  95989. var isSfInAttrs = false; //指定的 groupField 是否是geotext的属性字段之一
  95990. var attr = null; //属性值
  95991. for (var property in attributes) {
  95992. if (Sf === property) {
  95993. isSfInAttrs = true;
  95994. attr = attributes[property];
  95995. break;
  95996. }
  95997. }
  95998. //判断属性值是否属于styleGroups的某一个范围,以便对标签分组
  95999. if (isSfInAttrs) {
  96000. for (var i = 0, len = groups.length; i < len; i++) {
  96001. if (attr >= groups[i].start && attr < groups[i].end) {
  96002. var sty1 = groups[i].style;
  96003. if (sty1 && sty1.fontSize && parseFloat(sty1.fontSize) < 12) {
  96004. sty1.fontSize = "12px";
  96005. }
  96006. feature.style = Util_Util.copyAttributes(feature.style, sty1);
  96007. }
  96008. }
  96009. }
  96010. }
  96011. //将文本内容赋到标签要素的style上
  96012. feature.style.label = feature.geometry.text;
  96013. return feature;
  96014. }
  96015. /**
  96016. * @function Label.prototype.getLabelPxLocation
  96017. * @description 获取标签要素的像素坐标。
  96018. * @param {FeatureVector} feature - 标签要素。
  96019. * @returns {Object} 标签位置,例如:{"x":1,"y":1}。
  96020. */
  96021. }, {
  96022. key: "getLabelPxLocation",
  96023. value: function getLabelPxLocation(feature) {
  96024. var geoText = feature.geometry;
  96025. var styleTmp = feature.style;
  96026. //将标签的地理位置转为像素位置
  96027. var locationTmp = geoText.getCentroid();
  96028. var locTmp = this.map.getPixelFromCoordinate([locationTmp.x, locationTmp.y]);
  96029. var loc = new (external_ol_geom_Point_default())([locTmp[0], locTmp[1]]);
  96030. //偏移处理
  96031. if (styleTmp.labelXOffset || styleTmp.labelYOffset) {
  96032. var xOffset = isNaN(styleTmp.labelXOffset) ? 0 : styleTmp.labelXOffset;
  96033. var yOffset = isNaN(styleTmp.labelYOffset) ? 0 : styleTmp.labelYOffset;
  96034. loc.translate(xOffset, -yOffset);
  96035. }
  96036. return {
  96037. x: loc.getCoordinates()[0],
  96038. y: loc.getCoordinates()[1]
  96039. };
  96040. }
  96041. /**
  96042. * @function Label.prototype.calculateLabelBounds
  96043. * @description 获得标签要素的最终范围。
  96044. * @param {FeatureVector} feature - 需要计算bounds的标签要素数。
  96045. * @param {Object} loc - 标签位置,例如:{"x":1,"y":1}。
  96046. * @returns {Array.<Object>} 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  96047. */
  96048. }, {
  96049. key: "calculateLabelBounds",
  96050. value: function calculateLabelBounds(feature, loc) {
  96051. var geoText = feature.geometry;
  96052. //标签范围(未旋转前)
  96053. var labB = null;
  96054. var labelInfo = null;
  96055. //获取bounds的方式
  96056. if (this.getPxBoundsMode == 0) {
  96057. labB = geoText.getLabelPxBoundsByText(loc, feature.style);
  96058. } else if (this.getPxBoundsMode === 1) {
  96059. //canvas
  96060. labelInfo = this.getLabelInfo(feature.geometry.getCentroid(), feature.style);
  96061. labB = geoText.getLabelPxBoundsByLabel(loc, labelInfo.w, labelInfo.h, feature.style);
  96062. } else {
  96063. return null;
  96064. }
  96065. //旋转Bounds
  96066. var boundsQuad = [];
  96067. if (feature.style.labelRotation % 180 == 0) {
  96068. boundsQuad = [{
  96069. "x": labB.left,
  96070. "y": labB.top
  96071. }, {
  96072. "x": labB.right,
  96073. "y": labB.top
  96074. }, {
  96075. "x": labB.right,
  96076. "y": labB.bottom
  96077. }, {
  96078. "x": labB.left,
  96079. "y": labB.bottom
  96080. }, {
  96081. "x": labB.left,
  96082. "y": labB.top
  96083. }];
  96084. } else {
  96085. boundsQuad = this.rotationBounds(labB, loc, feature.style.labelRotation);
  96086. }
  96087. //重置GeoText的bounds
  96088. geoText.bounds = new Bounds(boundsQuad[1].x, boundsQuad[3].y, boundsQuad[2].x, boundsQuad[4].y);
  96089. return boundsQuad;
  96090. }
  96091. /**
  96092. * @function Label.prototype.calculateLabelBounds2
  96093. * @description 获得标签要素的最终范围的另一种算法(通过记录下的标签宽高),提高计算 bounds 的效率。
  96094. * @param {FeatureVector} feature - 需要计算 bounds 的标签要素数。
  96095. * @param {Object} loc - 标签位置,例如:{"x":1,"y":1}。
  96096. * @returns {Array.<Object>} 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  96097. */
  96098. }, {
  96099. key: "calculateLabelBounds2",
  96100. value: function calculateLabelBounds2(feature, loc) {
  96101. var labB, left, bottom, top, right;
  96102. var labelSize = feature.geometry.bsInfo;
  96103. var style = feature.style;
  96104. var locationPx = Util_Util.cloneObject(loc);
  96105. //处理文字对齐
  96106. if (style.labelAlign && style.labelAlign !== "cm") {
  96107. switch (style.labelAlign) {
  96108. case "lt":
  96109. locationPx.x += labelSize.w / 2;
  96110. locationPx.y += labelSize.h / 2;
  96111. break;
  96112. case "lm":
  96113. locationPx.x += labelSize.w / 2;
  96114. break;
  96115. case "lb":
  96116. locationPx.x += labelSize.w / 2;
  96117. locationPx.y -= labelSize.h / 2;
  96118. break;
  96119. case "ct":
  96120. locationPx.y += labelSize.h / 2;
  96121. break;
  96122. case "cb":
  96123. locationPx.y -= labelSize.h / 2;
  96124. break;
  96125. case "rt":
  96126. locationPx.x -= labelSize.w / 2;
  96127. locationPx.y += labelSize.h / 2;
  96128. break;
  96129. case "rm":
  96130. locationPx.x -= labelSize.w / 2;
  96131. break;
  96132. case "rb":
  96133. locationPx.x -= labelSize.w / 2;
  96134. locationPx.y -= labelSize.h / 2;
  96135. break;
  96136. default:
  96137. break;
  96138. }
  96139. }
  96140. left = locationPx.x - labelSize.w / 2;
  96141. bottom = locationPx.y + labelSize.h / 2;
  96142. //处理斜体字
  96143. if (style.fontStyle && style.fontStyle === "italic") {
  96144. right = locationPx.x + labelSize.w / 2 + parseInt(parseFloat(style.fontSize) / 2);
  96145. } else {
  96146. right = locationPx.x + labelSize.w / 2;
  96147. }
  96148. top = locationPx.y - labelSize.h / 2;
  96149. labB = new Bounds(left, bottom, right, top);
  96150. //旋转Bounds
  96151. var boundsQuad = [];
  96152. if (style.labelRotation % 180 == 0) {
  96153. boundsQuad = [{
  96154. "x": labB.left,
  96155. "y": labB.top
  96156. }, {
  96157. "x": labB.right,
  96158. "y": labB.top
  96159. }, {
  96160. "x": labB.right,
  96161. "y": labB.bottom
  96162. }, {
  96163. "x": labB.left,
  96164. "y": labB.bottom
  96165. }, {
  96166. "x": labB.left,
  96167. "y": labB.top
  96168. }];
  96169. } else {
  96170. boundsQuad = this.rotationBounds(labB, loc, style.labelRotation);
  96171. }
  96172. //重置GeoText的bounds
  96173. feature.geometry.bounds = new Bounds(boundsQuad[1].x, boundsQuad[3].y, boundsQuad[2].x, boundsQuad[4].y);
  96174. return boundsQuad;
  96175. }
  96176. /**
  96177. * @function Label.prototype.getLabelInfo
  96178. * @description 根据当前位置获取绘制后的标签信息,包括标签的宽,高和行数等。
  96179. * @returns {Object} 绘制后的标签信息。
  96180. */
  96181. }, {
  96182. key: "getLabelInfo",
  96183. value: function getLabelInfo(location, style) {
  96184. var LABEL_ALIGN = {
  96185. "l": "left",
  96186. "r": "right",
  96187. "t": "top",
  96188. "b": "bottom"
  96189. },
  96190. LABEL_FACTOR = {
  96191. "l": 0,
  96192. "r": -1,
  96193. "t": 0,
  96194. "b": -1
  96195. };
  96196. style = Util_Util.extend({
  96197. fontColor: "#000000",
  96198. labelAlign: "cm"
  96199. }, style);
  96200. var pt = this.getLocalXY(location);
  96201. var labelWidth = 0;
  96202. if (style.labelXOffset || style.labelYOffset) {
  96203. var xOffset = isNaN(style.labelXOffset) ? 0 : style.labelXOffset;
  96204. var yOffset = isNaN(style.labelYOffset) ? 0 : style.labelYOffset;
  96205. pt[0] += xOffset;
  96206. pt[1] -= yOffset;
  96207. }
  96208. var canvas = document.createElement('canvas');
  96209. canvas.globalAlpha = 0;
  96210. canvas.lineWidth = 1;
  96211. var ctx = canvas.getContext("2d");
  96212. ctx.fillStyle = style.fontColor;
  96213. ctx.globalAlpha = style.fontOpacity || 1.0;
  96214. var fontStyle = [style.fontStyle ? style.fontStyle : "normal", "normal", style.fontWeight ? style.fontWeight : "normal", style.fontSize ? style.fontSize : "1em", style.fontFamily ? style.fontFamily : "sans-serif"].join(" ");
  96215. var labelRows = style.label.split('\n');
  96216. var numRows = labelRows.length;
  96217. var vfactor, lineHeight, labelWidthTmp;
  96218. if (ctx.fillText) {
  96219. // HTML5
  96220. ctx.font = fontStyle;
  96221. ctx.textAlign = LABEL_ALIGN[style.labelAlign[0]] || "center";
  96222. ctx.textBaseline = LABEL_ALIGN[style.labelAlign[1]] || "middle";
  96223. vfactor = LABEL_FACTOR[style.labelAlign[1]];
  96224. if (vfactor == null) {
  96225. vfactor = -.5;
  96226. }
  96227. lineHeight = ctx.measureText('Mg').height || ctx.measureText('xx').width;
  96228. pt[1] += lineHeight * vfactor * (numRows - 1);
  96229. for (var i = 0; i < numRows; i++) {
  96230. labelWidthTmp = ctx.measureText(labelRows[i]).width;
  96231. if (labelWidth < labelWidthTmp) {
  96232. labelWidth = labelWidthTmp;
  96233. }
  96234. }
  96235. } else if (ctx.mozDrawText) {
  96236. // Mozilla pre-Gecko1.9.1 (<FF3.1)
  96237. ctx.mozTextStyle = fontStyle;
  96238. vfactor = LABEL_FACTOR[style.labelAlign[1]];
  96239. if (vfactor == null) {
  96240. vfactor = -.5;
  96241. }
  96242. lineHeight = ctx.mozMeasureText('xx');
  96243. pt[1] += lineHeight * (1 + vfactor * numRows);
  96244. for (var _i2 = 0; _i2 < numRows; _i2++) {
  96245. labelWidthTmp = ctx.measureText(labelRows[_i2]).width;
  96246. if (labelWidth < labelWidthTmp) {
  96247. labelWidth = labelWidthTmp;
  96248. }
  96249. }
  96250. }
  96251. var labelInfo = {}; //标签信息
  96252. if (labelWidth) {
  96253. labelInfo.w = labelWidth; //标签的宽
  96254. } else {
  96255. return null;
  96256. }
  96257. labelInfo.h = style.fontSize; //一行标签的高
  96258. labelInfo.rows = labelRows.length; //标签的行数
  96259. return labelInfo;
  96260. }
  96261. /**
  96262. * @function Label.prototype.rotationBounds
  96263. * @description 旋转 bounds。
  96264. * @param {Bounds} bounds - 要旋转的 bounds。
  96265. * @param {Object} rotationCenterPoi - 旋转中心点对象,此对象含有属性 x(横坐标),属性 y(纵坐标)。
  96266. * @param {number} angle - 旋转角度(顺时针)。
  96267. * @returns {Array.<Object>} bounds 旋转后形成的多边形节点数组。是一个四边形,形如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  96268. */
  96269. }, {
  96270. key: "rotationBounds",
  96271. value: function rotationBounds(bounds, rotationCenterPoi, angle) {
  96272. var ltPoi = new (external_ol_geom_Point_default())([bounds.left, bounds.top]);
  96273. var rtPoi = new (external_ol_geom_Point_default())([bounds.right, bounds.top]);
  96274. var rbPoi = new (external_ol_geom_Point_default())([bounds.right, bounds.bottom]);
  96275. var lbPoi = new (external_ol_geom_Point_default())([bounds.left, bounds.bottom]);
  96276. var ver = [];
  96277. ver.push(this.getRotatedLocation(ltPoi.getCoordinates()[0], ltPoi.getCoordinates()[1], rotationCenterPoi.x, rotationCenterPoi.y, angle));
  96278. ver.push(this.getRotatedLocation(rtPoi.getCoordinates()[0], rtPoi.getCoordinates()[1], rotationCenterPoi.x, rotationCenterPoi.y, angle));
  96279. ver.push(this.getRotatedLocation(rbPoi.getCoordinates()[0], rbPoi.getCoordinates()[1], rotationCenterPoi.x, rotationCenterPoi.y, angle));
  96280. ver.push(this.getRotatedLocation(lbPoi.getCoordinates()[0], lbPoi.getCoordinates()[1], rotationCenterPoi.x, rotationCenterPoi.y, angle));
  96281. //bounds旋转后形成的多边形节点数组
  96282. var quad = [];
  96283. for (var i = 0; i < ver.length; i++) {
  96284. quad.push({
  96285. "x": ver[i].x,
  96286. "y": ver[i].y
  96287. });
  96288. }
  96289. quad.push({
  96290. "x": ver[0].x,
  96291. "y": ver[0].y
  96292. });
  96293. return quad;
  96294. }
  96295. /**
  96296. * @function Label.prototype.getRotatedLocation
  96297. * @description 获取一个点绕旋转中心顺时针旋转后的位置。(此方法用于屏幕坐标)。
  96298. * @param {number} x - 旋转点横坐标。
  96299. * @param {number} y - 旋转点纵坐标。
  96300. * @param {number} rx - 旋转中心点横坐标。
  96301. * @param {number} ry - 旋转中心点纵坐标。
  96302. * @param {number} angle - 旋转角度
  96303. * @returns {Object} 旋转后的坐标位置对象,该对象含有属性 x(横坐标),属性 y(纵坐标)。
  96304. */
  96305. }, {
  96306. key: "getRotatedLocation",
  96307. value: function getRotatedLocation(x, y, rx, ry, angle) {
  96308. var loc = {},
  96309. x0,
  96310. y0;
  96311. y = -y;
  96312. ry = -ry;
  96313. angle = -angle; //顺时针旋转
  96314. x0 = (x - rx) * Math.cos(angle / 180 * Math.PI) - (y - ry) * Math.sin(angle / 180 * Math.PI) + rx;
  96315. y0 = (x - rx) * Math.sin(angle / 180 * Math.PI) + (y - ry) * Math.cos(angle / 180 * Math.PI) + ry;
  96316. loc.x = x0;
  96317. loc.y = -y0;
  96318. return loc;
  96319. }
  96320. /**
  96321. * @function Label.prototype.getAvoidInfo
  96322. * @description 获取避让的信息。
  96323. * @param {Bounds} bounds - 地图像素范围。
  96324. * @param {Array.<Object>} quadrilateral - 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  96325. * @returns {Object} 避让的信息。
  96326. */
  96327. }, {
  96328. key: "getAvoidInfo",
  96329. value: function getAvoidInfo(bounds, quadrilateral) {
  96330. if (quadrilateral.length !== 5) {
  96331. return null;
  96332. } //不是四边形
  96333. //将bound序列化为点数组形式
  96334. var bounddQuad = [{
  96335. "x": bounds.left,
  96336. "y": bounds.top
  96337. }, {
  96338. "x": bounds.right,
  96339. "y": bounds.top
  96340. }, {
  96341. "x": bounds.right,
  96342. "y": bounds.bottom
  96343. }, {
  96344. "x": bounds.left,
  96345. "y": bounds.bottom
  96346. }, {
  96347. "x": bounds.left,
  96348. "y": bounds.top
  96349. }];
  96350. var isIntersection = false,
  96351. bqLen = bounddQuad.length,
  96352. quadLen = quadrilateral.length;
  96353. var offsetX = 0,
  96354. offsetY = 0,
  96355. aspectH = "",
  96356. aspectW = "";
  96357. for (var i = 0; i < bqLen - 1; i++) {
  96358. for (var j = 0; j < quadLen - 1; j++) {
  96359. var isLineIn = Util_Util.lineIntersection(bounddQuad[i], bounddQuad[i + 1], quadrilateral[j], quadrilateral[j + 1]);
  96360. if (isLineIn.CLASS_NAME === "SuperMap.Geometry.Point") {
  96361. //设置避让信息
  96362. setInfo(quadrilateral[j]);
  96363. setInfo(quadrilateral[j + 1]);
  96364. isIntersection = true;
  96365. }
  96366. }
  96367. }
  96368. if (isIntersection) {
  96369. //组织避让操作所需的信息
  96370. return {
  96371. "aspectW": aspectW,
  96372. "aspectH": aspectH,
  96373. "offsetX": offsetX,
  96374. "offsetY": offsetY
  96375. };
  96376. } else {
  96377. return null;
  96378. }
  96379. //内部函数:设置避让信息
  96380. //参数:vec-{Object} quadrilateral四边形单个节点。如:{"x":1,"y":1}。
  96381. function setInfo(vec) {
  96382. //四边形不在bounds内的节点
  96383. if (!bounds.contains(vec.x, vec.y)) {
  96384. //bounds的Top边
  96385. if (vec.y < bounds.top) {
  96386. var oY = Math.abs(bounds.top - vec.y);
  96387. if (oY > offsetY) {
  96388. offsetY = oY;
  96389. aspectH = "top";
  96390. }
  96391. }
  96392. //bounds的Bottom边
  96393. if (vec.y > bounds.bottom) {
  96394. var _oY = Math.abs(vec.y - bounds.bottom);
  96395. if (_oY > offsetY) {
  96396. offsetY = _oY;
  96397. aspectH = "bottom";
  96398. }
  96399. }
  96400. //bounds的left边
  96401. if (vec.x < bounds.left) {
  96402. var oX = Math.abs(bounds.left - vec.x);
  96403. if (oX > offsetX) {
  96404. offsetX = oX;
  96405. aspectW = "left";
  96406. }
  96407. }
  96408. //bounds的right边
  96409. if (vec.x > bounds.right) {
  96410. var _oX = Math.abs(vec.x - bounds.right);
  96411. if (_oX > offsetX) {
  96412. offsetX = _oX;
  96413. aspectW = "right";
  96414. }
  96415. }
  96416. }
  96417. }
  96418. }
  96419. /**
  96420. * @function Label.prototype.isQuadrilateralOverLap
  96421. * @description 判断两个四边形是否有压盖。
  96422. * @param {Array.<Object>} quadrilateral - 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  96423. * @param {Array.<Object>} quadrilateral2 - 第二个四边形节点数组。
  96424. * @returns {boolean} 是否压盖,true 表示压盖。
  96425. */
  96426. }, {
  96427. key: "isQuadrilateralOverLap",
  96428. value: function isQuadrilateralOverLap(quadrilateral, quadrilateral2) {
  96429. var quadLen = quadrilateral.length,
  96430. quad2Len = quadrilateral2.length;
  96431. if (quadLen !== 5 || quad2Len !== 5) {
  96432. return null;
  96433. } //不是四边形
  96434. var OverLap = false;
  96435. //如果两四边形互不包含对方的节点,则两个四边形不相交
  96436. for (var i = 0; i < quadLen; i++) {
  96437. if (this.isPointInPoly(quadrilateral[i], quadrilateral2)) {
  96438. OverLap = true;
  96439. break;
  96440. }
  96441. }
  96442. for (var _i4 = 0; _i4 < quad2Len; _i4++) {
  96443. if (this.isPointInPoly(quadrilateral2[_i4], quadrilateral)) {
  96444. OverLap = true;
  96445. break;
  96446. }
  96447. }
  96448. //加上两矩形十字相交的情况
  96449. for (var _i6 = 0; _i6 < quadLen - 1; _i6++) {
  96450. if (OverLap) {
  96451. break;
  96452. }
  96453. for (var j = 0; j < quad2Len - 1; j++) {
  96454. var isLineIn = Util_Util.lineIntersection(quadrilateral[_i6], quadrilateral[_i6 + 1], quadrilateral2[j], quadrilateral2[j + 1]);
  96455. if (isLineIn.CLASS_NAME === "SuperMap.Geometry.Point") {
  96456. OverLap = true;
  96457. break;
  96458. }
  96459. }
  96460. }
  96461. return OverLap;
  96462. }
  96463. /**
  96464. * @function Label.prototype.isPointInPoly
  96465. * @description 判断一个点是否在多边形里面(射线法)。
  96466. * @param {Object} pt - 需要判定的点对象,该对象含有属性 x(横坐标),属性 y(纵坐标)。
  96467. * @param {Array.<Object>} poly - 多边形节点数组。例如一个四边形:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  96468. * @returns {boolean} 点是否在多边形内。
  96469. */
  96470. }, {
  96471. key: "isPointInPoly",
  96472. value: function isPointInPoly(pt, poly) {
  96473. for (var isIn = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i) {
  96474. (poly[i].y <= pt.y && pt.y < poly[j].y || poly[j].y <= pt.y && pt.y < poly[i].y) && pt.x < (poly[j].x - poly[i].x) * (pt.y - poly[i].y) / (poly[j].y - poly[i].y) + poly[i].x && (isIn = !isIn);
  96475. }
  96476. return isIn;
  96477. }
  96478. }, {
  96479. key: "canvasFunctionInternal_",
  96480. value: function canvasFunctionInternal_(extent, resolution, pixelRatio, size, projection) {
  96481. // eslint-disable-line no-unused-vars
  96482. return overlay_Label_get(overlay_Label_getPrototypeOf(Label.prototype), "canvasFunctionInternal_", this).apply(this, arguments);
  96483. }
  96484. }]);
  96485. return Label;
  96486. }(GeoFeature);
  96487. ;// CONCATENATED MODULE: ./src/openlayers/overlay/mapv/MapvCanvasLayer.js
  96488. function MapvCanvasLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  96489. function MapvCanvasLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  96490. function MapvCanvasLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) MapvCanvasLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) MapvCanvasLayer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  96491. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  96492. * This program are made available under the terms of the Apache License, Version 2.0
  96493. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  96494. /**
  96495. * @class MapvCanvasLayer
  96496. * @classdesc Mapv 渲染器。
  96497. * @private
  96498. * @param {Object} options - 参数。
  96499. * @param {number} options.width - 画布宽。
  96500. * @param {number} options.height - 画布高。
  96501. * @param {string} [options.paneName='mapPane'] - 窗口名。
  96502. * @param {string} [options.context='2d'] - 内容。
  96503. * @param {number} [options.zIndex=2] - 层级。
  96504. * @param {string} [options.mixBlendMode] - 最小混合模式。
  96505. */
  96506. var MapvCanvasLayer = /*#__PURE__*/function () {
  96507. function MapvCanvasLayer(options) {
  96508. MapvCanvasLayer_classCallCheck(this, MapvCanvasLayer);
  96509. this.options = options || {};
  96510. this.enableMassClear = this.options.enableMassClear;
  96511. this._map = options.map;
  96512. this.paneName = this.options.paneName || 'mapPane';
  96513. this.context = this.options.context || '2d';
  96514. this.zIndex = this.options.zIndex || 2;
  96515. this.mixBlendMode = this.options.mixBlendMode || null;
  96516. this.width = options.width;
  96517. this.height = options.height;
  96518. this.initialize();
  96519. }
  96520. MapvCanvasLayer_createClass(MapvCanvasLayer, [{
  96521. key: "initialize",
  96522. value: function initialize() {
  96523. var canvas = this.canvas = document.createElement("canvas");
  96524. canvas.style.cssText = "position:absolute;" + "left:0;" + "top:0;" + "z-index:" + this.zIndex + ";user-select:none;";
  96525. canvas.style.mixBlendMode = this.mixBlendMode;
  96526. canvas.className = "mapvClass";
  96527. var global$2 = typeof window === 'undefined' ? {} : window;
  96528. var devicePixelRatio = this.devicePixelRatio = global$2.devicePixelRatio || 1;
  96529. canvas.width = parseInt(this.width) * devicePixelRatio;
  96530. canvas.height = parseInt(this.height) * devicePixelRatio;
  96531. if (this.context === '2d') {
  96532. canvas.getContext(this.context).scale(devicePixelRatio, devicePixelRatio);
  96533. }
  96534. canvas.style.width = this.width + "px";
  96535. canvas.style.height = this.height + "px";
  96536. if (this.context === 'webgl') {
  96537. this.canvas.getContext(this.context).viewport(0, 0, canvas.width, canvas.height);
  96538. }
  96539. }
  96540. /**
  96541. * @function MapvCanvasLayer.prototype.draw
  96542. * @description 生成地图。
  96543. */
  96544. }, {
  96545. key: "draw",
  96546. value: function draw() {
  96547. this.options.update && this.options.update.call(this);
  96548. }
  96549. /**
  96550. * @function MapvCanvasLayer.prototype.resize
  96551. * @param {number} mapWidth - 地图宽度。
  96552. * @param {number} mapHeight - 地图高度。
  96553. * @description 调整地图大小。
  96554. */
  96555. }, {
  96556. key: "resize",
  96557. value: function resize(mapWidth, mapHeight) {
  96558. var global$2 = typeof window === 'undefined' ? {} : window;
  96559. var devicePixelRatio = this.devicePixelRatio = global$2.devicePixelRatio || 1;
  96560. this.canvas.width = mapWidth * devicePixelRatio;
  96561. this.canvas.height = mapHeight * devicePixelRatio;
  96562. if (this.context === '2d') {
  96563. this.canvas.getContext('2d').scale(devicePixelRatio, devicePixelRatio);
  96564. }
  96565. this.canvas.style.width = mapWidth + "px";
  96566. this.canvas.style.height = mapHeight + "px";
  96567. if (this.context === 'webgl') {
  96568. this.canvas.getContext(this.context).viewport(0, 0, this.canvas.width, this.canvas.height);
  96569. }
  96570. }
  96571. /**
  96572. * @function MapvCanvasLayer.prototype.getContainer
  96573. * @description 获取容器。
  96574. * @returns {HTMLElement} 包含 Mapv 图层的 DOM 对象。
  96575. */
  96576. }, {
  96577. key: "getContainer",
  96578. value: function getContainer() {
  96579. return this.canvas;
  96580. }
  96581. /**
  96582. * @function MapvCanvasLayer.prototype.setZIndex
  96583. * @param {number} zIndex - 层级参数。
  96584. * @description 设置图层层级。
  96585. */
  96586. }, {
  96587. key: "setZIndex",
  96588. value: function setZIndex(zIndex) {
  96589. this.canvas.style.zIndex = zIndex;
  96590. }
  96591. /**
  96592. * @function MapvCanvasLayer.prototype.getZIndex
  96593. * @description 获取图层层级。
  96594. */
  96595. }, {
  96596. key: "getZIndex",
  96597. value: function getZIndex() {
  96598. return this.zIndex;
  96599. }
  96600. }]);
  96601. return MapvCanvasLayer;
  96602. }();
  96603. ;// CONCATENATED MODULE: external "function(){try{return mapv}catch(e){return {}}}()"
  96604. var external_function_try_return_mapv_catch_e_return_namespaceObject = function(){try{return mapv}catch(e){return {}}}();
  96605. ;// CONCATENATED MODULE: external "ol.interaction.Pointer"
  96606. var external_ol_interaction_Pointer_namespaceObject = ol.interaction.Pointer;
  96607. var external_ol_interaction_Pointer_default = /*#__PURE__*/__webpack_require__.n(external_ol_interaction_Pointer_namespaceObject);
  96608. ;// CONCATENATED MODULE: ./src/openlayers/overlay/mapv/MapvLayer.js
  96609. function MapvLayer_typeof(obj) { "@babel/helpers - typeof"; return MapvLayer_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, MapvLayer_typeof(obj); }
  96610. function MapvLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  96611. function MapvLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  96612. function MapvLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) MapvLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) MapvLayer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  96613. function MapvLayer_get() { if (typeof Reflect !== "undefined" && Reflect.get) { MapvLayer_get = Reflect.get.bind(); } else { MapvLayer_get = function _get(target, property, receiver) { var base = MapvLayer_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return MapvLayer_get.apply(this, arguments); }
  96614. function MapvLayer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MapvLayer_getPrototypeOf(object); if (object === null) break; } return object; }
  96615. function MapvLayer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) MapvLayer_setPrototypeOf(subClass, superClass); }
  96616. function MapvLayer_setPrototypeOf(o, p) { MapvLayer_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MapvLayer_setPrototypeOf(o, p); }
  96617. function MapvLayer_createSuper(Derived) { var hasNativeReflectConstruct = MapvLayer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MapvLayer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MapvLayer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MapvLayer_possibleConstructorReturn(this, result); }; }
  96618. function MapvLayer_possibleConstructorReturn(self, call) { if (call && (MapvLayer_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return MapvLayer_assertThisInitialized(self); }
  96619. function MapvLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  96620. function MapvLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  96621. function MapvLayer_getPrototypeOf(o) { MapvLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MapvLayer_getPrototypeOf(o); }
  96622. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  96623. * This program are made available under the terms of the Apache License, Version 2.0
  96624. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  96625. var BaiduMapLayer = external_function_try_return_mapv_catch_e_return_namespaceObject.baiduMapLayer ? external_function_try_return_mapv_catch_e_return_namespaceObject.baiduMapLayer.__proto__ : Function;
  96626. /**
  96627. * @class MapvLayer
  96628. * @classdesc MapV 图层类。
  96629. * @private
  96630. * @param {Object} map - 地图。
  96631. * @param {Mapv.DataSet} [dataSet] - 数据集。
  96632. * @param {Object} options - 参数。
  96633. * @param {number} mapWidth - 地图宽度。
  96634. * @param {number} mapHeight - 地图高度。
  96635. * @param {Object} source - 资源。
  96636. * @param {number} options.width - 画布宽。
  96637. * @param {number} options.height - 画布高。
  96638. * @param {string} [options.paneName='mapPane'] - 窗口名。
  96639. * @param {string} [options.context] - 内容。
  96640. * @param {number} [options.zIndex] - 层级。
  96641. * @param {string} [options.mixBlendMode] - 最小混合模式。
  96642. * @extends {Mapv.BaiduMapLayer}
  96643. */
  96644. var MapvLayer = /*#__PURE__*/function (_BaiduMapLayer) {
  96645. MapvLayer_inherits(MapvLayer, _BaiduMapLayer);
  96646. var _super = MapvLayer_createSuper(MapvLayer);
  96647. function MapvLayer(map, dataSet, options, mapWidth, mapHeight, source) {
  96648. var _this;
  96649. MapvLayer_classCallCheck(this, MapvLayer);
  96650. _this = _super.call(this, map, dataSet, options);
  96651. _this.dataSet = dataSet;
  96652. _this.mapWidth = mapWidth;
  96653. _this.mapHeight = mapHeight;
  96654. var self = MapvLayer_assertThisInitialized(_this);
  96655. options = options || {};
  96656. _this.source = source;
  96657. self.animator = null;
  96658. self.map = map;
  96659. self.init(options);
  96660. self.argCheck(options);
  96661. _this.canvasLayer = new MapvCanvasLayer({
  96662. map: map,
  96663. context: _this.context,
  96664. paneName: options.paneName,
  96665. mixBlendMode: options.mixBlendMode,
  96666. enableMassClear: options.enableMassClear,
  96667. zIndex: options.zIndex,
  96668. width: mapWidth,
  96669. height: mapHeight,
  96670. update: function update() {
  96671. self._canvasUpdate();
  96672. }
  96673. });
  96674. _this.clickEvent = _this.clickEvent.bind(MapvLayer_assertThisInitialized(_this));
  96675. _this.mousemoveEvent = _this.mousemoveEvent.bind(MapvLayer_assertThisInitialized(_this));
  96676. map.on('movestart', _this.moveStartEvent.bind(MapvLayer_assertThisInitialized(_this)));
  96677. map.on('moveend', _this.moveEndEvent.bind(MapvLayer_assertThisInitialized(_this)));
  96678. map.getView().on('change:center', _this.zoomEvent.bind(MapvLayer_assertThisInitialized(_this)));
  96679. map.getView().on('change:size', _this.sizeEvent.bind(MapvLayer_assertThisInitialized(_this)));
  96680. map.on('pointerdrag', _this.dragEvent.bind(MapvLayer_assertThisInitialized(_this)));
  96681. _this.bindEvent();
  96682. return _this;
  96683. }
  96684. /**
  96685. * @function MapvLayer.prototype.init
  96686. * @param {Object} options - 参数。
  96687. * @description 初始化参数。
  96688. */
  96689. MapvLayer_createClass(MapvLayer, [{
  96690. key: "init",
  96691. value: function init(options) {
  96692. var self = this;
  96693. self.options = options;
  96694. this.initDataRange(options);
  96695. this.context = self.options.context || '2d';
  96696. if (self.options.zIndex) {
  96697. this.canvasLayer && this.canvasLayer.setZIndex(self.options.zIndex);
  96698. }
  96699. this.initAnimator();
  96700. }
  96701. /**
  96702. * @function MapvLayer.prototype.clickEvent
  96703. * @param {Object} e - 事件参数。
  96704. * @description 点击事件。
  96705. */
  96706. }, {
  96707. key: "clickEvent",
  96708. value: function clickEvent(e) {
  96709. var pixel = e.pixel;
  96710. MapvLayer_get(MapvLayer_getPrototypeOf(MapvLayer.prototype), "clickEvent", this).call(this, {
  96711. x: pixel[0] + this.offset[0],
  96712. y: pixel[1] + this.offset[1]
  96713. }, e);
  96714. }
  96715. /**
  96716. * @function MapvLayer.prototype.mousemoveEvent
  96717. * @param {Object} e - 事件参数。
  96718. * @description 鼠标移动事件。
  96719. */
  96720. }, {
  96721. key: "mousemoveEvent",
  96722. value: function mousemoveEvent(e) {
  96723. var pixel = e.pixel;
  96724. MapvLayer_get(MapvLayer_getPrototypeOf(MapvLayer.prototype), "mousemoveEvent", this).call(this, {
  96725. x: pixel[0],
  96726. y: pixel[1]
  96727. }, e);
  96728. }
  96729. /**
  96730. * @function MapvLayer.prototype.dragEvent
  96731. * @description 鼠标拖动事件。
  96732. */
  96733. }, {
  96734. key: "dragEvent",
  96735. value: function dragEvent() {
  96736. this.clear(this.getContext());
  96737. }
  96738. /**
  96739. * @function MapvLayer.prototype.zoomEvent
  96740. * @description 缩放事件。
  96741. */
  96742. }, {
  96743. key: "zoomEvent",
  96744. value: function zoomEvent() {
  96745. this.clear(this.getContext());
  96746. }
  96747. /**
  96748. * @function MapvLayer.prototype.sizeEvent
  96749. * @description 地图窗口大小发生变化时触发。
  96750. */
  96751. }, {
  96752. key: "sizeEvent",
  96753. value: function sizeEvent() {
  96754. this.canvasLayer.resize();
  96755. }
  96756. /**
  96757. * @function MapvLayer.prototype.moveStartEvent
  96758. * @description 开始移动事件。
  96759. */
  96760. }, {
  96761. key: "moveStartEvent",
  96762. value: function moveStartEvent() {
  96763. var animationOptions = this.options.animation;
  96764. if (this.isEnabledTime() && this.animator) {
  96765. this.steps.step = animationOptions.stepsRange.start;
  96766. }
  96767. }
  96768. /**
  96769. * @function MapvLayer.prototype.moveEndEvent
  96770. * @description 结束移动事件。
  96771. */
  96772. }, {
  96773. key: "moveEndEvent",
  96774. value: function moveEndEvent() {
  96775. this.canvasLayer.draw();
  96776. }
  96777. /**
  96778. * @function MapvLayer.prototype.bindEvent
  96779. * @description 绑定事件。
  96780. */
  96781. }, {
  96782. key: "bindEvent",
  96783. value: function bindEvent() {
  96784. var me = this;
  96785. var map = me.map;
  96786. if (me.options.methods) {
  96787. if (me.options.methods.click) {
  96788. map.on('click', me.clickEvent);
  96789. }
  96790. if (me.options.methods.mousemove) {
  96791. me.pointerInteraction = new (external_ol_interaction_Pointer_default())();
  96792. me.pointerInteraction.handleMoveEvent_ = function (event) {
  96793. me.mousemoveEvent(event);
  96794. };
  96795. map.addInteraction(me.pointerInteraction);
  96796. }
  96797. }
  96798. }
  96799. /**
  96800. * @function MapvLayer.prototype.unbindEvent
  96801. * @description 解除绑定事件。
  96802. */
  96803. }, {
  96804. key: "unbindEvent",
  96805. value: function unbindEvent() {
  96806. var map = this.map;
  96807. if (this.options.methods) {
  96808. if (this.options.methods.click) {
  96809. map.un('click', this.clickEvent);
  96810. }
  96811. if (this.options.methods.mousemove) {
  96812. map.removeInteraction(this.pointerInteraction);
  96813. }
  96814. }
  96815. }
  96816. /**
  96817. * @function MapvLayer.prototype.addData
  96818. * @description 添加数据。
  96819. * @param {Object} data - 待添加的数据。
  96820. * @param {Object} options - 待添加的数据信息。
  96821. */
  96822. }, {
  96823. key: "addData",
  96824. value: function addData(data, options) {
  96825. var _data = data;
  96826. if (data && data.get) {
  96827. _data = data.get();
  96828. }
  96829. this.dataSet.add(_data);
  96830. this.update({
  96831. options: options
  96832. });
  96833. }
  96834. /**
  96835. * @function MapvLayer.prototype.update
  96836. * @description 更新图层。
  96837. * @param {Object} opt - 待更新的数据。
  96838. * @param {Object} opt.data - mapv 数据集。
  96839. */
  96840. }, {
  96841. key: "update",
  96842. value: function update(opt) {
  96843. var update = opt || {};
  96844. var _data = update.data;
  96845. if (_data && _data.get) {
  96846. _data = _data.get();
  96847. }
  96848. if (_data != undefined) {
  96849. this.dataSet.set(_data);
  96850. }
  96851. MapvLayer_get(MapvLayer_getPrototypeOf(MapvLayer.prototype), "update", this).call(this, {
  96852. options: update.options
  96853. });
  96854. }
  96855. }, {
  96856. key: "draw",
  96857. value: function draw() {
  96858. this.canvasLayer.draw();
  96859. }
  96860. /**
  96861. * @function MapvLayer.prototype.getData
  96862. * @description 获取数据。
  96863. */
  96864. }, {
  96865. key: "getData",
  96866. value: function getData() {
  96867. return this.dataSet;
  96868. }
  96869. /**
  96870. * @function MapvLayer.prototype.removeData
  96871. * @description 删除符合过滤条件的数据。
  96872. * @param {function} filter - 过滤条件。条件参数为数据项,返回值为 true,表示删除该元素;否则表示不删除。
  96873. */
  96874. }, {
  96875. key: "removeData",
  96876. value: function removeData(_filter) {
  96877. if (!this.dataSet) {
  96878. return;
  96879. }
  96880. var newData = this.dataSet.get({
  96881. filter: function filter(data) {
  96882. return _filter != null && typeof _filter === "function" ? !_filter(data) : true;
  96883. }
  96884. });
  96885. this.dataSet.set(newData);
  96886. this.update({
  96887. options: null
  96888. });
  96889. }
  96890. /**
  96891. * @function MapvLayer.prototype.clearData
  96892. * @description 清除数据。
  96893. */
  96894. }, {
  96895. key: "clearData",
  96896. value: function clearData() {
  96897. this.dataSet && this.dataSet.clear();
  96898. this.update({
  96899. options: null
  96900. });
  96901. }
  96902. }, {
  96903. key: "_canvasUpdate",
  96904. value: function _canvasUpdate(time) {
  96905. if (!this.canvasLayer) {
  96906. return;
  96907. }
  96908. var self = this;
  96909. var animationOptions = self.options.animation;
  96910. var map = self.map;
  96911. var context = self.canvasLayer.canvas.getContext(self.context);
  96912. if (self.isEnabledTime()) {
  96913. if (time === undefined) {
  96914. self.clear(context);
  96915. return;
  96916. }
  96917. if (!self.context || self.context === '2d') {
  96918. context.save();
  96919. context.globalCompositeOperation = 'destination-out';
  96920. context.fillStyle = 'rgba(0, 0, 0, .1)';
  96921. context.fillRect(0, 0, context.canvas.width, context.canvas.height);
  96922. context.restore();
  96923. }
  96924. } else {
  96925. this.clear(context);
  96926. }
  96927. if (!self.context || self.context === '2d') {
  96928. for (var key in self.options) {
  96929. context[key] = self.options[key];
  96930. }
  96931. } else {
  96932. context.clear(context.COLOR_BUFFER_BIT);
  96933. }
  96934. var ext = map.getView().calculateExtent();
  96935. var topLeftPx = map.getPixelFromCoordinate([ext[0], ext[3]]);
  96936. self._mapCenter = map.getView().getCenter();
  96937. self._mapCenterPx = map.getPixelFromCoordinate(self._mapCenter);
  96938. self._reselutions = map.getView().getResolution();
  96939. self._rotation = -map.getView().getRotation();
  96940. var zoomUnit = self._reselutions;
  96941. var scaleRatio = 1;
  96942. if (this.context != '2d') {
  96943. var global$2 = typeof window === 'undefined' ? {} : window;
  96944. var devicePixelRatio = global$2.devicePixelRatio || 1;
  96945. scaleRatio = devicePixelRatio;
  96946. }
  96947. var dataGetOptions = {
  96948. transferCoordinate: function transferCoordinate(coordinate) {
  96949. var x = (coordinate[0] - self._mapCenter[0]) / self._reselutions,
  96950. y = (self._mapCenter[1] - coordinate[1]) / self._reselutions;
  96951. var scaledP = [x + self._mapCenterPx[0], y + self._mapCenterPx[1]];
  96952. scaledP = scale(scaledP, self._mapCenterPx, 1);
  96953. /*//有旋转量的时候处理旋转
  96954. if (self._rotation !== 0) {
  96955. var rotatedP = rotate(scaledP, self._rotation, self._mapCenterPx);
  96956. return [rotatedP[0] + self.offset[0], rotatedP[1] + self.offset[1]];
  96957. }
  96958. //处理放大或缩小级别*/
  96959. return [(scaledP[0] + self.offset[0]) * scaleRatio, (scaledP[1] + self.offset[1]) * scaleRatio];
  96960. }
  96961. };
  96962. // //获取某像素坐标点pixelP绕中心center逆时针旋转rotation弧度后的像素点坐标。
  96963. // function rotate(pixelP, rotation, center) {
  96964. // var x = Math.cos(rotation) * (pixelP[0] - center[0]) - Math.sin(rotation) * (pixelP[1] - center[1]) + center[0];
  96965. // var y = Math.sin(rotation) * (pixelP[0] - center[0]) + Math.cos(rotation) * (pixelP[1] - center[1]) + center[1];
  96966. // return [x, y];
  96967. // }
  96968. //获取某像素坐标点pixelP相对于中心center进行缩放scaleRatio倍后的像素点坐标。
  96969. function scale(pixelP, center, scaleRatio) {
  96970. var x = (pixelP[0] - center[0]) * scaleRatio + center[0];
  96971. var y = (pixelP[1] - center[1]) * scaleRatio + center[1];
  96972. return [x, y];
  96973. }
  96974. if (time !== undefined) {
  96975. dataGetOptions.filter = function (item) {
  96976. var trails = animationOptions.trails || 10;
  96977. return time && item.time > time - trails && item.time < time;
  96978. };
  96979. }
  96980. if (self.isEnabledTime() && !self.notFirst) {
  96981. self.canvasLayer.resize(self.mapWidth, self.mapHeight);
  96982. self.notFirst = true;
  96983. }
  96984. var data = self.dataSet.get(dataGetOptions);
  96985. self.processData(data);
  96986. // 兼容unit为'm'的情况
  96987. if (self.options.unit === 'm') {
  96988. if (self.options.size) {
  96989. self.options._size = self.options.size / zoomUnit;
  96990. }
  96991. if (self.options.width) {
  96992. self.options._width = self.options.width / zoomUnit;
  96993. }
  96994. if (self.options.height) {
  96995. self.options._height = self.options.height / zoomUnit;
  96996. }
  96997. } else {
  96998. self.options._size = self.options.size;
  96999. self.options._height = self.options.height;
  97000. self.options._width = self.options.width;
  97001. }
  97002. var pixel = map.getPixelFromCoordinate([0, 0]);
  97003. pixel = [pixel[0] - topLeftPx[0], pixel[1] - topLeftPx[1]];
  97004. this.drawContext(context, data, self.options, {
  97005. x: pixel[0],
  97006. y: pixel[1]
  97007. });
  97008. if (self.isEnabledTime()) {
  97009. this.source.changed();
  97010. }
  97011. self.options.updateCallback && self.options.updateCallback(time);
  97012. }
  97013. }, {
  97014. key: "isEnabledTime",
  97015. value: function isEnabledTime() {
  97016. var animationOptions = this.options.animation;
  97017. return animationOptions && !(animationOptions.enabled === false);
  97018. }
  97019. }, {
  97020. key: "argCheck",
  97021. value: function argCheck(options) {
  97022. if (options.draw === 'heatmap') {
  97023. if (options.strokeStyle) {
  97024. console.warn('[heatmap] options.strokeStyle is discard, pleause use options.strength [eg: options.strength = 0.1]');
  97025. }
  97026. }
  97027. }
  97028. }, {
  97029. key: "getContext",
  97030. value: function getContext() {
  97031. return this.canvasLayer.canvas.getContext(this.context);
  97032. }
  97033. }, {
  97034. key: "clear",
  97035. value: function clear(context) {
  97036. context && context.clearRect && context.clearRect(0, 0, context.canvas.width, context.canvas.height);
  97037. }
  97038. }]);
  97039. return MapvLayer;
  97040. }(BaiduMapLayer);
  97041. ;// CONCATENATED MODULE: ./src/openlayers/overlay/Mapv.js
  97042. function Mapv_typeof(obj) { "@babel/helpers - typeof"; return Mapv_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Mapv_typeof(obj); }
  97043. function Mapv_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  97044. function Mapv_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  97045. function Mapv_createClass(Constructor, protoProps, staticProps) { if (protoProps) Mapv_defineProperties(Constructor.prototype, protoProps); if (staticProps) Mapv_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  97046. function Mapv_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Mapv_setPrototypeOf(subClass, superClass); }
  97047. function Mapv_setPrototypeOf(o, p) { Mapv_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Mapv_setPrototypeOf(o, p); }
  97048. function Mapv_createSuper(Derived) { var hasNativeReflectConstruct = Mapv_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Mapv_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Mapv_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Mapv_possibleConstructorReturn(this, result); }; }
  97049. function Mapv_possibleConstructorReturn(self, call) { if (call && (Mapv_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Mapv_assertThisInitialized(self); }
  97050. function Mapv_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  97051. function Mapv_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  97052. function Mapv_getPrototypeOf(o) { Mapv_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Mapv_getPrototypeOf(o); }
  97053. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  97054. * This program are made available under the terms of the Apache License, Version 2.0
  97055. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  97056. /**
  97057. * @class Mapv
  97058. * @browsernamespace ol.source
  97059. * @category Visualization MapV
  97060. * @classdesc MapV 图层源。
  97061. * @modulecategory Overlay
  97062. * @param {Object} opt_options - 参数。
  97063. * @param {ol.Map} opt_options.map - 当前 Map 对象。
  97064. * @param {Mapv.DataSet} opt_options.dataSet - MapV 的数据集。
  97065. * @param {Object} opt_options.mapvOptions - MapV 的配置对象。
  97066. * @param {string} [opt_options.logo] - Logo(openLayers 5.0.0 及更高版本不再支持此参数)。
  97067. * @param {ol.proj.Projection} [opt_options.projection] - 投影信息。
  97068. * @param {number} [opt_options.ratio=1.5] - 视图比,1 表示画布是地图视口的大小,2 表示地图视口的宽度和高度的两倍,依此类推。必须是 1 或更高。
  97069. * @param {Array} [opt_options.resolutions] - 分辨率数组。
  97070. * @param {ol.source.State} [opt_options.state] - 资源状态。
  97071. * @param {(string|Object)} [opt_options.attributions='© 2018 百度 MapV with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>'] - 版权信息。
  97072. * @extends {ol.source.ImageCanvas}
  97073. * @usage
  97074. */
  97075. var Mapv = /*#__PURE__*/function (_ImageCanvasSource) {
  97076. Mapv_inherits(Mapv, _ImageCanvasSource);
  97077. var _super = Mapv_createSuper(Mapv);
  97078. function Mapv(opt_options) {
  97079. var _this;
  97080. Mapv_classCallCheck(this, Mapv);
  97081. var options = opt_options ? opt_options : {};
  97082. _this = _super.call(this, {
  97083. attributions: options.attributions || "© 2018 百度 MapV with <span>© SuperMap iClient</span>",
  97084. canvasFunction: canvasFunctionInternal_,
  97085. logo: core_Util_Util.getOlVersion() === '4' ? options.logo : null,
  97086. projection: options.projection,
  97087. ratio: options.ratio,
  97088. resolutions: options.resolutions,
  97089. state: options.state
  97090. });
  97091. _this.map = opt_options.map;
  97092. _this.dataSet = opt_options.dataSet;
  97093. _this.mapvOptions = opt_options.mapvOptions;
  97094. function canvasFunctionInternal_(extent, resolution, pixelRatio, size, projection) {
  97095. // eslint-disable-line no-unused-vars
  97096. var mapWidth = size[0] / pixelRatio;
  97097. var mapHeight = size[1] / pixelRatio;
  97098. var width = this.map.getSize()[0];
  97099. var height = this.map.getSize()[1];
  97100. if (!this.layer) {
  97101. this.layer = new MapvLayer(this.map, this.dataSet, this.mapvOptions, mapWidth, mapHeight, this);
  97102. }
  97103. this.layer.pixelRatio = pixelRatio;
  97104. this.layer.offset = [(mapWidth - width) / 2, (mapHeight - height) / 2];
  97105. if (!this.rotate) {
  97106. this.rotate = this.map.getView().getRotation();
  97107. } else {
  97108. if (this.rotate !== this.map.getView().getRotation()) {
  97109. this.layer.canvasLayer.resize(mapWidth, mapHeight);
  97110. this.rotate = this.map.getView().getRotation();
  97111. }
  97112. }
  97113. var canvas = this.layer.canvasLayer.canvas;
  97114. if (!this.layer.isEnabledTime()) {
  97115. this.layer.canvasLayer.resize(mapWidth, mapHeight);
  97116. this.layer.canvasLayer.draw();
  97117. }
  97118. if (!this.context) {
  97119. this.context = core_Util_Util.createCanvasContext2D(mapWidth, mapHeight);
  97120. }
  97121. var canvas2 = this.context.canvas;
  97122. this.context.clearRect(0, 0, canvas2.width, canvas2.height);
  97123. canvas2.width = size[0];
  97124. canvas2.height = size[1];
  97125. canvas2.style.width = size[0] + "px";
  97126. canvas2.style.height = size[1] + "px";
  97127. this.context.drawImage(canvas, 0, 0);
  97128. if (this.resolution !== resolution || JSON.stringify(this.extent) !== JSON.stringify(extent)) {
  97129. this.resolution = resolution;
  97130. this.extent = extent;
  97131. }
  97132. return this.context.canvas;
  97133. }
  97134. return _this;
  97135. }
  97136. /**
  97137. * @function Mapv.prototype.addData
  97138. * @description 追加数据。
  97139. * @param {Object} data - 要追加的数据。
  97140. * @param {Object} options - 要追加的值。
  97141. */
  97142. Mapv_createClass(Mapv, [{
  97143. key: "addData",
  97144. value: function addData(data, options) {
  97145. this.layer.addData(data, options);
  97146. }
  97147. /**
  97148. * @function Mapv.prototype.getData
  97149. * @description 获取数据。
  97150. * @returns {Mapv.DataSet} MapV 数据集。
  97151. */
  97152. }, {
  97153. key: "getData",
  97154. value: function getData() {
  97155. if (this.layer) {
  97156. this.dataSet = this.layer.getData();
  97157. }
  97158. return this.dataSet;
  97159. }
  97160. /**
  97161. * @function Mapv.prototype.removeData
  97162. * @description 删除符合过滤条件的数据。
  97163. * @param {function} filter - 过滤条件。条件参数为数据项,返回值为 true,表示删除该元素;否则表示不删除。
  97164. * @example
  97165. * filter=function(data){
  97166. * if(data.id=="1"){
  97167. * return true
  97168. * }
  97169. * return false;
  97170. * }
  97171. */
  97172. }, {
  97173. key: "removeData",
  97174. value: function removeData(filter) {
  97175. this.layer && this.layer.removeData(filter);
  97176. }
  97177. /**
  97178. * @function Mapv.prototype.clearData
  97179. * @description 清除数据。
  97180. */
  97181. }, {
  97182. key: "clearData",
  97183. value: function clearData() {
  97184. this.layer.clearData();
  97185. }
  97186. /**
  97187. * @function Mapv.prototype.update
  97188. * @description 更新数据。
  97189. * @param {Object} options - 待更新的数据。
  97190. * @param {Object} options.data - mapv 数据集。
  97191. */
  97192. }, {
  97193. key: "update",
  97194. value: function update(options) {
  97195. this.layer.update(options);
  97196. this.changed();
  97197. }
  97198. }]);
  97199. return Mapv;
  97200. }((external_ol_source_ImageCanvas_default()));
  97201. ;// CONCATENATED MODULE: ./src/openlayers/overlay/Range.js
  97202. function Range_typeof(obj) { "@babel/helpers - typeof"; return Range_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Range_typeof(obj); }
  97203. function Range_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  97204. function Range_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  97205. function Range_createClass(Constructor, protoProps, staticProps) { if (protoProps) Range_defineProperties(Constructor.prototype, protoProps); if (staticProps) Range_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  97206. function Range_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Range_setPrototypeOf(subClass, superClass); }
  97207. function Range_setPrototypeOf(o, p) { Range_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Range_setPrototypeOf(o, p); }
  97208. function Range_createSuper(Derived) { var hasNativeReflectConstruct = Range_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Range_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Range_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Range_possibleConstructorReturn(this, result); }; }
  97209. function Range_possibleConstructorReturn(self, call) { if (call && (Range_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Range_assertThisInitialized(self); }
  97210. function Range_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  97211. function Range_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  97212. function Range_getPrototypeOf(o) { Range_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Range_getPrototypeOf(o); }
  97213. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  97214. * This program are made available under the terms of the Apache License, Version 2.0
  97215. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  97216. /**
  97217. * @class Range
  97218. * @browsernamespace ol.source
  97219. * @category Visualization Theme
  97220. * @classdesc 分段专题图图层源。
  97221. * @param {string} name - 名称
  97222. * @param {Object} opt_options - 参数。
  97223. * @param {ol.Map} opt_options.map - 当前map对象。
  97224. * @param {string} opt_options.themeField - 指定创建专题图字段。
  97225. * @param {string} [opt_options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  97226. * @param {number} [opt_options.opacity = 1] - 图层透明度。
  97227. * @param {string} [opt_options.logo] - Logo(openLayers 5.0.0 及更高版本不再支持此参数)。
  97228. * @param {ol.proj.Projection} [opt_options.projection] - 投影信息。
  97229. * @param {number} [opt_options.ratio=1.5] - 视图比,1 表示画布是地图视口的大小,2 表示地图视口的宽度和高度的两倍,依此类推。必须是 1 或更高。
  97230. * @param {Array} [opt_options.resolutions] - 分辨率数组。
  97231. * @param {ol.source.State} [opt_options.state] - 资源状态。
  97232. * @param {Object} [opt_options.style] - 专题图样式。
  97233. * @param {Object} [opt_options.styleGroups] - 各专题类型样式组。
  97234. * @param {boolean} [opt_options.isHoverAble = false] - 是否开启 hover 事件。
  97235. * @param {Object} [opt_options.highlightStyle] - 开启 hover 事件后,触发的样式风格。
  97236. * @param {(string|Object)} [opt_options.attributions='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>'] - 版权信息。
  97237. * @extends {GeoFeature}
  97238. * @usage
  97239. */
  97240. var Range = /*#__PURE__*/function (_GeoFeature) {
  97241. Range_inherits(Range, _GeoFeature);
  97242. var _super = Range_createSuper(Range);
  97243. function Range(name, opt_options) {
  97244. var _this;
  97245. Range_classCallCheck(this, Range);
  97246. _this = _super.call(this, name, opt_options);
  97247. _this.style = opt_options.style;
  97248. _this.isHoverAble = opt_options.isHoverAble;
  97249. _this.highlightStyle = opt_options.highlightStyle;
  97250. _this.themeField = opt_options.themeField;
  97251. _this.styleGroups = opt_options.styleGroups;
  97252. return _this;
  97253. }
  97254. /**
  97255. * @function Range.prototype.destroy
  97256. * @description 释放资源,将引用资源的属性置空。
  97257. */
  97258. Range_createClass(Range, [{
  97259. key: "destroy",
  97260. value: function destroy() {
  97261. this.style = null;
  97262. this.themeField = null;
  97263. this.styleGroups = null;
  97264. GeoFeature.prototype.destroy.apply(this, arguments);
  97265. }
  97266. /**
  97267. * @private
  97268. * @function Range.prototype.createThematicFeature
  97269. * @description 创建专题图要素。
  97270. * @param {Object} feature - 要创建的专题图形要素。
  97271. */
  97272. }, {
  97273. key: "createThematicFeature",
  97274. value: function createThematicFeature(feature) {
  97275. //赋 style
  97276. var style = this.getStyleByData(feature);
  97277. //创建专题要素时的可选参数
  97278. var options = {};
  97279. options.nodesClipPixel = this.nodesClipPixel;
  97280. options.isHoverAble = this.isHoverAble;
  97281. options.isMultiHover = this.isMultiHover;
  97282. options.isClickAble = this.isClickAble;
  97283. options.highlightStyle = ShapeFactory.transformStyle(this.highlightStyle);
  97284. //将数据转为专题要素(ThemeVector)
  97285. var thematicFeature = new ThemeVector(feature, this, ShapeFactory.transformStyle(style), options);
  97286. //直接添加图形到渲染器
  97287. for (var m = 0; m < thematicFeature.shapes.length; m++) {
  97288. this.renderer.addShape(thematicFeature.shapes[m]);
  97289. }
  97290. return thematicFeature;
  97291. }
  97292. /**
  97293. * @private
  97294. * @function Range.prototype.getStyleByData
  97295. * @description 通过数据获取 style。
  97296. * @param {Object} fea - 要素数据。
  97297. */
  97298. }, {
  97299. key: "getStyleByData",
  97300. value: function getStyleByData(fea) {
  97301. var style = {};
  97302. var feature = fea;
  97303. style = Util_Util.copyAttributesWithClip(style, this.style);
  97304. if (this.themeField && this.styleGroups && this.styleGroups.length > 0 && feature.attributes) {
  97305. var Sf = this.themeField;
  97306. var Attrs = feature.attributes;
  97307. var Gro = this.styleGroups;
  97308. var isSfInAttrs = false; //指定的 themeField 是否是 feature 的属性字段之一
  97309. var attr = null; //属性值
  97310. for (var property in Attrs) {
  97311. if (Sf === property) {
  97312. isSfInAttrs = true;
  97313. attr = Attrs[property];
  97314. break;
  97315. }
  97316. }
  97317. //判断属性值是否属于styleGroups的某一个范围,以便对获取分组 style
  97318. if (isSfInAttrs) {
  97319. for (var i = 0, len = Gro.length; i < len; i++) {
  97320. if (attr >= Gro[i].start && attr < Gro[i].end) {
  97321. //feature.style = Util.copyAttributes(feature.style, this.defaultStyle);
  97322. var sty1 = Gro[i].style;
  97323. style = Util_Util.copyAttributesWithClip(style, sty1);
  97324. }
  97325. }
  97326. }
  97327. }
  97328. if (feature.style && this.isAllowFeatureStyle === true) {
  97329. style = Util_Util.copyAttributesWithClip(feature.style);
  97330. }
  97331. return style;
  97332. }
  97333. }, {
  97334. key: "canvasFunctionInternal_",
  97335. value: function canvasFunctionInternal_(extent, resolution, pixelRatio, size, projection) {
  97336. // eslint-disable-line no-unused-vars
  97337. return GeoFeature.prototype.canvasFunctionInternal_.apply(this, arguments);
  97338. }
  97339. }]);
  97340. return Range;
  97341. }(GeoFeature);
  97342. ;// CONCATENATED MODULE: ./src/openlayers/overlay/RankSymbol.js
  97343. function overlay_RankSymbol_typeof(obj) { "@babel/helpers - typeof"; return overlay_RankSymbol_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, overlay_RankSymbol_typeof(obj); }
  97344. function overlay_RankSymbol_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  97345. function overlay_RankSymbol_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  97346. function overlay_RankSymbol_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_RankSymbol_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_RankSymbol_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  97347. function overlay_RankSymbol_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) overlay_RankSymbol_setPrototypeOf(subClass, superClass); }
  97348. function overlay_RankSymbol_setPrototypeOf(o, p) { overlay_RankSymbol_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return overlay_RankSymbol_setPrototypeOf(o, p); }
  97349. function overlay_RankSymbol_createSuper(Derived) { var hasNativeReflectConstruct = overlay_RankSymbol_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = overlay_RankSymbol_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = overlay_RankSymbol_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return overlay_RankSymbol_possibleConstructorReturn(this, result); }; }
  97350. function overlay_RankSymbol_possibleConstructorReturn(self, call) { if (call && (overlay_RankSymbol_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return overlay_RankSymbol_assertThisInitialized(self); }
  97351. function overlay_RankSymbol_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  97352. function overlay_RankSymbol_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  97353. function overlay_RankSymbol_getPrototypeOf(o) { overlay_RankSymbol_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return overlay_RankSymbol_getPrototypeOf(o); }
  97354. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  97355. * This program are made available under the terms of the Apache License, Version 2.0
  97356. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  97357. /**
  97358. * @class RankSymbol
  97359. * @browsernamespace ol.source
  97360. * @category Visualization Theme
  97361. * @classdesc 等级符号专题图图层源。
  97362. * @modulecategory Overlay
  97363. * @param {string} name - 专题图层名。
  97364. * @param {string} symbolType - 标志类型。
  97365. * @param {Object} opt_options - 参数。
  97366. * @param {ol.Map} opt_options.map - 当前 Map 对象。
  97367. * @param {string} opt_options.themeFields - 指定创建专题图字段。
  97368. * @param {Object} opt_options.symbolSetting - 符号 Circle 配置对象 symbolSetting(<{@link SuperMap.Layer.RankSymbol}>)。
  97369. * @param {Array.<number>} opt_options.symbolSetting.codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  97370. * @param {number} [opt_options.symbolSetting.maxR] - 圆形的最大半径。
  97371. * @param {number} [opt_options.symbolSetting.minR] - 圆形的最小半径。
  97372. * @param {string} [opt_options.symbolSetting.fillColor] - 圆形的填充色,如:fillColor: "#FFB980"。
  97373. * @param {Object} [opt_options.symbolSetting.circleStyle] - 圆形的基础 style,此参数控制圆形基础样式,优先级低于 circleStyleByFields 和 circleStyleByCodomain。
  97374. * @param {number} [opt_options.symbolSetting.decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  97375. * @param {Object} [opt_options.symbolSetting.circleHoverStyle] - 圆形 hover 状态时的样式,circleHoverAble 为 true 时有效。
  97376. * @param {boolean} [opt_options.symbolSetting.circleHoverAble=true] - 是否允许圆形使用 hover 状态。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
  97377. * @param {boolean} [opt_options.symbolSetting.circleClickAble=true] - 是否允许圆形被点击。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
  97378. * @param {string} [opt_options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  97379. * @param {number} [opt_options.opacity=1] - 图层透明度。
  97380. * @param {string} [opt_options.logo] - Logo(openLayers 5.0.0 及更高版本不再支持此参数)。
  97381. * @param {ol.proj.Projection} [opt_options.projection] - 投影信息。
  97382. * @param {number} [opt_options.ratio=1.5] - 视图比,1 表示画布是地图视口的大小,2 表示地图视口的宽度和高度的两倍,依此类推。必须是 1 或更高。
  97383. * @param {Array} [opt_options.resolutions] - 分辨率数组。
  97384. * @param {ol.source.State} [opt_options.state] - 资源状态。
  97385. * @param {boolean} [opt_options.isOverLay=true] - 是否进行压盖处理,如果设为 true,图表绘制过程中将隐藏对已在图层中绘制的图表产生压盖的图表。
  97386. * @param {(string|Object)} [opt_options.attributions='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>'] - 版权信息。
  97387. * @extends {Graph}
  97388. * @usage
  97389. */
  97390. var RankSymbol_RankSymbol = /*#__PURE__*/function (_Graph) {
  97391. overlay_RankSymbol_inherits(RankSymbol, _Graph);
  97392. var _super = overlay_RankSymbol_createSuper(RankSymbol);
  97393. function RankSymbol(name, symbolType, opt_options) {
  97394. var _this;
  97395. overlay_RankSymbol_classCallCheck(this, RankSymbol);
  97396. _this = _super.call(this, name, symbolType, opt_options);
  97397. _this.symbolType = symbolType;
  97398. _this.symbolSetting = opt_options.symbolSetting;
  97399. _this.themeField = opt_options.themeField;
  97400. return _this;
  97401. }
  97402. /**
  97403. * @function RankSymbol.prototype.destroy
  97404. * @description 释放资源,将引用资源的属性置空。
  97405. */
  97406. overlay_RankSymbol_createClass(RankSymbol, [{
  97407. key: "destroy",
  97408. value: function destroy() {
  97409. this.symbolType = null;
  97410. this.symbolSetting = null;
  97411. this.themeField = null;
  97412. Graph_Graph.prototype.destroy.apply(this, arguments);
  97413. }
  97414. /**
  97415. * @function RankSymbol.prototype.setSymbolType
  97416. * @description 设置标志符号。
  97417. * @param {string} symbolType - 符号类型。
  97418. */
  97419. }, {
  97420. key: "setSymbolType",
  97421. value: function setSymbolType(symbolType) {
  97422. this.symbolType = symbolType;
  97423. this.redraw();
  97424. }
  97425. /**
  97426. * @private
  97427. * @function RankSymbol.prototype.createThematicFeature
  97428. * @description 创建专题图形要素。
  97429. * @param {Object} feature - 要创建的专题图形要素。
  97430. */
  97431. }, {
  97432. key: "createThematicFeature",
  97433. value: function createThematicFeature(feature) {
  97434. var thematicFeature;
  97435. // 检查图形创建条件并创建图形
  97436. if (Theme_Theme[this.symbolType] && this.themeField && this.symbolSetting) {
  97437. thematicFeature = new Theme_Theme[this.symbolType](feature, this, [this.themeField], this.symbolSetting);
  97438. }
  97439. // thematicFeature 是否创建成功
  97440. if (!thematicFeature) {
  97441. return false;
  97442. }
  97443. // 对专题要素执行图形装载
  97444. thematicFeature.assembleShapes();
  97445. return thematicFeature;
  97446. }
  97447. }, {
  97448. key: "canvasFunctionInternal_",
  97449. value: function canvasFunctionInternal_(extent, resolution, pixelRatio, size, projection) {
  97450. // eslint-disable-line no-unused-vars
  97451. return Graph_Graph.prototype.canvasFunctionInternal_.apply(this, arguments);
  97452. }
  97453. }]);
  97454. return RankSymbol;
  97455. }(Graph_Graph);
  97456. ;// CONCATENATED MODULE: external "function(){try{return turf}catch(e){return {}}}()"
  97457. var external_function_try_return_turf_catch_e_return_namespaceObject = function(){try{return turf}catch(e){return {}}}();
  97458. ;// CONCATENATED MODULE: ./src/openlayers/overlay/Turf.js
  97459. function Turf_typeof(obj) { "@babel/helpers - typeof"; return Turf_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Turf_typeof(obj); }
  97460. function Turf_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  97461. function Turf_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  97462. function Turf_createClass(Constructor, protoProps, staticProps) { if (protoProps) Turf_defineProperties(Constructor.prototype, protoProps); if (staticProps) Turf_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  97463. function Turf_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Turf_setPrototypeOf(subClass, superClass); }
  97464. function Turf_setPrototypeOf(o, p) { Turf_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Turf_setPrototypeOf(o, p); }
  97465. function Turf_createSuper(Derived) { var hasNativeReflectConstruct = Turf_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Turf_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Turf_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Turf_possibleConstructorReturn(this, result); }; }
  97466. function Turf_possibleConstructorReturn(self, call) { if (call && (Turf_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Turf_assertThisInitialized(self); }
  97467. function Turf_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  97468. function Turf_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  97469. function Turf_getPrototypeOf(o) { Turf_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Turf_getPrototypeOf(o); }
  97470. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  97471. * This program are made available under the terms of the Apache License, Version 2.0
  97472. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  97473. /**
  97474. * @class Turf
  97475. * @browsernamespace ol.source
  97476. * @category Visualization Turf
  97477. * @classdesc Turf.js 图层源。
  97478. * @modulecategory Overlay
  97479. * @param {Object} opt_options - 参数。
  97480. * @extends {ol.source.Vector}
  97481. * @usage
  97482. */
  97483. var Turf = /*#__PURE__*/function (_VectorSource) {
  97484. Turf_inherits(Turf, _VectorSource);
  97485. var _super = Turf_createSuper(Turf);
  97486. function Turf(opt_options) {
  97487. var _this;
  97488. Turf_classCallCheck(this, Turf);
  97489. var options = opt_options ? opt_options : {};
  97490. _this = _super.call(this, {
  97491. attributions: options.attributions || "<span>© turfjs</span> with <span>© SuperMap iClient</span>",
  97492. features: options.features,
  97493. format: options.format,
  97494. extent: options.extent,
  97495. logo: core_Util_Util.getOlVersion() === '4' ? options.logo : null,
  97496. projection: options.projection,
  97497. wrapX: options.wrapX
  97498. });
  97499. _this.turfMap = {
  97500. "Measurement.along": ["line", "distance", "units"],
  97501. "Measurement.area": ["geojson"],
  97502. "Measurement.bbox": ["geojson"],
  97503. "Measurement.bboxPolygon": ["bbox"],
  97504. "Measurement.bearing": ["start", "end", "final"],
  97505. "Measurement.center": ["geojson", "properties"],
  97506. "Measurement.centerOfMass": ["geojson", "properties"],
  97507. "Measurement.centroid": ["geojson", "properties"],
  97508. "Measurement.destination": ["origin", "distance", "bearing", "units"],
  97509. "Measurement.distance": ["from", "to", "units"],
  97510. "Measurement.envelope": ["geojson"],
  97511. "Measurement.length": ["geojson", "units"],
  97512. "Measurement.midpoint": ["point1", "point2"],
  97513. "Measurement.pointOnFeature": ["geojson"],
  97514. "Measurement.polygonTangents": ["point", "polygon"],
  97515. "Measurement.rhumbBearing": ["start", "end", "final"],
  97516. "Measurement.rhumbDestination": ["origin", "distance", "bearing", "units"],
  97517. "Measurement.rhumbDistance": ["from", "to", "units"],
  97518. "Measurement.square": ["bbox"],
  97519. "Measurement.greatCircle": ["start", "end", "properties", "npoints", "offset"],
  97520. "CoordinateMutation.cleanCoords": ["geojson", "mutate"],
  97521. "CoordinateMutation.flip": ["geojson", "mutate"],
  97522. "CoordinateMutation.rewind": ["geojson", "reverse", "mutate"],
  97523. "CoordinateMutation.round": ["num", "precision"],
  97524. "CoordinateMutation.truncate": ["geojson", "precision", "coordinates", "mutate"],
  97525. "Transformation.bboxClip": ["feature", "bbox"],
  97526. "Transformation.bezierSpline": ["line", "resolution", "sharpness"],
  97527. "Transformation.buffer": ["geojson", "radius", "units", "steps"],
  97528. "Transformation.circle": ["center", "radius", "steps", "units", "properties"],
  97529. "Transformation.clone": ["geojson"],
  97530. "Transformation.concave": ["points", "maxEdge", "units"],
  97531. "Transformation.convex": ["geojson", "concavity"],
  97532. "Transformation.difference": ["polygon1", "polygon2"],
  97533. "Transformation.dissolve": ["featureCollection", "propertyName"],
  97534. "Transformation.intersect": ["poly1", "poly2"],
  97535. "Transformation.lineOffset": ["geojson", "distance", "units"],
  97536. "Transformation.simplify": ["feature", "tolerance", "highQuality"],
  97537. "Transformation.tesselate": ["poly"],
  97538. "Transformation.transformRotate": ["geojson", "angle", "pivot", "mutate"],
  97539. "Transformation.transformTranslate": ["geojson", "distance", "direction", "units", "zTranslation", "mutate"],
  97540. "Transformation.transformScale": ["geojson", "factor", "origin", "mutate"],
  97541. "Transformation.union": ["A"],
  97542. "Transformation.voronoi": ["points", "bbox"],
  97543. "featureConversion.combine": ["fc"],
  97544. "featureConversion.explode": ["geojson"],
  97545. "featureConversion.flatten": ["geojson"],
  97546. "featureConversion.lineStringToPolygon": ["lines", "properties", "autoComplete", "orderCoords"],
  97547. "featureConversion.polygonize": ["geojson"],
  97548. "featureConversion.polygonToLineString": ["polygon", "properties"],
  97549. "Misc.kinks": ["featureIn"],
  97550. "Misc.lineArc": ["center", "radius", "bearing1", "bearing2", "steps", "units"],
  97551. "Misc.lineChunk": ["geojson", "segmentLength", "units", "reverse"],
  97552. "Misc.lineIntersect": ["line1", "line2"],
  97553. "Misc.lineOverlap": ["line1", "line2"],
  97554. "Misc.lineSegment": ["geojson"],
  97555. "Misc.lineSlice": ["startPt", "stopPt", "line"],
  97556. "Misc.lineSliceAlong": ["line", "startDist", "stopDist", "units"],
  97557. "Misc.lineSplit": ["line", "splitter"],
  97558. "Misc.mask": ["polygon", "mask"],
  97559. "Misc.pointOnLine": ["lines", "pt", "units"],
  97560. "Misc.sector": ["center", "radius", "bearing1", "bearing2", "steps", "units"],
  97561. "Misc.shortestPath": ["start", "end", "obstacles", "units", "resolution"],
  97562. "Misc.unkinkPolygon": ["geojson"],
  97563. "Helper.featureCollection": ["features", "bbox", "id"],
  97564. "Helper.feature": ["geometry", "properties", "bbox", "id"],
  97565. "Helper.geometryCollection": ["geometries", "properties", "bbox", "id"],
  97566. "Helper.lineString": ["coordinates", "properties", "bbox", "id"],
  97567. "Helper.multiLineString": ["coordinates", "properties", "bbox", "id"],
  97568. "Helper.multiPoint": ["coordinates", "properties", "bbox", "id"],
  97569. "Helper.multiPolygon": ["coordinates", "properties", "bbox", "id"],
  97570. "Helper.point": ["coordinates", "properties", "bbox", "id"],
  97571. "Helper.polygon": ["coordinates", "properties", "bbox", "id"],
  97572. "Data.sample": ["featurecollection", "num"],
  97573. "Interpolation.interpolate": ["points", "cellSize", "gridType", "property", "units", "weight"],
  97574. "Interpolation.isobands": ["pointGrid", "breaks", "zProperty", "commonProperties", "breaksProperties"],
  97575. "Interpolation.isolines": ["pointGrid", "breaks", "zProperty", "commonProperties", "breaksProperties"],
  97576. "Interpolation.planepoint": ["point", "triangle"],
  97577. "Interpolation.tin": ["points", "z"],
  97578. "Joins.pointsWithinPolygon": ["points", "polygons"],
  97579. "Joins.tag": ["points", "polygons", "field", "outField", "mask", "properties"],
  97580. "Grids.hexGrid": ["bbox", "cellSide", "units", "triangles"],
  97581. "Grids.pointGrid": ["bbox", "cellSide", "units", "mask", "properties"],
  97582. "Grids.squareGrid": ["bbox", "cellSide", "units", "mask", "properties"],
  97583. "Grids.triangleGrid": ["bbox", "cellSide", "units", "mask", "properties"],
  97584. "Classification.nearestPoint": ["targetPoint", "points"],
  97585. "Aggregation.collect": ["polygons", "points", "inProperty", "outProperty"],
  97586. "Aggregation.clustersDbscan": ["points", "maxDistance", "units", "minPoints", "mutate"],
  97587. "Aggregation.clustersKmeans": ["points", "numberOfClusters", "mutate"],
  97588. "Meta.coordAll": ["geojson"],
  97589. "Meta.coordEach": ["geojson", "callback", "excludeWrapCoord"],
  97590. "Meta.coordReduce": ["geojson", "callback", "initialValue", "excludeWrapCoord"],
  97591. "Meta.featureEach": ["geojson", "callback"],
  97592. "Meta.featureReduce": ["geojson", "callback", "initialValue"],
  97593. "Meta.flattenEach": ["geojson", "callback"],
  97594. "Meta.flattenReduce": ["geojson", "callback", "initialValue"],
  97595. "Meta.getCoord": ["coord"],
  97596. "Meta.getCoords": ["coords"],
  97597. "Meta.getGeom": ["geojson"],
  97598. "Meta.getGeomType": ["geojson", "name"],
  97599. "Meta.geomEach": ["geojson", "callback"],
  97600. "Meta.geomReduce": ["geojson", "callback", "initialValue"],
  97601. "Meta.propEach": ["geojson", "callback"],
  97602. "Meta.propReduce": ["geojson", "callback", "initialValue"],
  97603. "Meta.segmentEach": ["geojson", "callback"],
  97604. "Meta.segmentReduce": ["geojson", "callback", "initialValue"],
  97605. "Meta.getCluster": ["geojson", "filter"],
  97606. "Meta.clusterEach": ["geojson", "property", "callback"],
  97607. "Meta.clusterReduce": ["geojson", "property", "callback", "initialValue"],
  97608. "Assertions.collectionOf": ["featureCollection", "type", "name"],
  97609. "Assertions.containsNumber": ["coordinates"],
  97610. "Assertions.geojsonType": ["value", "type", "name"],
  97611. "Assertions.featureOf": ["feature", "type", "name"],
  97612. "Booleans.booleanClockwise": ["line"],
  97613. "Booleans.booleanContains": ["feature1", "feature2"],
  97614. "Booleans.booleanCrosses": ["feature1", "feature2"],
  97615. "Booleans.booleanDisjoint": ["feature1", "feature2"],
  97616. "Booleans.booleanEqual": ["feature1", "feature2"],
  97617. "Booleans.booleanOverlap": ["feature1", "feature2"],
  97618. "Booleans.booleanParallel": ["feature1", "feature2"],
  97619. "Booleans.booleanPointInPolygon": ["point", "polygon", "ignoreBoundary"],
  97620. "Booleans.booleanPointOnLine": ["point", "linestring", "ignoreEndVertices"],
  97621. "UnitConversion.bearingToAngle": ["bearing"],
  97622. "UnitConversion.convertArea": ["area", "originalUnit", "finalUnit"],
  97623. "UnitConversion.convertLength": ["length", "originalUnit", "finalUnit"],
  97624. "UnitConversion.degreesToradians": ["degrees"],
  97625. "UnitConversion.lengthToRadians": ["distance", "units"],
  97626. "UnitConversion.lengthToDegrees": ["distance", "units"],
  97627. "UnitConversion.radiansToLength": ["radians", "units"],
  97628. "UnitConversion.radiansToDegrees": ["radians"],
  97629. "UnitConversion.toMercator": ["geojson", "mutate"],
  97630. "UnitConversion.toWgs84": ["geojson", "mutate"]
  97631. };
  97632. // 5.0.0 及以上版本参数配置
  97633. _this.turfOptionMap = {
  97634. "Measurement.along": ["line", "distance", {
  97635. units: ""
  97636. }],
  97637. "Measurement.bboxPolygon": ["bbox", {
  97638. properties: "",
  97639. id: ""
  97640. }],
  97641. "Measurement.bearing": ["start", "end", {
  97642. "final": ""
  97643. }],
  97644. "Measurement.center": ["geojson", {
  97645. properties: ""
  97646. }],
  97647. "Measurement.destination": ["origin", "distance", "bearing", {
  97648. units: "",
  97649. properties: ""
  97650. }],
  97651. "Measurement.distance": ["from", "to", {
  97652. units: ""
  97653. }],
  97654. "Measurement.length": ["geojson", {
  97655. units: ""
  97656. }],
  97657. "Measurement.rhumbBearing": ["start", "end", {
  97658. "final": ""
  97659. }],
  97660. "Measurement.rhumbDestination": ["origin", "distance", "bearing", {
  97661. units: "",
  97662. properties: ""
  97663. }],
  97664. "Measurement.rhumbDistance": ["from", "to", {
  97665. units: ""
  97666. }],
  97667. "Measurement.greatCircle": ["start", "end", {
  97668. properties: "",
  97669. npoints: "",
  97670. offset: ""
  97671. }],
  97672. "CoordinateMutation.cleanCoords": ["geojson", {
  97673. mutate: ""
  97674. }],
  97675. "CoordinateMutation.flip": ["geojson", {
  97676. mutate: ""
  97677. }],
  97678. "CoordinateMutation.rewind": ["geojson", {
  97679. mutate: "",
  97680. reverse: ""
  97681. }],
  97682. "CoordinateMutation.truncate": ["geojson", {
  97683. precision: "",
  97684. coordinates: "",
  97685. mutate: ""
  97686. }],
  97687. "Transformation.bezierSpline": ["line", {
  97688. resolution: "",
  97689. sharpness: ""
  97690. }],
  97691. "Transformation.buffer": ["geojson", "radius", {
  97692. units: "",
  97693. steps: ""
  97694. }],
  97695. "Transformation.circle": ["center", "radius", {
  97696. units: "",
  97697. steps: "",
  97698. properties: ""
  97699. }],
  97700. "Transformation.concave": ["points", {
  97701. maxEdge: "",
  97702. units: ""
  97703. }],
  97704. "Transformation.convex": ["geojson", {
  97705. concavity: ""
  97706. }],
  97707. "Transformation.dissolve": ["featureCollection", {
  97708. propertyName: ""
  97709. }],
  97710. "Transformation.lineOffset": ["geojson", "distance", {
  97711. units: ""
  97712. }],
  97713. "Transformation.simplify": ["geojson", {
  97714. tolerance: "",
  97715. highQuality: ""
  97716. }],
  97717. "Transformation.transformRotate": ["geojson", "angle", {
  97718. pivot: "",
  97719. mutate: ""
  97720. }],
  97721. "Transformation.transformTranslate": ["geojson", "distance", "direction", {
  97722. units: "",
  97723. zTranslation: "",
  97724. mutate: ""
  97725. }],
  97726. "Transformation.transformScale": ["geojson", "factor", {
  97727. origin: "",
  97728. mutate: ""
  97729. }],
  97730. "Transformation.voronoi": ["points", {
  97731. bbox: ""
  97732. }],
  97733. "featureConversion.lineStringToPolygon": ["lines", {
  97734. properties: "",
  97735. autoComplete: "",
  97736. orderCoords: ""
  97737. }],
  97738. "featureConversion.polygonToLineString": ["polygon", {
  97739. properties: ""
  97740. }],
  97741. "Misc.lineArc": ["center", "radius", "bearing1", "bearing2", {
  97742. steps: "",
  97743. units: ""
  97744. }],
  97745. "Misc.lineChunk": ["geojson", "segmentLength", {
  97746. units: "",
  97747. reverse: ""
  97748. }],
  97749. "Misc.lineOverlap": ["line1", "line2", {
  97750. tolerance: ""
  97751. }],
  97752. "Misc.lineSliceAlong": ["line", "startDist", "stopDist", {
  97753. units: ""
  97754. }],
  97755. "Misc.pointOnLine": ["lines", "pt", {
  97756. units: ""
  97757. }],
  97758. "Misc.sector": ["center", "radius", "bearing1", "bearing2", {
  97759. units: "",
  97760. steps: "",
  97761. properties: ""
  97762. }],
  97763. "Misc.shortestPath": ["start", "end", {
  97764. obstacles: "",
  97765. units: "",
  97766. resolution: ""
  97767. }],
  97768. "Helper.feature": ["geometry", "properties", {
  97769. bbox: "",
  97770. id: ""
  97771. }],
  97772. "Helper.geometryCollection": ["geometries", "properties", {
  97773. bbox: "",
  97774. id: ""
  97775. }],
  97776. "Helper.lineString": ["coordinates", "properties", {
  97777. bbox: "",
  97778. id: ""
  97779. }],
  97780. "Helper.multiLineString": ["coordinates", "properties", {
  97781. bbox: "",
  97782. id: ""
  97783. }],
  97784. "Helper.multiPoint": ["coordinates", "properties", {
  97785. bbox: "",
  97786. id: ""
  97787. }],
  97788. "Helper.multiPolygon": ["coordinates", "properties", {
  97789. bbox: "",
  97790. id: ""
  97791. }],
  97792. "Helper.point": ["coordinates", "properties", {
  97793. bbox: "",
  97794. id: ""
  97795. }],
  97796. "Helper.polygon": ["coordinates", "properties", {
  97797. bbox: "",
  97798. id: ""
  97799. }],
  97800. "Interpolation.interpolate": ["points", "cellSize", {
  97801. gridType: "",
  97802. property: "",
  97803. units: "",
  97804. weight: ""
  97805. }],
  97806. "Interpolation.isobands": ["pointGrid", "breaks", {
  97807. zProperty: "",
  97808. commonProperties: "",
  97809. breaksProperties: ""
  97810. }],
  97811. "Interpolation.isolines": ["pointGrid", "breaks", {
  97812. zProperty: "",
  97813. commonProperties: "",
  97814. breaksProperties: ""
  97815. }],
  97816. "Grids.hexGrid": ["bbox", "cellSide", {
  97817. units: "",
  97818. triangles: "",
  97819. properties: "",
  97820. mask: ""
  97821. }],
  97822. "Grids.pointGrid": ["bbox", "cellSide", {
  97823. units: "",
  97824. mask: "",
  97825. properties: ""
  97826. }],
  97827. "Grids.squareGrid": ["bbox", "cellSide", {
  97828. units: "",
  97829. mask: "",
  97830. properties: ""
  97831. }],
  97832. "Grids.triangleGrid": ["bbox", "cellSide", {
  97833. units: "",
  97834. mask: "",
  97835. properties: ""
  97836. }],
  97837. "Aggregation.clustersDbscan": ["points", "maxDistance", {
  97838. units: "",
  97839. minPoints: "",
  97840. mutate: ""
  97841. }],
  97842. "Aggregation.clustersKmeans": ["points", {
  97843. numberOfClusters: "",
  97844. mutate: ""
  97845. }],
  97846. "Booleans.booleanPointInPolygon": ["point", "polygon", {
  97847. ignoreBoundary: ""
  97848. }],
  97849. "Booleans.booleanPointOnLine": ["point", "linestring", {
  97850. ignoreEndVertices: ""
  97851. }],
  97852. "UnitConversion.toMercator": ["geojson", {
  97853. mutate: ""
  97854. }],
  97855. "UnitConversion.toWgs84": ["geojson", {
  97856. mutate: ""
  97857. }]
  97858. };
  97859. return _this;
  97860. }
  97861. /**
  97862. * @function Turf.prototype.process
  97863. * @description 执行 Turf.js 提供的相关空间分析方法。
  97864. * @param {string} type - Turf.js 提供的空间分析方法名。
  97865. * @param {Object} args - Turf.js 提供的空间分析方法对应的参数对象。
  97866. * @param {function} callback - 空间分析完成执行的回调函数,返回执行的结果。
  97867. * @param {boolean} addFeaturesToMap - 是否添加到 Map。
  97868. */
  97869. Turf_createClass(Turf, [{
  97870. key: "process",
  97871. value: function process(type, args, callback, addFeaturesToMap) {
  97872. var result;
  97873. // 兼容版本4到5
  97874. try {
  97875. result = external_function_try_return_turf_catch_e_return_namespaceObject[type.split('.')[1]].apply(this, this.parse(type, args));
  97876. } catch (e) {
  97877. result = external_function_try_return_turf_catch_e_return_namespaceObject[type.split('.')[1]].apply(this, this.parseOption(type, args));
  97878. }
  97879. var features = null;
  97880. try {
  97881. features = new (external_ol_format_GeoJSON_default())().readFeatures(result);
  97882. } catch (e) {
  97883. if (callback) {
  97884. callback(result);
  97885. }
  97886. return;
  97887. }
  97888. addFeaturesToMap = addFeaturesToMap == null ? true : addFeaturesToMap;
  97889. if (addFeaturesToMap) {
  97890. this.addFeatures(features);
  97891. }
  97892. if (callback) {
  97893. callback(result);
  97894. }
  97895. }
  97896. }, {
  97897. key: "parse",
  97898. value: function parse(type, args) {
  97899. if (type === 'Transformation.union') {
  97900. return args['A'];
  97901. }
  97902. var result = [];
  97903. var tempArgs = this.turfMap[type];
  97904. if (tempArgs) {
  97905. tempArgs.map(function (key) {
  97906. result.push(args[key]);
  97907. return args[key];
  97908. });
  97909. }
  97910. return result;
  97911. }
  97912. }, {
  97913. key: "parseOption",
  97914. value: function parseOption(type, args) {
  97915. var result = [];
  97916. var tempArgs = this.turfOptionMap[type];
  97917. tempArgs.map(function (key) {
  97918. if (key instanceof Object) {
  97919. var options = key;
  97920. Object.keys(options).forEach(function (k) {
  97921. options[k] = args[k];
  97922. });
  97923. result.push(options);
  97924. } else {
  97925. result.push(args[key]);
  97926. }
  97927. return args;
  97928. });
  97929. return result;
  97930. }
  97931. }]);
  97932. return Turf;
  97933. }((external_ol_source_Vector_default()));
  97934. ;// CONCATENATED MODULE: ./src/openlayers/overlay/Unique.js
  97935. function Unique_typeof(obj) { "@babel/helpers - typeof"; return Unique_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, Unique_typeof(obj); }
  97936. function Unique_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  97937. function Unique_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  97938. function Unique_createClass(Constructor, protoProps, staticProps) { if (protoProps) Unique_defineProperties(Constructor.prototype, protoProps); if (staticProps) Unique_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  97939. function Unique_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Unique_setPrototypeOf(subClass, superClass); }
  97940. function Unique_setPrototypeOf(o, p) { Unique_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Unique_setPrototypeOf(o, p); }
  97941. function Unique_createSuper(Derived) { var hasNativeReflectConstruct = Unique_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Unique_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Unique_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Unique_possibleConstructorReturn(this, result); }; }
  97942. function Unique_possibleConstructorReturn(self, call) { if (call && (Unique_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Unique_assertThisInitialized(self); }
  97943. function Unique_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  97944. function Unique_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  97945. function Unique_getPrototypeOf(o) { Unique_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Unique_getPrototypeOf(o); }
  97946. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  97947. * This program are made available under the terms of the Apache License, Version 2.0
  97948. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  97949. /**
  97950. * @class Unique
  97951. * @browsernamespace ol.source
  97952. * @category Visualization Theme
  97953. * @classdesc 单值专题图图层源。
  97954. * @modulecategory Overlay
  97955. * @param {string} name - 图层名称。
  97956. * @param {Object} opt_options - 参数。
  97957. * @param {ol.Map} opt_options.map - 当前 Map 对象。
  97958. * @param {string} [opt_options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层ID。
  97959. * @param {number} [opt_options.opacity=1] - 图层透明度。
  97960. * @param {string} [opt_options.logo] - Logo(openLayers 5.0.0 及更高版本不再支持此参数)。
  97961. * @param {ol.proj.Projection} [opt_options.projection] - 投影信息。
  97962. * @param {number} [opt_options.ratio=1.5] - 视图比,1 表示画布是地图视口的大小,2 表示地图视口的宽度和高度的两倍,依此类推。必须是1 或更高。
  97963. * @param {Array} [opt_options.resolutions] - 分辨率数组。
  97964. * @param {ol.source.State} [opt_options.state] - 资源状态。
  97965. * @param {string} [opt_options.themeField] - 指定创建专题图字段。
  97966. * @param {Object} [opt_options.style] - 专题图样式。
  97967. * @param {Object} [opt_options.styleGroups] - 各专题类型样式组。
  97968. * @param {boolean} [opt_options.isHoverAble=false] - 是否开启 hover 事件。
  97969. * @param {Object} [opt_options.highlightStyle] - 开启 hover 事件后,触发的样式风格。
  97970. * @param {(string|Object)} [opt_options.attributions='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>'] - 版权信息。
  97971. * @extends {GeoFeature}
  97972. * @usage
  97973. */
  97974. var Unique = /*#__PURE__*/function (_GeoFeature) {
  97975. Unique_inherits(Unique, _GeoFeature);
  97976. var _super = Unique_createSuper(Unique);
  97977. function Unique(name, opt_options) {
  97978. var _this;
  97979. Unique_classCallCheck(this, Unique);
  97980. _this = _super.call(this, name, opt_options);
  97981. _this.themeField = opt_options.themeField;
  97982. _this.style = opt_options.style;
  97983. _this.styleGroups = opt_options.styleGroups;
  97984. _this.isHoverAble = opt_options.isHoverAble;
  97985. _this.highlightStyle = opt_options.highlightStyle;
  97986. return _this;
  97987. }
  97988. /**
  97989. * @function Unique.prototype.destroy
  97990. * @description 释放资源,将引用资源的属性置空。
  97991. */
  97992. Unique_createClass(Unique, [{
  97993. key: "destroy",
  97994. value: function destroy() {
  97995. this.style = null;
  97996. this.themeField = null;
  97997. this.styleGroups = null;
  97998. GeoFeature.prototype.destroy.apply(this, arguments);
  97999. }
  98000. /**
  98001. * @private
  98002. * @function Unique.prototype.createThematicFeature
  98003. * @description 创建专题要素。
  98004. * @param {Object} feature - 要素。
  98005. */
  98006. }, {
  98007. key: "createThematicFeature",
  98008. value: function createThematicFeature(feature) {
  98009. var style = this.getStyleByData(feature);
  98010. //创建专题要素时的可选参数
  98011. var options = {};
  98012. options.nodesClipPixel = this.nodesClipPixel;
  98013. options.isHoverAble = this.isHoverAble;
  98014. options.isMultiHover = this.isMultiHover;
  98015. options.isClickAble = this.isClickAble;
  98016. options.highlightStyle = ShapeFactory.transformStyle(this.highlightStyle);
  98017. //将数据转为专题要素(ThemeVector)
  98018. var thematicFeature = new ThemeVector(feature, this, ShapeFactory.transformStyle(style), options);
  98019. //直接添加图形到渲染器
  98020. for (var m = 0; m < thematicFeature.shapes.length; m++) {
  98021. this.renderer.addShape(thematicFeature.shapes[m]);
  98022. }
  98023. return thematicFeature;
  98024. }
  98025. /**
  98026. * @private
  98027. * @function Unique.prototype.getStyleByData
  98028. * @description 根据用户数据(feature)设置专题要素的 Style。
  98029. * @param {Object} fea - 用户要素数据。
  98030. */
  98031. }, {
  98032. key: "getStyleByData",
  98033. value: function getStyleByData(fea) {
  98034. var style = {};
  98035. var feature = fea;
  98036. style = Util_Util.copyAttributesWithClip(style, this.style);
  98037. if (this.themeField && this.styleGroups && this.styleGroups.length > 0 && feature.attributes) {
  98038. var tf = this.themeField;
  98039. var Attrs = feature.attributes;
  98040. var Gro = this.styleGroups;
  98041. var isSfInAttrs = false; //指定的 themeField 是否是 feature 的属性字段之一
  98042. var attr = null; //属性值
  98043. for (var property in Attrs) {
  98044. if (tf === property) {
  98045. isSfInAttrs = true;
  98046. attr = Attrs[property];
  98047. break;
  98048. }
  98049. }
  98050. //判断属性值是否属于styleGroups的某一个范围,以便对获取分组 style
  98051. if (isSfInAttrs) {
  98052. for (var i = 0, len = Gro.length; i < len; i++) {
  98053. if (attr.toString() === Gro[i].value.toString()) {
  98054. //feature.style = CommonUtil.copyAttributes(feature.style, this.defaultStyle);
  98055. var sty1 = Gro[i].style;
  98056. style = Util_Util.copyAttributesWithClip(style, sty1);
  98057. }
  98058. }
  98059. }
  98060. }
  98061. if (feature.style && this.isAllowFeatureStyle === true) {
  98062. style = Util_Util.copyAttributesWithClip(feature.style);
  98063. }
  98064. return style;
  98065. }
  98066. }, {
  98067. key: "canvasFunctionInternal_",
  98068. value: function canvasFunctionInternal_(extent, resolution, pixelRatio, size, projection) {
  98069. // eslint-disable-line no-unused-vars
  98070. return GeoFeature.prototype.canvasFunctionInternal_.apply(this, arguments);
  98071. }
  98072. }]);
  98073. return Unique;
  98074. }(GeoFeature);
  98075. ;// CONCATENATED MODULE: ./src/openlayers/overlay/vectortile/VectorTileStyles.js
  98076. function VectorTileStyles_typeof(obj) { "@babel/helpers - typeof"; return VectorTileStyles_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, VectorTileStyles_typeof(obj); }
  98077. function VectorTileStyles_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  98078. function VectorTileStyles_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  98079. function VectorTileStyles_createClass(Constructor, protoProps, staticProps) { if (protoProps) VectorTileStyles_defineProperties(Constructor.prototype, protoProps); if (staticProps) VectorTileStyles_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  98080. function VectorTileStyles_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) VectorTileStyles_setPrototypeOf(subClass, superClass); }
  98081. function VectorTileStyles_setPrototypeOf(o, p) { VectorTileStyles_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return VectorTileStyles_setPrototypeOf(o, p); }
  98082. function VectorTileStyles_createSuper(Derived) { var hasNativeReflectConstruct = VectorTileStyles_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = VectorTileStyles_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = VectorTileStyles_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return VectorTileStyles_possibleConstructorReturn(this, result); }; }
  98083. function VectorTileStyles_possibleConstructorReturn(self, call) { if (call && (VectorTileStyles_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return VectorTileStyles_assertThisInitialized(self); }
  98084. function VectorTileStyles_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  98085. function VectorTileStyles_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  98086. function VectorTileStyles_getPrototypeOf(o) { VectorTileStyles_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return VectorTileStyles_getPrototypeOf(o); }
  98087. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  98088. * This program are made available under the terms of the Apache License, Version 2.0
  98089. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  98090. /**
  98091. * @class VectorTileStyles
  98092. * @classdesc 矢量瓦片风格。
  98093. * @modulecategory Overlay
  98094. * @category Visualization VectorTile
  98095. * @param {Object} options - 交互时所需可选参数。
  98096. * @extends {ol.Observable}
  98097. * @usage
  98098. */
  98099. var VectorTileStyles = /*#__PURE__*/function (_Observable) {
  98100. VectorTileStyles_inherits(VectorTileStyles, _Observable);
  98101. var _super = VectorTileStyles_createSuper(VectorTileStyles);
  98102. function VectorTileStyles(options) {
  98103. var _this;
  98104. VectorTileStyles_classCallCheck(this, VectorTileStyles);
  98105. _this = _super.call(this);
  98106. if (!options) {
  98107. return VectorTileStyles_possibleConstructorReturn(_this);
  98108. }
  98109. var donotNeedServerCartoCss = false;
  98110. if (options.donotNeedServerCartoCss !== undefined) {
  98111. donotNeedServerCartoCss = options.donotNeedServerCartoCss;
  98112. }
  98113. VectorTileStyles.setDonotNeedServerCartoCss(donotNeedServerCartoCss);
  98114. if (options.view) {
  98115. VectorTileStyles.setView(options.view);
  98116. }
  98117. if (options.url) {
  98118. VectorTileStyles.setUrl(options.url);
  98119. }
  98120. if (options.cartoCss) {
  98121. VectorTileStyles.setCartoCss(options.cartoCss);
  98122. }
  98123. var selectedPointStyle = getDefaultSelectedPointStyle();
  98124. if (options.selectedPointStyle) {
  98125. selectedPointStyle = options.selectedPointStyle;
  98126. }
  98127. VectorTileStyles.setSelectedPointStyle(selectedPointStyle);
  98128. var selectedLineStyle = getDefaultSelectedLineStyle();
  98129. if (options.selectedLineStyle) {
  98130. selectedLineStyle = options.selectedLineStyle;
  98131. }
  98132. VectorTileStyles.setSelectedLineStyle(selectedLineStyle);
  98133. var selectedRegionStyle = getDefaultSelectedRegionStyle();
  98134. if (options.selectedRegionStyle) {
  98135. selectedRegionStyle = options.selectedRegionStyle;
  98136. }
  98137. VectorTileStyles.setSelectedRegionStyle(selectedRegionStyle);
  98138. var selectedTextStyle = getDefaultSelectedTextStyle();
  98139. if (options.selectedTextStyle) {
  98140. selectedTextStyle = options.selectedTextStyle;
  98141. }
  98142. VectorTileStyles.setSelectedTextStyle(selectedTextStyle);
  98143. var layersXHR = new XMLHttpRequest();
  98144. layersXHR.onreadystatechange = function () {
  98145. if (layersXHR.readyState == 4) {
  98146. var result = JSON.parse(layersXHR.responseText);
  98147. var layersInfo = {};
  98148. for (var i = 0, len = result.length; i < len; i++) {
  98149. var layers = result[i].subLayers.layers;
  98150. for (var j = 0, len1 = layers.length; j < len1; j++) {
  98151. layers[j].layerIndex = len1 - j;
  98152. layersInfo[layers[j].name] = layers[j];
  98153. }
  98154. }
  98155. VectorTileStyles.setLayersInfo(layersInfo);
  98156. if (!VectorTileStyles.getDonotNeedServerCartoCss()) {
  98157. var vectorStylesXHR = new XMLHttpRequest();
  98158. vectorStylesXHR.open("GET", Util_Util.urlPathAppend(VectorTileStyles.getUrl(), "tileFeature/vectorstyles.json"), false);
  98159. vectorStylesXHR.onreadystatechange = function () {
  98160. if (vectorStylesXHR.readyState == 4) {
  98161. var vectorStyles = new JSONFormat().read(vectorStylesXHR.responseText);
  98162. var cartoCss;
  98163. if (vectorStyles.style && vectorStyles.type === 'cartoCSS') {
  98164. cartoCss = vectorStyles.style;
  98165. cartoCss = cartoCss.replace(/[@]/gi, "___");
  98166. cartoCss = cartoCss.replace(/\\#/gi, "___");
  98167. //替换一些关键符号
  98168. var cachedLayer = {};
  98169. layersInfo && Object.keys(layersInfo).sort().forEach(function (attr) {
  98170. var newAttr = attr.replace(/[@#\s]/gi, "___");
  98171. var to = attr;
  98172. var keys = Object.keys(cachedLayer);
  98173. for (var index = keys.length; index > -1; index--) {
  98174. if (attr.indexOf(keys[index]) > -1) {
  98175. to = attr.replace(keys[index], cachedLayer[keys[index]]);
  98176. break;
  98177. }
  98178. }
  98179. to = to.replace(/[#]/gi, "\#");
  98180. cachedLayer[attr] = newAttr;
  98181. cartoCss = cartoCss.replace(new RegExp(to, "g"), newAttr);
  98182. });
  98183. cartoCss = cartoCss.replace(/[#]/gi, "\n#");
  98184. //将zoom转化为scale,以免引起混淆
  98185. cartoCss = cartoCss.replace(/\[zoom/gi, "[scale");
  98186. }
  98187. var cartoShadersArray = new CartoCSS(cartoCss).getShaders();
  98188. var cartoShaders = {};
  98189. cartoShadersArray.forEach(function (cartoShader) {
  98190. cartoShaders[cartoShader.elements[0].clean] = cartoShaders[cartoShader.elements[0].clean] || {};
  98191. cartoShaders[cartoShader.elements[0].clean][cartoShader.attachment] = cartoShaders[cartoShader.elements[0].clean][cartoShader.attachment] || [];
  98192. cartoShaders[cartoShader.elements[0].clean][cartoShader.attachment].push(cartoShader);
  98193. return cartoShader;
  98194. });
  98195. VectorTileStyles.setCartoShaders(cartoShaders);
  98196. }
  98197. };
  98198. vectorStylesXHR.send(null);
  98199. }
  98200. if (VectorTileStyles.getCartoCss()) {
  98201. var clientCartoShadersArray = new CartoCSS(VectorTileStyles.getCartoCss()).getShaders();
  98202. var clientCartoShaders = {};
  98203. clientCartoShadersArray.forEach(function (cartoShader) {
  98204. clientCartoShaders[cartoShader.elements[0].clean] = clientCartoShaders[cartoShader.elements[0].clean] || {};
  98205. clientCartoShaders[cartoShader.elements[0].clean][cartoShader.attachment] = clientCartoShaders[cartoShader.elements[0].clean][cartoShader.attachment] || [];
  98206. clientCartoShaders[cartoShader.elements[0].clean][cartoShader.attachment].push(cartoShader);
  98207. return cartoShader;
  98208. });
  98209. VectorTileStyles.setClientCartoShaders(clientCartoShaders);
  98210. }
  98211. }
  98212. };
  98213. layersXHR.open("GET", Util_Util.urlPathAppend(VectorTileStyles.getUrl(), "layers.json"), false);
  98214. layersXHR.send(null);
  98215. _this.on('featureSelected', function (e) {
  98216. VectorTileStyles.setSelectedId(e.selectedId);
  98217. VectorTileStyles.setLayerName(e.layerName);
  98218. });
  98219. /**
  98220. * @function VectorTileStyles.prototype.getDefaultSelectedPointStyle
  98221. * @description 设置默认选择后的点样式。
  98222. */
  98223. function getDefaultSelectedPointStyle() {
  98224. return new (external_ol_style_Style_default())({
  98225. image: new (external_ol_style_Circle_default())({
  98226. radius: 5,
  98227. fill: new (external_ol_style_Fill_default())({
  98228. color: 'blue'
  98229. })
  98230. })
  98231. });
  98232. }
  98233. /**
  98234. * @function VectorTileStyles.prototype.getDefaultSelectedLineStyle
  98235. * @description 设置默认选择后的线样式。
  98236. */
  98237. function getDefaultSelectedLineStyle() {
  98238. return new (external_ol_style_Style_default())({
  98239. stroke: new (external_ol_style_Stroke_default())({
  98240. color: 'blue',
  98241. width: 3
  98242. })
  98243. });
  98244. }
  98245. /**
  98246. * @function VectorTileStyles.prototype.getDefaultSelectedRegionStyle
  98247. * @description 设置默认选择后的面样式。
  98248. */
  98249. function getDefaultSelectedRegionStyle() {
  98250. return new (external_ol_style_Style_default())({
  98251. fill: new (external_ol_style_Fill_default())({
  98252. color: [0, 0, 255, 0.5]
  98253. }),
  98254. stroke: new (external_ol_style_Stroke_default())({
  98255. color: 'blue',
  98256. width: 3
  98257. })
  98258. });
  98259. }
  98260. /**
  98261. * @function VectorTileStyles.prototype.getDefaultSelectedTextStyle
  98262. * @description 设置默认选择后的文本样式。
  98263. */
  98264. function getDefaultSelectedTextStyle() {
  98265. return new (external_ol_style_Style_default())({
  98266. text: new (external_ol_style_Text_default())({
  98267. font: '15px Microsoft YaHei',
  98268. fill: new (external_ol_style_Fill_default())({
  98269. color: 'blue'
  98270. }),
  98271. stroke: new (external_ol_style_Stroke_default())({
  98272. color: 'white',
  98273. width: 1
  98274. })
  98275. })
  98276. });
  98277. }
  98278. return _this;
  98279. }
  98280. /**
  98281. * @function VectorTileStyles.setCartoShaders
  98282. * @description 设置服务端 Carto 的阴影。
  98283. * @param {Array} cartoShaders - 服务端 Carto 阴影。
  98284. */
  98285. VectorTileStyles_createClass(VectorTileStyles, [{
  98286. key: "getFeatureStyle",
  98287. value:
  98288. /**
  98289. * @function VectorTileStyles.prototype.getFeatureStyle
  98290. * @description 获取要素样式。
  98291. * @param {Object} feature - 要素。
  98292. */
  98293. function getFeatureStyle(feature) {
  98294. var selectedStyle;
  98295. var layerName = feature.getProperties().layerName || feature.getProperties().layer;
  98296. var id = feature.getProperties().id || parseInt(feature.getProperties().SmID);
  98297. if (feature.getProperties().type && feature.getProperties().type.toUpperCase() === 'TEXT') {
  98298. selectedStyle = VectorTileStyles.getSelectedStyle(feature.getProperties().type.toUpperCase());
  98299. if (feature.getProperties().texts) {
  98300. selectedStyle.getText().text_ = feature.getProperties().texts[0];
  98301. } else {
  98302. selectedStyle.getText().text_ = "";
  98303. }
  98304. } else {
  98305. selectedStyle = VectorTileStyles.getSelectedStyle(feature.getGeometry().getType().toUpperCase());
  98306. }
  98307. if (selectedStyle) {
  98308. var selectedLayerName = VectorTileStyles.getLayerName();
  98309. var selectedId = VectorTileStyles.getSelectedId();
  98310. if (selectedLayerName === layerName && id === selectedId) {
  98311. return selectedStyle;
  98312. }
  98313. }
  98314. return VectorTileStyles.getStyle(layerName, feature);
  98315. }
  98316. }], [{
  98317. key: "setCartoShaders",
  98318. value: function setCartoShaders(cartoShaders) {
  98319. this.cartoShaders = cartoShaders;
  98320. }
  98321. /**
  98322. * @function VectorTileStyles.getCartoShaders
  98323. * @description 获取服务端 Carto 的阴影。
  98324. */
  98325. }, {
  98326. key: "getCartoShaders",
  98327. value: function getCartoShaders() {
  98328. return this.cartoShaders;
  98329. }
  98330. /**
  98331. * @function VectorTileStyles.setClientCartoShaders
  98332. * @description 设置客户端 Carto 的阴影。
  98333. * @param {Array} clientCartoShaders - 客户端 Carto 阴影。
  98334. */
  98335. }, {
  98336. key: "setClientCartoShaders",
  98337. value: function setClientCartoShaders(clientCartoShaders) {
  98338. this.clientCartoShaders = clientCartoShaders;
  98339. }
  98340. /**
  98341. * @function VectorTileStyles.getClientCartoShaders
  98342. * @description 获取客户端 Carto 的阴影。
  98343. */
  98344. }, {
  98345. key: "getClientCartoShaders",
  98346. value: function getClientCartoShaders() {
  98347. return this.clientCartoShaders;
  98348. }
  98349. /**
  98350. * @function VectorTileStyles.setCartoCss
  98351. * @description 设置 CartoCSS 的样式。
  98352. * @param {Object} cartoCss - CartoCSS 的样式。
  98353. */
  98354. }, {
  98355. key: "setCartoCss",
  98356. value: function setCartoCss(cartoCss) {
  98357. this.cartoCss = cartoCss;
  98358. }
  98359. /**
  98360. * @function VectorTileStyles.getCartoCss
  98361. * @description 获取 CartoCSS 的样式。
  98362. */
  98363. }, {
  98364. key: "getCartoCss",
  98365. value: function getCartoCss() {
  98366. return this.cartoCss;
  98367. }
  98368. /**
  98369. * @function VectorTileStyles.setDonotNeedServerCartoCss
  98370. * @description 设置是否需要 CartoCss 服务。
  98371. * @param {Object} donotNeedServerCartoCss - 是否需要 CartoCss 服务。
  98372. */
  98373. }, {
  98374. key: "setDonotNeedServerCartoCss",
  98375. value: function setDonotNeedServerCartoCss(donotNeedServerCartoCss) {
  98376. this.donotNeedServerCartoCss = donotNeedServerCartoCss;
  98377. }
  98378. /**
  98379. * @function VectorTileStyles.getDonotNeedServerCartoCss
  98380. * @description 获取是否需要 CartoCss 服务。
  98381. */
  98382. }, {
  98383. key: "getDonotNeedServerCartoCss",
  98384. value: function getDonotNeedServerCartoCss() {
  98385. return this.donotNeedServerCartoCss;
  98386. }
  98387. /**
  98388. * @function VectorTileStyles.setLayersInfo
  98389. * @description 设置图层信息服务。
  98390. * @param {Object} layersInfo - 图层信息。
  98391. */
  98392. }, {
  98393. key: "setLayersInfo",
  98394. value: function setLayersInfo(layersInfo) {
  98395. this.layersInfo = layersInfo;
  98396. }
  98397. /**
  98398. * @function VectorTileStyles.getLayersInfo
  98399. * @description 获取图层信息服务。
  98400. */
  98401. }, {
  98402. key: "getLayersInfo",
  98403. value: function getLayersInfo() {
  98404. return this.layersInfo;
  98405. }
  98406. /**
  98407. * @function VectorTileStyles.setUrl
  98408. * @description 设置地址。
  98409. * @param {string} url - 地址。
  98410. */
  98411. }, {
  98412. key: "setUrl",
  98413. value: function setUrl(url) {
  98414. this.url = url;
  98415. }
  98416. /**
  98417. * @function VectorTileStyles.getUrl
  98418. * @description 获取地址。
  98419. */
  98420. }, {
  98421. key: "getUrl",
  98422. value: function getUrl() {
  98423. return this.url;
  98424. }
  98425. /**
  98426. * @function VectorTileStyles.setView
  98427. * @description 设置视图。
  98428. * @param {Object} view - 视图。
  98429. */
  98430. }, {
  98431. key: "setView",
  98432. value: function setView(view) {
  98433. this.view = view;
  98434. }
  98435. /**
  98436. * @function VectorTileStyles.getView
  98437. * @description 获取视图。
  98438. */
  98439. }, {
  98440. key: "getView",
  98441. value: function getView() {
  98442. return this.view;
  98443. }
  98444. /**
  98445. * @function VectorTileStyles.setSelectedId
  98446. * @description 设置选择序号。
  98447. * @param {number} selectedId - 选择序号。
  98448. */
  98449. }, {
  98450. key: "setSelectedId",
  98451. value: function setSelectedId(selectedId) {
  98452. this.selectedId = selectedId;
  98453. }
  98454. /**
  98455. * @function VectorTileStyles.getSelectedId
  98456. * @description 获取选择序号。
  98457. */
  98458. }, {
  98459. key: "getSelectedId",
  98460. value: function getSelectedId() {
  98461. return this.selectedId;
  98462. }
  98463. /**
  98464. * @function VectorTileStyles.setLayerName
  98465. * @description 设置图层名称。
  98466. * @param {string} layerName - 图层名称。
  98467. */
  98468. }, {
  98469. key: "setLayerName",
  98470. value: function setLayerName(layerName) {
  98471. this.layerName = layerName;
  98472. }
  98473. /**
  98474. * @function VectorTileStyles.getLayerName
  98475. * @description 获取图层名称。
  98476. */
  98477. }, {
  98478. key: "getLayerName",
  98479. value: function getLayerName() {
  98480. return this.layerName;
  98481. }
  98482. /**
  98483. * @function VectorTileStyles.setSelectedPointStyle
  98484. * @description 设置选择后点样式。
  98485. * @param {Object} selectedPointStyle - 选择后点样式。
  98486. */
  98487. }, {
  98488. key: "setSelectedPointStyle",
  98489. value: function setSelectedPointStyle(selectedPointStyle) {
  98490. this.selectedPointStyle = selectedPointStyle;
  98491. }
  98492. /**
  98493. * @function VectorTileStyles.setSelectedLineStyle
  98494. * @description 设置选择后线样式。
  98495. * @param {Object} selectedLineStyle - 选择后线样式。
  98496. */
  98497. }, {
  98498. key: "setSelectedLineStyle",
  98499. value: function setSelectedLineStyle(selectedLineStyle) {
  98500. this.selectedLineStyle = selectedLineStyle;
  98501. }
  98502. /**
  98503. * @function VectorTileStyles.setSelectedRegionStyle
  98504. * @description 设置选择后面样式。
  98505. * @param {Object} selectedRegionStyle - 选择后面样式。
  98506. */
  98507. }, {
  98508. key: "setSelectedRegionStyle",
  98509. value: function setSelectedRegionStyle(selectedRegionStyle) {
  98510. this.selectedRegionStyle = selectedRegionStyle;
  98511. }
  98512. /**
  98513. * @function VectorTileStyles.setSelectedTextStyle
  98514. * @description 设置选择后文本样式。
  98515. * @param {Object} selectedTextStyle - 选择后文本样式。
  98516. */
  98517. }, {
  98518. key: "setSelectedTextStyle",
  98519. value: function setSelectedTextStyle(selectedTextStyle) {
  98520. this.selectedTextStyle = selectedTextStyle;
  98521. }
  98522. /**
  98523. * @function VectorTileStyles.getSelectedStyle
  98524. * @description 设置选择后的样式。
  98525. * @param {string} type - 选择后的样式。
  98526. */
  98527. }, {
  98528. key: "getSelectedStyle",
  98529. value: function getSelectedStyle(type) {
  98530. if (type === 'POINT' || type === 'MULTIPOINT') {
  98531. return this.selectedPointStyle;
  98532. }
  98533. if (type === 'LINESTRING' || type === 'MULTILINESTRING') {
  98534. return this.selectedLineStyle;
  98535. }
  98536. if (type === 'POLYGON' || type === 'MULTIPOLYGON') {
  98537. return this.selectedRegionStyle;
  98538. }
  98539. if (type === 'TEXT') {
  98540. return this.selectedTextStyle;
  98541. }
  98542. }
  98543. /**
  98544. * @function VectorTileStyles.getLayerInfo
  98545. * @description 获取图层的信息。
  98546. * @param {string} layerName - 图层名。
  98547. */
  98548. }, {
  98549. key: "getLayerInfo",
  98550. value: function getLayerInfo(layerName) {
  98551. var layersInfo = VectorTileStyles.getLayersInfo();
  98552. if (layersInfo === undefined) {
  98553. return null;
  98554. }
  98555. var layerInfo = layersInfo[layerName];
  98556. if (!layerInfo) {
  98557. return null;
  98558. }
  98559. var layerInfo_simple = {
  98560. layerIndex: layerInfo.layerIndex,
  98561. ugcLayerType: layerInfo.ugcLayerType
  98562. };
  98563. switch (layerInfo.ugcLayerType) {
  98564. case "VECTOR":
  98565. layerInfo_simple.layerStyle = layerInfo.style ? layerInfo.style : null;
  98566. break;
  98567. case "THEME":
  98568. var theme = layerInfo.theme;
  98569. layerInfo_simple.layerStyle = theme ? theme.defaultStyle : null;
  98570. if (theme && theme.type === "LABEL") {
  98571. layerInfo_simple.type = theme.type;
  98572. layerInfo_simple.textField = theme.labelExpression;
  98573. }
  98574. break;
  98575. default:
  98576. //SVTile发布出来的地图没有ugcLayerType属性
  98577. if (layerInfo.style) {
  98578. layerInfo_simple.layerStyle = layerInfo.style;
  98579. }
  98580. break;
  98581. }
  98582. return layerInfo_simple;
  98583. }
  98584. /**
  98585. * @function VectorTileStyles.getStyle
  98586. * @description 获取样式。
  98587. * @param {string} originalLayerName - 原始图层信息。
  98588. * @param {Object} feature - 要素对象。
  98589. */
  98590. }, {
  98591. key: "getStyle",
  98592. value: function getStyle(originalLayerName, feature) {
  98593. var url = VectorTileStyles.getUrl(),
  98594. view = VectorTileStyles.getView(),
  98595. zoom = view.getZoom(),
  98596. dpi = 96,
  98597. scale = core_Util_Util.resolutionToScale(view.getResolution(), dpi, Unit.METER),
  98598. layerName = originalLayerName.replace(/(@)/gi, '___').replace(/(#)/gi, '___');
  98599. // feature对象样式的配置遵循以下优先级:
  98600. // 客户端CartoCSS > 服务器端CartoCSS > 服务器端layer样式 > 客户端默认样式。
  98601. if (VectorTileStyles.getCartoCss() && VectorTileStyles.getClientCartoShaders()[layerName]) {
  98602. return getStyleArray(VectorTileStyles.getClientCartoShaders()[layerName]);
  98603. }
  98604. var layerInfo = VectorTileStyles.getLayerInfo(originalLayerName);
  98605. if (!VectorTileStyles.getDonotNeedServerCartoCss() && VectorTileStyles.getCartoShaders()[layerName]) {
  98606. //如果是文本,这里特殊处理。
  98607. if (feature.getProperties().textStyle || feature.getProperties().TEXT_FEATURE_CONTENT || layerInfo.type == 'LABEL' && layerInfo.textField) {
  98608. var featureStyle = StyleUtils.getValidStyleFromLayerInfo(layerInfo, feature, url);
  98609. if (feature.getGeometry().getType().toUpperCase() === "POINT") {
  98610. featureStyle = mergeTextFeatureStyle(layerInfo, feature, url);
  98611. }
  98612. return featureStyle;
  98613. }
  98614. return getStyleArray(VectorTileStyles.getCartoShaders()[layerName]);
  98615. }
  98616. if (layerInfo) {
  98617. return StyleUtils.getValidStyleFromLayerInfo(layerInfo, feature, url);
  98618. }
  98619. function getStyleArray(shaderAttachment) {
  98620. var styleArray = [];
  98621. for (var j in shaderAttachment) {
  98622. shaderAttachment[j].map(function (shader) {
  98623. styleArray.push(StyleUtils.getStyleFromCarto(zoom, scale, shader, feature, true, url));
  98624. return shader;
  98625. });
  98626. }
  98627. return styleArray;
  98628. }
  98629. /**
  98630. * @function VectorTileStyles.prototype.mergeTextFeatureStyle
  98631. * @description 合并文本要素样式。
  98632. * @param {string} layerInfo - 图层信息。
  98633. * @param {Object} feature - 获取的要素。
  98634. * @param {string} url - 服务地址。
  98635. */
  98636. function mergeTextFeatureStyle(layerInfo, feature, url) {
  98637. var textFeatureStyle = StyleUtils.getValidStyleFromLayerInfo(layerInfo, feature, url);
  98638. if (layerInfo.type == 'LABEL') {
  98639. feature.setProperties({
  98640. type: "TEXT"
  98641. });
  98642. var cartoTextStyles = getStyleArray(VectorTileStyles.getCartoShaders()[layerName]);
  98643. var textStyle = textFeatureStyle.getText();
  98644. for (var i = 0; i < cartoTextStyles.length; i++) {
  98645. if (!textStyle) {
  98646. textStyle = cartoTextStyles[i].getText();
  98647. } else {
  98648. textStyle.setText(cartoTextStyles[i].getText().getText());
  98649. }
  98650. }
  98651. textFeatureStyle.setText(textStyle);
  98652. return textFeatureStyle;
  98653. }
  98654. return textFeatureStyle;
  98655. }
  98656. }
  98657. }]);
  98658. return VectorTileStyles;
  98659. }((external_ol_Observable_default()));
  98660. ;// CONCATENATED MODULE: external "ol.source.VectorTile"
  98661. var external_ol_source_VectorTile_namespaceObject = ol.source.VectorTile;
  98662. var external_ol_source_VectorTile_default = /*#__PURE__*/__webpack_require__.n(external_ol_source_VectorTile_namespaceObject);
  98663. ;// CONCATENATED MODULE: external "ol.format.MVT"
  98664. var external_ol_format_MVT_namespaceObject = ol.format.MVT;
  98665. var external_ol_format_MVT_default = /*#__PURE__*/__webpack_require__.n(external_ol_format_MVT_namespaceObject);
  98666. ;// CONCATENATED MODULE: ./src/openlayers/overlay/VectorTileSuperMapRest.js
  98667. function VectorTileSuperMapRest_typeof(obj) { "@babel/helpers - typeof"; return VectorTileSuperMapRest_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, VectorTileSuperMapRest_typeof(obj); }
  98668. function VectorTileSuperMapRest_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  98669. function VectorTileSuperMapRest_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  98670. function VectorTileSuperMapRest_createClass(Constructor, protoProps, staticProps) { if (protoProps) VectorTileSuperMapRest_defineProperties(Constructor.prototype, protoProps); if (staticProps) VectorTileSuperMapRest_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  98671. function VectorTileSuperMapRest_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) VectorTileSuperMapRest_setPrototypeOf(subClass, superClass); }
  98672. function VectorTileSuperMapRest_setPrototypeOf(o, p) { VectorTileSuperMapRest_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return VectorTileSuperMapRest_setPrototypeOf(o, p); }
  98673. function VectorTileSuperMapRest_createSuper(Derived) { var hasNativeReflectConstruct = VectorTileSuperMapRest_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = VectorTileSuperMapRest_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = VectorTileSuperMapRest_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return VectorTileSuperMapRest_possibleConstructorReturn(this, result); }; }
  98674. function VectorTileSuperMapRest_possibleConstructorReturn(self, call) { if (call && (VectorTileSuperMapRest_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return VectorTileSuperMapRest_assertThisInitialized(self); }
  98675. function VectorTileSuperMapRest_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  98676. function VectorTileSuperMapRest_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  98677. function VectorTileSuperMapRest_getPrototypeOf(o) { VectorTileSuperMapRest_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return VectorTileSuperMapRest_getPrototypeOf(o); }
  98678. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  98679. * This program are made available under the terms of the Apache License, Version 2.0
  98680. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  98681. /**
  98682. * @class VectorTileSuperMapRest
  98683. * @browsernamespace ol.source
  98684. * @category Visualization VectorTile
  98685. * @classdesc 矢量瓦片图层源。
  98686. * @modulecategory Overlay
  98687. * @param {Object} options - 参数。
  98688. * @param {(string|undefined)} options.url - 服务地址。
  98689. * @param {(string|Object|undefined)} options.style - Mapbox Style JSON 对象或获取 Mapbox Style JSON 对象的 URL。当 `options.format` 为 {@link ol.format.MVT} 且 `options.source` 不为空时有效,优先级高于 `options.url`。
  98690. * @param {(string|undefined)} options.source - Mapbox Style JSON 对象中的source名称。当 `options.style` 设置时有效。当不配置时,默认为 Mapbox Style JSON 的 `sources` 对象中的第一个。
  98691. * @param {(string|Object)} [options.attributions='Tile Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>'] - 版权信息。
  98692. * @param {Object} [options.format] - 瓦片的要素格式化。
  98693. * @param {boolean} [options.withCredentials] - 请求是否携带 cookie。
  98694. * @extends {ol.source.VectorTile}
  98695. * @usage
  98696. */
  98697. var VectorTileSuperMapRest = /*#__PURE__*/function (_VectorTile) {
  98698. VectorTileSuperMapRest_inherits(VectorTileSuperMapRest, _VectorTile);
  98699. var _super = VectorTileSuperMapRest_createSuper(VectorTileSuperMapRest);
  98700. function VectorTileSuperMapRest(options) {
  98701. var _this;
  98702. VectorTileSuperMapRest_classCallCheck(this, VectorTileSuperMapRest);
  98703. if (options.url === undefined && options.style === undefined) {
  98704. console.error("one of 'options.style' or 'options.style' is required");
  98705. }
  98706. var zRegEx = /\{z\}/g;
  98707. var xRegEx = /\{x\}/g;
  98708. var yRegEx = /\{y\}/g;
  98709. var dashYRegEx = /\{-y\}/g;
  98710. options.attributions = options.attributions || "Tile Data <span>© SuperMap iServer</span> with <span>© SuperMap iClient</span>";
  98711. if (['4', '5'].indexOf(core_Util_Util.getOlVersion()) < 0) {
  98712. options.tileSize = options.format instanceof (external_ol_format_MVT_default()) && options.style ? 512 : 256;
  98713. }
  98714. _this = _super.call(this, {
  98715. attributions: options.attributions,
  98716. cacheSize: options.cacheSize,
  98717. format: options.format || new (external_ol_format_GeoJSON_default())(),
  98718. logo: core_Util_Util.getOlVersion() === '4' ? options.logo : null,
  98719. overlaps: options.overlaps,
  98720. projection: options.projection,
  98721. state: options.format instanceof (external_ol_format_MVT_default()) && options.style && Object.prototype.toString.call(options.style) == '[object String]' ? 'loading' : options.state,
  98722. tileClass: options.tileClass,
  98723. tileGrid: options.tileGrid,
  98724. tilePixelRatio: options.tilePixelRatio,
  98725. tileUrlFunction: options.tileUrlFunction || (options.format instanceof (external_ol_format_MVT_default()) && options.style ? zxyTileUrlFunction : tileUrlFunction),
  98726. tileLoadFunction: options.tileLoadFunction || (options.format instanceof (external_ol_format_MVT_default()) ? mvtTileLoadFunction : tileLoadFunction),
  98727. wrapX: options.wrapX !== undefined ? options.wrapX : false,
  98728. tileSize: options.tileSize || null,
  98729. zDirection: ['4', '5'].indexOf(core_Util_Util.getOlVersion()) > -1 ? null : 0
  98730. });
  98731. var me = VectorTileSuperMapRest_assertThisInitialized(_this);
  98732. me.withCredentials = options.withCredentials;
  98733. me._tileType = options.tileType || 'ScaleXY';
  98734. _this.vectorTileStyles = new VectorTileStyles();
  98735. if (options.format instanceof (external_ol_format_MVT_default()) && options.style) {
  98736. if (Object.prototype.toString.call(options.style) == '[object String]') {
  98737. var url = SecurityManager.appendCredential(options.style);
  98738. FetchRequest.get(url, null, {
  98739. withCredentials: options.withCredentials
  98740. }).then(function (response) {
  98741. return response.json();
  98742. }).then(function (mbStyle) {
  98743. _this._fillByStyleJSON(mbStyle, options.source);
  98744. _this.setState('ready');
  98745. });
  98746. } else {
  98747. _this._fillByStyleJSON(options.style, options.source);
  98748. }
  98749. } else {
  98750. _this._fillByRestMapOptions(options.url, options);
  98751. }
  98752. function tileUrlFunction(tileCoord, pixelRatio, projection) {
  98753. if (!me.tileGrid) {
  98754. me.tileGrid = me.getTileGridForProjection(projection);
  98755. }
  98756. var z = tileCoord[0];
  98757. var x = tileCoord[1];
  98758. var y = ['4', '5'].indexOf(core_Util_Util.getOlVersion()) > -1 ? -tileCoord[2] - 1 : tileCoord[2];
  98759. var tileSize = external_ol_size_namespaceObject.toSize(me.tileGrid.getTileSize(z, me.tmpSize));
  98760. var params = '';
  98761. if (me.tileType === 'ZXY') {
  98762. params = '&width=' + tileSize[0] + '&height=' + tileSize[1] + '&x=' + x + '&y=' + y + '&z=' + z;
  98763. } else if (me.tileType === 'ViewBounds') {
  98764. var tileExtent = me.tileGrid.getTileCoordExtent(tileCoord);
  98765. params = '&width=' + tileSize[0] + '&height=' + tileSize[1] + '&viewBounds=' + tileExtent[0] + ',' + tileExtent[1] + ',' + tileExtent[2] + ',' + tileExtent[3];
  98766. } else {
  98767. var origin = me.tileGrid.getOrigin(z);
  98768. var resolution = me.tileGrid.getResolution(z);
  98769. var dpi = 96;
  98770. var unit = projection.getUnits() || 'degrees';
  98771. if (unit === 'degrees') {
  98772. unit = Unit.DEGREE;
  98773. }
  98774. if (unit === 'm') {
  98775. unit = Unit.METER;
  98776. }
  98777. var scale = core_Util_Util.resolutionToScale(resolution, dpi, unit);
  98778. params = '&x=' + x + '&y=' + y + '&width=' + tileSize[0] + '&height=' + tileSize[1] + '&scale=' + scale + "&origin={'x':" + origin[0] + ",'y':" + origin[1] + '}';
  98779. }
  98780. return me._tileUrl + encodeURI(params);
  98781. }
  98782. function zxyTileUrlFunction(tileCoord) {
  98783. if (!tileCoord) {
  98784. return undefined;
  98785. } else {
  98786. return me._tileUrl.replace(zRegEx, tileCoord[0].toString()).replace(xRegEx, tileCoord[1].toString()).replace(yRegEx, function () {
  98787. var y = ['4', '5'].indexOf(core_Util_Util.getOlVersion()) > -1 ? -tileCoord[2] - 1 : tileCoord[2];
  98788. return y.toString();
  98789. }).replace(dashYRegEx, function () {
  98790. var z = tileCoord[0];
  98791. var range = me.tileGrid.getFullTileRange(z);
  98792. var y = range.getHeight() + tileCoord[2];
  98793. return y.toString();
  98794. });
  98795. }
  98796. }
  98797. /**
  98798. * @private
  98799. * @function VectorTileSuperMapRest.prototype.tileLoadFunction
  98800. * @description 加载瓦片。
  98801. * @param {Object} tile -瓦片类。
  98802. * @param {string} tileUrl - 瓦片地址。
  98803. */
  98804. function tileLoadFunction(tile, tileUrl) {
  98805. var regWidth = new RegExp('(^|\\?|&)' + 'width' + '=([^&]*)(\\s|&|$)');
  98806. var regHeight = new RegExp('(^|\\?|&)' + 'height' + '=([^&]*)(\\s|&|$)');
  98807. var width = Number(tileUrl.match(regWidth)[2]);
  98808. var height = Number(tileUrl.match(regHeight)[2]);
  98809. tile.setLoader(function (extent, resolution, projection) {
  98810. FetchRequest.get(tileUrl).then(function (response) {
  98811. if (tile.getFormat() instanceof (external_ol_format_GeoJSON_default())) {
  98812. return response.json();
  98813. }
  98814. }).then(function (tileFeatureJson) {
  98815. var features = [];
  98816. if (tile.getFormat() instanceof (external_ol_format_GeoJSON_default())) {
  98817. tileFeatureJson.recordsets.map(function (recordset) {
  98818. recordset.features.map(function (feature) {
  98819. var points = [];
  98820. var startIndex = 0;
  98821. for (var i = 0; i < feature.geometry.parts.length; i++) {
  98822. var partPointsLength = feature.geometry.parts[i] * 2;
  98823. for (var j = 0, index = startIndex; j < partPointsLength; j += 2, index += 2) {
  98824. points.push(new Point(feature.geometry.points[index], feature.geometry.points[index + 1]));
  98825. }
  98826. startIndex += partPointsLength;
  98827. }
  98828. feature.geometry.points = points;
  98829. return feature;
  98830. });
  98831. return recordset;
  98832. });
  98833. tileFeatureJson.recordsets.map(function (recordset) {
  98834. recordset.features.map(function (feature) {
  98835. feature.layerName = recordset.layerName;
  98836. feature.type = feature.geometry.type;
  98837. features.push(feature);
  98838. return feature;
  98839. });
  98840. return recordset;
  98841. });
  98842. var dataProjection = new (external_ol_proj_Projection_default())({
  98843. extent: [0, 0, 256, 256],
  98844. code: 'TILE_PIXELS',
  98845. units: 'tile-pixels'
  98846. });
  98847. if (['4', '5'].indexOf(core_Util_Util.getOlVersion()) > -1) {
  98848. tile.setExtent([0, 0, width, height]);
  98849. tile.setProjection(dataProjection);
  98850. features = tile.getFormat().readFeatures(core_Util_Util.toGeoJSON(features));
  98851. } else {
  98852. features = tile.getFormat().readFeatures(core_Util_Util.toGeoJSON(features), {
  98853. extent: extent,
  98854. dataProjection: dataProjection,
  98855. featureProjection: projection
  98856. });
  98857. }
  98858. tile.setFeatures(features);
  98859. }
  98860. });
  98861. });
  98862. }
  98863. /**
  98864. * @private
  98865. * @function VectorTileSuperMapRest.prototype.tileLoadFunction
  98866. * @description 加载瓦片。
  98867. * @param {Object} tile -瓦片类。
  98868. * @param {string} tileUrl - 瓦片地址。
  98869. */
  98870. function mvtTileLoadFunction(tile, tileUrl) {
  98871. var format = tile.getFormat();
  98872. var success = tile.onLoad.bind(tile);
  98873. var failure = tile.onError.bind(tile);
  98874. tile.setLoader(function (extent, resolution, projection) {
  98875. var xhr = new XMLHttpRequest();
  98876. xhr.open('GET', typeof tileUrl === 'function' ? tileUrl(extent, resolution, projection) : tileUrl, true);
  98877. if (format.getType() == 'arraybuffer') {
  98878. xhr.responseType = 'arraybuffer';
  98879. }
  98880. xhr.withCredentials = me.withCredentials;
  98881. xhr.onload = function () {
  98882. if (!xhr.status || xhr.status >= 200 && xhr.status < 300) {
  98883. var type = format.getType();
  98884. var source = void 0;
  98885. if (type === 'json' || type === 'text') {
  98886. source = xhr.responseText;
  98887. } else if (type === 'xml') {
  98888. source = xhr.responseXML;
  98889. if (!source) {
  98890. source = new DOMParser().parseFromString(xhr.responseText, 'application/xml');
  98891. }
  98892. } else if (type === 'arraybuffer') {
  98893. source = xhr.response;
  98894. }
  98895. if (source) {
  98896. if (['4', '5'].indexOf(core_Util_Util.getOlVersion()) > -1) {
  98897. success.call(this, format.readFeatures(source, {
  98898. featureProjection: projection
  98899. }), format.readProjection(source), format.getLastExtent());
  98900. } else {
  98901. success.call(this, format.readFeatures(source, {
  98902. extent: extent,
  98903. featureProjection: projection
  98904. }), format.readProjection(source));
  98905. }
  98906. } else {
  98907. failure.call(this);
  98908. }
  98909. } else {
  98910. failure.call(this);
  98911. }
  98912. }.bind(this);
  98913. xhr.onerror = function () {
  98914. failure.call(this);
  98915. }.bind(this);
  98916. xhr.send();
  98917. });
  98918. }
  98919. return _this;
  98920. }
  98921. VectorTileSuperMapRest_createClass(VectorTileSuperMapRest, [{
  98922. key: "_fillByStyleJSON",
  98923. value: function _fillByStyleJSON(style, source) {
  98924. if (!source) {
  98925. source = Object.keys(style.sources)[0];
  98926. }
  98927. if (style.sources && style.sources[source]) {
  98928. //ToDo 支持多个tiles地址
  98929. this._tileUrl = SecurityManager.appendCredential(style.sources[source].tiles[0]);
  98930. }
  98931. if (style.metadata && style.metadata.indexbounds) {
  98932. var indexbounds = style.metadata.indexbounds;
  98933. var max = Math.max(indexbounds[2] - indexbounds[0], indexbounds[3] - indexbounds[1]);
  98934. var defaultResolutions = [];
  98935. for (var index = 0; index < 30; index++) {
  98936. defaultResolutions.push(max / 512 / Math.pow(2, index));
  98937. }
  98938. this.tileGrid = new (external_ol_tilegrid_TileGrid_default())({
  98939. extent: style.metadata.indexbounds,
  98940. resolutions: defaultResolutions,
  98941. tileSize: [512, 512]
  98942. });
  98943. }
  98944. }
  98945. }, {
  98946. key: "_fillByRestMapOptions",
  98947. value: function _fillByRestMapOptions(url, options) {
  98948. this._tileUrl = Util_Util.urlPathAppend(options.url, 'tileFeature.json');
  98949. if (options.format instanceof (external_ol_format_MVT_default())) {
  98950. this._tileUrl = Util_Util.urlPathAppend(options.url, 'tileFeature.mvt');
  98951. }
  98952. //为url添加安全认证信息片段
  98953. this._tileUrl = SecurityManager.appendCredential(this._tileUrl);
  98954. var returnAttributes = true;
  98955. if (options.returnAttributes !== undefined) {
  98956. returnAttributes = options.returnAttributes;
  98957. }
  98958. var params = {};
  98959. params['returnAttributes'] = returnAttributes;
  98960. if (options._cache !== undefined) {
  98961. params['_cache'] = options._cache;
  98962. }
  98963. if (options.layersID !== undefined) {
  98964. params['layersID'] = options.layersID;
  98965. }
  98966. if (options.layerNames !== undefined) {
  98967. params['layerNames'] = options.layerNames;
  98968. }
  98969. if (options.expands !== undefined) {
  98970. params['expands'] = options.expands;
  98971. }
  98972. if (options.compressTolerance !== undefined) {
  98973. params['compressTolerance'] = options.compressTolerance;
  98974. }
  98975. if (options.coordinateType !== undefined) {
  98976. params['coordinateType'] = options.coordinateType;
  98977. }
  98978. if (options.returnCutEdges !== undefined) {
  98979. params['returnCutEdges'] = options.returnCutEdges;
  98980. }
  98981. this._tileUrl = Util_Util.urlAppend(this._tileUrl, Util_Util.getParameterString(params));
  98982. }
  98983. /**
  98984. * @function VectorTileSuperMapRest.optionsFromMapJSON
  98985. * @param {string} url - 地址。
  98986. * @param {Object} mapJSONObj - 地图 JSON。
  98987. * @description 获取地图 JSON 信息。
  98988. */
  98989. }], [{
  98990. key: "optionsFromMapJSON",
  98991. value: function optionsFromMapJSON(url, mapJSONObj) {
  98992. var options = {};
  98993. options.url = url;
  98994. options.crossOrigin = 'anonymous';
  98995. var extent = [mapJSONObj.bounds.left, mapJSONObj.bounds.bottom, mapJSONObj.bounds.right, mapJSONObj.bounds.top];
  98996. var resolutions = getResolutions();
  98997. function getResolutions() {
  98998. var level = 17;
  98999. var dpi = 96;
  99000. var width = extent[2] - extent[0];
  99001. var height = extent[3] - extent[1];
  99002. var tileSize = width >= height ? width : height;
  99003. var maxReolution;
  99004. if (tileSize === width) {
  99005. maxReolution = tileSize / mapJSONObj.viewer.width;
  99006. } else {
  99007. maxReolution = tileSize / mapJSONObj.viewer.height;
  99008. }
  99009. var resolutions = [];
  99010. var unit = Unit.METER;
  99011. if (mapJSONObj.coordUnit === Unit.DEGREE) {
  99012. unit = Unit.DEGREE;
  99013. }
  99014. if (mapJSONObj.visibleScales.length > 0) {
  99015. var scales = initScales(mapJSONObj);
  99016. for (var i = 0; i < scales.length; i++) {
  99017. resolutions.push(core_Util_Util.scaleToResolution(scales[i], dpi, unit));
  99018. }
  99019. } else {
  99020. for (var _i2 = 0; _i2 < level; _i2++) {
  99021. resolutions.push(maxReolution / Math.pow(2, _i2));
  99022. }
  99023. }
  99024. return resolutions;
  99025. }
  99026. function initScales(mapJSONObj) {
  99027. var scales = mapJSONObj.visibleScales;
  99028. if (!scales) {
  99029. return null;
  99030. }
  99031. var viewBounds = mapJSONObj.viewBounds,
  99032. coordUnit = mapJSONObj.coordUnit,
  99033. viewer = mapJSONObj.viewer,
  99034. scale = mapJSONObj.scale,
  99035. datumAxis = mapJSONObj.datumAxis;
  99036. //将jsonObject转化为SuperMap.Bounds,用于计算dpi。
  99037. viewBounds = new Bounds(viewBounds.left, viewBounds.bottom, viewBounds.right, viewBounds.top);
  99038. viewer = new Size(viewer.rightBottom.x, viewer.rightBottom.y);
  99039. coordUnit = coordUnit.toLowerCase();
  99040. datumAxis = datumAxis || 6378137;
  99041. var units = coordUnit;
  99042. var dpi = Util_Util.calculateDpi(viewBounds, viewer, scale, units, datumAxis);
  99043. var resolutions = _resolutionsFromScales(scales);
  99044. var len = resolutions.length;
  99045. scales = [len];
  99046. for (var i = 0; i < len; i++) {
  99047. scales[i] = Util_Util.getScaleFromResolutionDpi(resolutions[i], dpi, units, datumAxis);
  99048. }
  99049. function _resolutionsFromScales(scales) {
  99050. if (scales === null) {
  99051. return;
  99052. }
  99053. var resolutions, len;
  99054. len = scales.length;
  99055. resolutions = [len];
  99056. for (var i = 0; i < len; i++) {
  99057. resolutions[i] = Util_Util.getResolutionFromScaleDpi(scales[i], dpi, units, datumAxis);
  99058. }
  99059. return resolutions;
  99060. }
  99061. return scales;
  99062. }
  99063. options.tileGrid = new (external_ol_tilegrid_TileGrid_default())({
  99064. extent: extent,
  99065. resolutions: resolutions
  99066. });
  99067. //options.projection = 'EPSG:' + mapJSONObj.prjCoordSys.epsgCode;
  99068. return options;
  99069. }
  99070. }]);
  99071. return VectorTileSuperMapRest;
  99072. }((external_ol_source_VectorTile_default()));
  99073. ;// CONCATENATED MODULE: ./src/openlayers/overlay/HeatMap.js
  99074. function HeatMap_typeof(obj) { "@babel/helpers - typeof"; return HeatMap_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, HeatMap_typeof(obj); }
  99075. function HeatMap_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  99076. function HeatMap_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  99077. function HeatMap_createClass(Constructor, protoProps, staticProps) { if (protoProps) HeatMap_defineProperties(Constructor.prototype, protoProps); if (staticProps) HeatMap_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  99078. function HeatMap_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) HeatMap_setPrototypeOf(subClass, superClass); }
  99079. function HeatMap_setPrototypeOf(o, p) { HeatMap_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return HeatMap_setPrototypeOf(o, p); }
  99080. function HeatMap_createSuper(Derived) { var hasNativeReflectConstruct = HeatMap_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = HeatMap_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = HeatMap_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return HeatMap_possibleConstructorReturn(this, result); }; }
  99081. function HeatMap_possibleConstructorReturn(self, call) { if (call && (HeatMap_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return HeatMap_assertThisInitialized(self); }
  99082. function HeatMap_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  99083. function HeatMap_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  99084. function HeatMap_getPrototypeOf(o) { HeatMap_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return HeatMap_getPrototypeOf(o); }
  99085. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  99086. * This program are made available under the terms of the Apache License, Version 2.0
  99087. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  99088. /**
  99089. * @class HeatMap
  99090. * @browsernamespace ol.source
  99091. * @classdesc 热力图层类。
  99092. * @modulecategory Overlay
  99093. * @category Visualization HeatMap
  99094. * @param {string} name - 图层名称。
  99095. * @param {Object} options - 参数。
  99096. * @param {ol.Map} options.map - openlayers 的 map 对象。
  99097. * @param {string} [options.id] - 专题图层 ID,默认使用 CommonUtil.createUniqueID("HeatMapSource_") 创建专题图层 ID。
  99098. * @param {string} [options.featureWeight] - 对应 feature 属性中的热点权重字段名称,权重值类型为 number。
  99099. * @param {number} [options.radius=50] - 热点渲染的最大半径(热点像素半径),单位为 px,当 useGeoUnit 参数 为 true 时,单位使用当前图层地理坐标单位。热点显示的时候以精确点为中心点开始往四周辐射衰减,其衰减半径和权重值成比列。
  99100. * @param {number} [options.opacity=1] - 图层透明度。
  99101. * @param {Array.<string>} [options.colors=['blue','cyan','lime','yellow','red']] - 颜色线性渐变数组,颜色值必须为 canvas 所支持的。
  99102. * @param {boolean} [options.useGeoUnit=false] - 使用地理单位,false 表示默认热点半径默认使用像素单位。当设置为 true 时,热点半径和图层地理坐标保持一致。
  99103. * @extends {ol.source.ImageCanvas}
  99104. * @usage
  99105. */
  99106. var HeatMap = /*#__PURE__*/function (_ImageCanvasSource) {
  99107. HeatMap_inherits(HeatMap, _ImageCanvasSource);
  99108. var _super = HeatMap_createSuper(HeatMap);
  99109. function HeatMap(name, opt_options) {
  99110. var _this;
  99111. HeatMap_classCallCheck(this, HeatMap);
  99112. var options = opt_options ? opt_options : {};
  99113. _this = _super.call(this, {
  99114. attributions: options.attributions || "Map Data <span>© SuperMap iServer</span> with <span>© SuperMap iClient</span>",
  99115. canvasFunction: canvasFunctionInternal_,
  99116. logo: core_Util_Util.getOlVersion() === '4' ? options.logo : null,
  99117. projection: options.projection,
  99118. ratio: options.ratio,
  99119. resolutions: options.resolutions,
  99120. state: options.state
  99121. });
  99122. function canvasFunctionInternal_(extent, resolution, pixelRatio, size, projection) {
  99123. // eslint-disable-line no-unused-vars
  99124. var mapWidth = size[0] * pixelRatio;
  99125. var mapHeight = size[1] * pixelRatio;
  99126. this.rootCanvas.width = this.maxWidth = mapWidth;
  99127. this.rootCanvas.height = this.maxHeight = mapHeight;
  99128. if (!this.features) {
  99129. return this.rootCanvas;
  99130. }
  99131. this.pixelRatio = pixelRatio;
  99132. //记录偏移量
  99133. var width = this.map.getSize()[0] * pixelRatio;
  99134. var height = this.map.getSize()[1] * pixelRatio;
  99135. this.offset = [(mapWidth - width) / 2 / pixelRatio, (mapHeight - height) / 2 / pixelRatio];
  99136. this.updateHeatPoints(resolution);
  99137. return this.rootCanvas;
  99138. }
  99139. //初始化成员变量
  99140. _this.canvasFunctionInternal_ = canvasFunctionInternal_;
  99141. _this.features = [];
  99142. _this.name = name;
  99143. if (!options.map) {
  99144. throw new Error('options.map is not found.');
  99145. }
  99146. _this.map = options.map;
  99147. // this.TFEvents = options.TFEvents || [];
  99148. _this.id = options.id ? options.id : Util_Util.createUniqueID("HeatMapSource_");
  99149. _this.opacity = options.opacity ? options.opacity : 1;
  99150. _this.colors = options.colors ? options.colors : ['blue', 'cyan', 'lime', 'yellow', 'red'];
  99151. _this.useGeoUnit = options.useGeoUnit ? options.useGeoUnit : false;
  99152. _this.radius = options.radius ? options.radius : 50;
  99153. _this.featureWeight = options.featureWeight ? options.featureWeight : null;
  99154. _this.maxWeight = null;
  99155. _this.minWeight = null;
  99156. _this.maxWidth = null;
  99157. _this.maxHeight = null;
  99158. //创建热力图绘制面板
  99159. _this.rootCanvas = document.createElement("canvas");
  99160. var mapSize = _this.map.getSize();
  99161. _this.rootCanvas.width = _this.maxWidth = parseInt(mapSize[0]);
  99162. _this.rootCanvas.height = _this.maxHeight = parseInt(mapSize[1]);
  99163. Util_Util.modifyDOMElement(_this.rootCanvas, null, null, null, null, null, null, _this.opacity);
  99164. _this.canvasContext = _this.rootCanvas.getContext('2d');
  99165. return _this;
  99166. }
  99167. /**
  99168. * @function HeatMap.prototype.addFeatures
  99169. * @description 添加热点信息。
  99170. * @param {(GeoJSONObject|Array.<ol.Feature>)} features - 待添加的要素数组。
  99171. * @example
  99172. * var geojson = {
  99173. * "type": "FeatureCollection",
  99174. * "features": [
  99175. * {
  99176. * "type": "feature",
  99177. * "geometry": {
  99178. * "type": "Point", //只支持point类型
  99179. * "coordinates": [0, 0]
  99180. * },
  99181. * "properties": {
  99182. * "height": Math.random()*9,
  99183. * }
  99184. * }
  99185. * ]
  99186. * };
  99187. * var heatMapSource = new HeatMap("heatMap",{"map": map});
  99188. * heatMapSource.addFeatures(geojson);
  99189. * map.addLayer(new ol.layer.Image({
  99190. * source: heatMapSource
  99191. * }));
  99192. */
  99193. HeatMap_createClass(HeatMap, [{
  99194. key: "addFeatures",
  99195. value: function addFeatures(features) {
  99196. this.features = this.toiClientFeature(features);
  99197. //支持更新features,刷新底图
  99198. this.changed();
  99199. }
  99200. /**
  99201. * @function HeatMap.prototype.setOpacity
  99202. * @description 设置图层的不透明度,取值 [0-1] 之间。
  99203. * @param {number} opacity - 不透明度。
  99204. */
  99205. }, {
  99206. key: "setOpacity",
  99207. value: function setOpacity(opacity) {
  99208. if (opacity !== this.opacity) {
  99209. this.opacity = opacity;
  99210. var element = this.rootCanvas;
  99211. Util_Util.modifyDOMElement(element, null, null, null, null, null, null, opacity);
  99212. if (this.map !== null) {
  99213. // this.dispatchEvent({type: 'changelayer', value: {layer: this, property: "opacity"}});
  99214. this.changed();
  99215. }
  99216. }
  99217. }
  99218. /**
  99219. * @function HeatMap.prototype.updateHeatPoints
  99220. * @description 刷新热点图显示。
  99221. * @param {ol.LngLatBounds} resolution - 当前显示范围。
  99222. * @private
  99223. */
  99224. }, {
  99225. key: "updateHeatPoints",
  99226. value: function updateHeatPoints(resolution) {
  99227. if (this.features && this.features.length > 0) {
  99228. this.convertFastToPixelPoints(resolution);
  99229. } else {
  99230. this.canvasContext.clearRect(0, 0, this.maxWidth, this.maxWidth);
  99231. }
  99232. }
  99233. /**
  99234. * @function HeatMap.prototype.convertFastToPixelPoints
  99235. * @description 过滤位于当前显示范围内的热点,并转换其为当前分辨率下的像素坐标。
  99236. * @param {number} resolution - 当前分辨率。
  99237. * @private
  99238. */
  99239. }, {
  99240. key: "convertFastToPixelPoints",
  99241. value: function convertFastToPixelPoints(resolution) {
  99242. var data = [],
  99243. x,
  99244. y,
  99245. k,
  99246. maxTemp,
  99247. minTemp,
  99248. maxWeightTemp;
  99249. //热点半径
  99250. this.useRadius = this.useGeoUnit ? parseInt(this.radius / resolution) : this.radius;
  99251. for (var i = 0; i < this.features.length; i++) {
  99252. var feature = this.features[i];
  99253. var point = feature.geometry;
  99254. //过滤,只显示当前范围
  99255. // if (mapBounds.contains(point.x, point.y)) {
  99256. var pixelPoint = this.getLocalXY(new LonLat(point.x, point.y));
  99257. if (this.featureWeight) {
  99258. pixelPoint.weight = feature.attributes[this.featureWeight]; //point.value;
  99259. if (!this.maxWeight) {
  99260. //找出最大最小权重值
  99261. maxTemp = maxTemp ? maxTemp : pixelPoint.weight;
  99262. minTemp = minTemp ? minTemp : pixelPoint.weight;
  99263. maxTemp = Math.max(maxTemp, pixelPoint.weight);
  99264. minTemp = Math.min(minTemp, pixelPoint.weight);
  99265. }
  99266. } else {
  99267. pixelPoint.weight = 1;
  99268. }
  99269. x = Math.floor(pixelPoint[0]);
  99270. y = Math.floor(pixelPoint[1]);
  99271. k = pixelPoint.weight;
  99272. data.push([x, y, k]);
  99273. // }
  99274. }
  99275. //无最大权重设置
  99276. if (!this.maxWeight) {
  99277. if (maxTemp && minTemp) {
  99278. maxWeightTemp = (maxTemp + minTemp) / 2;
  99279. } else {
  99280. maxWeightTemp = 1;
  99281. }
  99282. this.draw(data, maxWeightTemp);
  99283. } else {
  99284. this.draw(data, this.maxWeight);
  99285. }
  99286. }
  99287. /**
  99288. * @function HeatMap.prototype.draw
  99289. * @description 绘制热点图。
  99290. * @param {Array} data - convertToPixelPoints 方法计算出的点。
  99291. * @param {number} maxWeight -最大权重。
  99292. * @private
  99293. */
  99294. }, {
  99295. key: "draw",
  99296. value: function draw(data, maxWeight) {
  99297. if (this.maxHeight > 0 && this.maxWidth > 0) {
  99298. //清空
  99299. var ctx = this.canvasContext;
  99300. this.canvasContext.clearRect(0, 0, this.maxWidth, this.maxHeight);
  99301. this.drawCircle(this.useRadius);
  99302. this.createGradient();
  99303. for (var i = 0; i < data.length; i++) {
  99304. var p = data[i];
  99305. this.canvasContext.globalAlpha = Math.max(p[2] / maxWeight, 0.05);
  99306. this.canvasContext.drawImage(this.circle, p[0] - this.useRadius, p[1] - this.useRadius);
  99307. }
  99308. var colored = ctx.getImageData(0, 0, this.maxWidth, this.maxHeight);
  99309. this.colorize(colored.data, this.grad);
  99310. ctx.putImageData(colored, 0, 0);
  99311. } else {
  99312. return false;
  99313. }
  99314. }
  99315. /**
  99316. * @function HeatMap.prototype.colorize
  99317. * @description 根据渐变色重置热点图 rgb 值。
  99318. * @param {Object} pixels - 像素 rgba 值。
  99319. * @param {Array} gradient - 渐变 canvas.getImageData.data。
  99320. * @private
  99321. */
  99322. }, {
  99323. key: "colorize",
  99324. value: function colorize(pixels, gradient) {
  99325. for (var i = 0, j; i < pixels.length; i += 4) {
  99326. j = pixels[i + 3] * 4;
  99327. if (j) {
  99328. pixels[i] = gradient[j];
  99329. pixels[i + 1] = gradient[j + 1];
  99330. pixels[i + 2] = gradient[j + 2];
  99331. }
  99332. }
  99333. }
  99334. /**
  99335. * @function HeatMap.drawCircle
  99336. * @description 绘制热点半径圆。
  99337. * @param {number} r - 热点半径。
  99338. * @private
  99339. */
  99340. }, {
  99341. key: "drawCircle",
  99342. value: function drawCircle(r) {
  99343. var blur = r / 2;
  99344. var circle = this.circle = document.createElement('canvas'),
  99345. ctx = circle.getContext("2d");
  99346. circle.height = 2 * r;
  99347. circle.width = 2 * r;
  99348. ctx.shadowOffsetX = ctx.shadowOffsetY = 2 * r;
  99349. ctx.shadowBlur = blur;
  99350. ctx.shadowColor = "#000000";
  99351. ctx.beginPath();
  99352. ctx.arc(-r, -r, r / 2, 0, Math.PI * 2, true);
  99353. ctx.closePath();
  99354. ctx.fill();
  99355. }
  99356. /**
  99357. * @function HeatMap.createGradient
  99358. * @description 根据 this.canvasColors 设置渐变并 getImageData。
  99359. * @private
  99360. */
  99361. }, {
  99362. key: "createGradient",
  99363. value: function createGradient() {
  99364. var colors = this.colors;
  99365. var canvas = document.createElement('canvas'),
  99366. ctx = canvas.getContext("2d"),
  99367. gradient = ctx.createLinearGradient(0, 0, 0, 256);
  99368. canvas.height = 256;
  99369. canvas.width = 1;
  99370. var index = 1;
  99371. for (var i = 0, len = colors.length; i < len; i++) {
  99372. gradient.addColorStop(index / len, colors[i]);
  99373. index++;
  99374. }
  99375. ctx.fillStyle = gradient;
  99376. ctx.fillRect(0, 0, 1, 256);
  99377. this.grad = ctx.getImageData(0, 0, 1, 256).data;
  99378. }
  99379. /**
  99380. * @function HeatMap.prototype.getLocalXY
  99381. * @description 获取坐标系统。
  99382. * @param {Object} coordinate - 坐标位置。
  99383. */
  99384. }, {
  99385. key: "getLocalXY",
  99386. value: function getLocalXY(coordinate) {
  99387. var pixelP,
  99388. map = this.map;
  99389. if (coordinate instanceof Point || coordinate instanceof GeoText) {
  99390. pixelP = map.getPixelFromCoordinate([coordinate.x, coordinate.y]);
  99391. }
  99392. if (coordinate instanceof LonLat) {
  99393. pixelP = map.getPixelFromCoordinate([coordinate.lon, coordinate.lat]);
  99394. }
  99395. var rotation = -map.getView().getRotation();
  99396. var center = map.getPixelFromCoordinate(map.getView().getCenter());
  99397. var rotatedP = pixelP;
  99398. if (this.pixelRatio) {
  99399. rotatedP = this.scale(pixelP, center, this.pixelRatio);
  99400. }
  99401. if (pixelP && center) {
  99402. rotatedP = this.rotate(rotatedP, rotation, center);
  99403. }
  99404. if (this.offset && rotatedP) {
  99405. return [rotatedP[0] + this.offset[0], rotatedP[1] + this.offset[1]];
  99406. }
  99407. return rotatedP;
  99408. }
  99409. /**
  99410. * @function HeatMap.prototype.rotate
  99411. * @description 获取某像素坐标点 pixelP 绕中心 center 逆时针旋转 rotation 弧度后的像素点坐标。
  99412. * @param {number} pixelP - 像素坐标点位置。
  99413. * @param {number} rotation - 旋转角度。
  99414. * @param {number} center - 中心位置。
  99415. */
  99416. }, {
  99417. key: "rotate",
  99418. value: function rotate(pixelP, rotation, center) {
  99419. var x = Math.cos(rotation) * (pixelP[0] - center[0]) - Math.sin(rotation) * (pixelP[1] - center[1]) + center[0];
  99420. var y = Math.sin(rotation) * (pixelP[0] - center[0]) + Math.cos(rotation) * (pixelP[1] - center[1]) + center[1];
  99421. return [x, y];
  99422. }
  99423. /**
  99424. * @function HeatMap.prototype.scale
  99425. * @description 获取某像素坐标点 pixelP 相对于中心 center 进行缩放 scaleRatio 倍后的像素点坐标。
  99426. * @param {Object} pixelP - 像素点。
  99427. * @param {Object} center - 中心点。
  99428. * @param {number} scaleRatio - 缩放倍数。
  99429. * @returns {Array.<number>} 返回数组型比例。
  99430. */
  99431. }, {
  99432. key: "scale",
  99433. value: function scale(pixelP, center, scaleRatio) {
  99434. var x = (pixelP[0] - center[0]) * scaleRatio + center[0];
  99435. var y = (pixelP[1] - center[1]) * scaleRatio + center[1];
  99436. return [x, y];
  99437. }
  99438. /**
  99439. * @function HeatMap.prototype.removeFeatures
  99440. * @description 移除指定的热点信息。
  99441. * @param {Array.<FeatureVector>|FeatureVector} features - 热点信息数组。
  99442. */
  99443. }, {
  99444. key: "removeFeatures",
  99445. value: function removeFeatures(features) {
  99446. if (!features || features.length === 0 || !this.features || this.features.length === 0) {
  99447. return;
  99448. }
  99449. if (features === this.features) {
  99450. return this.removeAllFeatures();
  99451. }
  99452. if (!Util_Util.isArray(features)) {
  99453. features = [features];
  99454. }
  99455. var heatPoint,
  99456. index,
  99457. heatPointsFailedRemoved = [];
  99458. for (var i = 0, len = features.length; i < len; i++) {
  99459. heatPoint = features[i];
  99460. index = Util_Util.indexOf(this.features, heatPoint);
  99461. //找不到视为删除失败
  99462. if (index === -1) {
  99463. heatPointsFailedRemoved.push(heatPoint);
  99464. continue;
  99465. }
  99466. //删除热点
  99467. this.features.splice(index, 1);
  99468. }
  99469. var succeed = heatPointsFailedRemoved.length == 0 ? true : false;
  99470. //派发删除features成功的事件
  99471. this.dispatchEvent({
  99472. type: 'featuresremoved',
  99473. value: {
  99474. features: heatPointsFailedRemoved,
  99475. succeed: succeed
  99476. }
  99477. });
  99478. this.changed();
  99479. }
  99480. /**
  99481. * @function HeatMap.prototype.removeAllFeatures
  99482. * @description 移除全部的热点信息。
  99483. */
  99484. }, {
  99485. key: "removeAllFeatures",
  99486. value: function removeAllFeatures() {
  99487. this.features = [];
  99488. this.changed();
  99489. }
  99490. /**
  99491. * @function HeatMap.prototype.toiClientFeature
  99492. * @description 转为 iClient 要素。
  99493. * @param {GeoJSONObject|Array.<ol.Feature>} features - 待添加的要素数组。
  99494. * @returns {FeatureVector} 转换后的 iClient 要素。
  99495. */
  99496. }, {
  99497. key: "toiClientFeature",
  99498. value: function toiClientFeature(features) {
  99499. if (!core_Util_Util.isArray(features)) {
  99500. features = [features];
  99501. }
  99502. var featuresTemp = [],
  99503. geometry,
  99504. attributes;
  99505. for (var i = 0, len = features.length; i < len; i++) {
  99506. if (features[i] instanceof (external_ol_Feature_default())) {
  99507. //热点图支支持传入点对象要素
  99508. if (features[i].getGeometry() instanceof (external_ol_geom_Point_default())) {
  99509. geometry = new Point(features[i].getGeometry().getCoordinates()[0], features[i].getGeometry().getCoordinates()[1]);
  99510. //固定属性字段为 "Properties"
  99511. attributes = features[i].getProperties()["Properties"] ? features[i].getProperties()["Properties"] : {};
  99512. featuresTemp.push(new Vector(geometry, attributes));
  99513. }
  99514. } else if (["FeatureCollection", "Feature", "Geometry"].indexOf(features[i].type) != -1) {
  99515. var format = new GeoJSON();
  99516. featuresTemp = featuresTemp.concat(format.read(features[i]));
  99517. } else if (features[i].geometry && features[i].geometry.parts) {
  99518. //iServer服务器返回数据格式
  99519. featuresTemp.push(ServerFeature.fromJson(features[i]).toFeature());
  99520. } else {
  99521. throw new Error("Features[".concat(i, "]'s type does not match, please check."));
  99522. }
  99523. }
  99524. return featuresTemp;
  99525. }
  99526. }]);
  99527. return HeatMap;
  99528. }((external_ol_source_ImageCanvas_default()));
  99529. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/flat-geobuf/geometry-type.js
  99530. var geometry_type_GeometryType;
  99531. (function (GeometryType) {
  99532. GeometryType[GeometryType["Unknown"] = 0] = "Unknown";
  99533. GeometryType[GeometryType["Point"] = 1] = "Point";
  99534. GeometryType[GeometryType["LineString"] = 2] = "LineString";
  99535. GeometryType[GeometryType["Polygon"] = 3] = "Polygon";
  99536. GeometryType[GeometryType["MultiPoint"] = 4] = "MultiPoint";
  99537. GeometryType[GeometryType["MultiLineString"] = 5] = "MultiLineString";
  99538. GeometryType[GeometryType["MultiPolygon"] = 6] = "MultiPolygon";
  99539. GeometryType[GeometryType["GeometryCollection"] = 7] = "GeometryCollection";
  99540. GeometryType[GeometryType["CircularString"] = 8] = "CircularString";
  99541. GeometryType[GeometryType["CompoundCurve"] = 9] = "CompoundCurve";
  99542. GeometryType[GeometryType["CurvePolygon"] = 10] = "CurvePolygon";
  99543. GeometryType[GeometryType["MultiCurve"] = 11] = "MultiCurve";
  99544. GeometryType[GeometryType["MultiSurface"] = 12] = "MultiSurface";
  99545. GeometryType[GeometryType["Curve"] = 13] = "Curve";
  99546. GeometryType[GeometryType["Surface"] = 14] = "Surface";
  99547. GeometryType[GeometryType["PolyhedralSurface"] = 15] = "PolyhedralSurface";
  99548. GeometryType[GeometryType["TIN"] = 16] = "TIN";
  99549. GeometryType[GeometryType["Triangle"] = 17] = "Triangle";
  99550. })(geometry_type_GeometryType || (geometry_type_GeometryType = {}));
  99551. // EXTERNAL MODULE: ./node_modules/flatbuffers/js/flatbuffers.js
  99552. var js_flatbuffers = __webpack_require__(1095);
  99553. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/flat-geobuf/geometry.js
  99554. function geometry_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  99555. function geometry_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  99556. function geometry_createClass(Constructor, protoProps, staticProps) { if (protoProps) geometry_defineProperties(Constructor.prototype, protoProps); if (staticProps) geometry_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  99557. var geometry_Geometry = /*#__PURE__*/function () {
  99558. function Geometry() {
  99559. geometry_classCallCheck(this, Geometry);
  99560. this.bb = null;
  99561. this.bb_pos = 0;
  99562. }
  99563. geometry_createClass(Geometry, [{
  99564. key: "__init",
  99565. value: function __init(i, bb) {
  99566. this.bb_pos = i;
  99567. this.bb = bb;
  99568. return this;
  99569. }
  99570. }, {
  99571. key: "ends",
  99572. value: function ends(index) {
  99573. var offset = this.bb.__offset(this.bb_pos, 4);
  99574. return offset ? this.bb.readUint32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
  99575. }
  99576. }, {
  99577. key: "endsLength",
  99578. value: function endsLength() {
  99579. var offset = this.bb.__offset(this.bb_pos, 4);
  99580. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  99581. }
  99582. }, {
  99583. key: "endsArray",
  99584. value: function endsArray() {
  99585. var offset = this.bb.__offset(this.bb_pos, 4);
  99586. return offset ? new Uint32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  99587. }
  99588. }, {
  99589. key: "xy",
  99590. value: function xy(index) {
  99591. var offset = this.bb.__offset(this.bb_pos, 6);
  99592. return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
  99593. }
  99594. }, {
  99595. key: "xyLength",
  99596. value: function xyLength() {
  99597. var offset = this.bb.__offset(this.bb_pos, 6);
  99598. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  99599. }
  99600. }, {
  99601. key: "xyArray",
  99602. value: function xyArray() {
  99603. var offset = this.bb.__offset(this.bb_pos, 6);
  99604. return offset ? new Float64Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  99605. }
  99606. }, {
  99607. key: "z",
  99608. value: function z(index) {
  99609. var offset = this.bb.__offset(this.bb_pos, 8);
  99610. return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
  99611. }
  99612. }, {
  99613. key: "zLength",
  99614. value: function zLength() {
  99615. var offset = this.bb.__offset(this.bb_pos, 8);
  99616. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  99617. }
  99618. }, {
  99619. key: "zArray",
  99620. value: function zArray() {
  99621. var offset = this.bb.__offset(this.bb_pos, 8);
  99622. return offset ? new Float64Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  99623. }
  99624. }, {
  99625. key: "m",
  99626. value: function m(index) {
  99627. var offset = this.bb.__offset(this.bb_pos, 10);
  99628. return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
  99629. }
  99630. }, {
  99631. key: "mLength",
  99632. value: function mLength() {
  99633. var offset = this.bb.__offset(this.bb_pos, 10);
  99634. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  99635. }
  99636. }, {
  99637. key: "mArray",
  99638. value: function mArray() {
  99639. var offset = this.bb.__offset(this.bb_pos, 10);
  99640. return offset ? new Float64Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  99641. }
  99642. }, {
  99643. key: "t",
  99644. value: function t(index) {
  99645. var offset = this.bb.__offset(this.bb_pos, 12);
  99646. return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
  99647. }
  99648. }, {
  99649. key: "tLength",
  99650. value: function tLength() {
  99651. var offset = this.bb.__offset(this.bb_pos, 12);
  99652. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  99653. }
  99654. }, {
  99655. key: "tArray",
  99656. value: function tArray() {
  99657. var offset = this.bb.__offset(this.bb_pos, 12);
  99658. return offset ? new Float64Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  99659. }
  99660. }, {
  99661. key: "tm",
  99662. value: function tm(index) {
  99663. var offset = this.bb.__offset(this.bb_pos, 14);
  99664. return offset ? this.bb.readUint64(this.bb.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
  99665. }
  99666. }, {
  99667. key: "tmLength",
  99668. value: function tmLength() {
  99669. var offset = this.bb.__offset(this.bb_pos, 14);
  99670. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  99671. }
  99672. }, {
  99673. key: "type",
  99674. value: function type() {
  99675. var offset = this.bb.__offset(this.bb_pos, 16);
  99676. return offset ? this.bb.readUint8(this.bb_pos + offset) : geometry_type_GeometryType.Unknown;
  99677. }
  99678. }, {
  99679. key: "parts",
  99680. value: function parts(index, obj) {
  99681. var offset = this.bb.__offset(this.bb_pos, 18);
  99682. return offset ? (obj || new Geometry()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
  99683. }
  99684. }, {
  99685. key: "partsLength",
  99686. value: function partsLength() {
  99687. var offset = this.bb.__offset(this.bb_pos, 18);
  99688. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  99689. }
  99690. }], [{
  99691. key: "getRootAsGeometry",
  99692. value: function getRootAsGeometry(bb, obj) {
  99693. return (obj || new Geometry()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  99694. }
  99695. }, {
  99696. key: "getSizePrefixedRootAsGeometry",
  99697. value: function getSizePrefixedRootAsGeometry(bb, obj) {
  99698. bb.setPosition(bb.position() + js_flatbuffers/* SIZE_PREFIX_LENGTH */.XU);
  99699. return (obj || new Geometry()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  99700. }
  99701. }, {
  99702. key: "startGeometry",
  99703. value: function startGeometry(builder) {
  99704. builder.startObject(8);
  99705. }
  99706. }, {
  99707. key: "addEnds",
  99708. value: function addEnds(builder, endsOffset) {
  99709. builder.addFieldOffset(0, endsOffset, 0);
  99710. }
  99711. }, {
  99712. key: "createEndsVector",
  99713. value: function createEndsVector(builder, data) {
  99714. builder.startVector(4, data.length, 4);
  99715. for (var i = data.length - 1; i >= 0; i--) {
  99716. builder.addInt32(data[i]);
  99717. }
  99718. return builder.endVector();
  99719. }
  99720. }, {
  99721. key: "startEndsVector",
  99722. value: function startEndsVector(builder, numElems) {
  99723. builder.startVector(4, numElems, 4);
  99724. }
  99725. }, {
  99726. key: "addXy",
  99727. value: function addXy(builder, xyOffset) {
  99728. builder.addFieldOffset(1, xyOffset, 0);
  99729. }
  99730. }, {
  99731. key: "createXyVector",
  99732. value: function createXyVector(builder, data) {
  99733. builder.startVector(8, data.length, 8);
  99734. for (var i = data.length - 1; i >= 0; i--) {
  99735. builder.addFloat64(data[i]);
  99736. }
  99737. return builder.endVector();
  99738. }
  99739. }, {
  99740. key: "startXyVector",
  99741. value: function startXyVector(builder, numElems) {
  99742. builder.startVector(8, numElems, 8);
  99743. }
  99744. }, {
  99745. key: "addZ",
  99746. value: function addZ(builder, zOffset) {
  99747. builder.addFieldOffset(2, zOffset, 0);
  99748. }
  99749. }, {
  99750. key: "createZVector",
  99751. value: function createZVector(builder, data) {
  99752. builder.startVector(8, data.length, 8);
  99753. for (var i = data.length - 1; i >= 0; i--) {
  99754. builder.addFloat64(data[i]);
  99755. }
  99756. return builder.endVector();
  99757. }
  99758. }, {
  99759. key: "startZVector",
  99760. value: function startZVector(builder, numElems) {
  99761. builder.startVector(8, numElems, 8);
  99762. }
  99763. }, {
  99764. key: "addM",
  99765. value: function addM(builder, mOffset) {
  99766. builder.addFieldOffset(3, mOffset, 0);
  99767. }
  99768. }, {
  99769. key: "createMVector",
  99770. value: function createMVector(builder, data) {
  99771. builder.startVector(8, data.length, 8);
  99772. for (var i = data.length - 1; i >= 0; i--) {
  99773. builder.addFloat64(data[i]);
  99774. }
  99775. return builder.endVector();
  99776. }
  99777. }, {
  99778. key: "startMVector",
  99779. value: function startMVector(builder, numElems) {
  99780. builder.startVector(8, numElems, 8);
  99781. }
  99782. }, {
  99783. key: "addT",
  99784. value: function addT(builder, tOffset) {
  99785. builder.addFieldOffset(4, tOffset, 0);
  99786. }
  99787. }, {
  99788. key: "createTVector",
  99789. value: function createTVector(builder, data) {
  99790. builder.startVector(8, data.length, 8);
  99791. for (var i = data.length - 1; i >= 0; i--) {
  99792. builder.addFloat64(data[i]);
  99793. }
  99794. return builder.endVector();
  99795. }
  99796. }, {
  99797. key: "startTVector",
  99798. value: function startTVector(builder, numElems) {
  99799. builder.startVector(8, numElems, 8);
  99800. }
  99801. }, {
  99802. key: "addTm",
  99803. value: function addTm(builder, tmOffset) {
  99804. builder.addFieldOffset(5, tmOffset, 0);
  99805. }
  99806. }, {
  99807. key: "createTmVector",
  99808. value: function createTmVector(builder, data) {
  99809. builder.startVector(8, data.length, 8);
  99810. for (var i = data.length - 1; i >= 0; i--) {
  99811. builder.addInt64(data[i]);
  99812. }
  99813. return builder.endVector();
  99814. }
  99815. }, {
  99816. key: "startTmVector",
  99817. value: function startTmVector(builder, numElems) {
  99818. builder.startVector(8, numElems, 8);
  99819. }
  99820. }, {
  99821. key: "addType",
  99822. value: function addType(builder, type) {
  99823. builder.addFieldInt8(6, type, geometry_type_GeometryType.Unknown);
  99824. }
  99825. }, {
  99826. key: "addParts",
  99827. value: function addParts(builder, partsOffset) {
  99828. builder.addFieldOffset(7, partsOffset, 0);
  99829. }
  99830. }, {
  99831. key: "createPartsVector",
  99832. value: function createPartsVector(builder, data) {
  99833. builder.startVector(4, data.length, 4);
  99834. for (var i = data.length - 1; i >= 0; i--) {
  99835. builder.addOffset(data[i]);
  99836. }
  99837. return builder.endVector();
  99838. }
  99839. }, {
  99840. key: "startPartsVector",
  99841. value: function startPartsVector(builder, numElems) {
  99842. builder.startVector(4, numElems, 4);
  99843. }
  99844. }, {
  99845. key: "endGeometry",
  99846. value: function endGeometry(builder) {
  99847. var offset = builder.endObject();
  99848. return offset;
  99849. }
  99850. }, {
  99851. key: "createGeometry",
  99852. value: function createGeometry(builder, endsOffset, xyOffset, zOffset, mOffset, tOffset, tmOffset, type, partsOffset) {
  99853. Geometry.startGeometry(builder);
  99854. Geometry.addEnds(builder, endsOffset);
  99855. Geometry.addXy(builder, xyOffset);
  99856. Geometry.addZ(builder, zOffset);
  99857. Geometry.addM(builder, mOffset);
  99858. Geometry.addT(builder, tOffset);
  99859. Geometry.addTm(builder, tmOffset);
  99860. Geometry.addType(builder, type);
  99861. Geometry.addParts(builder, partsOffset);
  99862. return Geometry.endGeometry(builder);
  99863. }
  99864. }]);
  99865. return Geometry;
  99866. }();
  99867. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/generic/geometry.js
  99868. function geometry_toConsumableArray(arr) { return geometry_arrayWithoutHoles(arr) || geometry_iterableToArray(arr) || geometry_unsupportedIterableToArray(arr) || geometry_nonIterableSpread(); }
  99869. function geometry_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  99870. function geometry_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
  99871. function geometry_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return geometry_arrayLikeToArray(arr); }
  99872. function geometry_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = geometry_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
  99873. function geometry_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return geometry_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return geometry_arrayLikeToArray(o, minLen); }
  99874. function geometry_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  99875. function geometry_buildGeometry(builder, parsedGeometry) {
  99876. var xy = parsedGeometry.xy,
  99877. z = parsedGeometry.z,
  99878. ends = parsedGeometry.ends,
  99879. parts = parsedGeometry.parts,
  99880. type = parsedGeometry.type;
  99881. if (parts) {
  99882. var partOffsets = parts.map(function (part) {
  99883. return geometry_buildGeometry(builder, part);
  99884. });
  99885. var partsOffset = Geometry.createPartsVector(builder, partOffsets);
  99886. Geometry.startGeometry(builder);
  99887. Geometry.addParts(builder, partsOffset);
  99888. Geometry.addType(builder, type);
  99889. return Geometry.endGeometry(builder);
  99890. }
  99891. var xyOffset = Geometry.createXyVector(builder, xy);
  99892. var zOffset;
  99893. if (z) zOffset = Geometry.createZVector(builder, z);
  99894. var endsOffset;
  99895. if (ends) endsOffset = Geometry.createEndsVector(builder, ends);
  99896. Geometry.startGeometry(builder);
  99897. if (endsOffset) Geometry.addEnds(builder, endsOffset);
  99898. Geometry.addXy(builder, xyOffset);
  99899. if (zOffset) Geometry.addZ(builder, zOffset);
  99900. Geometry.addType(builder, type);
  99901. return Geometry.endGeometry(builder);
  99902. }
  99903. function geometry_flat(a, xy, z) {
  99904. if (a.length === 0) return;
  99905. if (Array.isArray(a[0])) {
  99906. var _iterator = geometry_createForOfIteratorHelper(a),
  99907. _step;
  99908. try {
  99909. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  99910. var sa = _step.value;
  99911. geometry_flat(sa, xy, z);
  99912. }
  99913. } catch (err) {
  99914. _iterator.e(err);
  99915. } finally {
  99916. _iterator.f();
  99917. }
  99918. } else {
  99919. if (a.length === 2) xy.push.apply(xy, geometry_toConsumableArray(a));else {
  99920. xy.push(a[0], a[1]);
  99921. z.push(a[2]);
  99922. }
  99923. }
  99924. }
  99925. function geometry_parseGeometry(geometry, headerGeomType) {
  99926. var xy;
  99927. var ends;
  99928. var parts;
  99929. var type = headerGeomType;
  99930. if (type === GeometryType.Unknown) {
  99931. type = geometry_toGeometryType(geometry.getType());
  99932. }
  99933. if (type === GeometryType.MultiLineString) {
  99934. if (geometry.getFlatCoordinates) xy = geometry.getFlatCoordinates();
  99935. var mlsEnds = geometry.getEnds();
  99936. if (mlsEnds.length > 1) ends = mlsEnds.map(function (e) {
  99937. return e >> 1;
  99938. });
  99939. } else if (type === GeometryType.Polygon) {
  99940. if (geometry.getFlatCoordinates) xy = geometry.getFlatCoordinates();
  99941. var pEnds = geometry.getEnds();
  99942. if (pEnds.length > 1) ends = pEnds.map(function (e) {
  99943. return e >> 1;
  99944. });
  99945. } else if (type === GeometryType.MultiPolygon) {
  99946. var mp = geometry;
  99947. parts = mp.getPolygons().map(function (p) {
  99948. return geometry_parseGeometry(p, GeometryType.Polygon);
  99949. });
  99950. } else {
  99951. if (geometry.getFlatCoordinates) xy = geometry.getFlatCoordinates();
  99952. }
  99953. return {
  99954. xy: xy,
  99955. ends: ends,
  99956. type: type,
  99957. parts: parts
  99958. };
  99959. }
  99960. function pairFlatCoordinates(xy, z) {
  99961. var newArray = [];
  99962. for (var i = 0; i < xy.length; i += 2) {
  99963. var a = [xy[i], xy[i + 1]];
  99964. if (z) a.push(z[i >> 1]);
  99965. newArray.push(a);
  99966. }
  99967. return newArray;
  99968. }
  99969. function geometry_toGeometryType(name) {
  99970. if (!name) return GeometryType.Unknown;
  99971. var type = GeometryType[name];
  99972. return type;
  99973. }
  99974. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/geojson/geometry.js
  99975. function geojson_geometry_parseGeometry(geometry) {
  99976. var cs = geometry.coordinates;
  99977. var xy = [];
  99978. var z = [];
  99979. var ends;
  99980. var parts;
  99981. var type = toGeometryType(geometry.type);
  99982. var end = 0;
  99983. switch (geometry.type) {
  99984. case 'Point':
  99985. flat(cs, xy, z);
  99986. break;
  99987. case 'MultiPoint':
  99988. case 'LineString':
  99989. flat(cs, xy, z);
  99990. break;
  99991. case 'MultiLineString':
  99992. case 'Polygon':
  99993. {
  99994. var css = cs;
  99995. flat(css, xy, z);
  99996. if (css.length > 1) ends = css.map(function (c) {
  99997. return end += c.length;
  99998. });
  99999. break;
  100000. }
  100001. case 'MultiPolygon':
  100002. {
  100003. var csss = cs;
  100004. var geometries = csss.map(function (coordinates) {
  100005. return {
  100006. type: 'Polygon',
  100007. coordinates: coordinates
  100008. };
  100009. });
  100010. parts = geometries.map(geojson_geometry_parseGeometry);
  100011. break;
  100012. }
  100013. }
  100014. return {
  100015. xy: xy,
  100016. z: z.length > 0 ? z : undefined,
  100017. ends: ends,
  100018. type: type,
  100019. parts: parts
  100020. };
  100021. }
  100022. function geometry_parseGC(geometry) {
  100023. var type = toGeometryType(geometry.type);
  100024. var parts = [];
  100025. for (var i = 0; i < geometry.geometries.length; i++) {
  100026. var g = geometry.geometries[i];
  100027. if (g.type === 'GeometryCollection') parts.push(geometry_parseGC(g));else parts.push(geojson_geometry_parseGeometry(g));
  100028. }
  100029. return {
  100030. type: type,
  100031. parts: parts
  100032. };
  100033. }
  100034. function extractParts(xy, z, ends) {
  100035. if (!ends || ends.length === 0) return [pairFlatCoordinates(xy, z)];
  100036. var s = 0;
  100037. var xySlices = Array.from(ends).map(function (e) {
  100038. return xy.slice(s, s = e << 1);
  100039. });
  100040. var zSlices;
  100041. if (z) {
  100042. s = 0;
  100043. zSlices = Array.from(ends).map(function (e) {
  100044. return z.slice(s, s = e);
  100045. });
  100046. }
  100047. return xySlices.map(function (xy, i) {
  100048. return pairFlatCoordinates(xy, zSlices ? zSlices[i] : undefined);
  100049. });
  100050. }
  100051. function toGeoJsonCoordinates(geometry, type) {
  100052. var xy = geometry.xyArray();
  100053. var z = geometry.zArray();
  100054. switch (type) {
  100055. case geometry_type_GeometryType.Point:
  100056. {
  100057. var a = Array.from(xy);
  100058. if (z) a.push(z[0]);
  100059. return a;
  100060. }
  100061. case geometry_type_GeometryType.MultiPoint:
  100062. case geometry_type_GeometryType.LineString:
  100063. return pairFlatCoordinates(xy, z);
  100064. case geometry_type_GeometryType.MultiLineString:
  100065. return extractParts(xy, z, geometry.endsArray());
  100066. case geometry_type_GeometryType.Polygon:
  100067. return extractParts(xy, z, geometry.endsArray());
  100068. }
  100069. }
  100070. function fromGeometry(geometry, headerType) {
  100071. var type = headerType;
  100072. if (type === geometry_type_GeometryType.Unknown) {
  100073. type = geometry.type();
  100074. }
  100075. if (type === geometry_type_GeometryType.GeometryCollection) {
  100076. var geometries = [];
  100077. for (var i = 0; i < geometry.partsLength(); i++) {
  100078. var part = geometry.parts(i);
  100079. var partType = part.type();
  100080. geometries.push(fromGeometry(part, partType));
  100081. }
  100082. return {
  100083. type: geometry_type_GeometryType[type],
  100084. geometries: geometries
  100085. };
  100086. } else if (type === geometry_type_GeometryType.MultiPolygon) {
  100087. var _geometries = [];
  100088. for (var _i2 = 0; _i2 < geometry.partsLength(); _i2++) _geometries.push(fromGeometry(geometry.parts(_i2), geometry_type_GeometryType.Polygon));
  100089. return {
  100090. type: geometry_type_GeometryType[type],
  100091. coordinates: _geometries.map(function (g) {
  100092. return g.coordinates;
  100093. })
  100094. };
  100095. }
  100096. var coordinates = toGeoJsonCoordinates(geometry, type);
  100097. return {
  100098. type: geometry_type_GeometryType[type],
  100099. coordinates: coordinates
  100100. };
  100101. }
  100102. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/flat-geobuf/column-type.js
  100103. var column_type_ColumnType;
  100104. (function (ColumnType) {
  100105. ColumnType[ColumnType["Byte"] = 0] = "Byte";
  100106. ColumnType[ColumnType["UByte"] = 1] = "UByte";
  100107. ColumnType[ColumnType["Bool"] = 2] = "Bool";
  100108. ColumnType[ColumnType["Short"] = 3] = "Short";
  100109. ColumnType[ColumnType["UShort"] = 4] = "UShort";
  100110. ColumnType[ColumnType["Int"] = 5] = "Int";
  100111. ColumnType[ColumnType["UInt"] = 6] = "UInt";
  100112. ColumnType[ColumnType["Long"] = 7] = "Long";
  100113. ColumnType[ColumnType["ULong"] = 8] = "ULong";
  100114. ColumnType[ColumnType["Float"] = 9] = "Float";
  100115. ColumnType[ColumnType["Double"] = 10] = "Double";
  100116. ColumnType[ColumnType["String"] = 11] = "String";
  100117. ColumnType[ColumnType["Json"] = 12] = "Json";
  100118. ColumnType[ColumnType["DateTime"] = 13] = "DateTime";
  100119. ColumnType[ColumnType["Binary"] = 14] = "Binary";
  100120. })(column_type_ColumnType || (column_type_ColumnType = {}));
  100121. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/flat-geobuf/column.js
  100122. function column_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  100123. function column_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  100124. function column_createClass(Constructor, protoProps, staticProps) { if (protoProps) column_defineProperties(Constructor.prototype, protoProps); if (staticProps) column_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  100125. var column_Column = /*#__PURE__*/function () {
  100126. function Column() {
  100127. column_classCallCheck(this, Column);
  100128. this.bb = null;
  100129. this.bb_pos = 0;
  100130. }
  100131. column_createClass(Column, [{
  100132. key: "__init",
  100133. value: function __init(i, bb) {
  100134. this.bb_pos = i;
  100135. this.bb = bb;
  100136. return this;
  100137. }
  100138. }, {
  100139. key: "name",
  100140. value: function name(optionalEncoding) {
  100141. var offset = this.bb.__offset(this.bb_pos, 4);
  100142. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  100143. }
  100144. }, {
  100145. key: "type",
  100146. value: function type() {
  100147. var offset = this.bb.__offset(this.bb_pos, 6);
  100148. return offset ? this.bb.readUint8(this.bb_pos + offset) : column_type_ColumnType.Byte;
  100149. }
  100150. }, {
  100151. key: "title",
  100152. value: function title(optionalEncoding) {
  100153. var offset = this.bb.__offset(this.bb_pos, 8);
  100154. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  100155. }
  100156. }, {
  100157. key: "description",
  100158. value: function description(optionalEncoding) {
  100159. var offset = this.bb.__offset(this.bb_pos, 10);
  100160. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  100161. }
  100162. }, {
  100163. key: "width",
  100164. value: function width() {
  100165. var offset = this.bb.__offset(this.bb_pos, 12);
  100166. return offset ? this.bb.readInt32(this.bb_pos + offset) : -1;
  100167. }
  100168. }, {
  100169. key: "precision",
  100170. value: function precision() {
  100171. var offset = this.bb.__offset(this.bb_pos, 14);
  100172. return offset ? this.bb.readInt32(this.bb_pos + offset) : -1;
  100173. }
  100174. }, {
  100175. key: "scale",
  100176. value: function scale() {
  100177. var offset = this.bb.__offset(this.bb_pos, 16);
  100178. return offset ? this.bb.readInt32(this.bb_pos + offset) : -1;
  100179. }
  100180. }, {
  100181. key: "nullable",
  100182. value: function nullable() {
  100183. var offset = this.bb.__offset(this.bb_pos, 18);
  100184. return offset ? !!this.bb.readInt8(this.bb_pos + offset) : true;
  100185. }
  100186. }, {
  100187. key: "unique",
  100188. value: function unique() {
  100189. var offset = this.bb.__offset(this.bb_pos, 20);
  100190. return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
  100191. }
  100192. }, {
  100193. key: "primaryKey",
  100194. value: function primaryKey() {
  100195. var offset = this.bb.__offset(this.bb_pos, 22);
  100196. return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
  100197. }
  100198. }, {
  100199. key: "metadata",
  100200. value: function metadata(optionalEncoding) {
  100201. var offset = this.bb.__offset(this.bb_pos, 24);
  100202. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  100203. }
  100204. }], [{
  100205. key: "getRootAsColumn",
  100206. value: function getRootAsColumn(bb, obj) {
  100207. return (obj || new Column()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  100208. }
  100209. }, {
  100210. key: "getSizePrefixedRootAsColumn",
  100211. value: function getSizePrefixedRootAsColumn(bb, obj) {
  100212. bb.setPosition(bb.position() + js_flatbuffers/* SIZE_PREFIX_LENGTH */.XU);
  100213. return (obj || new Column()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  100214. }
  100215. }, {
  100216. key: "startColumn",
  100217. value: function startColumn(builder) {
  100218. builder.startObject(11);
  100219. }
  100220. }, {
  100221. key: "addName",
  100222. value: function addName(builder, nameOffset) {
  100223. builder.addFieldOffset(0, nameOffset, 0);
  100224. }
  100225. }, {
  100226. key: "addType",
  100227. value: function addType(builder, type) {
  100228. builder.addFieldInt8(1, type, column_type_ColumnType.Byte);
  100229. }
  100230. }, {
  100231. key: "addTitle",
  100232. value: function addTitle(builder, titleOffset) {
  100233. builder.addFieldOffset(2, titleOffset, 0);
  100234. }
  100235. }, {
  100236. key: "addDescription",
  100237. value: function addDescription(builder, descriptionOffset) {
  100238. builder.addFieldOffset(3, descriptionOffset, 0);
  100239. }
  100240. }, {
  100241. key: "addWidth",
  100242. value: function addWidth(builder, width) {
  100243. builder.addFieldInt32(4, width, -1);
  100244. }
  100245. }, {
  100246. key: "addPrecision",
  100247. value: function addPrecision(builder, precision) {
  100248. builder.addFieldInt32(5, precision, -1);
  100249. }
  100250. }, {
  100251. key: "addScale",
  100252. value: function addScale(builder, scale) {
  100253. builder.addFieldInt32(6, scale, -1);
  100254. }
  100255. }, {
  100256. key: "addNullable",
  100257. value: function addNullable(builder, nullable) {
  100258. builder.addFieldInt8(7, +nullable, +true);
  100259. }
  100260. }, {
  100261. key: "addUnique",
  100262. value: function addUnique(builder, unique) {
  100263. builder.addFieldInt8(8, +unique, +false);
  100264. }
  100265. }, {
  100266. key: "addPrimaryKey",
  100267. value: function addPrimaryKey(builder, primaryKey) {
  100268. builder.addFieldInt8(9, +primaryKey, +false);
  100269. }
  100270. }, {
  100271. key: "addMetadata",
  100272. value: function addMetadata(builder, metadataOffset) {
  100273. builder.addFieldOffset(10, metadataOffset, 0);
  100274. }
  100275. }, {
  100276. key: "endColumn",
  100277. value: function endColumn(builder) {
  100278. var offset = builder.endObject();
  100279. builder.requiredField(offset, 4);
  100280. return offset;
  100281. }
  100282. }, {
  100283. key: "createColumn",
  100284. value: function createColumn(builder, nameOffset, type, titleOffset, descriptionOffset, width, precision, scale, nullable, unique, primaryKey, metadataOffset) {
  100285. Column.startColumn(builder);
  100286. Column.addName(builder, nameOffset);
  100287. Column.addType(builder, type);
  100288. Column.addTitle(builder, titleOffset);
  100289. Column.addDescription(builder, descriptionOffset);
  100290. Column.addWidth(builder, width);
  100291. Column.addPrecision(builder, precision);
  100292. Column.addScale(builder, scale);
  100293. Column.addNullable(builder, nullable);
  100294. Column.addUnique(builder, unique);
  100295. Column.addPrimaryKey(builder, primaryKey);
  100296. Column.addMetadata(builder, metadataOffset);
  100297. return Column.endColumn(builder);
  100298. }
  100299. }]);
  100300. return Column;
  100301. }();
  100302. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/flat-geobuf/feature.js
  100303. function feature_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  100304. function feature_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  100305. function feature_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  100306. var feature_Feature = /*#__PURE__*/function () {
  100307. function Feature() {
  100308. feature_classCallCheck(this, Feature);
  100309. this.bb = null;
  100310. this.bb_pos = 0;
  100311. }
  100312. feature_createClass(Feature, [{
  100313. key: "__init",
  100314. value: function __init(i, bb) {
  100315. this.bb_pos = i;
  100316. this.bb = bb;
  100317. return this;
  100318. }
  100319. }, {
  100320. key: "geometry",
  100321. value: function geometry(obj) {
  100322. var offset = this.bb.__offset(this.bb_pos, 4);
  100323. return offset ? (obj || new geometry_Geometry()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
  100324. }
  100325. }, {
  100326. key: "properties",
  100327. value: function properties(index) {
  100328. var offset = this.bb.__offset(this.bb_pos, 6);
  100329. return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
  100330. }
  100331. }, {
  100332. key: "propertiesLength",
  100333. value: function propertiesLength() {
  100334. var offset = this.bb.__offset(this.bb_pos, 6);
  100335. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  100336. }
  100337. }, {
  100338. key: "propertiesArray",
  100339. value: function propertiesArray() {
  100340. var offset = this.bb.__offset(this.bb_pos, 6);
  100341. return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  100342. }
  100343. }, {
  100344. key: "columns",
  100345. value: function columns(index, obj) {
  100346. var offset = this.bb.__offset(this.bb_pos, 8);
  100347. return offset ? (obj || new column_Column()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
  100348. }
  100349. }, {
  100350. key: "columnsLength",
  100351. value: function columnsLength() {
  100352. var offset = this.bb.__offset(this.bb_pos, 8);
  100353. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  100354. }
  100355. }], [{
  100356. key: "getRootAsFeature",
  100357. value: function getRootAsFeature(bb, obj) {
  100358. return (obj || new Feature()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  100359. }
  100360. }, {
  100361. key: "getSizePrefixedRootAsFeature",
  100362. value: function getSizePrefixedRootAsFeature(bb, obj) {
  100363. bb.setPosition(bb.position() + js_flatbuffers/* SIZE_PREFIX_LENGTH */.XU);
  100364. return (obj || new Feature()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  100365. }
  100366. }, {
  100367. key: "startFeature",
  100368. value: function startFeature(builder) {
  100369. builder.startObject(3);
  100370. }
  100371. }, {
  100372. key: "addGeometry",
  100373. value: function addGeometry(builder, geometryOffset) {
  100374. builder.addFieldOffset(0, geometryOffset, 0);
  100375. }
  100376. }, {
  100377. key: "addProperties",
  100378. value: function addProperties(builder, propertiesOffset) {
  100379. builder.addFieldOffset(1, propertiesOffset, 0);
  100380. }
  100381. }, {
  100382. key: "createPropertiesVector",
  100383. value: function createPropertiesVector(builder, data) {
  100384. builder.startVector(1, data.length, 1);
  100385. for (var i = data.length - 1; i >= 0; i--) {
  100386. builder.addInt8(data[i]);
  100387. }
  100388. return builder.endVector();
  100389. }
  100390. }, {
  100391. key: "startPropertiesVector",
  100392. value: function startPropertiesVector(builder, numElems) {
  100393. builder.startVector(1, numElems, 1);
  100394. }
  100395. }, {
  100396. key: "addColumns",
  100397. value: function addColumns(builder, columnsOffset) {
  100398. builder.addFieldOffset(2, columnsOffset, 0);
  100399. }
  100400. }, {
  100401. key: "createColumnsVector",
  100402. value: function createColumnsVector(builder, data) {
  100403. builder.startVector(4, data.length, 4);
  100404. for (var i = data.length - 1; i >= 0; i--) {
  100405. builder.addOffset(data[i]);
  100406. }
  100407. return builder.endVector();
  100408. }
  100409. }, {
  100410. key: "startColumnsVector",
  100411. value: function startColumnsVector(builder, numElems) {
  100412. builder.startVector(4, numElems, 4);
  100413. }
  100414. }, {
  100415. key: "endFeature",
  100416. value: function endFeature(builder) {
  100417. var offset = builder.endObject();
  100418. return offset;
  100419. }
  100420. }, {
  100421. key: "finishFeatureBuffer",
  100422. value: function finishFeatureBuffer(builder, offset) {
  100423. builder.finish(offset);
  100424. }
  100425. }, {
  100426. key: "finishSizePrefixedFeatureBuffer",
  100427. value: function finishSizePrefixedFeatureBuffer(builder, offset) {
  100428. builder.finish(offset, undefined, true);
  100429. }
  100430. }, {
  100431. key: "createFeature",
  100432. value: function createFeature(builder, geometryOffset, propertiesOffset, columnsOffset) {
  100433. Feature.startFeature(builder);
  100434. Feature.addGeometry(builder, geometryOffset);
  100435. Feature.addProperties(builder, propertiesOffset);
  100436. Feature.addColumns(builder, columnsOffset);
  100437. return Feature.endFeature(builder);
  100438. }
  100439. }]);
  100440. return Feature;
  100441. }();
  100442. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/generic/feature.js
  100443. var textEncoder = new TextEncoder();
  100444. var textDecoder = new TextDecoder();
  100445. function fromFeature(feature, header, createGeometry, createFeature) {
  100446. var columns = header.columns;
  100447. var geometry = feature.geometry();
  100448. var simpleGeometry = createGeometry(geometry, header.geometryType);
  100449. var properties = parseProperties(feature, columns);
  100450. return createFeature(simpleGeometry, properties);
  100451. }
  100452. function feature_buildFeature(geometry, properties, header) {
  100453. var columns = header.columns;
  100454. var builder = new flatbuffers.Builder();
  100455. var offset = 0;
  100456. var capacity = 1024;
  100457. var bytes = new Uint8Array(capacity);
  100458. var view = new DataView(bytes.buffer);
  100459. var prep = function prep(size) {
  100460. if (offset + size < capacity) return;
  100461. capacity = Math.max(capacity + size, capacity * 2);
  100462. var newBytes = new Uint8Array(capacity);
  100463. newBytes.set(bytes);
  100464. bytes = newBytes;
  100465. view = new DataView(bytes.buffer);
  100466. };
  100467. if (columns) {
  100468. for (var i = 0; i < columns.length; i++) {
  100469. var column = columns[i];
  100470. var value = properties[column.name];
  100471. if (value === null) continue;
  100472. prep(2);
  100473. view.setUint16(offset, i, true);
  100474. offset += 2;
  100475. switch (column.type) {
  100476. case ColumnType.Bool:
  100477. prep(1);
  100478. view.setUint8(offset, value);
  100479. offset += 1;
  100480. break;
  100481. case ColumnType.Short:
  100482. prep(2);
  100483. view.setInt16(offset, value, true);
  100484. offset += 2;
  100485. break;
  100486. case ColumnType.UShort:
  100487. prep(2);
  100488. view.setUint16(offset, value, true);
  100489. offset += 2;
  100490. break;
  100491. case ColumnType.Int:
  100492. prep(4);
  100493. view.setInt32(offset, value, true);
  100494. offset += 4;
  100495. break;
  100496. case ColumnType.UInt:
  100497. prep(4);
  100498. view.setUint32(offset, value, true);
  100499. offset += 4;
  100500. break;
  100501. case ColumnType.Long:
  100502. prep(8);
  100503. view.setBigInt64(offset, BigInt(value), true);
  100504. offset += 8;
  100505. break;
  100506. case ColumnType.Float:
  100507. prep(4);
  100508. view.setFloat32(offset, value, true);
  100509. offset += 4;
  100510. break;
  100511. case ColumnType.Double:
  100512. prep(8);
  100513. view.setFloat64(offset, value, true);
  100514. offset += 8;
  100515. break;
  100516. case ColumnType.DateTime:
  100517. case ColumnType.String:
  100518. {
  100519. var str = textEncoder.encode(value);
  100520. prep(4);
  100521. view.setUint32(offset, str.length, true);
  100522. offset += 4;
  100523. prep(str.length);
  100524. bytes.set(str, offset);
  100525. offset += str.length;
  100526. break;
  100527. }
  100528. case ColumnType.Json:
  100529. {
  100530. var _str = textEncoder.encode(JSON.stringify(value));
  100531. prep(4);
  100532. view.setUint32(offset, _str.length, true);
  100533. offset += 4;
  100534. prep(_str.length);
  100535. bytes.set(_str, offset);
  100536. offset += _str.length;
  100537. break;
  100538. }
  100539. default:
  100540. throw new Error('Unknown type ' + column.type);
  100541. }
  100542. }
  100543. }
  100544. var propertiesOffset = null;
  100545. if (offset > 0) propertiesOffset = Feature.createPropertiesVector(builder, bytes.slice(0, offset));
  100546. var geometryOffset = buildGeometry(builder, geometry);
  100547. Feature.startFeature(builder);
  100548. Feature.addGeometry(builder, geometryOffset);
  100549. if (propertiesOffset) Feature.addProperties(builder, propertiesOffset);
  100550. var featureOffset = Feature.endFeature(builder);
  100551. builder.finishSizePrefixed(featureOffset);
  100552. return builder.asUint8Array();
  100553. }
  100554. function parseProperties(feature, columns) {
  100555. var properties = {};
  100556. if (!columns || columns.length === 0) return properties;
  100557. var array = feature.propertiesArray();
  100558. if (!array) return properties;
  100559. var view = new DataView(array.buffer, array.byteOffset);
  100560. var length = feature.propertiesLength();
  100561. var offset = 0;
  100562. while (offset < length) {
  100563. var i = view.getUint16(offset, true);
  100564. offset += 2;
  100565. var column = columns[i];
  100566. var name = column.name;
  100567. switch (column.type) {
  100568. case column_type_ColumnType.Bool:
  100569. {
  100570. properties[name] = !!view.getUint8(offset);
  100571. offset += 1;
  100572. break;
  100573. }
  100574. case column_type_ColumnType.Byte:
  100575. {
  100576. properties[name] = view.getInt8(offset);
  100577. offset += 1;
  100578. break;
  100579. }
  100580. case column_type_ColumnType.UByte:
  100581. {
  100582. properties[name] = view.getUint8(offset);
  100583. offset += 1;
  100584. break;
  100585. }
  100586. case column_type_ColumnType.Short:
  100587. {
  100588. properties[name] = view.getInt16(offset, true);
  100589. offset += 2;
  100590. break;
  100591. }
  100592. case column_type_ColumnType.UShort:
  100593. {
  100594. properties[name] = view.getUint16(offset, true);
  100595. offset += 2;
  100596. break;
  100597. }
  100598. case column_type_ColumnType.Int:
  100599. {
  100600. properties[name] = view.getInt32(offset, true);
  100601. offset += 4;
  100602. break;
  100603. }
  100604. case column_type_ColumnType.UInt:
  100605. {
  100606. properties[name] = view.getUint32(offset, true);
  100607. offset += 4;
  100608. break;
  100609. }
  100610. case column_type_ColumnType.Long:
  100611. {
  100612. properties[name] = Number(view.getBigInt64(offset, true));
  100613. offset += 8;
  100614. break;
  100615. }
  100616. case column_type_ColumnType.ULong:
  100617. {
  100618. properties[name] = Number(view.getBigUint64(offset, true));
  100619. offset += 8;
  100620. break;
  100621. }
  100622. case column_type_ColumnType.Float:
  100623. {
  100624. properties[name] = view.getFloat32(offset, true);
  100625. offset += 4;
  100626. break;
  100627. }
  100628. case column_type_ColumnType.Double:
  100629. {
  100630. properties[name] = view.getFloat64(offset, true);
  100631. offset += 8;
  100632. break;
  100633. }
  100634. case column_type_ColumnType.DateTime:
  100635. case column_type_ColumnType.String:
  100636. {
  100637. var _length = view.getUint32(offset, true);
  100638. offset += 4;
  100639. properties[name] = textDecoder.decode(array.subarray(offset, offset + _length));
  100640. offset += _length;
  100641. break;
  100642. }
  100643. case column_type_ColumnType.Json:
  100644. {
  100645. var _length2 = view.getUint32(offset, true);
  100646. offset += 4;
  100647. var str = textDecoder.decode(array.subarray(offset, offset + _length2));
  100648. properties[name] = JSON.parse(str);
  100649. offset += _length2;
  100650. break;
  100651. }
  100652. default:
  100653. throw new Error('Unknown type ' + column.type);
  100654. }
  100655. }
  100656. return properties;
  100657. }
  100658. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/geojson/feature.js
  100659. function feature_fromFeature(feature, header) {
  100660. var columns = header.columns;
  100661. var geometry = fromGeometry(feature.geometry(), header.geometryType);
  100662. var geoJsonfeature = {
  100663. type: 'Feature',
  100664. geometry: geometry,
  100665. properties: parseProperties(feature, columns)
  100666. };
  100667. return geoJsonfeature;
  100668. }
  100669. // EXTERNAL MODULE: ./node_modules/slice-source/dist/slice-source.js
  100670. var slice_source = __webpack_require__(3425);
  100671. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/flat-geobuf/crs.js
  100672. function crs_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  100673. function crs_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  100674. function crs_createClass(Constructor, protoProps, staticProps) { if (protoProps) crs_defineProperties(Constructor.prototype, protoProps); if (staticProps) crs_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  100675. var Crs = /*#__PURE__*/function () {
  100676. function Crs() {
  100677. crs_classCallCheck(this, Crs);
  100678. this.bb = null;
  100679. this.bb_pos = 0;
  100680. }
  100681. crs_createClass(Crs, [{
  100682. key: "__init",
  100683. value: function __init(i, bb) {
  100684. this.bb_pos = i;
  100685. this.bb = bb;
  100686. return this;
  100687. }
  100688. }, {
  100689. key: "org",
  100690. value: function org(optionalEncoding) {
  100691. var offset = this.bb.__offset(this.bb_pos, 4);
  100692. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  100693. }
  100694. }, {
  100695. key: "code",
  100696. value: function code() {
  100697. var offset = this.bb.__offset(this.bb_pos, 6);
  100698. return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
  100699. }
  100700. }, {
  100701. key: "name",
  100702. value: function name(optionalEncoding) {
  100703. var offset = this.bb.__offset(this.bb_pos, 8);
  100704. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  100705. }
  100706. }, {
  100707. key: "description",
  100708. value: function description(optionalEncoding) {
  100709. var offset = this.bb.__offset(this.bb_pos, 10);
  100710. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  100711. }
  100712. }, {
  100713. key: "wkt",
  100714. value: function wkt(optionalEncoding) {
  100715. var offset = this.bb.__offset(this.bb_pos, 12);
  100716. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  100717. }
  100718. }, {
  100719. key: "codeString",
  100720. value: function codeString(optionalEncoding) {
  100721. var offset = this.bb.__offset(this.bb_pos, 14);
  100722. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  100723. }
  100724. }], [{
  100725. key: "getRootAsCrs",
  100726. value: function getRootAsCrs(bb, obj) {
  100727. return (obj || new Crs()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  100728. }
  100729. }, {
  100730. key: "getSizePrefixedRootAsCrs",
  100731. value: function getSizePrefixedRootAsCrs(bb, obj) {
  100732. bb.setPosition(bb.position() + js_flatbuffers/* SIZE_PREFIX_LENGTH */.XU);
  100733. return (obj || new Crs()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  100734. }
  100735. }, {
  100736. key: "startCrs",
  100737. value: function startCrs(builder) {
  100738. builder.startObject(6);
  100739. }
  100740. }, {
  100741. key: "addOrg",
  100742. value: function addOrg(builder, orgOffset) {
  100743. builder.addFieldOffset(0, orgOffset, 0);
  100744. }
  100745. }, {
  100746. key: "addCode",
  100747. value: function addCode(builder, code) {
  100748. builder.addFieldInt32(1, code, 0);
  100749. }
  100750. }, {
  100751. key: "addName",
  100752. value: function addName(builder, nameOffset) {
  100753. builder.addFieldOffset(2, nameOffset, 0);
  100754. }
  100755. }, {
  100756. key: "addDescription",
  100757. value: function addDescription(builder, descriptionOffset) {
  100758. builder.addFieldOffset(3, descriptionOffset, 0);
  100759. }
  100760. }, {
  100761. key: "addWkt",
  100762. value: function addWkt(builder, wktOffset) {
  100763. builder.addFieldOffset(4, wktOffset, 0);
  100764. }
  100765. }, {
  100766. key: "addCodeString",
  100767. value: function addCodeString(builder, codeStringOffset) {
  100768. builder.addFieldOffset(5, codeStringOffset, 0);
  100769. }
  100770. }, {
  100771. key: "endCrs",
  100772. value: function endCrs(builder) {
  100773. var offset = builder.endObject();
  100774. return offset;
  100775. }
  100776. }, {
  100777. key: "createCrs",
  100778. value: function createCrs(builder, orgOffset, code, nameOffset, descriptionOffset, wktOffset, codeStringOffset) {
  100779. Crs.startCrs(builder);
  100780. Crs.addOrg(builder, orgOffset);
  100781. Crs.addCode(builder, code);
  100782. Crs.addName(builder, nameOffset);
  100783. Crs.addDescription(builder, descriptionOffset);
  100784. Crs.addWkt(builder, wktOffset);
  100785. Crs.addCodeString(builder, codeStringOffset);
  100786. return Crs.endCrs(builder);
  100787. }
  100788. }]);
  100789. return Crs;
  100790. }();
  100791. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/flat-geobuf/header.js
  100792. function header_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  100793. function header_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  100794. function header_createClass(Constructor, protoProps, staticProps) { if (protoProps) header_defineProperties(Constructor.prototype, protoProps); if (staticProps) header_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  100795. var header_Header = /*#__PURE__*/function () {
  100796. function Header() {
  100797. header_classCallCheck(this, Header);
  100798. this.bb = null;
  100799. this.bb_pos = 0;
  100800. }
  100801. header_createClass(Header, [{
  100802. key: "__init",
  100803. value: function __init(i, bb) {
  100804. this.bb_pos = i;
  100805. this.bb = bb;
  100806. return this;
  100807. }
  100808. }, {
  100809. key: "name",
  100810. value: function name(optionalEncoding) {
  100811. var offset = this.bb.__offset(this.bb_pos, 4);
  100812. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  100813. }
  100814. }, {
  100815. key: "envelope",
  100816. value: function envelope(index) {
  100817. var offset = this.bb.__offset(this.bb_pos, 6);
  100818. return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
  100819. }
  100820. }, {
  100821. key: "envelopeLength",
  100822. value: function envelopeLength() {
  100823. var offset = this.bb.__offset(this.bb_pos, 6);
  100824. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  100825. }
  100826. }, {
  100827. key: "envelopeArray",
  100828. value: function envelopeArray() {
  100829. var offset = this.bb.__offset(this.bb_pos, 6);
  100830. return offset ? new Float64Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
  100831. }
  100832. }, {
  100833. key: "geometryType",
  100834. value: function geometryType() {
  100835. var offset = this.bb.__offset(this.bb_pos, 8);
  100836. return offset ? this.bb.readUint8(this.bb_pos + offset) : geometry_type_GeometryType.Unknown;
  100837. }
  100838. }, {
  100839. key: "hasZ",
  100840. value: function hasZ() {
  100841. var offset = this.bb.__offset(this.bb_pos, 10);
  100842. return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
  100843. }
  100844. }, {
  100845. key: "hasM",
  100846. value: function hasM() {
  100847. var offset = this.bb.__offset(this.bb_pos, 12);
  100848. return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
  100849. }
  100850. }, {
  100851. key: "hasT",
  100852. value: function hasT() {
  100853. var offset = this.bb.__offset(this.bb_pos, 14);
  100854. return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
  100855. }
  100856. }, {
  100857. key: "hasTm",
  100858. value: function hasTm() {
  100859. var offset = this.bb.__offset(this.bb_pos, 16);
  100860. return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
  100861. }
  100862. }, {
  100863. key: "columns",
  100864. value: function columns(index, obj) {
  100865. var offset = this.bb.__offset(this.bb_pos, 18);
  100866. return offset ? (obj || new column_Column()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
  100867. }
  100868. }, {
  100869. key: "columnsLength",
  100870. value: function columnsLength() {
  100871. var offset = this.bb.__offset(this.bb_pos, 18);
  100872. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  100873. }
  100874. }, {
  100875. key: "featuresCount",
  100876. value: function featuresCount() {
  100877. var offset = this.bb.__offset(this.bb_pos, 20);
  100878. return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
  100879. }
  100880. }, {
  100881. key: "indexNodeSize",
  100882. value: function indexNodeSize() {
  100883. var offset = this.bb.__offset(this.bb_pos, 22);
  100884. return offset ? this.bb.readUint16(this.bb_pos + offset) : 16;
  100885. }
  100886. }, {
  100887. key: "crs",
  100888. value: function crs(obj) {
  100889. var offset = this.bb.__offset(this.bb_pos, 24);
  100890. return offset ? (obj || new Crs()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
  100891. }
  100892. }, {
  100893. key: "title",
  100894. value: function title(optionalEncoding) {
  100895. var offset = this.bb.__offset(this.bb_pos, 26);
  100896. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  100897. }
  100898. }, {
  100899. key: "description",
  100900. value: function description(optionalEncoding) {
  100901. var offset = this.bb.__offset(this.bb_pos, 28);
  100902. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  100903. }
  100904. }, {
  100905. key: "metadata",
  100906. value: function metadata(optionalEncoding) {
  100907. var offset = this.bb.__offset(this.bb_pos, 30);
  100908. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  100909. }
  100910. }], [{
  100911. key: "getRootAsHeader",
  100912. value: function getRootAsHeader(bb, obj) {
  100913. return (obj || new Header()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  100914. }
  100915. }, {
  100916. key: "getSizePrefixedRootAsHeader",
  100917. value: function getSizePrefixedRootAsHeader(bb, obj) {
  100918. bb.setPosition(bb.position() + js_flatbuffers/* SIZE_PREFIX_LENGTH */.XU);
  100919. return (obj || new Header()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  100920. }
  100921. }, {
  100922. key: "startHeader",
  100923. value: function startHeader(builder) {
  100924. builder.startObject(14);
  100925. }
  100926. }, {
  100927. key: "addName",
  100928. value: function addName(builder, nameOffset) {
  100929. builder.addFieldOffset(0, nameOffset, 0);
  100930. }
  100931. }, {
  100932. key: "addEnvelope",
  100933. value: function addEnvelope(builder, envelopeOffset) {
  100934. builder.addFieldOffset(1, envelopeOffset, 0);
  100935. }
  100936. }, {
  100937. key: "createEnvelopeVector",
  100938. value: function createEnvelopeVector(builder, data) {
  100939. builder.startVector(8, data.length, 8);
  100940. for (var i = data.length - 1; i >= 0; i--) {
  100941. builder.addFloat64(data[i]);
  100942. }
  100943. return builder.endVector();
  100944. }
  100945. }, {
  100946. key: "startEnvelopeVector",
  100947. value: function startEnvelopeVector(builder, numElems) {
  100948. builder.startVector(8, numElems, 8);
  100949. }
  100950. }, {
  100951. key: "addGeometryType",
  100952. value: function addGeometryType(builder, geometryType) {
  100953. builder.addFieldInt8(2, geometryType, geometry_type_GeometryType.Unknown);
  100954. }
  100955. }, {
  100956. key: "addHasZ",
  100957. value: function addHasZ(builder, hasZ) {
  100958. builder.addFieldInt8(3, +hasZ, +false);
  100959. }
  100960. }, {
  100961. key: "addHasM",
  100962. value: function addHasM(builder, hasM) {
  100963. builder.addFieldInt8(4, +hasM, +false);
  100964. }
  100965. }, {
  100966. key: "addHasT",
  100967. value: function addHasT(builder, hasT) {
  100968. builder.addFieldInt8(5, +hasT, +false);
  100969. }
  100970. }, {
  100971. key: "addHasTm",
  100972. value: function addHasTm(builder, hasTm) {
  100973. builder.addFieldInt8(6, +hasTm, +false);
  100974. }
  100975. }, {
  100976. key: "addColumns",
  100977. value: function addColumns(builder, columnsOffset) {
  100978. builder.addFieldOffset(7, columnsOffset, 0);
  100979. }
  100980. }, {
  100981. key: "createColumnsVector",
  100982. value: function createColumnsVector(builder, data) {
  100983. builder.startVector(4, data.length, 4);
  100984. for (var i = data.length - 1; i >= 0; i--) {
  100985. builder.addOffset(data[i]);
  100986. }
  100987. return builder.endVector();
  100988. }
  100989. }, {
  100990. key: "startColumnsVector",
  100991. value: function startColumnsVector(builder, numElems) {
  100992. builder.startVector(4, numElems, 4);
  100993. }
  100994. }, {
  100995. key: "addFeaturesCount",
  100996. value: function addFeaturesCount(builder, featuresCount) {
  100997. builder.addFieldInt64(8, featuresCount, BigInt('0'));
  100998. }
  100999. }, {
  101000. key: "addIndexNodeSize",
  101001. value: function addIndexNodeSize(builder, indexNodeSize) {
  101002. builder.addFieldInt16(9, indexNodeSize, 16);
  101003. }
  101004. }, {
  101005. key: "addCrs",
  101006. value: function addCrs(builder, crsOffset) {
  101007. builder.addFieldOffset(10, crsOffset, 0);
  101008. }
  101009. }, {
  101010. key: "addTitle",
  101011. value: function addTitle(builder, titleOffset) {
  101012. builder.addFieldOffset(11, titleOffset, 0);
  101013. }
  101014. }, {
  101015. key: "addDescription",
  101016. value: function addDescription(builder, descriptionOffset) {
  101017. builder.addFieldOffset(12, descriptionOffset, 0);
  101018. }
  101019. }, {
  101020. key: "addMetadata",
  101021. value: function addMetadata(builder, metadataOffset) {
  101022. builder.addFieldOffset(13, metadataOffset, 0);
  101023. }
  101024. }, {
  101025. key: "endHeader",
  101026. value: function endHeader(builder) {
  101027. var offset = builder.endObject();
  101028. return offset;
  101029. }
  101030. }, {
  101031. key: "finishHeaderBuffer",
  101032. value: function finishHeaderBuffer(builder, offset) {
  101033. builder.finish(offset);
  101034. }
  101035. }, {
  101036. key: "finishSizePrefixedHeaderBuffer",
  101037. value: function finishSizePrefixedHeaderBuffer(builder, offset) {
  101038. builder.finish(offset, undefined, true);
  101039. }
  101040. }]);
  101041. return Header;
  101042. }();
  101043. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/header-meta.js
  101044. function fromByteBuffer(bb) {
  101045. var header = header_Header.getRootAsHeader(bb);
  101046. var featuresCount = header.featuresCount();
  101047. var indexNodeSize = header.indexNodeSize();
  101048. var columns = [];
  101049. for (var j = 0; j < header.columnsLength(); j++) {
  101050. var column = header.columns(j);
  101051. if (!column) throw new Error('Column unexpectedly missing');
  101052. if (!column.name()) throw new Error('Column name unexpectedly missing');
  101053. columns.push({
  101054. name: column.name(),
  101055. type: column.type(),
  101056. title: column.title(),
  101057. description: column.description(),
  101058. width: column.width(),
  101059. precision: column.precision(),
  101060. scale: column.scale(),
  101061. nullable: column.nullable(),
  101062. unique: column.unique(),
  101063. primary_key: column.primaryKey()
  101064. });
  101065. }
  101066. var crs = header.crs();
  101067. var crsMeta = crs ? {
  101068. org: crs.org(),
  101069. code: crs.code(),
  101070. name: crs.name(),
  101071. description: crs.description(),
  101072. wkt: crs.wkt(),
  101073. code_string: crs.codeString()
  101074. } : null;
  101075. var headerMeta = {
  101076. geometryType: header.geometryType(),
  101077. columns: columns,
  101078. envelope: null,
  101079. featuresCount: Number(featuresCount),
  101080. indexNodeSize: indexNodeSize,
  101081. crs: crsMeta,
  101082. title: header.title(),
  101083. description: header.description(),
  101084. metadata: header.metadata()
  101085. };
  101086. return headerMeta;
  101087. }
  101088. // EXTERNAL MODULE: ./node_modules/@repeaterjs/repeater/cjs/repeater.js
  101089. var repeater = __webpack_require__(1351);
  101090. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/config.js
  101091. function config_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  101092. function config_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  101093. function config_createClass(Constructor, protoProps, staticProps) { if (protoProps) config_defineProperties(Constructor.prototype, protoProps); if (staticProps) config_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  101094. var config_Config = /*#__PURE__*/function () {
  101095. function Config() {
  101096. config_classCallCheck(this, Config);
  101097. this._extraRequestThreshold = 256 * 1024;
  101098. }
  101099. config_createClass(Config, [{
  101100. key: "extraRequestThreshold",
  101101. value: function extraRequestThreshold() {
  101102. return this._extraRequestThreshold;
  101103. }
  101104. }, {
  101105. key: "setExtraRequestThreshold",
  101106. value: function setExtraRequestThreshold(bytes) {
  101107. if (bytes < 0) {
  101108. throw new Error('extraRequestThreshold cannot be negative');
  101109. }
  101110. this._extraRequestThreshold = bytes;
  101111. }
  101112. }]);
  101113. return Config;
  101114. }();
  101115. config_Config.global = new config_Config();
  101116. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/logger.js
  101117. function logger_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  101118. function logger_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  101119. function logger_createClass(Constructor, protoProps, staticProps) { if (protoProps) logger_defineProperties(Constructor.prototype, protoProps); if (staticProps) logger_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  101120. var LogLevel;
  101121. (function (LogLevel) {
  101122. LogLevel[LogLevel["Debug"] = 0] = "Debug";
  101123. LogLevel[LogLevel["Info"] = 1] = "Info";
  101124. LogLevel[LogLevel["Warn"] = 2] = "Warn";
  101125. LogLevel[LogLevel["Error"] = 3] = "Error";
  101126. })(LogLevel || (LogLevel = {}));
  101127. var Logger = /*#__PURE__*/function () {
  101128. function Logger() {
  101129. logger_classCallCheck(this, Logger);
  101130. }
  101131. logger_createClass(Logger, null, [{
  101132. key: "debug",
  101133. value: function debug() {
  101134. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  101135. args[_key] = arguments[_key];
  101136. }
  101137. this.log.apply(this, [LogLevel.Debug].concat(args));
  101138. }
  101139. }, {
  101140. key: "info",
  101141. value: function info() {
  101142. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  101143. args[_key2] = arguments[_key2];
  101144. }
  101145. this.log.apply(this, [LogLevel.Info].concat(args));
  101146. }
  101147. }, {
  101148. key: "warn",
  101149. value: function warn() {
  101150. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  101151. args[_key3] = arguments[_key3];
  101152. }
  101153. this.log.apply(this, [LogLevel.Warn].concat(args));
  101154. }
  101155. }, {
  101156. key: "error",
  101157. value: function error() {
  101158. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  101159. args[_key4] = arguments[_key4];
  101160. }
  101161. this.log.apply(this, [LogLevel.Error].concat(args));
  101162. }
  101163. }, {
  101164. key: "log",
  101165. value: function log(level) {
  101166. if (this.logLevel > level) {
  101167. return;
  101168. }
  101169. for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
  101170. args[_key5 - 1] = arguments[_key5];
  101171. }
  101172. switch (level) {
  101173. case LogLevel.Debug:
  101174. {
  101175. var _console;
  101176. (_console = console).debug.apply(_console, args);
  101177. break;
  101178. }
  101179. case LogLevel.Info:
  101180. {
  101181. var _console2;
  101182. (_console2 = console).info.apply(_console2, args);
  101183. break;
  101184. }
  101185. case LogLevel.Warn:
  101186. {
  101187. var _console3;
  101188. (_console3 = console).warn.apply(_console3, args);
  101189. break;
  101190. }
  101191. case LogLevel.Error:
  101192. {
  101193. var _console4;
  101194. (_console4 = console).error.apply(_console4, args);
  101195. break;
  101196. }
  101197. }
  101198. }
  101199. }]);
  101200. return Logger;
  101201. }();
  101202. Logger.logLevel = LogLevel.Info;
  101203. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/packedrtree.js
  101204. function packedrtree_typeof(obj) { "@babel/helpers - typeof"; return packedrtree_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, packedrtree_typeof(obj); }
  101205. function packedrtree_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ packedrtree_regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == packedrtree_typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
  101206. function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || packedrtree_unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
  101207. function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  101208. function packedrtree_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return packedrtree_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return packedrtree_arrayLikeToArray(o, minLen); }
  101209. function packedrtree_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  101210. function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
  101211. function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  101212. function packedrtree_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  101213. function packedrtree_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  101214. function packedrtree_createClass(Constructor, protoProps, staticProps) { if (protoProps) packedrtree_defineProperties(Constructor.prototype, protoProps); if (staticProps) packedrtree_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  101215. function _awaitAsyncGenerator(value) { return new _OverloadYield(value, 0); }
  101216. function _wrapAsyncGenerator(fn) { return function () { return new _AsyncGenerator(fn.apply(this, arguments)); }; }
  101217. function _AsyncGenerator(gen) { var front, back; function resume(key, arg) { try { var result = gen[key](arg), value = result.value, overloaded = value instanceof _OverloadYield; Promise.resolve(overloaded ? value.v : value).then(function (arg) { if (overloaded) { var nextKey = "return" === key ? "return" : "next"; if (!value.k || arg.done) return resume(nextKey, arg); arg = gen[nextKey](arg).value; } settle(result.done ? "return" : "normal", arg); }, function (err) { resume("throw", err); }); } catch (err) { settle("throw", err); } } function settle(type, value) { switch (type) { case "return": front.resolve({ value: value, done: !0 }); break; case "throw": front.reject(value); break; default: front.resolve({ value: value, done: !1 }); } (front = front.next) ? resume(front.key, front.arg) : back = null; } this._invoke = function (key, arg) { return new Promise(function (resolve, reject) { var request = { key: key, arg: arg, resolve: resolve, reject: reject, next: null }; back ? back = back.next = request : (front = back = request, resume(key, arg)); }); }, "function" != typeof gen["return"] && (this["return"] = void 0); }
  101218. _AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function () { return this; }, _AsyncGenerator.prototype.next = function (arg) { return this._invoke("next", arg); }, _AsyncGenerator.prototype["throw"] = function (arg) { return this._invoke("throw", arg); }, _AsyncGenerator.prototype["return"] = function (arg) { return this._invoke("return", arg); };
  101219. function _OverloadYield(value, kind) { this.v = value, this.k = kind; }
  101220. var NODE_ITEM_LEN = 8 * 4 + 8;
  101221. var DEFAULT_NODE_SIZE = 16;
  101222. function calcTreeSize(numItems, nodeSize) {
  101223. nodeSize = Math.min(Math.max(+nodeSize, 2), 65535);
  101224. var n = numItems;
  101225. var numNodes = n;
  101226. do {
  101227. n = Math.ceil(n / nodeSize);
  101228. numNodes += n;
  101229. } while (n !== 1);
  101230. return numNodes * NODE_ITEM_LEN;
  101231. }
  101232. function generateLevelBounds(numItems, nodeSize) {
  101233. if (nodeSize < 2) throw new Error('Node size must be at least 2');
  101234. if (numItems === 0) throw new Error('Number of items must be greater than 0');
  101235. var n = numItems;
  101236. var numNodes = n;
  101237. var levelNumNodes = [n];
  101238. do {
  101239. n = Math.ceil(n / nodeSize);
  101240. numNodes += n;
  101241. levelNumNodes.push(n);
  101242. } while (n !== 1);
  101243. var levelOffsets = [];
  101244. n = numNodes;
  101245. for (var _i = 0, _levelNumNodes = levelNumNodes; _i < _levelNumNodes.length; _i++) {
  101246. var size = _levelNumNodes[_i];
  101247. levelOffsets.push(n - size);
  101248. n -= size;
  101249. }
  101250. levelOffsets.reverse();
  101251. levelNumNodes.reverse();
  101252. var levelBounds = [];
  101253. for (var i = 0; i < levelNumNodes.length; i++) levelBounds.push([levelOffsets[i], levelOffsets[i] + levelNumNodes[i]]);
  101254. levelBounds.reverse();
  101255. return levelBounds;
  101256. }
  101257. function streamSearch(_x, _x2, _x3, _x4) {
  101258. return _streamSearch.apply(this, arguments);
  101259. }
  101260. function _streamSearch() {
  101261. _streamSearch = _wrapAsyncGenerator( /*#__PURE__*/packedrtree_regeneratorRuntime().mark(function _callee(numItems, nodeSize, rect, readNode) {
  101262. var NodeRange, minX, minY, maxX, maxY, levelBounds, leafNodesOffset, rootNodeRange, queue, _loop;
  101263. return packedrtree_regeneratorRuntime().wrap(function _callee$(_context3) {
  101264. while (1) switch (_context3.prev = _context3.next) {
  101265. case 0:
  101266. NodeRange = /*#__PURE__*/function () {
  101267. function NodeRange(nodes, level) {
  101268. packedrtree_classCallCheck(this, NodeRange);
  101269. this._level = level;
  101270. this.nodes = nodes;
  101271. }
  101272. packedrtree_createClass(NodeRange, [{
  101273. key: "level",
  101274. value: function level() {
  101275. return this._level;
  101276. }
  101277. }, {
  101278. key: "startNode",
  101279. value: function startNode() {
  101280. return this.nodes[0];
  101281. }
  101282. }, {
  101283. key: "endNode",
  101284. value: function endNode() {
  101285. return this.nodes[1];
  101286. }
  101287. }, {
  101288. key: "extendEndNodeToNewOffset",
  101289. value: function extendEndNodeToNewOffset(newOffset) {
  101290. console.assert(newOffset > this.nodes[1]);
  101291. this.nodes[1] = newOffset;
  101292. }
  101293. }, {
  101294. key: "toString",
  101295. value: function toString() {
  101296. return "[NodeRange level: ".concat(this._level, ", nodes: ").concat(this.nodes[0], "-").concat(this.nodes[1], "]");
  101297. }
  101298. }]);
  101299. return NodeRange;
  101300. }();
  101301. minX = rect.minX, minY = rect.minY, maxX = rect.maxX, maxY = rect.maxY;
  101302. Logger.info("tree items: ".concat(numItems, ", nodeSize: ").concat(nodeSize));
  101303. levelBounds = generateLevelBounds(numItems, nodeSize);
  101304. leafNodesOffset = levelBounds[0][0];
  101305. rootNodeRange = function () {
  101306. var range = [0, 1];
  101307. var level = levelBounds.length - 1;
  101308. return new NodeRange(range, level);
  101309. }();
  101310. queue = [rootNodeRange];
  101311. Logger.debug("starting stream search with queue: ".concat(queue, ", numItems: ").concat(numItems, ", nodeSize: ").concat(nodeSize, ", levelBounds: ").concat(levelBounds));
  101312. _loop = /*#__PURE__*/packedrtree_regeneratorRuntime().mark(function _loop() {
  101313. var nodeRange, nodeIndex, isLeafNode, _levelBounds$nodeRang, levelBound, end, length, buffer, float64Array, uint32Array, _loop2, _ret, pos;
  101314. return packedrtree_regeneratorRuntime().wrap(function _loop$(_context2) {
  101315. while (1) switch (_context2.prev = _context2.next) {
  101316. case 0:
  101317. nodeRange = queue.shift();
  101318. Logger.debug("popped node: ".concat(nodeRange, ", queueLength: ").concat(queue.length));
  101319. nodeIndex = nodeRange.startNode();
  101320. isLeafNode = nodeIndex >= leafNodesOffset;
  101321. _levelBounds$nodeRang = _slicedToArray(levelBounds[nodeRange.level()], 2), levelBound = _levelBounds$nodeRang[1];
  101322. end = Math.min(nodeRange.endNode() + nodeSize, levelBound);
  101323. length = end - nodeIndex;
  101324. _context2.next = 9;
  101325. return _awaitAsyncGenerator(readNode(nodeIndex * NODE_ITEM_LEN, length * NODE_ITEM_LEN));
  101326. case 9:
  101327. buffer = _context2.sent;
  101328. float64Array = new Float64Array(buffer);
  101329. uint32Array = new Uint32Array(buffer);
  101330. _loop2 = /*#__PURE__*/packedrtree_regeneratorRuntime().mark(function _loop2(pos) {
  101331. var nodePos, low32Offset, high32Offset, offset, featureLength, extraRequestThresholdNodes, nearestNodeRange, newNodeRange;
  101332. return packedrtree_regeneratorRuntime().wrap(function _loop2$(_context) {
  101333. while (1) switch (_context.prev = _context.next) {
  101334. case 0:
  101335. nodePos = (pos - nodeIndex) * 5;
  101336. if (!(maxX < float64Array[nodePos + 0])) {
  101337. _context.next = 3;
  101338. break;
  101339. }
  101340. return _context.abrupt("return", 0);
  101341. case 3:
  101342. if (!(maxY < float64Array[nodePos + 1])) {
  101343. _context.next = 5;
  101344. break;
  101345. }
  101346. return _context.abrupt("return", 0);
  101347. case 5:
  101348. if (!(minX > float64Array[nodePos + 2])) {
  101349. _context.next = 7;
  101350. break;
  101351. }
  101352. return _context.abrupt("return", 0);
  101353. case 7:
  101354. if (!(minY > float64Array[nodePos + 3])) {
  101355. _context.next = 9;
  101356. break;
  101357. }
  101358. return _context.abrupt("return", 0);
  101359. case 9:
  101360. low32Offset = uint32Array[(nodePos << 1) + 8];
  101361. high32Offset = uint32Array[(nodePos << 1) + 9];
  101362. offset = readUint52(high32Offset, low32Offset);
  101363. if (!isLeafNode) {
  101364. _context.next = 17;
  101365. break;
  101366. }
  101367. featureLength = function () {
  101368. if (pos < numItems - 1) {
  101369. var nextPos = (pos - nodeIndex + 1) * 5;
  101370. var _low32Offset = uint32Array[(nextPos << 1) + 8];
  101371. var _high32Offset = uint32Array[(nextPos << 1) + 9];
  101372. var nextOffset = readUint52(_high32Offset, _low32Offset);
  101373. return nextOffset - offset;
  101374. } else {
  101375. return null;
  101376. }
  101377. }();
  101378. _context.next = 16;
  101379. return [offset, pos - leafNodesOffset, featureLength];
  101380. case 16:
  101381. return _context.abrupt("return", 0);
  101382. case 17:
  101383. extraRequestThresholdNodes = config_Config.global.extraRequestThreshold() / NODE_ITEM_LEN;
  101384. nearestNodeRange = queue[queue.length - 1];
  101385. if (!(nearestNodeRange !== undefined && nearestNodeRange.level() == nodeRange.level() - 1 && offset < nearestNodeRange.endNode() + extraRequestThresholdNodes)) {
  101386. _context.next = 23;
  101387. break;
  101388. }
  101389. Logger.debug("Merging \"nodeRange\" request into existing range: ".concat(nearestNodeRange, ", newOffset: ").concat(nearestNodeRange.endNode(), " -> ").concat(offset));
  101390. nearestNodeRange.extendEndNodeToNewOffset(offset);
  101391. return _context.abrupt("return", 0);
  101392. case 23:
  101393. newNodeRange = function () {
  101394. var level = nodeRange.level() - 1;
  101395. var range = [offset, offset + 1];
  101396. return new NodeRange(range, level);
  101397. }();
  101398. if (nearestNodeRange !== undefined && nearestNodeRange.level() == newNodeRange.level()) {
  101399. Logger.info("Same level, but too far away. Pushing new request at offset: ".concat(offset, " rather than merging with distant ").concat(nearestNodeRange));
  101400. } else {
  101401. Logger.info("Pushing new level for ".concat(newNodeRange, " onto queue with nearestNodeRange: ").concat(nearestNodeRange, " since there's not already a range for this level."));
  101402. }
  101403. queue.push(newNodeRange);
  101404. case 26:
  101405. case "end":
  101406. return _context.stop();
  101407. }
  101408. }, _loop2);
  101409. });
  101410. pos = nodeIndex;
  101411. case 14:
  101412. if (!(pos < end)) {
  101413. _context2.next = 22;
  101414. break;
  101415. }
  101416. return _context2.delegateYield(_loop2(pos), "t0", 16);
  101417. case 16:
  101418. _ret = _context2.t0;
  101419. if (!(_ret === 0)) {
  101420. _context2.next = 19;
  101421. break;
  101422. }
  101423. return _context2.abrupt("continue", 19);
  101424. case 19:
  101425. pos++;
  101426. _context2.next = 14;
  101427. break;
  101428. case 22:
  101429. case "end":
  101430. return _context2.stop();
  101431. }
  101432. }, _loop);
  101433. });
  101434. case 9:
  101435. if (!(queue.length != 0)) {
  101436. _context3.next = 13;
  101437. break;
  101438. }
  101439. return _context3.delegateYield(_loop(), "t0", 11);
  101440. case 11:
  101441. _context3.next = 9;
  101442. break;
  101443. case 13:
  101444. case "end":
  101445. return _context3.stop();
  101446. }
  101447. }, _callee);
  101448. }));
  101449. return _streamSearch.apply(this, arguments);
  101450. }
  101451. function readUint52(high32Bits, low32Bits) {
  101452. if ((high32Bits & 0xfff00000) != 0) {
  101453. throw Error('integer is too large to be safely represented');
  101454. }
  101455. var result = low32Bits + high32Bits * Math.pow(2, 32);
  101456. return result;
  101457. }
  101458. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/constants.js
  101459. var constants_magicbytes = new Uint8Array([0x66, 0x67, 0x62, 0x03, 0x66, 0x67, 0x62, 0x00]);
  101460. var SIZE_PREFIX_LEN = 4;
  101461. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/http-reader.js
  101462. function http_reader_typeof(obj) { "@babel/helpers - typeof"; return http_reader_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, http_reader_typeof(obj); }
  101463. function http_reader_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = http_reader_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
  101464. function http_reader_slicedToArray(arr, i) { return http_reader_arrayWithHoles(arr) || http_reader_iterableToArrayLimit(arr, i) || http_reader_unsupportedIterableToArray(arr, i) || http_reader_nonIterableRest(); }
  101465. function http_reader_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  101466. function http_reader_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return http_reader_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return http_reader_arrayLikeToArray(o, minLen); }
  101467. function http_reader_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  101468. function http_reader_iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
  101469. function http_reader_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  101470. function http_reader_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ http_reader_regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == http_reader_typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
  101471. function http_reader_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
  101472. function http_reader_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { http_reader_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { http_reader_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
  101473. function http_reader_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  101474. function http_reader_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  101475. function http_reader_createClass(Constructor, protoProps, staticProps) { if (protoProps) http_reader_defineProperties(Constructor.prototype, protoProps); if (staticProps) http_reader_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  101476. function http_reader_wrapAsyncGenerator(fn) { return function () { return new http_reader_AsyncGenerator(fn.apply(this, arguments)); }; }
  101477. function http_reader_AsyncGenerator(gen) { var front, back; function resume(key, arg) { try { var result = gen[key](arg), value = result.value, overloaded = value instanceof http_reader_OverloadYield; Promise.resolve(overloaded ? value.v : value).then(function (arg) { if (overloaded) { var nextKey = "return" === key ? "return" : "next"; if (!value.k || arg.done) return resume(nextKey, arg); arg = gen[nextKey](arg).value; } settle(result.done ? "return" : "normal", arg); }, function (err) { resume("throw", err); }); } catch (err) { settle("throw", err); } } function settle(type, value) { switch (type) { case "return": front.resolve({ value: value, done: !0 }); break; case "throw": front.reject(value); break; default: front.resolve({ value: value, done: !1 }); } (front = front.next) ? resume(front.key, front.arg) : back = null; } this._invoke = function (key, arg) { return new Promise(function (resolve, reject) { var request = { key: key, arg: arg, resolve: resolve, reject: reject, next: null }; back ? back = back.next = request : (front = back = request, resume(key, arg)); }); }, "function" != typeof gen["return"] && (this["return"] = void 0); }
  101478. http_reader_AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function () { return this; }, http_reader_AsyncGenerator.prototype.next = function (arg) { return this._invoke("next", arg); }, http_reader_AsyncGenerator.prototype["throw"] = function (arg) { return this._invoke("throw", arg); }, http_reader_AsyncGenerator.prototype["return"] = function (arg) { return this._invoke("return", arg); };
  101479. function http_reader_awaitAsyncGenerator(value) { return new http_reader_OverloadYield(value, 0); }
  101480. function _asyncGeneratorDelegate(inner) { var iter = {}, waiting = !1; function pump(key, value) { return waiting = !0, value = new Promise(function (resolve) { resolve(inner[key](value)); }), { done: !1, value: new http_reader_OverloadYield(value, 1) }; } return iter["undefined" != typeof Symbol && Symbol.iterator || "@@iterator"] = function () { return this; }, iter.next = function (value) { return waiting ? (waiting = !1, value) : pump("next", value); }, "function" == typeof inner["throw"] && (iter["throw"] = function (value) { if (waiting) throw waiting = !1, value; return pump("throw", value); }), "function" == typeof inner["return"] && (iter["return"] = function (value) { return waiting ? (waiting = !1, value) : pump("return", value); }), iter; }
  101481. function http_reader_OverloadYield(value, kind) { this.v = value, this.k = kind; }
  101482. function _asyncIterator(iterable) { var method, async, sync, retry = 2; for ("undefined" != typeof Symbol && (async = Symbol.asyncIterator, sync = Symbol.iterator); retry--;) { if (async && null != (method = iterable[async])) return method.call(iterable); if (sync && null != (method = iterable[sync])) return new AsyncFromSyncIterator(method.call(iterable)); async = "@@asyncIterator", sync = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
  101483. function AsyncFromSyncIterator(s) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var done = r.done; return Promise.resolve(r.value).then(function (value) { return { value: value, done: done }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(s) { this.s = s, this.n = s.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, "return": function _return(value) { var ret = this.s["return"]; return void 0 === ret ? Promise.resolve({ value: value, done: !0 }) : AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments)); }, "throw": function _throw(value) { var thr = this.s["return"]; return void 0 === thr ? Promise.reject(value) : AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(s); }
  101484. var HttpReader = /*#__PURE__*/function () {
  101485. function HttpReader(headerClient, header, headerLength, indexLength) {
  101486. http_reader_classCallCheck(this, HttpReader);
  101487. this.headerClient = headerClient;
  101488. this.header = header;
  101489. this.headerLength = headerLength;
  101490. this.indexLength = indexLength;
  101491. }
  101492. http_reader_createClass(HttpReader, [{
  101493. key: "selectBbox",
  101494. value: function selectBbox(rect) {
  101495. var _this = this;
  101496. return http_reader_wrapAsyncGenerator( /*#__PURE__*/http_reader_regeneratorRuntime().mark(function _callee2() {
  101497. var lengthBeforeTree, bufferedClient, readNode, batches, currentBatch, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, searchResult, _searchResult2, featureOffset, _searchResult4, featureLength, guessLength, prevFeature, gap, promises;
  101498. return http_reader_regeneratorRuntime().wrap(function _callee2$(_context2) {
  101499. while (1) switch (_context2.prev = _context2.next) {
  101500. case 0:
  101501. lengthBeforeTree = _this.lengthBeforeTree();
  101502. bufferedClient = _this.headerClient;
  101503. readNode = /*#__PURE__*/function () {
  101504. var _ref = http_reader_asyncToGenerator( /*#__PURE__*/http_reader_regeneratorRuntime().mark(function _callee(offsetIntoTree, size) {
  101505. var minReqLength;
  101506. return http_reader_regeneratorRuntime().wrap(function _callee$(_context) {
  101507. while (1) switch (_context.prev = _context.next) {
  101508. case 0:
  101509. minReqLength = 0;
  101510. return _context.abrupt("return", bufferedClient.getRange(lengthBeforeTree + offsetIntoTree, size, minReqLength, 'index'));
  101511. case 2:
  101512. case "end":
  101513. return _context.stop();
  101514. }
  101515. }, _callee);
  101516. }));
  101517. return function readNode(_x, _x2) {
  101518. return _ref.apply(this, arguments);
  101519. };
  101520. }();
  101521. batches = [];
  101522. currentBatch = [];
  101523. _iteratorAbruptCompletion = false;
  101524. _didIteratorError = false;
  101525. _context2.prev = 7;
  101526. _iterator = _asyncIterator(streamSearch(_this.header.featuresCount, _this.header.indexNodeSize, rect, readNode));
  101527. case 9:
  101528. _context2.next = 11;
  101529. return http_reader_awaitAsyncGenerator(_iterator.next());
  101530. case 11:
  101531. if (!(_iteratorAbruptCompletion = !(_step = _context2.sent).done)) {
  101532. _context2.next = 26;
  101533. break;
  101534. }
  101535. searchResult = _step.value;
  101536. _searchResult2 = http_reader_slicedToArray(searchResult, 2), featureOffset = _searchResult2[0];
  101537. _searchResult4 = http_reader_slicedToArray(searchResult, 3), featureLength = _searchResult4[2];
  101538. if (!featureLength) {
  101539. Logger.info('final feature');
  101540. guessLength = config_Config.global.extraRequestThreshold();
  101541. featureLength = guessLength;
  101542. }
  101543. if (!(currentBatch.length == 0)) {
  101544. _context2.next = 19;
  101545. break;
  101546. }
  101547. currentBatch.push([featureOffset, featureLength]);
  101548. return _context2.abrupt("continue", 23);
  101549. case 19:
  101550. prevFeature = currentBatch[currentBatch.length - 1];
  101551. gap = featureOffset - (prevFeature[0] + prevFeature[1]);
  101552. if (gap > config_Config.global.extraRequestThreshold()) {
  101553. Logger.info("Pushing new feature batch, since gap ".concat(gap, " was too large"));
  101554. batches.push(currentBatch);
  101555. currentBatch = [];
  101556. }
  101557. currentBatch.push([featureOffset, featureLength]);
  101558. case 23:
  101559. _iteratorAbruptCompletion = false;
  101560. _context2.next = 9;
  101561. break;
  101562. case 26:
  101563. _context2.next = 32;
  101564. break;
  101565. case 28:
  101566. _context2.prev = 28;
  101567. _context2.t0 = _context2["catch"](7);
  101568. _didIteratorError = true;
  101569. _iteratorError = _context2.t0;
  101570. case 32:
  101571. _context2.prev = 32;
  101572. _context2.prev = 33;
  101573. if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) {
  101574. _context2.next = 37;
  101575. break;
  101576. }
  101577. _context2.next = 37;
  101578. return http_reader_awaitAsyncGenerator(_iterator["return"]());
  101579. case 37:
  101580. _context2.prev = 37;
  101581. if (!_didIteratorError) {
  101582. _context2.next = 40;
  101583. break;
  101584. }
  101585. throw _iteratorError;
  101586. case 40:
  101587. return _context2.finish(37);
  101588. case 41:
  101589. return _context2.finish(32);
  101590. case 42:
  101591. _this.headerClient.logUsage('header+index');
  101592. if (currentBatch.length > 0) {
  101593. batches.push(currentBatch);
  101594. }
  101595. promises = batches.flatMap(function (batch) {
  101596. return _this.readFeatureBatch(batch);
  101597. });
  101598. return _context2.delegateYield(_asyncGeneratorDelegate(_asyncIterator(repeater/* Repeater */.ZN.merge(promises)), http_reader_awaitAsyncGenerator), "t1", 46);
  101599. case 46:
  101600. case "end":
  101601. return _context2.stop();
  101602. }
  101603. }, _callee2, null, [[7, 28, 32, 42], [33,, 37, 41]]);
  101604. }))();
  101605. }
  101606. }, {
  101607. key: "lengthBeforeTree",
  101608. value: function lengthBeforeTree() {
  101609. return constants_magicbytes.length + SIZE_PREFIX_LEN + this.headerLength;
  101610. }
  101611. }, {
  101612. key: "lengthBeforeFeatures",
  101613. value: function lengthBeforeFeatures() {
  101614. return this.lengthBeforeTree() + this.indexLength;
  101615. }
  101616. }, {
  101617. key: "buildFeatureClient",
  101618. value: function buildFeatureClient() {
  101619. return new BufferedHttpRangeClient(this.headerClient.httpClient);
  101620. }
  101621. }, {
  101622. key: "readFeatureBatch",
  101623. value: function readFeatureBatch(batch) {
  101624. var _this2 = this;
  101625. return http_reader_wrapAsyncGenerator( /*#__PURE__*/http_reader_regeneratorRuntime().mark(function _callee3() {
  101626. var _batch$, firstFeatureOffset, _batch, lastFeatureOffset, lastFeatureLength, batchStart, batchEnd, batchSize, featureClient, _iterator2, _step2, _step2$value2, featureOffset;
  101627. return http_reader_regeneratorRuntime().wrap(function _callee3$(_context3) {
  101628. while (1) switch (_context3.prev = _context3.next) {
  101629. case 0:
  101630. _batch$ = http_reader_slicedToArray(batch[0], 1), firstFeatureOffset = _batch$[0];
  101631. _batch = http_reader_slicedToArray(batch[batch.length - 1], 2), lastFeatureOffset = _batch[0], lastFeatureLength = _batch[1];
  101632. batchStart = firstFeatureOffset;
  101633. batchEnd = lastFeatureOffset + lastFeatureLength;
  101634. batchSize = batchEnd - batchStart;
  101635. featureClient = _this2.buildFeatureClient();
  101636. _iterator2 = http_reader_createForOfIteratorHelper(batch);
  101637. _context3.prev = 7;
  101638. _iterator2.s();
  101639. case 9:
  101640. if ((_step2 = _iterator2.n()).done) {
  101641. _context3.next = 17;
  101642. break;
  101643. }
  101644. _step2$value2 = http_reader_slicedToArray(_step2.value, 1), featureOffset = _step2$value2[0];
  101645. _context3.next = 13;
  101646. return http_reader_awaitAsyncGenerator(_this2.readFeature(featureClient, featureOffset, batchSize));
  101647. case 13:
  101648. _context3.next = 15;
  101649. return _context3.sent;
  101650. case 15:
  101651. _context3.next = 9;
  101652. break;
  101653. case 17:
  101654. _context3.next = 22;
  101655. break;
  101656. case 19:
  101657. _context3.prev = 19;
  101658. _context3.t0 = _context3["catch"](7);
  101659. _iterator2.e(_context3.t0);
  101660. case 22:
  101661. _context3.prev = 22;
  101662. _iterator2.f();
  101663. return _context3.finish(22);
  101664. case 25:
  101665. featureClient.logUsage('feature');
  101666. case 26:
  101667. case "end":
  101668. return _context3.stop();
  101669. }
  101670. }, _callee3, null, [[7, 19, 22, 25]]);
  101671. }))();
  101672. }
  101673. }, {
  101674. key: "readFeature",
  101675. value: function () {
  101676. var _readFeature = http_reader_asyncToGenerator( /*#__PURE__*/http_reader_regeneratorRuntime().mark(function _callee4(featureClient, featureOffset, minFeatureReqLength) {
  101677. var offset, featureLength, _bytes, byteBuffer, bytes, bytesAligned, bb;
  101678. return http_reader_regeneratorRuntime().wrap(function _callee4$(_context4) {
  101679. while (1) switch (_context4.prev = _context4.next) {
  101680. case 0:
  101681. offset = featureOffset + this.lengthBeforeFeatures();
  101682. _context4.next = 3;
  101683. return featureClient.getRange(offset, 4, minFeatureReqLength, 'feature length');
  101684. case 3:
  101685. _bytes = _context4.sent;
  101686. featureLength = new DataView(_bytes).getUint32(0, true);
  101687. _context4.next = 7;
  101688. return featureClient.getRange(offset + 4, featureLength, minFeatureReqLength, 'feature data');
  101689. case 7:
  101690. byteBuffer = _context4.sent;
  101691. bytes = new Uint8Array(byteBuffer);
  101692. bytesAligned = new Uint8Array(featureLength + SIZE_PREFIX_LEN);
  101693. bytesAligned.set(bytes, SIZE_PREFIX_LEN);
  101694. bb = new js_flatbuffers/* ByteBuffer */.cZ(bytesAligned);
  101695. bb.setPosition(SIZE_PREFIX_LEN);
  101696. return _context4.abrupt("return", feature_Feature.getRootAsFeature(bb));
  101697. case 14:
  101698. case "end":
  101699. return _context4.stop();
  101700. }
  101701. }, _callee4, this);
  101702. }));
  101703. function readFeature(_x3, _x4, _x5) {
  101704. return _readFeature.apply(this, arguments);
  101705. }
  101706. return readFeature;
  101707. }()
  101708. }], [{
  101709. key: "open",
  101710. value: function () {
  101711. var _open = http_reader_asyncToGenerator( /*#__PURE__*/http_reader_regeneratorRuntime().mark(function _callee5(url) {
  101712. var assumedHeaderLength, headerClient, assumedIndexLength, minReqLength, _bytes2, headerLength, _bytes3, HEADER_MAX_BUFFER_SIZE, bytes, bb, header, indexLength;
  101713. return http_reader_regeneratorRuntime().wrap(function _callee5$(_context5) {
  101714. while (1) switch (_context5.prev = _context5.next) {
  101715. case 0:
  101716. assumedHeaderLength = 2024;
  101717. headerClient = new BufferedHttpRangeClient(url);
  101718. assumedIndexLength = function () {
  101719. var assumedBranchingFactor = DEFAULT_NODE_SIZE;
  101720. var prefetchedLayers = 3;
  101721. var result = 0;
  101722. var i;
  101723. for (i = 0; i < prefetchedLayers; i++) {
  101724. var layer_width = Math.pow(assumedBranchingFactor, i) * NODE_ITEM_LEN;
  101725. result += layer_width;
  101726. }
  101727. return result;
  101728. }();
  101729. minReqLength = assumedHeaderLength + assumedIndexLength;
  101730. Logger.debug("fetching header. minReqLength: ".concat(minReqLength, " (assumedHeaderLength: ").concat(assumedHeaderLength, ", assumedIndexLength: ").concat(assumedIndexLength, ")"));
  101731. _context5.t0 = Uint8Array;
  101732. _context5.next = 8;
  101733. return headerClient.getRange(0, 8, minReqLength, 'header');
  101734. case 8:
  101735. _context5.t1 = _context5.sent;
  101736. _bytes2 = new _context5.t0(_context5.t1);
  101737. if (_bytes2.subarray(0, 3).every(function (v, i) {
  101738. return constants_magicbytes[i] === v;
  101739. })) {
  101740. _context5.next = 13;
  101741. break;
  101742. }
  101743. Logger.error("bytes: ".concat(_bytes2, " != ").concat(constants_magicbytes));
  101744. throw new Error('Not a FlatGeobuf file');
  101745. case 13:
  101746. Logger.debug('magic bytes look good');
  101747. _context5.next = 16;
  101748. return headerClient.getRange(8, 4, minReqLength, 'header');
  101749. case 16:
  101750. _bytes3 = _context5.sent;
  101751. headerLength = new DataView(_bytes3).getUint32(0, true);
  101752. HEADER_MAX_BUFFER_SIZE = 1048576 * 10;
  101753. if (!(headerLength > HEADER_MAX_BUFFER_SIZE || headerLength < 8)) {
  101754. _context5.next = 21;
  101755. break;
  101756. }
  101757. throw new Error('Invalid header size');
  101758. case 21:
  101759. Logger.debug("headerLength: ".concat(headerLength));
  101760. _context5.next = 24;
  101761. return headerClient.getRange(12, headerLength, minReqLength, 'header');
  101762. case 24:
  101763. bytes = _context5.sent;
  101764. bb = new js_flatbuffers/* ByteBuffer */.cZ(new Uint8Array(bytes));
  101765. header = fromByteBuffer(bb);
  101766. indexLength = calcTreeSize(header.featuresCount, header.indexNodeSize);
  101767. Logger.debug('completed: opening http reader');
  101768. return _context5.abrupt("return", new HttpReader(headerClient, header, headerLength, indexLength));
  101769. case 30:
  101770. case "end":
  101771. return _context5.stop();
  101772. }
  101773. }, _callee5);
  101774. }));
  101775. function open(_x6) {
  101776. return _open.apply(this, arguments);
  101777. }
  101778. return open;
  101779. }()
  101780. }]);
  101781. return HttpReader;
  101782. }();
  101783. var BufferedHttpRangeClient = /*#__PURE__*/function () {
  101784. function BufferedHttpRangeClient(source) {
  101785. http_reader_classCallCheck(this, BufferedHttpRangeClient);
  101786. this.bytesEverUsed = 0;
  101787. this.bytesEverFetched = 0;
  101788. this.buffer = new ArrayBuffer(0);
  101789. this.head = 0;
  101790. if (typeof source === 'string') {
  101791. this.httpClient = new HttpRangeClient(source);
  101792. } else {
  101793. this.httpClient = source;
  101794. }
  101795. }
  101796. http_reader_createClass(BufferedHttpRangeClient, [{
  101797. key: "getRange",
  101798. value: function () {
  101799. var _getRange = http_reader_asyncToGenerator( /*#__PURE__*/http_reader_regeneratorRuntime().mark(function _callee6(start, length, minReqLength, purpose) {
  101800. var start_i, end_i, lengthToFetch;
  101801. return http_reader_regeneratorRuntime().wrap(function _callee6$(_context6) {
  101802. while (1) switch (_context6.prev = _context6.next) {
  101803. case 0:
  101804. this.bytesEverUsed += length;
  101805. start_i = start - this.head;
  101806. end_i = start_i + length;
  101807. if (!(start_i >= 0 && end_i <= this.buffer.byteLength)) {
  101808. _context6.next = 5;
  101809. break;
  101810. }
  101811. return _context6.abrupt("return", this.buffer.slice(start_i, end_i));
  101812. case 5:
  101813. lengthToFetch = Math.max(length, minReqLength);
  101814. this.bytesEverFetched += lengthToFetch;
  101815. Logger.debug("requesting for new Range: ".concat(start, "-").concat(start + length - 1));
  101816. _context6.next = 10;
  101817. return this.httpClient.getRange(start, lengthToFetch, purpose);
  101818. case 10:
  101819. this.buffer = _context6.sent;
  101820. this.head = start;
  101821. return _context6.abrupt("return", this.buffer.slice(0, length));
  101822. case 13:
  101823. case "end":
  101824. return _context6.stop();
  101825. }
  101826. }, _callee6, this);
  101827. }));
  101828. function getRange(_x7, _x8, _x9, _x10) {
  101829. return _getRange.apply(this, arguments);
  101830. }
  101831. return getRange;
  101832. }()
  101833. }, {
  101834. key: "logUsage",
  101835. value: function logUsage(purpose) {
  101836. var category = purpose.split(' ')[0];
  101837. var used = this.bytesEverUsed;
  101838. var requested = this.bytesEverFetched;
  101839. var efficiency = (100.0 * used / requested).toFixed(2);
  101840. Logger.info("".concat(category, " bytes used/requested: ").concat(used, " / ").concat(requested, " = ").concat(efficiency, "%"));
  101841. }
  101842. }]);
  101843. return BufferedHttpRangeClient;
  101844. }();
  101845. var HttpRangeClient = /*#__PURE__*/function () {
  101846. function HttpRangeClient(url) {
  101847. http_reader_classCallCheck(this, HttpRangeClient);
  101848. this.requestsEverMade = 0;
  101849. this.bytesEverRequested = 0;
  101850. this.url = url;
  101851. }
  101852. http_reader_createClass(HttpRangeClient, [{
  101853. key: "getRange",
  101854. value: function () {
  101855. var _getRange2 = http_reader_asyncToGenerator( /*#__PURE__*/http_reader_regeneratorRuntime().mark(function _callee7(begin, length, purpose) {
  101856. var range, response;
  101857. return http_reader_regeneratorRuntime().wrap(function _callee7$(_context7) {
  101858. while (1) switch (_context7.prev = _context7.next) {
  101859. case 0:
  101860. this.requestsEverMade += 1;
  101861. this.bytesEverRequested += length;
  101862. range = "bytes=".concat(begin, "-").concat(begin + length - 1);
  101863. Logger.info("request: #".concat(this.requestsEverMade, ", purpose: ").concat(purpose, "), bytes: (this_request: ").concat(length, ", ever: ").concat(this.bytesEverRequested, "), Range: ").concat(range));
  101864. _context7.next = 6;
  101865. return fetch(this.url, {
  101866. headers: {
  101867. Range: range
  101868. }
  101869. });
  101870. case 6:
  101871. response = _context7.sent;
  101872. return _context7.abrupt("return", response.arrayBuffer());
  101873. case 8:
  101874. case "end":
  101875. return _context7.stop();
  101876. }
  101877. }, _callee7, this);
  101878. }));
  101879. function getRange(_x11, _x12, _x13) {
  101880. return _getRange2.apply(this, arguments);
  101881. }
  101882. return getRange;
  101883. }()
  101884. }]);
  101885. return HttpRangeClient;
  101886. }();
  101887. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/generic/header.js
  101888. function header_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = header_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
  101889. function header_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return header_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return header_arrayLikeToArray(o, minLen); }
  101890. function header_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  101891. function featureGeomType(feature) {
  101892. if (feature.getGeometry) {
  101893. return toGeometryType(feature.getGeometry().getType());
  101894. } else {
  101895. return toGeometryType(feature.geometry.type);
  101896. }
  101897. }
  101898. function header_inferGeometryType(features) {
  101899. var geometryType = undefined;
  101900. var _iterator = header_createForOfIteratorHelper(features),
  101901. _step;
  101902. try {
  101903. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  101904. var f = _step.value;
  101905. if (geometryType === GeometryType.Unknown) {
  101906. break;
  101907. }
  101908. var gtype = featureGeomType(f);
  101909. if (geometryType === undefined) {
  101910. geometryType = gtype;
  101911. } else if (geometryType !== gtype) {
  101912. geometryType = GeometryType.Unknown;
  101913. }
  101914. }
  101915. } catch (err) {
  101916. _iterator.e(err);
  101917. } finally {
  101918. _iterator.f();
  101919. }
  101920. if (geometryType === undefined) {
  101921. throw new Error('Could not infer geometry type for collection of features.');
  101922. }
  101923. return geometryType;
  101924. }
  101925. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/generic/featurecollection.js
  101926. function featurecollection_typeof(obj) { "@babel/helpers - typeof"; return featurecollection_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, featurecollection_typeof(obj); }
  101927. function featurecollection_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ featurecollection_regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == featurecollection_typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
  101928. function featurecollection_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
  101929. function featurecollection_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { featurecollection_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { featurecollection_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
  101930. function featurecollection_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = featurecollection_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
  101931. function featurecollection_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return featurecollection_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return featurecollection_arrayLikeToArray(o, minLen); }
  101932. function featurecollection_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  101933. function featurecollection_asyncIterator(iterable) { var method, async, sync, retry = 2; for ("undefined" != typeof Symbol && (async = Symbol.asyncIterator, sync = Symbol.iterator); retry--;) { if (async && null != (method = iterable[async])) return method.call(iterable); if (sync && null != (method = iterable[sync])) return new featurecollection_AsyncFromSyncIterator(method.call(iterable)); async = "@@asyncIterator", sync = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
  101934. function featurecollection_AsyncFromSyncIterator(s) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var done = r.done; return Promise.resolve(r.value).then(function (value) { return { value: value, done: done }; }); } return featurecollection_AsyncFromSyncIterator = function AsyncFromSyncIterator(s) { this.s = s, this.n = s.next; }, featurecollection_AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, "return": function _return(value) { var ret = this.s["return"]; return void 0 === ret ? Promise.resolve({ value: value, done: !0 }) : AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments)); }, "throw": function _throw(value) { var thr = this.s["return"]; return void 0 === thr ? Promise.reject(value) : AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments)); } }, new featurecollection_AsyncFromSyncIterator(s); }
  101935. function featurecollection_awaitAsyncGenerator(value) { return new featurecollection_OverloadYield(value, 0); }
  101936. function featurecollection_wrapAsyncGenerator(fn) { return function () { return new featurecollection_AsyncGenerator(fn.apply(this, arguments)); }; }
  101937. function featurecollection_AsyncGenerator(gen) { var front, back; function resume(key, arg) { try { var result = gen[key](arg), value = result.value, overloaded = value instanceof featurecollection_OverloadYield; Promise.resolve(overloaded ? value.v : value).then(function (arg) { if (overloaded) { var nextKey = "return" === key ? "return" : "next"; if (!value.k || arg.done) return resume(nextKey, arg); arg = gen[nextKey](arg).value; } settle(result.done ? "return" : "normal", arg); }, function (err) { resume("throw", err); }); } catch (err) { settle("throw", err); } } function settle(type, value) { switch (type) { case "return": front.resolve({ value: value, done: !0 }); break; case "throw": front.reject(value); break; default: front.resolve({ value: value, done: !1 }); } (front = front.next) ? resume(front.key, front.arg) : back = null; } this._invoke = function (key, arg) { return new Promise(function (resolve, reject) { var request = { key: key, arg: arg, resolve: resolve, reject: reject, next: null }; back ? back = back.next = request : (front = back = request, resume(key, arg)); }); }, "function" != typeof gen["return"] && (this["return"] = void 0); }
  101938. featurecollection_AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function () { return this; }, featurecollection_AsyncGenerator.prototype.next = function (arg) { return this._invoke("next", arg); }, featurecollection_AsyncGenerator.prototype["throw"] = function (arg) { return this._invoke("throw", arg); }, featurecollection_AsyncGenerator.prototype["return"] = function (arg) { return this._invoke("return", arg); };
  101939. function featurecollection_OverloadYield(value, kind) { this.v = value, this.k = kind; }
  101940. function serialize(features) {
  101941. var headerMeta = introspectHeaderMeta(features);
  101942. var header = featurecollection_buildHeader(headerMeta);
  101943. var featureBuffers = features.map(function (f) {
  101944. if (!f.getGeometry) throw new Error('Missing getGeometry implementation');
  101945. if (!f.getProperties) throw new Error('Missing getProperties implementation');
  101946. return buildFeature(parseGeometry(f.getGeometry(), headerMeta.geometryType), f.getProperties(), headerMeta);
  101947. });
  101948. var featuresLength = featureBuffers.map(function (f) {
  101949. return f.length;
  101950. }).reduce(function (a, b) {
  101951. return a + b;
  101952. });
  101953. var uint8 = new Uint8Array(magicbytes.length + header.length + featuresLength);
  101954. uint8.set(header, magicbytes.length);
  101955. var offset = magicbytes.length + header.length;
  101956. var _iterator2 = featurecollection_createForOfIteratorHelper(featureBuffers),
  101957. _step2;
  101958. try {
  101959. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  101960. var feature = _step2.value;
  101961. uint8.set(feature, offset);
  101962. offset += feature.length;
  101963. }
  101964. } catch (err) {
  101965. _iterator2.e(err);
  101966. } finally {
  101967. _iterator2.f();
  101968. }
  101969. uint8.set(magicbytes);
  101970. return uint8;
  101971. }
  101972. function deserialize(bytes, fromFeature, headerMetaFn) {
  101973. if (!bytes.subarray(0, 3).every(function (v, i) {
  101974. return constants_magicbytes[i] === v;
  101975. })) throw new Error('Not a FlatGeobuf file');
  101976. var bb = new js_flatbuffers/* ByteBuffer */.cZ(bytes);
  101977. var headerLength = bb.readUint32(constants_magicbytes.length);
  101978. bb.setPosition(constants_magicbytes.length + SIZE_PREFIX_LEN);
  101979. var headerMeta = fromByteBuffer(bb);
  101980. if (headerMetaFn) headerMetaFn(headerMeta);
  101981. var offset = constants_magicbytes.length + SIZE_PREFIX_LEN + headerLength;
  101982. var indexNodeSize = headerMeta.indexNodeSize,
  101983. featuresCount = headerMeta.featuresCount;
  101984. if (indexNodeSize > 0) offset += calcTreeSize(featuresCount, indexNodeSize);
  101985. var features = [];
  101986. while (offset < bb.capacity()) {
  101987. var featureLength = bb.readUint32(offset);
  101988. bb.setPosition(offset + SIZE_PREFIX_LEN);
  101989. var feature = feature_Feature.getRootAsFeature(bb);
  101990. features.push(fromFeature(feature, headerMeta));
  101991. offset += SIZE_PREFIX_LEN + featureLength;
  101992. }
  101993. return features;
  101994. }
  101995. function deserializeStream(_x, _x2, _x3) {
  101996. return _deserializeStream.apply(this, arguments);
  101997. }
  101998. function _deserializeStream() {
  101999. _deserializeStream = featurecollection_wrapAsyncGenerator( /*#__PURE__*/featurecollection_regeneratorRuntime().mark(function _callee2(stream, fromFeature, headerMetaFn) {
  102000. var reader, read, bytes, bb, headerLength, headerMeta, indexNodeSize, featuresCount, treeSize, feature;
  102001. return featurecollection_regeneratorRuntime().wrap(function _callee2$(_context2) {
  102002. while (1) switch (_context2.prev = _context2.next) {
  102003. case 0:
  102004. reader = slice_source(stream);
  102005. read = /*#__PURE__*/function () {
  102006. var _ref = featurecollection_asyncToGenerator( /*#__PURE__*/featurecollection_regeneratorRuntime().mark(function _callee(size) {
  102007. return featurecollection_regeneratorRuntime().wrap(function _callee$(_context) {
  102008. while (1) switch (_context.prev = _context.next) {
  102009. case 0:
  102010. _context.next = 2;
  102011. return reader.slice(size);
  102012. case 2:
  102013. return _context.abrupt("return", _context.sent);
  102014. case 3:
  102015. case "end":
  102016. return _context.stop();
  102017. }
  102018. }, _callee);
  102019. }));
  102020. return function read(_x8) {
  102021. return _ref.apply(this, arguments);
  102022. };
  102023. }();
  102024. _context2.t0 = Uint8Array;
  102025. _context2.next = 5;
  102026. return featurecollection_awaitAsyncGenerator(read(8, 'magic bytes'));
  102027. case 5:
  102028. _context2.t1 = _context2.sent;
  102029. bytes = new _context2.t0(_context2.t1);
  102030. if (bytes.subarray(0, 3).every(function (v, i) {
  102031. return constants_magicbytes[i] === v;
  102032. })) {
  102033. _context2.next = 9;
  102034. break;
  102035. }
  102036. throw new Error('Not a FlatGeobuf file');
  102037. case 9:
  102038. _context2.t2 = Uint8Array;
  102039. _context2.next = 12;
  102040. return featurecollection_awaitAsyncGenerator(read(4, 'header length'));
  102041. case 12:
  102042. _context2.t3 = _context2.sent;
  102043. bytes = new _context2.t2(_context2.t3);
  102044. bb = new js_flatbuffers/* ByteBuffer */.cZ(bytes);
  102045. headerLength = bb.readUint32(0);
  102046. _context2.t4 = Uint8Array;
  102047. _context2.next = 19;
  102048. return featurecollection_awaitAsyncGenerator(read(headerLength, 'header data'));
  102049. case 19:
  102050. _context2.t5 = _context2.sent;
  102051. bytes = new _context2.t4(_context2.t5);
  102052. bb = new js_flatbuffers/* ByteBuffer */.cZ(bytes);
  102053. headerMeta = fromByteBuffer(bb);
  102054. if (headerMetaFn) headerMetaFn(headerMeta);
  102055. indexNodeSize = headerMeta.indexNodeSize, featuresCount = headerMeta.featuresCount;
  102056. if (!(indexNodeSize > 0)) {
  102057. _context2.next = 29;
  102058. break;
  102059. }
  102060. treeSize = calcTreeSize(featuresCount, indexNodeSize);
  102061. _context2.next = 29;
  102062. return featurecollection_awaitAsyncGenerator(read(treeSize, 'entire index, w/o rect'));
  102063. case 29:
  102064. _context2.next = 31;
  102065. return featurecollection_awaitAsyncGenerator(readFeature(read, headerMeta, fromFeature));
  102066. case 31:
  102067. if (!(feature = _context2.sent)) {
  102068. _context2.next = 36;
  102069. break;
  102070. }
  102071. _context2.next = 34;
  102072. return feature;
  102073. case 34:
  102074. _context2.next = 29;
  102075. break;
  102076. case 36:
  102077. case "end":
  102078. return _context2.stop();
  102079. }
  102080. }, _callee2);
  102081. }));
  102082. return _deserializeStream.apply(this, arguments);
  102083. }
  102084. function deserializeFiltered(_x4, _x5, _x6, _x7) {
  102085. return _deserializeFiltered.apply(this, arguments);
  102086. }
  102087. function _deserializeFiltered() {
  102088. _deserializeFiltered = featurecollection_wrapAsyncGenerator( /*#__PURE__*/featurecollection_regeneratorRuntime().mark(function _callee3(url, rect, fromFeature, headerMetaFn) {
  102089. var reader, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, feature;
  102090. return featurecollection_regeneratorRuntime().wrap(function _callee3$(_context3) {
  102091. while (1) switch (_context3.prev = _context3.next) {
  102092. case 0:
  102093. _context3.next = 2;
  102094. return featurecollection_awaitAsyncGenerator(HttpReader.open(url));
  102095. case 2:
  102096. reader = _context3.sent;
  102097. Logger.debug('opened reader');
  102098. if (headerMetaFn) headerMetaFn(reader.header);
  102099. _iteratorAbruptCompletion = false;
  102100. _didIteratorError = false;
  102101. _context3.prev = 7;
  102102. _iterator = featurecollection_asyncIterator(reader.selectBbox(rect));
  102103. case 9:
  102104. _context3.next = 11;
  102105. return featurecollection_awaitAsyncGenerator(_iterator.next());
  102106. case 11:
  102107. if (!(_iteratorAbruptCompletion = !(_step = _context3.sent).done)) {
  102108. _context3.next = 18;
  102109. break;
  102110. }
  102111. feature = _step.value;
  102112. _context3.next = 15;
  102113. return fromFeature(feature, reader.header);
  102114. case 15:
  102115. _iteratorAbruptCompletion = false;
  102116. _context3.next = 9;
  102117. break;
  102118. case 18:
  102119. _context3.next = 24;
  102120. break;
  102121. case 20:
  102122. _context3.prev = 20;
  102123. _context3.t0 = _context3["catch"](7);
  102124. _didIteratorError = true;
  102125. _iteratorError = _context3.t0;
  102126. case 24:
  102127. _context3.prev = 24;
  102128. _context3.prev = 25;
  102129. if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) {
  102130. _context3.next = 29;
  102131. break;
  102132. }
  102133. _context3.next = 29;
  102134. return featurecollection_awaitAsyncGenerator(_iterator["return"]());
  102135. case 29:
  102136. _context3.prev = 29;
  102137. if (!_didIteratorError) {
  102138. _context3.next = 32;
  102139. break;
  102140. }
  102141. throw _iteratorError;
  102142. case 32:
  102143. return _context3.finish(29);
  102144. case 33:
  102145. return _context3.finish(24);
  102146. case 34:
  102147. case "end":
  102148. return _context3.stop();
  102149. }
  102150. }, _callee3, null, [[7, 20, 24, 34], [25,, 29, 33]]);
  102151. }));
  102152. return _deserializeFiltered.apply(this, arguments);
  102153. }
  102154. function readFeature(_x9, _x10, _x11) {
  102155. return _readFeature.apply(this, arguments);
  102156. }
  102157. function _readFeature() {
  102158. _readFeature = featurecollection_asyncToGenerator( /*#__PURE__*/featurecollection_regeneratorRuntime().mark(function _callee4(read, headerMeta, fromFeature) {
  102159. var bytes, bb, featureLength, bytesAligned, feature;
  102160. return featurecollection_regeneratorRuntime().wrap(function _callee4$(_context4) {
  102161. while (1) switch (_context4.prev = _context4.next) {
  102162. case 0:
  102163. _context4.t0 = Uint8Array;
  102164. _context4.next = 3;
  102165. return read(4, 'feature length');
  102166. case 3:
  102167. _context4.t1 = _context4.sent;
  102168. bytes = new _context4.t0(_context4.t1);
  102169. if (!(bytes.byteLength === 0)) {
  102170. _context4.next = 7;
  102171. break;
  102172. }
  102173. return _context4.abrupt("return");
  102174. case 7:
  102175. bb = new js_flatbuffers/* ByteBuffer */.cZ(bytes);
  102176. featureLength = bb.readUint32(0);
  102177. _context4.t2 = Uint8Array;
  102178. _context4.next = 12;
  102179. return read(featureLength, 'feature data');
  102180. case 12:
  102181. _context4.t3 = _context4.sent;
  102182. bytes = new _context4.t2(_context4.t3);
  102183. bytesAligned = new Uint8Array(featureLength + 4);
  102184. bytesAligned.set(bytes, 4);
  102185. bb = new js_flatbuffers/* ByteBuffer */.cZ(bytesAligned);
  102186. bb.setPosition(SIZE_PREFIX_LEN);
  102187. feature = feature_Feature.getRootAsFeature(bb);
  102188. return _context4.abrupt("return", fromFeature(feature, headerMeta));
  102189. case 20:
  102190. case "end":
  102191. return _context4.stop();
  102192. }
  102193. }, _callee4);
  102194. }));
  102195. return _readFeature.apply(this, arguments);
  102196. }
  102197. function buildColumn(builder, column) {
  102198. var nameOffset = builder.createString(column.name);
  102199. Column.startColumn(builder);
  102200. Column.addName(builder, nameOffset);
  102201. Column.addType(builder, column.type);
  102202. return Column.endColumn(builder);
  102203. }
  102204. function featurecollection_buildHeader(header) {
  102205. var builder = new flatbuffers.Builder();
  102206. var columnOffsets = null;
  102207. if (header.columns) columnOffsets = Header.createColumnsVector(builder, header.columns.map(function (c) {
  102208. return buildColumn(builder, c);
  102209. }));
  102210. var nameOffset = builder.createString('L1');
  102211. Header.startHeader(builder);
  102212. Header.addFeaturesCount(builder, BigInt(header.featuresCount));
  102213. Header.addGeometryType(builder, header.geometryType);
  102214. Header.addIndexNodeSize(builder, 0);
  102215. if (columnOffsets) Header.addColumns(builder, columnOffsets);
  102216. Header.addName(builder, nameOffset);
  102217. var offset = Header.endHeader(builder);
  102218. builder.finishSizePrefixed(offset);
  102219. return builder.asUint8Array();
  102220. }
  102221. function valueToType(value) {
  102222. if (typeof value === 'boolean') return ColumnType.Bool;else if (typeof value === 'number') {
  102223. if (value % 1 === 0) return ColumnType.Int;else return ColumnType.Double;
  102224. } else if (typeof value === 'string') return ColumnType.String;else if (value === null) return ColumnType.String;else if (featurecollection_typeof(value) === 'object') return ColumnType.Json;else throw new Error("Unknown type (value '".concat(value, "')"));
  102225. }
  102226. function featurecollection_mapColumn(properties, k) {
  102227. return {
  102228. name: k,
  102229. type: valueToType(properties[k]),
  102230. title: null,
  102231. description: null,
  102232. width: -1,
  102233. precision: -1,
  102234. scale: -1,
  102235. nullable: true,
  102236. unique: false,
  102237. primary_key: false
  102238. };
  102239. }
  102240. function introspectHeaderMeta(features) {
  102241. var sampleFeature = features[0];
  102242. var properties = sampleFeature.getProperties ? sampleFeature.getProperties() : {};
  102243. var columns = null;
  102244. if (properties) columns = Object.keys(properties).filter(function (key) {
  102245. return key !== 'geometry';
  102246. }).map(function (k) {
  102247. return featurecollection_mapColumn(properties, k);
  102248. });
  102249. var geometryType = inferGeometryType(features);
  102250. var headerMeta = {
  102251. geometryType: geometryType,
  102252. columns: columns,
  102253. envelope: null,
  102254. featuresCount: features.length,
  102255. indexNodeSize: 0,
  102256. crs: null,
  102257. title: null,
  102258. description: null,
  102259. metadata: null
  102260. };
  102261. return headerMeta;
  102262. }
  102263. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/geojson/featurecollection.js
  102264. function geojson_featurecollection_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = geojson_featurecollection_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
  102265. function geojson_featurecollection_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return geojson_featurecollection_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return geojson_featurecollection_arrayLikeToArray(o, minLen); }
  102266. function geojson_featurecollection_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  102267. function featurecollection_serialize(featurecollection) {
  102268. var headerMeta = featurecollection_introspectHeaderMeta(featurecollection);
  102269. var header = buildHeader(headerMeta);
  102270. var features = featurecollection.features.map(function (f) {
  102271. return buildFeature(f.geometry.type === 'GeometryCollection' ? parseGC(f.geometry) : parseGeometry(f.geometry), f.properties, headerMeta);
  102272. });
  102273. var featuresLength = features.map(function (f) {
  102274. return f.length;
  102275. }).reduce(function (a, b) {
  102276. return a + b;
  102277. });
  102278. var uint8 = new Uint8Array(magicbytes.length + header.length + featuresLength);
  102279. uint8.set(header, magicbytes.length);
  102280. var offset = magicbytes.length + header.length;
  102281. var _iterator = geojson_featurecollection_createForOfIteratorHelper(features),
  102282. _step;
  102283. try {
  102284. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  102285. var feature = _step.value;
  102286. uint8.set(feature, offset);
  102287. offset += feature.length;
  102288. }
  102289. } catch (err) {
  102290. _iterator.e(err);
  102291. } finally {
  102292. _iterator.f();
  102293. }
  102294. uint8.set(magicbytes);
  102295. return uint8;
  102296. }
  102297. function featurecollection_deserialize(bytes, headerMetaFn) {
  102298. var features = deserialize(bytes, feature_fromFeature, headerMetaFn);
  102299. return {
  102300. type: 'FeatureCollection',
  102301. features: features
  102302. };
  102303. }
  102304. function featurecollection_deserializeStream(stream, headerMetaFn) {
  102305. return deserializeStream(stream, feature_fromFeature, headerMetaFn);
  102306. }
  102307. function featurecollection_deserializeFiltered(url, rect, headerMetaFn) {
  102308. return deserializeFiltered(url, rect, feature_fromFeature, headerMetaFn);
  102309. }
  102310. function featurecollection_introspectHeaderMeta(featurecollection) {
  102311. var feature = featurecollection.features[0];
  102312. var properties = feature.properties;
  102313. var columns = null;
  102314. if (properties) columns = Object.keys(properties).map(function (k) {
  102315. return mapColumn(properties, k);
  102316. });
  102317. var geometryType = inferGeometryType(featurecollection.features);
  102318. var headerMeta = {
  102319. geometryType: geometryType,
  102320. columns: columns,
  102321. envelope: null,
  102322. featuresCount: featurecollection.features.length,
  102323. indexNodeSize: 0,
  102324. crs: null,
  102325. title: null,
  102326. description: null,
  102327. metadata: null
  102328. };
  102329. return headerMeta;
  102330. }
  102331. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/geojson.js
  102332. function geojson_serialize(geojson) {
  102333. var bytes = fcSerialize(geojson);
  102334. return bytes;
  102335. }
  102336. function geojson_deserialize(input, rect, headerMetaFn) {
  102337. if (input instanceof Uint8Array) return featurecollection_deserialize(input, headerMetaFn);else if (input instanceof ReadableStream) return featurecollection_deserializeStream(input, headerMetaFn);else return featurecollection_deserializeFiltered(input, rect, headerMetaFn);
  102338. }
  102339. ;// CONCATENATED MODULE: external "ol.loadingstrategy"
  102340. var external_ol_loadingstrategy_namespaceObject = ol.loadingstrategy;
  102341. ;// CONCATENATED MODULE: ./src/openlayers/overlay/FGB.js
  102342. function FGB_typeof(obj) { "@babel/helpers - typeof"; return FGB_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FGB_typeof(obj); }
  102343. function FGB_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ FGB_regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == FGB_typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
  102344. function FGB_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
  102345. function FGB_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { FGB_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { FGB_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
  102346. function FGB_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  102347. function FGB_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  102348. function FGB_createClass(Constructor, protoProps, staticProps) { if (protoProps) FGB_defineProperties(Constructor.prototype, protoProps); if (staticProps) FGB_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  102349. function FGB_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FGB_setPrototypeOf(subClass, superClass); }
  102350. function FGB_setPrototypeOf(o, p) { FGB_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FGB_setPrototypeOf(o, p); }
  102351. function FGB_createSuper(Derived) { var hasNativeReflectConstruct = FGB_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FGB_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FGB_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FGB_possibleConstructorReturn(this, result); }; }
  102352. function FGB_possibleConstructorReturn(self, call) { if (call && (FGB_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FGB_assertThisInitialized(self); }
  102353. function FGB_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  102354. function FGB_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  102355. function FGB_getPrototypeOf(o) { FGB_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FGB_getPrototypeOf(o); }
  102356. function FGB_asyncIterator(iterable) { var method, async, sync, retry = 2; for ("undefined" != typeof Symbol && (async = Symbol.asyncIterator, sync = Symbol.iterator); retry--;) { if (async && null != (method = iterable[async])) return method.call(iterable); if (sync && null != (method = iterable[sync])) return new FGB_AsyncFromSyncIterator(method.call(iterable)); async = "@@asyncIterator", sync = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
  102357. function FGB_AsyncFromSyncIterator(s) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var done = r.done; return Promise.resolve(r.value).then(function (value) { return { value: value, done: done }; }); } return FGB_AsyncFromSyncIterator = function AsyncFromSyncIterator(s) { this.s = s, this.n = s.next; }, FGB_AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, "return": function _return(value) { var ret = this.s["return"]; return void 0 === ret ? Promise.resolve({ value: value, done: !0 }) : AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments)); }, "throw": function _throw(value) { var thr = this.s["return"]; return void 0 === thr ? Promise.reject(value) : AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments)); } }, new FGB_AsyncFromSyncIterator(s); }
  102358. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  102359. * This program are made available under the terms of the Apache License, Version 2.0
  102360. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  102361. /**
  102362. * @class FGB
  102363. * @browsernamespace ol.source
  102364. * @category Visualization FGB
  102365. * @classdesc FGB 图层源,该图层源把 {@link FlatGeobuf} 格式解析为点线面要素。
  102366. * @modulecategory Overlay
  102367. * @version 11.1.0
  102368. * @param {Object} opt_options - 参数。
  102369. * @param {string} opt_options.url - FGB 地址,例如:http://localhost:8090/iserver/services/xxx/rest/data/featureResults/newResourceId.fgb。
  102370. * @param {ol.loadingstrategy} [opt_options.strategy= ol.loadingstrategy.bbox] - ol.loadingstrategy.all为全量加载,要素会以流的方式渲染到地图。 ol.loadingstrategy.bbox为当前可见范围加载,当地图范围改变时会重新加载要素,此时可以通过idField 参数来标识已被加载过的要素,被标识的要素无需再次加载。idField 参数无效时会清空要素,重新加载。
  102371. * @param {Array} [opt_options.extent] - 加载范围, 参数规范为: [minX, minY, maxX, maxY], 传递此参数后, 图层将使用局部加载。
  102372. * @param {function} [opt_options.featureLoader] - 要素加载回调函数
  102373. * @param {boolean} [opt_options.overlaps] - 是否优化重叠要素的填充与描边操作
  102374. * @param {boolean} [opt_options.useSpatialIndex] - 是否启用要素空间索引
  102375. * @param {boolean} [opt_options.wrapX] - 是否平铺地图
  102376. * @param {boolean} [opt_options.idField='SmID'] - 要素属性中表示唯一标识的字段,当 strategy 为 ol.loadingstrategy.bbox时生效。
  102377. * @extends {ol.source.Vector}
  102378. * @usage
  102379. */
  102380. var FGB = /*#__PURE__*/function (_VectorSource) {
  102381. FGB_inherits(FGB, _VectorSource);
  102382. var _super = FGB_createSuper(FGB);
  102383. function FGB(options) {
  102384. var _this;
  102385. FGB_classCallCheck(this, FGB);
  102386. var baseOptions = Object.assign({
  102387. strategy: external_ol_loadingstrategy_namespaceObject.bbox
  102388. }, options);
  102389. delete baseOptions.url;
  102390. delete baseOptions.extent;
  102391. delete baseOptions.idField;
  102392. _this = _super.call(this, baseOptions);
  102393. _this.options = options || {};
  102394. _this.strategy = baseOptions.strategy;
  102395. _this.url = _this.options.url;
  102396. _this.extent = _this.options.extent;
  102397. _this._idField = _this.options.idField || 'SmID';
  102398. _this._validatedId = false;
  102399. _this._checked = false;
  102400. _this.setLoader( /*#__PURE__*/function () {
  102401. var _ref = FGB_asyncToGenerator( /*#__PURE__*/FGB_regeneratorRuntime().mark(function _callee(extent) {
  102402. var intersectExtent, fgbStream;
  102403. return FGB_regeneratorRuntime().wrap(function _callee$(_context) {
  102404. while (1) switch (_context.prev = _context.next) {
  102405. case 0:
  102406. if (this.strategy === external_ol_loadingstrategy_namespaceObject.bbox) {
  102407. if (!this._validatedId) {
  102408. this.clear();
  102409. }
  102410. if (this.extent) {
  102411. intersectExtent = getIntersection(this.extent, extent);
  102412. extent = intersectExtent && intersectExtent.length ? intersectExtent : this.extent;
  102413. }
  102414. }
  102415. if (!this.extent && (this.strategy === external_ol_loadingstrategy_namespaceObject.all || !isFinite(extent[0]))) {
  102416. extent = [];
  102417. }
  102418. if (Object.keys(extent).length) {
  102419. _context.next = 6;
  102420. break;
  102421. }
  102422. _context.next = 5;
  102423. return this._getStream(this.url);
  102424. case 5:
  102425. fgbStream = _context.sent;
  102426. case 6:
  102427. this._handleFeatures(fgbStream && fgbStream.body || this.url, extent);
  102428. case 7:
  102429. case "end":
  102430. return _context.stop();
  102431. }
  102432. }, _callee, this);
  102433. }));
  102434. return function (_x) {
  102435. return _ref.apply(this, arguments);
  102436. };
  102437. }());
  102438. return _this;
  102439. }
  102440. FGB_createClass(FGB, [{
  102441. key: "_handleFeatures",
  102442. value: function () {
  102443. var _handleFeatures2 = FGB_asyncToGenerator( /*#__PURE__*/FGB_regeneratorRuntime().mark(function _callee2(url, extent) {
  102444. var rect, fgb, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, feature, id;
  102445. return FGB_regeneratorRuntime().wrap(function _callee2$(_context2) {
  102446. while (1) switch (_context2.prev = _context2.next) {
  102447. case 0:
  102448. rect = {};
  102449. if (extent && extent.length) {
  102450. rect = {
  102451. minX: extent[0],
  102452. minY: extent[1],
  102453. maxX: extent[2],
  102454. maxY: extent[3]
  102455. };
  102456. }
  102457. fgb = geojson_deserialize(url, rect);
  102458. _iteratorAbruptCompletion = false;
  102459. _didIteratorError = false;
  102460. _context2.prev = 5;
  102461. _iterator = FGB_asyncIterator(fgb);
  102462. case 7:
  102463. _context2.next = 9;
  102464. return _iterator.next();
  102465. case 9:
  102466. if (!(_iteratorAbruptCompletion = !(_step = _context2.sent).done)) {
  102467. _context2.next = 20;
  102468. break;
  102469. }
  102470. feature = _step.value;
  102471. id = feature.properties[this._idField];
  102472. if (id && !this._validatedId) {
  102473. this._validatedId = true;
  102474. this._checked = true;
  102475. }
  102476. feature = new (external_ol_format_GeoJSON_default())().readFeature(feature);
  102477. if (id && this._checked) {
  102478. feature.setId(id);
  102479. }
  102480. if (this.options.featureLoader && typeof this.options.featureLoader === 'function') {
  102481. feature = this.options.featureLoader(feature);
  102482. }
  102483. this.addFeature(feature);
  102484. case 17:
  102485. _iteratorAbruptCompletion = false;
  102486. _context2.next = 7;
  102487. break;
  102488. case 20:
  102489. _context2.next = 26;
  102490. break;
  102491. case 22:
  102492. _context2.prev = 22;
  102493. _context2.t0 = _context2["catch"](5);
  102494. _didIteratorError = true;
  102495. _iteratorError = _context2.t0;
  102496. case 26:
  102497. _context2.prev = 26;
  102498. _context2.prev = 27;
  102499. if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) {
  102500. _context2.next = 31;
  102501. break;
  102502. }
  102503. _context2.next = 31;
  102504. return _iterator["return"]();
  102505. case 31:
  102506. _context2.prev = 31;
  102507. if (!_didIteratorError) {
  102508. _context2.next = 34;
  102509. break;
  102510. }
  102511. throw _iteratorError;
  102512. case 34:
  102513. return _context2.finish(31);
  102514. case 35:
  102515. return _context2.finish(26);
  102516. case 36:
  102517. case "end":
  102518. return _context2.stop();
  102519. }
  102520. }, _callee2, this, [[5, 22, 26, 36], [27,, 31, 35]]);
  102521. }));
  102522. function _handleFeatures(_x2, _x3) {
  102523. return _handleFeatures2.apply(this, arguments);
  102524. }
  102525. return _handleFeatures;
  102526. }()
  102527. }, {
  102528. key: "_getStream",
  102529. value: function () {
  102530. var _getStream2 = FGB_asyncToGenerator( /*#__PURE__*/FGB_regeneratorRuntime().mark(function _callee3(url) {
  102531. return FGB_regeneratorRuntime().wrap(function _callee3$(_context3) {
  102532. while (1) switch (_context3.prev = _context3.next) {
  102533. case 0:
  102534. _context3.next = 2;
  102535. return FetchRequest.get(url, {}, {
  102536. withoutFormatSuffix: true
  102537. }).then(function (response) {
  102538. return response;
  102539. });
  102540. case 2:
  102541. return _context3.abrupt("return", _context3.sent);
  102542. case 3:
  102543. case "end":
  102544. return _context3.stop();
  102545. }
  102546. }, _callee3);
  102547. }));
  102548. function _getStream(_x4) {
  102549. return _getStream2.apply(this, arguments);
  102550. }
  102551. return _getStream;
  102552. }()
  102553. }]);
  102554. return FGB;
  102555. }((external_ol_source_Vector_default()));
  102556. ;// CONCATENATED MODULE: ./src/openlayers/services/KnowledgeGraphService.js
  102557. function services_KnowledgeGraphService_typeof(obj) { "@babel/helpers - typeof"; return services_KnowledgeGraphService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, services_KnowledgeGraphService_typeof(obj); }
  102558. function KnowledgeGraphService_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ KnowledgeGraphService_regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == services_KnowledgeGraphService_typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
  102559. function KnowledgeGraphService_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
  102560. function KnowledgeGraphService_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { KnowledgeGraphService_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { KnowledgeGraphService_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
  102561. function services_KnowledgeGraphService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  102562. function services_KnowledgeGraphService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  102563. function services_KnowledgeGraphService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_KnowledgeGraphService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_KnowledgeGraphService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  102564. function services_KnowledgeGraphService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) services_KnowledgeGraphService_setPrototypeOf(subClass, superClass); }
  102565. function services_KnowledgeGraphService_setPrototypeOf(o, p) { services_KnowledgeGraphService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_KnowledgeGraphService_setPrototypeOf(o, p); }
  102566. function services_KnowledgeGraphService_createSuper(Derived) { var hasNativeReflectConstruct = services_KnowledgeGraphService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_KnowledgeGraphService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_KnowledgeGraphService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_KnowledgeGraphService_possibleConstructorReturn(this, result); }; }
  102567. function services_KnowledgeGraphService_possibleConstructorReturn(self, call) { if (call && (services_KnowledgeGraphService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return services_KnowledgeGraphService_assertThisInitialized(self); }
  102568. function services_KnowledgeGraphService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  102569. function services_KnowledgeGraphService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  102570. function services_KnowledgeGraphService_getPrototypeOf(o) { services_KnowledgeGraphService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_KnowledgeGraphService_getPrototypeOf(o); }
  102571. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  102572. * This program are made available under the terms of the Apache License, Version 2.0
  102573. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  102574. /**
  102575. * @class KnowledgeGraphService
  102576. * @category iServer KnowledgeGraph
  102577. * @classdesc 知识图谱服务类。
  102578. * @version 11.1.0
  102579. * @example
  102580. * new KnowledgeGraphService(url)
  102581. * .query(param,function(result){
  102582. * //doSomething
  102583. * })
  102584. * @extends {ServiceBase}
  102585. * @param {string} url - 服务地址。
  102586. * @param {Object} options -参数。
  102587. * @param {string} [options.proxy] - 服务代理地址。
  102588. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  102589. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  102590. * @param {Object} [options.headers] - 请求头。
  102591. * @usage
  102592. */
  102593. var KnowledgeGraphService = /*#__PURE__*/function (_ServiceBase) {
  102594. services_KnowledgeGraphService_inherits(KnowledgeGraphService, _ServiceBase);
  102595. var _super = services_KnowledgeGraphService_createSuper(KnowledgeGraphService);
  102596. function KnowledgeGraphService(url, options) {
  102597. var _this;
  102598. services_KnowledgeGraphService_classCallCheck(this, KnowledgeGraphService);
  102599. _this = _super.call(this, url, options);
  102600. _this._knowledgeGraphService = new KnowledgeGraphService_KnowledgeGraphService(url, options);
  102601. return _this;
  102602. }
  102603. /**
  102604. * @function KnowledgeGraphService.prototype.query
  102605. * @description 通过查询语句查询知识图谱数据。
  102606. * @param {string} cypherQuery - 查询条件。
  102607. * @param {RequestCallback} callback - 回调函数。
  102608. */
  102609. services_KnowledgeGraphService_createClass(KnowledgeGraphService, [{
  102610. key: "query",
  102611. value: function query(cypherQuery, callback) {
  102612. this._knowledgeGraphService.query(cypherQuery, callback);
  102613. }
  102614. // /**
  102615. // * @function KnowledgeGraphService.prototype.getMetaData
  102616. // * @description 获取元信息(展示所有实体类型和关系类型)。
  102617. // * @param {RequestCallback} callback 回调函数。
  102618. // */
  102619. // getMetaData(callback) {
  102620. // this._knowledgeGraphService.getMetaData(callback);
  102621. // }
  102622. /**
  102623. * @function KnowledgeGraphService.prototype.getGraphMaps
  102624. * @description 获取图谱列表。
  102625. * @param {RequestCallback} callback 回调函数。
  102626. */
  102627. }, {
  102628. key: "getGraphMaps",
  102629. value: function getGraphMaps(callback) {
  102630. this._knowledgeGraphService.getGraphMaps(callback);
  102631. }
  102632. /**
  102633. * @function KnowledgeGraphService.prototype.getGraphMap
  102634. * @description 获取图谱图序列化数据。
  102635. * @param {string} params 图谱名称。
  102636. * @param {RequestCallback} callback 回调函数。
  102637. */
  102638. }, {
  102639. key: "getGraphMap",
  102640. value: function getGraphMap(params, callback) {
  102641. this._knowledgeGraphService.getGraphMap(params, callback);
  102642. }
  102643. /**
  102644. * @function KnowledgeGraphService.prototype.getGraphMapData
  102645. * @description 将iServer GraphMap服务的数据格式转换为KnowledgeGraph的数据格式。
  102646. * @param {string} graphMapName - 图谱名称。
  102647. * @returns {Promise} Promise 对象。
  102648. */
  102649. }, {
  102650. key: "getGraphMapData",
  102651. value: function () {
  102652. var _getGraphMapData = KnowledgeGraphService_asyncToGenerator( /*#__PURE__*/KnowledgeGraphService_regeneratorRuntime().mark(function _callee(graphMapName) {
  102653. var res;
  102654. return KnowledgeGraphService_regeneratorRuntime().wrap(function _callee$(_context) {
  102655. while (1) switch (_context.prev = _context.next) {
  102656. case 0:
  102657. _context.next = 2;
  102658. return this._knowledgeGraphService.getGraphMapData(graphMapName);
  102659. case 2:
  102660. res = _context.sent;
  102661. return _context.abrupt("return", res);
  102662. case 4:
  102663. case "end":
  102664. return _context.stop();
  102665. }
  102666. }, _callee, this);
  102667. }));
  102668. function getGraphMapData(_x) {
  102669. return _getGraphMapData.apply(this, arguments);
  102670. }
  102671. return getGraphMapData;
  102672. }()
  102673. }]);
  102674. return KnowledgeGraphService;
  102675. }(ServiceBase);
  102676. ;// CONCATENATED MODULE: ./src/openlayers/overlay/GraphMap.js
  102677. function GraphMap_typeof(obj) { "@babel/helpers - typeof"; return GraphMap_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GraphMap_typeof(obj); }
  102678. function GraphMap_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ GraphMap_regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == GraphMap_typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
  102679. function GraphMap_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
  102680. function GraphMap_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { GraphMap_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { GraphMap_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
  102681. function GraphMap_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  102682. function GraphMap_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  102683. function GraphMap_createClass(Constructor, protoProps, staticProps) { if (protoProps) GraphMap_defineProperties(Constructor.prototype, protoProps); if (staticProps) GraphMap_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  102684. function GraphMap_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GraphMap_setPrototypeOf(subClass, superClass); }
  102685. function GraphMap_setPrototypeOf(o, p) { GraphMap_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GraphMap_setPrototypeOf(o, p); }
  102686. function GraphMap_createSuper(Derived) { var hasNativeReflectConstruct = GraphMap_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GraphMap_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GraphMap_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GraphMap_possibleConstructorReturn(this, result); }; }
  102687. function GraphMap_possibleConstructorReturn(self, call) { if (call && (GraphMap_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GraphMap_assertThisInitialized(self); }
  102688. function GraphMap_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  102689. function GraphMap_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  102690. function GraphMap_getPrototypeOf(o) { GraphMap_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GraphMap_getPrototypeOf(o); }
  102691. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  102692. * This program are made available under the terms of the Apache License, Version 2.0
  102693. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  102694. /**
  102695. * @class GraphMap
  102696. * @classdesc 对接 iServer GraphMap。
  102697. * @category iServer KnowledgeGraph
  102698. * @version 11.1.0
  102699. * @param {string} serviceUrl - GraphMap服务地址, 例如:http://{iserver}/services/{knowledgeGraph-provider}/restjsr/graph/graphmaps/{graphmap}。
  102700. * @param {Object} [options] - 参数。
  102701. * @param {KnowledgeGraph.Config} [options.config] - KnowledgeGraph的配置项。
  102702. * @param {string} [options.proxy] - 服务代理地址。
  102703. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  102704. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  102705. * @param {Object} [options.headers] - 请求头。
  102706. * @fires GraphMap#loaded
  102707. * @extends {ol.Observable}
  102708. * @usage
  102709. */
  102710. var GraphMap = /*#__PURE__*/function (_Observable) {
  102711. GraphMap_inherits(GraphMap, _Observable);
  102712. var _super = GraphMap_createSuper(GraphMap);
  102713. function GraphMap(serviceUrl, options) {
  102714. var _this;
  102715. GraphMap_classCallCheck(this, GraphMap);
  102716. _this = _super.call(this);
  102717. /**
  102718. * @member GraphMap.prototype.graph
  102719. * @description KnowledgeGraph的实例.
  102720. *
  102721. */
  102722. _this.graph = null;
  102723. /**
  102724. * @member GraphMap.prototype.EVENT_TYPES
  102725. * @description 监听一个自定义事件可用如下方式:
  102726. *
  102727. * 支持的事件如下:
  102728. * loaded - 渲染完成时触发。
  102729. */
  102730. _this.EVENT_TYPES = ['loaded'];
  102731. _this.url = serviceUrl;
  102732. _this.options = options;
  102733. var graphMapName = serviceUrl.split('/').pop();
  102734. _this.url = serviceUrl.replace("/graphmaps/".concat(graphMapName), '');
  102735. _this.createGraphMap(graphMapName, options);
  102736. return _this;
  102737. }
  102738. /**
  102739. * @private
  102740. * @function GraphMap.prototype.createGraphMap
  102741. * @description 创建图谱。
  102742. * @param {string} graphMapName - 图谱名称。
  102743. * @param {Object} options - 参数。
  102744. * @param {string} [options.proxy] - 服务代理地址。
  102745. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  102746. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  102747. * @param {Object} [options.headers] - 请求头。
  102748. * @param {KnowledgeGraph.Config} [options.config] - knowledgegrah配置项。
  102749. */
  102750. GraphMap_createClass(GraphMap, [{
  102751. key: "createGraphMap",
  102752. value: function () {
  102753. var _createGraphMap = GraphMap_asyncToGenerator( /*#__PURE__*/GraphMap_regeneratorRuntime().mark(function _callee(graphMapName, options) {
  102754. var _this2 = this;
  102755. var res, result;
  102756. return GraphMap_regeneratorRuntime().wrap(function _callee$(_context) {
  102757. while (1) switch (_context.prev = _context.next) {
  102758. case 0:
  102759. this.knowledgeGraphService = this.createKnowledgeGraphService(this.url, options);
  102760. _context.next = 3;
  102761. return this.knowledgeGraphService.getGraphMapData(graphMapName);
  102762. case 3:
  102763. res = _context.sent;
  102764. result = KnowledgeGraph.dataFromGraphMap(res.data, res.graphMap);
  102765. this.graph = new KnowledgeGraph(options && options.config);
  102766. this.graph.on('beforelayout', function () {
  102767. /**
  102768. * @event GraphMap#loaded
  102769. * @description 渲染完成时触发。
  102770. */
  102771. _this2.dispatchEvent(_this2.EVENT_TYPES[0]);
  102772. });
  102773. this.graph.setData(result);
  102774. this.graph.handleNodeStatus(transformExpandCollapseHiddenData(res.graphMap));
  102775. case 9:
  102776. case "end":
  102777. return _context.stop();
  102778. }
  102779. }, _callee, this);
  102780. }));
  102781. function createGraphMap(_x, _x2) {
  102782. return _createGraphMap.apply(this, arguments);
  102783. }
  102784. return createGraphMap;
  102785. }()
  102786. /**
  102787. * @private
  102788. * @function GraphMap.prototype.createKnowledgeGraphService
  102789. * @description 创建KnowledgeGraphService实例。
  102790. * @param {string} serviceUrl - GraphMap服务地址, 例如:http://{iserver}/services/knowledgeGraph-test/restjsr/graph
  102791. * @param {Object} options - 参数。
  102792. * @param {string} [options.proxy] - 服务代理地址。
  102793. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  102794. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  102795. * @param {Object} [options.headers] - 请求头。
  102796. */
  102797. }, {
  102798. key: "createKnowledgeGraphService",
  102799. value: function createKnowledgeGraphService(serviceUrl, options) {
  102800. return new KnowledgeGraphService(serviceUrl, options);
  102801. }
  102802. }]);
  102803. return GraphMap;
  102804. }((external_ol_Observable_default()));
  102805. ;// CONCATENATED MODULE: ./src/openlayers/overlay/graphic/index.js
  102806. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  102807. * This program are made available under the terms of the Apache License, Version 2.0
  102808. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  102809. ;// CONCATENATED MODULE: ./src/openlayers/overlay/mapv/index.js
  102810. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  102811. * This program are made available under the terms of the Apache License, Version 2.0
  102812. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  102813. ;// CONCATENATED MODULE: ./src/openlayers/overlay/theme/index.js
  102814. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  102815. * This program are made available under the terms of the Apache License, Version 2.0
  102816. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  102817. ;// CONCATENATED MODULE: external "ol.geom.LineString"
  102818. var external_ol_geom_LineString_namespaceObject = ol.geom.LineString;
  102819. var external_ol_geom_LineString_default = /*#__PURE__*/__webpack_require__.n(external_ol_geom_LineString_namespaceObject);
  102820. ;// CONCATENATED MODULE: ./src/openlayers/overlay/vectortile/olExtends.js
  102821. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  102822. * This program are made available under the terms of the Apache License, Version 2.0
  102823. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  102824. var olExtends = function olExtends(targetMap) {
  102825. //解决olms.js插件,在使用ol.js时沿线标注不显示的问题,因为ol.geom.LineString.getFlatMidpoint未非公开方法
  102826. if (!(external_ol_geom_LineString_default()).prototype.getFlatMidpoint) {
  102827. (external_ol_geom_LineString_default()).prototype.getFlatMidpoint = function () {
  102828. return this.getCoordinateAt(0.5);
  102829. };
  102830. }
  102831. if (core_Util_Util.getOlVersion() === '4' && window && window.ol && window.ol.geom.flat) {
  102832. // for ol4-debug
  102833. window.targetMapCache = targetMap;
  102834. var ol = window.ol;
  102835. //解决 new ol.format.MVT({featureClass: ol.Feature})时,非3857显示异常的问题。ol即将发布的5.0版本已解决。
  102836. // eslint-disable-next-line no-unused-vars
  102837. ol.format.MVT.prototype.readProjection = function (source) {
  102838. return new ol.proj.Projection({
  102839. code: '',
  102840. units: ol.proj.Units.TILE_PIXELS
  102841. });
  102842. };
  102843. //解决 new ol.format.MVT({featureClass: ol.Feature})时,非3857显示异常的问题。ol即将发布的5.0版本已解决。
  102844. // eslint-disable-next-line no-unused-vars
  102845. ol.format.MVT.prototype.readProjection = function (source) {
  102846. return new ol.proj.Projection({
  102847. code: '',
  102848. units: ol.proj.Units.TILE_PIXELS
  102849. });
  102850. };
  102851. //解决面填充时不能整版填充的问题。ol即将发布的5.0版本已解决。
  102852. // eslint-disable-next-line no-unused-vars
  102853. ol.render.canvas.Replay.prototype.applyFill = function (state, geometry) {
  102854. var fillStyle = state.fillStyle;
  102855. var fillInstruction = [ol.render.canvas.Instruction.SET_FILL_STYLE, fillStyle];
  102856. if (typeof fillStyle !== 'string') {
  102857. var viewExtent = window.targetMapCache.getView().getProjection().getExtent();
  102858. fillInstruction.push([viewExtent[0], viewExtent[3]]);
  102859. }
  102860. this.instructions.push(fillInstruction);
  102861. };
  102862. //解决面填充时不能整版填充的问题。ol即将发布的5.0版本已解决。
  102863. // eslint-disable-next-line no-unused-vars
  102864. ol.render.canvas.Replay.prototype.applyFill = function (state, geometry) {
  102865. var fillStyle = state.fillStyle;
  102866. var fillInstruction = [ol.render.canvas.Instruction.SET_FILL_STYLE, fillStyle];
  102867. if (typeof fillStyle !== 'string') {
  102868. var viewExtent = window.targetMapCache.getView().getProjection().getExtent();
  102869. fillInstruction.push([viewExtent[0], viewExtent[3]]);
  102870. }
  102871. this.instructions.push(fillInstruction);
  102872. };
  102873. //解决在多面时,第一个面是逆时针时无法显示的问题。该问题由组件修复。
  102874. ol.format.MVT.prototype.createFeature_ = function (pbf, rawFeature, opt_options) {
  102875. var type = rawFeature.type;
  102876. if (type === 0) {
  102877. return null;
  102878. }
  102879. var feature;
  102880. var id = rawFeature.id;
  102881. var values = rawFeature.properties;
  102882. values[this.layerName_] = rawFeature.layer.name;
  102883. var flatCoordinates = [];
  102884. var ends = [];
  102885. ol.format.MVT.readRawGeometry_(pbf, rawFeature, flatCoordinates, ends);
  102886. var geometryType = ol.format.MVT.getGeometryType_(type, ends.length);
  102887. if (this.featureClass_ === ol.render.Feature) {
  102888. feature = new this.featureClass_(geometryType, flatCoordinates, ends, values, id);
  102889. } else {
  102890. var geom;
  102891. if (geometryType == ol.geom.GeometryType.POLYGON) {
  102892. var endss = [];
  102893. var offset = 0;
  102894. var prevEndIndex = 0;
  102895. for (var i = 0, ii = ends.length; i < ii; ++i) {
  102896. var end = ends[i];
  102897. if (!ol.geom.flat.orient.linearRingIsClockwise(flatCoordinates, offset, end, 2)) {
  102898. endss.push(ends.slice(prevEndIndex, i + 1));
  102899. prevEndIndex = i + 1;
  102900. }
  102901. offset = end;
  102902. }
  102903. if (endss.length > 1) {
  102904. ends = endss;
  102905. geom = new ol.geom.MultiPolygon(null);
  102906. } else {
  102907. geom = new ol.geom.Polygon(null);
  102908. }
  102909. } else {
  102910. geom = geometryType === ol.geom.GeometryType.POINT ? new ol.geom.Point(null) : geometryType === ol.geom.GeometryType.LINE_STRING ? new ol.geom.LineString(null) : geometryType === ol.geom.GeometryType.POLYGON ? new ol.geom.Polygon(null) : geometryType === ol.geom.GeometryType.MULTI_POINT ? new ol.geom.MultiPoint(null) : geometryType === ol.geom.GeometryType.MULTI_LINE_STRING ? new ol.geom.MultiLineString(null) : null;
  102911. }
  102912. if (geom) {
  102913. geom.setFlatCoordinates(ol.geom.GeometryLayout.XY, flatCoordinates, ends);
  102914. feature = new this.featureClass_();
  102915. if (this.geometryName_) {
  102916. feature.setGeometryName(this.geometryName_);
  102917. }
  102918. var geometry = ol.format.Feature.transformWithOptions(geom, false, this.adaptOptions(opt_options));
  102919. feature.setGeometry(geometry);
  102920. feature.setId(id);
  102921. feature.setProperties(values);
  102922. }
  102923. }
  102924. return feature;
  102925. };
  102926. //解决中文沿线表述显示不符合中文阅读习惯的问题
  102927. ol.geom.flat.textpath.lineString = function (flatCoordinates, offset, end, stride, text, measure, startM, maxAngle) {
  102928. var result = [];
  102929. // Keep text upright
  102930. var anglereverse = Math.atan2(flatCoordinates[end - stride + 1] - flatCoordinates[offset + 1], flatCoordinates[end - stride] - flatCoordinates[offset]);
  102931. var reverse = anglereverse < -0.785 || anglereverse > 2.356; //0.785//2.356
  102932. var isRotateUp = anglereverse < -0.785 && anglereverse > -2.356 || anglereverse > 0.785 && anglereverse < 2.356;
  102933. var numChars = text.length;
  102934. var x1 = flatCoordinates[offset];
  102935. var y1 = flatCoordinates[offset + 1];
  102936. offset += stride;
  102937. var x2 = flatCoordinates[offset];
  102938. var y2 = flatCoordinates[offset + 1];
  102939. var segmentM = 0;
  102940. var segmentLength = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
  102941. while (offset < end - stride && segmentM + segmentLength < startM) {
  102942. x1 = x2;
  102943. y1 = y2;
  102944. offset += stride;
  102945. x2 = flatCoordinates[offset];
  102946. y2 = flatCoordinates[offset + 1];
  102947. segmentM += segmentLength;
  102948. segmentLength = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
  102949. }
  102950. var interpolate = (startM - segmentM) / segmentLength;
  102951. var x0 = ol.math.lerp(x1, x2, interpolate); //起始点
  102952. var y0 = ol.math.lerp(y1, y2, interpolate); //起始点
  102953. var chunk = '';
  102954. var chunkLength = 0;
  102955. var data, index, previousAngle, previousLang;
  102956. for (var i = 0; i < numChars; ++i) {
  102957. index = reverse ? numChars - i - 1 : i;
  102958. var _char = text.charAt(index);
  102959. var charcode = _char.charCodeAt(0);
  102960. var ischinese = charcode >= 19968 && charcode <= 40907;
  102961. chunk = reverse ? _char + chunk : chunk + _char;
  102962. var charLength = measure(chunk) - chunkLength;
  102963. chunkLength += charLength;
  102964. //var charM = startM + charLength / 2;
  102965. while (offset < end - stride && Math.sqrt(Math.pow(x2 - x0, 2) + Math.pow(y2 - y0, 2)) < charLength / 2) {
  102966. x1 = x2;
  102967. y1 = y2;
  102968. offset += stride;
  102969. x2 = flatCoordinates[offset];
  102970. y2 = flatCoordinates[offset + 1];
  102971. }
  102972. var a = Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2);
  102973. var b = 2 * (x2 - x1) * (x1 - x0) + 2 * (y2 - y1) * (y1 - y0);
  102974. var c = Math.pow(x1 - x0, 2) + Math.pow(y1 - y0, 2) - Math.pow(charLength / 2, 2);
  102975. var scale1 = (-b + Math.sqrt(b * b - 4 * a * c)) / (2 * a);
  102976. var scale2 = (-b - Math.sqrt(b * b - 4 * a * c)) / (2 * a);
  102977. interpolate = scale1 < 0 || scale1 > 1 ? scale2 : scale2 < 0 || scale2 > 1 ? scale1 : scale1 < scale2 ? scale2 : scale1;
  102978. var x = ol.math.lerp(x1, x2, interpolate);
  102979. var y = ol.math.lerp(y1, y2, interpolate);
  102980. while (offset < end - stride && Math.sqrt(Math.pow(x2 - x, 2) + Math.pow(y2 - y, 2)) < charLength / 2) {
  102981. x1 = x2;
  102982. y1 = y2;
  102983. offset += stride;
  102984. x2 = flatCoordinates[offset];
  102985. y2 = flatCoordinates[offset + 1];
  102986. }
  102987. a = Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2);
  102988. b = 2 * (x2 - x1) * (x1 - x) + 2 * (y2 - y1) * (y1 - y);
  102989. c = Math.pow(x1 - x, 2) + Math.pow(y1 - y, 2) - Math.pow(charLength / 2, 2);
  102990. scale1 = (-b + Math.sqrt(b * b - 4 * a * c)) / (2 * a);
  102991. scale2 = (-b - Math.sqrt(b * b - 4 * a * c)) / (2 * a);
  102992. interpolate = scale1 < 0 || scale1 > 1 ? scale2 : scale2 < 0 || scale2 > 1 ? scale1 : scale1 < scale2 ? scale2 : scale1;
  102993. var x3 = ol.math.lerp(x1, x2, interpolate);
  102994. var y3 = ol.math.lerp(y1, y2, interpolate);
  102995. var angle = Math.atan2(y3 - y0, x3 - x0);
  102996. if (reverse) {
  102997. angle += angle > 0 ? -Math.PI : Math.PI;
  102998. }
  102999. if (ischinese && isRotateUp) {
  103000. angle += angle > 0 ? -Math.PI / 2 : Math.PI / 2;
  103001. }
  103002. if (previousAngle !== undefined) {
  103003. var delta = angle - previousAngle;
  103004. delta += delta > Math.PI ? -2 * Math.PI : delta < -Math.PI ? 2 * Math.PI : 0;
  103005. if (ischinese === previousLang ? Math.abs(delta) > maxAngle : Math.abs(delta) > maxAngle + Math.PI / 2) {
  103006. return null;
  103007. }
  103008. }
  103009. if (previousAngle == angle && !isRotateUp) {
  103010. if (reverse) {
  103011. data[0] = x;
  103012. data[1] = y;
  103013. data[2] = charLength / 2;
  103014. }
  103015. data[4] = chunk;
  103016. } else {
  103017. chunk = _char;
  103018. chunkLength = charLength;
  103019. data = [x, y, charLength / 2, angle, chunk];
  103020. if (reverse) {
  103021. result.unshift(data);
  103022. } else {
  103023. result.push(data);
  103024. }
  103025. previousAngle = angle;
  103026. previousLang = ischinese;
  103027. }
  103028. x0 = x3;
  103029. y0 = y3;
  103030. startM += charLength;
  103031. }
  103032. return result;
  103033. };
  103034. //以下两个方法解决在大数据量图斑时,内存疯长的问题。该改法引发新问题:无法点选要素
  103035. ol.layer.VectorTile.prototype.setFastRender = function (fastRender) {
  103036. return this.fastRender = fastRender;
  103037. };
  103038. ol.renderer.canvas.VectorTileLayer.prototype.postCompose = function (context, frameState, layerState) {
  103039. var layer = this.getLayer();
  103040. var declutterReplays = layer.getDeclutter() ? {} : null;
  103041. var source = /** @type {ol.source.VectorTile} */layer.getSource();
  103042. var renderMode = layer.getRenderMode();
  103043. var replayTypes = ol.renderer.canvas.VectorTileLayer.VECTOR_REPLAYS[renderMode];
  103044. var pixelRatio = frameState.pixelRatio;
  103045. var rotation = frameState.viewState.rotation;
  103046. var size = frameState.size;
  103047. var offsetX, offsetY;
  103048. if (rotation) {
  103049. offsetX = Math.round(pixelRatio * size[0] / 2);
  103050. offsetY = Math.round(pixelRatio * size[1] / 2);
  103051. ol.render.canvas.rotateAtOffset(context, -rotation, offsetX, offsetY);
  103052. }
  103053. if (declutterReplays) {
  103054. this.declutterTree_.clear();
  103055. }
  103056. var tiles = this.renderedTiles;
  103057. var tileGrid = source.getTileGridForProjection(frameState.viewState.projection);
  103058. var clips = [];
  103059. var zs = [];
  103060. for (var i = tiles.length - 1; i >= 0; --i) {
  103061. var tile = /** @type {ol.VectorImageTile} */tiles[i];
  103062. if (tile.getState() == ol.TileState.ABORT) {
  103063. continue;
  103064. }
  103065. var tileCoord = tile.tileCoord;
  103066. var worldOffset = tileGrid.getTileCoordExtent(tileCoord)[0] - tileGrid.getTileCoordExtent(tile.wrappedTileCoord)[0];
  103067. var transform = undefined;
  103068. for (var t = 0, tt = tile.tileKeys.length; t < tt; ++t) {
  103069. var sourceTile = tile.getTile(tile.tileKeys[t]);
  103070. if (sourceTile.getState() == ol.TileState.ERROR) {
  103071. continue;
  103072. }
  103073. var replayGroup = sourceTile.getReplayGroup(layer, tileCoord.toString());
  103074. if (renderMode != ol.layer.VectorTileRenderType.VECTOR && (!replayGroup || !replayGroup.hasReplays(replayTypes))) {
  103075. if (layer.fastRender === true) {
  103076. sourceTile.replayGroups_ = {};
  103077. sourceTile.features_ = [];
  103078. }
  103079. continue;
  103080. }
  103081. if (!transform) {
  103082. transform = this.getTransform(frameState, worldOffset);
  103083. }
  103084. var currentZ = sourceTile.tileCoord[0];
  103085. var currentClip = replayGroup.getClipCoords(transform);
  103086. context.save();
  103087. context.globalAlpha = layerState.opacity;
  103088. // Create a clip mask for regions in this low resolution tile that are
  103089. // already filled by a higher resolution tile
  103090. for (var j = 0, jj = clips.length; j < jj; ++j) {
  103091. var clip = clips[j];
  103092. if (currentZ < zs[j]) {
  103093. context.beginPath();
  103094. // counter-clockwise (outer ring) for current tile
  103095. context.moveTo(currentClip[0], currentClip[1]);
  103096. context.lineTo(currentClip[2], currentClip[3]);
  103097. context.lineTo(currentClip[4], currentClip[5]);
  103098. context.lineTo(currentClip[6], currentClip[7]);
  103099. // clockwise (inner ring) for higher resolution tile
  103100. context.moveTo(clip[6], clip[7]);
  103101. context.lineTo(clip[4], clip[5]);
  103102. context.lineTo(clip[2], clip[3]);
  103103. context.lineTo(clip[0], clip[1]);
  103104. context.clip();
  103105. }
  103106. }
  103107. replayGroup.replay(context, transform, rotation, {}, replayTypes, declutterReplays);
  103108. context.restore();
  103109. clips.push(currentClip);
  103110. zs.push(currentZ);
  103111. }
  103112. }
  103113. if (declutterReplays) {
  103114. ol.render.canvas.ReplayGroup.replayDeclutter(declutterReplays, context, rotation);
  103115. }
  103116. if (rotation) {
  103117. ol.render.canvas.rotateAtOffset(context, rotation, /** @type {number} */
  103118. offsetX, /** @type {number} */offsetY);
  103119. }
  103120. ol.renderer.canvas.TileLayer.prototype.postCompose.apply(this, arguments);
  103121. };
  103122. }
  103123. };
  103124. window.olExtends = olExtends;
  103125. // EXTERNAL MODULE: ./node_modules/lodash.remove/index.js
  103126. var lodash_remove = __webpack_require__(1944);
  103127. var lodash_remove_default = /*#__PURE__*/__webpack_require__.n(lodash_remove);
  103128. ;// CONCATENATED MODULE: ./src/openlayers/overlay/vectortile/MapboxStyles.js
  103129. function MapboxStyles_typeof(obj) { "@babel/helpers - typeof"; return MapboxStyles_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, MapboxStyles_typeof(obj); }
  103130. function MapboxStyles_toConsumableArray(arr) { return MapboxStyles_arrayWithoutHoles(arr) || MapboxStyles_iterableToArray(arr) || MapboxStyles_unsupportedIterableToArray(arr) || MapboxStyles_nonIterableSpread(); }
  103131. function MapboxStyles_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  103132. function MapboxStyles_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return MapboxStyles_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return MapboxStyles_arrayLikeToArray(o, minLen); }
  103133. function MapboxStyles_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
  103134. function MapboxStyles_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return MapboxStyles_arrayLikeToArray(arr); }
  103135. function MapboxStyles_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  103136. function MapboxStyles_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  103137. function MapboxStyles_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  103138. function MapboxStyles_createClass(Constructor, protoProps, staticProps) { if (protoProps) MapboxStyles_defineProperties(Constructor.prototype, protoProps); if (staticProps) MapboxStyles_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  103139. function MapboxStyles_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) MapboxStyles_setPrototypeOf(subClass, superClass); }
  103140. function MapboxStyles_setPrototypeOf(o, p) { MapboxStyles_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MapboxStyles_setPrototypeOf(o, p); }
  103141. function MapboxStyles_createSuper(Derived) { var hasNativeReflectConstruct = MapboxStyles_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MapboxStyles_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MapboxStyles_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MapboxStyles_possibleConstructorReturn(this, result); }; }
  103142. function MapboxStyles_possibleConstructorReturn(self, call) { if (call && (MapboxStyles_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return MapboxStyles_assertThisInitialized(self); }
  103143. function MapboxStyles_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  103144. function MapboxStyles_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  103145. function MapboxStyles_getPrototypeOf(o) { MapboxStyles_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MapboxStyles_getPrototypeOf(o); }
  103146. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  103147. * This program are made available under the terms of the Apache License, Version 2.0
  103148. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  103149. /**
  103150. * @class MapboxStyles
  103151. * @classdesc Mapbox 矢量瓦片风格。
  103152. * <div style="padding: 20px;border: 1px solid #eee;border-left-width: 5px;border-radius: 3px;border-left-color: #ce4844;">
  103153. * <p style="color: #ce4844">Notice</p>
  103154. * <p style="font-size: 13px">该功能依赖 <a href='https://github.com/boundlessgeo/ol-mapbox-style'>ol-mapbox-style</a> 插件,请确认引入该插件。</p>
  103155. * `<script type="text/javascript" src="https://rawgit.com/boundlessgeo/ol-mapbox-style/v2.11.2-1/dist/olms.js"></script>`
  103156. * </div>
  103157. * @modulecategory Overlay
  103158. * @category Visualization VectorTile
  103159. * @param {Object} options - 参数。
  103160. * @param {(string|undefined)} [options.url] - SuperMap iServer 地图服务地址,例如'http://localhost:8090/iserver/services/map-mvt-test/rest/maps/test',与options.style互斥,优先级低于options.style。
  103161. * @param {(Object|string|undefined)} [options.style] - Mapbox Style JSON 对象或获取 Mapbox Style JSON 对象的 URL。与 options.url 互斥,优先级高于 options.url。
  103162. * @param {Array.<number>} [options.resolutions] - 地图分辨率数组,用于映射 zoom 值。通常情況与地图的 {@link ol.View} 的分辨率一致。</br>
  103163. * 默认值为:[78271.51696402048,39135.75848201024, 19567.87924100512,9783.93962050256,4891.96981025128,2445.98490512564, 1222.99245256282,611.49622628141,305.748113140705,152.8740565703525, 76.43702828517625,38.21851414258813,19.109257071294063,9.554628535647032, 4.777314267823516,2.388657133911758,1.194328566955879,0.5971642834779395, 0.29858214173896974,0.14929107086948487,0.07464553543474244]。
  103164. * @param {(string|Array.<string>|undefined)} [options.source] - Mapbox Style 'source'的 key 值或者 'layer' 的 ID 数组。
  103165. * 当配置 'source' 的 key 值时,source 为该值的 layer 会被加载;
  103166. * 当配置为 'layer' 的 ID 数组时,指定的 layer 会被加载,注意被指定的 layer 需要有相同的 source。
  103167. * 当不配置时,默认为 Mapbox Style JSON 的 `sources` 对象中的第一个。
  103168. * @param {ol.Map} [options.map] - Openlayers 地图对象,仅用于面填充样式,若没有面填充样式可不填。
  103169. * @param {ol.StyleFunction} [options.selectedStyle] -选中样式Function。
  103170. * @param {boolean} [options.withCredentials] - 请求是否携带 cookie。
  103171. * @example
  103172. * var mbStyle = new MapboxStyles({
  103173. url: url,
  103174. source: 'California',
  103175. resolutions: [78271.51696402048,39135.75848201024, 19567.87924100512,9783.93962050256,4891.96981025128,2445.98490512564]
  103176. })
  103177. mbStyle.on('styleLoaded', function () {
  103178. var vectorLayer = new ol.layer.VectorTile({
  103179. //设置避让参数
  103180. declutter: true,
  103181. source: new ol.source.VectorTileSuperMapRest({
  103182. url: url,
  103183. format: new ol.format.MVT({
  103184. featureClass: ol.Feature
  103185. }),
  103186. tileType: 'ScaleXY'
  103187. }),
  103188. style: mbStyle.featureStyleFuntion
  103189. });
  103190. map.addLayer(vectorLayer);
  103191. })
  103192. * @usage
  103193. */
  103194. var MapboxStyles = /*#__PURE__*/function (_Observable) {
  103195. MapboxStyles_inherits(MapboxStyles, _Observable);
  103196. var _super = MapboxStyles_createSuper(MapboxStyles);
  103197. function MapboxStyles(options) {
  103198. var _this;
  103199. MapboxStyles_classCallCheck(this, MapboxStyles);
  103200. _this = _super.call(this);
  103201. options = options || {};
  103202. _this.spriteRegEx = /^(.*)(\?.*)$/;
  103203. _this.defaultFont = ['DIN Offc Pro Medium', 'Arial Unicode MS Regular'];
  103204. _this.map = options.map;
  103205. _this.source = options.source;
  103206. _this.styleTarget = options.style || Util_Util.urlAppend(Util_Util.urlPathAppend(options.url, 'tileFeature/vectorstyles'), 'type=MapBox_GL&styleonly=true');
  103207. _this.resolutions = options.resolutions;
  103208. _this.withCredentials = options.withCredentials;
  103209. _this.selectedObjects = [];
  103210. _this.selectedStyle = options.selectedStyle || function () {
  103211. return new (external_ol_style_Style_default())({
  103212. fill: new (external_ol_style_Fill_default())({
  103213. color: 'rgba(255, 0, 0, 1)'
  103214. }),
  103215. stroke: new (external_ol_style_Stroke_default())({
  103216. color: 'rgba(255, 0, 0, 1)',
  103217. width: 10
  103218. }),
  103219. text: new (external_ol_style_Text_default())({
  103220. font: 'normal 400 11.19px "Microsoft YaHei"',
  103221. placement: 'point',
  103222. fill: new (external_ol_style_Fill_default())({
  103223. color: 'blue'
  103224. })
  103225. }),
  103226. image: new (external_ol_style_Circle_default())({
  103227. radius: 5,
  103228. fill: new (external_ol_style_Fill_default())({
  103229. color: 'blue'
  103230. })
  103231. })
  103232. });
  103233. };
  103234. _this.layersBySourceLayer = {};
  103235. olExtends(_this.map);
  103236. _this._loadStyle(_this.styleTarget);
  103237. return _this;
  103238. }
  103239. /**
  103240. * @function MapboxStyles.prototype.getStyleFunction
  103241. * @description 获取 ol.StyleFunction。
  103242. * @returns {ol.StyleFunction} 返回 ol.StyleFunction
  103243. */
  103244. MapboxStyles_createClass(MapboxStyles, [{
  103245. key: "getStyleFunction",
  103246. value: function getStyleFunction() {
  103247. return this.featureStyleFuntion;
  103248. }
  103249. /**
  103250. * @function MapboxStyles.prototype.getStylesBySourceLayer
  103251. * @description 根据图层名称获取样式。
  103252. * @param {string} sourceLayer - 数据图层名称。
  103253. */
  103254. }, {
  103255. key: "getStylesBySourceLayer",
  103256. value: function getStylesBySourceLayer(sourceLayer) {
  103257. if (this.layersBySourceLayer[sourceLayer]) {
  103258. return this.layersBySourceLayer[sourceLayer];
  103259. }
  103260. var layers = [];
  103261. for (var index = 0; index < this._mbStyle.layers.length; index++) {
  103262. var layer = this._mbStyle.layers[index];
  103263. if (layer['source-layer'] !== sourceLayer) {
  103264. continue;
  103265. }
  103266. layers.push(layer);
  103267. }
  103268. this.layersBySourceLayer[sourceLayer] = layers;
  103269. return layers;
  103270. }
  103271. /**
  103272. * @function MapboxStyles.prototype.setSelectedId
  103273. * @description 设置选中要素,该要素将会用 `selectedStyle` 样式绘制。调用该方法后需要调用 {@link ol.layer.VectorTile} 的 `changed`,才能生效。
  103274. * @param {number} selectedId - 要素ID。
  103275. * @param {string} sourceLayer - 要素所在图层名称。
  103276. */
  103277. }, {
  103278. key: "setSelectedId",
  103279. value: function setSelectedId(selectedId, sourceLayer) {
  103280. this.selectedObjects = [];
  103281. this.selectedObjects.push({
  103282. id: selectedId,
  103283. sourceLayer: sourceLayer
  103284. });
  103285. }
  103286. /**
  103287. * @typedef {Object} MapboxStyles.selectedObject
  103288. * @description 要选择的要素对象。
  103289. * @property {number} selectedId - 要素ID。
  103290. * @property {string} sourceLayer - 要素所在图层名称。
  103291. */
  103292. /**
  103293. * @function MapboxStyles.prototype.setSelectedObjects
  103294. * @version 10.0.0
  103295. * @description 设置选中要素或要素数组,该要素将会用 `selectedStyle` 样式绘制。调用该方法后需要调用 {@link ol.layer.VectorTile} 的 `changed`,才能生效。
  103296. * @param {MapboxStyles.selectedObject|Array.<MapboxStyles.selectedObject>} addSelectedObjects - 选择的要素或要素数组。
  103297. */
  103298. }, {
  103299. key: "setSelectedObjects",
  103300. value: function setSelectedObjects(selectedObjects) {
  103301. if (!Array.isArray(selectedObjects)) {
  103302. selectedObjects = [selectedObjects];
  103303. }
  103304. this.selectedObjects = [];
  103305. this.selectedObjects = selectedObjects;
  103306. }
  103307. /**
  103308. * @function MapboxStyles.prototype.addSelectedObjects
  103309. * @version 10.0.0
  103310. * @description 增加选中的要素或要素数组,该要素将会用 `selectedStyle` 样式绘制。调用该方法后需要调用 {@link ol.layer.VectorTile} 的 `changed` 才能生效。
  103311. * @param {MapboxStyles.selectedObject|Array.<MapboxStyles.selectedObject>} addSelectedObjects - 选择的要素或要素数组。
  103312. */
  103313. }, {
  103314. key: "addSelectedObjects",
  103315. value: function addSelectedObjects(selectedObjects) {
  103316. var _this$selectedObjects;
  103317. if (!Array.isArray(selectedObjects)) {
  103318. selectedObjects = [selectedObjects];
  103319. }
  103320. (_this$selectedObjects = this.selectedObjects).push.apply(_this$selectedObjects, MapboxStyles_toConsumableArray(selectedObjects));
  103321. }
  103322. /**
  103323. * @function MapboxStyles.prototype.removeSelectedObjects
  103324. * @version 10.0.0
  103325. * @description 清空选中状态。调用该方法后需要调用 {@link ol.layer.VectorTile} 的 `changed` 才能生效。
  103326. */
  103327. }, {
  103328. key: "removeSelectedObjects",
  103329. value: function removeSelectedObjects(selectedObjects) {
  103330. var _this2 = this;
  103331. if (!Array.isArray(selectedObjects)) {
  103332. selectedObjects = [selectedObjects];
  103333. }
  103334. selectedObjects.forEach(function (element) {
  103335. lodash_remove_default()(_this2.selectedObjects, function (obj) {
  103336. return element.id === obj.id && element.sourceLayer === obj.sourceLayer;
  103337. });
  103338. });
  103339. }
  103340. /**
  103341. * @function MapboxStyles.prototype.clearSelectedObjects
  103342. * @version 10.0.0
  103343. * @description 清空选中状态。调用该方法后需要调用 {@link ol.layer.VectorTile} 的 `changed`,才能生效。
  103344. */
  103345. }, {
  103346. key: "clearSelectedObjects",
  103347. value: function clearSelectedObjects() {
  103348. this.selectedObjects = [];
  103349. }
  103350. /**
  103351. * @function MapboxStyles.prototype.updateStyles
  103352. * @description 更新图层样式。
  103353. * @param {Object} layerStyles - 图层样式或图层样式数组。
  103354. */
  103355. }, {
  103356. key: "updateStyles",
  103357. value: function updateStyles(layerStyles) {
  103358. if (Object.prototype.toString.call(layerStyles) !== '[object Array]') {
  103359. layerStyles = [layerStyles];
  103360. }
  103361. var layerObj = {};
  103362. layerStyles.forEach(function (layerStyle) {
  103363. layerObj[layerStyle.id] = layerStyle;
  103364. });
  103365. var count = 0;
  103366. for (var key in this._mbStyle.layers) {
  103367. var oldLayerStyle = this._mbStyle.layers[key];
  103368. if (count >= layerStyles.length) {
  103369. break;
  103370. }
  103371. if (!layerObj[oldLayerStyle.id]) {
  103372. continue;
  103373. }
  103374. var newLayerStyle = JSON.parse(JSON.stringify(layerObj[oldLayerStyle.id]));
  103375. if (newLayerStyle.paint) {
  103376. newLayerStyle.paint = Object.assign({}, oldLayerStyle.paint, newLayerStyle.paint);
  103377. }
  103378. if (newLayerStyle.layout) {
  103379. newLayerStyle.layout = Object.assign({}, oldLayerStyle.layout, newLayerStyle.layout);
  103380. }
  103381. Object.assign(oldLayerStyle, newLayerStyle);
  103382. count++;
  103383. }
  103384. this._createStyleFunction();
  103385. }
  103386. /**
  103387. * @function MapboxStyles.prototype.setStyle
  103388. * @version 9.1.1
  103389. * @description 设置 Mapbox style 对象。
  103390. * @param {Object} style - Mapbox style 对象。
  103391. */
  103392. }, {
  103393. key: "setStyle",
  103394. value: function setStyle(style) {
  103395. this.layersBySourceLayer = {};
  103396. this._loadStyle(style);
  103397. }
  103398. }, {
  103399. key: "_loadStyle",
  103400. value: function _loadStyle(style) {
  103401. var _this3 = this;
  103402. if (Object.prototype.toString.call(style) == '[object Object]') {
  103403. this._mbStyle = style;
  103404. this._resolve();
  103405. } else {
  103406. var url = SecurityManager.appendCredential(style);
  103407. FetchRequest.get(url, null, {
  103408. withCredentials: this.withCredentials
  103409. }).then(function (response) {
  103410. return response.json();
  103411. }).then(function (mbStyle) {
  103412. _this3._mbStyle = mbStyle;
  103413. _this3._resolve();
  103414. });
  103415. }
  103416. }
  103417. }, {
  103418. key: "_resolve",
  103419. value: function _resolve() {
  103420. var _this4 = this;
  103421. if (!this.source) {
  103422. this.source = Object.keys(this._mbStyle.sources)[0];
  103423. }
  103424. if (this._mbStyle.sprite) {
  103425. var spriteScale = window.devicePixelRatio >= 1.5 ? 0.5 : 1;
  103426. var sizeFactor = spriteScale == 0.5 ? '@2x' : '';
  103427. //兼容一下iServer 等iServer修改
  103428. this._mbStyle.sprite = this._mbStyle.sprite.replace('@2x', '');
  103429. var spriteUrl = this._toSpriteUrl(this._mbStyle.sprite, this.path, sizeFactor + '.json');
  103430. FetchRequest.get(SecurityManager.appendCredential(spriteUrl), null, {
  103431. withCredentials: this.withCredentials
  103432. }).then(function (response) {
  103433. return response.json();
  103434. }).then(function (spritesJson) {
  103435. _this4._spriteData = spritesJson;
  103436. _this4._spriteImageUrl = SecurityManager.appendCredential(_this4._toSpriteUrl(_this4._mbStyle.sprite, _this4.path, sizeFactor + '.png'));
  103437. _this4._spriteImage = null;
  103438. var img = new Image();
  103439. img.crossOrigin = _this4.withCredentials ? 'use-credentials' : 'anonymous';
  103440. img.onload = function () {
  103441. _this4._spriteImage = img;
  103442. _this4._initStyleFunction();
  103443. };
  103444. img.onerror = function () {
  103445. _this4._spriteImage = null;
  103446. _this4._initStyleFunction();
  103447. };
  103448. img.src = _this4._spriteImageUrl;
  103449. })["catch"](function (err) {
  103450. console.log(err);
  103451. _this4._spriteImage = null;
  103452. _this4._initStyleFunction();
  103453. });
  103454. } else {
  103455. this._initStyleFunction();
  103456. }
  103457. }
  103458. }, {
  103459. key: "_initStyleFunction",
  103460. value: function _initStyleFunction() {
  103461. if (!this.resolutions && this._mbStyle.metadata && this._mbStyle.metadata.indexbounds) {
  103462. var indexbounds = this._mbStyle.metadata.indexbounds;
  103463. var max = Math.max(indexbounds[2] - indexbounds[0], indexbounds[3] - indexbounds[1]);
  103464. var defaultResolutions = [];
  103465. for (var index = 0; index < 30; index++) {
  103466. defaultResolutions.push(max / 512 / Math.pow(2, index));
  103467. }
  103468. this.resolutions = defaultResolutions;
  103469. }
  103470. this._createStyleFunction();
  103471. /**
  103472. * @event MapboxStyles#styleloaded
  103473. * @description 样式加载成功后触发。
  103474. */
  103475. this.dispatchEvent('styleloaded');
  103476. }
  103477. }, {
  103478. key: "_createStyleFunction",
  103479. value: function _createStyleFunction() {
  103480. if (this.map) {
  103481. window.olms.applyBackground(this.map, this._mbStyle);
  103482. }
  103483. this.featureStyleFuntion = this._getStyleFunction();
  103484. }
  103485. }, {
  103486. key: "_getStyleFunction",
  103487. value: function _getStyleFunction() {
  103488. var _this5 = this;
  103489. this.fun = window.olms.stylefunction({
  103490. setStyle: function setStyle() {},
  103491. set: function set() {},
  103492. changed: function changed() {}
  103493. }, this._mbStyle, this.source, this.resolutions, this._spriteData, '', this._spriteImage);
  103494. return function (feature, resolution) {
  103495. var style = _this5.fun(feature, resolution);
  103496. if (_this5.selectedObjects.length > 0 && _this5.selectedObjects.find(function (element) {
  103497. return element.id === feature.getId() && element.sourceLayer === feature.get('layer');
  103498. })) {
  103499. var styleIndex = style && style[0] ? style[0].getZIndex() : 99999;
  103500. var selectStyles = _this5.selectedStyle(feature, resolution);
  103501. if (!Array.isArray(selectStyles)) {
  103502. selectStyles = [selectStyles];
  103503. }
  103504. for (var index = 0; index < selectStyles.length; index++) {
  103505. var selectStyle = selectStyles[index];
  103506. if (feature.getGeometry().getType() === 'Point' && style[0].getText() && selectStyle.getText()) {
  103507. selectStyle.setFill(null);
  103508. selectStyle.setStroke(null);
  103509. selectStyle.setImage();
  103510. selectStyle.getText().setText(style[0].getText().getText());
  103511. }
  103512. selectStyle.setZIndex(styleIndex);
  103513. }
  103514. return selectStyles;
  103515. }
  103516. return style;
  103517. };
  103518. }
  103519. }, {
  103520. key: "_withPath",
  103521. value: function _withPath(url, path) {
  103522. if (path && url.indexOf('http') != 0) {
  103523. url = path + url;
  103524. }
  103525. return url;
  103526. }
  103527. }, {
  103528. key: "_toSpriteUrl",
  103529. value: function _toSpriteUrl(url, path, extension) {
  103530. url = this._withPath(url, path);
  103531. var parts = url.match(this.spriteRegEx);
  103532. return parts ? parts[1] + extension + (parts.length > 2 ? parts[2] : '') : url + extension;
  103533. }
  103534. }]);
  103535. return MapboxStyles;
  103536. }((external_ol_Observable_default()));
  103537. ;// CONCATENATED MODULE: ./src/openlayers/overlay/vectortile/index.js
  103538. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  103539. * This program are made available under the terms of the Apache License, Version 2.0
  103540. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  103541. ;// CONCATENATED MODULE: ./src/openlayers/overlay/index.js
  103542. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  103543. * This program are made available under the terms of the Apache License, Version 2.0
  103544. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  103545. ;// CONCATENATED MODULE: ./src/openlayers/services/AddressMatchService.js
  103546. function services_AddressMatchService_typeof(obj) { "@babel/helpers - typeof"; return services_AddressMatchService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, services_AddressMatchService_typeof(obj); }
  103547. function services_AddressMatchService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  103548. function services_AddressMatchService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  103549. function services_AddressMatchService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_AddressMatchService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_AddressMatchService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  103550. function services_AddressMatchService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) services_AddressMatchService_setPrototypeOf(subClass, superClass); }
  103551. function services_AddressMatchService_setPrototypeOf(o, p) { services_AddressMatchService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_AddressMatchService_setPrototypeOf(o, p); }
  103552. function services_AddressMatchService_createSuper(Derived) { var hasNativeReflectConstruct = services_AddressMatchService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_AddressMatchService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_AddressMatchService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_AddressMatchService_possibleConstructorReturn(this, result); }; }
  103553. function services_AddressMatchService_possibleConstructorReturn(self, call) { if (call && (services_AddressMatchService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return services_AddressMatchService_assertThisInitialized(self); }
  103554. function services_AddressMatchService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  103555. function services_AddressMatchService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  103556. function services_AddressMatchService_getPrototypeOf(o) { services_AddressMatchService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_AddressMatchService_getPrototypeOf(o); }
  103557. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  103558. * This program are made available under the terms of the Apache License, Version 2.0
  103559. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  103560. /**
  103561. * @class AddressMatchService
  103562. * @category iServer AddressMatch
  103563. * @classdesc 地址匹配服务。
  103564. * @modulecategory Services
  103565. * @example
  103566. * new AddressMatchService(url,options)
  103567. * .code(function(result){
  103568. * //doSomething
  103569. * })
  103570. * @param {string} url - 服务地址。
  103571. * @param {Object} options - 参数。
  103572. * @param {string} [options.proxy] - 服务代理地址。
  103573. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  103574. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  103575. * @param {Object} [options.headers] - 请求头。
  103576. * @extends {ServiceBase}
  103577. * @usage
  103578. */
  103579. var AddressMatchService = /*#__PURE__*/function (_ServiceBase) {
  103580. services_AddressMatchService_inherits(AddressMatchService, _ServiceBase);
  103581. var _super = services_AddressMatchService_createSuper(AddressMatchService);
  103582. function AddressMatchService(url, options) {
  103583. var _this;
  103584. services_AddressMatchService_classCallCheck(this, AddressMatchService);
  103585. _this = _super.call(this, url, options);
  103586. _this._addressMatchService = new AddressMatchService_AddressMatchService(_this.url, {
  103587. proxy: _this.options.proxy,
  103588. withCredentials: _this.options.withCredentials,
  103589. crossOrigin: _this.options.crossOrigin,
  103590. headers: _this.options.headers
  103591. });
  103592. return _this;
  103593. }
  103594. /**
  103595. * @function AddressMatchService.prototype.code
  103596. * @description 获取正向地址匹配结果。
  103597. * @param {GeoCodingParameter} params - 正向匹配参数。
  103598. * @param {RequestCallback} callback 回调函数。
  103599. */
  103600. services_AddressMatchService_createClass(AddressMatchService, [{
  103601. key: "code",
  103602. value: function code(params, callback) {
  103603. this._addressMatchService.code(Util_Util.urlPathAppend(this.url, 'geocoding'), params, callback);
  103604. }
  103605. /**
  103606. * @function AddressMatchService.prototype.decode
  103607. * @description 获取反向地址匹配结果。
  103608. * @param {GeoDecodingParameter} params - 反向匹配参数。
  103609. * @param {RequestCallback} callback 回调函数。
  103610. */
  103611. }, {
  103612. key: "decode",
  103613. value: function decode(params, callback) {
  103614. this._addressMatchService.decode(Util_Util.urlPathAppend(this.url, 'geodecoding'), params, callback);
  103615. }
  103616. }]);
  103617. return AddressMatchService;
  103618. }(ServiceBase);
  103619. ;// CONCATENATED MODULE: ./src/common/iServer/ChartService.js
  103620. function ChartService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  103621. function ChartService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  103622. function ChartService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  103623. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  103624. * This program are made available under the terms of the Apache License, Version 2.0
  103625. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  103626. /**
  103627. * @class ChartService
  103628. * @category iServer Map Chart
  103629. * @classdesc 海图服务。
  103630. * @extends {ServiceBase}
  103631. * @example
  103632. * new ChartService(url).queryChart(param,function(result){
  103633. * //doSomething
  103634. * })
  103635. * @param {string} url - 服务地址。
  103636. * @param {Object} options - 参数。
  103637. * @param {string} [options.proxy] - 服务代理地址。
  103638. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  103639. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  103640. * @param {Object} [options.headers] - 请求头。
  103641. * @usage
  103642. */
  103643. var ChartService_ChartService = /*#__PURE__*/function () {
  103644. function ChartService(url, options) {
  103645. ChartService_classCallCheck(this, ChartService);
  103646. this.url = url;
  103647. this.options = options || {};
  103648. }
  103649. /**
  103650. * @function ChartService.prototype.queryChart
  103651. * @description 查询海图服务。
  103652. * @param {ChartQueryParameters} params - 海图查询所需参数类。
  103653. * @param {RequestCallback} callback - 回调函数。
  103654. * @param {DataFormat} resultFormat - 返回结果类型。
  103655. */
  103656. ChartService_createClass(ChartService, [{
  103657. key: "queryChart",
  103658. value: function queryChart(params, callback, resultFormat) {
  103659. var me = this,
  103660. param = params,
  103661. format = me._processFormat(resultFormat);
  103662. var chartQueryService = new ChartQueryService(me.url, {
  103663. proxy: me.options.proxy,
  103664. withCredentials: me.options.withCredentials,
  103665. crossOrigin: me.options.crossOrigin,
  103666. headers: me.options.headers,
  103667. eventListeners: {
  103668. scope: me,
  103669. processCompleted: callback,
  103670. processFailed: callback
  103671. },
  103672. format: format
  103673. });
  103674. chartQueryService.processAsync(param);
  103675. }
  103676. /**
  103677. * @function ChartService.prototype.getChartFeatureInfo
  103678. * @description 获取海图物标信息服务。
  103679. * @param {RequestCallback} callback 回调函数。
  103680. */
  103681. }, {
  103682. key: "getChartFeatureInfo",
  103683. value: function getChartFeatureInfo(callback) {
  103684. var me = this;
  103685. var url = Util_Util.urlPathAppend(me.url, 'chartFeatureInfoSpecs');
  103686. var chartFeatureInfoSpecsService = new ChartFeatureInfoSpecsService(url, {
  103687. proxy: me.options.proxy,
  103688. withCredentials: me.options.withCredentials,
  103689. crossOrigin: me.options.crossOrigin,
  103690. headers: me.options.headers,
  103691. eventListeners: {
  103692. scope: me,
  103693. processCompleted: callback,
  103694. processFailed: callback
  103695. }
  103696. });
  103697. chartFeatureInfoSpecsService.processAsync();
  103698. }
  103699. }, {
  103700. key: "_processFormat",
  103701. value: function _processFormat(resultFormat) {
  103702. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  103703. }
  103704. }]);
  103705. return ChartService;
  103706. }();
  103707. ;// CONCATENATED MODULE: ./src/openlayers/services/ChartService.js
  103708. function ChartService_typeof(obj) { "@babel/helpers - typeof"; return ChartService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ChartService_typeof(obj); }
  103709. function services_ChartService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  103710. function services_ChartService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  103711. function services_ChartService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_ChartService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_ChartService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  103712. function ChartService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ChartService_setPrototypeOf(subClass, superClass); }
  103713. function ChartService_setPrototypeOf(o, p) { ChartService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ChartService_setPrototypeOf(o, p); }
  103714. function ChartService_createSuper(Derived) { var hasNativeReflectConstruct = ChartService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ChartService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ChartService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ChartService_possibleConstructorReturn(this, result); }; }
  103715. function ChartService_possibleConstructorReturn(self, call) { if (call && (ChartService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ChartService_assertThisInitialized(self); }
  103716. function ChartService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  103717. function ChartService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  103718. function ChartService_getPrototypeOf(o) { ChartService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ChartService_getPrototypeOf(o); }
  103719. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  103720. * This program are made available under the terms of the Apache License, Version 2.0
  103721. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  103722. /**
  103723. * @class ChartService
  103724. * @category iServer Map Chart
  103725. * @classdesc 海图服务。
  103726. * @modulecategory Services
  103727. * @extends {ServiceBase}
  103728. * @example
  103729. * new ChartService(url).queryChart(param,function(result){
  103730. * //doSomething
  103731. * })
  103732. * @param {string} url - 服务地址。
  103733. * @param {Object} options - 参数。
  103734. * @param {string} [options.proxy] - 服务代理地址。
  103735. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  103736. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  103737. * @param {Object} [options.headers] - 请求头。
  103738. * @usage
  103739. */
  103740. var ChartService = /*#__PURE__*/function (_ServiceBase) {
  103741. ChartService_inherits(ChartService, _ServiceBase);
  103742. var _super = ChartService_createSuper(ChartService);
  103743. function ChartService(url, options) {
  103744. var _this;
  103745. services_ChartService_classCallCheck(this, ChartService);
  103746. _this = _super.call(this, url, options);
  103747. _this._chartService = new ChartService_ChartService(url, options);
  103748. return _this;
  103749. }
  103750. /**
  103751. * @function ChartService.prototype.queryChart
  103752. * @description 查询海图服务。
  103753. * @param {ChartQueryParameters} params - 海图查询所需参数类。
  103754. * @param {RequestCallback} callback - 回调函数。
  103755. * @param {DataFormat} resultFormat - 返回结果类型。
  103756. */
  103757. services_ChartService_createClass(ChartService, [{
  103758. key: "queryChart",
  103759. value: function queryChart(params, callback, resultFormat) {
  103760. params = this._processParams(params);
  103761. this._chartService.queryChart(params, callback, resultFormat);
  103762. }
  103763. /**
  103764. * @function ChartService.prototype.getChartFeatureInfo
  103765. * @description 获取海图物标信息服务。
  103766. * @param {RequestCallback} callback 回调函数。
  103767. */
  103768. }, {
  103769. key: "getChartFeatureInfo",
  103770. value: function getChartFeatureInfo(callback) {
  103771. this._chartService.getChartFeatureInfo(callback);
  103772. }
  103773. }, {
  103774. key: "_processParams",
  103775. value: function _processParams(params) {
  103776. if (!params) {
  103777. return {};
  103778. }
  103779. params.returnContent = params.returnContent == null ? true : params.returnContent;
  103780. if (params.filter) {
  103781. params.chartQueryFilterParameters = core_Util_Util.isArray(params.filter) ? params.filter : [params.filter];
  103782. }
  103783. if (params.bounds) {
  103784. params.bounds = new Bounds(params.bounds[0], params.bounds[1], params.bounds[2], params.bounds[3]);
  103785. }
  103786. }
  103787. }]);
  103788. return ChartService;
  103789. }(ServiceBase);
  103790. ;// CONCATENATED MODULE: ./src/common/iServer/FieldService.js
  103791. function FieldService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  103792. function FieldService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  103793. function FieldService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  103794. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  103795. * This program are made available under the terms of the Apache License, Version 2.0
  103796. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  103797. /**
  103798. * @class FieldService
  103799. * @category iServer Data Field
  103800. * @classdesc 字段服务类。
  103801. * @example
  103802. * new FieldService(url).getFields(function(result){
  103803. * //doSomething
  103804. * });
  103805. * @param {string} url - 服务地址。
  103806. * @param {Object} options - 参数。
  103807. * @param {string} [options.proxy] - 服务代理地址。
  103808. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  103809. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  103810. * @param {Object} [options.headers] - 请求头。
  103811. * @extends {ServiceBase}
  103812. * @usage
  103813. */
  103814. var FieldService_FieldService = /*#__PURE__*/function () {
  103815. function FieldService(url, options) {
  103816. FieldService_classCallCheck(this, FieldService);
  103817. this.url = url;
  103818. this.options = options || {};
  103819. }
  103820. /**
  103821. * @function FieldService.prototype.getFields
  103822. * @description 字段查询服务。
  103823. * @param {FieldParameters} params - 字段信息查询参数类。
  103824. * @param {RequestCallback} callback 回调函数。
  103825. */
  103826. FieldService_createClass(FieldService, [{
  103827. key: "getFields",
  103828. value: function getFields(params, callback) {
  103829. var me = this;
  103830. var getFieldsService = new GetFieldsService(me.url, {
  103831. proxy: me.options.proxy,
  103832. withCredentials: me.options.withCredentials,
  103833. crossOrigin: me.options.crossOrigin,
  103834. headers: me.options.headers,
  103835. eventListeners: {
  103836. scope: me,
  103837. processCompleted: callback,
  103838. processFailed: callback
  103839. },
  103840. datasource: params.datasource,
  103841. dataset: params.dataset
  103842. });
  103843. getFieldsService.processAsync();
  103844. }
  103845. /**
  103846. * @function FieldService.prototype.getFieldStatisticsInfo
  103847. * @description 字段统计服务。
  103848. * @param {FieldStatisticsParameters} params - 字段统计信息查询参数类。
  103849. * @param {RequestCallback} callback 回调函数。
  103850. */
  103851. }, {
  103852. key: "getFieldStatisticsInfo",
  103853. value: function getFieldStatisticsInfo(params, callback) {
  103854. if (!(params instanceof FieldStatisticsParameters)) {
  103855. return;
  103856. }
  103857. var me = this,
  103858. fieldName = params.fieldName,
  103859. modes = params.statisticMode;
  103860. if (modes && !Array.isArray(modes)) {
  103861. modes = [modes];
  103862. }
  103863. me.currentStatisticResult = {
  103864. fieldName: fieldName
  103865. };
  103866. me._statisticsCallback = callback;
  103867. //针对每种统计方式分别进行请求
  103868. modes.forEach(function (mode) {
  103869. me.currentStatisticResult[mode] = null;
  103870. me._fieldStatisticRequest(params.datasource, params.dataset, fieldName, mode);
  103871. });
  103872. }
  103873. }, {
  103874. key: "_fieldStatisticRequest",
  103875. value: function _fieldStatisticRequest(datasource, dataset, fieldName, statisticMode) {
  103876. var me = this;
  103877. var statisticService = new FieldStatisticService(me.url, {
  103878. eventListeners: {
  103879. scope: me,
  103880. processCompleted: me._processCompleted.bind(me),
  103881. processFailed: me._statisticsCallback
  103882. },
  103883. datasource: datasource,
  103884. dataset: dataset,
  103885. field: fieldName,
  103886. statisticMode: statisticMode,
  103887. crossOrigin: me.options.crossOrigin,
  103888. headers: me.options.headers
  103889. });
  103890. statisticService.processAsync();
  103891. }
  103892. }, {
  103893. key: "_processCompleted",
  103894. value: function _processCompleted(fieldStatisticResult, options) {
  103895. var me = this;
  103896. var getAll = true,
  103897. result = fieldStatisticResult.result;
  103898. if (this.currentStatisticResult) {
  103899. if (null == me.currentStatisticResult[result.mode]) {
  103900. this.currentStatisticResult[result.mode] = result.result;
  103901. }
  103902. }
  103903. for (var mode in me.currentStatisticResult) {
  103904. if (null == me.currentStatisticResult[mode]) {
  103905. getAll = false;
  103906. break;
  103907. }
  103908. }
  103909. if (getAll) {
  103910. me._statisticsCallback({
  103911. result: me.currentStatisticResult,
  103912. options: options
  103913. });
  103914. }
  103915. }
  103916. }]);
  103917. return FieldService;
  103918. }();
  103919. ;// CONCATENATED MODULE: ./src/openlayers/services/FieldService.js
  103920. function FieldService_typeof(obj) { "@babel/helpers - typeof"; return FieldService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, FieldService_typeof(obj); }
  103921. function services_FieldService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  103922. function services_FieldService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  103923. function services_FieldService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_FieldService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_FieldService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  103924. function FieldService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) FieldService_setPrototypeOf(subClass, superClass); }
  103925. function FieldService_setPrototypeOf(o, p) { FieldService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FieldService_setPrototypeOf(o, p); }
  103926. function FieldService_createSuper(Derived) { var hasNativeReflectConstruct = FieldService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FieldService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FieldService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FieldService_possibleConstructorReturn(this, result); }; }
  103927. function FieldService_possibleConstructorReturn(self, call) { if (call && (FieldService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return FieldService_assertThisInitialized(self); }
  103928. function FieldService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  103929. function FieldService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  103930. function FieldService_getPrototypeOf(o) { FieldService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FieldService_getPrototypeOf(o); }
  103931. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  103932. * This program are made available under the terms of the Apache License, Version 2.0
  103933. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  103934. /**
  103935. * @class FieldService
  103936. * @category iServer Data Field
  103937. * @classdesc 字段服务类。
  103938. * @example
  103939. * new FieldService(url).getFields(function(result){
  103940. * //doSomething
  103941. * });
  103942. * @modulecategory Services
  103943. * @param {string} url - 服务地址。
  103944. * @param {Object} options - 参数。
  103945. * @param {string} [options.proxy] - 服务代理地址。
  103946. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  103947. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  103948. * @param {Object} [options.headers] - 请求头。
  103949. * @extends {ServiceBase}
  103950. * @usage
  103951. */
  103952. var FieldService = /*#__PURE__*/function (_ServiceBase) {
  103953. FieldService_inherits(FieldService, _ServiceBase);
  103954. var _super = FieldService_createSuper(FieldService);
  103955. function FieldService(url, options) {
  103956. var _this;
  103957. services_FieldService_classCallCheck(this, FieldService);
  103958. _this = _super.call(this, url, options);
  103959. _this._fieldService = new FieldService_FieldService(url, options);
  103960. return _this;
  103961. }
  103962. /**
  103963. * @function FieldService.prototype.getFields
  103964. * @description 字段查询服务。
  103965. * @param {FieldParameters} params - 字段信息查询参数类。
  103966. * @param {RequestCallback} callback - 回调函数。
  103967. */
  103968. services_FieldService_createClass(FieldService, [{
  103969. key: "getFields",
  103970. value: function getFields(params, callback) {
  103971. this._fieldService.getFields(params, callback);
  103972. }
  103973. /**
  103974. * @function FieldService.prototype.getFieldStatisticsInfo
  103975. * @description 字段统计服务。
  103976. * @param {FieldStatisticsParameters} params - 字段统计信息查询参数类。
  103977. * @param {RequestCallback} callback - 回调函数。
  103978. */
  103979. }, {
  103980. key: "getFieldStatisticsInfo",
  103981. value: function getFieldStatisticsInfo(params, callback) {
  103982. this._fieldService.getFieldStatisticsInfo(params, callback);
  103983. }
  103984. }]);
  103985. return FieldService;
  103986. }(ServiceBase);
  103987. ;// CONCATENATED MODULE: ./src/openlayers/services/DatasetService.js
  103988. function services_DatasetService_typeof(obj) { "@babel/helpers - typeof"; return services_DatasetService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, services_DatasetService_typeof(obj); }
  103989. function services_DatasetService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  103990. function services_DatasetService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  103991. function services_DatasetService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_DatasetService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_DatasetService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  103992. function services_DatasetService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) services_DatasetService_setPrototypeOf(subClass, superClass); }
  103993. function services_DatasetService_setPrototypeOf(o, p) { services_DatasetService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_DatasetService_setPrototypeOf(o, p); }
  103994. function services_DatasetService_createSuper(Derived) { var hasNativeReflectConstruct = services_DatasetService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_DatasetService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_DatasetService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_DatasetService_possibleConstructorReturn(this, result); }; }
  103995. function services_DatasetService_possibleConstructorReturn(self, call) { if (call && (services_DatasetService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return services_DatasetService_assertThisInitialized(self); }
  103996. function services_DatasetService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  103997. function services_DatasetService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  103998. function services_DatasetService_getPrototypeOf(o) { services_DatasetService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_DatasetService_getPrototypeOf(o); }
  103999. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  104000. * This program are made available under the terms of the Apache License, Version 2.0
  104001. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  104002. /**
  104003. * @class DatasetService
  104004. * @category iServer Data Dataset
  104005. * @classdesc 数据集服务类。
  104006. * @modulecategory Services
  104007. * @param {string} url - 服务地址。
  104008. * @param {Object} options - 参数。
  104009. * @param {string} [options.proxy] - 服务代理地址。
  104010. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  104011. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  104012. * @param {Object} [options.headers] - 请求头。
  104013. * @extends {ServiceBase}
  104014. * @usage
  104015. */
  104016. var DatasetService = /*#__PURE__*/function (_ServiceBase) {
  104017. services_DatasetService_inherits(DatasetService, _ServiceBase);
  104018. var _super = services_DatasetService_createSuper(DatasetService);
  104019. function DatasetService(url, options) {
  104020. var _this;
  104021. services_DatasetService_classCallCheck(this, DatasetService);
  104022. _this = _super.call(this, url, options);
  104023. _this._datasetService = new DatasetService_DatasetService(_this.url, {
  104024. proxy: _this.options.proxy,
  104025. withCredentials: _this.options.withCredentials,
  104026. crossOrigin: _this.options.crossOrigin,
  104027. headers: _this.options.headers
  104028. });
  104029. return _this;
  104030. }
  104031. /**
  104032. * @function DatasetService.prototype.getDatasets
  104033. * @description 数据集查询服务。
  104034. * @param {string} datasourceName - 数据源名称。
  104035. * @param {RequestCallback} callback - 回调函数。
  104036. */
  104037. services_DatasetService_createClass(DatasetService, [{
  104038. key: "getDatasets",
  104039. value: function getDatasets(datasourceName, callback) {
  104040. if (!datasourceName) {
  104041. return;
  104042. }
  104043. this._datasetService.getDatasetsService(datasourceName, callback);
  104044. }
  104045. /**
  104046. * @function DatasetService.prototype.getDataset
  104047. * @description 数据集查询服务。
  104048. * @param {string} datasourceName - 数据源名称。
  104049. * @param {string} datasetName - 数据集名称。
  104050. * @param {RequestCallback} callback - 回调函数。
  104051. */
  104052. }, {
  104053. key: "getDataset",
  104054. value: function getDataset(datasourceName, datasetName, callback) {
  104055. if (!datasourceName || !datasetName) {
  104056. return;
  104057. }
  104058. this._datasetService.getDatasetService(datasourceName, datasetName, callback);
  104059. }
  104060. /**
  104061. * @function DatasetService.prototype.setDataset
  104062. * @description 数据集信息设置服务。可实现修改已存在数据集,新增不存在数据集。
  104063. * @param {CreateDatasetParameters | UpdateDatasetParameters } params - 数据集创建参数类或数据集信息更改参数类。
  104064. * @param {RequestCallback} callback - 回调函数。
  104065. */
  104066. }, {
  104067. key: "setDataset",
  104068. value: function setDataset(params, callback) {
  104069. if (!(params instanceof CreateDatasetParameters) && !(params instanceof UpdateDatasetParameters)) {
  104070. return;
  104071. } else if (params instanceof CreateDatasetParameters) {
  104072. var datasetParams = {
  104073. "datasetType": params.datasetType,
  104074. "datasetName": params.datasetName,
  104075. "datasourceName": params.datasourceName
  104076. };
  104077. } else if (params instanceof UpdateDatasetParameters) {
  104078. datasetParams = {
  104079. "datasetName": params.datasetName,
  104080. "datasourceName": params.datasourceName,
  104081. "isFileCache": params.isFileCache,
  104082. "description": params.description,
  104083. "prjCoordSys": params.prjCoordSys,
  104084. "charset": params.charset
  104085. };
  104086. }
  104087. this._datasetService.setDatasetService(datasetParams, callback);
  104088. }
  104089. /**
  104090. * @function DatasetService.prototype.deleteDataset
  104091. * @description 指定数据源下的数据集删除服务。
  104092. * @param {string} datasourceName - 数据源名称。
  104093. * @param {string} datasetName - 数据集名称。
  104094. * @param {RequestCallback} callback - 回调函数。
  104095. */
  104096. }, {
  104097. key: "deleteDataset",
  104098. value: function deleteDataset(datasourceName, datasetName, callback) {
  104099. this._datasetService.deleteDatasetService(datasourceName, datasetName, callback);
  104100. }
  104101. }]);
  104102. return DatasetService;
  104103. }(ServiceBase);
  104104. ;// CONCATENATED MODULE: ./src/openlayers/services/DatasourceService.js
  104105. function services_DatasourceService_typeof(obj) { "@babel/helpers - typeof"; return services_DatasourceService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, services_DatasourceService_typeof(obj); }
  104106. function services_DatasourceService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  104107. function services_DatasourceService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  104108. function services_DatasourceService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_DatasourceService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_DatasourceService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  104109. function services_DatasourceService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) services_DatasourceService_setPrototypeOf(subClass, superClass); }
  104110. function services_DatasourceService_setPrototypeOf(o, p) { services_DatasourceService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_DatasourceService_setPrototypeOf(o, p); }
  104111. function services_DatasourceService_createSuper(Derived) { var hasNativeReflectConstruct = services_DatasourceService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_DatasourceService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_DatasourceService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_DatasourceService_possibleConstructorReturn(this, result); }; }
  104112. function services_DatasourceService_possibleConstructorReturn(self, call) { if (call && (services_DatasourceService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return services_DatasourceService_assertThisInitialized(self); }
  104113. function services_DatasourceService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  104114. function services_DatasourceService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  104115. function services_DatasourceService_getPrototypeOf(o) { services_DatasourceService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_DatasourceService_getPrototypeOf(o); }
  104116. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  104117. * This program are made available under the terms of the Apache License, Version 2.0
  104118. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  104119. /**
  104120. * @class DatasourceService
  104121. * @category iServer Data Datasource
  104122. * @classdesc 数据源服务类。
  104123. * @modulecategory Services
  104124. * @param {string} url - 服务地址。
  104125. * @param {Object} options - 参数。
  104126. * @param {string} [options.proxy] - 服务代理地址。
  104127. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  104128. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  104129. * @param {Object} [options.headers] - 请求头。
  104130. * @extends {ServiceBase}
  104131. * @usage
  104132. */
  104133. var DatasourceService = /*#__PURE__*/function (_ServiceBase) {
  104134. services_DatasourceService_inherits(DatasourceService, _ServiceBase);
  104135. var _super = services_DatasourceService_createSuper(DatasourceService);
  104136. function DatasourceService(url, options) {
  104137. var _this;
  104138. services_DatasourceService_classCallCheck(this, DatasourceService);
  104139. _this = _super.call(this, url, options);
  104140. _this._datasourceService = new DatasourceService_DatasourceService(_this.url, {
  104141. proxy: _this.proxy,
  104142. withCredentials: _this.withCredentials,
  104143. crossOrigin: _this.crossOrigin,
  104144. headers: _this.headers
  104145. });
  104146. return _this;
  104147. }
  104148. /**
  104149. * @function DatasourceService.prototype.getDatasources
  104150. * @description 数据源集查询服务。
  104151. * @param {RequestCallback} callback - 回调函数。
  104152. */
  104153. services_DatasourceService_createClass(DatasourceService, [{
  104154. key: "getDatasources",
  104155. value: function getDatasources(callback) {
  104156. this._datasourceService.getDatasourcesService(callback);
  104157. }
  104158. /**
  104159. * @function DatasourceService.prototype.getDatasource
  104160. * @description 数据源信息查询服务。
  104161. * @param {string} datasourceName - 数据源名称。
  104162. * @param {RequestCallback} callback 回调函数。
  104163. */
  104164. }, {
  104165. key: "getDatasource",
  104166. value: function getDatasource(datasourceName, callback) {
  104167. if (!datasourceName) {
  104168. return;
  104169. }
  104170. this._datasourceService.getDatasourceService(datasourceName, callback);
  104171. }
  104172. /**
  104173. * @function DatasourceService.prototype.setDatasource
  104174. * @description 数据源信息设置服务。可实现更改当前数据源信息。
  104175. * @param {SetDatasourceParameters} params - 数据源信息设置参数类。
  104176. * @param {RequestCallback} callback - 回调函数。
  104177. */
  104178. }, {
  104179. key: "setDatasource",
  104180. value: function setDatasource(params, callback) {
  104181. if (!(params instanceof SetDatasourceParameters)) {
  104182. return;
  104183. }
  104184. var datasourceParams = {
  104185. description: params.description,
  104186. coordUnit: params.coordUnit,
  104187. distanceUnit: params.distanceUnit,
  104188. datasourceName: params.datasourceName
  104189. };
  104190. this._datasourceService.setDatasourceService(datasourceParams, callback);
  104191. }
  104192. }]);
  104193. return DatasourceService;
  104194. }(ServiceBase);
  104195. ;// CONCATENATED MODULE: ./src/openlayers/services/GridCellInfosService.js
  104196. function GridCellInfosService_typeof(obj) { "@babel/helpers - typeof"; return GridCellInfosService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, GridCellInfosService_typeof(obj); }
  104197. function GridCellInfosService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  104198. function GridCellInfosService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  104199. function GridCellInfosService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GridCellInfosService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GridCellInfosService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  104200. function GridCellInfosService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) GridCellInfosService_setPrototypeOf(subClass, superClass); }
  104201. function GridCellInfosService_setPrototypeOf(o, p) { GridCellInfosService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GridCellInfosService_setPrototypeOf(o, p); }
  104202. function GridCellInfosService_createSuper(Derived) { var hasNativeReflectConstruct = GridCellInfosService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GridCellInfosService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GridCellInfosService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GridCellInfosService_possibleConstructorReturn(this, result); }; }
  104203. function GridCellInfosService_possibleConstructorReturn(self, call) { if (call && (GridCellInfosService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return GridCellInfosService_assertThisInitialized(self); }
  104204. function GridCellInfosService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  104205. function GridCellInfosService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  104206. function GridCellInfosService_getPrototypeOf(o) { GridCellInfosService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GridCellInfosService_getPrototypeOf(o); }
  104207. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  104208. * This program are made available under the terms of the Apache License, Version 2.0
  104209. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  104210. /**
  104211. /**
  104212. * @class GridCellInfosService
  104213. * @category iServer Data Grid
  104214. * @classdesc 数据栅格查询服务。
  104215. * @modulecategory Services
  104216. * @extends {ServiceBase}
  104217. * @example
  104218. * new GridCellInfosService(url)
  104219. * .getGridCellInfos(param,function(result){
  104220. * //doSomething
  104221. * })
  104222. * @param {string} url - 服务地址。请求地图服务,URL 应为:
  104223. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名}/tempLayersSet/{tempLayerID}/Rivers@World@@World。
  104224. * @param {Object} options - 参数。
  104225. * @param {string} [options.proxy] - 服务代理地址。
  104226. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  104227. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  104228. * @param {Object} [options.headers] - 请求头。
  104229. * @usage
  104230. */
  104231. var GridCellInfosService = /*#__PURE__*/function (_ServiceBase) {
  104232. GridCellInfosService_inherits(GridCellInfosService, _ServiceBase);
  104233. var _super = GridCellInfosService_createSuper(GridCellInfosService);
  104234. function GridCellInfosService(url, options) {
  104235. var _this;
  104236. GridCellInfosService_classCallCheck(this, GridCellInfosService);
  104237. _this = _super.call(this, url, options);
  104238. _this._gridCellQueryService = new GetGridCellInfosService(_this.url, {
  104239. proxy: _this.options.proxy,
  104240. withCredentials: _this.options.withCredentials,
  104241. crossOrigin: _this.options.crossOrigin,
  104242. headers: _this.options.headers
  104243. });
  104244. return _this;
  104245. }
  104246. /**
  104247. * @function GridCellInfosService.prototype.getGridCellInfos
  104248. * @param {GetGridCellInfosParameters} params - 数据服务栅格查询参数类。
  104249. * @param {RequestCallback} callback - 回调函数。
  104250. */
  104251. GridCellInfosService_createClass(GridCellInfosService, [{
  104252. key: "getGridCellInfos",
  104253. value: function getGridCellInfos(params, callback) {
  104254. if (!params) {
  104255. return null;
  104256. }
  104257. this._gridCellQueryService.processAsync(params, callback);
  104258. }
  104259. }]);
  104260. return GridCellInfosService;
  104261. }(ServiceBase);
  104262. ;// CONCATENATED MODULE: ./src/openlayers/services/GeoprocessingService.js
  104263. function services_GeoprocessingService_typeof(obj) { "@babel/helpers - typeof"; return services_GeoprocessingService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, services_GeoprocessingService_typeof(obj); }
  104264. function services_GeoprocessingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  104265. function services_GeoprocessingService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  104266. function services_GeoprocessingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_GeoprocessingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_GeoprocessingService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  104267. function services_GeoprocessingService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) services_GeoprocessingService_setPrototypeOf(subClass, superClass); }
  104268. function services_GeoprocessingService_setPrototypeOf(o, p) { services_GeoprocessingService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_GeoprocessingService_setPrototypeOf(o, p); }
  104269. function services_GeoprocessingService_createSuper(Derived) { var hasNativeReflectConstruct = services_GeoprocessingService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_GeoprocessingService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_GeoprocessingService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_GeoprocessingService_possibleConstructorReturn(this, result); }; }
  104270. function services_GeoprocessingService_possibleConstructorReturn(self, call) { if (call && (services_GeoprocessingService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return services_GeoprocessingService_assertThisInitialized(self); }
  104271. function services_GeoprocessingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  104272. function services_GeoprocessingService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  104273. function services_GeoprocessingService_getPrototypeOf(o) { services_GeoprocessingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_GeoprocessingService_getPrototypeOf(o); }
  104274. /**
  104275. * @class GeoprocessingService
  104276. * @classdesc 处理自动化服务接口类。
  104277. * @modulecategory Services
  104278. * @version 10.1.0
  104279. * @category iServer ProcessingAutomationService
  104280. * @extends {ServiceBase}
  104281. * @example
  104282. * //为了安全访问受保护的处理自动化服务,必须通过传递iserver令牌(token),才能正确访问相关资源。
  104283. * SecurityManager.registerToken(serviceUrl, token);
  104284. * var geoprocessingService = new geoprocessingService("http://localhost:8090/iserver/services/geoprocessing/restjsr/gp/v2")
  104285. geoprocessingService.submitJob(identifier,params, environments, function(serverResult) {
  104286. console.log(serverResult.result);
  104287. var jobID = serverResult.result.jobID;
  104288. var options = {
  104289. interval: 5000,
  104290. statusCallback: function(state) {
  104291. console.log("Job Status: ", state);
  104292. }
  104293. };
  104294. geoprocessingService.waitForJobCompletion(jobID, identifier, options, function(serverResult) {
  104295. console.log(serverResult);
  104296. });
  104297. })
  104298. * @param {string} url - 服务地址。
  104299. * @param {Object} options - 参数。
  104300. * @usage
  104301. */
  104302. var GeoprocessingService = /*#__PURE__*/function (_ServiceBase) {
  104303. services_GeoprocessingService_inherits(GeoprocessingService, _ServiceBase);
  104304. var _super = services_GeoprocessingService_createSuper(GeoprocessingService);
  104305. function GeoprocessingService(url, options) {
  104306. var _this;
  104307. services_GeoprocessingService_classCallCheck(this, GeoprocessingService);
  104308. _this = _super.call(this, url, options);
  104309. _this.headers = true;
  104310. _this.crossOrigin = true;
  104311. _this.withCredentials = true;
  104312. _this.proxy = true;
  104313. _this._geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(_this.url, {
  104314. proxy: _this.options.proxy,
  104315. withCredentials: _this.options.withCredentials,
  104316. crossOrigin: _this.options.crossOrigin,
  104317. headers: _this.options.headers
  104318. });
  104319. return _this;
  104320. }
  104321. /**
  104322. * @function GeoprocessingService.prototype.getTools
  104323. * @description 获取处理自动化工具列表。
  104324. * @param {RequestCallback} callback 回调函数。
  104325. */
  104326. services_GeoprocessingService_createClass(GeoprocessingService, [{
  104327. key: "getTools",
  104328. value: function getTools(callback) {
  104329. this._geoprocessingJobsService.getTools(callback);
  104330. }
  104331. /**
  104332. * @function GeoprocessingService.prototype.getTool
  104333. * @description 获取处理自动化工具的ID、名称、描述、输入参数、环境参数和输出结果等相关参数。
  104334. * @param {string} identifier - 处理自动化工具ID。
  104335. * @param {RequestCallback} callback 回调函数。
  104336. */
  104337. }, {
  104338. key: "getTool",
  104339. value: function getTool(identifier, callback) {
  104340. this._geoprocessingJobsService.getTool(identifier, callback);
  104341. }
  104342. /**
  104343. * @function GeoprocessingService.prototype.execute
  104344. * @description 同步执行处理自动化工具。
  104345. * @param {string} identifier - 处理自动化工具ID。
  104346. * @param {Object} parameter - 处理自动化工具的输入参数。
  104347. * @param {Object} environment - 处理自动化工具的环境参数。
  104348. * @param {RequestCallback} callback 回调函数。
  104349. */
  104350. }, {
  104351. key: "execute",
  104352. value: function execute(identifier, parameter, environment, callback) {
  104353. this._geoprocessingJobsService.execute(identifier, parameter, environment, callback);
  104354. }
  104355. /**
  104356. * @function GeoprocessingService.prototype.submitJob
  104357. * @description 异步执行处理自动化工具。
  104358. * @param {string} identifier - 处理自动化工具ID。
  104359. * @param {Object} parameter - 处理自动化工具的输入参数。
  104360. * @param {Object} environment - 处理自动化工具的环境参数。
  104361. * @param {RequestCallback} callback 回调函数。
  104362. */
  104363. }, {
  104364. key: "submitJob",
  104365. value: function submitJob(identifier, parameter, environment, callback) {
  104366. this._geoprocessingJobsService.submitJob(identifier, parameter, environment, callback);
  104367. }
  104368. /**
  104369. * @function GeoprocessingService.prototype.waitForJobCompletion
  104370. * @description 获取处理自动化异步执行状态信息。
  104371. * @param {string} jobId - 处理自动化任务ID。
  104372. * @param {string} identifier - 处理自动化工具ID。
  104373. * @param {Object} options - 状态信息参数。
  104374. * @param {number} options.interval - 定时器时间间隔。
  104375. * @param {function} options.statusCallback - 回调函数。
  104376. * @param {RequestCallback} callback 回调函数。
  104377. */
  104378. }, {
  104379. key: "waitForJobCompletion",
  104380. value: function waitForJobCompletion(jobId, identifier, options, callback) {
  104381. this._geoprocessingJobsService.waitForJobCompletion(jobId, identifier, options, callback);
  104382. }
  104383. /**
  104384. * @function GeoprocessingService.prototype.getJobInfo
  104385. * @description 获取处理自动化任务的执行信息。
  104386. * @param {string} identifier - 处理自动化工具ID。
  104387. * @param {string} jobId - 处理自动化任务ID。
  104388. * @param {RequestCallback} callback 回调函数。
  104389. */
  104390. }, {
  104391. key: "getJobInfo",
  104392. value: function getJobInfo(identifier, jobId, callback) {
  104393. this._geoprocessingJobsService.getJobInfo(identifier, jobId, callback);
  104394. }
  104395. /**
  104396. * @function GeoprocessingService.prototype.cancelJob
  104397. * @description 取消处理自动化任务的异步执行。
  104398. * @param {string} identifier - 处理自动化工具ID。
  104399. * @param {string} jobId - 处理自动化任务ID。
  104400. * @param {RequestCallback} callback 回调函数。
  104401. */
  104402. }, {
  104403. key: "cancelJob",
  104404. value: function cancelJob(identifier, jobId, callback) {
  104405. this._geoprocessingJobsService.cancelJob(identifier, jobId, callback);
  104406. }
  104407. /**
  104408. * @function GeoprocessingService.prototype.getJobs
  104409. * @description 获取处理自动化服务任务列表。
  104410. * @param {string} identifier - 处理自动化工具ID。(可选,传参代表identifier算子的任务列表,不传参代表所有任务的列表)
  104411. * @param {RequestCallback} callback 回调函数。
  104412. */
  104413. }, {
  104414. key: "getJobs",
  104415. value: function getJobs(identifier, callback) {
  104416. this._geoprocessingJobsService.getJobs(identifier, callback);
  104417. }
  104418. /**
  104419. * @function GeoprocessingService.prototype.getResults
  104420. * @description 处理自动化工具异步执行的结果,支持结果过滤。
  104421. * @param {string} identifier - 处理自动化工具ID。
  104422. * @param {string} jobId - 处理自动化任务ID。
  104423. * @param {string} filter - 输出异步结果的ID。(可选,传入filter参数时对该处理自动化工具执行的结果进行过滤获取,不填参时显示所有的执行结果)
  104424. * @param {RequestCallback} callback 回调函数。
  104425. */
  104426. }, {
  104427. key: "getResults",
  104428. value: function getResults(identifier, jobId, filter, callback) {
  104429. this._geoprocessingJobsService.getResults(identifier, jobId, filter, callback);
  104430. }
  104431. }]);
  104432. return GeoprocessingService;
  104433. }(ServiceBase);
  104434. ;// CONCATENATED MODULE: ./src/common/iServer/LayerInfoService.js
  104435. function LayerInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  104436. function LayerInfoService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  104437. function LayerInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) LayerInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) LayerInfoService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  104438. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  104439. * This program are made available under the terms of the Apache License, Version 2.0
  104440. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  104441. /**
  104442. * @class LayerInfoService
  104443. * @category iServer Map Layer
  104444. * @classdesc 图层信息服务类。
  104445. * @extends {ServiceBase}
  104446. * @example
  104447. * new LayerInfoService(url).getLayersInfo(function(result){
  104448. * //doSomething
  104449. * })
  104450. * @param {string} url - 服务地址。请求地图服务,URL 应为:
  104451. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名}/tempLayersSet/{tempLayerID}/Rivers@World@@World"。
  104452. * @param {Object} options - 参数。
  104453. * @param {string} [options.proxy] - 服务代理地址。
  104454. * @param {boolean} [options.withCredentials=false] - 请求是否携带cookie。
  104455. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  104456. * @param {Object} [options.headers] - 请求头。
  104457. * @usage
  104458. */
  104459. var LayerInfoService_LayerInfoService = /*#__PURE__*/function () {
  104460. function LayerInfoService(url, options) {
  104461. LayerInfoService_classCallCheck(this, LayerInfoService);
  104462. this.url = url;
  104463. this.options = options || {};
  104464. }
  104465. /**
  104466. * @function LayerInfoService.prototype.getLayersInfo
  104467. * @description 获取图层信息服务。
  104468. * @param {RequestCallback} callback - 回调函数。
  104469. */
  104470. LayerInfoService_createClass(LayerInfoService, [{
  104471. key: "getLayersInfo",
  104472. value: function getLayersInfo(callback) {
  104473. var me = this;
  104474. var getLayersInfoService = new GetLayersInfoService(me.url, {
  104475. proxy: me.options.proxy,
  104476. withCredentials: me.options.withCredentials,
  104477. crossOrigin: me.options.crossOrigin,
  104478. headers: me.options.headers,
  104479. eventListeners: {
  104480. processCompleted: callback,
  104481. processFailed: callback
  104482. }
  104483. });
  104484. getLayersInfoService.processAsync();
  104485. }
  104486. /**
  104487. * @function LayerInfoService.prototype.setLayerInfo
  104488. * @description 设置图层信息服务。可以实现临时图层中子图层的修改。
  104489. * @param {SetLayerInfoParameters} params - 设置图层信息参数类。
  104490. * @param {RequestCallback} callback - 回调函数。
  104491. */
  104492. }, {
  104493. key: "setLayerInfo",
  104494. value: function setLayerInfo(params, callback) {
  104495. if (!params) {
  104496. return;
  104497. }
  104498. var me = this,
  104499. resourceID = params.resourceID,
  104500. tempLayerName = params.tempLayerName,
  104501. layerInfoParams = params.layerInfo;
  104502. if (!resourceID || !tempLayerName) {
  104503. return;
  104504. }
  104505. var url = Util_Util.urlPathAppend(me.url, "tempLayersSet/" + resourceID + "/" + tempLayerName);
  104506. var setLayerInfoService = new SetLayerInfoService(url, {
  104507. proxy: me.options.proxy,
  104508. withCredentials: me.options.withCredentials,
  104509. crossOrigin: me.options.crossOrigin,
  104510. headers: me.options.headers,
  104511. eventListeners: {
  104512. processCompleted: callback,
  104513. processFailed: callback
  104514. }
  104515. });
  104516. setLayerInfoService.processAsync(layerInfoParams);
  104517. }
  104518. /**
  104519. * @function LayerInfoService.prototype.setLayersInfo
  104520. * @description 设置图层信息服务。可以创建新的临时图层和修改现有的临时图层。
  104521. * @param {SetLayersInfoParameters} params - 设置图层信息参数类。
  104522. * @param {RequestCallback} callback - 回调函数。
  104523. */
  104524. }, {
  104525. key: "setLayersInfo",
  104526. value: function setLayersInfo(params, callback) {
  104527. if (!params) {
  104528. return;
  104529. }
  104530. var me = this,
  104531. resourceID = params.resourceID,
  104532. isTempLayers = params.isTempLayers ? params.isTempLayers : false,
  104533. layersInfo = params.layersInfo;
  104534. if (isTempLayers && !resourceID || !layersInfo) {
  104535. return;
  104536. }
  104537. var setLayersInfoService = new SetLayersInfoService(me.url, {
  104538. proxy: me.options.proxy,
  104539. withCredentials: me.options.withCredentials,
  104540. crossOrigin: me.options.crossOrigin,
  104541. headers: me.options.headers,
  104542. eventListeners: {
  104543. processCompleted: callback,
  104544. processFailed: callback
  104545. },
  104546. resourceID: resourceID,
  104547. isTempLayers: isTempLayers
  104548. });
  104549. setLayersInfoService.processAsync(layersInfo);
  104550. }
  104551. /**
  104552. * @function LayerInfoService.prototype.setLayerStatus
  104553. * @description 子图层显示控制服务。负责将子图层显示控制参数传递到服务端,并获取服务端返回的图层显示状态。
  104554. * @param {SetLayerStatusParameters} params - 子图层显示控制参数类。
  104555. * @param {RequestCallback} callback - 回调函数。
  104556. */
  104557. }, {
  104558. key: "setLayerStatus",
  104559. value: function setLayerStatus(params, callback) {
  104560. if (!params) {
  104561. return;
  104562. }
  104563. var me = this;
  104564. var setLayerStatusService = new SetLayerStatusService(me.url, {
  104565. proxy: me.options.proxy,
  104566. withCredentials: me.options.withCredentials,
  104567. crossOrigin: me.options.crossOrigin,
  104568. headers: me.options.headers,
  104569. eventListeners: {
  104570. processCompleted: callback,
  104571. processFailed: callback
  104572. }
  104573. });
  104574. setLayerStatusService.processAsync(params);
  104575. }
  104576. }]);
  104577. return LayerInfoService;
  104578. }();
  104579. ;// CONCATENATED MODULE: ./src/openlayers/services/LayerInfoService.js
  104580. function LayerInfoService_typeof(obj) { "@babel/helpers - typeof"; return LayerInfoService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, LayerInfoService_typeof(obj); }
  104581. function services_LayerInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  104582. function services_LayerInfoService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  104583. function services_LayerInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_LayerInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_LayerInfoService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  104584. function LayerInfoService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) LayerInfoService_setPrototypeOf(subClass, superClass); }
  104585. function LayerInfoService_setPrototypeOf(o, p) { LayerInfoService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LayerInfoService_setPrototypeOf(o, p); }
  104586. function LayerInfoService_createSuper(Derived) { var hasNativeReflectConstruct = LayerInfoService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = LayerInfoService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = LayerInfoService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return LayerInfoService_possibleConstructorReturn(this, result); }; }
  104587. function LayerInfoService_possibleConstructorReturn(self, call) { if (call && (LayerInfoService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return LayerInfoService_assertThisInitialized(self); }
  104588. function LayerInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  104589. function LayerInfoService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  104590. function LayerInfoService_getPrototypeOf(o) { LayerInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LayerInfoService_getPrototypeOf(o); }
  104591. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  104592. * This program are made available under the terms of the Apache License, Version 2.0
  104593. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  104594. /**
  104595. * @class LayerInfoService
  104596. * @category iServer Map Layer
  104597. * @classdesc 图层信息服务类。
  104598. * @modulecategory Services
  104599. * @extends {ServiceBase}
  104600. * @example
  104601. * new LayerInfoService(url).getLayersInfo(function(result){
  104602. * //doSomething
  104603. * })
  104604. * @param {string} url - 服务地址。请求地图服务,URL 应为:
  104605. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名}/tempLayersSet/{tempLayerID}/Rivers@World@@World"。
  104606. * @param {Object} options - 参数。
  104607. * @param {string} [options.proxy] - 服务代理地址。
  104608. * @param {boolean} [options.withCredentials=false] - 请求是否携带cookie。
  104609. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  104610. * @param {Object} [options.headers] - 请求头。
  104611. * @usage
  104612. */
  104613. var LayerInfoService = /*#__PURE__*/function (_ServiceBase) {
  104614. LayerInfoService_inherits(LayerInfoService, _ServiceBase);
  104615. var _super = LayerInfoService_createSuper(LayerInfoService);
  104616. function LayerInfoService(url, options) {
  104617. var _this;
  104618. services_LayerInfoService_classCallCheck(this, LayerInfoService);
  104619. _this = _super.call(this, url, options);
  104620. _this._layerInfoService = new LayerInfoService_LayerInfoService(url, options);
  104621. return _this;
  104622. }
  104623. /**
  104624. * @function LayerInfoService.prototype.getLayersInfo
  104625. * @description 获取图层信息服务。
  104626. * @param {RequestCallback} callback - 回调函数。
  104627. */
  104628. services_LayerInfoService_createClass(LayerInfoService, [{
  104629. key: "getLayersInfo",
  104630. value: function getLayersInfo(callback) {
  104631. this._layerInfoService.getLayersInfo(callback);
  104632. }
  104633. /**
  104634. * @function LayerInfoService.prototype.setLayerInfo
  104635. * @description 设置图层信息服务。可以实现临时图层中子图层的修改。
  104636. * @param {SetLayerInfoParameters} params - 设置图层信息参数类。
  104637. * @param {RequestCallback} callback - 回调函数。
  104638. */
  104639. }, {
  104640. key: "setLayerInfo",
  104641. value: function setLayerInfo(params, callback) {
  104642. this._layerInfoService.setLayerInfo(params, callback);
  104643. }
  104644. /**
  104645. * @function LayerInfoService.prototype.setLayersInfo
  104646. * @description 设置图层信息服务。可以创建新的临时图层和修改现有的临时图层。
  104647. * @param {SetLayersInfoParameters} params - 设置图层信息参数类。
  104648. * @param {RequestCallback} callback - 回调函数。
  104649. */
  104650. }, {
  104651. key: "setLayersInfo",
  104652. value: function setLayersInfo(params, callback) {
  104653. this._layerInfoService.setLayersInfo(params, callback);
  104654. }
  104655. /**
  104656. * @function LayerInfoService.prototype.setLayerStatus
  104657. * @description 子图层显示控制服务。负责将子图层显示控制参数传递到服务端,并获取服务端返回的图层显示状态。
  104658. * @param {SetLayerStatusParameters} params - 子图层显示控制参数类。
  104659. * @param {RequestCallback} callback - 回调函数。
  104660. */
  104661. }, {
  104662. key: "setLayerStatus",
  104663. value: function setLayerStatus(params, callback) {
  104664. this._layerInfoService.setLayerStatus(params, callback);
  104665. }
  104666. }]);
  104667. return LayerInfoService;
  104668. }(ServiceBase);
  104669. ;// CONCATENATED MODULE: ./src/openlayers/services/MeasureService.js
  104670. function services_MeasureService_typeof(obj) { "@babel/helpers - typeof"; return services_MeasureService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, services_MeasureService_typeof(obj); }
  104671. function services_MeasureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  104672. function services_MeasureService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  104673. function services_MeasureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_MeasureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_MeasureService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  104674. function services_MeasureService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) services_MeasureService_setPrototypeOf(subClass, superClass); }
  104675. function services_MeasureService_setPrototypeOf(o, p) { services_MeasureService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_MeasureService_setPrototypeOf(o, p); }
  104676. function services_MeasureService_createSuper(Derived) { var hasNativeReflectConstruct = services_MeasureService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_MeasureService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_MeasureService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_MeasureService_possibleConstructorReturn(this, result); }; }
  104677. function services_MeasureService_possibleConstructorReturn(self, call) { if (call && (services_MeasureService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return services_MeasureService_assertThisInitialized(self); }
  104678. function services_MeasureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  104679. function services_MeasureService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  104680. function services_MeasureService_getPrototypeOf(o) { services_MeasureService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_MeasureService_getPrototypeOf(o); }
  104681. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  104682. * This program are made available under the terms of the Apache License, Version 2.0
  104683. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  104684. /**
  104685. * @class MeasureService
  104686. * @category iServer Map Measure
  104687. * @classdesc 量算服务。
  104688. * @modulecategory Services
  104689. * @extends {ServiceBase}
  104690. * @param {string} url - 服务地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
  104691. * @param {Object} options - 参数。
  104692. * @param {string} [options.proxy] - 服务代理地址。
  104693. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  104694. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  104695. * @param {Object} [options.headers] - 请求头。
  104696. * @usage
  104697. */
  104698. var MeasureService = /*#__PURE__*/function (_ServiceBase) {
  104699. services_MeasureService_inherits(MeasureService, _ServiceBase);
  104700. var _super = services_MeasureService_createSuper(MeasureService);
  104701. function MeasureService(url, options) {
  104702. services_MeasureService_classCallCheck(this, MeasureService);
  104703. return _super.call(this, url, options);
  104704. }
  104705. /**
  104706. * @function MeasureService.prototype.measureDistance
  104707. * @description 测距。
  104708. * @param {MeasureParameters} params - 量算参数类。
  104709. * @param {RequestCallback} callback - 回调函数。
  104710. */
  104711. services_MeasureService_createClass(MeasureService, [{
  104712. key: "measureDistance",
  104713. value: function measureDistance(params, callback) {
  104714. this.measure(params, 'DISTANCE', callback);
  104715. }
  104716. /**
  104717. * @function MeasureService.prototype.measureArea
  104718. * @description 测面积。
  104719. * @param {MeasureParameters} params - 量算参数类。
  104720. * @param {RequestCallback} callback - 回调函数。
  104721. */
  104722. }, {
  104723. key: "measureArea",
  104724. value: function measureArea(params, callback) {
  104725. this.measure(params, 'AREA', callback);
  104726. }
  104727. /**
  104728. * @function MeasureService.prototype.measure
  104729. * @description 测量。
  104730. * @param {MeasureParameters} params - 量算参数类。
  104731. * @param {string} type - 类型。
  104732. * @param {RequestCallback} callback - 回调函数。
  104733. * @returns {MeasureService} 量算服务。
  104734. */
  104735. }, {
  104736. key: "measure",
  104737. value: function measure(params, type, callback) {
  104738. var me = this;
  104739. var measureService = new MeasureService_MeasureService(me.url, {
  104740. proxy: me.options.proxy,
  104741. withCredentials: me.options.withCredentials,
  104742. crossOrigin: me.options.crossOrigin,
  104743. headers: me.options.headers,
  104744. measureMode: type
  104745. });
  104746. measureService.processAsync(me._processParam(params), callback);
  104747. }
  104748. }, {
  104749. key: "_processParam",
  104750. value: function _processParam(params) {
  104751. if (params && params.geometry) {
  104752. params.geometry = core_Util_Util.toSuperMapGeometry(JSON.parse(new (external_ol_format_GeoJSON_default())().writeGeometry(params.geometry)));
  104753. }
  104754. return params;
  104755. }
  104756. }]);
  104757. return MeasureService;
  104758. }(ServiceBase);
  104759. ;// CONCATENATED MODULE: ./src/common/iServer/NetworkAnalyst3DService.js
  104760. function NetworkAnalyst3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  104761. function NetworkAnalyst3DService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  104762. function NetworkAnalyst3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) NetworkAnalyst3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) NetworkAnalyst3DService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  104763. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  104764. * This program are made available under the terms of the Apache License, Version 2.0
  104765. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  104766. /**
  104767. * @class NetworkAnalyst3DService
  104768. * @category iServer FacilityAnalyst3D
  104769. * @classdesc 3D 网络分析服务类。
  104770. * @extends {ServiceBase}
  104771. * @example
  104772. * new NetworkAnalyst3DService(url).sinksFacilityAnalyst(params,function(result){
  104773. * //doSomething
  104774. * })
  104775. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL 应为:
  104776. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  104777. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  104778. * @param {Object} options - 参数。
  104779. * @param {string} [options.proxy] - 服务代理地址。
  104780. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  104781. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  104782. * @param {Object} [options.headers] - 请求头。
  104783. * @usage
  104784. */
  104785. var NetworkAnalyst3DService_NetworkAnalyst3DService = /*#__PURE__*/function () {
  104786. function NetworkAnalyst3DService(url, options) {
  104787. NetworkAnalyst3DService_classCallCheck(this, NetworkAnalyst3DService);
  104788. this.url = url;
  104789. this.options = options || {};
  104790. }
  104791. /**
  104792. * @function NetworkAnalyst3DService.prototype.sinksFacilityAnalyst
  104793. * @description 汇查找服务
  104794. * @param {FacilityAnalystSinks3DParameters} params- 最近设施分析参数类(汇查找资源)。
  104795. * @param {RequestCallback} callback - 回调函数。
  104796. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  104797. */
  104798. NetworkAnalyst3DService_createClass(NetworkAnalyst3DService, [{
  104799. key: "sinksFacilityAnalyst",
  104800. value: function sinksFacilityAnalyst(params, callback) {
  104801. var me = this;
  104802. var facilityAnalystSinks3DService = new FacilityAnalystSinks3DService(me.url, {
  104803. proxy: me.options.proxy,
  104804. withCredentials: me.options.withCredentials,
  104805. crossOrigin: me.options.crossOrigin,
  104806. headers: me.options.headers,
  104807. eventListeners: {
  104808. scope: me,
  104809. processCompleted: callback,
  104810. processFailed: callback
  104811. }
  104812. });
  104813. facilityAnalystSinks3DService.processAsync(params);
  104814. }
  104815. /**
  104816. * @function NetworkAnalyst3DService.prototype.sourcesFacilityAnalyst
  104817. * @description 源查找服务。
  104818. * @param {FacilityAnalystSources3DParameters} params - 最近设施分析参数类(源查找服务)。
  104819. * @param {RequestCallback} callback - 回调函数。
  104820. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  104821. */
  104822. }, {
  104823. key: "sourcesFacilityAnalyst",
  104824. value: function sourcesFacilityAnalyst(params, callback) {
  104825. var me = this;
  104826. var facilityAnalystSources3DService = new FacilityAnalystSources3DService(me.url, {
  104827. proxy: me.options.proxy,
  104828. withCredentials: me.options.withCredentials,
  104829. crossOrigin: me.options.crossOrigin,
  104830. headers: me.options.headers,
  104831. eventListeners: {
  104832. scope: me,
  104833. processCompleted: callback,
  104834. processFailed: callback
  104835. }
  104836. });
  104837. facilityAnalystSources3DService.processAsync(params);
  104838. }
  104839. /**
  104840. * @function NetworkAnalyst3DService.prototype.traceUpFacilityAnalyst
  104841. * @description 上游追踪资源服务。
  104842. * @param {FacilityAnalystTraceup3DParameters} params - 上游追踪资源参数类。
  104843. * @param {RequestCallback} callback - 回调函数。
  104844. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  104845. */
  104846. }, {
  104847. key: "traceUpFacilityAnalyst",
  104848. value: function traceUpFacilityAnalyst(params, callback) {
  104849. var me = this;
  104850. var facilityAnalystTraceup3DService = new FacilityAnalystTraceup3DService(me.url, {
  104851. proxy: me.options.proxy,
  104852. withCredentials: me.options.withCredentials,
  104853. crossOrigin: me.options.crossOrigin,
  104854. headers: me.options.headers,
  104855. eventListeners: {
  104856. scope: me,
  104857. processCompleted: callback,
  104858. processFailed: callback
  104859. }
  104860. });
  104861. facilityAnalystTraceup3DService.processAsync(params);
  104862. }
  104863. /**
  104864. * @function NetworkAnalyst3DService.prototype.traceDownFacilityAnalyst
  104865. * @description 下游追踪资源服务。
  104866. * @param {FacilityAnalystTracedown3DParameters} params - 下游追踪资源服务参数类。
  104867. * @param {RequestCallback} callback - 回调函数。
  104868. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  104869. */
  104870. }, {
  104871. key: "traceDownFacilityAnalyst",
  104872. value: function traceDownFacilityAnalyst(params, callback) {
  104873. var me = this;
  104874. var facilityAnalystTracedown3DService = new FacilityAnalystTracedown3DService(me.url, {
  104875. proxy: me.options.proxy,
  104876. withCredentials: me.options.withCredentials,
  104877. crossOrigin: me.options.crossOrigin,
  104878. headers: me.options.headers,
  104879. eventListeners: {
  104880. scope: me,
  104881. processCompleted: callback,
  104882. processFailed: callback
  104883. }
  104884. });
  104885. facilityAnalystTracedown3DService.processAsync(params);
  104886. }
  104887. /**
  104888. * @function NetworkAnalyst3DService.prototype.upstreamFacilityAnalyst
  104889. * @description 上游关键设施查找服务。
  104890. * @param {FacilityAnalystUpstream3DParameters} params - 上游关键设施查找服务参数类。
  104891. * @param {RequestCallback} callback - 回调函数。
  104892. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  104893. */
  104894. }, {
  104895. key: "upstreamFacilityAnalyst",
  104896. value: function upstreamFacilityAnalyst(params, callback) {
  104897. var me = this;
  104898. var facilityAnalystUpstream3DService = new FacilityAnalystUpstream3DService(me.url, {
  104899. proxy: me.options.proxy,
  104900. withCredentials: me.options.withCredentials,
  104901. crossOrigin: me.options.crossOrigin,
  104902. headers: me.options.headers,
  104903. eventListeners: {
  104904. scope: me,
  104905. processCompleted: callback,
  104906. processFailed: callback
  104907. }
  104908. });
  104909. facilityAnalystUpstream3DService.processAsync(params);
  104910. }
  104911. }]);
  104912. return NetworkAnalyst3DService;
  104913. }();
  104914. ;// CONCATENATED MODULE: ./src/openlayers/services/NetworkAnalyst3DService.js
  104915. function NetworkAnalyst3DService_typeof(obj) { "@babel/helpers - typeof"; return NetworkAnalyst3DService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, NetworkAnalyst3DService_typeof(obj); }
  104916. function services_NetworkAnalyst3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  104917. function services_NetworkAnalyst3DService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  104918. function services_NetworkAnalyst3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_NetworkAnalyst3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_NetworkAnalyst3DService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  104919. function NetworkAnalyst3DService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) NetworkAnalyst3DService_setPrototypeOf(subClass, superClass); }
  104920. function NetworkAnalyst3DService_setPrototypeOf(o, p) { NetworkAnalyst3DService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NetworkAnalyst3DService_setPrototypeOf(o, p); }
  104921. function NetworkAnalyst3DService_createSuper(Derived) { var hasNativeReflectConstruct = NetworkAnalyst3DService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = NetworkAnalyst3DService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = NetworkAnalyst3DService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return NetworkAnalyst3DService_possibleConstructorReturn(this, result); }; }
  104922. function NetworkAnalyst3DService_possibleConstructorReturn(self, call) { if (call && (NetworkAnalyst3DService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return NetworkAnalyst3DService_assertThisInitialized(self); }
  104923. function NetworkAnalyst3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  104924. function NetworkAnalyst3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  104925. function NetworkAnalyst3DService_getPrototypeOf(o) { NetworkAnalyst3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NetworkAnalyst3DService_getPrototypeOf(o); }
  104926. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  104927. * This program are made available under the terms of the Apache License, Version 2.0
  104928. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  104929. /**
  104930. * @class NetworkAnalyst3DService
  104931. * @category iServer FacilityAnalyst3D
  104932. * @classdesc 3D 网络分析服务类。
  104933. * @modulecategory Services
  104934. * @extends {ServiceBase}
  104935. * @example
  104936. * new NetworkAnalyst3DService(url).sinksFacilityAnalyst(params,function(result){
  104937. * //doSomething
  104938. * })
  104939. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL 应为:
  104940. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  104941. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  104942. * @param {Object} options - 参数。
  104943. * @param {string} [options.proxy] - 服务代理地址。
  104944. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  104945. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  104946. * @param {Object} [options.headers] - 请求头。
  104947. * @usage
  104948. */
  104949. var NetworkAnalyst3DService = /*#__PURE__*/function (_ServiceBase) {
  104950. NetworkAnalyst3DService_inherits(NetworkAnalyst3DService, _ServiceBase);
  104951. var _super = NetworkAnalyst3DService_createSuper(NetworkAnalyst3DService);
  104952. function NetworkAnalyst3DService(url, options) {
  104953. var _this;
  104954. services_NetworkAnalyst3DService_classCallCheck(this, NetworkAnalyst3DService);
  104955. _this = _super.call(this, url, options);
  104956. _this._networkAnalyst3DService = new NetworkAnalyst3DService_NetworkAnalyst3DService(url, options);
  104957. return _this;
  104958. }
  104959. /**
  104960. * @function NetworkAnalyst3DService.prototype.sinksFacilityAnalyst
  104961. * @description 汇查找服务
  104962. * @param {FacilityAnalystSinks3DParameters} params- 最近设施分析参数类(汇查找资源)。
  104963. * @param {RequestCallback} callback - 回调函数。
  104964. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  104965. */
  104966. services_NetworkAnalyst3DService_createClass(NetworkAnalyst3DService, [{
  104967. key: "sinksFacilityAnalyst",
  104968. value: function sinksFacilityAnalyst(params, callback) {
  104969. this._networkAnalyst3DService.sinksFacilityAnalyst(params, callback);
  104970. }
  104971. /**
  104972. * @function NetworkAnalyst3DService.prototype.sourcesFacilityAnalyst
  104973. * @description 源查找服务。
  104974. * @param {FacilityAnalystSources3DParameters} params - 最近设施分析参数类(源查找服务)。
  104975. * @param {RequestCallback} callback - 回调函数。
  104976. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  104977. */
  104978. }, {
  104979. key: "sourcesFacilityAnalyst",
  104980. value: function sourcesFacilityAnalyst(params, callback) {
  104981. this._networkAnalyst3DService.sourcesFacilityAnalyst(params, callback);
  104982. }
  104983. /**
  104984. * @function NetworkAnalyst3DService.prototype.traceUpFacilityAnalyst
  104985. * @description 上游追踪资源服务。
  104986. * @param {FacilityAnalystTraceup3DParameters} params - 上游追踪资源参数类。
  104987. * @param {RequestCallback} callback - 回调函数。
  104988. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  104989. */
  104990. }, {
  104991. key: "traceUpFacilityAnalyst",
  104992. value: function traceUpFacilityAnalyst(params, callback) {
  104993. this._networkAnalyst3DService.traceUpFacilityAnalyst(params, callback);
  104994. }
  104995. /**
  104996. * @function NetworkAnalyst3DService.prototype.traceDownFacilityAnalyst
  104997. * @description 下游追踪资源服务。
  104998. * @param {FacilityAnalystTracedown3DParameters} params - 下游追踪资源服务参数类。
  104999. * @param {RequestCallback} callback - 回调函数。
  105000. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  105001. */
  105002. }, {
  105003. key: "traceDownFacilityAnalyst",
  105004. value: function traceDownFacilityAnalyst(params, callback) {
  105005. this._networkAnalyst3DService.traceDownFacilityAnalyst(params, callback);
  105006. }
  105007. /**
  105008. * @function NetworkAnalyst3DService.prototype.upstreamFacilityAnalyst
  105009. * @description 上游关键设施查找服务。
  105010. * @param {FacilityAnalystUpstream3DParameters} params - 上游关键设施查找服务参数类。
  105011. * @param {RequestCallback} callback - 回调函数。
  105012. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  105013. */
  105014. }, {
  105015. key: "upstreamFacilityAnalyst",
  105016. value: function upstreamFacilityAnalyst(params, callback) {
  105017. this._networkAnalyst3DService.upstreamFacilityAnalyst(params, callback);
  105018. }
  105019. }]);
  105020. return NetworkAnalyst3DService;
  105021. }(ServiceBase);
  105022. ;// CONCATENATED MODULE: ./src/common/iServer/NetworkAnalystService.js
  105023. function NetworkAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  105024. function NetworkAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  105025. function NetworkAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) NetworkAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) NetworkAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  105026. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  105027. * This program are made available under the terms of the Apache License, Version 2.0
  105028. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  105029. /**
  105030. * @class NetworkAnalystService
  105031. * @category iServer NetworkAnalyst
  105032. * @classdesc 网络分析服务类。
  105033. * @extends {ServiceBase}
  105034. * @example
  105035. * new NetworkAnalystService(url)
  105036. * .findPath(params,function(result){
  105037. * //doSomething
  105038. * })
  105039. * @param {string} url - 服务地址。请求网络分析服务,URL应为:</br>
  105040. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源}。
  105041. * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet"。
  105042. * @param {Object} options - 参数。
  105043. * @param {string} [options.proxy] - 服务代理地址。
  105044. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  105045. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  105046. * @param {Object} [options.headers] - 请求头。
  105047. * @usage
  105048. */
  105049. var NetworkAnalystService_NetworkAnalystService = /*#__PURE__*/function () {
  105050. function NetworkAnalystService(url, options) {
  105051. NetworkAnalystService_classCallCheck(this, NetworkAnalystService);
  105052. this.url = url;
  105053. this.options = options || {};
  105054. }
  105055. /**
  105056. * @function NetworkAnalystService.prototype.burstPipelineAnalyst
  105057. * @description 爆管分析服务:即将给定弧段或节点作为爆管点来进行分析,返回关键结点 ID 数组,普通结点 ID 数组及其上下游弧段 ID 数组。
  105058. * @param {BurstPipelineAnalystParameters} params - 爆管分析服务参数类。
  105059. * @param {RequestCallback} callback 回调函数。
  105060. */
  105061. NetworkAnalystService_createClass(NetworkAnalystService, [{
  105062. key: "burstPipelineAnalyst",
  105063. value: function burstPipelineAnalyst(params, callback) {
  105064. var me = this;
  105065. var burstPipelineAnalystService = new BurstPipelineAnalystService(me.url, {
  105066. proxy: me.options.proxy,
  105067. withCredentials: me.options.withCredentials,
  105068. crossOrigin: me.options.crossOrigin,
  105069. headers: me.options.headers,
  105070. eventListeners: {
  105071. scope: me,
  105072. processCompleted: callback,
  105073. processFailed: callback
  105074. }
  105075. });
  105076. burstPipelineAnalystService.processAsync(params);
  105077. }
  105078. /**
  105079. * @function NetworkAnalystService.prototype.computeWeightMatrix
  105080. * @description 耗费矩阵分析服务:根据交通网络分析参数中的耗费字段返回一个耗费矩阵。该矩阵是一个二维数组,用来存储任意两点间的资源消耗。
  105081. * @param {ComputeWeightMatrixParameters} params - 耗费矩阵分析服务参数类。
  105082. * @param {RequestCallback} callback - 回调函数。
  105083. */
  105084. }, {
  105085. key: "computeWeightMatrix",
  105086. value: function computeWeightMatrix(params, callback) {
  105087. var me = this;
  105088. var computeWeightMatrixService = new ComputeWeightMatrixService(me.url, {
  105089. proxy: me.options.proxy,
  105090. withCredentials: me.options.withCredentials,
  105091. crossOrigin: me.options.crossOrigin,
  105092. headers: me.options.headers,
  105093. eventListeners: {
  105094. scope: me,
  105095. processCompleted: callback,
  105096. processFailed: callback
  105097. }
  105098. });
  105099. computeWeightMatrixService.processAsync(params);
  105100. }
  105101. /**
  105102. * @function NetworkAnalystService.prototype.findClosestFacilities
  105103. * @description 最近设施分析服务:指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  105104. * @param {FindClosestFacilitiesParameters} params - 最近设施分析服务参数类。
  105105. * @param {RequestCallback} callback 回调函数。
  105106. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105107. */
  105108. }, {
  105109. key: "findClosestFacilities",
  105110. value: function findClosestFacilities(params, callback, resultFormat) {
  105111. var me = this;
  105112. var findClosestFacilitiesService = new FindClosestFacilitiesService(me.url, {
  105113. proxy: me.options.proxy,
  105114. withCredentials: me.options.withCredentials,
  105115. crossOrigin: me.options.crossOrigin,
  105116. headers: me.options.headers,
  105117. eventListeners: {
  105118. scope: me,
  105119. processCompleted: callback,
  105120. processFailed: callback
  105121. },
  105122. format: me._processFormat(resultFormat)
  105123. });
  105124. findClosestFacilitiesService.processAsync(params);
  105125. }
  105126. /**
  105127. * @function NetworkAnalystService.prototype.streamFacilityAnalyst
  105128. * @description 上游/下游 关键设施查找资源服务:查找给定弧段或节点的上游/下游中的关键设施结点,返回关键结点 ID 数组及其下游弧段 ID 数组。
  105129. * @param {FacilityAnalystStreamParameters} params - 上游/下游 关键设施查找资源服务参数类。
  105130. * @param {RequestCallback} callback 回调函数。
  105131. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105132. */
  105133. }, {
  105134. key: "streamFacilityAnalyst",
  105135. value: function streamFacilityAnalyst(params, callback, resultFormat) {
  105136. var me = this;
  105137. var facilityAnalystStreamService = new FacilityAnalystStreamService(me.url, {
  105138. proxy: me.options.proxy,
  105139. withCredentials: me.options.withCredentials,
  105140. crossOrigin: me.options.crossOrigin,
  105141. headers: me.options.headers,
  105142. eventListeners: {
  105143. scope: me,
  105144. processCompleted: callback,
  105145. processFailed: callback
  105146. },
  105147. format: me._processFormat(resultFormat)
  105148. });
  105149. facilityAnalystStreamService.processAsync(params);
  105150. }
  105151. /**
  105152. * @function NetworkAnalystService.prototype.findLocation
  105153. * @description 选址分区分析服务:确定一个或多个待建设施的最佳或最优位置。
  105154. * @param {FindLocationParameters} params - 选址分区分析服务参数类。
  105155. * @param {RequestCallback} callback 回调函数。
  105156. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105157. */
  105158. }, {
  105159. key: "findLocation",
  105160. value: function findLocation(params, callback, resultFormat) {
  105161. var me = this;
  105162. var findLocationService = new FindLocationService(me.url, {
  105163. proxy: me.options.proxy,
  105164. withCredentials: me.options.withCredentials,
  105165. crossOrigin: me.options.crossOrigin,
  105166. headers: me.options.headers,
  105167. eventListeners: {
  105168. scope: me,
  105169. processCompleted: callback,
  105170. processFailed: callback
  105171. },
  105172. format: me._processFormat(resultFormat)
  105173. });
  105174. findLocationService.processAsync(params);
  105175. }
  105176. /**
  105177. * @function NetworkAnalystService.prototype.findPath
  105178. * @description 最佳路径分析服务:在网络数据集中指定一些节点,按照节点的选择顺序,顺序访问这些节点从而求解起止点之间阻抗最小的路经。
  105179. * @param {FindPathParameters} params - 最佳路径分析服务参数类。
  105180. * @param {RequestCallback} callback - 回调函数。
  105181. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105182. */
  105183. }, {
  105184. key: "findPath",
  105185. value: function findPath(params, callback, resultFormat) {
  105186. var me = this;
  105187. var findPathService = new FindPathService(me.url, {
  105188. proxy: me.options.proxy,
  105189. withCredentials: me.options.withCredentials,
  105190. crossOrigin: me.options.crossOrigin,
  105191. headers: me.options.headers,
  105192. eventListeners: {
  105193. scope: me,
  105194. processCompleted: callback,
  105195. processFailed: callback
  105196. },
  105197. format: me._processFormat(resultFormat)
  105198. });
  105199. findPathService.processAsync(params);
  105200. }
  105201. /**
  105202. * @function NetworkAnalystService.prototype.findTSPPaths
  105203. * @description 旅行商分析服务:路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
  105204. * @param {FindTSPPathsParameters} params - 旅行商分析服务参数类。
  105205. * @param {RequestCallback} callback - 回调函数。
  105206. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105207. */
  105208. }, {
  105209. key: "findTSPPaths",
  105210. value: function findTSPPaths(params, callback, resultFormat) {
  105211. var me = this;
  105212. var findTSPPathsService = new FindTSPPathsService(me.url, {
  105213. proxy: me.options.proxy,
  105214. withCredentials: me.options.withCredentials,
  105215. crossOrigin: me.options.crossOrigin,
  105216. headers: me.options.headers,
  105217. eventListeners: {
  105218. scope: me,
  105219. processCompleted: callback,
  105220. processFailed: callback
  105221. },
  105222. format: me._processFormat(resultFormat)
  105223. });
  105224. findTSPPathsService.processAsync(params);
  105225. }
  105226. /**
  105227. * @function NetworkAnalystService.prototype.findMTSPPaths
  105228. * @description 多旅行商分析服务:也称为物流配送,是指在网络数据集中,给定 M 个配送中心点和 N 个配送目的地(M,N 为大于零的整数)。查找经济有效的配送路径,并给出相应的行走路线。
  105229. * @param {FindMTSPPathsParameters} params - 多旅行商分析服务参数类。
  105230. * @param {RequestCallback} callback - 回调函数。
  105231. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105232. */
  105233. }, {
  105234. key: "findMTSPPaths",
  105235. value: function findMTSPPaths(params, callback, resultFormat) {
  105236. var me = this;
  105237. var findMTSPPathsService = new FindMTSPPathsService(me.url, {
  105238. proxy: me.options.proxy,
  105239. withCredentials: me.options.withCredentials,
  105240. crossOrigin: me.options.crossOrigin,
  105241. headers: me.options.headers,
  105242. eventListeners: {
  105243. scope: me,
  105244. processCompleted: callback,
  105245. processFailed: callback
  105246. },
  105247. format: me._processFormat(resultFormat)
  105248. });
  105249. findMTSPPathsService.processAsync(params);
  105250. }
  105251. /**
  105252. * @function NetworkAnalystService.prototype.findServiceAreas
  105253. * @description 服务区分析服务:以指定服务站点为中心,在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
  105254. * @param {FindServiceAreasParameters} params - 服务区分析服务参数类。
  105255. * @param {RequestCallback} callback 回调函数。
  105256. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105257. */
  105258. }, {
  105259. key: "findServiceAreas",
  105260. value: function findServiceAreas(params, callback, resultFormat) {
  105261. var me = this;
  105262. var findServiceAreasService = new FindServiceAreasService(me.url, {
  105263. proxy: me.options.proxy,
  105264. withCredentials: me.options.withCredentials,
  105265. crossOrigin: me.options.crossOrigin,
  105266. headers: me.options.headers,
  105267. eventListeners: {
  105268. scope: me,
  105269. processCompleted: callback,
  105270. processFailed: callback
  105271. },
  105272. format: me._processFormat(resultFormat)
  105273. });
  105274. findServiceAreasService.processAsync(params);
  105275. }
  105276. /**
  105277. * @function NetworkAnalystService.prototype.updateEdgeWeight
  105278. * @description 更新边的耗费权重服务。
  105279. * @param {UpdateEdgeWeightParameters} params - 更新边的耗费权重服务参数类。
  105280. * @param {RequestCallback} callback 回调函数。
  105281. */
  105282. }, {
  105283. key: "updateEdgeWeight",
  105284. value: function updateEdgeWeight(params, callback) {
  105285. var me = this;
  105286. var updateEdgeWeightService = new UpdateEdgeWeightService(me.url, {
  105287. proxy: me.options.proxy,
  105288. withCredentials: me.options.withCredentials,
  105289. crossOrigin: me.options.crossOrigin,
  105290. headers: me.options.headers,
  105291. eventListeners: {
  105292. scope: me,
  105293. processCompleted: callback,
  105294. processFailed: callback
  105295. }
  105296. });
  105297. updateEdgeWeightService.processAsync(params);
  105298. }
  105299. /**
  105300. * @function NetworkAnalystService.prototype.updateTurnNodeWeight
  105301. * @description 转向耗费权重更新服务。
  105302. * @param {UpdateTurnNodeWeightParameters} params - 转向耗费权重更新服务参数类。
  105303. * @param {RequestCallback} callback - 回调函数。
  105304. */
  105305. }, {
  105306. key: "updateTurnNodeWeight",
  105307. value: function updateTurnNodeWeight(params, callback) {
  105308. var me = this;
  105309. var updateTurnNodeWeightService = new UpdateTurnNodeWeightService(me.url, {
  105310. proxy: me.options.proxy,
  105311. withCredentials: me.options.withCredentials,
  105312. crossOrigin: me.options.crossOrigin,
  105313. headers: me.options.headers,
  105314. eventListeners: {
  105315. scope: me,
  105316. processCompleted: callback,
  105317. processFailed: callback
  105318. }
  105319. });
  105320. updateTurnNodeWeightService.processAsync(params);
  105321. }
  105322. }, {
  105323. key: "_processFormat",
  105324. value: function _processFormat(resultFormat) {
  105325. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  105326. }
  105327. }]);
  105328. return NetworkAnalystService;
  105329. }();
  105330. ;// CONCATENATED MODULE: ./src/openlayers/services/NetworkAnalystService.js
  105331. function NetworkAnalystService_typeof(obj) { "@babel/helpers - typeof"; return NetworkAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, NetworkAnalystService_typeof(obj); }
  105332. function services_NetworkAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  105333. function services_NetworkAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  105334. function services_NetworkAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_NetworkAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_NetworkAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  105335. function NetworkAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) NetworkAnalystService_setPrototypeOf(subClass, superClass); }
  105336. function NetworkAnalystService_setPrototypeOf(o, p) { NetworkAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NetworkAnalystService_setPrototypeOf(o, p); }
  105337. function NetworkAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = NetworkAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = NetworkAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = NetworkAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return NetworkAnalystService_possibleConstructorReturn(this, result); }; }
  105338. function NetworkAnalystService_possibleConstructorReturn(self, call) { if (call && (NetworkAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return NetworkAnalystService_assertThisInitialized(self); }
  105339. function NetworkAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  105340. function NetworkAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  105341. function NetworkAnalystService_getPrototypeOf(o) { NetworkAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NetworkAnalystService_getPrototypeOf(o); }
  105342. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  105343. * This program are made available under the terms of the Apache License, Version 2.0
  105344. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  105345. /**
  105346. * @class NetworkAnalystService
  105347. * @category iServer NetworkAnalyst
  105348. * @classdesc 网络分析服务类。
  105349. * @modulecategory Services
  105350. * @extends {ServiceBase}
  105351. * @example
  105352. * new NetworkAnalystService(url).findPath(params,function(result){
  105353. * //doSomething
  105354. * })
  105355. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL 应为:
  105356. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};<br>
  105357. * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet"。
  105358. * @param {Object} options - 参数。
  105359. * @param {string} [options.proxy] - 服务代理地址。
  105360. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  105361. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  105362. * @param {Object} [options.headers] - 请求头。
  105363. * @usage
  105364. */
  105365. var NetworkAnalystService = /*#__PURE__*/function (_ServiceBase) {
  105366. NetworkAnalystService_inherits(NetworkAnalystService, _ServiceBase);
  105367. var _super = NetworkAnalystService_createSuper(NetworkAnalystService);
  105368. function NetworkAnalystService(url, options) {
  105369. var _this;
  105370. services_NetworkAnalystService_classCallCheck(this, NetworkAnalystService);
  105371. _this = _super.call(this, url, options);
  105372. _this._networkAnalystService = new NetworkAnalystService_NetworkAnalystService(url, options);
  105373. return _this;
  105374. }
  105375. /**
  105376. * @function NetworkAnalystService.prototype.burstPipelineAnalyst
  105377. * @description 爆管分析服务:即将给定弧段或节点作为爆管点来进行分析,返回关键结点 ID 数组,普通结点 ID 数组及其上下游弧段 ID 数组。
  105378. * @param {BurstPipelineAnalystParameters} params - 爆管分析服务参数类。
  105379. * @param {RequestCallback} callback 回调函数。
  105380. */
  105381. services_NetworkAnalystService_createClass(NetworkAnalystService, [{
  105382. key: "burstPipelineAnalyst",
  105383. value: function burstPipelineAnalyst(params, callback) {
  105384. params = this._processParams(params);
  105385. this._networkAnalystService.burstPipelineAnalyst(params, callback);
  105386. }
  105387. /**
  105388. * @function NetworkAnalystService.prototype.computeWeightMatrix
  105389. * @description 耗费矩阵分析服务:根据交通网络分析参数中的耗费字段返回一个耗费矩阵。该矩阵是一个二维数组,用来存储任意两点间的资源消耗。
  105390. * @param {ComputeWeightMatrixParameters} params - 耗费矩阵分析服务参数类。
  105391. * @param {RequestCallback} callback - 回调函数。
  105392. */
  105393. }, {
  105394. key: "computeWeightMatrix",
  105395. value: function computeWeightMatrix(params, callback) {
  105396. params = this._processParams(params);
  105397. this._networkAnalystService.computeWeightMatrix(params, callback);
  105398. }
  105399. /**
  105400. * @function NetworkAnalystService.prototype.findClosestFacilities
  105401. * @description 最近设施分析服务:指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  105402. * @param {FindClosestFacilitiesParameters} params - 最近设施分析服务参数类。
  105403. * @param {RequestCallback} callback - 回调函数。
  105404. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  105405. */
  105406. }, {
  105407. key: "findClosestFacilities",
  105408. value: function findClosestFacilities(params, callback, resultFormat) {
  105409. params = this._processParams(params);
  105410. this._networkAnalystService.findClosestFacilities(params, callback, resultFormat);
  105411. }
  105412. /**
  105413. * @function NetworkAnalystService.prototype.streamFacilityAnalyst
  105414. * @description 上游/下游 关键设施查找资源服务:查找给定弧段或节点的上游/下游中的关键设施结点,返回关键结点 ID 数组及其下游弧段 ID 数组。
  105415. * @param {FacilityAnalystStreamParameters} params - 上游/下游 关键设施查找资源服务参数类。
  105416. * @param {RequestCallback} callback - 回调函数。
  105417. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  105418. */
  105419. }, {
  105420. key: "streamFacilityAnalyst",
  105421. value: function streamFacilityAnalyst(params, callback, resultFormat) {
  105422. params = this._processParams(params);
  105423. this._networkAnalystService.streamFacilityAnalyst(params, callback, resultFormat);
  105424. }
  105425. /**
  105426. * @function NetworkAnalystService.prototype.findLocation
  105427. * @description 选址分区分析服务:确定一个或多个待建设施的最佳或最优位置。
  105428. * @param {FindLocationParameters} params - 选址分区分析服务参数类。
  105429. * @param {RequestCallback} callback - 回调函数。
  105430. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  105431. */
  105432. }, {
  105433. key: "findLocation",
  105434. value: function findLocation(params, callback, resultFormat) {
  105435. params = this._processParams(params);
  105436. this._networkAnalystService.findLocation(params, callback, resultFormat);
  105437. }
  105438. /**
  105439. * @function NetworkAnalystService.prototype.findPath
  105440. * @description 最佳路径分析服务:在网络数据集中指定一些节点,按照节点的选择顺序,顺序访问这些节点从而求解起止点之间阻抗最小的路经。
  105441. * @param {FindPathParameters} params - 最佳路径分析服务参数类。
  105442. * @param {RequestCallback} callback - 回调函数。
  105443. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  105444. */
  105445. }, {
  105446. key: "findPath",
  105447. value: function findPath(params, callback, resultFormat) {
  105448. params = this._processParams(params);
  105449. this._networkAnalystService.findPath(params, callback, resultFormat);
  105450. }
  105451. /**
  105452. * @function NetworkAnalystService.prototype.findTSPPaths
  105453. * @description 旅行商分析服务:路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
  105454. * @param {FindTSPPathsParameters} params - 旅行商分析服务参数类。
  105455. * @param {RequestCallback} callback - 回调函数。
  105456. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  105457. */
  105458. }, {
  105459. key: "findTSPPaths",
  105460. value: function findTSPPaths(params, callback, resultFormat) {
  105461. params = this._processParams(params);
  105462. this._networkAnalystService.findTSPPaths(params, callback, resultFormat);
  105463. }
  105464. /**
  105465. * @function NetworkAnalystService.prototype.findMTSPPaths
  105466. * @description 多旅行商分析服务:也称为物流配送,是指在网络数据集中,给定 M 个配送中心点和 N 个配送目的地(M,N 为大于零的整数)。查找经济有效的配送路径,并给出相应的行走路线。
  105467. * @param {FindMTSPPathsParameters} params - 多旅行商分析服务参数类。
  105468. * @param {RequestCallback} callback - 回调函数。
  105469. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  105470. */
  105471. }, {
  105472. key: "findMTSPPaths",
  105473. value: function findMTSPPaths(params, callback, resultFormat) {
  105474. params = this._processParams(params);
  105475. this._networkAnalystService.findMTSPPaths(params, callback, resultFormat);
  105476. }
  105477. /**
  105478. * @function NetworkAnalystService.prototype.findServiceAreas
  105479. * @description 服务区分析服务:以指定服务站点为中心,在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
  105480. * @param {FindServiceAreasParameters} params - 服务区分析服务参数类。
  105481. * @param {RequestCallback} callback - 回调函数。
  105482. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  105483. */
  105484. }, {
  105485. key: "findServiceAreas",
  105486. value: function findServiceAreas(params, callback, resultFormat) {
  105487. params = this._processParams(params);
  105488. this._networkAnalystService.findServiceAreas(params, callback, resultFormat);
  105489. }
  105490. /**
  105491. * @function NetworkAnalystService.prototype.updateEdgeWeight
  105492. * @description 更新边的耗费权重服务。
  105493. * @param {UpdateEdgeWeightParameters} params - 更新边的耗费权重服务参数类。
  105494. * @param {RequestCallback} callback 回调函数。
  105495. */
  105496. }, {
  105497. key: "updateEdgeWeight",
  105498. value: function updateEdgeWeight(params, callback) {
  105499. this._networkAnalystService.updateEdgeWeight(params, callback);
  105500. }
  105501. /**
  105502. * @function NetworkAnalystService.prototype.updateTurnNodeWeight
  105503. * @description 转向耗费权重更新服务。
  105504. * @param {UpdateTurnNodeWeightParameters} params - 转向耗费权重更新服务参数类。
  105505. * @param {RequestCallback} callback - 回调函数。
  105506. */
  105507. }, {
  105508. key: "updateTurnNodeWeight",
  105509. value: function updateTurnNodeWeight(params, callback) {
  105510. this._networkAnalystService.updateTurnNodeWeight(params, callback);
  105511. }
  105512. }, {
  105513. key: "_processParams",
  105514. value: function _processParams(params) {
  105515. if (!params) {
  105516. return {};
  105517. }
  105518. if (params.centers && core_Util_Util.isArray(params.centers)) {
  105519. params.centers.map(function (point, key) {
  105520. params.centers[key] = point instanceof (external_ol_geom_Point_default()) ? {
  105521. x: point.getCoordinates()[0],
  105522. y: point.getCoordinates()[1]
  105523. } : point;
  105524. return params.centers[key];
  105525. });
  105526. }
  105527. if (params.nodes && core_Util_Util.isArray(params.nodes)) {
  105528. params.nodes.map(function (point, key) {
  105529. params.nodes[key] = point instanceof (external_ol_geom_Point_default()) ? {
  105530. x: point.getCoordinates()[0],
  105531. y: point.getCoordinates()[1]
  105532. } : point;
  105533. return params.nodes[key];
  105534. });
  105535. }
  105536. if (params.event && params.event instanceof (external_ol_geom_Point_default())) {
  105537. params.event = {
  105538. x: params.event.getCoordinates()[0],
  105539. y: params.event.getCoordinates()[1]
  105540. };
  105541. }
  105542. if (params.facilities && core_Util_Util.isArray(params.facilities)) {
  105543. params.facilities.map(function (point, key) {
  105544. params.facilities[key] = point instanceof (external_ol_geom_Point_default()) ? {
  105545. x: point.getCoordinates()[0],
  105546. y: point.getCoordinates()[1]
  105547. } : point;
  105548. return params.facilities[key];
  105549. });
  105550. }
  105551. if (params.parameter && params.parameter.barrierPoints) {
  105552. var barrierPoints = params.parameter.barrierPoints;
  105553. if (core_Util_Util.isArray(barrierPoints)) {
  105554. barrierPoints.map(function (point, key) {
  105555. params.parameter.barrierPoints[key] = point instanceof (external_ol_geom_Point_default()) ? {
  105556. x: point.getCoordinates()[0],
  105557. y: point.getCoordinates()[1]
  105558. } : point;
  105559. return params.parameter.barrierPoints[key];
  105560. });
  105561. } else {
  105562. params.parameter.barrierPoints = [barrierPoints instanceof (external_ol_geom_Point_default()) ? {
  105563. x: barrierPoints.getCoordinates()[0],
  105564. y: barrierPoints.getCoordinates()[1]
  105565. } : barrierPoints];
  105566. }
  105567. }
  105568. return params;
  105569. }
  105570. }, {
  105571. key: "_processFormat",
  105572. value: function _processFormat(resultFormat) {
  105573. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  105574. }
  105575. }]);
  105576. return NetworkAnalystService;
  105577. }(ServiceBase);
  105578. ;// CONCATENATED MODULE: ./src/common/iServer/ProcessingService.js
  105579. function ProcessingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  105580. function ProcessingService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  105581. function ProcessingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ProcessingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ProcessingService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  105582. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  105583. * This program are made available under the terms of the Apache License, Version 2.0
  105584. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  105585. /**
  105586. * @class ProcessingService
  105587. * @category iServer ProcessingService
  105588. * @classdesc 分布式分析相关服务类。
  105589. * @extends {ServiceBase}
  105590. * @example
  105591. * new ProcessingService(url,options)
  105592. * .getKernelDensityJobs(function(result){
  105593. * //doSomething
  105594. * })
  105595. * @param {string} url - 服务地址。
  105596. * @param {Object} options - 参数。
  105597. * @param {string} [options.proxy] - 服务代理地址。
  105598. * @param {boolean} [options.withCredentials=false] - 请求是否携带cookie。
  105599. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  105600. * @param {Object} [options.headers] - 请求头。
  105601. * @usage
  105602. */
  105603. var ProcessingService_ProcessingService = /*#__PURE__*/function () {
  105604. function ProcessingService(url, options) {
  105605. ProcessingService_classCallCheck(this, ProcessingService);
  105606. this.url = url;
  105607. this.options = options || {};
  105608. this.kernelDensityJobs = {};
  105609. this.summaryMeshJobs = {};
  105610. this.queryJobs = {};
  105611. this.summaryRegionJobs = {};
  105612. this.vectorClipJobs = {};
  105613. this.overlayGeoJobs = {};
  105614. this.buffersJobs = {};
  105615. this.topologyValidatorJobs = {};
  105616. this.summaryAttributesJobs = {};
  105617. }
  105618. /**
  105619. * @function ProcessingService.prototype.getKernelDensityJobs
  105620. * @description 获取密度分析的列表。
  105621. * @param {RequestCallback} callback - 回调函数。
  105622. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105623. */
  105624. ProcessingService_createClass(ProcessingService, [{
  105625. key: "getKernelDensityJobs",
  105626. value: function getKernelDensityJobs(callback, resultFormat) {
  105627. var me = this,
  105628. format = me._processFormat(resultFormat);
  105629. var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
  105630. proxy: me.options.proxy,
  105631. withCredentials: me.options.withCredentials,
  105632. crossOrigin: me.options.crossOrigin,
  105633. headers: me.options.headers,
  105634. eventListeners: {
  105635. scope: me,
  105636. processCompleted: callback,
  105637. processFailed: callback
  105638. },
  105639. format: format
  105640. });
  105641. kernelDensityJobsService.getKernelDensityJobs();
  105642. }
  105643. /**
  105644. * @function ProcessingService.prototype.getKernelDensityJob
  105645. * @description 获取某个密度分析。
  105646. * @param {string} id - 空间分析的ID。
  105647. * @param {RequestCallback} callback - 回调函数。
  105648. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105649. */
  105650. }, {
  105651. key: "getKernelDensityJob",
  105652. value: function getKernelDensityJob(id, callback, resultFormat) {
  105653. var me = this,
  105654. format = me._processFormat(resultFormat);
  105655. var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
  105656. proxy: me.options.proxy,
  105657. withCredentials: me.options.withCredentials,
  105658. crossOrigin: me.options.crossOrigin,
  105659. headers: me.options.headers,
  105660. eventListeners: {
  105661. scope: me,
  105662. processCompleted: callback,
  105663. processFailed: callback
  105664. },
  105665. format: format
  105666. });
  105667. kernelDensityJobsService.getKernelDensityJob(id);
  105668. }
  105669. /**
  105670. * @function ProcessingService.prototype.addKernelDensityJob
  105671. * @description 密度分析。
  105672. * @param {KernelDensityJobParameter} params -密度分析参数类。
  105673. * @param {RequestCallback} callback 回调函数。
  105674. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  105675. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105676. */
  105677. }, {
  105678. key: "addKernelDensityJob",
  105679. value: function addKernelDensityJob(params, callback, seconds, resultFormat) {
  105680. var me = this,
  105681. format = me._processFormat(resultFormat);
  105682. var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
  105683. proxy: me.options.proxy,
  105684. withCredentials: me.options.withCredentials,
  105685. crossOrigin: me.options.crossOrigin,
  105686. headers: me.options.headers,
  105687. eventListeners: {
  105688. scope: me,
  105689. processCompleted: callback,
  105690. processFailed: callback,
  105691. processRunning: function processRunning(job) {
  105692. me.kernelDensityJobs[job.id] = job.state;
  105693. }
  105694. },
  105695. format: format
  105696. });
  105697. kernelDensityJobsService.addKernelDensityJob(params, seconds);
  105698. }
  105699. /**
  105700. * @function ProcessingService.prototype.getKernelDensityJobState
  105701. * @description 获取密度分析的状态。
  105702. * @param {string} id - 密度分析的id。
  105703. * @returns {Object} 密度分析的状态。
  105704. */
  105705. }, {
  105706. key: "getKernelDensityJobState",
  105707. value: function getKernelDensityJobState(id) {
  105708. return this.kernelDensityJobs[id];
  105709. }
  105710. /**
  105711. * @function ProcessingService.prototype.getSummaryMeshJobs
  105712. * @description 获取点聚合分析的列表。
  105713. * @param {RequestCallback} callback - 回调函数。
  105714. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105715. */
  105716. }, {
  105717. key: "getSummaryMeshJobs",
  105718. value: function getSummaryMeshJobs(callback, resultFormat) {
  105719. var me = this,
  105720. format = me._processFormat(resultFormat);
  105721. var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
  105722. proxy: me.options.proxy,
  105723. withCredentials: me.options.withCredentials,
  105724. crossOrigin: me.options.crossOrigin,
  105725. headers: me.options.headers,
  105726. eventListeners: {
  105727. scope: me,
  105728. processCompleted: callback,
  105729. processFailed: callback
  105730. },
  105731. format: format
  105732. });
  105733. summaryMeshJobsService.getSummaryMeshJobs();
  105734. }
  105735. /**
  105736. * @function ProcessingService.prototype.getSummaryMeshJob
  105737. * @description 获取某个点聚合分析。
  105738. * @param {string} id - 空间分析的 ID。
  105739. * @param {RequestCallback} callback - 回调函数。
  105740. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105741. */
  105742. }, {
  105743. key: "getSummaryMeshJob",
  105744. value: function getSummaryMeshJob(id, callback, resultFormat) {
  105745. var me = this,
  105746. format = me._processFormat(resultFormat);
  105747. var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
  105748. proxy: me.options.proxy,
  105749. withCredentials: me.options.withCredentials,
  105750. crossOrigin: me.options.crossOrigin,
  105751. headers: me.options.headers,
  105752. eventListeners: {
  105753. scope: me,
  105754. processCompleted: callback,
  105755. processFailed: callback
  105756. },
  105757. format: format
  105758. });
  105759. summaryMeshJobsService.getSummaryMeshJob(id);
  105760. }
  105761. /**
  105762. * @function ProcessingService.prototype.addSummaryMeshJob
  105763. * @description 点聚合分析。
  105764. * @param {SummaryMeshJobParameter} params - 点聚合分析任务参数类。
  105765. * @param {RequestCallback} callback 回调函数。
  105766. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  105767. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105768. */
  105769. }, {
  105770. key: "addSummaryMeshJob",
  105771. value: function addSummaryMeshJob(params, callback, seconds, resultFormat) {
  105772. var me = this,
  105773. format = me._processFormat(resultFormat);
  105774. var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
  105775. proxy: me.options.proxy,
  105776. withCredentials: me.options.withCredentials,
  105777. crossOrigin: me.options.crossOrigin,
  105778. headers: me.options.headers,
  105779. eventListeners: {
  105780. scope: me,
  105781. processCompleted: callback,
  105782. processFailed: callback,
  105783. processRunning: function processRunning(job) {
  105784. me.summaryMeshJobs[job.id] = job.state;
  105785. }
  105786. },
  105787. format: format
  105788. });
  105789. summaryMeshJobsService.addSummaryMeshJob(params, seconds);
  105790. }
  105791. /**
  105792. * @function ProcessingService.prototype.getSummaryMeshJobState
  105793. * @description 获取点聚合分析的状态。
  105794. * @param {string} id - 点聚合分析的 ID。
  105795. * @returns {Object} 点聚合分析的状态。
  105796. */
  105797. }, {
  105798. key: "getSummaryMeshJobState",
  105799. value: function getSummaryMeshJobState(id) {
  105800. return this.summaryMeshJobs[id];
  105801. }
  105802. /**
  105803. * @function ProcessingService.prototype.getQueryJobs
  105804. * @description 获取单对象查询分析的列表。
  105805. * @param {RequestCallback} callback - 回调函数。
  105806. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105807. */
  105808. }, {
  105809. key: "getQueryJobs",
  105810. value: function getQueryJobs(callback, resultFormat) {
  105811. var me = this,
  105812. format = me._processFormat(resultFormat);
  105813. var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
  105814. proxy: me.options.proxy,
  105815. withCredentials: me.options.withCredentials,
  105816. crossOrigin: me.options.crossOrigin,
  105817. headers: me.options.headers,
  105818. eventListeners: {
  105819. scope: me,
  105820. processCompleted: callback,
  105821. processFailed: callback
  105822. },
  105823. format: format
  105824. });
  105825. singleObjectQueryJobsService.getQueryJobs();
  105826. }
  105827. /**
  105828. * @function ProcessingService.prototype.getQueryJob
  105829. * @description 获取某个单对象查询分析。
  105830. * @param {string} id - 空间分析的 ID。
  105831. * @param {RequestCallback} callback - 回调函数。
  105832. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105833. */
  105834. }, {
  105835. key: "getQueryJob",
  105836. value: function getQueryJob(id, callback, resultFormat) {
  105837. var me = this,
  105838. format = me._processFormat(resultFormat);
  105839. var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
  105840. proxy: me.options.proxy,
  105841. withCredentials: me.options.withCredentials,
  105842. crossOrigin: me.options.crossOrigin,
  105843. headers: me.options.headers,
  105844. eventListeners: {
  105845. scope: me,
  105846. processCompleted: callback,
  105847. processFailed: callback
  105848. },
  105849. format: format
  105850. });
  105851. singleObjectQueryJobsService.getQueryJob(id);
  105852. }
  105853. /**
  105854. * @function ProcessingService.prototype.addQueryJob
  105855. * @description 单对象查询分析。
  105856. * @param {SingleObjectQueryJobsParameter} params - 单对象查询分析的请求参数。
  105857. * @param {RequestCallback} callback - 回调函数。
  105858. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  105859. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105860. */
  105861. }, {
  105862. key: "addQueryJob",
  105863. value: function addQueryJob(params, callback, seconds, resultFormat) {
  105864. var me = this,
  105865. format = me._processFormat(resultFormat);
  105866. var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
  105867. proxy: me.options.proxy,
  105868. withCredentials: me.options.withCredentials,
  105869. crossOrigin: me.options.crossOrigin,
  105870. headers: me.options.headers,
  105871. eventListeners: {
  105872. scope: me,
  105873. processCompleted: callback,
  105874. processFailed: callback,
  105875. processRunning: function processRunning(job) {
  105876. me.queryJobs[job.id] = job.state;
  105877. }
  105878. },
  105879. format: format
  105880. });
  105881. singleObjectQueryJobsService.addQueryJob(params, seconds);
  105882. }
  105883. /**
  105884. * @function ProcessingService.prototype.getQueryJobState
  105885. * @description 获取单对象查询分析的状态。
  105886. * @param {string} id - 单对象查询分析的 ID。
  105887. * @returns {Object} 单对象查询分析的状态。
  105888. */
  105889. }, {
  105890. key: "getQueryJobState",
  105891. value: function getQueryJobState(id) {
  105892. return this.queryJobs[id];
  105893. }
  105894. /**
  105895. * @function ProcessingService.prototype.getSummaryRegionJobs
  105896. * @description 获取区域汇总分析的列表。
  105897. * @param {RequestCallback} callback - 回调函数。
  105898. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105899. */
  105900. }, {
  105901. key: "getSummaryRegionJobs",
  105902. value: function getSummaryRegionJobs(callback, resultFormat) {
  105903. var me = this,
  105904. format = me._processFormat(resultFormat);
  105905. var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
  105906. proxy: me.options.proxy,
  105907. withCredentials: me.options.withCredentials,
  105908. crossOrigin: me.options.crossOrigin,
  105909. headers: me.options.headers,
  105910. eventListeners: {
  105911. scope: me,
  105912. processCompleted: callback,
  105913. processFailed: callback
  105914. },
  105915. format: format
  105916. });
  105917. summaryRegionJobsService.getSummaryRegionJobs();
  105918. }
  105919. /**
  105920. * @function ProcessingService.prototype.getSummaryRegionJob
  105921. * @description 获取某个区域汇总分析。
  105922. * @param {string} id - 区域汇总分析的 ID。
  105923. * @param {RequestCallback} callback - 回调函数。
  105924. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105925. */
  105926. }, {
  105927. key: "getSummaryRegionJob",
  105928. value: function getSummaryRegionJob(id, callback, resultFormat) {
  105929. var me = this,
  105930. format = me._processFormat(resultFormat);
  105931. var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
  105932. proxy: me.options.proxy,
  105933. withCredentials: me.options.withCredentials,
  105934. crossOrigin: me.options.crossOrigin,
  105935. headers: me.options.headers,
  105936. eventListeners: {
  105937. scope: me,
  105938. processCompleted: callback,
  105939. processFailed: callback
  105940. },
  105941. format: format
  105942. });
  105943. summaryRegionJobsService.getSummaryRegionJob(id);
  105944. }
  105945. /**
  105946. * @function ProcessingService.prototype.addSummaryRegionJob
  105947. * @description 区域汇总分析。
  105948. * @param {SummaryRegionJobParameter} params - 区域汇总分析参数类。
  105949. * @param {RequestCallback} callback - 回调函数。
  105950. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  105951. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105952. */
  105953. }, {
  105954. key: "addSummaryRegionJob",
  105955. value: function addSummaryRegionJob(params, callback, seconds, resultFormat) {
  105956. var me = this,
  105957. format = me._processFormat(resultFormat);
  105958. var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
  105959. proxy: me.options.proxy,
  105960. withCredentials: me.options.withCredentials,
  105961. crossOrigin: me.options.crossOrigin,
  105962. headers: me.options.headers,
  105963. eventListeners: {
  105964. scope: me,
  105965. processCompleted: callback,
  105966. processFailed: callback,
  105967. processRunning: function processRunning(job) {
  105968. me.summaryRegionJobs[job.id] = job.state;
  105969. }
  105970. },
  105971. format: format
  105972. });
  105973. summaryRegionJobsService.addSummaryRegionJob(params, seconds);
  105974. }
  105975. /**
  105976. * @function ProcessingService.prototype.getSummaryRegionJobState
  105977. * @description 获取区域汇总分析的状态。
  105978. * @param {string} id - 生成区域汇总分析的 ID。
  105979. * @returns {Object} 区域汇总分析的状态。
  105980. */
  105981. }, {
  105982. key: "getSummaryRegionJobState",
  105983. value: function getSummaryRegionJobState(id) {
  105984. return this.summaryRegionJobs[id];
  105985. }
  105986. /**
  105987. * @function ProcessingService.prototype.getVectorClipJobs
  105988. * @description 获取矢量裁剪分析的列表。
  105989. * @param {RequestCallback} callback - 回调函数。
  105990. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105991. */
  105992. }, {
  105993. key: "getVectorClipJobs",
  105994. value: function getVectorClipJobs(callback, resultFormat) {
  105995. var me = this,
  105996. format = me._processFormat(resultFormat);
  105997. var vectorClipJobsService = new VectorClipJobsService(me.url, {
  105998. proxy: me.options.proxy,
  105999. withCredentials: me.options.withCredentials,
  106000. crossOrigin: me.options.crossOrigin,
  106001. headers: me.options.headers,
  106002. eventListeners: {
  106003. scope: me,
  106004. processCompleted: callback,
  106005. processFailed: callback
  106006. },
  106007. format: format
  106008. });
  106009. vectorClipJobsService.getVectorClipJobs();
  106010. }
  106011. /**
  106012. * @function ProcessingService.prototype.getVectorClipJob
  106013. * @description 获取某个矢量裁剪分析。
  106014. * @param {string} id - 空间分析的 ID。
  106015. * @param {RequestCallback} callback - 回调函数。
  106016. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106017. */
  106018. }, {
  106019. key: "getVectorClipJob",
  106020. value: function getVectorClipJob(id, callback, resultFormat) {
  106021. var me = this,
  106022. format = me._processFormat(resultFormat);
  106023. var vectorClipJobsService = new VectorClipJobsService(me.url, {
  106024. proxy: me.options.proxy,
  106025. withCredentials: me.options.withCredentials,
  106026. crossOrigin: me.options.crossOrigin,
  106027. headers: me.options.headers,
  106028. eventListeners: {
  106029. scope: me,
  106030. processCompleted: callback,
  106031. processFailed: callback
  106032. },
  106033. format: format
  106034. });
  106035. vectorClipJobsService.getVectorClipJob(id);
  106036. }
  106037. /**
  106038. * @function ProcessingService.prototype.addVectorClipJob
  106039. * @description 矢量裁剪分析。
  106040. * @param {VectorClipJobsParameter} params - 矢量裁剪分析请求参数类。
  106041. * @param {RequestCallback} callback - 回调函数。
  106042. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  106043. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106044. */
  106045. }, {
  106046. key: "addVectorClipJob",
  106047. value: function addVectorClipJob(params, callback, seconds, resultFormat) {
  106048. var me = this,
  106049. format = me._processFormat(resultFormat);
  106050. var vectorClipJobsService = new VectorClipJobsService(me.url, {
  106051. proxy: me.options.proxy,
  106052. withCredentials: me.options.withCredentials,
  106053. crossOrigin: me.options.crossOrigin,
  106054. headers: me.options.headers,
  106055. eventListeners: {
  106056. scope: me,
  106057. processCompleted: callback,
  106058. processFailed: callback,
  106059. processRunning: function processRunning(job) {
  106060. me.vectorClipJobs[job.id] = job.state;
  106061. }
  106062. },
  106063. format: format
  106064. });
  106065. vectorClipJobsService.addVectorClipJob(params, seconds);
  106066. }
  106067. /**
  106068. * @function ProcessingService.prototype.getVectorClipJobState
  106069. * @description 获取矢量裁剪分析的状态。
  106070. * @param {number} id - 矢量裁剪分析的ID。
  106071. * @returns {Object} 矢量裁剪分析的状态。
  106072. */
  106073. }, {
  106074. key: "getVectorClipJobState",
  106075. value: function getVectorClipJobState(id) {
  106076. return this.vectorClipJobs[id];
  106077. }
  106078. /**
  106079. * @function ProcessingService.prototype.getOverlayGeoJobs
  106080. * @description 获取叠加分析的列表。
  106081. * @param {RequestCallback} callback - 回调函数。
  106082. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106083. */
  106084. }, {
  106085. key: "getOverlayGeoJobs",
  106086. value: function getOverlayGeoJobs(callback, resultFormat) {
  106087. var me = this,
  106088. format = me._processFormat(resultFormat);
  106089. var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
  106090. proxy: me.options.proxy,
  106091. withCredentials: me.options.withCredentials,
  106092. crossOrigin: me.options.crossOrigin,
  106093. headers: me.options.headers,
  106094. eventListeners: {
  106095. scope: me,
  106096. processCompleted: callback,
  106097. processFailed: callback
  106098. },
  106099. format: format
  106100. });
  106101. overlayGeoJobsService.getOverlayGeoJobs();
  106102. }
  106103. /**
  106104. * @function ProcessingService.prototype.getOverlayGeoJob
  106105. * @description 获取某个叠加分析。
  106106. * @param {string} id - 空间分析的 ID。
  106107. * @param {RequestCallback} callback - 回调函数。
  106108. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106109. */
  106110. }, {
  106111. key: "getOverlayGeoJob",
  106112. value: function getOverlayGeoJob(id, callback, resultFormat) {
  106113. var me = this,
  106114. format = me._processFormat(resultFormat);
  106115. var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
  106116. proxy: me.options.proxy,
  106117. withCredentials: me.options.withCredentials,
  106118. crossOrigin: me.options.crossOrigin,
  106119. headers: me.options.headers,
  106120. eventListeners: {
  106121. scope: me,
  106122. processCompleted: callback,
  106123. processFailed: callback
  106124. },
  106125. format: format
  106126. });
  106127. overlayGeoJobsService.getOverlayGeoJob(id);
  106128. }
  106129. /**
  106130. * @function ProcessingService.prototype.addOverlayGeoJob
  106131. * @description 叠加分析。
  106132. * @param {OverlayGeoJobParameter} params - 叠加分析请求参数类。
  106133. * @param {RequestCallback} callback - 回调函数。
  106134. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  106135. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106136. */
  106137. }, {
  106138. key: "addOverlayGeoJob",
  106139. value: function addOverlayGeoJob(params, callback, seconds, resultFormat) {
  106140. var me = this,
  106141. format = me._processFormat(resultFormat);
  106142. var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
  106143. proxy: me.options.proxy,
  106144. withCredentials: me.options.withCredentials,
  106145. crossOrigin: me.options.crossOrigin,
  106146. headers: me.options.headers,
  106147. eventListeners: {
  106148. scope: me,
  106149. processCompleted: callback,
  106150. processFailed: callback,
  106151. processRunning: function processRunning(job) {
  106152. me.overlayGeoJobs[job.id] = job.state;
  106153. }
  106154. },
  106155. format: format
  106156. });
  106157. overlayGeoJobsService.addOverlayGeoJob(params, seconds);
  106158. }
  106159. /**
  106160. * @function ProcessingService.prototype.getoverlayGeoJobState
  106161. * @description 获取叠加分析的状态。
  106162. * @param {string} id - 叠加分析的 ID。
  106163. * @returns {Object} 叠加分析的状态。
  106164. */
  106165. }, {
  106166. key: "getoverlayGeoJobState",
  106167. value: function getoverlayGeoJobState(id) {
  106168. return this.overlayGeoJobs[id];
  106169. }
  106170. /**
  106171. * @function ProcessingService.prototype.getBuffersJobs
  106172. * @description 获取缓冲区分析的列表。
  106173. * @param {RequestCallback} callback - 回调函数。
  106174. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106175. */
  106176. }, {
  106177. key: "getBuffersJobs",
  106178. value: function getBuffersJobs(callback, resultFormat) {
  106179. var me = this,
  106180. format = me._processFormat(resultFormat);
  106181. var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
  106182. proxy: me.options.proxy,
  106183. withCredentials: me.options.withCredentials,
  106184. crossOrigin: me.options.crossOrigin,
  106185. headers: me.options.headers,
  106186. eventListeners: {
  106187. scope: me,
  106188. processCompleted: callback,
  106189. processFailed: callback
  106190. },
  106191. format: format
  106192. });
  106193. buffersAnalystJobsService.getBuffersJobs();
  106194. }
  106195. /**
  106196. * @function ProcessingService.prototype.getBuffersJob
  106197. * @description 获取某个缓冲区分析。
  106198. * @param {string} id - 空间分析的 ID。
  106199. * @param {RequestCallback} callback - 回调函数。
  106200. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106201. */
  106202. }, {
  106203. key: "getBuffersJob",
  106204. value: function getBuffersJob(id, callback, resultFormat) {
  106205. var me = this,
  106206. format = me._processFormat(resultFormat);
  106207. var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
  106208. proxy: me.options.proxy,
  106209. withCredentials: me.options.withCredentials,
  106210. crossOrigin: me.options.crossOrigin,
  106211. headers: me.options.headers,
  106212. eventListeners: {
  106213. scope: me,
  106214. processCompleted: callback,
  106215. processFailed: callback
  106216. },
  106217. format: format
  106218. });
  106219. buffersAnalystJobsService.getBuffersJob(id);
  106220. }
  106221. /**
  106222. * @function ProcessingService.prototype.addBuffersJob
  106223. * @description 缓冲区分析。
  106224. * @param {BuffersAnalystJobsParameter} params - 缓冲区分析请求参数类。
  106225. * @param {RequestCallback} callback - 回调函数。
  106226. * @param {number} seconds - 获取创建成功结果的时间间隔。
  106227. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106228. */
  106229. }, {
  106230. key: "addBuffersJob",
  106231. value: function addBuffersJob(params, callback, seconds, resultFormat) {
  106232. var me = this,
  106233. format = me._processFormat(resultFormat);
  106234. var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
  106235. proxy: me.options.proxy,
  106236. withCredentials: me.options.withCredentials,
  106237. crossOrigin: me.options.crossOrigin,
  106238. headers: me.options.headers,
  106239. eventListeners: {
  106240. scope: me,
  106241. processCompleted: callback,
  106242. processFailed: callback,
  106243. processRunning: function processRunning(job) {
  106244. me.buffersJobs[job.id] = job.state;
  106245. }
  106246. },
  106247. format: format
  106248. });
  106249. buffersAnalystJobsService.addBuffersJob(params, seconds);
  106250. }
  106251. /**
  106252. * @function ProcessingService.prototype.getBuffersJobState
  106253. * @description 获取缓冲区分析的状态。
  106254. * @param {string} id - 缓冲区分析的 ID。
  106255. * @returns {Object} 缓冲区分析的状态。
  106256. */
  106257. }, {
  106258. key: "getBuffersJobState",
  106259. value: function getBuffersJobState(id) {
  106260. return this.buffersJobs[id];
  106261. }
  106262. /**
  106263. * @function ProcessingService.prototype.getTopologyValidatorJobs
  106264. * @description 获取拓扑检查分析的列表。
  106265. * @param {RequestCallback} callback - 回调函数。
  106266. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106267. */
  106268. }, {
  106269. key: "getTopologyValidatorJobs",
  106270. value: function getTopologyValidatorJobs(callback, resultFormat) {
  106271. var me = this,
  106272. format = me._processFormat(resultFormat);
  106273. var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
  106274. proxy: me.options.proxy,
  106275. withCredentials: me.options.withCredentials,
  106276. crossOrigin: me.options.crossOrigin,
  106277. headers: me.options.headers,
  106278. eventListeners: {
  106279. scope: me,
  106280. processCompleted: callback,
  106281. processFailed: callback
  106282. },
  106283. format: format
  106284. });
  106285. topologyValidatorJobsService.getTopologyValidatorJobs();
  106286. }
  106287. /**
  106288. * @function ProcessingService.prototype.getTopologyValidatorJob
  106289. * @description 获取某个拓扑检查分析。
  106290. * @param {string} id - 空间分析的 ID。
  106291. * @param {RequestCallback} callback - 回调函数。
  106292. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106293. */
  106294. }, {
  106295. key: "getTopologyValidatorJob",
  106296. value: function getTopologyValidatorJob(id, callback, resultFormat) {
  106297. var me = this,
  106298. format = me._processFormat(resultFormat);
  106299. var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
  106300. proxy: me.options.proxy,
  106301. withCredentials: me.options.withCredentials,
  106302. crossOrigin: me.options.crossOrigin,
  106303. headers: me.options.headers,
  106304. eventListeners: {
  106305. scope: me,
  106306. processCompleted: callback,
  106307. processFailed: callback
  106308. },
  106309. format: format
  106310. });
  106311. topologyValidatorJobsService.getTopologyValidatorJob(id);
  106312. }
  106313. /**
  106314. * @function ProcessingService.prototype.addTopologyValidatorJob
  106315. * @description 拓扑检查分析。
  106316. * @param {TopologyValidatorJobsParameter} params - 拓扑检查分析请求参数类。
  106317. * @param {RequestCallback} callback - 回调函数。
  106318. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  106319. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106320. */
  106321. }, {
  106322. key: "addTopologyValidatorJob",
  106323. value: function addTopologyValidatorJob(params, callback, seconds, resultFormat) {
  106324. var me = this,
  106325. format = me._processFormat(resultFormat);
  106326. var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
  106327. proxy: me.options.proxy,
  106328. withCredentials: me.options.withCredentials,
  106329. crossOrigin: me.options.crossOrigin,
  106330. headers: me.options.headers,
  106331. eventListeners: {
  106332. scope: me,
  106333. processCompleted: callback,
  106334. processFailed: callback,
  106335. processRunning: function processRunning(job) {
  106336. me.topologyValidatorJobs[job.id] = job.state;
  106337. }
  106338. },
  106339. format: format
  106340. });
  106341. topologyValidatorJobsService.addTopologyValidatorJob(params, seconds);
  106342. }
  106343. /**
  106344. * @function ProcessingService.prototype.getTopologyValidatorJobState
  106345. * @description 获取拓扑检查分析的状态。
  106346. * @param {string} id - 拓扑检查分析的 ID。
  106347. * @returns {Object} 拓扑检查分析的状态。
  106348. */
  106349. }, {
  106350. key: "getTopologyValidatorJobState",
  106351. value: function getTopologyValidatorJobState(id) {
  106352. return this.topologyValidatorJobs[id];
  106353. }
  106354. /**
  106355. * @function ProcessingService.prototype.getSummaryAttributesJobs
  106356. * @description 获取属性汇总分析的列表。
  106357. * @param {RequestCallback} callback - 回调函数。
  106358. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106359. */
  106360. }, {
  106361. key: "getSummaryAttributesJobs",
  106362. value: function getSummaryAttributesJobs(callback, resultFormat) {
  106363. var me = this,
  106364. format = me._processFormat(resultFormat);
  106365. var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
  106366. proxy: me.options.proxy,
  106367. withCredentials: me.options.withCredentials,
  106368. crossOrigin: me.options.crossOrigin,
  106369. headers: me.options.headers,
  106370. eventListeners: {
  106371. scope: me,
  106372. processCompleted: callback,
  106373. processFailed: callback
  106374. },
  106375. format: format
  106376. });
  106377. summaryAttributesJobsService.getSummaryAttributesJobs();
  106378. }
  106379. /**
  106380. * @function ProcessingService.prototype.getSummaryAttributesJob
  106381. * @description 获取某个属性汇总分析。
  106382. * @param {string} id - 空间分析的 ID。
  106383. * @param {RequestCallback} callback - 回调函数。
  106384. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106385. */
  106386. }, {
  106387. key: "getSummaryAttributesJob",
  106388. value: function getSummaryAttributesJob(id, callback, resultFormat) {
  106389. var me = this,
  106390. format = me._processFormat(resultFormat);
  106391. var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
  106392. proxy: me.options.proxy,
  106393. withCredentials: me.options.withCredentials,
  106394. crossOrigin: me.options.crossOrigin,
  106395. headers: me.options.headers,
  106396. eventListeners: {
  106397. scope: me,
  106398. processCompleted: callback,
  106399. processFailed: callback
  106400. },
  106401. format: format
  106402. });
  106403. summaryAttributesJobsService.getSummaryAttributesJob(id);
  106404. }
  106405. /**
  106406. * @function ProcessingService.prototype.addSummaryAttributesJob
  106407. * @description 属性汇总分析。
  106408. * @param {SummaryAttributesJobsParameter} params - 属性汇总分析参数类。
  106409. * @param {RequestCallback} callback - 回调函数。
  106410. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  106411. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106412. */
  106413. }, {
  106414. key: "addSummaryAttributesJob",
  106415. value: function addSummaryAttributesJob(params, callback, seconds, resultFormat) {
  106416. var me = this,
  106417. format = me._processFormat(resultFormat);
  106418. var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
  106419. proxy: me.options.proxy,
  106420. withCredentials: me.options.withCredentials,
  106421. crossOrigin: me.options.crossOrigin,
  106422. headers: me.options.headers,
  106423. eventListeners: {
  106424. scope: me,
  106425. processCompleted: callback,
  106426. processFailed: callback,
  106427. processRunning: function processRunning(job) {
  106428. me.summaryAttributesJobs[job.id] = job.state;
  106429. }
  106430. },
  106431. format: format
  106432. });
  106433. summaryAttributesJobsService.addSummaryAttributesJob(params, seconds);
  106434. }
  106435. /**
  106436. * @function ProcessingService.prototype.getSummaryAttributesJobState
  106437. * @description 获取属性汇总分析的状态。
  106438. * @param {string} id - 属性汇总分析的 ID。
  106439. * @returns {Object} 属性汇总分析的状态
  106440. */
  106441. }, {
  106442. key: "getSummaryAttributesJobState",
  106443. value: function getSummaryAttributesJobState(id) {
  106444. return this.summaryAttributesJobs[id];
  106445. }
  106446. }, {
  106447. key: "_processFormat",
  106448. value: function _processFormat(resultFormat) {
  106449. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  106450. }
  106451. }]);
  106452. return ProcessingService;
  106453. }();
  106454. ;// CONCATENATED MODULE: ./src/openlayers/services/ProcessingService.js
  106455. function ProcessingService_typeof(obj) { "@babel/helpers - typeof"; return ProcessingService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ProcessingService_typeof(obj); }
  106456. function services_ProcessingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  106457. function services_ProcessingService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  106458. function services_ProcessingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_ProcessingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_ProcessingService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  106459. function ProcessingService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ProcessingService_setPrototypeOf(subClass, superClass); }
  106460. function ProcessingService_setPrototypeOf(o, p) { ProcessingService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ProcessingService_setPrototypeOf(o, p); }
  106461. function ProcessingService_createSuper(Derived) { var hasNativeReflectConstruct = ProcessingService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ProcessingService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ProcessingService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ProcessingService_possibleConstructorReturn(this, result); }; }
  106462. function ProcessingService_possibleConstructorReturn(self, call) { if (call && (ProcessingService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ProcessingService_assertThisInitialized(self); }
  106463. function ProcessingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  106464. function ProcessingService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  106465. function ProcessingService_getPrototypeOf(o) { ProcessingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ProcessingService_getPrototypeOf(o); }
  106466. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  106467. * This program are made available under the terms of the Apache License, Version 2.0
  106468. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  106469. /**
  106470. * @class ProcessingService
  106471. * @category iServer ProcessingService
  106472. * @classdesc 分布式分析相关服务类。
  106473. * @extends {ServiceBase}
  106474. * @example
  106475. * new ProcessingService(url,options).getKernelDensityJobs(function(result){
  106476. * //doSomething
  106477. * })
  106478. * @param {string} url - 服务地址。
  106479. * @param {Object} options - 参数。
  106480. * @param {string} [options.proxy] - 服务代理地址。
  106481. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  106482. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  106483. * @param {Object} [options.headers] - 请求头。
  106484. * @usage
  106485. */
  106486. var ProcessingService = /*#__PURE__*/function (_ServiceBase) {
  106487. ProcessingService_inherits(ProcessingService, _ServiceBase);
  106488. var _super = ProcessingService_createSuper(ProcessingService);
  106489. function ProcessingService(url, options) {
  106490. var _this;
  106491. services_ProcessingService_classCallCheck(this, ProcessingService);
  106492. _this = _super.call(this, url, options);
  106493. _this._processingService = new ProcessingService_ProcessingService(url, options);
  106494. return _this;
  106495. }
  106496. /**
  106497. * @function ProcessingService.prototype.getKernelDensityJobs
  106498. * @description 获取密度分析的列表。
  106499. * @param {RequestCallback} callback - 回调函数。
  106500. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106501. */
  106502. services_ProcessingService_createClass(ProcessingService, [{
  106503. key: "getKernelDensityJobs",
  106504. value: function getKernelDensityJobs(callback, resultFormat) {
  106505. this._processingService.getKernelDensityJobs(callback, resultFormat);
  106506. }
  106507. /**
  106508. * @function ProcessingService.prototype.getKernelDensityJob
  106509. * @description 获取密度分析。
  106510. * @param {string} id - 空间分析的 ID。
  106511. * @param {RequestCallback} callback - 回调函数。
  106512. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106513. */
  106514. }, {
  106515. key: "getKernelDensityJob",
  106516. value: function getKernelDensityJob(id, callback, resultFormat) {
  106517. this._processingService.getKernelDensityJob(id, callback, resultFormat);
  106518. }
  106519. /**
  106520. * @function ProcessingService.prototype.addKernelDensityJob
  106521. * @description 密度分析。
  106522. * @param {KernelDensityJobParameter} params - 核密度分析服务参数类。
  106523. * @param {RequestCallback} callback - 回调函数。
  106524. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  106525. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106526. */
  106527. }, {
  106528. key: "addKernelDensityJob",
  106529. value: function addKernelDensityJob(params, callback, seconds, resultFormat) {
  106530. params = this._processParams(params);
  106531. this._processingService.addKernelDensityJob(params, callback, seconds, resultFormat);
  106532. }
  106533. /**
  106534. * @function ProcessingService.prototype.getKernelDensityJobState
  106535. * @description 获取密度分析的状态。
  106536. * @param {string} id - 密度分析的 ID。
  106537. * @returns {Object} 密度分析的状态
  106538. */
  106539. }, {
  106540. key: "getKernelDensityJobState",
  106541. value: function getKernelDensityJobState(id) {
  106542. return this._processingService.getKernelDensityJobState(id);
  106543. }
  106544. /**
  106545. * @function ProcessingService.prototype.getSummaryMeshJobs
  106546. * @description 获取点聚合分析的列表。
  106547. * @param {RequestCallback} callback - 回调函数。
  106548. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106549. */
  106550. }, {
  106551. key: "getSummaryMeshJobs",
  106552. value: function getSummaryMeshJobs(callback, resultFormat) {
  106553. this._processingService.getSummaryMeshJobs(callback, resultFormat);
  106554. }
  106555. /**
  106556. * @function ProcessingService.prototype.getSummaryMeshJob
  106557. * @description 获取点聚合分析。
  106558. * @param {string} id - 空间分析的 ID。
  106559. * @param {RequestCallback} callback - 回调函数。
  106560. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106561. */
  106562. }, {
  106563. key: "getSummaryMeshJob",
  106564. value: function getSummaryMeshJob(id, callback, resultFormat) {
  106565. this._processingService.getSummaryMeshJob(id, callback, resultFormat);
  106566. }
  106567. /**
  106568. * @function ProcessingService.prototype.addSummaryMeshJob
  106569. * @description 点聚合分析。
  106570. * @param {SummaryMeshJobParameter} params - 点聚合分析任务参数类。
  106571. * @param {RequestCallback} callback - 回调函数。
  106572. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  106573. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106574. */
  106575. }, {
  106576. key: "addSummaryMeshJob",
  106577. value: function addSummaryMeshJob(params, callback, seconds, resultFormat) {
  106578. params = this._processParams(params);
  106579. this._processingService.addSummaryMeshJob(params, callback, seconds, resultFormat);
  106580. }
  106581. /**
  106582. * @function ProcessingService.prototype.getSummaryMeshJobState
  106583. * @description 获取点聚合分析的状态。
  106584. * @param {string} id - 点聚合分析的 ID。
  106585. * @returns {Object} 点聚合分析的状态。
  106586. */
  106587. }, {
  106588. key: "getSummaryMeshJobState",
  106589. value: function getSummaryMeshJobState(id) {
  106590. return this._processingService.getSummaryMeshJobState(id);
  106591. }
  106592. /**
  106593. * @function ProcessingService.prototype.getQueryJobs
  106594. * @description 获取单对象查询分析的列表。
  106595. * @param {RequestCallback} callback - 回调函数。
  106596. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106597. */
  106598. }, {
  106599. key: "getQueryJobs",
  106600. value: function getQueryJobs(callback, resultFormat) {
  106601. this._processingService.getQueryJobs(callback, resultFormat);
  106602. }
  106603. /**
  106604. * @function ProcessingService.prototype.getQueryJob
  106605. * @description 获取单对象查询分析。
  106606. * @param {string} id - 空间分析的 ID。
  106607. * @param {RequestCallback} callback - 回调函数。
  106608. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106609. */
  106610. }, {
  106611. key: "getQueryJob",
  106612. value: function getQueryJob(id, callback, resultFormat) {
  106613. this._processingService.getQueryJob(id, callback, resultFormat);
  106614. }
  106615. /**
  106616. * @function ProcessingService.prototype.addQueryJob
  106617. * @description 单对象查询分析。
  106618. * @param {SingleObjectQueryJobsParameter} params - 单对象空间查询分析任务参数类。
  106619. * @param {RequestCallback} callback - 回调函数。
  106620. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  106621. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106622. */
  106623. }, {
  106624. key: "addQueryJob",
  106625. value: function addQueryJob(params, callback, seconds, resultFormat) {
  106626. params = this._processParams(params);
  106627. this._processingService.addQueryJob(params, callback, seconds, resultFormat);
  106628. }
  106629. /**
  106630. * @function ProcessingService.prototype.getQueryJobState
  106631. * @description 获取单对象查询分析的状态。
  106632. * @param {string} id - 单对象查询分析的 ID。
  106633. * @returns {Object} 单对象查询分析的状态。
  106634. */
  106635. }, {
  106636. key: "getQueryJobState",
  106637. value: function getQueryJobState(id) {
  106638. return this._processingService.getQueryJobState(id);
  106639. }
  106640. /**
  106641. * @function ProcessingService.prototype.getSummaryRegionJobs
  106642. * @description 获取区域汇总分析的列表。
  106643. * @param {RequestCallback} callback - 回调函数。
  106644. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106645. */
  106646. }, {
  106647. key: "getSummaryRegionJobs",
  106648. value: function getSummaryRegionJobs(callback, resultFormat) {
  106649. this._processingService.getSummaryRegionJobs(callback, resultFormat);
  106650. }
  106651. /**
  106652. * @function ProcessingService.prototype.getSummaryRegionJob
  106653. * @description 获取区域汇总分析。
  106654. * @param {string} id - 区域汇总分析的 ID。
  106655. * @param {RequestCallback} callback - 回调函数。
  106656. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106657. */
  106658. }, {
  106659. key: "getSummaryRegionJob",
  106660. value: function getSummaryRegionJob(id, callback, resultFormat) {
  106661. this._processingService.getSummaryRegionJob(id, callback, resultFormat);
  106662. }
  106663. /**
  106664. * @function ProcessingService.prototype.addSummaryRegionJob
  106665. * @description 区域汇总分析。
  106666. * @param {SummaryRegionJobParameter} params - 区域汇总分析任务参数类。
  106667. * @param {RequestCallback} callback - 回调函数。
  106668. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  106669. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106670. */
  106671. }, {
  106672. key: "addSummaryRegionJob",
  106673. value: function addSummaryRegionJob(params, callback, seconds, resultFormat) {
  106674. params = this._processParams(params);
  106675. this._processingService.addSummaryRegionJob(params, callback, seconds, resultFormat);
  106676. }
  106677. /**
  106678. * @function ProcessingService.prototype.getSummaryRegionJobState
  106679. * @description 获取区域汇总分析的状态。
  106680. * @param {string} id - 生成区域汇总分析的 ID。
  106681. * @returns {Object} 区域汇总分析的状态。
  106682. */
  106683. }, {
  106684. key: "getSummaryRegionJobState",
  106685. value: function getSummaryRegionJobState(id) {
  106686. return this._processingService.getSummaryRegionJobState(id);
  106687. }
  106688. /**
  106689. * @function ProcessingService.prototype.getVectorClipJobs
  106690. * @description 获取矢量裁剪分析的列表。
  106691. * @param {RequestCallback} callback 回调函数。
  106692. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106693. */
  106694. }, {
  106695. key: "getVectorClipJobs",
  106696. value: function getVectorClipJobs(callback, resultFormat) {
  106697. this._processingService.getVectorClipJobs(callback, resultFormat);
  106698. }
  106699. /**
  106700. * @function ProcessingService.prototype.getVectorClipJob
  106701. * @description 获取矢量裁剪分析。
  106702. * @param {string} id - 空间分析的 ID。
  106703. * @param {RequestCallback} callback 回调函数。
  106704. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106705. */
  106706. }, {
  106707. key: "getVectorClipJob",
  106708. value: function getVectorClipJob(id, callback, resultFormat) {
  106709. return this._processingService.getVectorClipJob(id, callback, resultFormat);
  106710. }
  106711. /**
  106712. * @function ProcessingService.prototype.addVectorClipJob
  106713. * @description 矢量裁剪分析。
  106714. * @param {VectorClipJobsParameter} params - 矢量裁剪分析任务参数类。
  106715. * @param {RequestCallback} callback 回调函数。
  106716. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  106717. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106718. */
  106719. }, {
  106720. key: "addVectorClipJob",
  106721. value: function addVectorClipJob(params, callback, seconds, resultFormat) {
  106722. params = this._processParams(params);
  106723. this._processingService.addVectorClipJob(params, callback, seconds, resultFormat);
  106724. }
  106725. /**
  106726. * @function ProcessingService.prototype.getVectorClipJobState
  106727. * @description 获取矢量裁剪分析的状态。
  106728. * @param {number} id - 矢量裁剪分析的 ID。
  106729. * @returns {Object} 矢量裁剪分析的状态。
  106730. */
  106731. }, {
  106732. key: "getVectorClipJobState",
  106733. value: function getVectorClipJobState(id) {
  106734. return this._processingService.getVectorClipJobState(id);
  106735. }
  106736. /**
  106737. * @function ProcessingService.prototype.getOverlayGeoJobs
  106738. * @description 获取叠加分析的列表。
  106739. * @param {RequestCallback} callback 回调函数。
  106740. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106741. */
  106742. }, {
  106743. key: "getOverlayGeoJobs",
  106744. value: function getOverlayGeoJobs(callback, resultFormat) {
  106745. this._processingService.getOverlayGeoJobs(callback, resultFormat);
  106746. }
  106747. /**
  106748. * @function ProcessingService.prototype.getOverlayGeoJob
  106749. * @description 获取叠加分析。
  106750. * @param {string} id - 空间分析的 ID。
  106751. * @param {RequestCallback} callback 回调函数。
  106752. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106753. */
  106754. }, {
  106755. key: "getOverlayGeoJob",
  106756. value: function getOverlayGeoJob(id, callback, resultFormat) {
  106757. this._processingService.getOverlayGeoJob(id, callback, resultFormat);
  106758. }
  106759. /**
  106760. * @function ProcessingService.prototype.addOverlayGeoJob
  106761. * @description 叠加分析。
  106762. * @param {OverlayGeoJobParameter} params - 叠加分析任务参数类。
  106763. * @param {RequestCallback} callback 回调函数。
  106764. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  106765. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106766. */
  106767. }, {
  106768. key: "addOverlayGeoJob",
  106769. value: function addOverlayGeoJob(params, callback, seconds, resultFormat) {
  106770. params = this._processParams(params);
  106771. this._processingService.addOverlayGeoJob(params, callback, seconds, resultFormat);
  106772. }
  106773. /**
  106774. * @function ProcessingService.prototype.getoverlayGeoJobState
  106775. * @description 获取叠加分析的状态。
  106776. * @param {string} id - 叠加分析的 ID。
  106777. * @returns {Object} 叠加分析的状态。
  106778. */
  106779. }, {
  106780. key: "getoverlayGeoJobState",
  106781. value: function getoverlayGeoJobState(id) {
  106782. return this._processingService.getoverlayGeoJobState(id);
  106783. }
  106784. /**
  106785. * @function ProcessingService.prototype.getBuffersJobs
  106786. * @description 获取缓冲区分析的列表。
  106787. * @param {RequestCallback} callback 回调函数。
  106788. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106789. */
  106790. }, {
  106791. key: "getBuffersJobs",
  106792. value: function getBuffersJobs(callback, resultFormat) {
  106793. this._processingService.getBuffersJobs(callback, resultFormat);
  106794. }
  106795. /**
  106796. * @function ProcessingService.prototype.getBuffersJob
  106797. * @description 获取缓冲区分析。
  106798. * @param {string} id - 空间分析的 ID。
  106799. * @param {RequestCallback} callback 回调函数。
  106800. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106801. */
  106802. }, {
  106803. key: "getBuffersJob",
  106804. value: function getBuffersJob(id, callback, resultFormat) {
  106805. this._processingService.getBuffersJob(id, callback, resultFormat);
  106806. }
  106807. /**
  106808. * @function ProcessingService.prototype.addBuffersJob
  106809. * @description 缓冲区分析。
  106810. * @param {BuffersAnalystJobsParameter} params - 缓冲区分析任务参数类。
  106811. * @param {RequestCallback} callback 回调函数。
  106812. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  106813. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106814. */
  106815. }, {
  106816. key: "addBuffersJob",
  106817. value: function addBuffersJob(params, callback, seconds, resultFormat) {
  106818. params = this._processParams(params);
  106819. this._processingService.addBuffersJob(params, callback, seconds, resultFormat);
  106820. }
  106821. /**
  106822. * @function ProcessingService.prototype.getBuffersJobState
  106823. * @description 获取缓冲区分析的状态。
  106824. * @param {string} id - 缓冲区分析的 ID。
  106825. * @returns {Object} 缓冲区分析的状态。
  106826. */
  106827. }, {
  106828. key: "getBuffersJobState",
  106829. value: function getBuffersJobState(id) {
  106830. return this._processingService.getBuffersJobState(id);
  106831. }
  106832. /**
  106833. * @function ProcessingService.prototype.getTopologyValidatorJobs
  106834. * @description 获取拓扑检查分析的列表。
  106835. * @param {RequestCallback} callback 回调函数。
  106836. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106837. */
  106838. }, {
  106839. key: "getTopologyValidatorJobs",
  106840. value: function getTopologyValidatorJobs(callback, resultFormat) {
  106841. this._processingService.getTopologyValidatorJobs(callback, resultFormat);
  106842. }
  106843. /**
  106844. * @function ProcessingService.prototype.getTopologyValidatorJob
  106845. * @description 获取拓扑检查分析。
  106846. * @param {string} id - 空间分析的 ID。
  106847. * @param {RequestCallback} callback - 回调函数。
  106848. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106849. */
  106850. }, {
  106851. key: "getTopologyValidatorJob",
  106852. value: function getTopologyValidatorJob(id, callback, resultFormat) {
  106853. this._processingService.getTopologyValidatorJob(id, callback, resultFormat);
  106854. }
  106855. /**
  106856. * @function ProcessingService.prototype.addTopologyValidatorJob
  106857. * @description 拓扑检查分析。
  106858. * @param {TopologyValidatorJobsParameter} params - 拓扑检查分析任务参数类。
  106859. * @param {RequestCallback} callback - 回调函数。
  106860. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  106861. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106862. */
  106863. }, {
  106864. key: "addTopologyValidatorJob",
  106865. value: function addTopologyValidatorJob(params, callback, seconds, resultFormat) {
  106866. params = this._processParams(params);
  106867. this._processingService.addTopologyValidatorJob(params, callback, seconds, resultFormat);
  106868. }
  106869. /**
  106870. * @function ProcessingService.prototype.getTopologyValidatorJobState
  106871. * @description 获取拓扑检查分析的状态。
  106872. * @param {string} id - 拓扑检查分析的 ID。
  106873. * @returns {Object} 拓扑检查分析的状态。
  106874. */
  106875. }, {
  106876. key: "getTopologyValidatorJobState",
  106877. value: function getTopologyValidatorJobState(id) {
  106878. return this._processingService.getTopologyValidatorJobState(id);
  106879. }
  106880. /**
  106881. * @function ProcessingService.prototype.getSummaryAttributesJobs
  106882. * @description 获取拓扑检查属性汇总分析的列表。
  106883. * @param {RequestCallback} callback - 回调函数。
  106884. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106885. */
  106886. }, {
  106887. key: "getSummaryAttributesJobs",
  106888. value: function getSummaryAttributesJobs(callback, resultFormat) {
  106889. this._processingService.getSummaryAttributesJobs(callback, resultFormat);
  106890. }
  106891. /**
  106892. * @function ProcessingService.prototype.getSummaryAttributesJob
  106893. * @description 获取属性汇总分析。
  106894. * @param {string} id - 空间分析的 ID。
  106895. * @param {RequestCallback} callback - 回调函数。
  106896. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106897. */
  106898. }, {
  106899. key: "getSummaryAttributesJob",
  106900. value: function getSummaryAttributesJob(id, callback, resultFormat) {
  106901. this._processingService.getSummaryAttributesJob(id, callback, resultFormat);
  106902. }
  106903. /**
  106904. * @function ProcessingService.prototype.addSummaryAttributesJob
  106905. * @description 属性汇总分析。
  106906. * @param {SummaryAttributesJobsParameter} params - 属性汇总分析任务参数类。
  106907. * @param {RequestCallback} callback - 回调函数。
  106908. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  106909. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106910. */
  106911. }, {
  106912. key: "addSummaryAttributesJob",
  106913. value: function addSummaryAttributesJob(params, callback, seconds, resultFormat) {
  106914. params = this._processParams(params);
  106915. this._processingService.addSummaryAttributesJob(params, callback, seconds, resultFormat);
  106916. }
  106917. /**
  106918. * @function ProcessingService.prototype.getSummaryAttributesJobState
  106919. * @description 获取属性汇总分析的状态。
  106920. * @param {string} id - 属性汇总分析的 ID。
  106921. * @returns {Object} 属性汇总分析的状态。
  106922. */
  106923. }, {
  106924. key: "getSummaryAttributesJobState",
  106925. value: function getSummaryAttributesJobState(id) {
  106926. return this._processingService.getSummaryAttributesJobState(id);
  106927. }
  106928. }, {
  106929. key: "_processFormat",
  106930. value: function _processFormat(resultFormat) {
  106931. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  106932. }
  106933. }, {
  106934. key: "_processParams",
  106935. value: function _processParams(params) {
  106936. if (!params) {
  106937. return {};
  106938. }
  106939. if (params.bounds) {
  106940. params.bounds = core_Util_Util.toSuperMapBounds(params.bounds);
  106941. }
  106942. if (params.query) {
  106943. params.query = core_Util_Util.toSuperMapBounds(params.query);
  106944. }
  106945. if (params.geometryQuery) {
  106946. params.geometryQuery = core_Util_Util.toProcessingParam(params.geometryQuery);
  106947. }
  106948. if (params.geometryClip) {
  106949. params.geometryClip = core_Util_Util.toProcessingParam(params.geometryClip);
  106950. }
  106951. return params;
  106952. }
  106953. }]);
  106954. return ProcessingService;
  106955. }(ServiceBase);
  106956. ;// CONCATENATED MODULE: ./src/common/iServer/SpatialAnalystService.js
  106957. function SpatialAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  106958. function SpatialAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  106959. function SpatialAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SpatialAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SpatialAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  106960. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  106961. * This program are made available under the terms of the Apache License, Version 2.0
  106962. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  106963. /**
  106964. * @class SpatialAnalystService
  106965. * @extends {ServiceBase}
  106966. * @category iServer SpatialAnalyst
  106967. * @classdesc 空间分析服务类。提供:地区太阳辐射、缓冲区分析、点密度分析、动态分段分析、空间关系分析、插值分析、栅格代数运算、叠加分析、路由定位、路由测量计算、表面分析、地形曲率计算、泰森多边形分析。
  106968. * @example
  106969. * new SpatialAnalystService(url).bufferAnalysis(params,function(result){
  106970. * //doSomething
  106971. * })
  106972. * @param {string} url - 服务地址。
  106973. * @param {Object} options - 参数。
  106974. * @param {string} [options.proxy] - 服务代理地址。
  106975. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  106976. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  106977. * @param {Object} [options.headers] - 请求头。
  106978. * @usage
  106979. */
  106980. var SpatialAnalystService_SpatialAnalystService = /*#__PURE__*/function () {
  106981. function SpatialAnalystService(url, options) {
  106982. SpatialAnalystService_classCallCheck(this, SpatialAnalystService);
  106983. this.url = url;
  106984. this.options = options || {};
  106985. }
  106986. /**
  106987. * @function SpatialAnalystService.prototype.getAreaSolarRadiationResult
  106988. * @description 地区太阳辐射。
  106989. * @param {AreaSolarRadiationParameters} params - 地区太阳辐射参数类。
  106990. * @param {RequestCallback} callback 回调函数。
  106991. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  106992. */
  106993. SpatialAnalystService_createClass(SpatialAnalystService, [{
  106994. key: "getAreaSolarRadiationResult",
  106995. value: function getAreaSolarRadiationResult(params, callback, resultFormat) {
  106996. var me = this;
  106997. var areaSolarRadiationService = new AreaSolarRadiationService(me.url, {
  106998. proxy: me.options.proxy,
  106999. withCredentials: me.options.withCredentials,
  107000. crossOrigin: me.options.crossOrigin,
  107001. headers: me.options.headers,
  107002. eventListeners: {
  107003. scope: me,
  107004. processCompleted: callback,
  107005. processFailed: callback
  107006. },
  107007. format: me._processFormat(resultFormat)
  107008. });
  107009. areaSolarRadiationService.processAsync(params);
  107010. }
  107011. /**
  107012. * @function SpatialAnalystService.prototype.bufferAnalysis
  107013. * @description 缓冲区分析。
  107014. * @param {DatasetBufferAnalystParameters} params - 数据集缓冲区分析参数类。
  107015. * @param {RequestCallback} callback 回调函数。
  107016. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107017. */
  107018. }, {
  107019. key: "bufferAnalysis",
  107020. value: function bufferAnalysis(params, callback, resultFormat) {
  107021. var me = this;
  107022. var bufferAnalystService = new BufferAnalystService(me.url, {
  107023. proxy: me.options.proxy,
  107024. withCredentials: me.options.withCredentials,
  107025. crossOrigin: me.options.crossOrigin,
  107026. headers: me.options.headers,
  107027. eventListeners: {
  107028. scope: me,
  107029. processCompleted: callback,
  107030. processFailed: callback
  107031. },
  107032. format: me._processFormat(resultFormat)
  107033. });
  107034. bufferAnalystService.processAsync(params);
  107035. }
  107036. /**
  107037. * @function SpatialAnalystService.prototype.densityAnalysis
  107038. * @description 点密度分析。
  107039. * @param {DensityKernelAnalystParameters} params - 核密度分析参数类。
  107040. * @param {RequestCallback} callback 回调函数。
  107041. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107042. */
  107043. }, {
  107044. key: "densityAnalysis",
  107045. value: function densityAnalysis(params, callback, resultFormat) {
  107046. var me = this;
  107047. var densityAnalystService = new DensityAnalystService(me.url, {
  107048. proxy: me.options.proxy,
  107049. withCredentials: me.options.withCredentials,
  107050. crossOrigin: me.options.crossOrigin,
  107051. headers: me.options.headers,
  107052. eventListeners: {
  107053. scope: me,
  107054. processCompleted: callback,
  107055. processFailed: callback
  107056. },
  107057. format: me._processFormat(resultFormat)
  107058. });
  107059. densityAnalystService.processAsync(params);
  107060. }
  107061. /**
  107062. * @function SpatialAnalystService.prototype.generateSpatialData
  107063. * @description 动态分段分析。
  107064. * @param {GenerateSpatialDataParameters} params - 动态分段操作参数类。
  107065. * @param {RequestCallback} callback 回调函数。
  107066. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107067. */
  107068. }, {
  107069. key: "generateSpatialData",
  107070. value: function generateSpatialData(params, callback, resultFormat) {
  107071. var me = this;
  107072. var generateSpatialDataService = new GenerateSpatialDataService(me.url, {
  107073. proxy: me.options.proxy,
  107074. withCredentials: me.options.withCredentials,
  107075. crossOrigin: me.options.crossOrigin,
  107076. headers: me.options.headers,
  107077. eventListeners: {
  107078. scope: me,
  107079. processCompleted: callback,
  107080. processFailed: callback
  107081. },
  107082. format: me._processFormat(resultFormat)
  107083. });
  107084. generateSpatialDataService.processAsync(params);
  107085. }
  107086. /**
  107087. * @function SpatialAnalystService.prototype.geoRelationAnalysis
  107088. * @description 空间关系分析。
  107089. * @param {GeoRelationAnalystParameters} params - 空间关系分析服务参数类。
  107090. * @param {RequestCallback} callback 回调函数。
  107091. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107092. */
  107093. }, {
  107094. key: "geoRelationAnalysis",
  107095. value: function geoRelationAnalysis(params, callback, resultFormat) {
  107096. var me = this;
  107097. var geoRelationAnalystService = new GeoRelationAnalystService(me.url, {
  107098. proxy: me.options.proxy,
  107099. withCredentials: me.options.withCredentials,
  107100. crossOrigin: me.options.crossOrigin,
  107101. headers: me.options.headers,
  107102. eventListeners: {
  107103. scope: me,
  107104. processCompleted: callback,
  107105. processFailed: callback
  107106. },
  107107. format: me._processFormat(resultFormat)
  107108. });
  107109. geoRelationAnalystService.processAsync(params);
  107110. }
  107111. /**
  107112. * @function SpatialAnalystService.prototype.interpolationAnalysis
  107113. * @description 插值分析。
  107114. * @param {InterpolationRBFAnalystParameters|InterpolationDensityAnalystParameters|InterpolationIDWAnalystParameters|InterpolationKrigingAnalystParameters} params - 样条插值分析参数类。
  107115. * @param {RequestCallback} callback 回调函数。
  107116. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107117. */
  107118. }, {
  107119. key: "interpolationAnalysis",
  107120. value: function interpolationAnalysis(params, callback, resultFormat) {
  107121. var me = this;
  107122. var interpolationAnalystService = new InterpolationAnalystService(me.url, {
  107123. proxy: me.options.proxy,
  107124. withCredentials: me.options.withCredentials,
  107125. crossOrigin: me.options.crossOrigin,
  107126. headers: me.options.headers,
  107127. eventListeners: {
  107128. scope: me,
  107129. processCompleted: callback,
  107130. processFailed: callback
  107131. },
  107132. format: me._processFormat(resultFormat)
  107133. });
  107134. interpolationAnalystService.processAsync(params);
  107135. }
  107136. /**
  107137. * @function SpatialAnalystService.prototype.mathExpressionAnalysis
  107138. * @description 栅格代数运算。
  107139. * @param {MathExpressionAnalysisParameters} params - 栅格代数运算参数类。
  107140. * @param {RequestCallback} callback 回调函数。
  107141. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107142. */
  107143. }, {
  107144. key: "mathExpressionAnalysis",
  107145. value: function mathExpressionAnalysis(params, callback, resultFormat) {
  107146. var me = this;
  107147. var mathExpressionAnalysisService = new MathExpressionAnalysisService(me.url, {
  107148. proxy: me.options.proxy,
  107149. withCredentials: me.options.withCredentials,
  107150. crossOrigin: me.options.crossOrigin,
  107151. headers: me.options.headers,
  107152. eventListeners: {
  107153. scope: me,
  107154. processCompleted: callback,
  107155. processFailed: callback
  107156. },
  107157. format: me._processFormat(resultFormat)
  107158. });
  107159. mathExpressionAnalysisService.processAsync(params);
  107160. }
  107161. /**
  107162. * @function SpatialAnalystService.prototype.overlayAnalysis
  107163. * @description 叠加分析。
  107164. * @param {DatasetOverlayAnalystParameters|GeometryOverlayAnalystParameters} params - 数据集叠加分析参数类或几何对象叠加分析参数类。
  107165. * @param {RequestCallback} callback 回调函数。
  107166. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107167. */
  107168. }, {
  107169. key: "overlayAnalysis",
  107170. value: function overlayAnalysis(params, callback, resultFormat) {
  107171. var me = this;
  107172. var overlayAnalystService = new OverlayAnalystService(me.url, {
  107173. proxy: me.options.proxy,
  107174. withCredentials: me.options.withCredentials,
  107175. crossOrigin: me.options.crossOrigin,
  107176. headers: me.options.headers,
  107177. eventListeners: {
  107178. scope: me,
  107179. processCompleted: callback,
  107180. processFailed: callback
  107181. },
  107182. format: me._processFormat(resultFormat)
  107183. });
  107184. overlayAnalystService.processAsync(params);
  107185. }
  107186. /**
  107187. * @function SpatialAnalystService.prototype.routeCalculateMeasure
  107188. * @description 路由测量计算。
  107189. * @param {RouteCalculateMeasureParameters} params - 基于路由对象计算指定点 M 值操作的参数类。
  107190. * @param {RequestCallback} callback 回调函数。
  107191. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107192. */
  107193. }, {
  107194. key: "routeCalculateMeasure",
  107195. value: function routeCalculateMeasure(params, callback, resultFormat) {
  107196. var me = this;
  107197. var routeCalculateMeasureService = new RouteCalculateMeasureService(me.url, {
  107198. proxy: me.options.proxy,
  107199. withCredentials: me.options.withCredentials,
  107200. crossOrigin: me.options.crossOrigin,
  107201. headers: me.options.headers,
  107202. eventListeners: {
  107203. scope: me,
  107204. processCompleted: callback,
  107205. processFailed: callback
  107206. },
  107207. format: me._processFormat(resultFormat)
  107208. });
  107209. routeCalculateMeasureService.processAsync(params);
  107210. }
  107211. /**
  107212. * @function SpatialAnalystService.prototype.routeLocate
  107213. * @description 路由定位。
  107214. * @param {RouteLocatorParameters} params - 路由对象定位空间对象的参数类。
  107215. * @param {RequestCallback} callback 回调函数。
  107216. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107217. */
  107218. }, {
  107219. key: "routeLocate",
  107220. value: function routeLocate(params, callback, resultFormat) {
  107221. var me = this;
  107222. var routeLocatorService = new RouteLocatorService(me.url, {
  107223. proxy: me.options.proxy,
  107224. withCredentials: me.options.withCredentials,
  107225. crossOrigin: me.options.crossOrigin,
  107226. headers: me.options.headers,
  107227. eventListeners: {
  107228. scope: me,
  107229. processCompleted: callback,
  107230. processFailed: callback
  107231. },
  107232. format: me._processFormat(resultFormat)
  107233. });
  107234. routeLocatorService.processAsync(params);
  107235. }
  107236. /**
  107237. * @function SpatialAnalystService.prototype.surfaceAnalysis
  107238. * @description 表面分析。
  107239. * @param {SurfaceAnalystParameters} params - 表面分析提取操作参数类。
  107240. * @param {RequestCallback} callback 回调函数。
  107241. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107242. */
  107243. }, {
  107244. key: "surfaceAnalysis",
  107245. value: function surfaceAnalysis(params, callback, resultFormat) {
  107246. var me = this;
  107247. var surfaceAnalystService = new SurfaceAnalystService(me.url, {
  107248. proxy: me.options.proxy,
  107249. withCredentials: me.options.withCredentials,
  107250. crossOrigin: me.options.crossOrigin,
  107251. headers: me.options.headers,
  107252. eventListeners: {
  107253. scope: me,
  107254. processCompleted: callback,
  107255. processFailed: callback
  107256. },
  107257. format: me._processFormat(resultFormat)
  107258. });
  107259. surfaceAnalystService.processAsync(params);
  107260. }
  107261. /**
  107262. * @function SpatialAnalystService.prototype.terrainCurvatureCalculate
  107263. * @description 地形曲率计算。
  107264. * @param {TerrainCurvatureCalculationParameters} params - 地形曲率计算参数类。
  107265. * @param {RequestCallback} callback 回调函数。
  107266. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107267. */
  107268. }, {
  107269. key: "terrainCurvatureCalculate",
  107270. value: function terrainCurvatureCalculate(params, callback, resultFormat) {
  107271. var me = this;
  107272. var terrainCurvatureCalculationService = new TerrainCurvatureCalculationService(me.url, {
  107273. proxy: me.options.proxy,
  107274. withCredentials: me.options.withCredentials,
  107275. crossOrigin: me.options.crossOrigin,
  107276. headers: me.options.headers,
  107277. eventListeners: {
  107278. scope: me,
  107279. processCompleted: callback,
  107280. processFailed: callback
  107281. },
  107282. format: me._processFormat(resultFormat)
  107283. });
  107284. terrainCurvatureCalculationService.processAsync(params);
  107285. }
  107286. /**
  107287. * @function SpatialAnalystService.prototype.thiessenAnalysis
  107288. * @description 泰森多边形分析。
  107289. * @param {DatasetThiessenAnalystParameters|GeometryThiessenAnalystParameters} params - 数据集泰森多边形分析参数类。
  107290. * @param {RequestCallback} callback 回调函数。
  107291. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107292. */
  107293. }, {
  107294. key: "thiessenAnalysis",
  107295. value: function thiessenAnalysis(params, callback, resultFormat) {
  107296. var me = this;
  107297. var thiessenAnalystService = new ThiessenAnalystService(me.url, {
  107298. proxy: me.options.proxy,
  107299. withCredentials: me.options.withCredentials,
  107300. crossOrigin: me.options.crossOrigin,
  107301. headers: me.options.headers,
  107302. eventListeners: {
  107303. scope: me,
  107304. processCompleted: callback,
  107305. processFailed: callback
  107306. },
  107307. format: me._processFormat(resultFormat)
  107308. });
  107309. thiessenAnalystService.processAsync(params);
  107310. }
  107311. /**
  107312. * @function SpatialAnalystService.prototype.geometrybatchAnalysis
  107313. * @description 批量空间分析。
  107314. * @param {Array.<Object>} params - 批量分析参数对象数组。
  107315. * @param {Array.<Object>} params.analystName - 空间分析方法的名称。包括:</br>
  107316. * "buffer","overlay","interpolationDensity","interpolationidw","interpolationRBF","interpolationKriging","isoregion","isoline"。
  107317. * @param {Object} params.param - 空间分析类型对应的请求参数,包括:</br>
  107318. * {@link GeometryBufferAnalystParameters} 缓冲区分析参数类。</br>
  107319. * {@link GeometryOverlayAnalystParameters} 叠加分析参数类。</br>
  107320. * {@link InterpolationAnalystParameters} 插值分析参数类。</br>
  107321. * {@link SurfaceAnalystParameters} 表面分析参数类。</br>
  107322. * @param {RequestCallback} callback - 回调函数。
  107323. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107324. */
  107325. }, {
  107326. key: "geometrybatchAnalysis",
  107327. value: function geometrybatchAnalysis(params, callback, resultFormat) {
  107328. var me = this;
  107329. var geometryBatchAnalystService = new GeometryBatchAnalystService(me.url, {
  107330. eventListeners: {
  107331. scope: me,
  107332. processCompleted: callback,
  107333. processFailed: callback
  107334. },
  107335. format: me._processFormat(resultFormat)
  107336. });
  107337. //处理批量分析中各个分类类型的参数:
  107338. var analystParameters = [];
  107339. for (var i = 0; i < params.length; i++) {
  107340. var tempParameter = params[i];
  107341. analystParameters.push({
  107342. analystName: tempParameter.analystName,
  107343. param: tempParameter.param
  107344. });
  107345. }
  107346. geometryBatchAnalystService.processAsync(analystParameters);
  107347. }
  107348. }, {
  107349. key: "_processFormat",
  107350. value: function _processFormat(resultFormat) {
  107351. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  107352. }
  107353. }]);
  107354. return SpatialAnalystService;
  107355. }();
  107356. ;// CONCATENATED MODULE: ./src/openlayers/services/SpatialAnalystService.js
  107357. function SpatialAnalystService_typeof(obj) { "@babel/helpers - typeof"; return SpatialAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, SpatialAnalystService_typeof(obj); }
  107358. function services_SpatialAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  107359. function services_SpatialAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  107360. function services_SpatialAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_SpatialAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_SpatialAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  107361. function SpatialAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) SpatialAnalystService_setPrototypeOf(subClass, superClass); }
  107362. function SpatialAnalystService_setPrototypeOf(o, p) { SpatialAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SpatialAnalystService_setPrototypeOf(o, p); }
  107363. function SpatialAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = SpatialAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SpatialAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SpatialAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SpatialAnalystService_possibleConstructorReturn(this, result); }; }
  107364. function SpatialAnalystService_possibleConstructorReturn(self, call) { if (call && (SpatialAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return SpatialAnalystService_assertThisInitialized(self); }
  107365. function SpatialAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  107366. function SpatialAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  107367. function SpatialAnalystService_getPrototypeOf(o) { SpatialAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SpatialAnalystService_getPrototypeOf(o); }
  107368. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  107369. * This program are made available under the terms of the Apache License, Version 2.0
  107370. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  107371. /**
  107372. * @class SpatialAnalystService
  107373. * @extends {ServiceBase}
  107374. * @category iServer SpatialAnalyst
  107375. * @classdesc 空间分析服务类。提供:地区太阳辐射、缓冲区分析、点密度分析、动态分段分析、空间关系分析、插值分析、栅格代数运算、叠加分析、路由定位、路由测量计算、表面分析、地形曲率计算、泰森多边形分析。
  107376. * @modulecategory Services
  107377. * @example
  107378. * new SpatialAnalystService(url).bufferAnalysis(params,function(result){
  107379. * //doSomething
  107380. * })
  107381. * @param {string} url - 服务地址。
  107382. * @param {Object} options - 参数。
  107383. * @param {string} [options.proxy] - 服务代理地址。
  107384. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  107385. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  107386. * @param {Object} [options.headers] - 请求头。
  107387. * @usage
  107388. */
  107389. var SpatialAnalystService = /*#__PURE__*/function (_ServiceBase) {
  107390. SpatialAnalystService_inherits(SpatialAnalystService, _ServiceBase);
  107391. var _super = SpatialAnalystService_createSuper(SpatialAnalystService);
  107392. function SpatialAnalystService(url, options) {
  107393. var _this;
  107394. services_SpatialAnalystService_classCallCheck(this, SpatialAnalystService);
  107395. _this = _super.call(this, url, options);
  107396. _this._spatialAnalystService = new SpatialAnalystService_SpatialAnalystService(url, options);
  107397. return _this;
  107398. }
  107399. /**
  107400. * @function SpatialAnalystService.prototype.getAreaSolarRadiationResult
  107401. * @description 地区太阳辐射。
  107402. * @param {AreaSolarRadiationParameters} params - 地区太阳辐射参数类。
  107403. * @param {RequestCallback} callback 回调函数。
  107404. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107405. */
  107406. services_SpatialAnalystService_createClass(SpatialAnalystService, [{
  107407. key: "getAreaSolarRadiationResult",
  107408. value: function getAreaSolarRadiationResult(params, callback, resultFormat) {
  107409. this._spatialAnalystService.getAreaSolarRadiationResult(params, callback, resultFormat);
  107410. }
  107411. /**
  107412. * @function SpatialAnalystService.prototype.bufferAnalysis
  107413. * @description 缓冲区分析。
  107414. * @param {DatasetBufferAnalystParameters} params - 数据集缓冲区分析参数类。
  107415. * @param {RequestCallback} callback 回调函数。
  107416. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107417. */
  107418. }, {
  107419. key: "bufferAnalysis",
  107420. value: function bufferAnalysis(params, callback, resultFormat) {
  107421. params = this._processParams(params);
  107422. this._spatialAnalystService.bufferAnalysis(params, callback, resultFormat);
  107423. }
  107424. /**
  107425. * @function SpatialAnalystService.prototype.densityAnalysis
  107426. * @description 点密度分析。
  107427. * @param {DensityKernelAnalystParameters} params - 核密度分析参数类。
  107428. * @param {RequestCallback} callback 回调函数。
  107429. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107430. */
  107431. }, {
  107432. key: "densityAnalysis",
  107433. value: function densityAnalysis(params, callback, resultFormat) {
  107434. params = this._processParams(params);
  107435. this._spatialAnalystService.densityAnalysis(params, callback, resultFormat);
  107436. }
  107437. /**
  107438. * @function SpatialAnalystService.prototype.generateSpatialData
  107439. * @description 动态分段分析。
  107440. * @param {GenerateSpatialDataParameters} params - 动态分段操作参数类。
  107441. * @param {RequestCallback} callback 回调函数。
  107442. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107443. */
  107444. }, {
  107445. key: "generateSpatialData",
  107446. value: function generateSpatialData(params, callback, resultFormat) {
  107447. this._spatialAnalystService.generateSpatialData(params, callback, resultFormat);
  107448. }
  107449. /**
  107450. * @function SpatialAnalystService.prototype.geoRelationAnalysis
  107451. * @description 空间关系分析。
  107452. * @param {GeoRelationAnalystParameters} params - 空间关系分析服务参数类。
  107453. * @param {RequestCallback} callback 回调函数。
  107454. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107455. */
  107456. }, {
  107457. key: "geoRelationAnalysis",
  107458. value: function geoRelationAnalysis(params, callback, resultFormat) {
  107459. params = this._processParams(params);
  107460. this._spatialAnalystService.geoRelationAnalysis(params, callback, resultFormat);
  107461. }
  107462. /**
  107463. * @function SpatialAnalystService.prototype.interpolationAnalysis
  107464. * @description 插值分析。
  107465. * @param {InterpolationRBFAnalystParameters|InterpolationDensityAnalystParameters|InterpolationIDWAnalystParameters|InterpolationKrigingAnalystParameters} params - 样条插值分析参数类。
  107466. * @param {RequestCallback} callback 回调函数。
  107467. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107468. */
  107469. }, {
  107470. key: "interpolationAnalysis",
  107471. value: function interpolationAnalysis(params, callback, resultFormat) {
  107472. params = this._processParams(params);
  107473. this._spatialAnalystService.interpolationAnalysis(params, callback, resultFormat);
  107474. }
  107475. /**
  107476. * @function SpatialAnalystService.prototype.mathExpressionAnalysis
  107477. * @description 栅格代数运算。
  107478. * @param {MathExpressionAnalysisParameters} params - 栅格代数运算参数类。
  107479. * @param {RequestCallback} callback 回调函数。
  107480. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107481. */
  107482. }, {
  107483. key: "mathExpressionAnalysis",
  107484. value: function mathExpressionAnalysis(params, callback, resultFormat) {
  107485. params = this._processParams(params);
  107486. this._spatialAnalystService.mathExpressionAnalysis(params, callback, resultFormat);
  107487. }
  107488. /**
  107489. * @function SpatialAnalystService.prototype.overlayAnalysis
  107490. * @description 叠加分析。
  107491. * @param {DatasetOverlayAnalystParameters|GeometryOverlayAnalystParameters} params - 数据集叠加分析参数类或几何对象叠加分析参数类。
  107492. * @param {RequestCallback} callback 回调函数。
  107493. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107494. */
  107495. }, {
  107496. key: "overlayAnalysis",
  107497. value: function overlayAnalysis(params, callback, resultFormat) {
  107498. params = this._processParams(params);
  107499. this._spatialAnalystService.overlayAnalysis(params, callback, resultFormat);
  107500. }
  107501. /**
  107502. * @function SpatialAnalystService.prototype.routeCalculateMeasure
  107503. * @description 路由测量计算。
  107504. * @param {RouteCalculateMeasureParameters} params - 基于路由对象计算指定点 M 值操作的参数类。
  107505. * @param {RequestCallback} callback 回调函数。
  107506. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107507. */
  107508. }, {
  107509. key: "routeCalculateMeasure",
  107510. value: function routeCalculateMeasure(params, callback, resultFormat) {
  107511. params = this._processParams(params);
  107512. this._spatialAnalystService.routeCalculateMeasure(params, callback, resultFormat);
  107513. }
  107514. /**
  107515. * @function SpatialAnalystService.prototype.routeLocate
  107516. * @description 路由定位。
  107517. * @param {RouteLocatorParameters} params - 路由对象定位空间对象的参数类。
  107518. * @param {RequestCallback} callback 回调函数。
  107519. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107520. */
  107521. }, {
  107522. key: "routeLocate",
  107523. value: function routeLocate(params, callback, resultFormat) {
  107524. params = this._processParams(params);
  107525. this._spatialAnalystService.routeLocate(params, callback, resultFormat);
  107526. }
  107527. /**
  107528. * @function SpatialAnalystService.prototype.surfaceAnalysis
  107529. * @description 表面分析。
  107530. * @param {SurfaceAnalystParameters} params - 表面分析提取操作参数类。
  107531. * @param {RequestCallback} callback 回调函数。
  107532. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107533. */
  107534. }, {
  107535. key: "surfaceAnalysis",
  107536. value: function surfaceAnalysis(params, callback, resultFormat) {
  107537. params = this._processParams(params);
  107538. this._spatialAnalystService.surfaceAnalysis(params, callback, resultFormat);
  107539. }
  107540. /**
  107541. * @function SpatialAnalystService.prototype.terrainCurvatureCalculate
  107542. * @description 地形曲率计算。
  107543. * @param {TerrainCurvatureCalculationParameters} params - 地形曲率计算参数类。
  107544. * @param {RequestCallback} callback 回调函数。
  107545. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107546. */
  107547. }, {
  107548. key: "terrainCurvatureCalculate",
  107549. value: function terrainCurvatureCalculate(params, callback, resultFormat) {
  107550. this._spatialAnalystService.terrainCurvatureCalculate(params, callback, resultFormat);
  107551. }
  107552. /**
  107553. * @function SpatialAnalystService.prototype.thiessenAnalysis
  107554. * @description 泰森多边形分析。
  107555. * @param {DatasetThiessenAnalystParameters|GeometryThiessenAnalystParameters} params - 数据集泰森多边形分析参数类。
  107556. * @param {RequestCallback} callback 回调函数。
  107557. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107558. */
  107559. }, {
  107560. key: "thiessenAnalysis",
  107561. value: function thiessenAnalysis(params, callback, resultFormat) {
  107562. params = this._processParams(params);
  107563. this._spatialAnalystService.thiessenAnalysis(params, callback, resultFormat);
  107564. }
  107565. /**
  107566. * @function SpatialAnalystService.prototype.geometrybatchAnalysis
  107567. * @description 批量空间分析。
  107568. * @param {Array.<Object>} params - 批量分析参数对象数组。
  107569. * @param {Array.<Object>} params.analystName - 空间分析方法的名称。包括:</br>
  107570. * "buffer","overlay","interpolationDensity","interpolationidw","interpolationRBF","interpolationKriging","isoregion","isoline"。
  107571. * @param {Object} params.param - 空间分析类型对应的请求参数,包括:</br>
  107572. * {@link GeometryBufferAnalystParameters} 缓冲区分析参数类。</br>
  107573. * {@link GeometryOverlayAnalystParameters} 叠加分析参数类。</br>
  107574. * {@link InterpolationAnalystParameters} 插值分析参数类。</br>
  107575. * {@link SurfaceAnalystParameters} 表面分析参数类。</br>
  107576. * @param {RequestCallback} callback - 回调函数。
  107577. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  107578. */
  107579. }, {
  107580. key: "geometrybatchAnalysis",
  107581. value: function geometrybatchAnalysis(params, callback, resultFormat) {
  107582. for (var i = 0; i < params.length; i++) {
  107583. params[i].param = this._processParams(params[i].param);
  107584. }
  107585. this._spatialAnalystService.geometrybatchAnalysis(params, callback, resultFormat);
  107586. }
  107587. }, {
  107588. key: "_processParams",
  107589. value: function _processParams(params) {
  107590. if (!params) {
  107591. return {};
  107592. }
  107593. if (params.bounds) {
  107594. params.bounds = core_Util_Util.toSuperMapBounds(params.bounds);
  107595. }
  107596. if (params.inputPoints) {
  107597. for (var i = 0; i < params.inputPoints.length; i++) {
  107598. var inputPoint = params.inputPoints[i];
  107599. if (core_Util_Util.isArray(inputPoint)) {
  107600. params.inputPoints[i] = {
  107601. x: inputPoint[0],
  107602. y: inputPoint[1],
  107603. tag: inputPoint[2]
  107604. };
  107605. } else {
  107606. params.inputPoints[i] = {
  107607. x: inputPoint.getCoordinates()[0],
  107608. y: inputPoint.getCoordinates()[1],
  107609. tag: inputPoint.tag
  107610. };
  107611. }
  107612. }
  107613. }
  107614. if (params.points) {
  107615. for (var _i2 = 0; _i2 < params.points.length; _i2++) {
  107616. var point = params.points[_i2];
  107617. if (core_Util_Util.isArray(point)) {
  107618. point.setCoordinates(point);
  107619. }
  107620. params.points[_i2] = new Point(point.getCoordinates()[0], point.getCoordinates()[1]);
  107621. }
  107622. }
  107623. if (params.point) {
  107624. var _point = params.point;
  107625. if (core_Util_Util.isArray(_point)) {
  107626. _point.setCoordinates(_point);
  107627. }
  107628. params.point = new Point(_point.getCoordinates()[0], _point.getCoordinates()[1]);
  107629. }
  107630. if (params.extractRegion) {
  107631. params.extractRegion = this.convertGeometry(params.extractRegion);
  107632. }
  107633. if (params.extractParameter && params.extractParameter.clipRegion) {
  107634. params.extractParameter.clipRegion = this.convertGeometry(params.extractParameter.clipRegion);
  107635. }
  107636. if (params.clipParam && params.clipParam.clipRegion) {
  107637. params.clipParam.clipRegion = this.convertGeometry(params.clipParam.clipRegion);
  107638. }
  107639. //支持格式:Vector Layers; GeoJson
  107640. if (params.sourceGeometry) {
  107641. var SRID = null;
  107642. if (params.sourceGeometrySRID) {
  107643. SRID = params.sourceGeometrySRID;
  107644. }
  107645. params.sourceGeometry = this.convertGeometry(params.sourceGeometry);
  107646. if (SRID) {
  107647. params.sourceGeometry.SRID = SRID;
  107648. }
  107649. delete params.sourceGeometry.sourceGeometrySRID;
  107650. }
  107651. if (params.operateGeometry) {
  107652. params.operateGeometry = this.convertGeometry(params.operateGeometry);
  107653. }
  107654. //支持传入多个几何要素进行叠加分析:
  107655. if (params.sourceGeometries) {
  107656. var sourceGeometries = [];
  107657. for (var k = 0; k < params.sourceGeometries.length; k++) {
  107658. sourceGeometries.push(this.convertGeometry(params.sourceGeometries[k]));
  107659. }
  107660. params.sourceGeometries = sourceGeometries;
  107661. }
  107662. //支持传入多个几何要素进行叠加分析:
  107663. if (params.operateGeometries) {
  107664. var operateGeometries = [];
  107665. for (var j = 0; j < params.operateGeometries.length; j++) {
  107666. operateGeometries.push(this.convertGeometry(params.operateGeometries[j]));
  107667. }
  107668. params.operateGeometries = operateGeometries;
  107669. }
  107670. if (params.sourceRoute) {
  107671. if (params.sourceRoute instanceof (external_ol_geom_LineString_default()) && params.sourceRoute.getCoordinates()) {
  107672. var target = {};
  107673. target.type = "LINEM";
  107674. target.parts = [params.sourceRoute.getCoordinates()[0].length];
  107675. target.points = [];
  107676. for (var _i4 = 0; _i4 < params.sourceRoute.getCoordinates()[0].length; _i4++) {
  107677. var _point2 = params.sourceRoute.getCoordinates()[0][_i4];
  107678. target.points = target.points.concat({
  107679. x: _point2[0],
  107680. y: _point2[1],
  107681. measure: _point2[2]
  107682. });
  107683. }
  107684. params.sourceRoute = target;
  107685. }
  107686. }
  107687. var me = this;
  107688. if (params.operateRegions && core_Util_Util.isArray(params.operateRegions)) {
  107689. params.operateRegions.map(function (geometry, key) {
  107690. params.operateRegions[key] = me.convertGeometry(geometry);
  107691. return params.operateRegions[key];
  107692. });
  107693. }
  107694. if (params.sourceRoute && params.sourceRoute.components && core_Util_Util.isArray(params.sourceRoute.components)) {
  107695. params.sourceRoute.components.map(function (geometry, key) {
  107696. params.sourceRoute.components[key] = me.convertGeometry(geometry);
  107697. return params.sourceRoute.components[key];
  107698. });
  107699. }
  107700. return params;
  107701. }
  107702. }, {
  107703. key: "_processFormat",
  107704. value: function _processFormat(resultFormat) {
  107705. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  107706. }
  107707. /**
  107708. * @private
  107709. * @function SpatialAnalystService.prototype.convertGeometry
  107710. * @description 转换几何对象。
  107711. * @param {Object} ol3Geometry - 待转换的几何对象。
  107712. */
  107713. }, {
  107714. key: "convertGeometry",
  107715. value: function convertGeometry(ol3Geometry) {
  107716. //判断是否传入的是geojson 并作相应处理
  107717. if (["FeatureCollection", "Feature", "Geometry"].indexOf(ol3Geometry.type) != -1) {
  107718. return core_Util_Util.toSuperMapGeometry(ol3Geometry);
  107719. }
  107720. return core_Util_Util.toSuperMapGeometry(JSON.parse(new (external_ol_format_GeoJSON_default())().writeGeometry(ol3Geometry)));
  107721. }
  107722. }]);
  107723. return SpatialAnalystService;
  107724. }(ServiceBase);
  107725. ;// CONCATENATED MODULE: ./src/openlayers/services/ThemeService.js
  107726. function services_ThemeService_typeof(obj) { "@babel/helpers - typeof"; return services_ThemeService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, services_ThemeService_typeof(obj); }
  107727. function services_ThemeService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  107728. function services_ThemeService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  107729. function services_ThemeService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_ThemeService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_ThemeService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  107730. function services_ThemeService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) services_ThemeService_setPrototypeOf(subClass, superClass); }
  107731. function services_ThemeService_setPrototypeOf(o, p) { services_ThemeService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_ThemeService_setPrototypeOf(o, p); }
  107732. function services_ThemeService_createSuper(Derived) { var hasNativeReflectConstruct = services_ThemeService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_ThemeService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_ThemeService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_ThemeService_possibleConstructorReturn(this, result); }; }
  107733. function services_ThemeService_possibleConstructorReturn(self, call) { if (call && (services_ThemeService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return services_ThemeService_assertThisInitialized(self); }
  107734. function services_ThemeService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  107735. function services_ThemeService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  107736. function services_ThemeService_getPrototypeOf(o) { services_ThemeService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_ThemeService_getPrototypeOf(o); }
  107737. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  107738. * This program are made available under the terms of the Apache License, Version 2.0
  107739. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  107740. /**
  107741. * @class ThemeService
  107742. * @category iServer Map Theme
  107743. * @classdesc 专题图服务类。
  107744. * @modulecategory Services
  107745. * @extends {ServiceBase}
  107746. * @example
  107747. * new ThemeService(url,{
  107748. * projection:projection
  107749. * }).getThemeInfo(params,function(result){
  107750. * //doSomething
  107751. * });
  107752. * @param {string} url - 服务地址。
  107753. * @param {Object} options - 参数。
  107754. * @param {string} [options.proxy] - 服务代理地址。
  107755. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  107756. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  107757. * @param {Object} [options.headers] - 请求头。
  107758. * @usage
  107759. */
  107760. var ThemeService = /*#__PURE__*/function (_ServiceBase) {
  107761. services_ThemeService_inherits(ThemeService, _ServiceBase);
  107762. var _super = services_ThemeService_createSuper(ThemeService);
  107763. function ThemeService(url, options) {
  107764. var _this;
  107765. services_ThemeService_classCallCheck(this, ThemeService);
  107766. _this = _super.call(this, url, options);
  107767. var me = services_ThemeService_assertThisInitialized(_this);
  107768. _this._themeService = new ThemeService_ThemeService(me.url, {
  107769. proxy: me.options.proxy,
  107770. withCredentials: me.options.withCredentials,
  107771. crossOrigin: me.options.crossOrigin,
  107772. headers: me.options.headers
  107773. });
  107774. return _this;
  107775. }
  107776. /**
  107777. * @function ThemeService.prototype.getThemeInfo
  107778. * @description 获取专题图信息。
  107779. * @param {ThemeParameters} params - 专题图参数类。
  107780. * @param {RequestCallback} callback 回调函数。
  107781. */
  107782. services_ThemeService_createClass(ThemeService, [{
  107783. key: "getThemeInfo",
  107784. value: function getThemeInfo(params, callback) {
  107785. this._themeService.processAsync(params, callback);
  107786. }
  107787. }]);
  107788. return ThemeService;
  107789. }(ServiceBase);
  107790. ;// CONCATENATED MODULE: ./src/common/iServer/TrafficTransferAnalystService.js
  107791. function TrafficTransferAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  107792. function TrafficTransferAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  107793. function TrafficTransferAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TrafficTransferAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TrafficTransferAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  107794. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  107795. * This program are made available under the terms of the Apache License, Version 2.0
  107796. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  107797. /**
  107798. * @class TrafficTransferAnalystService
  107799. * @extends {ServiceBase}
  107800. * @category iServer TrafficTransferAnalyst
  107801. * @classdesc 交通换乘分析服务类。
  107802. * @example
  107803. * new TrafficTransferAnalystService(url).queryStop(params,function(result){
  107804. * //doSomething
  107805. * })
  107806. * @param {string} url - 服务地址。
  107807. * @param {Object} options - 参数。
  107808. * @param {string} [options.proxy] - 服务代理地址。
  107809. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  107810. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  107811. * @param {Object} [options.headers] - 请求头。
  107812. * @usage
  107813. */
  107814. var TrafficTransferAnalystService_TrafficTransferAnalystService = /*#__PURE__*/function () {
  107815. function TrafficTransferAnalystService(url, options) {
  107816. TrafficTransferAnalystService_classCallCheck(this, TrafficTransferAnalystService);
  107817. this.url = url;
  107818. this.options = options || {};
  107819. }
  107820. /**
  107821. * @function TrafficTransferAnalystService.prototype.queryStop
  107822. * @description 站点查询服务。
  107823. * @param {StopQueryParameters} params - 查询相关参数类。
  107824. * @param {RequestCallback} callback - 回调函数。
  107825. */
  107826. TrafficTransferAnalystService_createClass(TrafficTransferAnalystService, [{
  107827. key: "queryStop",
  107828. value: function queryStop(params, callback) {
  107829. var me = this;
  107830. var stopQueryService = new StopQueryService(me.url, {
  107831. proxy: me.options.proxy,
  107832. withCredentials: me.options.withCredentials,
  107833. crossOrigin: me.options.crossOrigin,
  107834. headers: me.options.headers,
  107835. eventListeners: {
  107836. scope: me,
  107837. processCompleted: callback,
  107838. processFailed: callback
  107839. }
  107840. });
  107841. stopQueryService.processAsync(params);
  107842. }
  107843. /**
  107844. * @function TrafficTransferAnalystService.prototype.analysisTransferPath
  107845. * @description 交通换乘线路查询服务。
  107846. * @param {TransferPathParameters} params - 查询相关参数类。
  107847. * @param {RequestCallback} callback - 回调函数。
  107848. */
  107849. }, {
  107850. key: "analysisTransferPath",
  107851. value: function analysisTransferPath(params, callback) {
  107852. var me = this;
  107853. var transferPathService = new TransferPathService(me.url, {
  107854. proxy: me.options.proxy,
  107855. withCredentials: me.options.withCredentials,
  107856. crossOrigin: me.options.crossOrigin,
  107857. headers: me.options.headers,
  107858. eventListeners: {
  107859. scope: me,
  107860. processCompleted: callback,
  107861. processFailed: callback
  107862. }
  107863. });
  107864. transferPathService.processAsync(params);
  107865. }
  107866. /**
  107867. * @function TrafficTransferAnalystService.prototype.analysisTransferSolution
  107868. * @description 交通换乘方案查询服务。
  107869. * @param {TransferSolutionParameters} params - 查询相关参数类。
  107870. * @param {RequestCallback} callback - 回调函数。
  107871. */
  107872. }, {
  107873. key: "analysisTransferSolution",
  107874. value: function analysisTransferSolution(params, callback) {
  107875. var me = this;
  107876. var transferSolutionService = new TransferSolutionService(me.url, {
  107877. proxy: me.options.proxy,
  107878. withCredentials: me.options.withCredentials,
  107879. crossOrigin: me.options.crossOrigin,
  107880. headers: me.options.headers,
  107881. eventListeners: {
  107882. scope: me,
  107883. processCompleted: callback,
  107884. processFailed: callback
  107885. }
  107886. });
  107887. transferSolutionService.processAsync(params);
  107888. }
  107889. }]);
  107890. return TrafficTransferAnalystService;
  107891. }();
  107892. ;// CONCATENATED MODULE: ./src/openlayers/services/TrafficTransferAnalystService.js
  107893. function TrafficTransferAnalystService_typeof(obj) { "@babel/helpers - typeof"; return TrafficTransferAnalystService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, TrafficTransferAnalystService_typeof(obj); }
  107894. function services_TrafficTransferAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  107895. function services_TrafficTransferAnalystService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  107896. function services_TrafficTransferAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_TrafficTransferAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_TrafficTransferAnalystService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  107897. function TrafficTransferAnalystService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) TrafficTransferAnalystService_setPrototypeOf(subClass, superClass); }
  107898. function TrafficTransferAnalystService_setPrototypeOf(o, p) { TrafficTransferAnalystService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TrafficTransferAnalystService_setPrototypeOf(o, p); }
  107899. function TrafficTransferAnalystService_createSuper(Derived) { var hasNativeReflectConstruct = TrafficTransferAnalystService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = TrafficTransferAnalystService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = TrafficTransferAnalystService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return TrafficTransferAnalystService_possibleConstructorReturn(this, result); }; }
  107900. function TrafficTransferAnalystService_possibleConstructorReturn(self, call) { if (call && (TrafficTransferAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return TrafficTransferAnalystService_assertThisInitialized(self); }
  107901. function TrafficTransferAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  107902. function TrafficTransferAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  107903. function TrafficTransferAnalystService_getPrototypeOf(o) { TrafficTransferAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TrafficTransferAnalystService_getPrototypeOf(o); }
  107904. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  107905. * This program are made available under the terms of the Apache License, Version 2.0
  107906. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  107907. /**
  107908. * @class TrafficTransferAnalystService
  107909. * @extends {ServiceBase}
  107910. * @category iServer TrafficTransferAnalyst
  107911. * @classdesc 交通换乘分析服务类。
  107912. * @modulecategory Services
  107913. * @example
  107914. * new TrafficTransferAnalystService(url).queryStop(params,function(result){
  107915. * //doSomething
  107916. * })
  107917. * @param {string} url - 服务地址。
  107918. * @param {Object} options - 参数。
  107919. * @param {string} [options.proxy] - 服务代理地址。
  107920. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  107921. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  107922. * @param {Object} [options.headers] - 请求头。
  107923. * @usage
  107924. */
  107925. var TrafficTransferAnalystService = /*#__PURE__*/function (_ServiceBase) {
  107926. TrafficTransferAnalystService_inherits(TrafficTransferAnalystService, _ServiceBase);
  107927. var _super = TrafficTransferAnalystService_createSuper(TrafficTransferAnalystService);
  107928. function TrafficTransferAnalystService(url, options) {
  107929. var _this;
  107930. services_TrafficTransferAnalystService_classCallCheck(this, TrafficTransferAnalystService);
  107931. _this = _super.call(this, url, options);
  107932. _this._commonTrafficTransferAnalystService = new TrafficTransferAnalystService_TrafficTransferAnalystService(url, options);
  107933. return _this;
  107934. }
  107935. /**
  107936. * @function TrafficTransferAnalystService.prototype.queryStop
  107937. * @description 站点查询服务。
  107938. * @param {StopQueryParameters} params - 查询相关参数类。
  107939. * @param {RequestCallback} callback - 回调函数。
  107940. */
  107941. services_TrafficTransferAnalystService_createClass(TrafficTransferAnalystService, [{
  107942. key: "queryStop",
  107943. value: function queryStop(params, callback) {
  107944. this._commonTrafficTransferAnalystService.queryStop(params, callback);
  107945. }
  107946. /**
  107947. * @function TrafficTransferAnalystService.prototype.analysisTransferPath
  107948. * @description 交通换乘线路查询服务。
  107949. * @param {TransferPathParameters} params - 查询相关参数类。
  107950. * @param {RequestCallback} callback - 回调函数。
  107951. */
  107952. }, {
  107953. key: "analysisTransferPath",
  107954. value: function analysisTransferPath(params, callback) {
  107955. params = this._processParams(params);
  107956. this._commonTrafficTransferAnalystService.analysisTransferPath(params, callback);
  107957. }
  107958. /**
  107959. * @function TrafficTransferAnalystService.prototype.analysisTransferSolution
  107960. * @description 交通换乘方案查询服务。
  107961. * @param {TransferSolutionParameters} params - 查询相关参数类。
  107962. * @param {RequestCallback} callback - 回调函数。
  107963. */
  107964. }, {
  107965. key: "analysisTransferSolution",
  107966. value: function analysisTransferSolution(params, callback) {
  107967. params = this._processParams(params);
  107968. this._commonTrafficTransferAnalystService.analysisTransferSolution(params, callback);
  107969. }
  107970. }, {
  107971. key: "_processParams",
  107972. value: function _processParams(params) {
  107973. if (!params) {
  107974. return {};
  107975. }
  107976. if (params.transferLines && !core_Util_Util.isArray(params.transferLines)) {
  107977. params.transferLines = [params.transferLines];
  107978. }
  107979. if (params.points && core_Util_Util.isArray(params.points)) {
  107980. params.points.map(function (point, key) {
  107981. params.points[key] = point instanceof (external_ol_geom_Point_default()) ? {
  107982. x: point.getCoordinates()[0],
  107983. y: point.getCoordinates()[1]
  107984. } : point;
  107985. return params.points[key];
  107986. });
  107987. }
  107988. return params;
  107989. }
  107990. }]);
  107991. return TrafficTransferAnalystService;
  107992. }(ServiceBase);
  107993. ;// CONCATENATED MODULE: ./src/openlayers/services/WebPrintingJobService.js
  107994. function WebPrintingJobService_typeof(obj) { "@babel/helpers - typeof"; return WebPrintingJobService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, WebPrintingJobService_typeof(obj); }
  107995. function WebPrintingJobService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  107996. function WebPrintingJobService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  107997. function WebPrintingJobService_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobService_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  107998. function WebPrintingJobService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) WebPrintingJobService_setPrototypeOf(subClass, superClass); }
  107999. function WebPrintingJobService_setPrototypeOf(o, p) { WebPrintingJobService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return WebPrintingJobService_setPrototypeOf(o, p); }
  108000. function WebPrintingJobService_createSuper(Derived) { var hasNativeReflectConstruct = WebPrintingJobService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = WebPrintingJobService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = WebPrintingJobService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return WebPrintingJobService_possibleConstructorReturn(this, result); }; }
  108001. function WebPrintingJobService_possibleConstructorReturn(self, call) { if (call && (WebPrintingJobService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return WebPrintingJobService_assertThisInitialized(self); }
  108002. function WebPrintingJobService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  108003. function WebPrintingJobService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  108004. function WebPrintingJobService_getPrototypeOf(o) { WebPrintingJobService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WebPrintingJobService_getPrototypeOf(o); }
  108005. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  108006. * This program are made available under the terms of the Apache License, Version 2.0
  108007. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  108008. /**
  108009. * @class WebPrintingJobService
  108010. * @category iServer WebPrintingJob
  108011. * @version 10.1.0
  108012. * @classdesc Web 打印服务类。
  108013. * 提供:创建 Web 打印任务,获取 Web 打印任务内容,获取 Web 打印输出文档流,获取 Web 打印服务的布局模板信息。
  108014. * @modulecategory Services
  108015. * @extends {ServiceBase}
  108016. * @param {string} url - 服务地址。请求打印地图服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/webprinting/rest/webprinting/v1。
  108017. * @param {Object} options - 服务交互时所需的可选参数。
  108018. * @param {string} [options.proxy] - 服务代理地址。
  108019. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  108020. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  108021. * @param {Object} [options.headers] - 请求头。
  108022. * @example
  108023. * new WebPrintingJobService(url).createWebPrintingJob(param,function(result){
  108024. * //doSomething
  108025. * })
  108026. * @usage
  108027. */
  108028. var WebPrintingJobService = /*#__PURE__*/function (_ServiceBase) {
  108029. WebPrintingJobService_inherits(WebPrintingJobService, _ServiceBase);
  108030. var _super = WebPrintingJobService_createSuper(WebPrintingJobService);
  108031. function WebPrintingJobService(url, options) {
  108032. var _this;
  108033. WebPrintingJobService_classCallCheck(this, WebPrintingJobService);
  108034. _this = _super.call(this, url, options);
  108035. _this._webPrintingService = new WebPrintingService(_this.url, {
  108036. proxy: _this.options.proxy,
  108037. withCredentials: _this.options.withCredentials,
  108038. crossOrigin: _this.options.crossOrigin,
  108039. headers: _this.options.headers
  108040. });
  108041. return _this;
  108042. }
  108043. /**
  108044. * @function WebPrintingJobService.prototype.createWebPrintingJob
  108045. * @description 创建 Web 打印任务。
  108046. * @param {WebPrintingJobParameters} params - Web 打印参数类。
  108047. * @param {RequestCallback} callback - 回调函数。
  108048. */
  108049. WebPrintingJobService_createClass(WebPrintingJobService, [{
  108050. key: "createWebPrintingJob",
  108051. value: function createWebPrintingJob(params, callback) {
  108052. if (!params) {
  108053. return;
  108054. }
  108055. this._webPrintingService.createWebPrintingJob(this._processParams(params), callback);
  108056. }
  108057. /**
  108058. * @function WebPrintingJobService.prototype.getPrintingJob
  108059. * @description 获取 Web 打印输出文档任务。
  108060. * @param {string} jobId - Web 打印输入文档任务 ID。
  108061. * @param {RequestCallback} callback - 回调函数。
  108062. */
  108063. }, {
  108064. key: "getPrintingJob",
  108065. value: function getPrintingJob(jobId, callback) {
  108066. this._webPrintingService.getPrintingJob(jobId, callback);
  108067. }
  108068. /**
  108069. * @function WebPrintingJobService.prototype.getPrintingJobResult
  108070. * @description 获取 Web 打印任务的输出文档。
  108071. * @param {string} jobId - Web 打印输入文档任务 ID。
  108072. * @param {RequestCallback} callback - 回调函数。
  108073. */
  108074. }, {
  108075. key: "getPrintingJobResult",
  108076. value: function getPrintingJobResult(jobId, callback) {
  108077. this._webPrintingService.getPrintingJobResult(jobId, callback);
  108078. }
  108079. /**
  108080. * @function WebPrintingJobService.prototype.getLayoutTemplates
  108081. * @description 查询 Web 打印服务所有可用的模板信息。
  108082. * @param {RequestCallback} callback - 回调函数。
  108083. */
  108084. }, {
  108085. key: "getLayoutTemplates",
  108086. value: function getLayoutTemplates(callback) {
  108087. this._webPrintingService.getLayoutTemplates(callback);
  108088. }
  108089. }, {
  108090. key: "_processParams",
  108091. value: function _processParams(params) {
  108092. if (params.layoutOptions && params.layoutOptions.littleMapOptions) {
  108093. params.layoutOptions.littleMapOptions.center = this._toPointObject(params.layoutOptions.littleMapOptions.center);
  108094. }
  108095. if (params.exportOptions) {
  108096. params.exportOptions.center = this._toPointObject(params.exportOptions.center);
  108097. }
  108098. return params;
  108099. }
  108100. }, {
  108101. key: "_toPointObject",
  108102. value: function _toPointObject(point) {
  108103. if (Array.isArray(point)) {
  108104. return {
  108105. x: point[0],
  108106. y: point[1]
  108107. };
  108108. } else if (point instanceof Point || point instanceof (external_ol_geom_Point_default())) {
  108109. return {
  108110. x: point.x,
  108111. y: point.y
  108112. };
  108113. }
  108114. return point;
  108115. }
  108116. }]);
  108117. return WebPrintingJobService;
  108118. }(ServiceBase);
  108119. ;// CONCATENATED MODULE: ./src/openlayers/services/ImageService.js
  108120. function services_ImageService_typeof(obj) { "@babel/helpers - typeof"; return services_ImageService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, services_ImageService_typeof(obj); }
  108121. function services_ImageService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  108122. function services_ImageService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  108123. function services_ImageService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_ImageService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_ImageService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  108124. function services_ImageService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) services_ImageService_setPrototypeOf(subClass, superClass); }
  108125. function services_ImageService_setPrototypeOf(o, p) { services_ImageService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_ImageService_setPrototypeOf(o, p); }
  108126. function services_ImageService_createSuper(Derived) { var hasNativeReflectConstruct = services_ImageService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_ImageService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_ImageService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_ImageService_possibleConstructorReturn(this, result); }; }
  108127. function services_ImageService_possibleConstructorReturn(self, call) { if (call && (services_ImageService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return services_ImageService_assertThisInitialized(self); }
  108128. function services_ImageService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  108129. function services_ImageService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  108130. function services_ImageService_getPrototypeOf(o) { services_ImageService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_ImageService_getPrototypeOf(o); }
  108131. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  108132. * This program are made available under the terms of the Apache License, Version 2.0
  108133. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  108134. /**
  108135. * @class ImageService
  108136. * @version 10.2.0
  108137. * @constructs ImageService
  108138. * @classdesc 影像服务类。
  108139. * @modulecategory Services
  108140. * @category iServer Image
  108141. * @extends {ServiceBase}
  108142. * @example
  108143. * ImageService(url,options).getCollections(function(result){
  108144. * //doSomething
  108145. * })
  108146. * @param {string} url - 服务地址。例如: http://{ip}:{port}/iserver/{imageservice-imageserviceName}/restjsr/
  108147. * @param {Object} options - 参数。
  108148. * @param {string} [options.proxy] - 服务代理地址。
  108149. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  108150. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  108151. * @param {Object} [options.headers] - 请求头。
  108152. * @usage
  108153. */
  108154. var ImageService = /*#__PURE__*/function (_ServiceBase) {
  108155. services_ImageService_inherits(ImageService, _ServiceBase);
  108156. var _super = services_ImageService_createSuper(ImageService);
  108157. function ImageService(url, options) {
  108158. var _this;
  108159. services_ImageService_classCallCheck(this, ImageService);
  108160. _this = _super.call(this, url, options);
  108161. _this._imageService = new ImageService_ImageService(_this.url, {
  108162. proxy: _this.options.proxy,
  108163. withCredentials: _this.options.withCredentials,
  108164. crossOrigin: _this.options.crossOrigin,
  108165. headers: _this.options.headers
  108166. });
  108167. return _this;
  108168. }
  108169. /**
  108170. * @function ImageService.prototype.getCollections
  108171. * @description 返回当前影像服务中的影像集合列表(Collections)。
  108172. * @param {RequestCallback} callback - 回调函数。
  108173. */
  108174. services_ImageService_createClass(ImageService, [{
  108175. key: "getCollections",
  108176. value: function getCollections(callback) {
  108177. this._imageService.getCollections(callback);
  108178. }
  108179. /**
  108180. * @function ImageService.prototype.getCollectionByID
  108181. * @description ID值等于`collectionId`参数值的影像集合(Collection)。ID值用于在服务中唯一标识该影像集合。
  108182. * @param {string} collectionId 影像集合(Collection)的ID,在一个影像服务中唯一标识影像集合。
  108183. * @param {RequestCallback} callback - 回调函数。
  108184. */
  108185. }, {
  108186. key: "getCollectionByID",
  108187. value: function getCollectionByID(collectionId, callback) {
  108188. this._imageService.getCollectionByID(collectionId, callback);
  108189. }
  108190. /**
  108191. * @function ImageService.prototype.search
  108192. * @description 查询与过滤条件匹配的影像数据。
  108193. * @param {ImageSearchParameter} [itemSearch] 查询参数。
  108194. * @param {RequestCallback} callback - 回调函数。
  108195. */
  108196. }, {
  108197. key: "search",
  108198. value: function search(itemSearch, callback) {
  108199. this._imageService.search(itemSearch, callback);
  108200. }
  108201. }]);
  108202. return ImageService;
  108203. }(ServiceBase);
  108204. ;// CONCATENATED MODULE: ./src/openlayers/services/ImageCollectionService.js
  108205. function services_ImageCollectionService_typeof(obj) { "@babel/helpers - typeof"; return services_ImageCollectionService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, services_ImageCollectionService_typeof(obj); }
  108206. function services_ImageCollectionService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  108207. function services_ImageCollectionService_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  108208. function services_ImageCollectionService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_ImageCollectionService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_ImageCollectionService_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  108209. function services_ImageCollectionService_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) services_ImageCollectionService_setPrototypeOf(subClass, superClass); }
  108210. function services_ImageCollectionService_setPrototypeOf(o, p) { services_ImageCollectionService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_ImageCollectionService_setPrototypeOf(o, p); }
  108211. function services_ImageCollectionService_createSuper(Derived) { var hasNativeReflectConstruct = services_ImageCollectionService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_ImageCollectionService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_ImageCollectionService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_ImageCollectionService_possibleConstructorReturn(this, result); }; }
  108212. function services_ImageCollectionService_possibleConstructorReturn(self, call) { if (call && (services_ImageCollectionService_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return services_ImageCollectionService_assertThisInitialized(self); }
  108213. function services_ImageCollectionService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  108214. function services_ImageCollectionService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  108215. function services_ImageCollectionService_getPrototypeOf(o) { services_ImageCollectionService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_ImageCollectionService_getPrototypeOf(o); }
  108216. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  108217. * This program are made available under the terms of the Apache License, Version 2.0
  108218. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  108219. /**
  108220. * @class ImageCollectionService
  108221. * @version 10.2.0
  108222. * @constructs ImageCollectionService
  108223. * @classdesc 影像集合服务类。
  108224. * @modulecategory Services
  108225. * @category iServer Image
  108226. * @extends {ServiceBase}
  108227. * @example
  108228. * new ImageCollectionService(url,options).getLegend(queryParams,function(result){
  108229. * //doSomething
  108230. * })
  108231. * @param {string} url - 服务地址。例如: http://{ip}:{port}/iserver/{imageservice-imageserviceName}/restjsr/
  108232. * @param {Object} options - 参数。
  108233. * @param {string} options.collectionId 影像集合(Collection)的ID,在一个影像服务中唯一标识影像集合。
  108234. * @param {string} [options.proxy] - 服务代理地址。
  108235. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  108236. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  108237. * @param {Object} [options.headers] - 请求头。
  108238. * @usage
  108239. */
  108240. var ImageCollectionService = /*#__PURE__*/function (_ServiceBase) {
  108241. services_ImageCollectionService_inherits(ImageCollectionService, _ServiceBase);
  108242. var _super = services_ImageCollectionService_createSuper(ImageCollectionService);
  108243. function ImageCollectionService(url, options) {
  108244. var _this;
  108245. services_ImageCollectionService_classCallCheck(this, ImageCollectionService);
  108246. _this = _super.call(this, url, options);
  108247. _this._imageCollectionService = new ImageCollectionService_ImageCollectionService(_this.url, {
  108248. collectionId: _this.options.collectionId,
  108249. proxy: _this.options.proxy,
  108250. withCredentials: _this.options.withCredentials,
  108251. crossOrigin: _this.options.crossOrigin,
  108252. headers: _this.options.headers
  108253. });
  108254. return _this;
  108255. }
  108256. /**
  108257. * @function ImageCollectionService.prototype.getLegend
  108258. * @param {Object} queryParams query参数。
  108259. * @param {ImageRenderingRule} [queryParams.renderingRule] 指定影像显示的风格,包含拉伸显示方式、颜色表、波段组合以及应用栅格函数进行快速处理等。不指定时,使用发布服务时所配置的风格。
  108260. * @param {RequestCallback} callback - 回调函数。
  108261. */
  108262. services_ImageCollectionService_createClass(ImageCollectionService, [{
  108263. key: "getLegend",
  108264. value: function getLegend(queryParams, callback) {
  108265. this._imageCollectionService.getLegend(queryParams, callback);
  108266. }
  108267. /**
  108268. * @function ImageCollectionService.prototype.getStatistics
  108269. * @description 返回当前影像集合的统计信息。包括文件数量,文件大小等信息。
  108270. * @param {RequestCallback} callback - 回调函数。
  108271. */
  108272. }, {
  108273. key: "getStatistics",
  108274. value: function getStatistics(callback) {
  108275. this._imageCollectionService.getStatistics(callback);
  108276. }
  108277. /**
  108278. * @function ImageCollectionService.prototype.getTileInfo
  108279. * @description 返回影像集合所提供的服务瓦片的信息,包括:每层瓦片的分辨率,比例尺等信息,方便前端进行图层叠加。
  108280. * @param {RequestCallback} callback - 回调函数。
  108281. */
  108282. }, {
  108283. key: "getTileInfo",
  108284. value: function getTileInfo(callback) {
  108285. this._imageCollectionService.getTileInfo(callback);
  108286. }
  108287. /**
  108288. * @function ImageCollectionService.prototype.deleteItemByID
  108289. * @description 删除影像集合中的指定ID(`featureId`)的Item对象,即从影像集合中删除指定的影像。
  108290. * @param {string} featureId Feature 的本地标识符。
  108291. * @param {RequestCallback} callback - 回调函数。
  108292. */
  108293. }, {
  108294. key: "deleteItemByID",
  108295. value: function deleteItemByID(featureId, callback) {
  108296. this._imageCollectionService.deleteItemByID(featureId, callback);
  108297. }
  108298. /**
  108299. * @function ImageCollectionService.prototype.getItemByID
  108300. * @description 返回影像集合中的指定ID(`featureId`)的Item对象,即返回影像集合中指定的影像。
  108301. * @param {string} featureId Feature 的本地标识符。
  108302. * @param {RequestCallback} callback - 回调函数。
  108303. */
  108304. }, {
  108305. key: "getItemByID",
  108306. value: function getItemByID(featureId, callback) {
  108307. this._imageCollectionService.getItemByID(featureId, callback);
  108308. }
  108309. }]);
  108310. return ImageCollectionService;
  108311. }(ServiceBase);
  108312. ;// CONCATENATED MODULE: ./src/openlayers/services/index.js
  108313. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  108314. * This program are made available under the terms of the Apache License, Version 2.0
  108315. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  108316. ;// CONCATENATED MODULE: ./src/openlayers/mapping/webmap/config/ProvinceCenter.json
  108317. var ProvinceCenter_namespaceObject = JSON.parse('[{"name":"黑龙江省","coord":[127.64559817675396,48.48668098449708]},{"name":"内蒙古自治区","coord":[118.34519572208615,45.370218276977525]},{"name":"新疆维吾尔自治区","coord":[87.13479065593184,41.75497055053711]},{"name":"吉林省","coord":[126.12985278813787,43.57983207702637]},{"name":"辽宁省","coord":[124.02494773936439,41.105743408203125]},{"name":"甘肃省","coord":[102.87785725633012,37.69582366943361]},{"name":"河北省","coord":[115.66327227481898,39.33383178710938]},{"name":"北京市","coord":[116.62199343603638,40.25053787231445]},{"name":"山西省","coord":[112.45180235808988,37.666561126708984]},{"name":"天津市","coord":[117.35711842642581,39.406789779663086]},{"name":"陕西省","coord":[109.56294003056632,35.64754199981689]},{"name":"宁夏回族自治区","coord":[105.96110877640074,37.3081169128418]},{"name":"青海省","coord":[96.07301048277901,35.44417190551758]},{"name":"山东省","coord":[118.03833752951093,36.29800605773925]},{"name":"西藏自治区","coord":[87.47361520439412,31.6703872680664]},{"name":"河南省","coord":[113.07832397097275,33.87751102447509]},{"name":"江苏省","coord":[119.93926538201052,32.945452690124505]},{"name":"安徽省","coord":[117.15146765881019,32.024482727050774]},{"name":"四川省","coord":[102.28998890142759,30.182161331176758]},{"name":"湖北省","coord":[112.87798261431585,31.157071113586426]},{"name":"重庆市","coord":[107.870126637831,30.188085556030266]},{"name":"上海市","coord":[121.42561166015514,31.276043891906745]},{"name":"浙江省","coord":[119.75337092707514,29.175934791564945]},{"name":"湖南省","coord":[111.52770282777405,27.38110256195069]},{"name":"江西省","coord":[115.51091280655628,27.283511161804206]},{"name":"云南省","coord":[101.27053825991308,25.19783210754396]},{"name":"贵州省","coord":[106.49672346773299,26.92267990112305]},{"name":"福建省","coord":[117.9976766946587,25.939599990844727]},{"name":"广西壮族自治区","coord":[108.98706831086302,23.891559600830078]},{"name":"台湾省","coord":[120.82468432537434,23.602651596069336]},{"name":"香港特别行政区","coord":[114.21036850371561,22.374858856201172]},{"name":"海南省","coord":[109.62792940960824,19.163116455078125]},{"name":"广东省","coord":[113.32127888266032,22.873867034912106]},{"name":"澳门特别行政区","coord":[113.56819996291901,22.160347992976]}]');
  108318. ;// CONCATENATED MODULE: ./src/openlayers/mapping/webmap/config/MunicipalCenter.json
  108319. var MunicipalCenter_namespaceObject = JSON.parse('[{"name":"克拉玛依市","coord":[85.01486759299489,45.406422237230046]},{"name":"昌吉回族自治州","coord":[88.7154624754753,44.26991024636568]},{"name":"石河子市","coord":[86.0208600035924,44.239045558096805]},{"name":"霍林郭勒市","coord":[114.73479243733115,44.16058374713977]},{"name":"本溪市","coord":[124.64357865201586,41.177197783134275]},{"name":"嘉峪关市","coord":[98.16891560537093,39.76279786284264]},{"name":"莱芜市","coord":[117.65723565456207,36.27916499211527]},{"name":"神农架林区","coord":[110.48296222218153,31.581260143666697]},{"name":"天门市","coord":[113.00615321481195,30.64105781887143]},{"name":"鄂州市","coord":[114.94764081970385,30.325634953844585]},{"name":"潜江市","coord":[112.70703817700621,30.349210666019893]},{"name":"仙桃市","coord":[113.34688900729822,30.315951161935402]},{"name":"萍乡市","coord":[113.88072263074415,27.47193090553213]},{"name":"台湾省","coord":[120.14338943402045,23.596002465926095]},{"name":"东莞市","coord":[113.89443658529342,22.897826158636448]},{"name":"中山市","coord":[113.37118387764659,22.501478858616522]},{"name":"珠海市","coord":[113.21799258934986,22.23782602992192]},{"name":"北海市","coord":[109.18248083043899,21.695773689750148]},{"name":"香港","coord":[114.20689279508653,22.36016760139811]},{"name":"舟山市","coord":[122.22514712841459,30.338633120695956]},{"name":"克孜勒苏柯尔克孜","coord":[74.62910472637343,39.59886016069875]},{"name":"喀什地区","coord":[77.19899922143753,37.85462871211595]},{"name":"阿克苏地区","coord":[81.43930290016381,41.067304799230456]},{"name":"和田地区","coord":[80.69780509160952,36.95287032287055]},{"name":"阿里地区","coord":[82.536487505389,32.69566569631762]},{"name":"日喀则地区","coord":[86.5996831353606,29.54861754814263]},{"name":"那曲地区","coord":[88.32523292667608,33.20600450932715]},{"name":"玉树藏族自治州","coord":[95.2107128446203,33.90320387919257]},{"name":"迪庆藏族自治州","coord":[99.42465312188943,28.052797714348895]},{"name":"怒江傈傈族自治州","coord":[98.85737910439825,26.98345757528851]},{"name":"大理白族自治州","coord":[99.93934374816013,25.684737357453045]},{"name":"德宏傣族景颇族自","coord":[98.13830877778075,24.593421919561205]},{"name":"保山市","coord":[99.19031013453166,24.979380341662]},{"name":"临沧市","coord":[99.62483778975081,24.058807858948214]},{"name":"普洱市","coord":[100.94440267992684,23.44121660743221]},{"name":"西双版纳傣族自治","coord":[100.86105801845994,21.882475641324206]},{"name":"拉萨市","coord":[91.3684790613129,30.14176592960237]},{"name":"山南地区","coord":[92.11665242621062,28.33000201578789]},{"name":"林芝地区","coord":[94.9307847458166,29.125110156601963]},{"name":"昌都地区","coord":[97.33912235873476,30.48520825551814]},{"name":"丽江市","coord":[100.65713436205135,26.96190318191959]},{"name":"攀枝花市","coord":[101.73355913301131,26.714486678752795]},{"name":"凉山彝族自治州","coord":[102.08678551422615,27.683020519860396]},{"name":"楚雄彝族自治州","coord":[101.68264761198458,25.369603845264024]},{"name":"红河哈尼族彝族自","coord":[102.95101719613119,23.624860095239875]},{"name":"文山壮族苗族自治","coord":[104.8708359910614,23.579587266862504]},{"name":"百色市","coord":[106.69546907589859,23.98220841166522]},{"name":"崇左市","coord":[107.3277087317123,22.49769755349952]},{"name":"防城港市","coord":[107.88939931155171,21.94550204069006]},{"name":"南宁市","coord":[108.67078983716917,23.12207641861882]},{"name":"钦州市","coord":[108.8532307305186,22.157690108421384]},{"name":"玉林市","coord":[110.26918466489103,22.391823643610415]},{"name":"湛江市","coord":[109.93033457863683,21.086751055633457]},{"name":"茂名市","coord":[110.80336192333934,22.069184739040775]},{"name":"阳江市","coord":[111.70471342186183,22.108751366417575]},{"name":"江门市","coord":[112.53715618649149,22.297368082806777]},{"name":"广州市","coord":[113.4949302208309,23.28359314707863]},{"name":"清远市","coord":[113.10957368131268,24.334444053233856]},{"name":"肇庆市","coord":[112.11117530204233,23.60241158796112]},{"name":"梧州市","coord":[111.01709510772797,23.518132876753846]},{"name":"贺州市","coord":[111.50423061842756,24.4095096817199]},{"name":"桂林市","coord":[110.44046163393094,25.353966673735407]},{"name":"柳州市","coord":[109.34854449214147,24.972408051485047]},{"name":"河池市","coord":[107.81191841865586,24.649291651298164]},{"name":"黔东南苗族侗族自","coord":[108.39952601614591,26.429286420465576]},{"name":"贵阳市","coord":[106.59784062851153,26.797907456479816]},{"name":"安顺市","coord":[105.76161265300635,25.988644902171018]},{"name":"黔西南布依族苗族","coord":[105.5954078788574,25.404850939549405]},{"name":"曲靖市","coord":[103.9164335632742,25.697243690315265]},{"name":"六盘水市","coord":[104.77723228072432,26.15402255629164]},{"name":"毕节地区","coord":[105.03867422931839,27.077913968069666]},{"name":"昭通市","coord":[104.29730513046874,27.62418247971078]},{"name":"宜宾市","coord":[104.76748901448207,28.553501804266475]},{"name":"乐山市","coord":[103.56027669102787,29.160754519210577]},{"name":"自贡市","coord":[104.63272827056402,29.273152614922402]},{"name":"内江市","coord":[104.82644562304716,29.61272653799929]},{"name":"遵义市","coord":[106.82413636302059,28.191847588570702]},{"name":"达州市","coord":[107.59704170009518,31.32138258839703]},{"name":"遂宁市","coord":[105.48979445433736,30.677687821242678]},{"name":"广安市","coord":[106.56708164098042,30.43500706741521]},{"name":"泸州市","coord":[105.42591761727707,28.50277238478137]},{"name":"资阳市","coord":[104.97995126874034,30.154251886139654]},{"name":"雅安市","coord":[102.69931299964517,29.892630706195035]},{"name":"眉山市","coord":[104.07052881858888,29.894202166560405]},{"name":"甘孜藏族自治州","coord":[100.50721042614238,30.975216556269658]},{"name":"果洛藏族自治州","coord":[99.30775565051923,34.03539865224808]},{"name":"海南藏族自治州","coord":[100.39969108016373,35.90048272566899]},{"name":"黄南藏族自治州","coord":[101.5360706381689,35.10286360841902]},{"name":"赣南藏族自治州","coord":[102.97083885806067,34.326752803339026]},{"name":"陇南市","coord":[105.24780098912132,33.57031117443431]},{"name":"天水市","coord":[105.53503634660417,34.62320421368087]},{"name":"定西市","coord":[104.58787768541339,35.08900966621695]},{"name":"临夏回族自治州","coord":[103.2612870434902,35.591577124455235]},{"name":"西宁市","coord":[101.57680657999033,36.84800271717157]},{"name":"海东地区","coord":[102.30909850729282,36.287400615025646]},{"name":"海北藏族自治州","coord":[100.27122484450717,37.892557516083826]},{"name":"金昌市","coord":[102.02244049169511,38.497330414886164]},{"name":"酒泉市","coord":[95.94486678270127,40.56891536586272]},{"name":"海西蒙古族藏族自","coord":[94.67143298050689,36.022725148503724]},{"name":"巴音郭楞蒙古自治","coord":[88.18116214759745,39.556478810319916]},{"name":"哈密地区","coord":[93.84302392518026,42.95015211178875]},{"name":"叶鲁番地区","coord":[89.82035217277885,42.399368632283505]},{"name":"乌鲁木齐市","coord":[88.00048109561487,43.549986370786]},{"name":"阿勒泰地区","coord":[88.11213933257655,47.05593413019629]},{"name":"博尔塔拉蒙古自治","coord":[82.26402238163408,44.671135542630864]},{"name":"伊犁哈萨克自治州","coord":[82.80778717477179,43.53783381365267]},{"name":"阿拉善盟","coord":[103.29923966842289,40.10955801781495]},{"name":"武威市","coord":[102.73362058791429,37.94211141321436]},{"name":"兰州市","coord":[103.73793563506032,36.27379827886003]},{"name":"中卫市","coord":[105.6943786030716,37.20654236148948]},{"name":"银川市","coord":[106.20022174140034,38.52103167597483]},{"name":"石嘴山市","coord":[106.41544011793628,38.84054137571417]},{"name":"乌海市","coord":[106.8984175998405,39.54616572239788]},{"name":"鄂尔多斯市","coord":[108.43285571424619,39.24036799350715]},{"name":"巴彦淖尔市","coord":[107.45840392808307,41.30159860424196]},{"name":"包头市","coord":[110.46472193224272,41.48017783644221]},{"name":"呼和浩特市","coord":[111.48365173603975,40.498363056149884]},{"name":"乌兰察布市","coord":[112.61568977597707,41.75789561273154]},{"name":"大同市","coord":[113.7107192749083,39.898956799744184]},{"name":"朔州市","coord":[112.65428748167508,39.681772914701924]},{"name":"忻州市","coord":[112.36127575589583,38.88990233614568]},{"name":"榆林市","coord":[109.68473112169593,38.19921027134876]},{"name":"延安市","coord":[109.52425222161318,36.406522726136814]},{"name":"庆阳市","coord":[107.73052193155061,36.183821532624464]},{"name":"固原市","coord":[106.20191575442442,36.11634909496382]},{"name":"白银市","coord":[104.68634478137065,36.51582865625868]},{"name":"宝鸡市","coord":[107.33534779230747,34.3387216485855]},{"name":"汉中市","coord":[107.03534754266246,33.00142998064871]},{"name":"广元市","coord":[105.92928137563939,32.21872447205537]},{"name":"巴中市","coord":[107.03422410306194,31.99874720836291]},{"name":"南充市","coord":[106.32964805032347,31.156657700184095]},{"name":"绵阳市","coord":[104.58949560201106,31.88628780630976]},{"name":"德阳市","coord":[104.41542984932845,31.110558133718676]},{"name":"成都市","coord":[103.8852290010473,30.777258040348634]},{"name":"阿坝藏族羌族自治","coord":[102.26209319552814,32.45725845387284]},{"name":"安康市","coord":[109.14236501848015,32.77467694678074]},{"name":"十堰市","coord":[110.39934083416314,32.376209039347906]},{"name":"襄阳市","coord":[111.97539147094662,31.93399822417465]},{"name":"宜昌市","coord":[111.22204852395754,30.772457669035354]},{"name":"恩施市","coord":[109.42158366502872,30.260366574390105]},{"name":"张家界市","coord":[110.59760006538717,29.330107409240718]},{"name":"吉首市","coord":[109.72176899848378,28.681903937242495]},{"name":"铜仁地区","coord":[108.54247523485463,28.11736237519646]},{"name":"重庆市","coord":[107.86007108564992,30.186253395053196]},{"name":"怀化市","coord":[109.94325166787243,27.43919084801186]},{"name":"益阳市","coord":[112.43060358108062,28.75127294553697]},{"name":"娄底市","coord":[111.41891416951897,27.696312460064604]},{"name":"常德市","coord":[111.72571610131646,29.27189463838195]},{"name":"荆州市","coord":[112.65896596965268,30.05161542755362]},{"name":"荆门市","coord":[112.6586855902184,31.01267124474617]},{"name":"岳阳市","coord":[113.2595036144316,29.106247116930163]},{"name":"长沙市","coord":[113.15415586456598,28.222934680488425]},{"name":"湘潭市","coord":[112.51092596317824,27.69881544105668]},{"name":"株州市","coord":[113.49665538546823,27.03993794610501]},{"name":"衡阳市","coord":[112.48849636578527,26.783613569970782]},{"name":"邵阳市","coord":[110.6723832117475,26.81652287086792]},{"name":"永州市","coord":[111.8565364154186,25.768488267811968]},{"name":"韶关市","coord":[113.53420325850979,24.69848878771937]},{"name":"惠州市","coord":[114.32029589634925,23.25504544231892]},{"name":"佛山市","coord":[112.95925897403649,23.10116677189257]},{"name":"云浮市","coord":[111.78042514904234,22.840400494105687]},{"name":"深圳市","coord":[114.13138648919008,22.649563063468342]},{"name":"汕尾市","coord":[115.57412892884373,23.06989642104901]},{"name":"河源市","coord":[114.89746229844398,23.97971937124767]},{"name":"揭阳市","coord":[116.04290004239446,23.304802704715357]},{"name":"汕头市","coord":[116.7008461897183,23.35898625947344]},{"name":"潮州市","coord":[116.75405548481658,23.854381508863064]},{"name":"梅州市","coord":[116.13719397345734,24.15633544812716]},{"name":"漳州市","coord":[117.38279760543345,24.41111215459575]},{"name":"厦门市","coord":[118.04275971554665,24.675908246507944]},{"name":"龙岩市","coord":[116.69341144552507,25.20284542644492]},{"name":"泉州市","coord":[118.12035864630246,25.22984144365049]},{"name":"莆田市","coord":[118.82439690138142,25.439653480972687]},{"name":"福州市","coord":[119.1608285845262,25.99117532466728]},{"name":"三明市","coord":[117.51188176216434,26.318292906961602]},{"name":"南平市","coord":[118.16153136678187,27.306303151805437]},{"name":"抚州市","coord":[116.3455359885574,27.487043655935366]},{"name":"鹰潭市","coord":[117.01082360702333,28.241253742969946]},{"name":"吉安市","coord":[114.91377151807418,26.957486660664525]},{"name":"赣州市","coord":[115.046455717572,25.81565075681663]},{"name":"郴州市","coord":[113.1544526703492,25.871927095452524]},{"name":"新余市","coord":[114.94161795877827,27.79044654578371]},{"name":"宜春市","coord":[115.04574494880995,28.306428044943356]},{"name":"南昌市","coord":[115.9963824234495,28.664803351584705]},{"name":"九江市","coord":[115.53225905704193,29.362905920276297]},{"name":"上饶市","coord":[117.8595355766598,28.765755150094634]},{"name":"景德镇市","coord":[117.25387030721845,29.33426823662448]},{"name":"黄山市","coord":[117.85476357809696,29.969632034273722]},{"name":"池州市","coord":[117.34517113140791,30.208089337922335]},{"name":"铜陵市","coord":[117.93160431300694,30.926442655001676]},{"name":"安庆市","coord":[116.54307680610799,30.524265461641296]},{"name":"黄石市","coord":[115.02354597728443,29.924060229331015]},{"name":"咸宁市","coord":[114.26967602231792,29.652174021136048]},{"name":"黄冈市","coord":[115.2859016705373,30.65856897065683]},{"name":"武汉市","coord":[114.34552076948799,30.68836237966767]},{"name":"随州市","coord":[113.3850627838818,31.87891659924412]},{"name":"信阳市","coord":[114.81374730587638,32.0309685135914]},{"name":"驻马店市","coord":[114.07756451509235,32.896720987266114]},{"name":"商洛市","coord":[109.82044421310393,33.77403373563189]},{"name":"西安市","coord":[109.11839808451401,34.225257215515896]},{"name":"渭南市","coord":[109.75732444226935,35.025913644359306]},{"name":"铜川市","coord":[108.98695328111377,35.19235092947735]},{"name":"咸阳市","coord":[108.36398776446165,34.84311348287181]},{"name":"三门峡市","coord":[110.80049688104964,34.31818709571671]},{"name":"运城市","coord":[111.1736679525165,35.19010372283576]},{"name":"洛阳市","coord":[111.87577573098216,34.33379926109848]},{"name":"平顶山市","coord":[112.80931281928427,33.759895800153096]},{"name":"漯河市","coord":[113.83505724178012,33.70034266174508]},{"name":"许昌市","coord":[113.78762484088509,34.051835688452435]},{"name":"郑州市","coord":[113.49619951867594,34.61181797865449]},{"name":"焦作市","coord":[113.13404280173008,35.134167097471625]},{"name":"晋城市","coord":[112.7495732073233,35.63186423091449]},{"name":"长治市","coord":[112.85900842873183,36.45872910742828]},{"name":"临汾市","coord":[111.49379787924448,36.22810800777857]},{"name":"太原市","coord":[112.15628804033796,37.91704444063036]},{"name":"吕梁市","coord":[111.31901105774872,37.712740463356496]},{"name":"晋中市","coord":[113.08199599739676,37.36532613794343]},{"name":"邯郸市","coord":[114.41824047234618,36.530119932543315]},{"name":"安阳市","coord":[113.88883283163116,35.7797611183252]},{"name":"鹤壁市","coord":[114.3654094911545,35.75770487428472]},{"name":"新乡市","coord":[113.9184107718167,35.348471214026716]},{"name":"开封市","coord":[114.52801677500626,34.61371216679872]},{"name":"周口市","coord":[114.88509782391864,33.69999759722657]},{"name":"阜阳市","coord":[115.44595951398213,32.98060371610532]},{"name":"淮南市","coord":[116.68941991880993,32.79972275772595]},{"name":"蚌埠市","coord":[117.38594715783302,33.106729536033896]},{"name":"淮北市","coord":[116.69651711889378,33.69527529383458]},{"name":"宿州市","coord":[117.30175405886838,33.943330421260015]},{"name":"亳州市","coord":[116.12410804185097,33.46769392946132]},{"name":"商丘市","coord":[115.59575176872548,34.28339840831147]},{"name":"菏泽市","coord":[115.53631974831816,35.197319393220624]},{"name":"濮阳市","coord":[115.3070485514902,35.775883510964334]},{"name":"聊城市","coord":[115.8870069012884,36.40529594548765]},{"name":"邢台市","coord":[114.74259008644859,37.251396750084155]},{"name":"石家庄市","coord":[114.56923838363613,38.13141710980106]},{"name":"阳泉市","coord":[113.39216149668508,38.09075470547468]},{"name":"保定市","coord":[115.261524468934,39.09118520781398]},{"name":"衡水市","coord":[115.8182936677897,37.715661598187154]},{"name":"德州市","coord":[116.4582273790399,37.19372347888644]},{"name":"沧州市","coord":[116.76192710911863,38.20240042039232]},{"name":"廊坊市","coord":[116.50410772133856,39.27896741763884]},{"name":"天津市","coord":[117.31988934444873,39.37154482470619]},{"name":"北京市","coord":[116.59734730757869,40.237112944270976]},{"name":"张家口市","coord":[115.1823606483226,40.83732566607167]},{"name":"唐山市","coord":[117.8693184261954,39.71862889477249]},{"name":"秦皇岛市","coord":[119.30467355367742,39.990574652162564]},{"name":"承德市","coord":[117.16275671911026,41.36623845548547]},{"name":"葫芦岛市","coord":[119.9342336210531,40.5628822626519]},{"name":"朝阳市","coord":[120.11853493535794,41.471852354885755]},{"name":"赤峰市","coord":[118.50943546234379,43.25452976059767]},{"name":"锦州市","coord":[121.5167549323861,41.45933087433065]},{"name":"营口市","coord":[122.58571915054674,40.42093503997384]},{"name":"丹东市","coord":[124.33549382902183,40.46369290272115]},{"name":"辽阳市","coord":[123.34064798039414,41.152331397771356]},{"name":"盘锦市","coord":[122.06718005354679,41.05573599862555]},{"name":"阜新市","coord":[121.93889757908204,42.27641773244204]},{"name":"鞍山市","coord":[122.78904432242356,40.77781183142038]},{"name":"沈阳市","coord":[122.99508899709724,42.1162195010079]},{"name":"铁岭市","coord":[124.23100515588399,42.72666083611828]},{"name":"扶顺市","coord":[124.46027188217573,41.82955407638859]},{"name":"通辽市","coord":[122.0729370657937,43.90889130864869]},{"name":"兴安盟","coord":[120.79456431092532,45.92003249442161]},{"name":"白城市","coord":[123.10619907715235,45.25475749267784]},{"name":"齐齐哈尔市","coord":[124.5462214659102,47.55395009317394]},{"name":"大兴安岭地区","coord":[124.50992855161529,52.18438447846694]},{"name":"黑河市","coord":[127.14721400335922,49.25080134026901]},{"name":"大庆市","coord":[124.40329830095243,46.401048760966745]},{"name":"绥化市","coord":[126.5214484055605,46.76992452194825]},{"name":"松原市","coord":[124.21244334807682,44.75779381338502]},{"name":"四平市","coord":[124.27839350328821,43.52139065090318]},{"name":"通化市","coord":[125.67392830706305,41.91771808663852]},{"name":"辽源市","coord":[125.33529527643432,42.758340204944986]},{"name":"吉林市","coord":[126.83350281902375,43.60730120049175]},{"name":"长春市","coord":[125.53597875970374,44.24624314701737]},{"name":"白山市","coord":[127.16780160322108,42.093893880305075]},{"name":"哈尔滨市","coord":[127.39125008786029,45.36200668820575]},{"name":"鹤岗市","coord":[130.4703811258197,47.66520688940109]},{"name":"伊春市","coord":[128.91240831703635,47.93833794565277]},{"name":"七台河市","coord":[131.2677920224311,45.945099776108584]},{"name":"鸡西市","coord":[132.38059153660274,45.722934218318535]},{"name":"双鸭山市","coord":[132.3184817002743,46.65813679030265]},{"name":"佳木斯市","coord":[132.26174446608726,47.17569713691394]},{"name":"呼伦贝尔市","coord":[122.3210739998419,50.18176996070858]},{"name":"孝感市","coord":[113.83749892135485,31.11757234692128]},{"name":"贵港市","coord":[110.07354588052804,23.380735604767374]},{"name":"黔南布依族苗族自","coord":[107.30931767543106,26.2976919432269]},{"name":"宁德市","coord":[119.52482556634342,27.013151692716413]},{"name":"温州市","coord":[120.30037042732202,27.8699145504001]},{"name":"台州市","coord":[120.88886782713843,28.670799172772313]},{"name":"丽水市","coord":[119.56796851966463,28.170268394477755]},{"name":"衢州市","coord":[118.79479802644406,28.865874397158763]},{"name":"金华市","coord":[119.99381920686633,29.093455548185744]},{"name":"绍兴市","coord":[120.46546691682343,29.69382513836818]},{"name":"宁波市","coord":[121.42142987830871,29.70001162878972]},{"name":"杭州市","coord":[119.4405685790891,29.87218307296989]},{"name":"宣城市","coord":[118.68748382914703,30.628143499626418]},{"name":"湖州市","coord":[119.98261306633574,30.7945175862809]},{"name":"嘉兴市","coord":[120.83889215988998,30.67538495499343]},{"name":"上海市","coord":[121.37534147322967,31.25628247908459]},{"name":"苏州市","coord":[120.6906182622391,31.381280695137775]},{"name":"无锡市","coord":[120.32182300914366,31.54113306724517]},{"name":"常州市","coord":[119.61953292830165,31.611878565375576]},{"name":"南京市","coord":[118.71890548838064,31.910863187910323]},{"name":"镇江市","coord":[119.42349332902813,31.97942313430778]},{"name":"合肥市","coord":[117.30651975617157,31.79407863049138]},{"name":"六安市","coord":[116.24668220575353,31.820846193819513]},{"name":"滁州市","coord":[117.88422385307969,32.51792621904418]},{"name":"泰州市","coord":[120.03124303305091,32.56503102346783]},{"name":"南通市","coord":[120.85599446760912,32.18496706099728]},{"name":"盐城市","coord":[120.01812490612667,33.54219948734023]},{"name":"淮安市","coord":[119.0749424205415,33.39203631772854]},{"name":"宿迁市","coord":[118.45404943216346,33.666258719120265]},{"name":"徐州市","coord":[117.77482249295966,34.30847766157078]},{"name":"济宁市","coord":[116.74147276546373,35.27488504351119]},{"name":"枣庄市","coord":[117.43359942491492,34.884162021736]},{"name":"连云港市","coord":[119.01553213785074,34.54316517587849]},{"name":"临沂市","coord":[118.31478835349617,35.28173079028279]},{"name":"日照市","coord":[119.14265350444272,35.54479073199592]},{"name":"青岛市","coord":[120.27779044405756,36.3464117375903]},{"name":"威海市","coord":[122.12963327195605,37.13879077904251]},{"name":"烟台市","coord":[120.7689567423966,37.19772002195597]},{"name":"潍坊市","coord":[119.02178548592039,36.49292234053931]},{"name":"淄博市","coord":[117.92936024367185,36.60871347163638]},{"name":"泰安市","coord":[116.93810893944303,36.0423330118612]},{"name":"济南市","coord":[117.34560282551296,36.769574973846304]},{"name":"东营市","coord":[118.4915054457184,37.52194690335787]},{"name":"滨州市","coord":[117.67610299757533,37.4439597758601]},{"name":"昆明市","coord":[102.93100245594789,25.481300763922075]},{"name":"玉溪市","coord":[102.23080854291823,24.156168324611663]},{"name":"塔城地区","coord":[83.60908162840168,45.3721852373893]},{"name":"张掖市","coord":[100.47710030600572,38.704239320458385]},{"name":"南阳市","coord":[112.1400670951149,33.03033276715801]},{"name":"扬州市","coord":[119.48949608990988,32.80956776339646]},{"name":"延边朝鲜族自治州","coord":[129.3577692895626,43.24968794080283]},{"name":"牡丹江市","coord":[129.87240796405672,44.7073040108322]},{"name":"澳门","coord":[113.56289691515346,22.14602596262204]},{"name":"吴忠市","coord":[106.76894508116403,37.72566765880316]},{"name":"来宾市","coord":[109.25592217010114,23.86346274681084]},{"name":"平凉市","coord":[107.0708132782897,35.30329631658711]},{"name":"马鞍山市","coord":[118.27245878467022,31.657727937739004]},{"name":"芜湖市","coord":[118.32992684415504,31.081688223101658]},{"name":"澄迈县","coord":[110.04198076060266,19.694955078668105]},{"name":"保亭黎族苗族自治","coord":[109.6055304964257,18.6101488675304]},{"name":"乐东黎族自治县","coord":[109.04051999525574,18.643137437909203]},{"name":"儋州市","coord":[109.3431358337404,19.550974957403195]},{"name":"定安县","coord":[110.38744429685676,19.47557074114284]},{"name":"屯昌县","coord":[110.00574767630334,19.367175093044388]},{"name":"白沙黎族自治县","coord":[109.36860737761768,19.214416393082217]},{"name":"琼中黎族苗族自治","coord":[109.86691465937548,19.073671135862682]},{"name":"东方市","coord":[108.86903802405428,19.017352815445214]},{"name":"昌江黎族自治县","coord":[108.9686431884767,19.182594167127824]},{"name":"海口市","coord":[110.420654296875,19.806565564640795]},{"name":"济源市","coord":[112.38051465474433,35.07958362422394]},{"name":"五指山市","coord":[109.53595187364496,18.832908264613966]},{"name":"大连市","coord":[121.96662235866603,39.444150542439914]},{"name":"文昌市三沙市","coord":[110.81828537536748,19.756501444162936]},{"name":"三亚市","coord":[109.38424600793707,18.39186315877128]},{"name":"万宁市","coord":[110.28485046979574,18.860240588635115]},{"name":"陵水黎族自治县","coord":[109.95577603229562,18.594712684620465]},{"name":"临高县","coord":[109.71915395436967,19.79420403032508]},{"name":"琼海市","coord":[110.41650700703043,19.22315873149372]}]');
  108320. ;// CONCATENATED MODULE: ./src/openlayers/mapping/webmap/config/SampleDataInfo.json
  108321. var SampleDataInfo_namespaceObject = JSON.parse('[{"id":"SalesJan2009","fileName":"SalesJan2009","xField":"Longitude","yField":"Latitude","type":"POINT"},{"id":"Sacramentorealestatetransactions","fileName":"Ealestate transactions","xField":"longitude","yField":"latitude","type":"POINT"},{"id":"BeijingResidentialDistrict","fileName":"北京市住宅小区","xField":"SmX","yField":"SmY","type":"POINT"},{"id":"GlobalRecordOfOver7Earthquakes","fileName":"全球历史7级以上地震记录","xField":"经度","yField":"纬度","type":"POINT"},{"id":"ChinaRecordOfOver6Earthquakes","fileName":"中国历史6级以上地震记录","xField":"经度","yField":"纬度","type":"POINT"},{"id":"ChinaMeteorologicalObservationStation","fileName":"中国气象观测站","xField":"经度","yField":"纬度","type":"POINT"},{"id":"BeijingSubwayLine","fileName":"北京市地铁交通线路","type":"LINE"},{"id":"ChinaEarthquakeIntensityZone","fileName":"中国地震烈度区划面","type":"POLYGON"}]');
  108322. ;// CONCATENATED MODULE: external "ol.View"
  108323. var external_ol_View_namespaceObject = ol.View;
  108324. var external_ol_View_default = /*#__PURE__*/__webpack_require__.n(external_ol_View_namespaceObject);
  108325. ;// CONCATENATED MODULE: external "ol.interaction.MouseWheelZoom"
  108326. var external_ol_interaction_MouseWheelZoom_namespaceObject = ol.interaction.MouseWheelZoom;
  108327. var external_ol_interaction_MouseWheelZoom_default = /*#__PURE__*/__webpack_require__.n(external_ol_interaction_MouseWheelZoom_namespaceObject);
  108328. ;// CONCATENATED MODULE: external "ol.proj.proj4"
  108329. var external_ol_proj_proj4_namespaceObject = ol.proj.proj4;
  108330. ;// CONCATENATED MODULE: external "ol.proj.Units"
  108331. var external_ol_proj_Units_namespaceObject = ol.proj.Units;
  108332. var external_ol_proj_Units_default = /*#__PURE__*/__webpack_require__.n(external_ol_proj_Units_namespaceObject);
  108333. ;// CONCATENATED MODULE: external "ol.layer"
  108334. var external_ol_layer_namespaceObject = ol.layer;
  108335. ;// CONCATENATED MODULE: external "ol.format.WMTSCapabilities"
  108336. var external_ol_format_WMTSCapabilities_namespaceObject = ol.format.WMTSCapabilities;
  108337. var external_ol_format_WMTSCapabilities_default = /*#__PURE__*/__webpack_require__.n(external_ol_format_WMTSCapabilities_namespaceObject);
  108338. ;// CONCATENATED MODULE: external "ol.format.WMSCapabilities"
  108339. var external_ol_format_WMSCapabilities_namespaceObject = ol.format.WMSCapabilities;
  108340. var external_ol_format_WMSCapabilities_default = /*#__PURE__*/__webpack_require__.n(external_ol_format_WMSCapabilities_namespaceObject);
  108341. ;// CONCATENATED MODULE: external "ol.geom"
  108342. var external_ol_geom_namespaceObject = ol.geom;
  108343. ;// CONCATENATED MODULE: external "ol.source.TileWMS"
  108344. var external_ol_source_TileWMS_namespaceObject = ol.source.TileWMS;
  108345. var external_ol_source_TileWMS_default = /*#__PURE__*/__webpack_require__.n(external_ol_source_TileWMS_namespaceObject);
  108346. ;// CONCATENATED MODULE: external "ol.render.Feature"
  108347. var external_ol_render_Feature_namespaceObject = ol.render.Feature;
  108348. var external_ol_render_Feature_default = /*#__PURE__*/__webpack_require__.n(external_ol_render_Feature_namespaceObject);
  108349. ;// CONCATENATED MODULE: external "ol.Collection"
  108350. var external_ol_Collection_namespaceObject = ol.Collection;
  108351. var external_ol_Collection_default = /*#__PURE__*/__webpack_require__.n(external_ol_Collection_namespaceObject);
  108352. // EXTERNAL MODULE: ./node_modules/lodash.difference/index.js
  108353. var lodash_difference = __webpack_require__(4940);
  108354. var lodash_difference_default = /*#__PURE__*/__webpack_require__.n(lodash_difference);
  108355. ;// CONCATENATED MODULE: ./src/openlayers/mapping/WebMap.js
  108356. function WebMap_typeof(obj) { "@babel/helpers - typeof"; return WebMap_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, WebMap_typeof(obj); }
  108357. function WebMap_slicedToArray(arr, i) { return WebMap_arrayWithHoles(arr) || WebMap_iterableToArrayLimit(arr, i) || WebMap_unsupportedIterableToArray(arr, i) || WebMap_nonIterableRest(); }
  108358. function WebMap_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  108359. function WebMap_iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
  108360. function WebMap_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  108361. function WebMap_toConsumableArray(arr) { return WebMap_arrayWithoutHoles(arr) || WebMap_iterableToArray(arr) || WebMap_unsupportedIterableToArray(arr) || WebMap_nonIterableSpread(); }
  108362. function WebMap_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  108363. function WebMap_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return WebMap_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return WebMap_arrayLikeToArray(o, minLen); }
  108364. function WebMap_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
  108365. function WebMap_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return WebMap_arrayLikeToArray(arr); }
  108366. function WebMap_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
  108367. function WebMap_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ WebMap_regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == WebMap_typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
  108368. function WebMap_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
  108369. function WebMap_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { WebMap_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { WebMap_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
  108370. function WebMap_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  108371. function WebMap_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  108372. function WebMap_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebMap_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebMap_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  108373. function WebMap_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) WebMap_setPrototypeOf(subClass, superClass); }
  108374. function WebMap_setPrototypeOf(o, p) { WebMap_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return WebMap_setPrototypeOf(o, p); }
  108375. function WebMap_createSuper(Derived) { var hasNativeReflectConstruct = WebMap_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = WebMap_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = WebMap_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return WebMap_possibleConstructorReturn(this, result); }; }
  108376. function WebMap_possibleConstructorReturn(self, call) { if (call && (WebMap_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return WebMap_assertThisInitialized(self); }
  108377. function WebMap_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  108378. function WebMap_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  108379. function WebMap_getPrototypeOf(o) { WebMap_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WebMap_getPrototypeOf(o); }
  108380. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  108381. * This program are made available under the terms of the Apache License, Version 2.0
  108382. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  108383. // eslint-disable-line import/extensions
  108384. // eslint-disable-line import/extensions
  108385. // eslint-disable-line import/extensions
  108386. window.proj4 = (proj4_src_default());
  108387. window.Proj4js = (proj4_src_default());
  108388. //数据转换工具
  108389. var transformTools = new (external_ol_format_GeoJSON_default())();
  108390. // 迁徙图最大支持要素数量
  108391. var MAX_MIGRATION_ANIMATION_COUNT = 1000;
  108392. //不同坐标系单位。计算公式中的值
  108393. var metersPerUnit = {
  108394. DEGREES: 2 * Math.PI * 6370997 / 360,
  108395. DEGREE: 2 * Math.PI * 6370997 / 360,
  108396. FEET: 0.3048,
  108397. METERS: 1,
  108398. METER: 1,
  108399. M: 1,
  108400. USFEET: 1200 / 3937
  108401. };
  108402. var dpiConfig = {
  108403. "default": 96,
  108404. // 常用dpi
  108405. iServerWMTS: 90.7142857142857 // iserver使用的wmts图层dpi
  108406. };
  108407. /**
  108408. * @class WebMap
  108409. * @category iPortal/Online Resources Map
  108410. * @classdesc 对接 iPortal/Online 地图类
  108411. * @modulecategory Mapping
  108412. * @param {Object} options - 参数
  108413. * @param {string} [options.target='map'] - 地图容器id
  108414. * @param {Object | string} [options.webMap] - webMap对象,或者是获取webMap的url地址。存在webMap,优先使用webMap, id的选项则会被忽略
  108415. * @param {number} [options.id] - 地图的id
  108416. * @param {string} [options.server] - 地图的地址,如果使用传入id,server则会和id拼接成webMap请求地址
  108417. * @param {function} [options.successCallback] - 成功加载地图后调用的函数
  108418. * @param {function} [options.errorCallback] - 加载地图失败调用的函数
  108419. * @param {string} [options.credentialKey] - 凭证密钥。例如为"key"、"token",或者用户自定义的密钥。用户申请了密钥,此参数必填
  108420. * @param {string} [options.credentialValue] - 凭证密钥对应的值,credentialKey和credentialValue必须一起使用
  108421. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie
  108422. * @param {boolean} [options.excludePortalProxyUrl] - server传递过来的url是否带有代理
  108423. * @param {Object} [options.serviceProxy] - iportal内置代理信息, 仅矢量瓦片图层上图才会使用
  108424. * @param {string} [options.tiandituKey] - 天地图的key
  108425. * @param {string} [options.googleMapsAPIKey] - 谷歌底图需要的key
  108426. * @param {string} [options.proxy] - 代理地址,当域名不一致,请求会加上代理。避免跨域
  108427. * @param {string} [options.tileFormat] - 地图瓦片出图格式,png/webp
  108428. * @param {Object} [options.mapSetting] - 地图可选参数
  108429. * @param {function} [options.mapSetting.mapClickCallback] - 地图被点击的回调函数
  108430. * @param {function} [options.mapSetting.overlays] - 地图的overlays
  108431. * @param {function} [options.mapSetting.controls] - 地图的控件
  108432. * @param {function} [options.mapSetting.interactions] - 地图控制的参数
  108433. * @param {number} [options.restDataSingleRequestCount=1000] - 自定义restData分批请求,单次请求数量
  108434. * @extends {ol.Observable}
  108435. * @usage
  108436. */
  108437. var WebMap = /*#__PURE__*/function (_Observable) {
  108438. WebMap_inherits(WebMap, _Observable);
  108439. var _super = WebMap_createSuper(WebMap);
  108440. function WebMap(id, options) {
  108441. var _this2;
  108442. WebMap_classCallCheck(this, WebMap);
  108443. _this2 = _super.call(this);
  108444. if (core_Util_Util.isObject(id)) {
  108445. options = id;
  108446. _this2.mapId = options.id;
  108447. } else {
  108448. _this2.mapId = id;
  108449. }
  108450. options = options || {};
  108451. _this2.server = options.server;
  108452. _this2.successCallback = options.successCallback;
  108453. _this2.errorCallback = options.errorCallback;
  108454. _this2.credentialKey = options.credentialKey;
  108455. _this2.credentialValue = options.credentialValue;
  108456. _this2.withCredentials = options.withCredentials || false;
  108457. _this2.target = options.target || "map";
  108458. _this2.excludePortalProxyUrl = options.excludePortalProxyUrl || false;
  108459. _this2.serviceProxy = options.serviceProxy || null;
  108460. _this2.tiandituKey = options.tiandituKey;
  108461. _this2.googleMapsAPIKey = options.googleMapsAPIKey || '';
  108462. _this2.proxy = options.proxy;
  108463. //计数叠加图层,处理过的数量(成功和失败都会计数)
  108464. _this2.layerAdded = 0;
  108465. _this2.layers = [];
  108466. _this2.events = new Events(WebMap_assertThisInitialized(_this2), null, ["updateDataflowFeature"], true);
  108467. _this2.webMap = options.webMap;
  108468. _this2.tileFormat = options.tileFormat && options.tileFormat.toLowerCase();
  108469. _this2.restDataSingleRequestCount = options.restDataSingleRequestCount || 1000;
  108470. _this2.createMap(options.mapSetting);
  108471. if (_this2.webMap) {
  108472. // webmap有可能是url地址,有可能是webmap对象
  108473. core_Util_Util.isString(_this2.webMap) ? _this2.createWebmap(_this2.webMap) : _this2.getMapInfoSuccess(options.webMap);
  108474. } else {
  108475. _this2.createWebmap();
  108476. }
  108477. return _this2;
  108478. }
  108479. /**
  108480. * @private
  108481. * @function WebMap.prototype._removeBaseLayer
  108482. * @description 移除底图
  108483. */
  108484. WebMap_createClass(WebMap, [{
  108485. key: "_removeBaseLayer",
  108486. value: function _removeBaseLayer() {
  108487. var map = this.map;
  108488. var _this$baseLayer = this.baseLayer,
  108489. layer = _this$baseLayer.layer,
  108490. labelLayer = _this$baseLayer.labelLayer;
  108491. // 移除天地图标签图层
  108492. labelLayer && map.removeLayer(labelLayer);
  108493. // 移除图层
  108494. layer && map.removeLayer(layer);
  108495. this.baseLayer = null;
  108496. }
  108497. /**
  108498. * @private
  108499. * @function WebMap.prototype._removeLayers
  108500. * @description 移除叠加图层
  108501. */
  108502. }, {
  108503. key: "_removeLayers",
  108504. value: function _removeLayers() {
  108505. var map = this.map;
  108506. this.layers.forEach(function (_ref) {
  108507. var layerType = _ref.layerType,
  108508. layer = _ref.layer,
  108509. labelLayer = _ref.labelLayer,
  108510. pathLayer = _ref.pathLayer,
  108511. dataflowService = _ref.dataflowService;
  108512. if (!layer) {
  108513. return;
  108514. }
  108515. if (layerType === 'MIGRATION') {
  108516. layer.remove();
  108517. return;
  108518. }
  108519. if (layerType === 'DATAFLOW_POINT_TRACK' || layerType === 'DATAFLOW_HEAT') {
  108520. // 移除轨迹图层
  108521. pathLayer && map.removeLayer(pathLayer);
  108522. // 取消订阅
  108523. dataflowService && dataflowService.unSubscribe();
  108524. }
  108525. // 移除标签图层
  108526. labelLayer && map.removeLayer(labelLayer);
  108527. // 移除图层
  108528. map.removeLayer(layer);
  108529. });
  108530. this.layers = [];
  108531. }
  108532. /**
  108533. * @private
  108534. * @function WebMap.prototype.clear
  108535. * @description 清空地图
  108536. */
  108537. }, {
  108538. key: "_clear",
  108539. value: function _clear() {
  108540. // 比例尺
  108541. this.scales = [];
  108542. // 分辨率
  108543. this.resolutionArray = [];
  108544. // 比例尺-分辨率 {scale: resolution}
  108545. this.resolutions = {};
  108546. // 计数叠加图层,处理过的数量(成功和失败都会计数)
  108547. this.layerAdded = 0;
  108548. this._removeBaseLayer();
  108549. this._removeLayers();
  108550. }
  108551. /**
  108552. * @function WebMap.prototype.refresh
  108553. * @version 10.1.0
  108554. * @description 重新渲染地图
  108555. */
  108556. }, {
  108557. key: "refresh",
  108558. value: function refresh() {
  108559. this._clear();
  108560. this.createWebmap();
  108561. }
  108562. /**
  108563. * @private
  108564. * @function WebMap.prototype.createMap
  108565. * @description 创建地图对象以及注册地图事件
  108566. * @param {Object} mapSetting - 关于地图的设置以及需要注册的事件
  108567. */
  108568. }, {
  108569. key: "createMap",
  108570. value: function createMap(mapSetting) {
  108571. var overlays, controls, interactions;
  108572. if (mapSetting) {
  108573. interactions = mapSetting.interactions;
  108574. overlays = mapSetting.overlays;
  108575. controls = mapSetting.controls;
  108576. }
  108577. this.map = new (external_ol_Map_default())({
  108578. interactions: interactions,
  108579. overlays: overlays,
  108580. controls: controls,
  108581. target: this.target
  108582. });
  108583. mapSetting && this.registerMapEvent({
  108584. mapClickCallback: mapSetting.mapClickCallback
  108585. });
  108586. }
  108587. /**
  108588. * @private
  108589. * @function WebMap.prototype.registerMapEvent
  108590. * @description 注册地图事件
  108591. * @param {Object} mapSetting - 关于地图的设置以及需要注册的事件
  108592. */
  108593. }, {
  108594. key: "registerMapEvent",
  108595. value: function registerMapEvent(mapSetting) {
  108596. var map = this.map;
  108597. map.on("click", function (evt) {
  108598. mapSetting.mapClickCallback && mapSetting.mapClickCallback(evt);
  108599. });
  108600. }
  108601. /**
  108602. * @private
  108603. * @function WebMap.prototype.createWebmap
  108604. * @description 创建webmap
  108605. * @param {string} webMapUrl - 请求webMap的地址
  108606. */
  108607. }, {
  108608. key: "createWebmap",
  108609. value: function createWebmap(webMapUrl) {
  108610. var mapUrl;
  108611. if (webMapUrl) {
  108612. mapUrl = webMapUrl;
  108613. } else {
  108614. var urlArr = this.server.split('');
  108615. if (urlArr[urlArr.length - 1] !== '/') {
  108616. this.server += '/';
  108617. }
  108618. mapUrl = this.server + 'web/maps/' + this.mapId + '/map';
  108619. var filter = 'getUrlResource.json?url=';
  108620. if (this.excludePortalProxyUrl && this.server.indexOf(filter) > -1) {
  108621. //大屏需求,或者有加上代理的
  108622. var urlArray = this.server.split(filter);
  108623. if (urlArray.length > 1) {
  108624. mapUrl = urlArray[0] + filter + this.server + 'web/maps/' + this.mapId + '/map.json';
  108625. }
  108626. }
  108627. }
  108628. this.getMapInfo(mapUrl);
  108629. }
  108630. /**
  108631. * @private
  108632. * @function WebMap.prototype.getMapInfo
  108633. * @description 获取地图的json信息
  108634. * @param {string} url - 请求地图的url
  108635. */
  108636. }, {
  108637. key: "getMapInfo",
  108638. value: function getMapInfo(url) {
  108639. var that = this,
  108640. mapUrl = url;
  108641. if (url.indexOf('.json') === -1) {
  108642. url = this.handleJSONSuffix(url);
  108643. //传递过来的url,没有包括.json,在这里加上。
  108644. mapUrl = url;
  108645. }
  108646. FetchRequest.get(that.getRequestUrl(mapUrl), null, {
  108647. withCredentials: this.withCredentials
  108648. }).then(function (response) {
  108649. return response.json();
  108650. }).then(function (mapInfo) {
  108651. that.getMapInfoSuccess(mapInfo);
  108652. })["catch"](function (error) {
  108653. that.errorCallback && that.errorCallback(error, 'getMapFaild', that.map);
  108654. });
  108655. }
  108656. /**
  108657. * @private
  108658. * @function WebMap.prototype.getMapInfoSuccess
  108659. * @description 获取地图的json信息
  108660. * @param {Object} mapInfo - webMap对象
  108661. */
  108662. }, {
  108663. key: "getMapInfoSuccess",
  108664. value: function () {
  108665. var _getMapInfoSuccess = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee2(mapInfo) {
  108666. var that, handleResult;
  108667. return WebMap_regeneratorRuntime().wrap(function _callee2$(_context2) {
  108668. while (1) switch (_context2.prev = _context2.next) {
  108669. case 0:
  108670. that = this;
  108671. if (!(mapInfo.succeed === false)) {
  108672. _context2.next = 4;
  108673. break;
  108674. }
  108675. that.errorCallback && that.errorCallback(mapInfo.error, 'getMapFaild', that.map);
  108676. return _context2.abrupt("return");
  108677. case 4:
  108678. _context2.next = 6;
  108679. return that.handleCRS(mapInfo.projection, mapInfo.baseLayer.url);
  108680. case 6:
  108681. handleResult = _context2.sent;
  108682. //存储地图的名称以及描述等信息,返回给用户
  108683. that.mapParams = {
  108684. title: mapInfo.title,
  108685. description: mapInfo.description
  108686. };
  108687. if (!(handleResult.action === "BrowseMap")) {
  108688. _context2.next = 12;
  108689. break;
  108690. }
  108691. that.createSpecLayer(mapInfo);
  108692. _context2.next = 34;
  108693. break;
  108694. case 12:
  108695. if (!(handleResult.action === "OpenMap")) {
  108696. _context2.next = 32;
  108697. break;
  108698. }
  108699. that.baseProjection = handleResult.newCrs || mapInfo.projection;
  108700. that.webMapVersion = mapInfo.version;
  108701. that.baseLayer = mapInfo.baseLayer;
  108702. // that.mapParams = {
  108703. // title: mapInfo.title,
  108704. // description: mapInfo.description
  108705. // }; //存储地图的名称以及描述等信息,返回给用户
  108706. that.isHaveGraticule = mapInfo.grid && mapInfo.grid.graticule;
  108707. if (!(mapInfo.baseLayer && mapInfo.baseLayer.layerType === 'MAPBOXSTYLE')) {
  108708. _context2.next = 21;
  108709. break;
  108710. }
  108711. // 添加矢量瓦片服务作为底图
  108712. that.addMVTMapLayer(mapInfo, mapInfo.baseLayer, 0).then( /*#__PURE__*/WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee() {
  108713. return WebMap_regeneratorRuntime().wrap(function _callee$(_context) {
  108714. while (1) switch (_context.prev = _context.next) {
  108715. case 0:
  108716. that.createView(mapInfo);
  108717. if (!(!mapInfo.layers || mapInfo.layers.length === 0)) {
  108718. _context.next = 5;
  108719. break;
  108720. }
  108721. that.sendMapToUser(0);
  108722. _context.next = 7;
  108723. break;
  108724. case 5:
  108725. _context.next = 7;
  108726. return that.addLayers(mapInfo);
  108727. case 7:
  108728. that.addGraticule(mapInfo);
  108729. case 8:
  108730. case "end":
  108731. return _context.stop();
  108732. }
  108733. }, _callee);
  108734. })))["catch"](function (error) {
  108735. that.errorCallback && that.errorCallback(error, 'getMapFaild', that.map);
  108736. });
  108737. _context2.next = 30;
  108738. break;
  108739. case 21:
  108740. _context2.next = 23;
  108741. return that.addBaseMap(mapInfo);
  108742. case 23:
  108743. if (!(!mapInfo.layers || mapInfo.layers.length === 0)) {
  108744. _context2.next = 27;
  108745. break;
  108746. }
  108747. that.sendMapToUser(0);
  108748. _context2.next = 29;
  108749. break;
  108750. case 27:
  108751. _context2.next = 29;
  108752. return that.addLayers(mapInfo);
  108753. case 29:
  108754. that.addGraticule(mapInfo);
  108755. case 30:
  108756. _context2.next = 34;
  108757. break;
  108758. case 32:
  108759. // 不支持的坐标系
  108760. that.errorCallback && that.errorCallback({
  108761. type: "Not support CS",
  108762. errorMsg: "Not support CS: ".concat(mapInfo.projection)
  108763. }, 'getMapFaild', that.map);
  108764. return _context2.abrupt("return");
  108765. case 34:
  108766. case "end":
  108767. return _context2.stop();
  108768. }
  108769. }, _callee2, this);
  108770. }));
  108771. function getMapInfoSuccess(_x) {
  108772. return _getMapInfoSuccess.apply(this, arguments);
  108773. }
  108774. return getMapInfoSuccess;
  108775. }()
  108776. /**
  108777. * 处理坐标系(底图)
  108778. * @private
  108779. * @param {string} crs 必传参数,值是webmap2中定义的坐标系,可能是 1、EGSG:xxx 2、WKT string
  108780. * @param {string} baseLayerUrl 可选参数,地图的服务地址;用于EPSG:-1 的时候,用于请求iServer提供的wkt
  108781. * @return {Object}
  108782. */
  108783. }, {
  108784. key: "handleCRS",
  108785. value: function () {
  108786. var _handleCRS = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee4(crs, baseLayerUrl) {
  108787. var that, handleResult, newCrs, action;
  108788. return WebMap_regeneratorRuntime().wrap(function _callee4$(_context4) {
  108789. while (1) switch (_context4.prev = _context4.next) {
  108790. case 0:
  108791. that = this, handleResult = {};
  108792. newCrs = crs, action = "OpenMap";
  108793. if (!this.isCustomProjection(crs)) {
  108794. _context4.next = 7;
  108795. break;
  108796. }
  108797. _context4.next = 5;
  108798. return FetchRequest.get(that.getRequestUrl("".concat(baseLayerUrl, "/prjCoordSys.wkt")), null, {
  108799. withCredentials: that.withCredentials,
  108800. withoutFormatSuffix: true
  108801. }).then(function (response) {
  108802. return response.text();
  108803. }).then( /*#__PURE__*/function () {
  108804. var _ref3 = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee3(result) {
  108805. return WebMap_regeneratorRuntime().wrap(function _callee3$(_context3) {
  108806. while (1) switch (_context3.prev = _context3.next) {
  108807. case 0:
  108808. if (!(result.indexOf("<!doctype html>") === -1)) {
  108809. _context3.next = 5;
  108810. break;
  108811. }
  108812. that.addProjctionFromWKT(result, crs);
  108813. handleResult = {
  108814. action: action,
  108815. newCrs: newCrs
  108816. };
  108817. _context3.next = 6;
  108818. break;
  108819. case 5:
  108820. throw 'ERROR';
  108821. case 6:
  108822. case "end":
  108823. return _context3.stop();
  108824. }
  108825. }, _callee3);
  108826. }));
  108827. return function (_x4) {
  108828. return _ref3.apply(this, arguments);
  108829. };
  108830. }())["catch"](function () {
  108831. action = "BrowseMap";
  108832. handleResult = {
  108833. action: action,
  108834. newCrs: newCrs
  108835. };
  108836. });
  108837. case 5:
  108838. _context4.next = 9;
  108839. break;
  108840. case 7:
  108841. if (crs.indexOf("EPSG") === 0 && crs.split(":")[1] <= 0) {
  108842. // 自定义坐标系 rest map EPSG:-1(自定义坐标系) 支持编辑
  108843. // 未知坐标系情况特殊处理,只支持预览 1、rest map EPSG:-1000(没定义坐标系) 2、wms/wmts EPSG:0 (自定义坐标系)
  108844. action = "BrowseMap";
  108845. } else if (crs === 'EPSG:910111' || crs === 'EPSG:910112') {
  108846. // 早期数据存在的自定义坐标系 "EPSG:910111": "GCJ02MERCATOR", "EPSG:910112": "BDMERCATOR"
  108847. newCrs = "EPSG:3857";
  108848. } else if (crs === 'EPSG:910101' || crs === 'EPSG:910102') {
  108849. // 早期数据存在的自定义坐标系 "EPSG:910101": "GCJ02", "EPSG:910102": "BD",
  108850. newCrs = "EPSG:4326";
  108851. } else if (crs.indexOf("EPSG") !== 0) {
  108852. // wkt
  108853. that.addProjctionFromWKT(newCrs);
  108854. newCrs = that.getEpsgInfoFromWKT(crs);
  108855. }
  108856. handleResult = {
  108857. action: action,
  108858. newCrs: newCrs
  108859. };
  108860. case 9:
  108861. return _context4.abrupt("return", handleResult);
  108862. case 10:
  108863. case "end":
  108864. return _context4.stop();
  108865. }
  108866. }, _callee4, this);
  108867. }));
  108868. function handleCRS(_x2, _x3) {
  108869. return _handleCRS.apply(this, arguments);
  108870. }
  108871. return handleCRS;
  108872. }()
  108873. /**
  108874. * @private
  108875. * @function WebMap.prototype.getScales
  108876. * @description 根据级别获取每个级别对应的分辨率
  108877. * @param {Object} baseLayerInfo - 底图的图层信息
  108878. */
  108879. }, {
  108880. key: "getScales",
  108881. value: function getScales(baseLayerInfo) {
  108882. var _this3 = this;
  108883. var scales = [],
  108884. resolutions = {},
  108885. res,
  108886. scale,
  108887. resolutionArray = [],
  108888. coordUnit = baseLayerInfo.coordUnit || external_ol_proj_namespaceObject.get(baseLayerInfo.projection).getUnits();
  108889. if (!coordUnit) {
  108890. coordUnit = this.baseProjection == "EPSG:3857" ? "m" : "degree";
  108891. }
  108892. if (baseLayerInfo.visibleScales && baseLayerInfo.visibleScales.length > 0) {
  108893. //底部设置过固定比例尺,则使用设置的
  108894. baseLayerInfo.visibleScales.forEach(function (scale) {
  108895. var value = 1 / scale;
  108896. res = _this3.getResFromScale(value, coordUnit);
  108897. scale = "1:".concat(value);
  108898. //多此一举转换,因为toLocalString会自动保留小数点后三位,and当第二位小数是0就会保存小数点后两位。所有为了统一。
  108899. resolutions[_this3.formatScale(scale)] = res;
  108900. resolutionArray.push(res);
  108901. scales.push(scale);
  108902. }, this);
  108903. } else if (baseLayerInfo.layerType === 'WMTS') {
  108904. baseLayerInfo.scales.forEach(function (scale) {
  108905. res = _this3.getResFromScale(scale, coordUnit, 90.7);
  108906. scale = "1:".concat(scale);
  108907. //多此一举转换,因为toLocalString会自动保留小数点后三位,and当第二位小数是0就会保存小数点后两位。所有为了统一。
  108908. resolutions[_this3.formatScale(scale)] = res;
  108909. resolutionArray.push(res);
  108910. scales.push(scale);
  108911. }, this);
  108912. } else {
  108913. var _baseLayerInfo$minZoo2 = baseLayerInfo.minZoom,
  108914. minZoom = _baseLayerInfo$minZoo2 === void 0 ? 0 : _baseLayerInfo$minZoo2,
  108915. _baseLayerInfo$maxZoo2 = baseLayerInfo.maxZoom,
  108916. maxZoom = _baseLayerInfo$maxZoo2 === void 0 ? 22 : _baseLayerInfo$maxZoo2,
  108917. view = this.map.getView();
  108918. for (var i = minZoom; i <= maxZoom; i++) {
  108919. res = view.getResolutionForZoom(i);
  108920. scale = this.getScaleFromRes(res, coordUnit);
  108921. if (scales.indexOf(scale) === -1) {
  108922. //不添加重复的比例尺
  108923. scales.push(scale);
  108924. var attr = scale.replace(/,/g, "");
  108925. resolutions[attr] = res;
  108926. resolutionArray.push(res);
  108927. }
  108928. }
  108929. }
  108930. this.scales = scales;
  108931. this.resolutions = resolutions;
  108932. this.resolutionArray = resolutionArray;
  108933. }
  108934. /**
  108935. * @private
  108936. * @function WebMap.prototype.getResFromScale
  108937. * @description 将比例尺转换为分辨率
  108938. * @param {number} scale - 比例尺
  108939. * @param {string} coordUnit - 比例尺单位
  108940. * @param {number} dpi
  108941. */
  108942. }, {
  108943. key: "getResFromScale",
  108944. value: function getResFromScale(scale) {
  108945. var coordUnit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "DEGREE";
  108946. var dpi = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 96;
  108947. var mpu = metersPerUnit[coordUnit.toUpperCase()];
  108948. return scale * .0254 / dpi / mpu;
  108949. }
  108950. /**
  108951. * @private
  108952. * @function WebMap.prototype.getScaleFromRes
  108953. * @description 将分辨率转换为比例尺
  108954. * @param {number} resolution - 分辨率
  108955. * @param {string} coordUnit - 比例尺单位
  108956. * @param {number} dpi
  108957. */
  108958. }, {
  108959. key: "getScaleFromRes",
  108960. value: function getScaleFromRes(resolution) {
  108961. var coordUnit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "DEGREE";
  108962. var dpi = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 96;
  108963. var scale,
  108964. mpu = metersPerUnit[coordUnit.toUpperCase()];
  108965. scale = resolution * dpi * mpu / .0254;
  108966. return '1:' + scale;
  108967. }
  108968. /**
  108969. * @private
  108970. * @function WebMap.prototype.formatScale
  108971. * @description 将有千位符的数字转为普通数字。例如:1,234 => 1234
  108972. * @param {number} scale - 比例尺分母
  108973. */
  108974. }, {
  108975. key: "formatScale",
  108976. value: function formatScale(scale) {
  108977. return scale.replace(/,/g, "");
  108978. }
  108979. /**
  108980. * @private
  108981. * @function WebMap.prototype.createSpecLayer
  108982. * @description 创建坐标系为0和-1000的图层
  108983. * @param {Object} mapInfo - 地图信息
  108984. */
  108985. }, {
  108986. key: "createSpecLayer",
  108987. value: function createSpecLayer(mapInfo) {
  108988. var me = this,
  108989. baseLayerInfo = mapInfo.baseLayer,
  108990. url = baseLayerInfo.url,
  108991. baseLayerType = baseLayerInfo.layerType;
  108992. var extent = [mapInfo.extent.leftBottom.x, mapInfo.extent.leftBottom.y, mapInfo.extent.rightTop.x, mapInfo.extent.rightTop.y];
  108993. var proj = new external_ol_proj_namespaceObject.Projection({
  108994. extent: extent,
  108995. units: 'm',
  108996. code: 'EPSG:0'
  108997. });
  108998. external_ol_proj_namespaceObject.addProjection(proj);
  108999. var options = {
  109000. center: mapInfo.center,
  109001. level: 0
  109002. };
  109003. //添加view
  109004. me.baseProjection = proj;
  109005. var viewOptions = {
  109006. center: options.center ? [options.center.x, options.center.y] : [0, 0],
  109007. zoom: 0,
  109008. projection: proj
  109009. };
  109010. if (['4', '5'].indexOf(core_Util_Util.getOlVersion()) < 0) {
  109011. // 兼容 ol 4,5,6
  109012. viewOptions.multiWorld = true;
  109013. }
  109014. var view = new (external_ol_View_default())(viewOptions);
  109015. me.map.setView(view);
  109016. if (me.mapParams) {
  109017. me.mapParams.extent = extent;
  109018. me.mapParams.projection = mapInfo.projection;
  109019. }
  109020. if (url && url.indexOf("?token=") > -1) {
  109021. //兼容iserver地址有token的情况
  109022. me.credentialKey = 'token';
  109023. me.credentialValue = mapInfo.baseLayer.credential = url.split("?token=")[1];
  109024. url = url.split("?token=")[0];
  109025. }
  109026. var source;
  109027. if (baseLayerType === "TILE") {
  109028. url = this.handleJSONSuffix(url);
  109029. FetchRequest.get(me.getRequestUrl(url), null, {
  109030. withCredentials: this.withCredentials
  109031. }).then(function (response) {
  109032. return response.json();
  109033. }).then(function (result) {
  109034. baseLayerInfo.originResult = result;
  109035. var serverType = "IPORTAL",
  109036. credential = baseLayerInfo.credential,
  109037. keyfix = 'Token',
  109038. keyParams = baseLayerInfo.url;
  109039. if (baseLayerInfo.url.indexOf("www.supermapol.com") > -1 || baseLayerInfo.url.indexOf("itest.supermapol.com") > -1) {
  109040. keyfix = 'Key';
  109041. keyParams = [keyParams];
  109042. serverType = "ONLINE";
  109043. }
  109044. if (credential) {
  109045. SecurityManager["register".concat(keyfix)](keyParams, credential);
  109046. }
  109047. var options = {
  109048. serverType: serverType,
  109049. url: url,
  109050. tileGrid: TileSuperMapRest.optionsFromMapJSON(url, result).tileGrid
  109051. };
  109052. if (url && !Util_Util.isInTheSameDomain(url) && !this.isIportalProxyServiceUrl(url)) {
  109053. options.tileProxy = me.server + 'apps/viewer/getUrlResource.png?url=';
  109054. }
  109055. source = new TileSuperMapRest(options);
  109056. me.addSpecToMap(source);
  109057. })["catch"](function (error) {
  109058. me.errorCallback && me.errorCallback(error, 'getMapFaild', me.map);
  109059. });
  109060. } else if (baseLayerType === "WMS") {
  109061. source = me.createWMSSource(baseLayerInfo);
  109062. me.addSpecToMap(source);
  109063. } else if (baseLayerType === "WMTS") {
  109064. FetchRequest.get(me.getRequestUrl(url, true), null, {
  109065. withCredentials: this.withCredentials
  109066. }).then(function (response) {
  109067. return response.text();
  109068. }).then(function (capabilitiesText) {
  109069. baseLayerInfo.extent = [mapInfo.extent.leftBottom.x, mapInfo.extent.leftBottom.y, mapInfo.extent.rightTop.x, mapInfo.extent.rightTop.y];
  109070. baseLayerInfo.scales = me.getWMTSScales(baseLayerInfo.tileMatrixSet, capabilitiesText);
  109071. baseLayerInfo.dpi = dpiConfig.iServerWMTS;
  109072. source = me.createWMTSSource(baseLayerInfo);
  109073. me.addSpecToMap(source);
  109074. })["catch"](function (error) {
  109075. me.errorCallback && me.errorCallback(error, 'getMapFaild', me.map);
  109076. });
  109077. } else {
  109078. me.errorCallback && me.errorCallback({
  109079. type: "Not support CS",
  109080. errorMsg: "Not support CS: ".concat(baseLayerType)
  109081. }, 'getMapFaild', me.map);
  109082. }
  109083. view && view.fit(extent);
  109084. }
  109085. /**
  109086. * @private
  109087. * @function WebMap.prototype.addSpecToMap
  109088. * @description 将坐标系为0和-1000的图层添加到地图上
  109089. * @param {Object} mapInfo - 地图信息
  109090. */
  109091. }, {
  109092. key: "addSpecToMap",
  109093. value: function addSpecToMap(source) {
  109094. var layer = new external_ol_layer_namespaceObject.Tile({
  109095. source: source,
  109096. zIndex: 0
  109097. });
  109098. this.map.addLayer(layer);
  109099. this.sendMapToUser(0);
  109100. }
  109101. /**
  109102. * @private
  109103. * @function WebMap.prototype.getWMTSScales
  109104. * @description 获取wmts的比例尺
  109105. * @param {Object} identifier - 图层存储的标识信息
  109106. * @param {Object} capabilitiesText - wmts信息
  109107. */
  109108. }, {
  109109. key: "getWMTSScales",
  109110. value: function getWMTSScales(identifier, capabilitiesText) {
  109111. var format = new (external_ol_format_WMTSCapabilities_default())();
  109112. var capabilities = format.read(capabilitiesText);
  109113. var content = capabilities.Contents;
  109114. var tileMatrixSet = content.TileMatrixSet;
  109115. var scales = [];
  109116. for (var i = 0; i < tileMatrixSet.length; i++) {
  109117. if (tileMatrixSet[i].Identifier === identifier) {
  109118. for (var h = 0; h < tileMatrixSet[i].TileMatrix.length; h++) {
  109119. scales.push(tileMatrixSet[i].TileMatrix[h].ScaleDenominator);
  109120. }
  109121. break;
  109122. }
  109123. }
  109124. return scales;
  109125. }
  109126. /**
  109127. * @private
  109128. * @function WebMap.prototype.addBaseMap
  109129. * @description 添加底图
  109130. * @param {string} mapInfo - 请求地图的url
  109131. */
  109132. }, {
  109133. key: "addBaseMap",
  109134. value: function () {
  109135. var _addBaseMap = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee5(mapInfo) {
  109136. var baseLayer, layerType, layer, labelLayer;
  109137. return WebMap_regeneratorRuntime().wrap(function _callee5$(_context5) {
  109138. while (1) switch (_context5.prev = _context5.next) {
  109139. case 0:
  109140. baseLayer = mapInfo.baseLayer, layerType = baseLayer.layerType; //底图,使用默认的配置,不用存储的
  109141. if (!(layerType !== 'TILE' && layerType !== 'WMS' && layerType !== 'WMTS')) {
  109142. _context5.next = 5;
  109143. break;
  109144. }
  109145. this.getInternetMapInfo(baseLayer);
  109146. _context5.next = 18;
  109147. break;
  109148. case 5:
  109149. if (!(layerType === 'WMTS')) {
  109150. _context5.next = 10;
  109151. break;
  109152. }
  109153. _context5.next = 8;
  109154. return this.getWmtsInfo(baseLayer);
  109155. case 8:
  109156. _context5.next = 18;
  109157. break;
  109158. case 10:
  109159. if (!(layerType === 'TILE')) {
  109160. _context5.next = 15;
  109161. break;
  109162. }
  109163. _context5.next = 13;
  109164. return this.getTileInfo(baseLayer);
  109165. case 13:
  109166. _context5.next = 18;
  109167. break;
  109168. case 15:
  109169. if (!(layerType === 'WMS')) {
  109170. _context5.next = 18;
  109171. break;
  109172. }
  109173. _context5.next = 18;
  109174. return this.getWmsInfo(baseLayer);
  109175. case 18:
  109176. baseLayer.projection = mapInfo.projection;
  109177. if (!baseLayer.extent) {
  109178. baseLayer.extent = [mapInfo.extent.leftBottom.x, mapInfo.extent.leftBottom.y, mapInfo.extent.rightTop.x, mapInfo.extent.rightTop.y];
  109179. }
  109180. this.createView(mapInfo);
  109181. layer = this.createBaseLayer(baseLayer, 0, null, null, true); //底图增加图层类型,DV分享需要用它来识别版权信息
  109182. layer.setProperties({
  109183. layerType: layerType
  109184. });
  109185. this.map.addLayer(layer);
  109186. if (this.mapParams) {
  109187. this.mapParams.extent = baseLayer.extent;
  109188. this.mapParams.projection = mapInfo.projection;
  109189. }
  109190. if (baseLayer.labelLayerVisible) {
  109191. //存在天地图路网
  109192. labelLayer = new external_ol_layer_namespaceObject.Tile({
  109193. source: this.createTiandituSource(baseLayer.layerType, mapInfo.projection, true),
  109194. zIndex: baseLayer.zIndex || 1,
  109195. visible: baseLayer.visible
  109196. });
  109197. this.map.addLayer(labelLayer);
  109198. // 挂载带baseLayer上,便于删除
  109199. baseLayer.labelLayer = labelLayer;
  109200. }
  109201. this.limitScale(mapInfo, baseLayer);
  109202. case 27:
  109203. case "end":
  109204. return _context5.stop();
  109205. }
  109206. }, _callee5, this);
  109207. }));
  109208. function addBaseMap(_x5) {
  109209. return _addBaseMap.apply(this, arguments);
  109210. }
  109211. return addBaseMap;
  109212. }()
  109213. }, {
  109214. key: "validScale",
  109215. value: function validScale(scale) {
  109216. if (!scale) {
  109217. return false;
  109218. }
  109219. var scaleNum = scale.split(':')[1];
  109220. if (!scaleNum) {
  109221. return false;
  109222. }
  109223. var res = 1 / +scaleNum;
  109224. if (res === Infinity || res >= 1) {
  109225. return false;
  109226. }
  109227. return true;
  109228. }
  109229. }, {
  109230. key: "limitScale",
  109231. value: function limitScale(mapInfo, baseLayer) {
  109232. if (this.validScale(mapInfo.minScale) && this.validScale(mapInfo.maxScale)) {
  109233. var visibleScales, minScale, maxScale;
  109234. if (baseLayer.layerType === 'WMTS') {
  109235. visibleScales = baseLayer.scales;
  109236. minScale = +mapInfo.minScale.split(':')[1];
  109237. maxScale = +mapInfo.maxScale.split(':')[1];
  109238. } else {
  109239. var scales = this.scales.map(function (scale) {
  109240. return 1 / scale.split(':')[1];
  109241. });
  109242. if (Array.isArray(baseLayer.visibleScales) && baseLayer.visibleScales.length && baseLayer.visibleScales) {
  109243. visibleScales = baseLayer.visibleScales;
  109244. } else {
  109245. visibleScales = scales;
  109246. }
  109247. minScale = 1 / +mapInfo.minScale.split(':')[1];
  109248. maxScale = 1 / +mapInfo.maxScale.split(':')[1];
  109249. }
  109250. var minVisibleScale = this.findNearest(visibleScales, minScale);
  109251. var maxVisibleScale = this.findNearest(visibleScales, maxScale);
  109252. var minZoom = visibleScales.indexOf(minVisibleScale);
  109253. var maxZoom = visibleScales.indexOf(maxVisibleScale);
  109254. if (minZoom > maxZoom) {
  109255. var _ref4 = [maxZoom, minZoom];
  109256. minZoom = _ref4[0];
  109257. maxZoom = _ref4[1];
  109258. }
  109259. if (minZoom !== 0 || maxZoom !== visibleScales.length - 1) {
  109260. this.map.setView(new (external_ol_View_default())(Object.assign({}, this.map.getView().options_, {
  109261. maxResolution: undefined,
  109262. minResolution: undefined,
  109263. minZoom: minZoom,
  109264. maxZoom: maxZoom,
  109265. constrainResolution: false
  109266. })));
  109267. this.map.addInteraction(new (external_ol_interaction_MouseWheelZoom_default())({
  109268. constrainResolution: true
  109269. }));
  109270. }
  109271. }
  109272. }
  109273. }, {
  109274. key: "parseNumber",
  109275. value: function parseNumber(scaleStr) {
  109276. return Number(scaleStr.split(":")[1]);
  109277. }
  109278. }, {
  109279. key: "findNearest",
  109280. value: function findNearest(scales, target) {
  109281. var resultIndex = 0;
  109282. var targetScaleD = target;
  109283. for (var i = 1, len = scales.length; i < len; i++) {
  109284. if (Math.abs(scales[i] - targetScaleD) < Math.abs(scales[resultIndex] - targetScaleD)) {
  109285. resultIndex = i;
  109286. }
  109287. }
  109288. return scales[resultIndex];
  109289. }
  109290. /**
  109291. * @private
  109292. * @function WebMap.prototype.addMVTMapLayer
  109293. * @description 添加地图服务mapboxstyle图层
  109294. * @param {Object} mapInfo - 地图信息
  109295. * @param {Object} layerInfo - mapboxstyle图层信息
  109296. */
  109297. }, {
  109298. key: "addMVTMapLayer",
  109299. value: function addMVTMapLayer(mapInfo, layerInfo, zIndex) {
  109300. var _this4 = this;
  109301. layerInfo.zIndex = zIndex;
  109302. // 获取地图详细信息
  109303. return this.getMapboxStyleLayerInfo(mapInfo, layerInfo).then(function (msLayerInfo) {
  109304. // 创建图层
  109305. return _this4.createMVTLayer(msLayerInfo).then(function (layer) {
  109306. var layerID = core_Util_Util.newGuid(8);
  109307. if (layerInfo.name) {
  109308. layer.setProperties({
  109309. name: layerInfo.name,
  109310. layerID: layerID,
  109311. layerType: 'VECTOR_TILE'
  109312. });
  109313. }
  109314. layerInfo.visibleScale && _this4.setVisibleScales(layer, layerInfo.visibleScale);
  109315. //否则没有ID,对不上号
  109316. layerInfo.layer = layer;
  109317. layerInfo.layerID = layerID;
  109318. _this4.map.addLayer(layer);
  109319. });
  109320. })["catch"](function (error) {
  109321. throw error;
  109322. });
  109323. }
  109324. /**
  109325. * @private
  109326. * @function WebMap.prototype.createView
  109327. * @description 创建地图视图
  109328. * @param {Object} options - 关于地图的信息
  109329. */
  109330. }, {
  109331. key: "createView",
  109332. value: function createView(options) {
  109333. var oldcenter = options.center,
  109334. zoom = options.level !== undefined ? options.level : 1,
  109335. maxZoom = options.maxZoom || 22,
  109336. extent,
  109337. projection = this.baseProjection;
  109338. var center = [];
  109339. for (var key in oldcenter) {
  109340. center.push(oldcenter[key]);
  109341. }
  109342. if (center.length === 0) {
  109343. //兼容wms
  109344. center = [0, 0];
  109345. }
  109346. //与DV一致用底图的默认范围,不用存储的范围。否则会导致地图拖不动
  109347. this.baseLayerExtent = extent = options.baseLayer && options.baseLayer.extent;
  109348. if (this.mapParams) {
  109349. this.mapParams.extent = extent;
  109350. this.mapParams.projection = projection;
  109351. }
  109352. //当前中心点不在extent内,就用extent的中心点 todo
  109353. !(0,external_ol_extent_namespaceObject.containsCoordinate)(extent, center) && (center = (0,external_ol_extent_namespaceObject.getCenter)(extent));
  109354. // 计算当前最大分辨率
  109355. var baseLayer = options.baseLayer;
  109356. var maxResolution;
  109357. if (baseLayer.visibleScales && baseLayer.visibleScales.length > 0 || baseLayer.scales && baseLayer.scales.length > 0) {
  109358. //底图有固定比例尺,就直接获取。不用view计算
  109359. this.getScales(baseLayer);
  109360. } else if (options.baseLayer && extent && extent.length === 4) {
  109361. var width = extent[2] - extent[0];
  109362. var height = extent[3] - extent[1];
  109363. var maxResolution1 = width / 512;
  109364. var maxResolution2 = height / 512;
  109365. maxResolution = Math.max(maxResolution1, maxResolution2);
  109366. }
  109367. // if(options.baseLayer.visibleScales && options.baseLayer.visibleScales.length > 0){
  109368. // maxZoom = options.baseLayer.visibleScales.length;
  109369. // }
  109370. this.map.setView(new (external_ol_View_default())({
  109371. zoom: zoom,
  109372. center: center,
  109373. projection: projection,
  109374. maxZoom: maxZoom,
  109375. maxResolution: maxResolution
  109376. }));
  109377. var viewOptions = {};
  109378. if (baseLayer.scales && baseLayer.scales.length > 0 && baseLayer.layerType === "WMTS" || this.resolutionArray && this.resolutionArray.length > 0) {
  109379. viewOptions = {
  109380. zoom: zoom,
  109381. center: center,
  109382. projection: projection,
  109383. resolutions: this.resolutionArray,
  109384. maxZoom: maxZoom
  109385. };
  109386. } else if (baseLayer.layerType === "WMTS") {
  109387. viewOptions = {
  109388. zoom: zoom,
  109389. center: center,
  109390. projection: projection,
  109391. maxZoom: maxZoom
  109392. };
  109393. this.getScales(baseLayer);
  109394. } else {
  109395. viewOptions = {
  109396. zoom: zoom,
  109397. center: center,
  109398. projection: projection,
  109399. maxResolution: maxResolution,
  109400. maxZoom: maxZoom
  109401. };
  109402. this.getScales(baseLayer);
  109403. }
  109404. if (['4', '5'].indexOf(core_Util_Util.getOlVersion()) < 0) {
  109405. // 兼容 ol 4,5,6
  109406. viewOptions.multiWorld = true;
  109407. viewOptions.showFullExtent = true;
  109408. viewOptions.enableRotation = false;
  109409. viewOptions.constrainResolution = true; //设置此参数,是因为需要显示整数级别。为了可视比例尺中包含当前比例尺
  109410. }
  109411. this.map.setView(new (external_ol_View_default())(viewOptions));
  109412. if (options.visibleExtent) {
  109413. var view = this.map.getView();
  109414. var resolution = view.getResolutionForExtent(options.visibleExtent, this.map.getSize());
  109415. view.setResolution(resolution);
  109416. view.setCenter((0,external_ol_extent_namespaceObject.getCenter)(options.visibleExtent));
  109417. }
  109418. }
  109419. /**
  109420. * @private
  109421. * @function WebMap.prototype.createBaseLayer
  109422. * @description 创建矢量图层,包括底图及其叠加的矢量图层
  109423. * @param {Object} layerInfo - 关于地图的信息
  109424. * @param {number} index - 当前图层在地图中的index
  109425. * @param {boolean} isCallBack - 是否调用回调函数
  109426. * @param {scope} {Object} this对象
  109427. */
  109428. }, {
  109429. key: "createBaseLayer",
  109430. value: function createBaseLayer(layerInfo, index, isCallBack, scope, isBaseLayer) {
  109431. var source,
  109432. that = this;
  109433. if (scope) {
  109434. // 解决异步回调
  109435. that = scope;
  109436. }
  109437. var layerType = layerInfo.layerType; //底图和rest地图兼容
  109438. if (layerType.indexOf('TIANDITU_VEC') > -1 || layerType.indexOf('TIANDITU_IMG') > -1 || layerType.indexOf('TIANDITU_TER') > -1) {
  109439. layerType = layerType.substr(0, 12);
  109440. }
  109441. switch (layerType) {
  109442. case "TIANDITU_VEC":
  109443. case "TIANDITU_IMG":
  109444. case "TIANDITU_TER":
  109445. source = this.createTiandituSource(layerType, layerInfo.projection);
  109446. break;
  109447. case "BAIDU":
  109448. source = this.createBaiduSource();
  109449. break;
  109450. case 'BING':
  109451. source = this.createBingSource(layerInfo, layerInfo.projection);
  109452. break;
  109453. case "WMS":
  109454. source = this.createWMSSource(layerInfo);
  109455. break;
  109456. case "WMTS":
  109457. source = that.createWMTSSource(layerInfo);
  109458. break;
  109459. case 'TILE':
  109460. case 'SUPERMAP_REST':
  109461. source = that.createDynamicTiledSource(layerInfo, isBaseLayer);
  109462. break;
  109463. case 'CLOUD':
  109464. case 'CLOUD_BLACK':
  109465. case 'OSM':
  109466. case 'JAPAN_ORT':
  109467. case 'JAPAN_RELIEF':
  109468. case 'JAPAN_PALE':
  109469. case 'JAPAN_STD':
  109470. case 'GOOGLE_CN':
  109471. case 'GOOGLE':
  109472. source = this.createXYZSource(layerInfo);
  109473. break;
  109474. default:
  109475. break;
  109476. }
  109477. var layer = new external_ol_layer_namespaceObject.Tile({
  109478. source: source,
  109479. zIndex: layerInfo.zIndex || 1,
  109480. visible: layerInfo.visible
  109481. });
  109482. var layerID = core_Util_Util.newGuid(8);
  109483. if (layerInfo.name) {
  109484. layer.setProperties({
  109485. name: layerInfo.name,
  109486. layerID: layerID
  109487. });
  109488. }
  109489. if (layerInfo.visible === undefined || layerInfo.visible === null) {
  109490. layerInfo.visible = true;
  109491. }
  109492. layer.setVisible(layerInfo.visible);
  109493. layerInfo.opacity && layer.setOpacity(layerInfo.opacity);
  109494. //layerInfo没有存储index属性
  109495. index && layer.setZIndex(index);
  109496. //否则没有ID,对不上号
  109497. layerInfo.layer = layer;
  109498. layerInfo.layerID = layerID;
  109499. var visibleScale = layerInfo.visibleScale,
  109500. autoUpdateTime = layerInfo.autoUpdateTime,
  109501. minResolution,
  109502. maxResolution;
  109503. if (visibleScale) {
  109504. maxResolution = this.resolutions[visibleScale.minScale];
  109505. minResolution = this.resolutions[visibleScale.maxScale];
  109506. //比例尺和分别率是反比的关系
  109507. maxResolution > 1 ? layer.setMaxResolution(Math.ceil(maxResolution)) : layer.setMaxResolution(maxResolution * 1.1);
  109508. layer.setMinResolution(minResolution);
  109509. }
  109510. if (autoUpdateTime && !layerInfo.autoUpdateInterval) {
  109511. //自动更新
  109512. layerInfo.autoUpdateInterval = setInterval(function () {
  109513. that.updateTileToMap(layerInfo, index);
  109514. }, autoUpdateTime);
  109515. }
  109516. if (isCallBack) {
  109517. layer.setZIndex(0); // wmts
  109518. that.map.addLayer(layer);
  109519. }
  109520. return layer;
  109521. }
  109522. /**
  109523. * @private
  109524. * @function WebMap.prototype.updateTileToMap
  109525. * @description 获取底图对应的图层信息,不是用请求回来的底图信息
  109526. * @param {Object} layerInfo - 图层信息
  109527. * @param {number} layerIndex - 图层index
  109528. */
  109529. }, {
  109530. key: "updateTileToMap",
  109531. value: function updateTileToMap(layerInfo, layerIndex) {
  109532. this.map.removeLayer(layerInfo.layer);
  109533. this.map.addLayer(this.createBaseLayer(layerInfo, layerIndex));
  109534. }
  109535. /**
  109536. * @private
  109537. * @function WebMap.prototype.getInternetMapInfo
  109538. * @description 获取底图对应的图层信息,不是用请求回来的底图信息
  109539. * @param {Object} baseLayerInfo - 底图信息
  109540. * @returns {Object} 底图的具体信息
  109541. */
  109542. }, {
  109543. key: "getInternetMapInfo",
  109544. value: function getInternetMapInfo(baseLayerInfo) {
  109545. var baiduBounds = [-20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892];
  109546. var bounds_4326 = [-180, -90, 180, 90];
  109547. var osmBounds = [-20037508.34, -20037508.34, 20037508.34, 20037508.34];
  109548. var japanReliefBounds = [12555667.53929, 1281852.98656, 17525908.86651, 7484870.70596];
  109549. var japanOrtBounds = [-19741117.14519, -10003921.36848, 19981677.71404, 19660983.56089];
  109550. baseLayerInfo.units = "m";
  109551. switch (baseLayerInfo.layerType) {
  109552. case 'BAIDU':
  109553. baseLayerInfo.iServerUrl = 'https://map.baidu.com/';
  109554. baseLayerInfo.epsgCode = 'EPSG:3857';
  109555. baseLayerInfo.minZoom = 1;
  109556. baseLayerInfo.maxZoom = 19;
  109557. baseLayerInfo.level = 1;
  109558. baseLayerInfo.extent = baiduBounds;
  109559. // thumbnail: this.getImagePath('bmap.png') 暂时不用到缩略图
  109560. break;
  109561. case 'CLOUD':
  109562. baseLayerInfo.url = 'http://t2.dituhui.com/FileService/image?map=quanguo&type=web&x={x}&y={y}&z={z}';
  109563. baseLayerInfo.epsgCode = 'EPSG:3857';
  109564. baseLayerInfo.minZoom = 1;
  109565. baseLayerInfo.maxZoom = 18;
  109566. baseLayerInfo.level = 1;
  109567. baseLayerInfo.extent = baiduBounds;
  109568. break;
  109569. case 'CLOUD_BLACK':
  109570. baseLayerInfo.url = 'http://t3.dituhui.com/MapService/getGdp?x={x}&y={y}&z={z}';
  109571. baseLayerInfo.epsgCode = 'EPSG:3857';
  109572. baseLayerInfo.minZoom = 1;
  109573. baseLayerInfo.maxZoom = 18;
  109574. baseLayerInfo.level = 1;
  109575. baseLayerInfo.extent = baiduBounds;
  109576. break;
  109577. case 'tencent':
  109578. baseLayerInfo.epsgCode = 'EPSG:3857';
  109579. baseLayerInfo.minZoom = 1;
  109580. baseLayerInfo.maxZoom = 18;
  109581. baseLayerInfo.level = 1;
  109582. baseLayerInfo.extent = baiduBounds;
  109583. break;
  109584. case 'TIANDITU_VEC_3857':
  109585. case 'TIANDITU_IMG_3857':
  109586. case 'TIANDITU_TER_3857':
  109587. baseLayerInfo.iserverUrl = 'https://map.tianditu.gov.cn/';
  109588. baseLayerInfo.epsgCode = 'EPSG:3857';
  109589. baseLayerInfo.minZoom = 0;
  109590. baseLayerInfo.maxZoom = 19;
  109591. baseLayerInfo.level = 1;
  109592. baseLayerInfo.extent = baiduBounds;
  109593. if (baseLayerInfo.layerType === "TIANDITU_TER_3857") {
  109594. baseLayerInfo.maxZoom = 14;
  109595. }
  109596. break;
  109597. case 'TIANDITU_VEC_4326':
  109598. case 'TIANDITU_IMG_4326':
  109599. case 'TIANDITU_TER_4326':
  109600. baseLayerInfo.iserverUrl = 'https://map.tianditu.gov.cn/';
  109601. baseLayerInfo.epsgCode = 'EPSG:4326';
  109602. baseLayerInfo.minZoom = 0;
  109603. baseLayerInfo.maxZoom = 19;
  109604. baseLayerInfo.level = 1;
  109605. baseLayerInfo.extent = bounds_4326;
  109606. if (baseLayerInfo.layerType === "TIANDITU_TER_4326") {
  109607. baseLayerInfo.maxZoom = 14;
  109608. }
  109609. break;
  109610. case 'OSM':
  109611. baseLayerInfo.url = 'http://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png';
  109612. baseLayerInfo.epsgCode = 'EPSG:3857';
  109613. baseLayerInfo.minZoom = 1;
  109614. baseLayerInfo.maxZoom = 19;
  109615. baseLayerInfo.level = 1;
  109616. baseLayerInfo.extent = osmBounds;
  109617. baseLayerInfo.iserverUrl = 'https://www.openstreetmap.org';
  109618. break;
  109619. case 'GOOGLE':
  109620. baseLayerInfo.url = "https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i{z}!2i{x}!3i{y}!4i256!2m3!1e0!2sm!3i540264686!3m12!2s".concat(this.getLang(), "!3sUS!5e18!12m4!1e68!2m2!1sset!2sRoadmap!12m3!1e37!2m1!1ssmartmaps!4e0&key=").concat(this.googleMapsAPIKey);
  109621. baseLayerInfo.epsgCode = 'EPSG:3857';
  109622. baseLayerInfo.minZoom = 1;
  109623. baseLayerInfo.maxZoom = 22;
  109624. baseLayerInfo.level = 1;
  109625. baseLayerInfo.extent = osmBounds;
  109626. baseLayerInfo.iserverUrl = 'https://www.google.cn/maps';
  109627. break;
  109628. case 'JAPAN_STD':
  109629. baseLayerInfo.url = 'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png';
  109630. baseLayerInfo.epsgCode = 'EPSG:3857';
  109631. baseLayerInfo.minZoom = 1;
  109632. baseLayerInfo.maxZoom = 19;
  109633. baseLayerInfo.level = 0;
  109634. baseLayerInfo.extent = osmBounds;
  109635. break;
  109636. case 'JAPAN_PALE':
  109637. baseLayerInfo.url = 'https://cyberjapandata.gsi.go.jp/xyz/pale/{z}/{x}/{y}.png';
  109638. baseLayerInfo.epsgCode = 'EPSG:3857';
  109639. baseLayerInfo.minZoom = 2;
  109640. baseLayerInfo.maxZoom = 19;
  109641. baseLayerInfo.level = 2;
  109642. baseLayerInfo.extent = osmBounds;
  109643. break;
  109644. case 'JAPAN_RELIEF':
  109645. baseLayerInfo.url = 'https://cyberjapandata.gsi.go.jp/xyz/relief/{z}/{x}/{y}.png';
  109646. baseLayerInfo.epsgCode = 'EPSG:3857';
  109647. baseLayerInfo.minZoom = 5;
  109648. baseLayerInfo.maxZoom = 14;
  109649. baseLayerInfo.level = 5;
  109650. baseLayerInfo.extent = japanReliefBounds;
  109651. break;
  109652. case 'JAPAN_ORT':
  109653. baseLayerInfo.url = 'https://cyberjapandata.gsi.go.jp/xyz/ort/{z}/{x}/{y}.jpg';
  109654. baseLayerInfo.epsgCode = 'EPSG:3857';
  109655. baseLayerInfo.minZoom = 2;
  109656. baseLayerInfo.maxZoom = 12;
  109657. baseLayerInfo.level = 2;
  109658. baseLayerInfo.extent = japanOrtBounds;
  109659. break;
  109660. }
  109661. }
  109662. /**
  109663. * @private
  109664. * @function WebMap.prototype.createDynamicTiledSource
  109665. * @description 获取supermap iServer类型的地图的source。
  109666. * @param {Object} layerInfo
  109667. * @param {boolean} isBaseLayer 是否是底图
  109668. */
  109669. }, {
  109670. key: "createDynamicTiledSource",
  109671. value: function createDynamicTiledSource(layerInfo, isBaseLayer) {
  109672. var serverType = "IPORTAL",
  109673. credential = layerInfo.credential ? layerInfo.credential.token : undefined,
  109674. keyfix = 'Token',
  109675. keyParams = layerInfo.url;
  109676. if (layerInfo.url.indexOf("www.supermapol.com") > -1 || layerInfo.url.indexOf("itest.supermapol.com") > -1) {
  109677. keyfix = 'Key';
  109678. keyParams = [keyParams];
  109679. serverType = "ONLINE";
  109680. }
  109681. if (credential) {
  109682. SecurityManager["register".concat(keyfix)](keyParams, credential);
  109683. }
  109684. // extent: isBaseLayer ? layerInfo.extent : ol.proj.transformExtent(layerInfo.extent, layerInfo.projection, this.baseProjection),
  109685. var options = {
  109686. transparent: true,
  109687. url: layerInfo.url,
  109688. wrapX: false,
  109689. serverType: serverType,
  109690. // crossOrigin: 'anonymous', //在IE11.0.9600版本,会影响通过注册服务打开的iserver地图,不出图。因为没有携带cookie会报跨域问题
  109691. // extent: this.baseLayerExtent,
  109692. // prjCoordSys: {epsgCode: isBaseLayer ? layerInfo.projection.split(':')[1] : this.baseProjection.split(':')[1]},
  109693. format: layerInfo.format
  109694. };
  109695. if (!isBaseLayer && !this.isCustomProjection(this.baseProjection)) {
  109696. options.prjCoordSys = {
  109697. epsgCode: this.baseProjection.split(':')[1]
  109698. };
  109699. }
  109700. if (layerInfo.visibleScales && layerInfo.visibleScales.length > 0) {
  109701. var visibleResolutions = [];
  109702. for (var i in layerInfo.visibleScales) {
  109703. var resolution = core_Util_Util.scaleToResolution(layerInfo.visibleScales[i], dpiConfig["default"], layerInfo.coordUnit);
  109704. visibleResolutions.push(resolution);
  109705. }
  109706. layerInfo.visibleResolutions = visibleResolutions;
  109707. var tileGrid = new (external_ol_tilegrid_TileGrid_default())({
  109708. extent: layerInfo.extent,
  109709. resolutions: visibleResolutions
  109710. });
  109711. options.tileGrid = tileGrid;
  109712. } else {
  109713. options.extent = this.baseLayerExtent;
  109714. //bug:ISVJ-2412,不添加下列代码出不了图。参照iserver ol3出图方式
  109715. var _tileGrid = new (external_ol_tilegrid_TileGrid_default())({
  109716. extent: layerInfo.extent,
  109717. resolutions: this.getResolutionsFromBounds(layerInfo.extent)
  109718. });
  109719. options.tileGrid = _tileGrid;
  109720. }
  109721. //主机名相同时不添加代理,iportal geturlResource不支持webp代理
  109722. if (layerInfo.url && !Util_Util.isInTheSameDomain(layerInfo.url) && !this.isIportalProxyServiceUrl(layerInfo.url) && layerInfo.format !== 'webp') {
  109723. options.tileProxy = this.server + 'apps/viewer/getUrlResource.png?url=';
  109724. }
  109725. var source = new TileSuperMapRest(options);
  109726. SecurityManager["register".concat(keyfix)](layerInfo.url);
  109727. return source;
  109728. }
  109729. /**
  109730. * @private
  109731. * @function WebMap.prototype.getResolutionsFromBounds
  109732. * @description 获取比例尺数组
  109733. * @param {Array.<number>} bounds 范围数组
  109734. * @returns {styleResolutions} 比例尺数组
  109735. */
  109736. }, {
  109737. key: "getResolutionsFromBounds",
  109738. value: function getResolutionsFromBounds(bounds) {
  109739. var styleResolutions = [];
  109740. var temp = Math.abs(bounds[0] - bounds[2]) / 512;
  109741. for (var i = 0; i < 22; i++) {
  109742. if (i === 0) {
  109743. styleResolutions[i] = temp;
  109744. continue;
  109745. }
  109746. temp = temp / 2;
  109747. styleResolutions[i] = temp;
  109748. }
  109749. return styleResolutions;
  109750. }
  109751. /**
  109752. * @private
  109753. * @function WebMap.prototype.createTiandituSource
  109754. * @description 创建天地图的source。
  109755. * @param layerType 图层类型
  109756. * @param projection 地理坐标系
  109757. * @param isLabel 是否有路网图层
  109758. * @returns {Tianditu} 天地图的source
  109759. */
  109760. }, {
  109761. key: "createTiandituSource",
  109762. value: function createTiandituSource(layerType, projection, isLabel) {
  109763. var options = {
  109764. layerType: layerType.split('_')[1].toLowerCase(),
  109765. isLabel: isLabel || false,
  109766. projection: projection,
  109767. url: "https://t{0-7}.tianditu.gov.cn/{layer}_{proj}/wmts?tk=".concat(this.tiandituKey)
  109768. };
  109769. return new Tianditu(options);
  109770. }
  109771. /**
  109772. * @private
  109773. * @function WebMap.prototype.createBaiduSource
  109774. * @description 创建百度地图的source。
  109775. * @returns {BaiduMap} baidu地图的source
  109776. */
  109777. }, {
  109778. key: "createBaiduSource",
  109779. value: function createBaiduSource() {
  109780. return new BaiduMap();
  109781. }
  109782. /**
  109783. * @private
  109784. * @function WebMap.prototype.createBingSource
  109785. * @description 创建bing地图的source。
  109786. * @returns {ol.source.XYZ} bing地图的source
  109787. */
  109788. }, {
  109789. key: "createBingSource",
  109790. value: function createBingSource(layerInfo, projection) {
  109791. var url = 'https://dynamic.t0.tiles.ditu.live.com/comp/ch/{quadKey}?it=G,TW,L,LA&mkt=zh-cn&og=109&cstl=w4c&ur=CN&n=z';
  109792. return new (external_ol_source_XYZ_default())({
  109793. wrapX: false,
  109794. projection: projection,
  109795. crossOrigin: 'anonymous',
  109796. tileUrlFunction: function tileUrlFunction(coordinates) {
  109797. var _ref5 = WebMap_toConsumableArray(coordinates),
  109798. z = _ref5[0],
  109799. x = _ref5[1],
  109800. y = _ref5[2];
  109801. y = y > 0 ? y - 1 : -y - 1;
  109802. var index = '';
  109803. for (var i = z; i > 0; i--) {
  109804. var b = 0;
  109805. var mask = 1 << i - 1;
  109806. if ((x & mask) !== 0) {
  109807. b++;
  109808. }
  109809. if ((y & mask) !== 0) {
  109810. b += 2;
  109811. }
  109812. index += b.toString();
  109813. }
  109814. return url.replace('{quadKey}', index);
  109815. }
  109816. });
  109817. }
  109818. /**
  109819. * @private
  109820. * @function WebMap.prototype.createXYZSource
  109821. * @description 创建图层的XYZsource。
  109822. * @param {Object} layerInfo - 图层信息
  109823. * @returns {ol.source.XYZ} xyz的source
  109824. */
  109825. }, {
  109826. key: "createXYZSource",
  109827. value: function createXYZSource(layerInfo) {
  109828. return new (external_ol_source_XYZ_default())({
  109829. url: layerInfo.url,
  109830. wrapX: false,
  109831. crossOrigin: 'anonymous'
  109832. });
  109833. }
  109834. /**
  109835. * @private
  109836. * @function WebMap.prototype.createWMSSource
  109837. * @description 创建wms地图source。
  109838. * @param {Object} layerInfo - 图层信息。
  109839. * @returns {ol.source.TileWMS} wms的source
  109840. */
  109841. }, {
  109842. key: "createWMSSource",
  109843. value: function createWMSSource(layerInfo) {
  109844. var that = this;
  109845. return new (external_ol_source_TileWMS_default())({
  109846. url: layerInfo.url,
  109847. wrapX: false,
  109848. params: {
  109849. LAYERS: layerInfo.layers ? layerInfo.layers[0] : "0",
  109850. FORMAT: 'image/png',
  109851. VERSION: layerInfo.version || "1.3.0"
  109852. },
  109853. projection: layerInfo.projection || that.baseProjection,
  109854. tileLoadFunction: function tileLoadFunction(imageTile, src) {
  109855. imageTile.getImage().src = src;
  109856. }
  109857. });
  109858. }
  109859. /**
  109860. * @private
  109861. * @function WebMap.prototype.getTileLayerExtent
  109862. * @description 获取(Supermap RestMap)的图层参数。
  109863. * @param {Object} layerInfo - 图层信息。
  109864. * @param {function} callback - 获得tile图层参数执行的回调函数
  109865. * @param {function} failedCallback - 失败回调函数
  109866. */
  109867. }, {
  109868. key: "getTileLayerExtent",
  109869. value: function () {
  109870. var _getTileLayerExtent = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee6(layerInfo, callback, failedCallback) {
  109871. var that, dynamicLayerInfo, originLayerInfo;
  109872. return WebMap_regeneratorRuntime().wrap(function _callee6$(_context6) {
  109873. while (1) switch (_context6.prev = _context6.next) {
  109874. case 0:
  109875. that = this; // 默认使用动态投影方式请求数据
  109876. _context6.next = 3;
  109877. return that.getTileLayerExtentInfo(layerInfo);
  109878. case 3:
  109879. dynamicLayerInfo = _context6.sent;
  109880. if (!(dynamicLayerInfo.succeed === false)) {
  109881. _context6.next = 15;
  109882. break;
  109883. }
  109884. if (!(dynamicLayerInfo.error.code === 400)) {
  109885. _context6.next = 12;
  109886. break;
  109887. }
  109888. _context6.next = 8;
  109889. return that.getTileLayerExtentInfo(layerInfo, false);
  109890. case 8:
  109891. originLayerInfo = _context6.sent;
  109892. if (originLayerInfo.succeed === false) {
  109893. failedCallback();
  109894. } else {
  109895. Object.assign(layerInfo, originLayerInfo);
  109896. callback(layerInfo);
  109897. }
  109898. _context6.next = 13;
  109899. break;
  109900. case 12:
  109901. failedCallback();
  109902. case 13:
  109903. _context6.next = 17;
  109904. break;
  109905. case 15:
  109906. Object.assign(layerInfo, dynamicLayerInfo);
  109907. callback(layerInfo);
  109908. case 17:
  109909. case "end":
  109910. return _context6.stop();
  109911. }
  109912. }, _callee6, this);
  109913. }));
  109914. function getTileLayerExtent(_x6, _x7, _x8) {
  109915. return _getTileLayerExtent.apply(this, arguments);
  109916. }
  109917. return getTileLayerExtent;
  109918. }()
  109919. /**
  109920. * @private
  109921. * @function WebMap.prototype.getTileLayerExtentInfo
  109922. * @description 获取rest map的图层参数。
  109923. * @param {Object} layerInfo - 图层信息。
  109924. * @param {boolean} isDynamic - 是否请求动态投影信息
  109925. */
  109926. }, {
  109927. key: "getTileLayerExtentInfo",
  109928. value: function getTileLayerExtentInfo(layerInfo) {
  109929. var isDynamic = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  109930. var that = this,
  109931. token,
  109932. url = layerInfo.url.trim(),
  109933. credential = layerInfo.credential,
  109934. options = {
  109935. withCredentials: this.withCredentials,
  109936. withoutFormatSuffix: true
  109937. };
  109938. if (isDynamic) {
  109939. var projection = {
  109940. epsgCode: that.baseProjection.split(":")[1]
  109941. };
  109942. if (!that.isCustomProjection(that.baseProjection)) {
  109943. // bug IE11 不会自动编码
  109944. url += '.json?prjCoordSys=' + encodeURI(JSON.stringify(projection));
  109945. }
  109946. }
  109947. if (credential) {
  109948. url = "".concat(url, "&token=").concat(encodeURI(credential.token));
  109949. token = credential.token;
  109950. }
  109951. url = this.handleJSONSuffix(url);
  109952. return FetchRequest.get(that.getRequestUrl(url), null, options).then(function (response) {
  109953. return response.json();
  109954. }).then( /*#__PURE__*/function () {
  109955. var _ref6 = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee7(result) {
  109956. var format, isSupportWebp;
  109957. return WebMap_regeneratorRuntime().wrap(function _callee7$(_context7) {
  109958. while (1) switch (_context7.prev = _context7.next) {
  109959. case 0:
  109960. if (!(result.succeed === false)) {
  109961. _context7.next = 2;
  109962. break;
  109963. }
  109964. return _context7.abrupt("return", result);
  109965. case 2:
  109966. format = 'png';
  109967. if (!(that.tileFormat === 'webp')) {
  109968. _context7.next = 8;
  109969. break;
  109970. }
  109971. _context7.next = 6;
  109972. return that.isSupportWebp(layerInfo.url, token);
  109973. case 6:
  109974. isSupportWebp = _context7.sent;
  109975. format = isSupportWebp ? 'webp' : 'png';
  109976. case 8:
  109977. return _context7.abrupt("return", {
  109978. units: result.coordUnit && result.coordUnit.toLowerCase(),
  109979. coordUnit: result.coordUnit,
  109980. visibleScales: result.visibleScales,
  109981. extent: [result.bounds.left, result.bounds.bottom, result.bounds.right, result.bounds.top],
  109982. projection: "EPSG:".concat(result.prjCoordSys.epsgCode),
  109983. format: format
  109984. });
  109985. case 9:
  109986. case "end":
  109987. return _context7.stop();
  109988. }
  109989. }, _callee7);
  109990. }));
  109991. return function (_x9) {
  109992. return _ref6.apply(this, arguments);
  109993. };
  109994. }())["catch"](function (error) {
  109995. return {
  109996. succeed: false,
  109997. error: error
  109998. };
  109999. });
  110000. }
  110001. /**
  110002. * @private
  110003. * @function WebMap.prototype.getTileInfo
  110004. * @description 获取rest map的图层参数。
  110005. * @param {Object} layerInfo - 图层信息。
  110006. * @param {function} callback - 获得wmts图层参数执行的回调函数
  110007. */
  110008. }, {
  110009. key: "getTileInfo",
  110010. value: function getTileInfo(layerInfo, callback, mapInfo) {
  110011. var that = this;
  110012. var options = {
  110013. withCredentials: this.withCredentials,
  110014. withoutFormatSuffix: true
  110015. };
  110016. if (layerInfo.url.indexOf("?token=") > -1) {
  110017. that.credentialKey = 'token';
  110018. that.credentialValue = layerInfo.credential = layerInfo.url.split("?token=")[1];
  110019. layerInfo.url = layerInfo.url.split("?token=")[0];
  110020. }
  110021. var url = this.handleJSONSuffix(layerInfo.url);
  110022. return FetchRequest.get(that.getRequestUrl(url), null, options).then(function (response) {
  110023. return response.json();
  110024. }).then( /*#__PURE__*/function () {
  110025. var _ref7 = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee8(result) {
  110026. var token, isSupprtWebp;
  110027. return WebMap_regeneratorRuntime().wrap(function _callee8$(_context8) {
  110028. while (1) switch (_context8.prev = _context8.next) {
  110029. case 0:
  110030. if (!(result && result.code && result.code !== 200)) {
  110031. _context8.next = 2;
  110032. break;
  110033. }
  110034. throw result;
  110035. case 2:
  110036. if (result.visibleScales) {
  110037. layerInfo.visibleScales = result.visibleScales;
  110038. layerInfo.coordUnit = result.coordUnit;
  110039. }
  110040. layerInfo.maxZoom = result.maxZoom;
  110041. layerInfo.maxZoom = result.minZoom;
  110042. token = layerInfo.credential ? layerInfo.credential.token : undefined;
  110043. layerInfo.format = 'png';
  110044. // china_dark为默认底图,还是用png出图
  110045. if (!(that.tileFormat === 'webp' && layerInfo.url !== 'https://maptiles.supermapol.com/iserver/services/map_China/rest/maps/China_Dark')) {
  110046. _context8.next = 12;
  110047. break;
  110048. }
  110049. _context8.next = 10;
  110050. return that.isSupportWebp(layerInfo.url, token);
  110051. case 10:
  110052. isSupprtWebp = _context8.sent;
  110053. layerInfo.format = isSupprtWebp ? 'webp' : 'png';
  110054. case 12:
  110055. // 请求结果完成 继续添加图层
  110056. if (mapInfo) {
  110057. //todo 这个貌似没有用到,下次优化
  110058. callback && callback(mapInfo, null, true, that);
  110059. } else {
  110060. callback && callback(layerInfo);
  110061. }
  110062. case 13:
  110063. case "end":
  110064. return _context8.stop();
  110065. }
  110066. }, _callee8);
  110067. }));
  110068. return function (_x10) {
  110069. return _ref7.apply(this, arguments);
  110070. };
  110071. }())["catch"](function (error) {
  110072. that.errorCallback && that.errorCallback(error, 'getTileInfo', that.map);
  110073. });
  110074. }
  110075. /**
  110076. * @private
  110077. * @function WebMap.prototype.getWMTSUrl
  110078. * @description 获取wmts请求文档的url
  110079. * @param {string} url - 图层信息。
  110080. * @param {boolean} isKvp - 是否为kvp模式
  110081. */
  110082. }, {
  110083. key: "getWMTSUrl",
  110084. value: function getWMTSUrl(url, isKvp) {
  110085. var splitStr = '?';
  110086. if (url.indexOf('?') > -1) {
  110087. splitStr = '&';
  110088. }
  110089. if (isKvp) {
  110090. url += splitStr + 'SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetCapabilities';
  110091. } else {
  110092. url += splitStr + '/1.0.0/WMTSCapabilities.xml';
  110093. }
  110094. return this.getRequestUrl(url, true);
  110095. }
  110096. /**
  110097. * @private
  110098. * @function WebMap.prototype.getWmtsInfo
  110099. * @description 获取wmts的图层参数。
  110100. * @param {Object} layerInfo - 图层信息。
  110101. * @param {function} callback - 获得wmts图层参数执行的回调函数
  110102. */
  110103. }, {
  110104. key: "getWmtsInfo",
  110105. value: function getWmtsInfo(layerInfo, callback) {
  110106. var that = this;
  110107. var options = {
  110108. withCredentials: that.withCredentials,
  110109. withoutFormatSuffix: true
  110110. };
  110111. var isKvp = !layerInfo.requestEncoding || layerInfo.requestEncoding === 'KVP';
  110112. return FetchRequest.get(that.getWMTSUrl(layerInfo.url, isKvp), null, options).then(function (response) {
  110113. return response.text();
  110114. }).then(function (capabilitiesText) {
  110115. var format = new (external_ol_format_WMTSCapabilities_default())();
  110116. var capabilities = format.read(capabilitiesText);
  110117. if (that.isValidResponse(capabilities)) {
  110118. var content = capabilities.Contents;
  110119. var tileMatrixSet = content.TileMatrixSet,
  110120. layers = content.Layer,
  110121. layer,
  110122. idx,
  110123. layerFormat,
  110124. style = 'default';
  110125. for (var n = 0; n < layers.length; n++) {
  110126. if (layers[n].Identifier === layerInfo.layer) {
  110127. idx = n;
  110128. layer = layers[idx];
  110129. layerFormat = layer.Format[0];
  110130. var layerBounds = layer.WGS84BoundingBox;
  110131. // tileMatrixSetLink = layer.TileMatrixSetLink;
  110132. break;
  110133. }
  110134. }
  110135. layer && layer.Style && layer.Style.forEach(function (value) {
  110136. if (value.isDefault) {
  110137. style = value.Identifier;
  110138. }
  110139. });
  110140. var scales = [],
  110141. matrixIds = [];
  110142. for (var i = 0; i < tileMatrixSet.length; i++) {
  110143. if (tileMatrixSet[i].Identifier === layerInfo.tileMatrixSet) {
  110144. var wmtsLayerEpsg = "EPSG:".concat(tileMatrixSet[i].SupportedCRS.split('::')[1]);
  110145. for (var h = 0; h < tileMatrixSet[i].TileMatrix.length; h++) {
  110146. scales.push(tileMatrixSet[i].TileMatrix[h].ScaleDenominator);
  110147. matrixIds.push(tileMatrixSet[i].TileMatrix[h].Identifier);
  110148. }
  110149. //bug wmts出图需要加上origin,否则会出现出图不正确的情况。偏移或者瓦片出不了
  110150. var origin = tileMatrixSet[i].TileMatrix[0].TopLeftCorner;
  110151. layerInfo.origin = ["EPSG:4326", "EPSG:4490"].indexOf(wmtsLayerEpsg) > -1 ? [origin[1], origin[0]] : origin;
  110152. break;
  110153. }
  110154. }
  110155. var name = layerInfo.name,
  110156. extent;
  110157. if (layerBounds) {
  110158. if (layerBounds[0] < -180) {
  110159. layerBounds[0] = -180;
  110160. }
  110161. if (layerBounds[1] < -90) {
  110162. layerBounds[1] = -90;
  110163. }
  110164. if (layerBounds[2] > 180) {
  110165. layerBounds[2] = 180;
  110166. }
  110167. if (layerBounds[3] > 90) {
  110168. layerBounds[3] = 90;
  110169. }
  110170. extent = external_ol_proj_namespaceObject.transformExtent(layerBounds, 'EPSG:4326', that.baseProjection);
  110171. } else {
  110172. extent = external_ol_proj_namespaceObject.get(that.baseProjection).getExtent();
  110173. }
  110174. layerInfo.tileUrl = that.getTileUrl(capabilities.OperationsMetadata.GetTile.DCP.HTTP.Get, layer, layerFormat, isKvp);
  110175. //将需要的参数补上
  110176. layerInfo.extent = extent;
  110177. layerInfo.name = name;
  110178. layerInfo.orginEpsgCode = layerInfo.projection;
  110179. layerInfo.overLayer = true;
  110180. layerInfo.scales = scales;
  110181. layerInfo.style = style;
  110182. layerInfo.title = name;
  110183. layerInfo.unit = "m";
  110184. layerInfo.layerFormat = layerFormat;
  110185. layerInfo.matrixIds = matrixIds;
  110186. callback && callback(layerInfo);
  110187. }
  110188. })["catch"](function (error) {
  110189. that.errorCallback && that.errorCallback(error, 'getWmtsFaild', that.map);
  110190. });
  110191. }
  110192. /**
  110193. * @private
  110194. * @function WebMap.prototype.getWmsInfo
  110195. * @description 获取wms的图层参数。
  110196. * @param {Object} layerInfo - 图层信息。
  110197. */
  110198. }, {
  110199. key: "getWmsInfo",
  110200. value: function getWmsInfo(layerInfo) {
  110201. var that = this;
  110202. var url = layerInfo.url.trim();
  110203. url += url.indexOf('?') > -1 ? '&SERVICE=WMS&REQUEST=GetCapabilities' : '?SERVICE=WMS&REQUEST=GetCapabilities';
  110204. var options = {
  110205. withCredentials: that.withCredentials,
  110206. withoutFormatSuffix: true
  110207. };
  110208. var promise = new Promise(function (resolve) {
  110209. return FetchRequest.get(that.getRequestUrl(url, true), null, options).then(function (response) {
  110210. return response.text();
  110211. }).then( /*#__PURE__*/function () {
  110212. var _ref8 = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee9(capabilitiesText) {
  110213. var format, capabilities, layers, proj, i, layer, bbox;
  110214. return WebMap_regeneratorRuntime().wrap(function _callee9$(_context9) {
  110215. while (1) switch (_context9.prev = _context9.next) {
  110216. case 0:
  110217. format = new (external_ol_format_WMSCapabilities_default())();
  110218. capabilities = format.read(capabilitiesText);
  110219. if (!capabilities) {
  110220. _context9.next = 17;
  110221. break;
  110222. }
  110223. layers = capabilities.Capability.Layer.Layer, proj = layerInfo.projection;
  110224. layerInfo.subLayers = layerInfo.layers[0];
  110225. layerInfo.version = capabilities.version;
  110226. i = 0;
  110227. case 7:
  110228. if (!(i < layers.length)) {
  110229. _context9.next = 17;
  110230. break;
  110231. }
  110232. if (!(layerInfo.layers[0] === layers[i].name)) {
  110233. _context9.next = 14;
  110234. break;
  110235. }
  110236. layer = layers[i];
  110237. if (!layer.bbox[proj]) {
  110238. _context9.next = 14;
  110239. break;
  110240. }
  110241. bbox = layer.bbox[proj].bbox; // wmts 130 坐标轴是否反向,目前还无法判断
  110242. // 后续还需继续完善WKT 增加坐标轴方向值
  110243. // 目前wkt信息 来自https://epsg.io/
  110244. // 提供坐标方向值的网站 如:https://www.epsg-registry.org/export.htm?wkt=urn:ogc:def:crs:EPSG::4490
  110245. if (layerInfo.version === "1.3.0" && layerInfo.projection === "EPSG:4326" || layerInfo.version === "1.3.0" && layerInfo.projection === "EPSG:4490") {
  110246. layerInfo.extent = [bbox[1], bbox[0], bbox[3], bbox[2]];
  110247. } else {
  110248. layerInfo.extent = bbox;
  110249. }
  110250. return _context9.abrupt("break", 17);
  110251. case 14:
  110252. i++;
  110253. _context9.next = 7;
  110254. break;
  110255. case 17:
  110256. resolve();
  110257. case 18:
  110258. case "end":
  110259. return _context9.stop();
  110260. }
  110261. }, _callee9);
  110262. }));
  110263. return function (_x11) {
  110264. return _ref8.apply(this, arguments);
  110265. };
  110266. }())["catch"](function (error) {
  110267. that.errorCallback && that.errorCallback(error, 'getWMSFaild', that.map);
  110268. resolve();
  110269. });
  110270. });
  110271. return promise;
  110272. }
  110273. /**
  110274. * @private
  110275. * @function WebMap.prototype.getTileUrl
  110276. * @description 获取wmts的图层参数。
  110277. * @param {Object} getTileArray - 图层信息。
  110278. * @param {string} layer - 选择的图层
  110279. * @param {string} format - 选择的出图方式
  110280. * @param {boolean} isKvp - 是否是kvp方式
  110281. */
  110282. }, {
  110283. key: "getTileUrl",
  110284. value: function getTileUrl(getTileArray, layer, format, isKvp) {
  110285. var url;
  110286. if (isKvp) {
  110287. getTileArray.forEach(function (data) {
  110288. if (data.Constraint[0].AllowedValues.Value[0].toUpperCase() === 'KVP') {
  110289. url = data.href;
  110290. }
  110291. });
  110292. } else {
  110293. var reuslt = layer.ResourceURL.filter(function (resource) {
  110294. return resource.format === format;
  110295. });
  110296. url = reuslt[0].template;
  110297. }
  110298. return url;
  110299. }
  110300. /**
  110301. * @private
  110302. * @function WebMap.prototype.createWMTSSource
  110303. * @description 获取WMTS类型图层的source。
  110304. * @param {Object} layerInfo - 图层信息。
  110305. * @returns {ol.source.WMTS} wmts的souce
  110306. */
  110307. }, {
  110308. key: "createWMTSSource",
  110309. value: function createWMTSSource(layerInfo) {
  110310. var extent = layerInfo.extent || external_ol_proj_namespaceObject.get(layerInfo.projection).getExtent();
  110311. // 单位通过坐标系获取 (PS: 以前代码非4326 都默认是米)
  110312. var unit = external_ol_proj_namespaceObject.get(this.baseProjection).getUnits();
  110313. return new (external_ol_source_WMTS_default())({
  110314. url: layerInfo.tileUrl || layerInfo.url,
  110315. layer: layerInfo.layer,
  110316. format: layerInfo.layerFormat,
  110317. style: layerInfo.style,
  110318. matrixSet: layerInfo.tileMatrixSet,
  110319. requestEncoding: layerInfo.requestEncoding || 'KVP',
  110320. tileGrid: this.getWMTSTileGrid(extent, layerInfo.scales, unit, layerInfo.dpi, layerInfo.origin, layerInfo.matrixIds),
  110321. tileLoadFunction: function tileLoadFunction(imageTile, src) {
  110322. if (src.indexOf('tianditu.gov.cn') >= 0) {
  110323. imageTile.getImage().src = "".concat(src, "&tk=").concat(Util_Util.getParameters(layerInfo.url)['tk']);
  110324. return;
  110325. }
  110326. imageTile.getImage().src = src;
  110327. }
  110328. });
  110329. }
  110330. /**
  110331. * @private
  110332. * @function WebMap.prototype.getWMTSTileGrid
  110333. * @description 获取wmts的瓦片。
  110334. * @param {Object} extent - 图层范围。
  110335. * @param {number} scales - 图层比例尺
  110336. * @param {string} unit - 单位
  110337. * @param {number} dpi - dpi
  110338. * @param {Array} origin 瓦片的原点
  110339. * @returns {ol.tilegrid.WMTS} wmts的瓦片
  110340. */
  110341. }, {
  110342. key: "getWMTSTileGrid",
  110343. value: function getWMTSTileGrid(extent, scales, unit, dpi, origin, matrixIds) {
  110344. var resolutionsInfo = this.getReslutionsFromScales(scales, dpi || dpiConfig.iServerWMTS, unit);
  110345. return new (external_ol_tilegrid_WMTS_default())({
  110346. origin: origin,
  110347. extent: extent,
  110348. resolutions: resolutionsInfo.res,
  110349. matrixIds: matrixIds || resolutionsInfo.matrixIds
  110350. });
  110351. }
  110352. /**
  110353. * @private
  110354. * @function WebMap.prototype.getReslutionsFromScales
  110355. * @description 根据比例尺(比例尺分母)、地图单位、dpi、获取一个分辨率数组
  110356. * @param {Array.<number>} scales - 比例尺(比例尺分母)
  110357. * @param {number} dpi - 地图dpi
  110358. * @param {string} unit - 单位
  110359. * @param {number} datumAxis
  110360. * @returns {{res: Array, matrixIds: Array}}
  110361. */
  110362. }, {
  110363. key: "getReslutionsFromScales",
  110364. value: function getReslutionsFromScales(scales, dpi, unit, datumAxis) {
  110365. unit = unit && unit.toLowerCase() || 'degrees';
  110366. dpi = dpi || dpiConfig.iServerWMTS;
  110367. datumAxis = datumAxis || 6378137;
  110368. var res = [],
  110369. matrixIds = [];
  110370. //给个默认的
  110371. if (core_Util_Util.isArray(scales)) {
  110372. scales && scales.forEach(function (scale, idx) {
  110373. if (scale > 1.0) {
  110374. matrixIds.push(idx);
  110375. res.push(this.getResolutionFromScale(scale, dpi, unit, datumAxis));
  110376. }
  110377. }, this);
  110378. } else {
  110379. var tileMatrixSet = scales['TileMatrix'];
  110380. tileMatrixSet && tileMatrixSet.forEach(function (tileMatrix) {
  110381. matrixIds.push(tileMatrix['Identifier']);
  110382. res.push(this.getResolutionFromScale(tileMatrix['ScaleDenominator'], dpi, unit, datumAxis));
  110383. }, this);
  110384. }
  110385. return {
  110386. res: res,
  110387. matrixIds: matrixIds
  110388. };
  110389. }
  110390. /**
  110391. * @private
  110392. * @function WebMap.prototype.getResolutionFromScale
  110393. * @description 获取一个WMTS source需要的tileGrid
  110394. * @param {number} scale - 比例尺(比例尺分母)
  110395. * @param {number} dpi - 地图dpi
  110396. * @param {string} unit - 单位
  110397. * @param {number} datumAxis
  110398. * @returns {{res: Array, matrixIds: Array}}
  110399. */
  110400. }, {
  110401. key: "getResolutionFromScale",
  110402. value: function getResolutionFromScale(scale) {
  110403. var dpi = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : dpiConfig["default"];
  110404. var unit = arguments.length > 2 ? arguments[2] : undefined;
  110405. var datumAxis = arguments.length > 3 ? arguments[3] : undefined;
  110406. //radio = 10000;
  110407. var res;
  110408. scale = +scale;
  110409. scale = scale > 1.0 ? 1.0 / scale : scale;
  110410. if (unit === 'degrees' || unit === 'dd' || unit === 'degree') {
  110411. res = 0.0254 * 10000 / dpi / scale / (Math.PI * 2 * datumAxis / 360) / 10000;
  110412. } else {
  110413. res = 0.0254 * 10000 / dpi / scale / 10000;
  110414. }
  110415. return res;
  110416. }
  110417. /**
  110418. * @private
  110419. * @function WebMap.prototype.isValidResponse
  110420. * @description 返回信息是否符合对应类型的标准
  110421. * @param {Object} response - 返回的信息
  110422. * @returns {boolean}
  110423. */
  110424. }, {
  110425. key: "isValidResponse",
  110426. value: function isValidResponse(response) {
  110427. var responseEnum = ['Contents', 'OperationsMetadata'],
  110428. valid = true;
  110429. for (var i = 0; i < responseEnum.length; i++) {
  110430. if (!response[responseEnum[i]] || response.error) {
  110431. valid = false;
  110432. break;
  110433. }
  110434. }
  110435. return valid;
  110436. }
  110437. /**
  110438. * @private
  110439. * @function WebMap.prototype.addLayers
  110440. * @description 添加叠加图层
  110441. * @param {Object} mapInfo - 地图信息
  110442. */
  110443. }, {
  110444. key: "addLayers",
  110445. value: function () {
  110446. var _addLayers = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee16(mapInfo) {
  110447. var _this5 = this;
  110448. var layers, that, features, len, _loop, _ret, index;
  110449. return WebMap_regeneratorRuntime().wrap(function _callee16$(_context17) {
  110450. while (1) switch (_context17.prev = _context17.next) {
  110451. case 0:
  110452. layers = mapInfo.layers, that = this;
  110453. features = [], len = layers.length;
  110454. if (!(len > 0)) {
  110455. _context17.next = 14;
  110456. break;
  110457. }
  110458. //存储地图上所有的图层对象
  110459. this.layers = layers;
  110460. _loop = /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _loop() {
  110461. var layer, layerIndex, dataSource, isSampleData, _dataSource, serverId, url, isMapService, _serverId;
  110462. return WebMap_regeneratorRuntime().wrap(function _loop$(_context16) {
  110463. while (1) switch (_context16.prev = _context16.next) {
  110464. case 0:
  110465. layer = layers[index]; //加上底图的index
  110466. layerIndex = index + 1, dataSource = layer.dataSource, isSampleData = dataSource && dataSource.type === "SAMPLE_DATA" && !!dataSource.name; //SAMPLE_DATA是本地示例数据
  110467. if (!(layer.layerType === "MAPBOXSTYLE")) {
  110468. _context16.next = 6;
  110469. break;
  110470. }
  110471. that.addMVTMapLayer(mapInfo, layer, layerIndex).then(function () {
  110472. that.layerAdded++;
  110473. that.sendMapToUser(len);
  110474. })["catch"](function (error) {
  110475. that.layerAdded++;
  110476. that.sendMapToUser(len);
  110477. that.errorCallback && that.errorCallback(error, 'getLayerFaild', that.map);
  110478. });
  110479. _context16.next = 18;
  110480. break;
  110481. case 6:
  110482. if (!(dataSource && dataSource.serverId || layer.layerType === "MARKER" || layer.layerType === 'HOSTED_TILE' || isSampleData)) {
  110483. _context16.next = 17;
  110484. break;
  110485. }
  110486. //数据存储到iportal上了
  110487. _dataSource = layer.dataSource, serverId = _dataSource ? _dataSource.serverId : layer.serverId;
  110488. if (!(!serverId && !isSampleData)) {
  110489. _context16.next = 14;
  110490. break;
  110491. }
  110492. _context16.next = 11;
  110493. return that.addLayer(layer, null, layerIndex);
  110494. case 11:
  110495. that.layerAdded++;
  110496. that.sendMapToUser(len);
  110497. return _context16.abrupt("return", {
  110498. v: void 0
  110499. });
  110500. case 14:
  110501. if (layer.layerType === "MARKER" || _dataSource && (!_dataSource.accessType || _dataSource.accessType === 'DIRECT') || isSampleData) {
  110502. //原来二进制文件
  110503. url = isSampleData ? "".concat(that.server, "apps/dataviz/libs/sample-datas/").concat(_dataSource.name, ".json") : "".concat(that.server, "web/datas/").concat(serverId, "/content.json?pageSize=9999999&currentPage=1");
  110504. url = that.getRequestUrl(url);
  110505. FetchRequest.get(url, null, {
  110506. withCredentials: _this5.withCredentials
  110507. }).then(function (response) {
  110508. return response.json();
  110509. }).then( /*#__PURE__*/function () {
  110510. var _ref9 = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee10(data) {
  110511. var _layer$dataSource$adm2, divisionType, divisionField, geojson, content;
  110512. return WebMap_regeneratorRuntime().wrap(function _callee10$(_context10) {
  110513. while (1) switch (_context10.prev = _context10.next) {
  110514. case 0:
  110515. if (!(data.succeed === false)) {
  110516. _context10.next = 5;
  110517. break;
  110518. }
  110519. //请求失败
  110520. that.layerAdded++;
  110521. that.sendMapToUser(len);
  110522. that.errorCallback && that.errorCallback(data.error, 'getLayerFaild', that.map);
  110523. return _context10.abrupt("return");
  110524. case 5:
  110525. if (!(data && data.type)) {
  110526. _context10.next = 29;
  110527. break;
  110528. }
  110529. if (!(data.type === "JSON" || data.type === "GEOJSON")) {
  110530. _context10.next = 11;
  110531. break;
  110532. }
  110533. data.content = data.content.type ? data.content : JSON.parse(data.content);
  110534. features = that.geojsonToFeature(data.content, layer);
  110535. _context10.next = 25;
  110536. break;
  110537. case 11:
  110538. if (!(data.type === 'EXCEL' || data.type === 'CSV')) {
  110539. _context10.next = 24;
  110540. break;
  110541. }
  110542. if (!(layer.dataSource && layer.dataSource.administrativeInfo)) {
  110543. _context10.next = 19;
  110544. break;
  110545. }
  110546. //行政规划信息
  110547. data.content.rows.unshift(data.content.colTitles);
  110548. _layer$dataSource$adm2 = layer.dataSource.administrativeInfo, divisionType = _layer$dataSource$adm2.divisionType, divisionField = _layer$dataSource$adm2.divisionField;
  110549. geojson = that.excelData2FeatureByDivision(data.content, divisionType, divisionField);
  110550. features = that._parseGeoJsonData2Feature({
  110551. allDatas: {
  110552. features: geojson.features
  110553. },
  110554. fileCode: layer.projection
  110555. });
  110556. _context10.next = 22;
  110557. break;
  110558. case 19:
  110559. _context10.next = 21;
  110560. return that.excelData2Feature(data.content, layer);
  110561. case 21:
  110562. features = _context10.sent;
  110563. case 22:
  110564. _context10.next = 25;
  110565. break;
  110566. case 24:
  110567. if (data.type === 'SHP') {
  110568. content = JSON.parse(data.content);
  110569. data.content = content.layers[0];
  110570. features = that.geojsonToFeature(data.content, layer);
  110571. }
  110572. case 25:
  110573. _context10.next = 27;
  110574. return that.addLayer(layer, features, layerIndex);
  110575. case 27:
  110576. that.layerAdded++;
  110577. that.sendMapToUser(len);
  110578. case 29:
  110579. case "end":
  110580. return _context10.stop();
  110581. }
  110582. }, _callee10);
  110583. }));
  110584. return function (_x13) {
  110585. return _ref9.apply(this, arguments);
  110586. };
  110587. }())["catch"](function (error) {
  110588. that.layerAdded++;
  110589. that.sendMapToUser(len);
  110590. that.errorCallback && that.errorCallback(error, 'getLayerFaild', that.map);
  110591. });
  110592. } else {
  110593. //关系型文件
  110594. isMapService = layer.layerType === 'HOSTED_TILE', _serverId = _dataSource ? _dataSource.serverId : layer.serverId;
  110595. that.checkUploadToRelationship(_serverId).then(function (result) {
  110596. if (result && result.length > 0) {
  110597. var datasetName = result[0].name,
  110598. featureType = result[0].type.toUpperCase();
  110599. that.getDataService(_serverId, datasetName).then( /*#__PURE__*/function () {
  110600. var _ref10 = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee13(data) {
  110601. var dataItemServices, dataService;
  110602. return WebMap_regeneratorRuntime().wrap(function _callee13$(_context13) {
  110603. while (1) switch (_context13.prev = _context13.next) {
  110604. case 0:
  110605. dataItemServices = data.dataItemServices;
  110606. if (!(dataItemServices.length === 0)) {
  110607. _context13.next = 6;
  110608. break;
  110609. }
  110610. that.layerAdded++;
  110611. that.sendMapToUser(len);
  110612. that.errorCallback && that.errorCallback(null, 'getLayerFaild', that.map);
  110613. return _context13.abrupt("return");
  110614. case 6:
  110615. if (!isMapService) {
  110616. _context13.next = 11;
  110617. break;
  110618. }
  110619. //需要判断是使用tile还是mvt服务
  110620. dataService = that.getService(dataItemServices, 'RESTDATA');
  110621. that.isMvt(dataService.address, datasetName).then( /*#__PURE__*/function () {
  110622. var _ref11 = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee11(info) {
  110623. return WebMap_regeneratorRuntime().wrap(function _callee11$(_context11) {
  110624. while (1) switch (_context11.prev = _context11.next) {
  110625. case 0:
  110626. _context11.next = 2;
  110627. return that.getServiceInfoFromLayer(layerIndex, len, layer, dataItemServices, datasetName, featureType, info);
  110628. case 2:
  110629. case "end":
  110630. return _context11.stop();
  110631. }
  110632. }, _callee11);
  110633. }));
  110634. return function (_x15) {
  110635. return _ref11.apply(this, arguments);
  110636. };
  110637. }())["catch"]( /*#__PURE__*/WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee12() {
  110638. return WebMap_regeneratorRuntime().wrap(function _callee12$(_context12) {
  110639. while (1) switch (_context12.prev = _context12.next) {
  110640. case 0:
  110641. _context12.next = 2;
  110642. return that.getServiceInfoFromLayer(layerIndex, len, layer, dataItemServices, datasetName, featureType);
  110643. case 2:
  110644. case "end":
  110645. return _context12.stop();
  110646. }
  110647. }, _callee12);
  110648. })));
  110649. _context13.next = 13;
  110650. break;
  110651. case 11:
  110652. _context13.next = 13;
  110653. return that.getServiceInfoFromLayer(layerIndex, len, layer, dataItemServices, datasetName, featureType);
  110654. case 13:
  110655. case "end":
  110656. return _context13.stop();
  110657. }
  110658. }, _callee13);
  110659. }));
  110660. return function (_x14) {
  110661. return _ref10.apply(this, arguments);
  110662. };
  110663. }());
  110664. } else {
  110665. that.layerAdded++;
  110666. that.sendMapToUser(len);
  110667. that.errorCallback && that.errorCallback(null, 'getLayerFaild', that.map);
  110668. }
  110669. })["catch"](function (error) {
  110670. that.layerAdded++;
  110671. that.sendMapToUser(len);
  110672. that.errorCallback && that.errorCallback(error, 'getLayerFaild', that.map);
  110673. });
  110674. }
  110675. _context16.next = 18;
  110676. break;
  110677. case 17:
  110678. if (dataSource && dataSource.type === "USER_DATA") {
  110679. that.addGeojsonFromUrl(layer, len, layerIndex, false);
  110680. } else if (layer.layerType === "TILE") {
  110681. that.getTileLayerExtent(layer, function (layerInfo) {
  110682. that.map.addLayer(that.createBaseLayer(layerInfo, layerIndex));
  110683. that.layerAdded++;
  110684. that.sendMapToUser(len);
  110685. }, function (e) {
  110686. that.layerAdded++;
  110687. that.sendMapToUser(len);
  110688. that.errorCallback && that.errorCallback(e, 'getLayerFaild', that.map);
  110689. });
  110690. } else if (layer.layerType === 'SUPERMAP_REST' || layer.layerType === "WMS" || layer.layerType === "WMTS") {
  110691. if (layer.layerType === "WMTS") {
  110692. that.getWmtsInfo(layer, function (layerInfo) {
  110693. that.map.addLayer(that.createBaseLayer(layerInfo, layerIndex));
  110694. that.layerAdded++;
  110695. that.sendMapToUser(len);
  110696. });
  110697. } else if (layer.layerType === "WMS") {
  110698. that.getWmsInfo(layer).then(function () {
  110699. that.map.addLayer(that.createBaseLayer(layer, layerIndex));
  110700. that.layerAdded++;
  110701. that.sendMapToUser(len);
  110702. });
  110703. } else {
  110704. layer.projection = that.baseProjection;
  110705. that.map.addLayer(that.createBaseLayer(layer, layerIndex));
  110706. that.layerAdded++;
  110707. that.sendMapToUser(len);
  110708. }
  110709. } else if (dataSource && dataSource.type === "REST_DATA") {
  110710. //从restData获取数据
  110711. that.getFeaturesFromRestData(layer, layerIndex, len);
  110712. } else if (dataSource && dataSource.type === "REST_MAP" && dataSource.url) {
  110713. //示例数据
  110714. queryFeatureBySQL(dataSource.url, dataSource.layerName, 'smid=1', null, null, function (result) {
  110715. var recordsets = result && result.result.recordsets;
  110716. var recordset = recordsets && recordsets[0];
  110717. var attributes = recordset.fields;
  110718. if (recordset && attributes) {
  110719. var fileterAttrs = [];
  110720. for (var i in attributes) {
  110721. var value = attributes[i];
  110722. if (value.indexOf('Sm') !== 0 || value === "SmID") {
  110723. fileterAttrs.push(value);
  110724. }
  110725. }
  110726. that.getFeatures(fileterAttrs, layer, /*#__PURE__*/function () {
  110727. var _ref13 = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee14(features) {
  110728. return WebMap_regeneratorRuntime().wrap(function _callee14$(_context14) {
  110729. while (1) switch (_context14.prev = _context14.next) {
  110730. case 0:
  110731. _context14.next = 2;
  110732. return that.addLayer(layer, features, layerIndex);
  110733. case 2:
  110734. that.layerAdded++;
  110735. that.sendMapToUser(len);
  110736. case 4:
  110737. case "end":
  110738. return _context14.stop();
  110739. }
  110740. }, _callee14);
  110741. }));
  110742. return function (_x16) {
  110743. return _ref13.apply(this, arguments);
  110744. };
  110745. }(), function (e) {
  110746. that.layerAdded++;
  110747. that.errorCallback && that.errorCallback(e, 'getFeatureFaild', that.map);
  110748. });
  110749. }
  110750. }, function (e) {
  110751. that.errorCallback && that.errorCallback(e, 'getFeatureFaild', that.map);
  110752. });
  110753. } else if (layer.layerType === "DATAFLOW_POINT_TRACK" || layer.layerType === "DATAFLOW_HEAT") {
  110754. that.getDataflowInfo(layer, /*#__PURE__*/WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee15() {
  110755. return WebMap_regeneratorRuntime().wrap(function _callee15$(_context15) {
  110756. while (1) switch (_context15.prev = _context15.next) {
  110757. case 0:
  110758. _context15.next = 2;
  110759. return that.addLayer(layer, features, layerIndex);
  110760. case 2:
  110761. that.layerAdded++;
  110762. that.sendMapToUser(len);
  110763. case 4:
  110764. case "end":
  110765. return _context15.stop();
  110766. }
  110767. }, _callee15);
  110768. })), function (e) {
  110769. that.layerAdded++;
  110770. that.errorCallback && that.errorCallback(e, 'getFeatureFaild', that.map);
  110771. });
  110772. }
  110773. case 18:
  110774. case "end":
  110775. return _context16.stop();
  110776. }
  110777. }, _loop);
  110778. });
  110779. index = 0;
  110780. case 6:
  110781. if (!(index < layers.length)) {
  110782. _context17.next = 14;
  110783. break;
  110784. }
  110785. return _context17.delegateYield(_loop(), "t0", 8);
  110786. case 8:
  110787. _ret = _context17.t0;
  110788. if (!_ret) {
  110789. _context17.next = 11;
  110790. break;
  110791. }
  110792. return _context17.abrupt("return", _ret.v);
  110793. case 11:
  110794. index++;
  110795. _context17.next = 6;
  110796. break;
  110797. case 14:
  110798. case "end":
  110799. return _context17.stop();
  110800. }
  110801. }, _callee16, this);
  110802. }));
  110803. function addLayers(_x12) {
  110804. return _addLayers.apply(this, arguments);
  110805. }
  110806. return addLayers;
  110807. }()
  110808. /**
  110809. * @private
  110810. * @function WebMap.prototype.addGeojsonFromUrl
  110811. * @description 从web服务输入geojson地址的图层
  110812. * @param {Object} layerInfo - 图层信息
  110813. * @param {number} len - 总的图层数量
  110814. * @param {number} layerIndex - 当前图层index
  110815. * @param {boolean} withCredentials - 是否携带cookie
  110816. */
  110817. }, {
  110818. key: "addGeojsonFromUrl",
  110819. value: function addGeojsonFromUrl(layerInfo, len, layerIndex) {
  110820. var withCredentials = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : this.withCredentials;
  110821. // 通过web添加geojson不需要携带cookie
  110822. var dataSource = layerInfo.dataSource,
  110823. url = dataSource.url,
  110824. that = this;
  110825. FetchRequest.get(url, null, {
  110826. withCredentials: withCredentials,
  110827. withoutFormatSuffix: true
  110828. }).then(function (response) {
  110829. return response.json();
  110830. }).then( /*#__PURE__*/function () {
  110831. var _ref15 = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee17(data) {
  110832. var features, _layerInfo$dataSource2, divisionType, divisionField, geojson, geoJson;
  110833. return WebMap_regeneratorRuntime().wrap(function _callee17$(_context18) {
  110834. while (1) switch (_context18.prev = _context18.next) {
  110835. case 0:
  110836. if (!(!data || data.succeed === false)) {
  110837. _context18.next = 3;
  110838. break;
  110839. }
  110840. //请求失败
  110841. if (len) {
  110842. that.errorCallback && that.errorCallback(data.error, 'autoUpdateFaild', that.map);
  110843. } else {
  110844. that.layerAdded++;
  110845. that.sendMapToUser(len);
  110846. that.errorCallback && that.errorCallback(data.error, 'getLayerFaild', that.map);
  110847. }
  110848. return _context18.abrupt("return");
  110849. case 3:
  110850. if (!(data.type === 'CSV' || data.type === 'EXCEL')) {
  110851. _context18.next = 16;
  110852. break;
  110853. }
  110854. if (!(layerInfo.dataSource && layerInfo.dataSource.administrativeInfo)) {
  110855. _context18.next = 11;
  110856. break;
  110857. }
  110858. //行政规划信息
  110859. data.content.rows.unshift(data.content.colTitles);
  110860. _layerInfo$dataSource2 = layerInfo.dataSource.administrativeInfo, divisionType = _layerInfo$dataSource2.divisionType, divisionField = _layerInfo$dataSource2.divisionField;
  110861. geojson = that.excelData2FeatureByDivision(data.content, divisionType, divisionField);
  110862. features = that._parseGeoJsonData2Feature({
  110863. allDatas: {
  110864. features: geojson.features
  110865. },
  110866. fileCode: layerInfo.projection
  110867. });
  110868. _context18.next = 14;
  110869. break;
  110870. case 11:
  110871. _context18.next = 13;
  110872. return that.excelData2Feature(data.content, layerInfo);
  110873. case 13:
  110874. features = _context18.sent;
  110875. case 14:
  110876. _context18.next = 18;
  110877. break;
  110878. case 16:
  110879. geoJson = data.content ? JSON.parse(data.content) : data;
  110880. features = that.geojsonToFeature(geoJson, layerInfo);
  110881. case 18:
  110882. if (!len) {
  110883. _context18.next = 25;
  110884. break;
  110885. }
  110886. _context18.next = 21;
  110887. return that.addLayer(layerInfo, features, layerIndex);
  110888. case 21:
  110889. that.layerAdded++;
  110890. that.sendMapToUser(len);
  110891. _context18.next = 29;
  110892. break;
  110893. case 25:
  110894. //自动更新
  110895. that.map.removeLayer(layerInfo.layer);
  110896. layerInfo.labelLayer && that.map.removeLayer(layerInfo.labelLayer);
  110897. _context18.next = 29;
  110898. return that.addLayer(layerInfo, features, layerIndex);
  110899. case 29:
  110900. case "end":
  110901. return _context18.stop();
  110902. }
  110903. }, _callee17);
  110904. }));
  110905. return function (_x17) {
  110906. return _ref15.apply(this, arguments);
  110907. };
  110908. }())["catch"](function (error) {
  110909. that.layerAdded++;
  110910. that.sendMapToUser(len);
  110911. that.errorCallback && that.errorCallback(error, 'getLayerFaild', that.map);
  110912. });
  110913. }
  110914. /**
  110915. * @private
  110916. * @function WebMap.prototype.getServiceInfoFromLayer
  110917. * @description 判断使用哪种服务上图
  110918. * @param {number} layerIndex - 图层对应的index
  110919. * @param {number} len - 成功添加的图层个数
  110920. * @param {Object} layer - 图层信息
  110921. * @param {Array.<Object>} dataItemServices - 数据发布的服务
  110922. * @param {string} datasetName - 数据服务的数据集名称
  110923. * @param {string} featureType - feature类型
  110924. * @param {Object} info - 数据服务的信息
  110925. */
  110926. }, {
  110927. key: "getServiceInfoFromLayer",
  110928. value: function () {
  110929. var _getServiceInfoFromLayer = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee18(layerIndex, len, layer, dataItemServices, datasetName, featureType, info) {
  110930. var that, isMapService, isAdded, _loop2, _ret2, i;
  110931. return WebMap_regeneratorRuntime().wrap(function _callee18$(_context20) {
  110932. while (1) switch (_context20.prev = _context20.next) {
  110933. case 0:
  110934. that = this;
  110935. isMapService = info ? !info.isMvt : layer.layerType === 'HOSTED_TILE', isAdded = false;
  110936. _loop2 = /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _loop2() {
  110937. var service, bounds;
  110938. return WebMap_regeneratorRuntime().wrap(function _loop2$(_context19) {
  110939. while (1) switch (_context19.prev = _context19.next) {
  110940. case 0:
  110941. service = dataItemServices[i];
  110942. if (!isAdded) {
  110943. _context19.next = 3;
  110944. break;
  110945. }
  110946. return _context19.abrupt("return", {
  110947. v: void 0
  110948. });
  110949. case 3:
  110950. if (!(service && isMapService && service.serviceType === 'RESTMAP')) {
  110951. _context19.next = 8;
  110952. break;
  110953. }
  110954. isAdded = true;
  110955. //地图服务,判断使用mvt还是tile
  110956. that.getTileLayerInfo(service.address).then(function (restMaps) {
  110957. restMaps.forEach(function (restMapInfo) {
  110958. var bounds = restMapInfo.bounds;
  110959. layer.layerType = 'TILE';
  110960. layer.orginEpsgCode = that.baseProjection;
  110961. layer.units = restMapInfo.coordUnit && restMapInfo.coordUnit.toLowerCase();
  110962. layer.extent = [bounds.left, bounds.bottom, bounds.right, bounds.top];
  110963. layer.visibleScales = restMapInfo.visibleScales;
  110964. layer.url = restMapInfo.url;
  110965. layer.sourceType = 'TILE';
  110966. that.map.addLayer(that.createBaseLayer(layer, layerIndex));
  110967. that.layerAdded++;
  110968. that.sendMapToUser(len);
  110969. });
  110970. });
  110971. _context19.next = 24;
  110972. break;
  110973. case 8:
  110974. if (!(service && !isMapService && service.serviceType === 'RESTDATA')) {
  110975. _context19.next = 24;
  110976. break;
  110977. }
  110978. isAdded = true;
  110979. if (!(info && info.isMvt)) {
  110980. _context19.next = 22;
  110981. break;
  110982. }
  110983. bounds = info.bounds;
  110984. layer = Object.assign(layer, {
  110985. layerType: "VECTOR_TILE",
  110986. epsgCode: info.epsgCode,
  110987. projection: "EPSG:".concat(info.epsgCode),
  110988. bounds: bounds,
  110989. extent: [bounds.left, bounds.bottom, bounds.right, bounds.top],
  110990. name: layer.name,
  110991. url: info.url,
  110992. visible: layer.visible,
  110993. featureType: featureType,
  110994. serverId: layer.serverId.toString()
  110995. });
  110996. _context19.t0 = that.map;
  110997. _context19.next = 16;
  110998. return that.addVectorTileLayer(layer, layerIndex, 'RESTDATA');
  110999. case 16:
  111000. _context19.t1 = _context19.sent;
  111001. _context19.t0.addLayer.call(_context19.t0, _context19.t1);
  111002. that.layerAdded++;
  111003. that.sendMapToUser(len);
  111004. _context19.next = 24;
  111005. break;
  111006. case 22:
  111007. //数据服务
  111008. isAdded = true;
  111009. //关系型文件发布的数据服务
  111010. that.getDatasources(service.address).then(function (datasourceName) {
  111011. layer.dataSource.dataSourceName = datasourceName + ":" + datasetName;
  111012. layer.dataSource.url = "".concat(service.address, "/data");
  111013. that.getFeaturesFromRestData(layer, layerIndex, len);
  111014. });
  111015. case 24:
  111016. case "end":
  111017. return _context19.stop();
  111018. }
  111019. }, _loop2);
  111020. });
  111021. i = 0;
  111022. case 4:
  111023. if (!(i < dataItemServices.length)) {
  111024. _context20.next = 12;
  111025. break;
  111026. }
  111027. return _context20.delegateYield(_loop2(), "t0", 6);
  111028. case 6:
  111029. _ret2 = _context20.t0;
  111030. if (!_ret2) {
  111031. _context20.next = 9;
  111032. break;
  111033. }
  111034. return _context20.abrupt("return", _ret2.v);
  111035. case 9:
  111036. i++;
  111037. _context20.next = 4;
  111038. break;
  111039. case 12:
  111040. if (!isAdded) {
  111041. //循环完成了,也没有找到合适的服务。有可能服务被删除
  111042. that.layerAdded++;
  111043. that.sendMapToUser(len);
  111044. that.errorCallback && that.errorCallback(null, 'getLayerFaild', that.map);
  111045. }
  111046. case 13:
  111047. case "end":
  111048. return _context20.stop();
  111049. }
  111050. }, _callee18, this);
  111051. }));
  111052. function getServiceInfoFromLayer(_x18, _x19, _x20, _x21, _x22, _x23, _x24) {
  111053. return _getServiceInfoFromLayer.apply(this, arguments);
  111054. }
  111055. return getServiceInfoFromLayer;
  111056. }()
  111057. /**
  111058. * @private
  111059. * @function WebMap.prototype.getDataflowInfo
  111060. * @description 获取数据流服务的参数
  111061. * @param {Object} layerInfo - 图层信息
  111062. * @param {function} success - 成功回调函数
  111063. * @param {function} faild - 失败回调函数
  111064. */
  111065. }, {
  111066. key: "getDataflowInfo",
  111067. value: function getDataflowInfo(layerInfo, success, faild) {
  111068. var that = this;
  111069. var url = layerInfo.url,
  111070. token;
  111071. url = this.handleJSONSuffix(url);
  111072. var requestUrl = that.getRequestUrl(url, false);
  111073. if (layerInfo.credential && layerInfo.credential.token) {
  111074. token = layerInfo.credential.token;
  111075. requestUrl += "?token=".concat(token);
  111076. }
  111077. FetchRequest.get(requestUrl, null, {
  111078. withCredentials: this.withCredentials
  111079. }).then(function (response) {
  111080. return response.json();
  111081. }).then(function (result) {
  111082. layerInfo.featureType = "POINT";
  111083. if (result && result.featureMetaData) {
  111084. layerInfo.featureType = result.featureMetaData.featureType.toUpperCase();
  111085. }
  111086. layerInfo.wsUrl = result.urls[0].url;
  111087. success();
  111088. })["catch"](function () {
  111089. faild();
  111090. });
  111091. }
  111092. /**
  111093. * @private
  111094. * @function WebMap.prototype.getFeaturesFromRestData
  111095. * @description 从数据服务中获取feature
  111096. * @param {Object} layer - 图层信息
  111097. * @param {number} layerIndex - 图层index
  111098. * @param {number} layerLength - 图层数量
  111099. */
  111100. }, {
  111101. key: "getFeaturesFromRestData",
  111102. value: function getFeaturesFromRestData(layer, layerIndex, layerLength) {
  111103. var that = this,
  111104. dataSource = layer.dataSource,
  111105. url = layer.dataSource.url,
  111106. dataSourceName = dataSource.dataSourceName || layer.name;
  111107. var requestUrl = that.formatUrlWithCredential(url),
  111108. serviceOptions = {};
  111109. serviceOptions.withCredentials = this.withCredentials;
  111110. if (!this.excludePortalProxyUrl && !Util_Util.isInTheSameDomain(requestUrl)) {
  111111. serviceOptions.proxy = this.getProxy();
  111112. }
  111113. if (['EPSG:0'].includes(layer.projection)) {
  111114. // 不支持动态投影restData服务
  111115. that.layerAdded++;
  111116. that.sendMapToUser(layerLength);
  111117. that.errorCallback && that.errorCallback({}, 'getFeatureFaild', that.map);
  111118. return;
  111119. }
  111120. //因为itest上使用的https,iserver是http,所以要加上代理
  111121. getFeatureBySQL(requestUrl, [decodeURIComponent(dataSourceName)], serviceOptions, /*#__PURE__*/function () {
  111122. var _ref16 = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee19(result) {
  111123. var features;
  111124. return WebMap_regeneratorRuntime().wrap(function _callee19$(_context21) {
  111125. while (1) switch (_context21.prev = _context21.next) {
  111126. case 0:
  111127. features = that.parseGeoJsonData2Feature({
  111128. allDatas: {
  111129. features: result.result.features.features
  111130. },
  111131. fileCode: that.baseProjection,
  111132. //因为获取restData用了动态投影,不需要再进行坐标转换。所以此处filecode和底图坐标系一致
  111133. featureProjection: that.baseProjection
  111134. });
  111135. _context21.next = 3;
  111136. return that.addLayer(layer, features, layerIndex);
  111137. case 3:
  111138. that.layerAdded++;
  111139. that.sendMapToUser(layerLength);
  111140. case 5:
  111141. case "end":
  111142. return _context21.stop();
  111143. }
  111144. }, _callee19);
  111145. }));
  111146. return function (_x25) {
  111147. return _ref16.apply(this, arguments);
  111148. };
  111149. }(), function (err) {
  111150. that.layerAdded++;
  111151. that.sendMapToUser(layerLength);
  111152. that.errorCallback && that.errorCallback(err, 'getFeatureFaild', that.map);
  111153. }, that.baseProjection.split("EPSG:")[1], this.restDataSingleRequestCount);
  111154. }
  111155. /**
  111156. * @private
  111157. * @function WebMap.prototype.getFeatures
  111158. * @description 从地图中获取feature
  111159. * @param {Object} fields - 图层信息
  111160. * @param {number} layerInfo - 图层index
  111161. * @param {number} success - 成功回调
  111162. * @param {number} faild - 失败回调
  111163. */
  111164. }, {
  111165. key: "getFeatures",
  111166. value: function getFeatures(fields, layerInfo, success, faild) {
  111167. var that = this;
  111168. var source = layerInfo.dataSource;
  111169. var fileCode = layerInfo.projection;
  111170. queryFeatureBySQL(source.url, source.layerName, null, fields, null, function (result) {
  111171. var recordsets = result.result.recordsets[0];
  111172. var features = recordsets.features.features;
  111173. var featuresObj = that.parseGeoJsonData2Feature({
  111174. allDatas: {
  111175. features: features
  111176. },
  111177. fileCode: fileCode,
  111178. featureProjection: that.baseProjection
  111179. }, 'JSON');
  111180. success(featuresObj);
  111181. }, function (err) {
  111182. faild(err);
  111183. });
  111184. }
  111185. /**
  111186. * @private
  111187. * @function WebMap.prototype.sendMapToUser
  111188. * @description 将所有叠加图层叠加后,返回最终的map对象给用户,供他们操作使用
  111189. * @param {number} layersLen - 叠加图层总数
  111190. */
  111191. }, {
  111192. key: "sendMapToUser",
  111193. value: function sendMapToUser(layersLen) {
  111194. var lens = this.isHaveGraticule ? layersLen + 1 : layersLen;
  111195. if (this.layerAdded === lens && this.successCallback) {
  111196. this.successCallback(this.map, this.mapParams, this.layers, this.baseLayer);
  111197. }
  111198. }
  111199. /**
  111200. * @private
  111201. * @function WebMap.prototype.excelData2Feature
  111202. * @description 将csv和xls文件内容转换成ol.feature
  111203. * @param {Object} content - 文件内容
  111204. * @param {Object} layerInfo - 图层信息
  111205. * @returns {Array} ol.feature的数组集合
  111206. */
  111207. }, {
  111208. key: "excelData2Feature",
  111209. value: function () {
  111210. var _excelData2Feature = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee20(content, layerInfo) {
  111211. var rows, colTitles, i, fileCode, dataSource, baseLayerEpsgCode, features, xField, yField, xIdx, yIdx, _yield$FetchRequest$g2, dataMetaInfo, sampleData, _i2, len, rowDatas, attributes, geomX, geomY, olGeom, j, leng, field, newField, feature;
  111212. return WebMap_regeneratorRuntime().wrap(function _callee20$(_context22) {
  111213. while (1) switch (_context22.prev = _context22.next) {
  111214. case 0:
  111215. rows = content.rows, colTitles = content.colTitles; // 解决V2恢复的数据中含有空格
  111216. for (i in colTitles) {
  111217. if (core_Util_Util.isString(colTitles[i])) {
  111218. colTitles[i] = core_Util_Util.trim(colTitles[i]);
  111219. }
  111220. }
  111221. fileCode = layerInfo.projection, dataSource = layerInfo.dataSource, baseLayerEpsgCode = this.baseProjection, features = [], xField = core_Util_Util.trim(layerInfo.xyField && layerInfo.xyField.xField || layerInfo.from && layerInfo.from.xField), yField = core_Util_Util.trim(layerInfo.xyField && layerInfo.xyField.yField || layerInfo.from && layerInfo.from.yField), xIdx = colTitles.indexOf(xField), yIdx = colTitles.indexOf(yField); // todo 优化 暂时这样处理
  111222. if (!(layerInfo.layerType === 'MIGRATION')) {
  111223. _context22.next = 20;
  111224. break;
  111225. }
  111226. _context22.prev = 4;
  111227. if (!(dataSource.type === 'PORTAL_DATA')) {
  111228. _context22.next = 14;
  111229. break;
  111230. }
  111231. _context22.next = 8;
  111232. return FetchRequest.get("".concat(this.server, "web/datas/").concat(dataSource.serverId, ".json"), null, {
  111233. withCredentials: this.withCredentials
  111234. }).then(function (res) {
  111235. return res.json();
  111236. });
  111237. case 8:
  111238. _yield$FetchRequest$g2 = _context22.sent;
  111239. dataMetaInfo = _yield$FetchRequest$g2.dataMetaInfo;
  111240. // eslint-disable-next-line require-atomic-updates
  111241. layerInfo.xyField = {
  111242. xField: dataMetaInfo.xField,
  111243. yField: dataMetaInfo.yField
  111244. };
  111245. if (!dataMetaInfo.xIndex) {
  111246. xIdx = colTitles.indexOf(dataMetaInfo.xField);
  111247. yIdx = colTitles.indexOf(dataMetaInfo.yField);
  111248. } else {
  111249. xIdx = dataMetaInfo.xIndex;
  111250. yIdx = dataMetaInfo.yIndex;
  111251. }
  111252. _context22.next = 15;
  111253. break;
  111254. case 14:
  111255. if (dataSource.type === 'SAMPLE_DATA') {
  111256. // 示例数据从本地拿xyField
  111257. sampleData = SampleDataInfo_namespaceObject.find(function (item) {
  111258. return item.id === dataSource.name;
  111259. }) || {};
  111260. xField = sampleData.xField;
  111261. yField = sampleData.yField;
  111262. layerInfo.xyField = {
  111263. xField: xField,
  111264. yField: yField
  111265. };
  111266. xIdx = colTitles.findIndex(function (item) {
  111267. return item === xField;
  111268. });
  111269. yIdx = colTitles.findIndex(function (item) {
  111270. return item === yField;
  111271. });
  111272. }
  111273. case 15:
  111274. _context22.next = 20;
  111275. break;
  111276. case 17:
  111277. _context22.prev = 17;
  111278. _context22.t0 = _context22["catch"](4);
  111279. console.error(_context22.t0);
  111280. case 20:
  111281. _i2 = 0, len = rows.length;
  111282. case 21:
  111283. if (!(_i2 < len)) {
  111284. _context22.next = 41;
  111285. break;
  111286. }
  111287. rowDatas = rows[_i2], attributes = {}, geomX = rows[_i2][xIdx], geomY = rows[_i2][yIdx]; // 位置字段信息不存在 过滤数据
  111288. if (!(geomX !== '' && geomY !== '')) {
  111289. _context22.next = 38;
  111290. break;
  111291. }
  111292. olGeom = new external_ol_geom_namespaceObject.Point([+geomX, +geomY]);
  111293. if (fileCode !== baseLayerEpsgCode) {
  111294. olGeom.transform(fileCode, baseLayerEpsgCode);
  111295. }
  111296. j = 0, leng = rowDatas.length;
  111297. case 27:
  111298. if (!(j < leng)) {
  111299. _context22.next = 36;
  111300. break;
  111301. }
  111302. field = colTitles[j];
  111303. if (!(field === undefined || field === null)) {
  111304. _context22.next = 31;
  111305. break;
  111306. }
  111307. return _context22.abrupt("continue", 33);
  111308. case 31:
  111309. field = field.trim();
  111310. if (Object.keys(attributes).indexOf(field) > -1) {
  111311. //说明前面有个一模一样的字段
  111312. newField = field + '_1';
  111313. attributes[newField] = rowDatas[j];
  111314. } else {
  111315. attributes[field] = rowDatas[j];
  111316. }
  111317. case 33:
  111318. j++;
  111319. _context22.next = 27;
  111320. break;
  111321. case 36:
  111322. feature = new (external_ol_Feature_default())({
  111323. geometry: olGeom,
  111324. attributes: attributes
  111325. });
  111326. features.push(feature);
  111327. case 38:
  111328. _i2++;
  111329. _context22.next = 21;
  111330. break;
  111331. case 41:
  111332. return _context22.abrupt("return", Promise.resolve(features));
  111333. case 42:
  111334. case "end":
  111335. return _context22.stop();
  111336. }
  111337. }, _callee20, this, [[4, 17]]);
  111338. }));
  111339. function excelData2Feature(_x26, _x27) {
  111340. return _excelData2Feature.apply(this, arguments);
  111341. }
  111342. return excelData2Feature;
  111343. }()
  111344. /**
  111345. * @private
  111346. * @function WebMap.prototype.excelData2FeatureByDivision
  111347. * @description 行政区划数据处理
  111348. * @param {Object} content - 文件内容
  111349. * @param {Object} layerInfo - 图层信息
  111350. * @returns {Object} geojson对象
  111351. */
  111352. }, {
  111353. key: "excelData2FeatureByDivision",
  111354. value: function excelData2FeatureByDivision(content, divisionType, divisionField) {
  111355. var me = this;
  111356. var asyncInport;
  111357. if (divisionType === 'Province') {
  111358. asyncInport = window.ProvinceData;
  111359. } else if (divisionType === 'City') {
  111360. asyncInport = window.MunicipalData;
  111361. } else if (divisionType === 'GB-T_2260') {
  111362. // let geojso;
  111363. asyncInport = window.AdministrativeArea;
  111364. }
  111365. if (asyncInport) {
  111366. var geojson = me.changeExcel2Geojson(asyncInport.features, content.rows, divisionType, divisionField);
  111367. return geojson;
  111368. }
  111369. }
  111370. /**
  111371. * @private
  111372. * @function WebMap.prototype._parseGeoJsonData2Feature
  111373. * @description 将geojson的数据转换成ol.Feature
  111374. * @param {Object} metaData - 文件内容
  111375. * @returns {Array.<ol.Feature>} features
  111376. */
  111377. }, {
  111378. key: "_parseGeoJsonData2Feature",
  111379. value: function _parseGeoJsonData2Feature(metaData) {
  111380. var allFeatures = metaData.allDatas.features,
  111381. features = [];
  111382. for (var i = 0, len = allFeatures.length; i < len; i++) {
  111383. //不删除properties转换后,属性全都在feature上
  111384. var properties = Object.assign({}, allFeatures[i].properties);
  111385. delete allFeatures[i].properties;
  111386. var feature = transformTools.readFeature(allFeatures[i], {
  111387. dataProjection: metaData.fileCode,
  111388. featureProjection: this.baseProjection || 'ESPG:4326'
  111389. });
  111390. feature.setProperties({
  111391. attributes: properties
  111392. });
  111393. features.push(feature);
  111394. }
  111395. return features;
  111396. }
  111397. /**
  111398. * @private
  111399. * @function WebMap.prototype.changeExcel2Geojson
  111400. * @description 将excel和csv数据转换成标准geojson数据
  111401. * @param {Array} features - feature对象
  111402. * @param {Array} datas - 数据内容
  111403. * @param {string} divisionType - 行政区划类型
  111404. * @param {string} divisionField - 行政区划字段
  111405. * @returns {Object} geojson对象
  111406. */
  111407. }, {
  111408. key: "changeExcel2Geojson",
  111409. value: function changeExcel2Geojson(features, datas, divisionType, divisionField) {
  111410. var geojson = {
  111411. type: 'FeatureCollection',
  111412. features: []
  111413. };
  111414. if (datas.length < 2) {
  111415. return geojson; //只有一行数据时为标题
  111416. }
  111417. var titles = datas[0],
  111418. rows = datas.slice(1),
  111419. fieldIndex = titles.findIndex(function (title) {
  111420. return title === divisionField;
  111421. });
  111422. rows.forEach(function (row) {
  111423. var feature;
  111424. if (divisionType === 'GB-T_2260') {
  111425. feature = features.find(function (item) {
  111426. return item.properties.GB === row[fieldIndex];
  111427. });
  111428. } else {
  111429. feature = core_Util_Util.getHighestMatchAdministration(features, row[fieldIndex]);
  111430. }
  111431. //todo 需提示忽略无效数据
  111432. if (feature) {
  111433. var newFeature = window.cloneDeep(feature);
  111434. newFeature.properties = {};
  111435. row.forEach(function (item, idx) {
  111436. //空格问题,看见DV多处处理空格问题,TODO统一整理
  111437. var key = titles[idx].trim();
  111438. newFeature.properties[key] = item;
  111439. });
  111440. geojson.features.push(newFeature);
  111441. }
  111442. });
  111443. return geojson;
  111444. }
  111445. /**
  111446. * @private
  111447. * @function WebMap.prototype.geojsonToFeature
  111448. * @description geojson 转换为 feature
  111449. * @param {Object} layerInfo - 图层信息
  111450. * @returns {Array} ol.feature的数组集合
  111451. */
  111452. }, {
  111453. key: "geojsonToFeature",
  111454. value: function geojsonToFeature(geojson, layerInfo) {
  111455. var allFeatures = geojson.features,
  111456. features = [];
  111457. for (var i = 0, len = allFeatures.length; i < len; i++) {
  111458. //转换前删除properties,这样转换后属性不会重复存储
  111459. var featureAttr = allFeatures[i].properties || {};
  111460. delete allFeatures[i].properties;
  111461. var feature = transformTools.readFeature(allFeatures[i], {
  111462. dataProjection: layerInfo.projection || 'EPSG:4326',
  111463. featureProjection: this.baseProjection || 'ESPG:4326'
  111464. });
  111465. //geojson格式的feature属性没有坐标系字段,为了统一,再次加上
  111466. var coordinate = feature.getGeometry().getCoordinates();
  111467. if (allFeatures[i].geometry.type === 'Point') {
  111468. // 标注图层 还没有属性值时候不加
  111469. if (allFeatures[i].properties) {
  111470. allFeatures[i].properties.lon = coordinate[0];
  111471. allFeatures[i].properties.lat = coordinate[1];
  111472. }
  111473. }
  111474. // 标注图层特殊处理
  111475. var isMarker = false;
  111476. var attributes = void 0;
  111477. var useStyle = void 0;
  111478. if (allFeatures[i].dv_v5_markerInfo) {
  111479. //因为优化代码之前,属性字段都存储在propertise上,markerInfo没有
  111480. attributes = Object.assign({}, allFeatures[i].dv_v5_markerInfo, featureAttr);
  111481. if (attributes.lon) {
  111482. //标注图层不需要
  111483. delete attributes.lon;
  111484. delete attributes.lat;
  111485. }
  111486. }
  111487. if (allFeatures[i].dv_v5_markerStyle) {
  111488. useStyle = allFeatures[i].dv_v5_markerStyle;
  111489. isMarker = true;
  111490. }
  111491. var properties = void 0;
  111492. if (isMarker) {
  111493. properties = Object.assign({}, {
  111494. attributes: attributes
  111495. }, {
  111496. useStyle: useStyle
  111497. });
  111498. //feature上添加图层的id,为了对应图层
  111499. feature.layerId = layerInfo.timeId;
  111500. } else if (layerInfo.featureStyles) {
  111501. //V4 版本标注图层处理
  111502. var style = JSON.parse(layerInfo.featureStyles[i].style);
  111503. var attr = featureAttr;
  111504. var imgUrl = void 0;
  111505. if (attr._smiportal_imgLinkUrl.indexOf('http://') > -1 || attr._smiportal_imgLinkUrl.indexOf('https://') > -1) {
  111506. imgUrl = attr._smiportal_imgLinkUrl;
  111507. } else if (attr._smiportal_imgLinkUrl !== undefined && attr._smiportal_imgLinkUrl !== null && attr._smiportal_imgLinkUrl !== '') {
  111508. //上传的图片,加上当前地址
  111509. imgUrl = "".concat(core_Util_Util.getIPortalUrl(), "resources/markerIcon/").concat(attr._smiportal_imgLinkUrl);
  111510. }
  111511. attributes = {
  111512. dataViz_description: attr._smiportal_description,
  111513. dataViz_imgUrl: imgUrl,
  111514. dataViz_title: attr._smiportal_title,
  111515. dataViz_url: attr._smiportal_otherLinkUrl
  111516. };
  111517. style.anchor = [0.5, 1];
  111518. style.src = style.externalGraphic;
  111519. useStyle = style;
  111520. properties = Object.assign({}, {
  111521. attributes: attributes
  111522. }, {
  111523. useStyle: useStyle
  111524. });
  111525. delete attr._smiportal_description;
  111526. delete attr._smiportal_imgLinkUrl;
  111527. delete attr._smiportal_title;
  111528. delete attr._smiportal_otherLinkUrl;
  111529. } else {
  111530. properties = {
  111531. attributes: featureAttr
  111532. };
  111533. }
  111534. feature.setProperties(properties);
  111535. features.push(feature);
  111536. }
  111537. return features;
  111538. }
  111539. /**
  111540. * @private
  111541. * @function WebMap.prototype.parseGeoJsonData2Feature
  111542. * @description 将从restData地址上获取的json转换成feature(从iserver中获取的json转换成feature)
  111543. * @param {Object} metaData - json内容
  111544. * @returns {Array} ol.feature的数组集合
  111545. */
  111546. }, {
  111547. key: "parseGeoJsonData2Feature",
  111548. value: function parseGeoJsonData2Feature(metaData) {
  111549. var allFeatures = metaData.allDatas.features,
  111550. features = [];
  111551. for (var i = 0, len = allFeatures.length; i < len; i++) {
  111552. var properties = allFeatures[i].properties;
  111553. delete allFeatures[i].properties;
  111554. var feature = transformTools.readFeature(allFeatures[i], {
  111555. dataProjection: metaData.fileCode || 'EPSG:4326',
  111556. featureProjection: metaData.featureProjection || this.baseProjection || 'EPSG:4326'
  111557. });
  111558. //geojson格式的feature属性没有坐标系字段,为了统一,再次加上
  111559. var geometry = feature.getGeometry();
  111560. // 如果不存在geometry,也不需要组装feature
  111561. if (!geometry) {
  111562. continue;
  111563. }
  111564. var coordinate = geometry.getCoordinates();
  111565. if (allFeatures[i].geometry.type === 'Point') {
  111566. properties.lon = coordinate[0];
  111567. properties.lat = coordinate[1];
  111568. }
  111569. feature.setProperties({
  111570. attributes: properties
  111571. });
  111572. features.push(feature);
  111573. }
  111574. return features;
  111575. }
  111576. /**
  111577. * @private
  111578. * @function WebMap.prototype.addLayer
  111579. * @description 将叠加图层添加到地图上
  111580. * @param {Object} layerInfo - 图层信息
  111581. * @param {Array} features - 图层上的feature集合
  111582. * @param {number} index 图层的顺序
  111583. */
  111584. }, {
  111585. key: "addLayer",
  111586. value: function () {
  111587. var _addLayer = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee21(layerInfo, features, index) {
  111588. var layer, that, layerID, img, visibleScale, autoUpdateTime, dataSource;
  111589. return WebMap_regeneratorRuntime().wrap(function _callee21$(_context23) {
  111590. while (1) switch (_context23.prev = _context23.next) {
  111591. case 0:
  111592. that = this;
  111593. if (!(layerInfo.layerType === "VECTOR")) {
  111594. _context23.next = 17;
  111595. break;
  111596. }
  111597. if (!(layerInfo.featureType === "POINT")) {
  111598. _context23.next = 12;
  111599. break;
  111600. }
  111601. if (!(layerInfo.style.type === 'SYMBOL_POINT')) {
  111602. _context23.next = 7;
  111603. break;
  111604. }
  111605. layer = this.createSymbolLayer(layerInfo, features);
  111606. _context23.next = 10;
  111607. break;
  111608. case 7:
  111609. _context23.next = 9;
  111610. return this.createGraphicLayer(layerInfo, features);
  111611. case 9:
  111612. layer = _context23.sent;
  111613. case 10:
  111614. _context23.next = 15;
  111615. break;
  111616. case 12:
  111617. _context23.next = 14;
  111618. return this.createVectorLayer(layerInfo, features);
  111619. case 14:
  111620. layer = _context23.sent;
  111621. case 15:
  111622. _context23.next = 56;
  111623. break;
  111624. case 17:
  111625. if (!(layerInfo.layerType === "UNIQUE")) {
  111626. _context23.next = 23;
  111627. break;
  111628. }
  111629. _context23.next = 20;
  111630. return this.createUniqueLayer(layerInfo, features);
  111631. case 20:
  111632. layer = _context23.sent;
  111633. _context23.next = 56;
  111634. break;
  111635. case 23:
  111636. if (!(layerInfo.layerType === "RANGE")) {
  111637. _context23.next = 29;
  111638. break;
  111639. }
  111640. _context23.next = 26;
  111641. return this.createRangeLayer(layerInfo, features);
  111642. case 26:
  111643. layer = _context23.sent;
  111644. _context23.next = 56;
  111645. break;
  111646. case 29:
  111647. if (!(layerInfo.layerType === "HEAT")) {
  111648. _context23.next = 33;
  111649. break;
  111650. }
  111651. layer = this.createHeatLayer(layerInfo, features);
  111652. _context23.next = 56;
  111653. break;
  111654. case 33:
  111655. if (!(layerInfo.layerType === "MARKER")) {
  111656. _context23.next = 39;
  111657. break;
  111658. }
  111659. _context23.next = 36;
  111660. return this.createMarkerLayer(features);
  111661. case 36:
  111662. layer = _context23.sent;
  111663. _context23.next = 56;
  111664. break;
  111665. case 39:
  111666. if (!(layerInfo.layerType === "DATAFLOW_POINT_TRACK")) {
  111667. _context23.next = 45;
  111668. break;
  111669. }
  111670. _context23.next = 42;
  111671. return this.createDataflowLayer(layerInfo, index);
  111672. case 42:
  111673. layer = _context23.sent;
  111674. _context23.next = 56;
  111675. break;
  111676. case 45:
  111677. if (!(layerInfo.layerType === "DATAFLOW_HEAT")) {
  111678. _context23.next = 49;
  111679. break;
  111680. }
  111681. layer = this.createDataflowHeatLayer(layerInfo);
  111682. _context23.next = 56;
  111683. break;
  111684. case 49:
  111685. if (!(layerInfo.layerType === "RANK_SYMBOL")) {
  111686. _context23.next = 55;
  111687. break;
  111688. }
  111689. _context23.next = 52;
  111690. return this.createRankSymbolLayer(layerInfo, features);
  111691. case 52:
  111692. layer = _context23.sent;
  111693. _context23.next = 56;
  111694. break;
  111695. case 55:
  111696. if (layerInfo.layerType === "MIGRATION") {
  111697. layer = this.createMigrationLayer(layerInfo, features);
  111698. }
  111699. case 56:
  111700. layerID = core_Util_Util.newGuid(8);
  111701. if (layer) {
  111702. layerInfo.name && layer.setProperties({
  111703. name: layerInfo.name,
  111704. layerID: layerID,
  111705. layerType: layerInfo.layerType
  111706. });
  111707. //刷新下图层,否则feature样式出不来
  111708. if (layerInfo && layerInfo.style && layerInfo.style.imageInfo) {
  111709. img = new Image();
  111710. img.src = layerInfo.style.imageInfo.url;
  111711. img.onload = function () {
  111712. layer.getSource().changed();
  111713. };
  111714. }
  111715. if (layerInfo.layerType === 'MIGRATION') {
  111716. layer.appendTo(this.map);
  111717. // 在这里恢复图层可见性状态
  111718. layer.setVisible(layerInfo.visible);
  111719. // 设置鼠标样式为默认
  111720. layer.setCursor();
  111721. } else {
  111722. layerInfo.opacity != undefined && layer.setOpacity(layerInfo.opacity);
  111723. layer.setVisible(layerInfo.visible);
  111724. this.map.addLayer(layer);
  111725. }
  111726. layer.setZIndex(index);
  111727. visibleScale = layerInfo.visibleScale, autoUpdateTime = layerInfo.autoUpdateTime;
  111728. visibleScale && this.setVisibleScales(layer, visibleScale);
  111729. if (autoUpdateTime && !layerInfo.autoUpdateInterval) {
  111730. //自动更新数据
  111731. dataSource = layerInfo.dataSource;
  111732. if (dataSource.accessType === "DIRECT" && !dataSource.url) {
  111733. // 二进制数据更新feautre所需的url
  111734. dataSource.url = "".concat(this.server, "web/datas/").concat(dataSource.serverId, "/content.json?pageSize=9999999&currentPage=1");
  111735. }
  111736. layerInfo.autoUpdateInterval = setInterval(function () {
  111737. that.updateFeaturesToMap(layerInfo, index, true);
  111738. }, autoUpdateTime);
  111739. }
  111740. }
  111741. layerInfo.layer = layer;
  111742. layerInfo.layerID = layerID;
  111743. if (layerInfo.labelStyle && layerInfo.labelStyle.labelField && layerInfo.layerType !== "DATAFLOW_POINT_TRACK") {
  111744. //存在标签专题图
  111745. //过滤条件过滤feature
  111746. features = layerInfo.filterCondition ? this.getFiterFeatures(layerInfo.filterCondition, features) : features;
  111747. this.addLabelLayer(layerInfo, features);
  111748. }
  111749. case 61:
  111750. case "end":
  111751. return _context23.stop();
  111752. }
  111753. }, _callee21, this);
  111754. }));
  111755. function addLayer(_x28, _x29, _x30) {
  111756. return _addLayer.apply(this, arguments);
  111757. }
  111758. return addLayer;
  111759. }()
  111760. /**
  111761. * @private
  111762. * @function WebMap.prototype.updateFeaturesToMap
  111763. * @description 更新地图上的feature,适用于专题图
  111764. * @param {Object} layerInfo - 图层信息
  111765. * @param {number} index 图层的顺序
  111766. */
  111767. }, {
  111768. key: "updateFeaturesToMap",
  111769. value: function updateFeaturesToMap(layerInfo, layerIndex) {
  111770. var that = this,
  111771. dataSource = layerInfo.dataSource,
  111772. url = layerInfo.dataSource.url,
  111773. dataSourceName = dataSource.dataSourceName || layerInfo.name;
  111774. if (dataSource.type === "USER_DATA" || dataSource.accessType === "DIRECT") {
  111775. that.addGeojsonFromUrl(layerInfo, null, layerIndex);
  111776. } else {
  111777. var requestUrl = that.formatUrlWithCredential(url),
  111778. serviceOptions = {};
  111779. serviceOptions.withCredentials = this.withCredentials;
  111780. if (!this.excludePortalProxyUrl && !Util_Util.isInTheSameDomain(requestUrl) && !this.isIportalProxyServiceUrl(requestUrl)) {
  111781. serviceOptions.proxy = this.getProxy();
  111782. }
  111783. //因为itest上使用的https,iserver是http,所以要加上代理
  111784. getFeatureBySQL(requestUrl, [dataSourceName], serviceOptions, /*#__PURE__*/function () {
  111785. var _ref17 = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee22(result) {
  111786. var features;
  111787. return WebMap_regeneratorRuntime().wrap(function _callee22$(_context24) {
  111788. while (1) switch (_context24.prev = _context24.next) {
  111789. case 0:
  111790. features = that.parseGeoJsonData2Feature({
  111791. allDatas: {
  111792. features: result.result.features.features
  111793. },
  111794. fileCode: layerInfo.projection,
  111795. featureProjection: that.baseProjection
  111796. }); //删除之前的图层和标签图层
  111797. that.map.removeLayer(layerInfo.layer);
  111798. layerInfo.labelLayer && that.map.removeLayer(layerInfo.labelLayer);
  111799. _context24.next = 5;
  111800. return that.addLayer(layerInfo, features, layerIndex);
  111801. case 5:
  111802. case "end":
  111803. return _context24.stop();
  111804. }
  111805. }, _callee22);
  111806. }));
  111807. return function (_x31) {
  111808. return _ref17.apply(this, arguments);
  111809. };
  111810. }(), function (err) {
  111811. that.errorCallback && that.errorCallback(err, 'autoUpdateFaild', that.map);
  111812. }, undefined, this.restDataSingleRequestCount);
  111813. }
  111814. }
  111815. /**
  111816. * @private
  111817. * @function WebMap.prototype.addVectorTileLayer
  111818. * @description 添加vectorTILE图层
  111819. * @param {Object} layerInfo - 图层信息
  111820. * @param {number} index 图层的顺序
  111821. * @param {string} type 创建的图层类型,restData为创建数据服务的mvt, restMap为创建地图服务的mvt
  111822. * @returns {ol.layer.VectorTile} 图层对象
  111823. */
  111824. }, {
  111825. key: "addVectorTileLayer",
  111826. value: function () {
  111827. var _addVectorTileLayer = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee23(layerInfo, index, type) {
  111828. var layer, layerID;
  111829. return WebMap_regeneratorRuntime().wrap(function _callee23$(_context25) {
  111830. while (1) switch (_context25.prev = _context25.next) {
  111831. case 0:
  111832. if (!(type === 'RESTDATA')) {
  111833. _context25.next = 4;
  111834. break;
  111835. }
  111836. _context25.next = 3;
  111837. return this.createDataVectorTileLayer(layerInfo);
  111838. case 3:
  111839. layer = _context25.sent;
  111840. case 4:
  111841. layerID = core_Util_Util.newGuid(8);
  111842. if (layer) {
  111843. layerInfo.name && layer.setProperties({
  111844. name: layerInfo.name,
  111845. layerID: layerID
  111846. });
  111847. layerInfo.opacity != undefined && layer.setOpacity(layerInfo.opacity);
  111848. layer.setVisible(layerInfo.visible);
  111849. layer.setZIndex(index);
  111850. }
  111851. layerInfo.layer = layer;
  111852. layerInfo.layerID = layerID;
  111853. return _context25.abrupt("return", layer);
  111854. case 9:
  111855. case "end":
  111856. return _context25.stop();
  111857. }
  111858. }, _callee23, this);
  111859. }));
  111860. function addVectorTileLayer(_x32, _x33, _x34) {
  111861. return _addVectorTileLayer.apply(this, arguments);
  111862. }
  111863. return addVectorTileLayer;
  111864. }()
  111865. /**
  111866. * @private
  111867. * @function WebMap.prototype.createDataVectorTileLayer
  111868. * @description 创建vectorTILE图层
  111869. * @param {Object} layerInfo - 图层信息
  111870. * @returns {ol.layer.VectorTile} 图层对象
  111871. */
  111872. }, {
  111873. key: "createDataVectorTileLayer",
  111874. value: function () {
  111875. var _createDataVectorTileLayer = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee24(layerInfo) {
  111876. var format, featureType, style;
  111877. return WebMap_regeneratorRuntime().wrap(function _callee24$(_context26) {
  111878. while (1) switch (_context26.prev = _context26.next) {
  111879. case 0:
  111880. //创建图层
  111881. format = new (external_ol_format_MVT_default())({
  111882. featureClass: (external_ol_Feature_default())
  111883. }); //要加上这一句,否则坐标,默认都是3857
  111884. (external_ol_format_MVT_default()).prototype.readProjection = function () {
  111885. return new external_ol_proj_namespaceObject.Projection({
  111886. code: '',
  111887. units: (external_ol_proj_Units_default()).TILE_PIXELS
  111888. });
  111889. };
  111890. featureType = layerInfo.featureType;
  111891. _context26.next = 5;
  111892. return StyleUtils.toOpenLayersStyle(this.getDataVectorTileStyle(featureType), featureType);
  111893. case 5:
  111894. style = _context26.sent;
  111895. return _context26.abrupt("return", new external_ol_layer_namespaceObject.VectorTile({
  111896. //设置避让参数
  111897. source: new VectorTileSuperMapRest({
  111898. url: layerInfo.url,
  111899. projection: layerInfo.projection,
  111900. tileType: "ScaleXY",
  111901. format: format
  111902. }),
  111903. style: style
  111904. }));
  111905. case 7:
  111906. case "end":
  111907. return _context26.stop();
  111908. }
  111909. }, _callee24, this);
  111910. }));
  111911. function createDataVectorTileLayer(_x35) {
  111912. return _createDataVectorTileLayer.apply(this, arguments);
  111913. }
  111914. return createDataVectorTileLayer;
  111915. }()
  111916. /**
  111917. * @private
  111918. * @function WebMap.prototype.getDataVectorTileStyle
  111919. * @description 获取数据服务的mvt上图的默认样式
  111920. * @param {string} featureType - 要素类型
  111921. * @returns {Object} 样式参数
  111922. */
  111923. }, {
  111924. key: "getDataVectorTileStyle",
  111925. value: function getDataVectorTileStyle(featureType) {
  111926. var styleParameters = {
  111927. radius: 8,
  111928. //圆点半径
  111929. fillColor: '#EE4D5A',
  111930. //填充色
  111931. fillOpacity: 0.9,
  111932. strokeColor: '#ffffff',
  111933. //边框颜色
  111934. strokeWidth: 1,
  111935. strokeOpacity: 1,
  111936. lineDash: 'solid',
  111937. type: "BASIC_POINT"
  111938. };
  111939. if (["LINE", "LINESTRING", "MULTILINESTRING"].indexOf(featureType) > -1) {
  111940. styleParameters.strokeColor = '#4CC8A3';
  111941. styleParameters.strokeWidth = 2;
  111942. } else if (["REGION", "POLYGON", "MULTIPOLYGON"].indexOf(featureType) > -1) {
  111943. styleParameters.fillColor = '#826DBA';
  111944. }
  111945. return styleParameters;
  111946. }
  111947. /**
  111948. * @private
  111949. * @function WebMap.prototype.getFiterFeatures
  111950. * @description 通过过滤条件查询满足的feature
  111951. * @param {string} filterCondition - 过滤条件
  111952. * @param {Array} allFeatures - 图层上的feature集合
  111953. */
  111954. }, {
  111955. key: "getFiterFeatures",
  111956. value: function getFiterFeatures(filterCondition, allFeatures) {
  111957. var condition = this.parseFilterCondition(filterCondition);
  111958. var filterFeatures = [];
  111959. for (var i = 0; i < allFeatures.length; i++) {
  111960. var feature = allFeatures[i];
  111961. var filterResult = false;
  111962. try {
  111963. var properties = feature.get('attributes');
  111964. var conditions = parseCondition(condition, Object.keys(properties));
  111965. var filterFeature = parseConditionFeature(properties);
  111966. var sql = 'select * from json where (' + conditions + ')';
  111967. filterResult = window.jsonsql.query(sql, {
  111968. attributes: filterFeature
  111969. });
  111970. } catch (err) {
  111971. //必须把要过滤得内容封装成一个对象,主要是处理jsonsql(line : 62)中由于with语句遍历对象造成的问题
  111972. continue;
  111973. }
  111974. if (filterResult && filterResult.length > 0) {
  111975. //afterFilterFeatureIdx.push(i);
  111976. filterFeatures.push(feature);
  111977. }
  111978. }
  111979. return filterFeatures;
  111980. }
  111981. /**
  111982. * @private
  111983. * @function WebMap.prototype.parseFilterCondition
  111984. * @description 1、替换查询语句 中的 and / AND / or / OR / = / !=
  111985. * 2、匹配 Name in ('', ''),多条件需用()包裹
  111986. * @param {string} filterCondition - 过滤条件
  111987. * @return {string} 换成组件能识别的字符串
  111988. */
  111989. }, {
  111990. key: "parseFilterCondition",
  111991. value: function parseFilterCondition(filterCondition) {
  111992. return filterCondition.replace(/=/g, "==").replace(/AND|and/g, "&&").replace(/or|OR/g, "||").replace(/<==/g, "<=").replace(/>==/g, ">=").replace(/\(?[^\(]+?\s*in\s*\([^\)]+?\)\)?/gi, function (res) {
  111993. // res格式:(省份 in ('四川', '河南'))
  111994. var data = res.match(/([^(]+?)\s*in\s*\(([^)]+?)\)/i);
  111995. return data.length === 3 ? "(".concat(data[2].split(",").map(function (c) {
  111996. return "".concat(data[1], " == ").concat(c.trim());
  111997. }).join(" || "), ")") : res;
  111998. });
  111999. }
  112000. /**
  112001. * @private
  112002. * @function WebMap.prototype.createGraphicLayer
  112003. * @description 添加大数据图层到地图上
  112004. * @param {Object} layerInfo - 图层信息
  112005. * @param {Array} features - feature的集合
  112006. * @return {ol.layer.image} 大数据图层
  112007. */
  112008. }, {
  112009. key: "createGraphicLayer",
  112010. value: function () {
  112011. var _createGraphicLayer = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee25(layerInfo, features) {
  112012. var graphics, source;
  112013. return WebMap_regeneratorRuntime().wrap(function _callee25$(_context27) {
  112014. while (1) switch (_context27.prev = _context27.next) {
  112015. case 0:
  112016. features = layerInfo.filterCondition ? this.getFiterFeatures(layerInfo.filterCondition, features) : features;
  112017. _context27.next = 3;
  112018. return this.getGraphicsFromFeatures(features, layerInfo.style, layerInfo.featureType);
  112019. case 3:
  112020. graphics = _context27.sent;
  112021. source = new Graphic({
  112022. graphics: graphics,
  112023. render: 'canvas',
  112024. map: this.map,
  112025. isHighLight: false
  112026. });
  112027. return _context27.abrupt("return", new external_ol_layer_namespaceObject.Image({
  112028. source: source
  112029. }));
  112030. case 6:
  112031. case "end":
  112032. return _context27.stop();
  112033. }
  112034. }, _callee25, this);
  112035. }));
  112036. function createGraphicLayer(_x36, _x37) {
  112037. return _createGraphicLayer.apply(this, arguments);
  112038. }
  112039. return createGraphicLayer;
  112040. }()
  112041. /**
  112042. * @private
  112043. * @function WebMap.prototype.getGraphicsFromFeatures
  112044. * @description 将feature转换成大数据图层对应的Graphics要素
  112045. * @param {Array} features - feature的集合
  112046. * @param {Object} style - 图层样式
  112047. * @param {string} featureType - feature的类型
  112048. * @return {Array} 大数据图层要素数组
  112049. */
  112050. }, {
  112051. key: "getGraphicsFromFeatures",
  112052. value: function () {
  112053. var _getGraphicsFromFeatures = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee26(features, style, featureType) {
  112054. var olStyle, shape, graphics, i, graphic;
  112055. return WebMap_regeneratorRuntime().wrap(function _callee26$(_context28) {
  112056. while (1) switch (_context28.prev = _context28.next) {
  112057. case 0:
  112058. _context28.next = 2;
  112059. return StyleUtils.getOpenlayersStyle(style, featureType);
  112060. case 2:
  112061. olStyle = _context28.sent;
  112062. shape = olStyle.getImage();
  112063. graphics = []; //构建graphic
  112064. for (i in features) {
  112065. graphic = new Graphic_Graphic(features[i].getGeometry());
  112066. graphic.setStyle(shape);
  112067. graphic.setProperties({
  112068. attributes: features[i].get('attributes')
  112069. });
  112070. graphics.push(graphic);
  112071. }
  112072. return _context28.abrupt("return", graphics);
  112073. case 7:
  112074. case "end":
  112075. return _context28.stop();
  112076. }
  112077. }, _callee26);
  112078. }));
  112079. function getGraphicsFromFeatures(_x38, _x39, _x40) {
  112080. return _getGraphicsFromFeatures.apply(this, arguments);
  112081. }
  112082. return getGraphicsFromFeatures;
  112083. }()
  112084. /**
  112085. * @private
  112086. * @function WebMap.prototype.createSymbolLayer
  112087. * @description 添加符号图层
  112088. * @param {Object} layerInfo - 图层信息
  112089. * @param {Array} features - feature的集合
  112090. * @return {ol.layer.Vector} 符号图层
  112091. */
  112092. }, {
  112093. key: "createSymbolLayer",
  112094. value: function createSymbolLayer(layerInfo, features) {
  112095. var style = StyleUtils.getSymbolStyle(layerInfo.style);
  112096. return new external_ol_layer_namespaceObject.Vector({
  112097. style: style,
  112098. source: new (external_ol_source_Vector_default())({
  112099. features: layerInfo.filterCondition ? this.getFiterFeatures(layerInfo.filterCondition, features) : features,
  112100. wrapX: false
  112101. }),
  112102. renderMode: 'image'
  112103. });
  112104. }
  112105. /**
  112106. * @private
  112107. * @function WebMap.prototype.addLabelLayer
  112108. * @description 添加标签图层
  112109. * @param {Object} layerInfo - 图层信息
  112110. * @param {Array} features -feature的集合
  112111. * @returns {ol.layer.Vector} 图层对象
  112112. */
  112113. }, {
  112114. key: "addLabelLayer",
  112115. value: function addLabelLayer(layerInfo, features) {
  112116. var labelStyle = layerInfo.labelStyle;
  112117. var style = this.getLabelStyle(labelStyle, layerInfo);
  112118. var layer = layerInfo.labelLayer = new external_ol_layer_namespaceObject.Vector({
  112119. declutter: true,
  112120. styleOL: style,
  112121. labelField: labelStyle.labelField,
  112122. source: new (external_ol_source_Vector_default())({
  112123. features: features,
  112124. wrapX: false
  112125. })
  112126. });
  112127. layer.setStyle(function (features) {
  112128. var labelField = labelStyle.labelField;
  112129. var label = features.get('attributes')[labelField.trim()] + "";
  112130. if (label === "undefined") {
  112131. return null;
  112132. }
  112133. var styleOL = layer.get('styleOL');
  112134. var text = styleOL.getText();
  112135. if (text && text.setText) {
  112136. text.setText(label);
  112137. }
  112138. return styleOL;
  112139. });
  112140. this.map.addLayer(layer);
  112141. layer.setVisible(layerInfo.visible);
  112142. layer.setZIndex(1000);
  112143. var visibleScale = layerInfo.visibleScale;
  112144. visibleScale && this.setVisibleScales(layer, visibleScale);
  112145. return layer;
  112146. }
  112147. /**
  112148. * @private
  112149. * @function WebMap.prototype.setVisibleScales
  112150. * @description 改变图层可视范围
  112151. * @param {Object} layer - 图层对象。ol.Layer
  112152. * @param {Object} visibleScale - 图层样式参数
  112153. */
  112154. }, {
  112155. key: "setVisibleScales",
  112156. value: function setVisibleScales(layer, visibleScale) {
  112157. var maxResolution = this.resolutions[visibleScale.minScale],
  112158. minResolution = this.resolutions[visibleScale.maxScale];
  112159. //比例尺和分别率是反比的关系
  112160. maxResolution > 1 ? layer.setMaxResolution(Math.ceil(maxResolution)) : layer.setMaxResolution(maxResolution * 1.1);
  112161. layer.setMinResolution(minResolution);
  112162. }
  112163. /**
  112164. * @private
  112165. * @function WebMap.prototype.getLabelStyle
  112166. * @description 获取标签样式
  112167. * @param {Object} parameters - 标签图层样式参数
  112168. * @param {Object} layerInfo - 图层样式参数
  112169. * @returns {ol.style.Style} 标签样式
  112170. */
  112171. }, {
  112172. key: "getLabelStyle",
  112173. value: function getLabelStyle(parameters, layerInfo) {
  112174. var style = layerInfo.style || layerInfo.pointStyle;
  112175. var _style$radius = style.radius,
  112176. radius = _style$radius === void 0 ? 0 : _style$radius,
  112177. _style$strokeWidth = style.strokeWidth,
  112178. strokeWidth = _style$strokeWidth === void 0 ? 0 : _style$strokeWidth,
  112179. beforeOffsetY = -(radius + strokeWidth);
  112180. var _parameters$fontSize = parameters.fontSize,
  112181. fontSize = _parameters$fontSize === void 0 ? '14px' : _parameters$fontSize,
  112182. fontFamily = parameters.fontFamily,
  112183. fill = parameters.fill,
  112184. backgroundFill = parameters.backgroundFill,
  112185. _parameters$offsetX = parameters.offsetX,
  112186. offsetX = _parameters$offsetX === void 0 ? 0 : _parameters$offsetX,
  112187. _parameters$offsetY = parameters.offsetY,
  112188. offsetY = _parameters$offsetY === void 0 ? beforeOffsetY : _parameters$offsetY,
  112189. _parameters$placement = parameters.placement,
  112190. placement = _parameters$placement === void 0 ? "point" : _parameters$placement,
  112191. _parameters$textBasel = parameters.textBaseline,
  112192. textBaseline = _parameters$textBasel === void 0 ? "bottom" : _parameters$textBasel,
  112193. _parameters$textAlign = parameters.textAlign,
  112194. textAlign = _parameters$textAlign === void 0 ? 'center' : _parameters$textAlign,
  112195. _parameters$outlineCo = parameters.outlineColor,
  112196. outlineColor = _parameters$outlineCo === void 0 ? "#000000" : _parameters$outlineCo,
  112197. _parameters$outlineWi = parameters.outlineWidth,
  112198. outlineWidth = _parameters$outlineWi === void 0 ? 0 : _parameters$outlineWi;
  112199. var option = {
  112200. font: "".concat(fontSize, " ").concat(fontFamily),
  112201. placement: placement,
  112202. textBaseline: textBaseline,
  112203. fill: new (external_ol_style_Fill_default())({
  112204. color: fill
  112205. }),
  112206. backgroundFill: new (external_ol_style_Fill_default())({
  112207. color: backgroundFill
  112208. }),
  112209. padding: [3, 3, 3, 3],
  112210. offsetX: layerInfo.featureType === 'POINT' ? offsetX : 0,
  112211. offsetY: layerInfo.featureType === 'POINT' ? offsetY : 0,
  112212. overflow: true,
  112213. maxAngle: 0
  112214. };
  112215. if (layerInfo.featureType === 'POINT') {
  112216. //线面不需要此参数,否则超出线面overflow:true,也不会显示标签
  112217. option.textAlign = textAlign;
  112218. }
  112219. if (outlineWidth > 0) {
  112220. option.stroke = new (external_ol_style_Stroke_default())({
  112221. color: outlineColor,
  112222. width: outlineWidth
  112223. });
  112224. }
  112225. return new (external_ol_style_Style_default())({
  112226. text: new (external_ol_style_Text_default())(option)
  112227. });
  112228. }
  112229. /**
  112230. * @private
  112231. * @function WebMap.prototype.createVectorLayer
  112232. * @description 创建vector图层
  112233. * @param {Object} layerInfo - 图层信息
  112234. * @param {Array} features -feature的集合
  112235. * @returns {ol.layer.Vector} 矢量图层
  112236. */
  112237. }, {
  112238. key: "createVectorLayer",
  112239. value: function () {
  112240. var _createVectorLayer = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee27(layerInfo, features) {
  112241. var featureType, style, newStyle, _style2, outlineStyle, strokeStyle;
  112242. return WebMap_regeneratorRuntime().wrap(function _callee27$(_context29) {
  112243. while (1) switch (_context29.prev = _context29.next) {
  112244. case 0:
  112245. featureType = layerInfo.featureType, style = layerInfo.style;
  112246. if (!(featureType === 'LINE' && core_Util_Util.isArray(style) && style.length === 2)) {
  112247. _context29.next = 6;
  112248. break;
  112249. }
  112250. _style2 = WebMap_slicedToArray(style, 2), outlineStyle = _style2[0], strokeStyle = _style2[1];
  112251. newStyle = !strokeStyle.lineDash || strokeStyle.lineDash === 'solid' ? StyleUtils.getRoadPath(strokeStyle, outlineStyle) : StyleUtils.getPathway(strokeStyle, outlineStyle);
  112252. _context29.next = 10;
  112253. break;
  112254. case 6:
  112255. if (core_Util_Util.isArray(style)) {
  112256. layerInfo.style = style[0];
  112257. }
  112258. _context29.next = 9;
  112259. return StyleUtils.toOpenLayersStyle(layerInfo.style, layerInfo.featureType);
  112260. case 9:
  112261. newStyle = _context29.sent;
  112262. case 10:
  112263. return _context29.abrupt("return", new external_ol_layer_namespaceObject.Vector({
  112264. style: newStyle,
  112265. source: new (external_ol_source_Vector_default())({
  112266. features: layerInfo.filterCondition ? this.getFiterFeatures(layerInfo.filterCondition, features) : features,
  112267. wrapX: false
  112268. })
  112269. }));
  112270. case 11:
  112271. case "end":
  112272. return _context29.stop();
  112273. }
  112274. }, _callee27, this);
  112275. }));
  112276. function createVectorLayer(_x41, _x42) {
  112277. return _createVectorLayer.apply(this, arguments);
  112278. }
  112279. return createVectorLayer;
  112280. }()
  112281. /**
  112282. * @private
  112283. * @function WebMap.prototype.createHeatLayer
  112284. * @description 创建热力图图层
  112285. * @param {Object} layerInfo - 图层信息
  112286. * @param {Array} features -feature的集合
  112287. * @returns {ol.layer.Heatmap} 热力图图层
  112288. */
  112289. }, {
  112290. key: "createHeatLayer",
  112291. value: function createHeatLayer(layerInfo, features) {
  112292. //因为热力图,随着过滤,需要重新计算权重
  112293. features = layerInfo.filterCondition ? this.getFiterFeatures(layerInfo.filterCondition, features) : features;
  112294. var source = new (external_ol_source_Vector_default())({
  112295. features: features,
  112296. wrapX: false
  112297. });
  112298. var layerOptions = {
  112299. source: source
  112300. };
  112301. var themeSetting = layerInfo.themeSetting;
  112302. layerOptions.gradient = themeSetting.colors.slice();
  112303. layerOptions.radius = parseInt(themeSetting.radius);
  112304. //自定义颜色
  112305. var customSettings = themeSetting.customSettings;
  112306. for (var i in customSettings) {
  112307. layerOptions.gradient[i] = customSettings[i];
  112308. }
  112309. // 权重字段恢复
  112310. if (themeSetting.weight) {
  112311. this.changeWeight(features, themeSetting.weight);
  112312. }
  112313. return new external_ol_layer_namespaceObject.Heatmap(layerOptions);
  112314. }
  112315. /**
  112316. * @private
  112317. * @function WebMap.prototype.changeWeight
  112318. * @description 改变当前权重字段
  112319. * @param {Array} features - feature的集合
  112320. * @param {string} weightFeild - 权重字段
  112321. */
  112322. }, {
  112323. key: "changeWeight",
  112324. value: function changeWeight(features, weightFeild) {
  112325. var that = this;
  112326. this.fieldMaxValue = {};
  112327. this.getMaxValue(features, weightFeild);
  112328. var maxValue = this.fieldMaxValue[weightFeild];
  112329. features.forEach(function (feature) {
  112330. var attributes = feature.get('attributes');
  112331. try {
  112332. var value = attributes[weightFeild];
  112333. feature.set('weight', value / maxValue);
  112334. } catch (e) {
  112335. that.errorCallback && that.errorCallback(e);
  112336. }
  112337. });
  112338. }
  112339. /**
  112340. * @private
  112341. * @function WebMap.prototype.getMaxValue
  112342. * @description 获取当前字段对应的最大值,用于计算权重
  112343. * @param {Array} features - feature 数组
  112344. * @param {string} weightField - 权重字段
  112345. */
  112346. }, {
  112347. key: "getMaxValue",
  112348. value: function getMaxValue(features, weightField) {
  112349. var values = [],
  112350. that = this,
  112351. attributes;
  112352. var field = weightField;
  112353. if (this.fieldMaxValue[field]) {
  112354. return;
  112355. }
  112356. features.forEach(function (feature) {
  112357. //收集当前权重字段对应的所有值
  112358. attributes = feature.get('attributes');
  112359. try {
  112360. values.push(parseFloat(attributes[field]));
  112361. } catch (e) {
  112362. that.errorCallback && that.errorCallback(e);
  112363. }
  112364. });
  112365. this.fieldMaxValue[field] = ArrayStatistic.getArrayStatistic(values, 'Maximum');
  112366. }
  112367. /**
  112368. * @private
  112369. * @function WebMap.prototype.createUniqueLayer
  112370. * @description 获取当前字段对应的最大值,用于计算权重
  112371. * @param {Object} layerInfo - 图层信息
  112372. * @param {Array} features - 所有feature结合
  112373. */
  112374. }, {
  112375. key: "createUniqueLayer",
  112376. value: function () {
  112377. var _createUniqueLayer = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee28(layerInfo, features) {
  112378. var styleSource, layer;
  112379. return WebMap_regeneratorRuntime().wrap(function _callee28$(_context30) {
  112380. while (1) switch (_context30.prev = _context30.next) {
  112381. case 0:
  112382. _context30.next = 2;
  112383. return this.createUniqueSource(layerInfo, features);
  112384. case 2:
  112385. styleSource = _context30.sent;
  112386. layer = new external_ol_layer_namespaceObject.Vector({
  112387. styleSource: styleSource,
  112388. source: new (external_ol_source_Vector_default())({
  112389. features: layerInfo.filterCondition ? this.getFiterFeatures(layerInfo.filterCondition, features) : features,
  112390. wrapX: false
  112391. })
  112392. });
  112393. layer.setStyle(function (feature) {
  112394. var styleSource = layer.get('styleSource');
  112395. var labelField = styleSource.themeField;
  112396. var label = feature.get('attributes')[labelField];
  112397. var styleGroup = styleSource.styleGroups.find(function (item) {
  112398. return item.value === label;
  112399. });
  112400. return styleGroup.olStyle;
  112401. });
  112402. return _context30.abrupt("return", layer);
  112403. case 6:
  112404. case "end":
  112405. return _context30.stop();
  112406. }
  112407. }, _callee28, this);
  112408. }));
  112409. function createUniqueLayer(_x43, _x44) {
  112410. return _createUniqueLayer.apply(this, arguments);
  112411. }
  112412. return createUniqueLayer;
  112413. }()
  112414. /**
  112415. * @private
  112416. * @function WebMap.prototype.createUniqueSource
  112417. * @description 创建单值图层的source
  112418. * @param {Object} parameters- 图层信息
  112419. * @param {Array} features - feature 数组
  112420. * @returns {{map: *, style: *, isHoverAble: *, highlightStyle: *, themeField: *, styleGroups: Array}}
  112421. */
  112422. }, {
  112423. key: "createUniqueSource",
  112424. value: function () {
  112425. var _createUniqueSource = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee29(parameters, features) {
  112426. var styleGroup;
  112427. return WebMap_regeneratorRuntime().wrap(function _callee29$(_context31) {
  112428. while (1) switch (_context31.prev = _context31.next) {
  112429. case 0:
  112430. _context31.next = 2;
  112431. return this.getUniqueStyleGroup(parameters, features);
  112432. case 2:
  112433. styleGroup = _context31.sent;
  112434. return _context31.abrupt("return", {
  112435. map: this.map,
  112436. //必传参数 API居然不提示
  112437. style: parameters.style,
  112438. isHoverAble: parameters.isHoverAble,
  112439. highlightStyle: parameters.highlightStyle,
  112440. themeField: parameters.themeSetting.themeField,
  112441. styleGroups: styleGroup
  112442. });
  112443. case 4:
  112444. case "end":
  112445. return _context31.stop();
  112446. }
  112447. }, _callee29, this);
  112448. }));
  112449. function createUniqueSource(_x45, _x46) {
  112450. return _createUniqueSource.apply(this, arguments);
  112451. }
  112452. return createUniqueSource;
  112453. }()
  112454. /**
  112455. * @private
  112456. * @function WebMap.prototype.getUniqueStyleGroup
  112457. * @description 获取单值专题图的styleGroup
  112458. * @param {Object} parameters- 图层信息
  112459. * @param {Array} features - feature 数组
  112460. * @returns {Array} 单值样式
  112461. */
  112462. }, {
  112463. key: "getUniqueStyleGroup",
  112464. value: function () {
  112465. var _getUniqueStyleGroup = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee30(parameters, features) {
  112466. var featureType, style, themeSetting, fieldName, names, customSettings, i, attributes, name, isSaved, j, styleGroup, usedColors, curentColors, newColors, index, _name, key, custom, olStyle, type;
  112467. return WebMap_regeneratorRuntime().wrap(function _callee30$(_context32) {
  112468. while (1) switch (_context32.prev = _context32.next) {
  112469. case 0:
  112470. // 找出所有的单值
  112471. featureType = parameters.featureType, style = parameters.style, themeSetting = parameters.themeSetting;
  112472. fieldName = themeSetting.themeField;
  112473. names = [], customSettings = themeSetting.customSettings;
  112474. _context32.t0 = WebMap_regeneratorRuntime().keys(features);
  112475. case 4:
  112476. if ((_context32.t1 = _context32.t0()).done) {
  112477. _context32.next = 20;
  112478. break;
  112479. }
  112480. i = _context32.t1.value;
  112481. attributes = features[i].get('attributes');
  112482. name = attributes[fieldName];
  112483. isSaved = false;
  112484. _context32.t2 = WebMap_regeneratorRuntime().keys(names);
  112485. case 10:
  112486. if ((_context32.t3 = _context32.t2()).done) {
  112487. _context32.next = 17;
  112488. break;
  112489. }
  112490. j = _context32.t3.value;
  112491. if (!(names[j] === name)) {
  112492. _context32.next = 15;
  112493. break;
  112494. }
  112495. isSaved = true;
  112496. return _context32.abrupt("break", 17);
  112497. case 15:
  112498. _context32.next = 10;
  112499. break;
  112500. case 17:
  112501. if (!isSaved) {
  112502. names.push(name);
  112503. }
  112504. _context32.next = 4;
  112505. break;
  112506. case 20:
  112507. //生成styleGroup
  112508. styleGroup = [];
  112509. usedColors = this.getCustomSettingColors(customSettings, featureType).map(function (item) {
  112510. return item.toLowerCase();
  112511. });
  112512. curentColors = this.getUniqueColors(themeSetting.colors || this.defaultParameters.themeSetting.colors, names.length + Object.keys(customSettings).length).map(function (item) {
  112513. return item.toLowerCase();
  112514. });
  112515. newColors = lodash_difference_default()(curentColors, usedColors);
  112516. index = 0;
  112517. case 25:
  112518. if (!(index < names.length)) {
  112519. _context32.next = 53;
  112520. break;
  112521. }
  112522. _name = names[index]; //兼容之前自定义是用key,现在因为数据支持编辑,需要用属性值。
  112523. key = this.webMapVersion === "1.0" ? index : _name;
  112524. custom = customSettings[key];
  112525. if (core_Util_Util.isString(custom)) {
  112526. //兼容之前自定义只存储一个color
  112527. custom = this.getCustomSetting(style, custom, featureType);
  112528. customSettings[key] = custom;
  112529. }
  112530. if (!custom) {
  112531. custom = this.getCustomSetting(style, newColors.shift(), featureType);
  112532. }
  112533. // 转化成 ol 样式
  112534. olStyle = void 0, type = custom.type;
  112535. if (!(type === 'SYMBOL_POINT')) {
  112536. _context32.next = 36;
  112537. break;
  112538. }
  112539. olStyle = StyleUtils.getSymbolStyle(custom);
  112540. _context32.next = 49;
  112541. break;
  112542. case 36:
  112543. if (!(type === 'SVG_POINT')) {
  112544. _context32.next = 42;
  112545. break;
  112546. }
  112547. _context32.next = 39;
  112548. return StyleUtils.getSVGStyle(custom);
  112549. case 39:
  112550. olStyle = _context32.sent;
  112551. _context32.next = 49;
  112552. break;
  112553. case 42:
  112554. if (!(type === 'IMAGE_POINT')) {
  112555. _context32.next = 46;
  112556. break;
  112557. }
  112558. olStyle = StyleUtils.getImageStyle(custom);
  112559. _context32.next = 49;
  112560. break;
  112561. case 46:
  112562. _context32.next = 48;
  112563. return StyleUtils.toOpenLayersStyle(custom, featureType);
  112564. case 48:
  112565. olStyle = _context32.sent;
  112566. case 49:
  112567. styleGroup.push({
  112568. olStyle: olStyle,
  112569. style: customSettings[key],
  112570. value: _name
  112571. });
  112572. case 50:
  112573. index++;
  112574. _context32.next = 25;
  112575. break;
  112576. case 53:
  112577. return _context32.abrupt("return", styleGroup);
  112578. case 54:
  112579. case "end":
  112580. return _context32.stop();
  112581. }
  112582. }, _callee30, this);
  112583. }));
  112584. function getUniqueStyleGroup(_x47, _x48) {
  112585. return _getUniqueStyleGroup.apply(this, arguments);
  112586. }
  112587. return getUniqueStyleGroup;
  112588. }()
  112589. /**
  112590. * @description 获取单值专题图自定义样式对象
  112591. * @param {Object} style - 图层上的样式
  112592. * @param {string} color - 单值对应的颜色
  112593. * @param {string} featureType - 要素类型
  112594. */
  112595. }, {
  112596. key: "getCustomSetting",
  112597. value: function getCustomSetting(style, color, featureType) {
  112598. var newProps = {};
  112599. if (featureType === "LINE") {
  112600. newProps.strokeColor = color;
  112601. } else {
  112602. newProps.fillColor = color;
  112603. }
  112604. var customSetting = Object.assign(style, newProps);
  112605. return customSetting;
  112606. }
  112607. }, {
  112608. key: "getCustomSettingColors",
  112609. value: function getCustomSettingColors(customSettings, featureType) {
  112610. var keys = Object.keys(customSettings);
  112611. var colors = [];
  112612. keys.forEach(function (key) {
  112613. //兼容之前自定义只存储一个color
  112614. if (core_Util_Util.isString(customSettings[key])) {
  112615. colors.push(customSettings[key]);
  112616. return;
  112617. }
  112618. if (featureType === "LINE") {
  112619. colors.push(customSettings[key].strokeColor);
  112620. } else {
  112621. colors.push(customSettings[key].fillColor);
  112622. }
  112623. });
  112624. return colors;
  112625. }
  112626. }, {
  112627. key: "getUniqueColors",
  112628. value: function getUniqueColors(colors, valuesLen) {
  112629. return ColorsPickerUtil.getGradientColors(colors, valuesLen);
  112630. }
  112631. /**
  112632. * @private
  112633. * @function WebMap.prototype.createRangeLayer
  112634. * @description 创建分段图层
  112635. * @param {Object} layerInfo- 图层信息
  112636. * @param {Array} features - 所有feature结合
  112637. * @returns {ol.layer.Vector} 单值图层
  112638. */
  112639. }, {
  112640. key: "createRangeLayer",
  112641. value: function () {
  112642. var _createRangeLayer = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee31(layerInfo, features) {
  112643. var styleSource, layer;
  112644. return WebMap_regeneratorRuntime().wrap(function _callee31$(_context33) {
  112645. while (1) switch (_context33.prev = _context33.next) {
  112646. case 0:
  112647. _context33.next = 2;
  112648. return this.createRangeSource(layerInfo, features);
  112649. case 2:
  112650. styleSource = _context33.sent;
  112651. layer = new external_ol_layer_namespaceObject.Vector({
  112652. styleSource: styleSource,
  112653. source: new (external_ol_source_Vector_default())({
  112654. features: layerInfo.filterCondition ? this.getFiterFeatures(layerInfo.filterCondition, features) : features,
  112655. wrapX: false
  112656. })
  112657. });
  112658. layer.setStyle(function (feature) {
  112659. var styleSource = layer.get('styleSource');
  112660. if (styleSource) {
  112661. var labelField = styleSource.themeField;
  112662. var value = Number(feature.get('attributes')[labelField.trim()]);
  112663. var styleGroups = styleSource.styleGroups;
  112664. for (var i = 0; i < styleGroups.length; i++) {
  112665. if (i === 0) {
  112666. if (value >= styleGroups[i].start && value <= styleGroups[i].end) {
  112667. return styleGroups[i].olStyle;
  112668. }
  112669. } else {
  112670. if (value > styleGroups[i].start && value <= styleGroups[i].end) {
  112671. return styleGroups[i].olStyle;
  112672. }
  112673. }
  112674. }
  112675. }
  112676. });
  112677. return _context33.abrupt("return", layer);
  112678. case 6:
  112679. case "end":
  112680. return _context33.stop();
  112681. }
  112682. }, _callee31, this);
  112683. }));
  112684. function createRangeLayer(_x49, _x50) {
  112685. return _createRangeLayer.apply(this, arguments);
  112686. }
  112687. return createRangeLayer;
  112688. }()
  112689. /**
  112690. * @private
  112691. * @function WebMap.prototype.createRangeSource
  112692. * @description 创建分段专题图的图层source
  112693. * @param {Object} parameters- 图层信息
  112694. * @param {Array} features - 所以的feature集合
  112695. * @returns {Object} 图层source
  112696. */
  112697. }, {
  112698. key: "createRangeSource",
  112699. value: function () {
  112700. var _createRangeSource = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee32(parameters, features) {
  112701. var styleGroup;
  112702. return WebMap_regeneratorRuntime().wrap(function _callee32$(_context34) {
  112703. while (1) switch (_context34.prev = _context34.next) {
  112704. case 0:
  112705. _context34.next = 2;
  112706. return this.getRangeStyleGroup(parameters, features);
  112707. case 2:
  112708. styleGroup = _context34.sent;
  112709. if (!styleGroup) {
  112710. _context34.next = 7;
  112711. break;
  112712. }
  112713. return _context34.abrupt("return", {
  112714. style: parameters.style,
  112715. themeField: parameters.themeSetting.themeField,
  112716. styleGroups: styleGroup
  112717. });
  112718. case 7:
  112719. return _context34.abrupt("return", false);
  112720. case 8:
  112721. case "end":
  112722. return _context34.stop();
  112723. }
  112724. }, _callee32, this);
  112725. }));
  112726. function createRangeSource(_x51, _x52) {
  112727. return _createRangeSource.apply(this, arguments);
  112728. }
  112729. return createRangeSource;
  112730. }()
  112731. /**
  112732. * @private
  112733. * @function WebMap.prototype.getRangeStyleGroup
  112734. * @description 获取分段专题图的styleGroup样式
  112735. * @param {Object} parameters- 图层信息
  112736. * @param {Array} features - 所以的feature集合
  112737. * @returns {Array} styleGroups
  112738. */
  112739. }, {
  112740. key: "getRangeStyleGroup",
  112741. value: function () {
  112742. var _getRangeStyleGroup = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee33(parameters, features) {
  112743. var featureType, themeSetting, style, count, method, colors, customSettings, fieldName, values, attributes, segmentCount, segmentMethod, that, segements, itemNum, key, value, curentColors, index, styleGroups, i, color, olStyle, start, end;
  112744. return WebMap_regeneratorRuntime().wrap(function _callee33$(_context35) {
  112745. while (1) switch (_context35.prev = _context35.next) {
  112746. case 0:
  112747. // 找出分段值
  112748. featureType = parameters.featureType, themeSetting = parameters.themeSetting, style = parameters.style;
  112749. count = themeSetting.segmentCount, method = themeSetting.segmentMethod, colors = themeSetting.colors, customSettings = themeSetting.customSettings, fieldName = themeSetting.themeField;
  112750. values = [];
  112751. segmentCount = count;
  112752. segmentMethod = method;
  112753. that = this;
  112754. features.forEach(function (feature) {
  112755. attributes = feature.get("attributes");
  112756. try {
  112757. if (attributes) {
  112758. //过滤掉非数值的数据
  112759. var value = attributes[fieldName.trim()];
  112760. if (value !== undefined && value !== null && core_Util_Util.isNumber(value)) {
  112761. values.push(parseFloat(value));
  112762. }
  112763. } else if (feature.get(fieldName) && core_Util_Util.isNumber(feature.get(fieldName))) {
  112764. if (feature.get(fieldName)) {
  112765. values.push(parseFloat(feature.get(fieldName)));
  112766. }
  112767. }
  112768. } catch (e) {
  112769. that.errorCallback && that.errorCallback(e);
  112770. }
  112771. });
  112772. try {
  112773. segements = ArrayStatistic.getArraySegments(values, segmentMethod, segmentCount);
  112774. } catch (e) {
  112775. that.errorCallback && that.errorCallback(e);
  112776. }
  112777. if (!segements) {
  112778. _context35.next = 33;
  112779. break;
  112780. }
  112781. itemNum = segmentCount;
  112782. if (attributes && segements[0] === segements[attributes.length - 1]) {
  112783. itemNum = 1;
  112784. segements.length = 2;
  112785. }
  112786. //保留两位有效数
  112787. for (key in segements) {
  112788. value = segements[key];
  112789. if (Number(key) === 0) {
  112790. // 最小的值下舍入,要用两个等于号。否则有些值判断不对
  112791. value = Math.floor(value * 100) / 100;
  112792. } else {
  112793. // 其余上舍入
  112794. value = Math.ceil(value * 100) / 100 + 0.1; // 加0.1 解决最大值没有样式问题
  112795. }
  112796. segements[key] = Number(value.toFixed(2));
  112797. }
  112798. //获取一定量的颜色
  112799. curentColors = colors;
  112800. curentColors = ColorsPickerUtil.getGradientColors(curentColors, itemNum, 'RANGE');
  112801. for (index = 0; index < itemNum; index++) {
  112802. if (index in customSettings) {
  112803. if (customSettings[index]["segment"]["start"]) {
  112804. segements[index] = customSettings[index]["segment"]["start"];
  112805. }
  112806. if (customSettings[index]["segment"]["end"]) {
  112807. segements[index + 1] = customSettings[index]["segment"]["end"];
  112808. }
  112809. }
  112810. }
  112811. //生成styleGroup
  112812. styleGroups = [];
  112813. i = 0;
  112814. case 17:
  112815. if (!(i < itemNum)) {
  112816. _context35.next = 30;
  112817. break;
  112818. }
  112819. color = curentColors[i];
  112820. if (i in customSettings) {
  112821. if (customSettings[i].color) {
  112822. color = customSettings[i].color;
  112823. }
  112824. }
  112825. if (featureType === "LINE") {
  112826. style.strokeColor = color;
  112827. } else {
  112828. style.fillColor = color;
  112829. }
  112830. // 转化成 ol 样式
  112831. _context35.next = 23;
  112832. return StyleUtils.toOpenLayersStyle(style, featureType);
  112833. case 23:
  112834. olStyle = _context35.sent;
  112835. start = segements[i];
  112836. end = segements[i + 1];
  112837. styleGroups.push({
  112838. olStyle: olStyle,
  112839. color: color,
  112840. start: start,
  112841. end: end
  112842. });
  112843. case 27:
  112844. i++;
  112845. _context35.next = 17;
  112846. break;
  112847. case 30:
  112848. return _context35.abrupt("return", styleGroups);
  112849. case 33:
  112850. return _context35.abrupt("return", false);
  112851. case 34:
  112852. case "end":
  112853. return _context35.stop();
  112854. }
  112855. }, _callee33, this);
  112856. }));
  112857. function getRangeStyleGroup(_x53, _x54) {
  112858. return _getRangeStyleGroup.apply(this, arguments);
  112859. }
  112860. return getRangeStyleGroup;
  112861. }()
  112862. /**
  112863. * @private
  112864. * @function WebMap.prototype.createMarkerLayer
  112865. * @description 创建标注图层
  112866. * @param {Array} features - 所以的feature集合
  112867. * @returns {ol.layer.Vector} 矢量图层
  112868. */
  112869. }, {
  112870. key: "createMarkerLayer",
  112871. value: function () {
  112872. var _createMarkerLayer = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee34(features) {
  112873. return WebMap_regeneratorRuntime().wrap(function _callee34$(_context36) {
  112874. while (1) switch (_context36.prev = _context36.next) {
  112875. case 0:
  112876. _context36.t0 = features;
  112877. if (!_context36.t0) {
  112878. _context36.next = 4;
  112879. break;
  112880. }
  112881. _context36.next = 4;
  112882. return this.setEachFeatureDefaultStyle(features);
  112883. case 4:
  112884. return _context36.abrupt("return", new external_ol_layer_namespaceObject.Vector({
  112885. source: new (external_ol_source_Vector_default())({
  112886. features: features,
  112887. wrapX: false
  112888. })
  112889. }));
  112890. case 5:
  112891. case "end":
  112892. return _context36.stop();
  112893. }
  112894. }, _callee34, this);
  112895. }));
  112896. function createMarkerLayer(_x55) {
  112897. return _createMarkerLayer.apply(this, arguments);
  112898. }
  112899. return createMarkerLayer;
  112900. }()
  112901. /**
  112902. * @private
  112903. * @function WebMap.prototype.createDataflowLayer
  112904. * @description 创建数据流图层
  112905. * @param {Object} layerInfo- 图层信息
  112906. * @param {number} layerIndex - 图层的zindex
  112907. * @returns {ol.layer.Vector} 数据流图层
  112908. */
  112909. }, {
  112910. key: "createDataflowLayer",
  112911. value: function () {
  112912. var _createDataflowLayer = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee35(layerInfo, layerIndex) {
  112913. var layerStyle, style, source, labelLayer, labelSource, pathLayer, pathSource, layer, visibleScale, featureCache, labelFeatureCache, pathFeatureCache, that;
  112914. return WebMap_regeneratorRuntime().wrap(function _callee35$(_context37) {
  112915. while (1) switch (_context37.prev = _context37.next) {
  112916. case 0:
  112917. layerStyle = layerInfo.pointStyle; //获取样式
  112918. _context37.next = 3;
  112919. return StyleUtils.getOpenlayersStyle(layerStyle, layerInfo.featureType);
  112920. case 3:
  112921. style = _context37.sent;
  112922. source = new (external_ol_source_Vector_default())({
  112923. wrapX: false
  112924. });
  112925. layer = new external_ol_layer_namespaceObject.Vector({
  112926. styleOL: style,
  112927. source: source
  112928. });
  112929. if (layerInfo.labelStyle && layerInfo.visible) {
  112930. //有标签图层
  112931. labelLayer = this.addLabelLayer(layerInfo);
  112932. //和编辑页面保持一致
  112933. labelLayer.setZIndex(1000);
  112934. labelSource = labelLayer.getSource();
  112935. }
  112936. visibleScale = layerInfo.visibleScale;
  112937. if (!(layerInfo.lineStyle && layerInfo.visible)) {
  112938. _context37.next = 17;
  112939. break;
  112940. }
  112941. _context37.next = 11;
  112942. return this.createVectorLayer({
  112943. style: layerInfo.lineStyle,
  112944. featureType: "LINE"
  112945. });
  112946. case 11:
  112947. pathLayer = _context37.sent;
  112948. pathSource = pathLayer.getSource();
  112949. pathLayer.setZIndex(layerIndex);
  112950. this.map.addLayer(pathLayer);
  112951. visibleScale && this.setVisibleScales(pathLayer, visibleScale);
  112952. // 挂载到layerInfo上,便于删除
  112953. layerInfo.pathLayer = pathLayer;
  112954. case 17:
  112955. featureCache = {}, labelFeatureCache = {}, pathFeatureCache = {}, that = this;
  112956. this.createDataflowService(layerInfo, function (featureCache, labelFeatureCache, pathFeatureCache) {
  112957. return function (feature) {
  112958. that.events.triggerEvent('updateDataflowFeature', {
  112959. feature: feature,
  112960. identifyField: layerInfo.identifyField,
  112961. layerID: layerInfo.layerID
  112962. });
  112963. if (layerInfo.filterCondition) {
  112964. //过滤条件
  112965. var condition = that.parseFilterCondition(layerInfo.filterCondition);
  112966. var properties = feature.get('attributes');
  112967. var conditions = parseCondition(condition, Object.keys(properties));
  112968. var filterFeature = parseConditionFeature(properties);
  112969. var sql = 'select * from json where (' + conditions + ')';
  112970. var filterResult = window.jsonsql.query(sql, {
  112971. attributes: filterFeature
  112972. });
  112973. if (filterResult && filterResult.length > 0) {
  112974. that.addDataflowFeature(feature, layerInfo.identifyField, {
  112975. dataflowSource: source,
  112976. featureCache: featureCache,
  112977. labelSource: labelSource,
  112978. labelFeatureCache: labelFeatureCache,
  112979. pathSource: pathSource,
  112980. pathFeatureCache: pathFeatureCache,
  112981. maxPointCount: layerInfo.maxPointCount
  112982. });
  112983. }
  112984. } else {
  112985. that.addDataflowFeature(feature, layerInfo.identifyField, {
  112986. dataflowSource: source,
  112987. featureCache: featureCache,
  112988. labelSource: labelSource,
  112989. labelFeatureCache: labelFeatureCache,
  112990. pathSource: pathSource,
  112991. pathFeatureCache: pathFeatureCache,
  112992. maxPointCount: layerInfo.maxPointCount
  112993. });
  112994. }
  112995. };
  112996. }(featureCache, labelFeatureCache, pathFeatureCache));
  112997. this.setFeatureStyle(layer, layerInfo.directionField, layerStyle.type);
  112998. return _context37.abrupt("return", layer);
  112999. case 21:
  113000. case "end":
  113001. return _context37.stop();
  113002. }
  113003. }, _callee35, this);
  113004. }));
  113005. function createDataflowLayer(_x56, _x57) {
  113006. return _createDataflowLayer.apply(this, arguments);
  113007. }
  113008. return createDataflowLayer;
  113009. }()
  113010. /**
  113011. * @private
  113012. * @function WebMap.prototype.addDataflowFeature
  113013. * @description 添加数据流的feature
  113014. * @param {Object} feature - 服务器更新的feature
  113015. * @param {string} identifyField - 标识feature的字段
  113016. * @param {Object} options - 其他参数
  113017. */
  113018. }, {
  113019. key: "addDataflowFeature",
  113020. value: function addDataflowFeature(feature, identifyField, options) {
  113021. options.dataflowSource && this.addFeatureFromDataflowService(options.dataflowSource, feature, identifyField, options.featureCache);
  113022. options.labelSource && this.addFeatureFromDataflowService(options.labelSource, feature, identifyField, options.labelFeatureCache);
  113023. options.pathSource && this.addPathFeature(options.pathSource, feature, identifyField, options.pathFeatureCache, options.maxPointCount);
  113024. }
  113025. /**
  113026. * @private
  113027. * @function WebMap.prototype.addPathFeature
  113028. * @description 添加数据流图层中轨迹线的feature
  113029. * @param {Object} source - 轨迹线图层的source
  113030. * @param {Object} feature - 轨迹线feature
  113031. * @param {string} identifyField - 标识feature的字段
  113032. * @param {Object} featureCache - 存储feature
  113033. * @param {number} maxPointCount - 轨迹线最多点个数数量
  113034. */
  113035. }, {
  113036. key: "addPathFeature",
  113037. value: function addPathFeature(source, feature, identifyField, featureCache, maxPointCount) {
  113038. var coordinates = [];
  113039. var geoID = feature.get(identifyField);
  113040. if (featureCache[geoID]) {
  113041. //加过feautre
  113042. coordinates = featureCache[geoID].getGeometry().getCoordinates();
  113043. coordinates.push(feature.getGeometry().getCoordinates());
  113044. if (maxPointCount && coordinates.length > maxPointCount) {
  113045. coordinates.splice(0, coordinates.length - maxPointCount);
  113046. }
  113047. featureCache[geoID].getGeometry().setCoordinates(coordinates);
  113048. } else {
  113049. coordinates.push(feature.getGeometry().getCoordinates());
  113050. featureCache[geoID] = new (external_ol_Feature_default())({
  113051. geometry: new external_ol_geom_namespaceObject.LineString(coordinates)
  113052. });
  113053. source.addFeature(featureCache[geoID]);
  113054. }
  113055. }
  113056. /**
  113057. * @private
  113058. * @function WebMap.prototype.setFeatureStyle
  113059. * @description 设置feature样式
  113060. * @param {Object} layer - 图层对象
  113061. * @param {string} directionField - 方向字段
  113062. * @param {string} styleType - 样式的类型
  113063. */
  113064. }, {
  113065. key: "setFeatureStyle",
  113066. value: function setFeatureStyle(layer, directionField, styleType) {
  113067. var layerStyle = layer.get('styleOL');
  113068. layer.setStyle(function (feature) {
  113069. //有转向字段
  113070. var value, image;
  113071. if (directionField !== undefined && directionField !== "未设置" && directionField !== "None") {
  113072. value = feature.get('attributes')[directionField];
  113073. } else {
  113074. value = 0;
  113075. }
  113076. if (value > 360 || value < 0) {
  113077. return null;
  113078. }
  113079. if (styleType === "SYMBOL_POINT") {
  113080. image = layerStyle.getText();
  113081. } else {
  113082. image = layerStyle.getImage();
  113083. }
  113084. //默认用户使用的是角度,换算成弧度
  113085. var rotate = Math.PI * value / 180;
  113086. image && image.setRotation(rotate);
  113087. return layerStyle;
  113088. });
  113089. }
  113090. /**
  113091. * @private
  113092. * @function WebMap.prototype.createDataflowHeatLayer
  113093. * @description 创建数据流服务的热力图图层
  113094. * @param {Object} layerInfo - 图层参数
  113095. * @returns {ol.layer.Heatmap} 热力图图层对象
  113096. */
  113097. }, {
  113098. key: "createDataflowHeatLayer",
  113099. value: function createDataflowHeatLayer(layerInfo) {
  113100. var source = this.createDataflowHeatSource(layerInfo);
  113101. var layerOptions = {
  113102. source: source
  113103. };
  113104. layerOptions.gradient = layerInfo.themeSetting.colors.slice();
  113105. layerOptions.radius = parseInt(layerInfo.themeSetting.radius);
  113106. if (layerInfo.themeSetting.customSettings) {
  113107. var customSettings = layerInfo.themeSetting.customSettings;
  113108. for (var i in customSettings) {
  113109. layerOptions.gradient[i] = customSettings[i];
  113110. }
  113111. }
  113112. return new external_ol_layer_namespaceObject.Heatmap(layerOptions);
  113113. }
  113114. /**
  113115. * @private
  113116. * @function WebMap.prototype.createDataflowHeatSource
  113117. * @description 创建数据流服务的热力图的source
  113118. * @param {Object} layerInfo - 图层参数
  113119. * @returns {ol.souce.Vector} 热力图source对象
  113120. */
  113121. }, {
  113122. key: "createDataflowHeatSource",
  113123. value: function createDataflowHeatSource(layerInfo) {
  113124. var that = this,
  113125. source = new (external_ol_source_Vector_default())({
  113126. wrapX: false
  113127. });
  113128. var featureCache = {};
  113129. this.createDataflowService(layerInfo, function (featureCache) {
  113130. return function (feature) {
  113131. if (layerInfo.filterCondition) {
  113132. //过滤条件
  113133. var condition = that.parseFilterCondition(layerInfo.filterCondition);
  113134. var properties = feature.get('attributes');
  113135. var conditions = parseCondition(condition, Object.keys(properties));
  113136. var filterFeature = parseConditionFeature(properties);
  113137. var sql = 'select * from json where (' + conditions + ')';
  113138. var filterResult = window.jsonsql.query(sql, {
  113139. attributes: filterFeature
  113140. });
  113141. if (filterResult && filterResult.length > 0) {
  113142. that.addDataflowFeature(feature, layerInfo.identifyField, {
  113143. dataflowSource: source,
  113144. featureCache: featureCache
  113145. });
  113146. }
  113147. } else {
  113148. that.addDataflowFeature(feature, layerInfo.identifyField, {
  113149. dataflowSource: source,
  113150. featureCache: featureCache
  113151. });
  113152. }
  113153. // 权重字段恢复
  113154. if (layerInfo.themeSetting.weight) {
  113155. that.changeWeight(source.getFeatures(), layerInfo.themeSetting.weight);
  113156. }
  113157. };
  113158. }(featureCache));
  113159. return source;
  113160. }
  113161. /**
  113162. * @private
  113163. * @function WebMap.prototype.addFeatureFromDataflowService
  113164. * @description 将feature添加到数据流图层
  113165. * @param {Object} source - 图层对应的source
  113166. * @param {Object} feature - 需要添加到图层的feature
  113167. * @param {Object} identifyField - feature的标识字段
  113168. * @param {Object} featureCache - 存储已添加到图层的feature对象
  113169. */
  113170. }, {
  113171. key: "addFeatureFromDataflowService",
  113172. value: function addFeatureFromDataflowService(source, feature, identifyField, featureCache) {
  113173. //判断是否有这个feature,存在feature就更新位置。
  113174. var geoID = feature.get(identifyField);
  113175. if (geoID !== undefined && featureCache[geoID]) {
  113176. /*if(that.addFeatureFinish) {
  113177. //feature全都加上图层,就缩放范围
  113178. MapManager.zoomToExtent(LayerUtil.getBoundsFromFeatures(source.getFeatures()));
  113179. that.addFeatureFinish = false;
  113180. }*/
  113181. featureCache[geoID].setGeometry(feature.getGeometry());
  113182. featureCache[geoID].setProperties(feature.getProperties());
  113183. source.changed();
  113184. } else {
  113185. source.addFeature(feature);
  113186. featureCache[geoID] = feature;
  113187. }
  113188. }
  113189. /**
  113190. * @private
  113191. * @function WebMap.prototype.createDataflowService
  113192. * @description 将feature添加到数据流图层
  113193. * @param {Object} layerInfo - 图层参数
  113194. * @param {Object} callback - 回调函数
  113195. */
  113196. }, {
  113197. key: "createDataflowService",
  113198. value: function createDataflowService(layerInfo, callback) {
  113199. var that = this;
  113200. var dataflowService = new DataFlowService(layerInfo.wsUrl).initSubscribe();
  113201. dataflowService.on('messageSucceeded', function (e) {
  113202. var geojson = JSON.parse(e.value.data);
  113203. var feature = transformTools.readFeature(geojson, {
  113204. dataProjection: layerInfo.projection || "EPSG:4326",
  113205. featureProjection: that.baseProjection || 'EPSG:4326'
  113206. });
  113207. feature.setProperties({
  113208. attributes: geojson.properties
  113209. });
  113210. callback(feature);
  113211. });
  113212. layerInfo.dataflowService = dataflowService;
  113213. }
  113214. /**
  113215. * @private
  113216. * @function WebMap.prototype.setEachFeatureDefaultStyle
  113217. * @description 为标注图层上的feature设置样式
  113218. * @param {Array} features - 所以的feature集合
  113219. */
  113220. }, {
  113221. key: "setEachFeatureDefaultStyle",
  113222. value: function () {
  113223. var _setEachFeatureDefaultStyle = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee36(features) {
  113224. var that, i, feature, geomType, defaultStyle, attributes;
  113225. return WebMap_regeneratorRuntime().wrap(function _callee36$(_context38) {
  113226. while (1) switch (_context38.prev = _context38.next) {
  113227. case 0:
  113228. that = this;
  113229. features = core_Util_Util.isArray(features) || features instanceof (external_ol_Collection_default()) ? features : [features];
  113230. i = 0;
  113231. case 3:
  113232. if (!(i < features.length)) {
  113233. _context38.next = 16;
  113234. break;
  113235. }
  113236. feature = features[i];
  113237. geomType = feature.getGeometry().getType().toUpperCase(); // let styleType = geomType === "POINT" ? 'MARKER' : geomType;
  113238. defaultStyle = feature.getProperties().useStyle;
  113239. if (defaultStyle) {
  113240. if (geomType === 'POINT' && defaultStyle.text) {
  113241. //说明是文字的feature类型
  113242. geomType = "TEXT";
  113243. }
  113244. attributes = that.setFeatureInfo(feature);
  113245. feature.setProperties({
  113246. useStyle: defaultStyle,
  113247. attributes: attributes
  113248. });
  113249. //标注图层的feature上需要存一个layerId,为了之后样式应用到图层上使用
  113250. // feature.layerId = timeId;
  113251. if (geomType === 'POINT' && defaultStyle.src && defaultStyle.src.indexOf('http://') === -1 && defaultStyle.src.indexOf('https://') === -1) {
  113252. //说明地址不完整
  113253. defaultStyle.src = that.server + defaultStyle.src;
  113254. }
  113255. } else {
  113256. defaultStyle = StyleUtils.getMarkerDefaultStyle(geomType, that.server);
  113257. }
  113258. _context38.t0 = feature;
  113259. _context38.next = 11;
  113260. return StyleUtils.toOpenLayersStyle(defaultStyle, geomType);
  113261. case 11:
  113262. _context38.t1 = _context38.sent;
  113263. _context38.t0.setStyle.call(_context38.t0, _context38.t1);
  113264. case 13:
  113265. i++;
  113266. _context38.next = 3;
  113267. break;
  113268. case 16:
  113269. case "end":
  113270. return _context38.stop();
  113271. }
  113272. }, _callee36, this);
  113273. }));
  113274. function setEachFeatureDefaultStyle(_x58) {
  113275. return _setEachFeatureDefaultStyle.apply(this, arguments);
  113276. }
  113277. return setEachFeatureDefaultStyle;
  113278. }()
  113279. /**
  113280. * @private
  113281. * @function WebMap.prototype.setFeatureInfo
  113282. * @description 为feature设置属性
  113283. * @param {Array} feature - 单个feature
  113284. * @returns {Object} 属性
  113285. */
  113286. }, {
  113287. key: "setFeatureInfo",
  113288. value: function setFeatureInfo(feature) {
  113289. var attributes = feature.get('attributes'),
  113290. defaultAttr = {
  113291. dataViz_title: '',
  113292. dataViz_description: '',
  113293. dataViz_imgUrl: '',
  113294. dataViz_url: ''
  113295. },
  113296. newAttribute = Object.assign(defaultAttr, attributes);
  113297. var properties = feature.getProperties();
  113298. for (var key in newAttribute) {
  113299. if (properties[key]) {
  113300. newAttribute[key] = properties[key];
  113301. delete properties[key];
  113302. }
  113303. }
  113304. return newAttribute;
  113305. }
  113306. /**
  113307. * @private
  113308. * @function WebMap.prototype.createRankSymbolLayer
  113309. * @description 创建等级符号图层
  113310. * @param {Object} layerInfo - 图层信息
  113311. * @param {Array} features - 添加到图层上的features
  113312. * @returns {ol.layer.Vector} 矢量图层
  113313. */
  113314. }, {
  113315. key: "createRankSymbolLayer",
  113316. value: function () {
  113317. var _createRankSymbolLayer = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee37(layerInfo, features) {
  113318. var styleSource, layer;
  113319. return WebMap_regeneratorRuntime().wrap(function _callee37$(_context39) {
  113320. while (1) switch (_context39.prev = _context39.next) {
  113321. case 0:
  113322. _context39.next = 2;
  113323. return this.createRankStyleSource(layerInfo, features, layerInfo.featureType);
  113324. case 2:
  113325. styleSource = _context39.sent;
  113326. layer = new external_ol_layer_namespaceObject.Vector({
  113327. styleSource: styleSource,
  113328. source: new (external_ol_source_Vector_default())({
  113329. features: layerInfo.filterCondition ? this.getFiterFeatures(layerInfo.filterCondition, features) : features,
  113330. wrapX: false
  113331. }),
  113332. renderMode: 'image'
  113333. });
  113334. layer.setStyle(function (feature) {
  113335. var styleSource = layer.get('styleSource');
  113336. var themeField = styleSource.parameters.themeSetting.themeField;
  113337. var value = Number(feature.get('attributes')[themeField]);
  113338. var styleGroups = styleSource.styleGroups;
  113339. for (var i = 0, len = styleGroups.length; i < len; i++) {
  113340. if (value >= styleGroups[i].start && value < styleGroups[i].end) {
  113341. return styleSource.styleGroups[i].olStyle;
  113342. }
  113343. }
  113344. });
  113345. return _context39.abrupt("return", layer);
  113346. case 6:
  113347. case "end":
  113348. return _context39.stop();
  113349. }
  113350. }, _callee37, this);
  113351. }));
  113352. function createRankSymbolLayer(_x59, _x60) {
  113353. return _createRankSymbolLayer.apply(this, arguments);
  113354. }
  113355. return createRankSymbolLayer;
  113356. }()
  113357. /**
  113358. * @private
  113359. * @function WebMap.prototype.createRankSymbolLayer
  113360. * @description 创建等级符号图层的source
  113361. * @param {Object} parameters - 图层信息
  113362. * @param {Array} features - 添加到图层上的features
  113363. * @param {string} featureType - feature的类型
  113364. * @returns {Object} styleGroups
  113365. */
  113366. }, {
  113367. key: "createRankStyleSource",
  113368. value: function () {
  113369. var _createRankStyleSource = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee38(parameters, features, featureType) {
  113370. var themeSetting, themeField, styleGroups;
  113371. return WebMap_regeneratorRuntime().wrap(function _callee38$(_context40) {
  113372. while (1) switch (_context40.prev = _context40.next) {
  113373. case 0:
  113374. themeSetting = parameters.themeSetting, themeField = themeSetting.themeField;
  113375. _context40.next = 3;
  113376. return this.getRankStyleGroup(themeField, features, parameters, featureType);
  113377. case 3:
  113378. styleGroups = _context40.sent;
  113379. return _context40.abrupt("return", styleGroups ? {
  113380. parameters: parameters,
  113381. styleGroups: styleGroups
  113382. } : false);
  113383. case 5:
  113384. case "end":
  113385. return _context40.stop();
  113386. }
  113387. }, _callee38, this);
  113388. }));
  113389. function createRankStyleSource(_x61, _x62, _x63) {
  113390. return _createRankStyleSource.apply(this, arguments);
  113391. }
  113392. return createRankStyleSource;
  113393. }()
  113394. /**
  113395. * @private
  113396. * @function WebMap.prototype.getRankStyleGroup
  113397. * @description 获取等级符号的style
  113398. * @param {string} themeField - 分段字段
  113399. * @param {Array} features - 添加到图层上的features
  113400. * @param {Object} parameters - 图层参数
  113401. * @param {string} featureType - feature的类型
  113402. * @returns {Array} stylegroup
  113403. */
  113404. }, {
  113405. key: "getRankStyleGroup",
  113406. value: function () {
  113407. var _getRankStyleGroup = WebMap_asyncToGenerator( /*#__PURE__*/WebMap_regeneratorRuntime().mark(function _callee39(themeField, features, parameters, featureType) {
  113408. var values, segements, style, themeSetting, segmentMethod, segmentCount, customSettings, minR, maxR, fillColor, colors, i, startValue, endValue, styleGroup, len, incrementR, start, end, radius, rangeColors, j, olStyle;
  113409. return WebMap_regeneratorRuntime().wrap(function _callee39$(_context41) {
  113410. while (1) switch (_context41.prev = _context41.next) {
  113411. case 0:
  113412. // 找出所有的单值
  113413. values = [], segements = [], style = parameters.style, themeSetting = parameters.themeSetting, segmentMethod = themeSetting.segmentMethod || this.defaultParameters.themeSetting.segmentMethod, segmentCount = themeSetting.segmentCount || this.defaultParameters.themeSetting.segmentCount, customSettings = themeSetting.customSettings, minR = parameters.themeSetting.minRadius, maxR = parameters.themeSetting.maxRadius, fillColor = style.fillColor, colors = parameters.themeSetting.colors;
  113414. features.forEach(function (feature) {
  113415. var attributes = feature.get('attributes'),
  113416. value = attributes[themeField];
  113417. // 过滤掉空值和非数值
  113418. if (value == null || !core_Util_Util.isNumber(value)) {
  113419. return;
  113420. }
  113421. values.push(Number(value));
  113422. });
  113423. try {
  113424. segements = ArrayStatistic.getArraySegments(values, segmentMethod, segmentCount);
  113425. } catch (error) {
  113426. console.error(error);
  113427. }
  113428. // 处理自定义 分段
  113429. for (i = 0; i < segmentCount; i++) {
  113430. if (i in customSettings) {
  113431. startValue = customSettings[i]['segment']['start'], endValue = customSettings[i]['segment']['end'];
  113432. startValue != null && (segements[i] = startValue);
  113433. endValue != null && (segements[i + 1] = endValue);
  113434. }
  113435. }
  113436. //生成styleGroup
  113437. styleGroup = [];
  113438. if (!(segements && segements.length)) {
  113439. _context41.next = 27;
  113440. break;
  113441. }
  113442. len = segements.length, incrementR = (maxR - minR) / (len - 1), radius = Number(((maxR + minR) / 2).toFixed(2)); // 获取颜色
  113443. rangeColors = colors ? ColorsPickerUtil.getGradientColors(colors, len, 'RANGE') : [];
  113444. j = 0;
  113445. case 9:
  113446. if (!(j < len - 1)) {
  113447. _context41.next = 24;
  113448. break;
  113449. }
  113450. start = Number(segements[j].toFixed(2));
  113451. end = Number(segements[j + 1].toFixed(2));
  113452. // 这里特殊处理以下分段值相同的情况(即所有字段值相同)
  113453. radius = start === end ? radius : minR + Math.round(incrementR * j);
  113454. // 最后一个分段时将end+0.01,避免取不到最大值
  113455. end = j === len - 2 ? end + 0.01 : end;
  113456. // 处理自定义 半径
  113457. radius = customSettings[j] && customSettings[j].radius ? customSettings[j].radius : radius;
  113458. // 转化成 ol 样式
  113459. style.radius = radius;
  113460. style.fillColor = customSettings[j] && customSettings[j].color ? customSettings[j].color : rangeColors[j] || fillColor;
  113461. _context41.next = 19;
  113462. return StyleUtils.getOpenlayersStyle(style, featureType, true);
  113463. case 19:
  113464. olStyle = _context41.sent;
  113465. styleGroup.push({
  113466. olStyle: olStyle,
  113467. radius: radius,
  113468. start: start,
  113469. end: end,
  113470. fillColor: style.fillColor
  113471. });
  113472. case 21:
  113473. j++;
  113474. _context41.next = 9;
  113475. break;
  113476. case 24:
  113477. return _context41.abrupt("return", styleGroup);
  113478. case 27:
  113479. return _context41.abrupt("return", false);
  113480. case 28:
  113481. case "end":
  113482. return _context41.stop();
  113483. }
  113484. }, _callee39, this);
  113485. }));
  113486. function getRankStyleGroup(_x64, _x65, _x66, _x67) {
  113487. return _getRankStyleGroup.apply(this, arguments);
  113488. }
  113489. return getRankStyleGroup;
  113490. }()
  113491. /**
  113492. * @private
  113493. * @function WebMap.prototype.checkUploadToRelationship
  113494. * @description 检查是否上传到关系型
  113495. * @param {string} fileId - 文件的id
  113496. * @returns {Promise<T | never>} 关系型文件一些参数
  113497. */
  113498. }, {
  113499. key: "checkUploadToRelationship",
  113500. value: function checkUploadToRelationship(fileId) {
  113501. var url = this.getRequestUrl("".concat(this.server, "web/datas/").concat(fileId, "/datasets.json"));
  113502. return FetchRequest.get(url, null, {
  113503. withCredentials: this.withCredentials
  113504. }).then(function (response) {
  113505. return response.json();
  113506. }).then(function (result) {
  113507. return result;
  113508. });
  113509. }
  113510. /**
  113511. * @private
  113512. * @function WebMap.prototype.getDatasources
  113513. * @description 获取关系型文件发布的数据服务中数据源的名称
  113514. * @param {string} url - 获取数据源信息的url
  113515. * @returns {Promise<T | never>} 数据源名称
  113516. */
  113517. }, {
  113518. key: "getDatasources",
  113519. value: function getDatasources(url) {
  113520. var requestUrl = this.getRequestUrl("".concat(url, "/data/datasources.json"));
  113521. return FetchRequest.get(requestUrl, null, {
  113522. withCredentials: this.withCredentials
  113523. }).then(function (response) {
  113524. return response.json();
  113525. }).then(function (datasource) {
  113526. var datasourceNames = datasource.datasourceNames;
  113527. return datasourceNames[0];
  113528. });
  113529. }
  113530. /**
  113531. * @private
  113532. * @function WebMap.prototype.getDataService
  113533. * @description 获取上传的数据信息
  113534. * @param {string} fileId - 文件id
  113535. * @param {string} datasetName 数据服务的数据集名称
  113536. * @returns {Promise<T | never>} 数据的信息
  113537. */
  113538. }, {
  113539. key: "getDataService",
  113540. value: function getDataService(fileId, datasetName) {
  113541. var url = this.getRequestUrl("".concat(this.server, "web/datas/").concat(fileId, ".json"));
  113542. return FetchRequest.get(url, null, {
  113543. withCredentials: this.withCredentials
  113544. }).then(function (response) {
  113545. return response.json();
  113546. }).then(function (result) {
  113547. result.fileId = fileId;
  113548. result.datasetName = datasetName;
  113549. return result;
  113550. });
  113551. }
  113552. /**
  113553. * @private
  113554. * @function WebMap.prototype.getRootUrl
  113555. * @description 获取请求地址
  113556. * @param {string} url 请求的地址
  113557. * @param {boolean} 请求是否带上Credential.
  113558. * @returns {Promise<T | never>} 请求地址
  113559. */
  113560. }, {
  113561. key: "getRequestUrl",
  113562. value: function getRequestUrl(url, excludeCreditial) {
  113563. url = excludeCreditial ? url : this.formatUrlWithCredential(url);
  113564. //如果传入进来的url带了代理则不需要处理
  113565. if (this.excludePortalProxyUrl) {
  113566. return;
  113567. }
  113568. return Util_Util.isInTheSameDomain(url) || this.isIportalProxyServiceUrl(url) ? url : "".concat(this.getProxy()).concat(encodeURIComponent(url));
  113569. }
  113570. /**
  113571. * @description 给url带上凭证密钥
  113572. * @param {string} url - 地址
  113573. */
  113574. }, {
  113575. key: "formatUrlWithCredential",
  113576. value: function formatUrlWithCredential(url) {
  113577. if (this.credentialValue) {
  113578. //有token之类的配置项
  113579. url = url.indexOf("?") === -1 ? "".concat(url, "?").concat(this.credentialKey, "=").concat(this.credentialValue) : "".concat(url, "&").concat(this.credentialKey, "=").concat(this.credentialValue);
  113580. }
  113581. return url;
  113582. }
  113583. /**
  113584. * @private
  113585. * @function WebMap.prototype.getProxy
  113586. * @description 获取代理地址
  113587. * @returns {Promise<T | never>} 代理地址
  113588. */
  113589. }, {
  113590. key: "getProxy",
  113591. value: function getProxy(type) {
  113592. if (!type) {
  113593. type = 'json';
  113594. }
  113595. return this.proxy || this.server + "apps/viewer/getUrlResource.".concat(type, "?url=");
  113596. }
  113597. /**
  113598. * @private
  113599. * @function WebMap.prototype.getTileLayerInfo
  113600. * @description 获取地图服务的信息
  113601. * @param {string} url 地图服务的url(没有地图名字)
  113602. * @returns {Promise<T | never>} 地图服务信息
  113603. */
  113604. }, {
  113605. key: "getTileLayerInfo",
  113606. value: function getTileLayerInfo(url) {
  113607. var that = this,
  113608. epsgCode = that.baseProjection.split('EPSG:')[1];
  113609. var requestUrl = that.getRequestUrl("".concat(url, "/maps.json"));
  113610. return FetchRequest.get(requestUrl, null, {
  113611. withCredentials: this.withCredentials
  113612. }).then(function (response) {
  113613. return response.json();
  113614. }).then(function (mapInfo) {
  113615. var promises = [];
  113616. if (mapInfo) {
  113617. mapInfo.forEach(function (info) {
  113618. var mapUrl = that.getRequestUrl("".concat(info.path, ".json?prjCoordSys=").concat(encodeURI(JSON.stringify({
  113619. epsgCode: epsgCode
  113620. }))));
  113621. var promise = FetchRequest.get(mapUrl, null, {
  113622. withCredentials: that.withCredentials
  113623. }).then(function (response) {
  113624. return response.json();
  113625. }).then(function (restMapInfo) {
  113626. restMapInfo.url = info.path;
  113627. return restMapInfo;
  113628. });
  113629. promises.push(promise);
  113630. });
  113631. }
  113632. return Promise.all(promises).then(function (allRestMaps) {
  113633. return allRestMaps;
  113634. });
  113635. });
  113636. }
  113637. /**
  113638. * 通过wkt参数扩展支持多坐标系
  113639. *
  113640. * @param {string} wkt 字符串
  113641. * @param {string} crsCode epsg信息,如: "EPSG:4490"
  113642. *
  113643. * @returns {boolean} 坐标系是否添加成功
  113644. */
  113645. }, {
  113646. key: "addProjctionFromWKT",
  113647. value: function addProjctionFromWKT(wkt, crsCode) {
  113648. if (typeof wkt !== 'string') {
  113649. //参数类型错误
  113650. return false;
  113651. } else {
  113652. if (wkt === "EPSG:4326" || wkt === "EPSG:3857") {
  113653. return true;
  113654. } else {
  113655. var epsgCode = crsCode || this.getEpsgInfoFromWKT(wkt);
  113656. if (epsgCode) {
  113657. proj4_src_default().defs(epsgCode, wkt);
  113658. // 重新注册proj4到ol.proj,不然不会生效
  113659. if (external_ol_proj_proj4_namespaceObject && external_ol_proj_proj4_namespaceObject.register) {
  113660. external_ol_proj_proj4_namespaceObject.register((proj4_src_default()));
  113661. } else if (window.ol.proj && window.ol.proj.setProj4) {
  113662. window.ol.proj.setProj4((proj4_src_default()));
  113663. }
  113664. return true;
  113665. } else {
  113666. // 参数类型非wkt标准
  113667. return false;
  113668. }
  113669. }
  113670. }
  113671. }
  113672. /**
  113673. * 通过wkt参数获取坐标信息
  113674. *
  113675. * @param {string} wkt 字符串
  113676. * @returns {string} epsg 如:"EPSG:4326"
  113677. */
  113678. }, {
  113679. key: "getEpsgInfoFromWKT",
  113680. value: function getEpsgInfoFromWKT(wkt) {
  113681. if (typeof wkt !== 'string') {
  113682. return false;
  113683. } else if (wkt.indexOf("EPSG") === 0) {
  113684. return wkt;
  113685. } else {
  113686. var lastAuthority = wkt.lastIndexOf("AUTHORITY") + 10,
  113687. endString = wkt.indexOf("]", lastAuthority) - 1;
  113688. if (lastAuthority > 0 && endString > 0) {
  113689. return "EPSG:".concat(wkt.substring(lastAuthority, endString).split(",")[1].substr(1));
  113690. } else {
  113691. return false;
  113692. }
  113693. }
  113694. }
  113695. /**
  113696. * @private
  113697. * @function WebMap.prototype.createMigrationLayer
  113698. * @description 创建迁徙图
  113699. * @param {Object} layerInfo 图层信息
  113700. * @param {Array} features 要素数组
  113701. * @returns {ol.layer} 图层
  113702. */
  113703. }, {
  113704. key: "createMigrationLayer",
  113705. value: function createMigrationLayer(layerInfo, features) {
  113706. // 获取图层外包DOM
  113707. if (!window.ol3Echarts.prototype.getContainer) {
  113708. window.ol3Echarts.prototype.getContainer = function () {
  113709. return this.$container;
  113710. };
  113711. }
  113712. // 设置图层可见性
  113713. if (!window.ol3Echarts.prototype.setVisible) {
  113714. window.ol3Echarts.prototype.setVisible = function (visible) {
  113715. if (visible) {
  113716. var _options = this.get('options');
  113717. if (_options) {
  113718. this.setChartOptions(_options);
  113719. this.unset('options');
  113720. }
  113721. } else {
  113722. var _options2 = this.getChartOptions();
  113723. this.set('options', _options2);
  113724. this.clear();
  113725. this.setChartOptions({});
  113726. }
  113727. };
  113728. }
  113729. // 设置图层层级
  113730. if (!window.ol3Echarts.prototype.setZIndex) {
  113731. window.ol3Echarts.prototype.setZIndex = function (zIndex) {
  113732. var container = this.getContainer();
  113733. if (container) {
  113734. container.style.zIndex = zIndex;
  113735. }
  113736. };
  113737. }
  113738. /**
  113739. * 设置鼠标样式
  113740. * .cursor-default > div {
  113741. * cursor: default !important;
  113742. * }
  113743. */
  113744. if (!window.ol3Echarts.prototype.setCursor) {
  113745. window.ol3Echarts.prototype.setCursor = function () {
  113746. var cursor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
  113747. var container = this.getContainer();
  113748. if (container && cursor === 'default') {
  113749. container.classList.add('cursor-default');
  113750. }
  113751. };
  113752. }
  113753. var properties = getFeatureProperties(features);
  113754. var lineData = this.createLinesData(layerInfo, properties);
  113755. var pointData = this.createPointsData(lineData, layerInfo, properties);
  113756. var options = this.createOptions(layerInfo, lineData, pointData);
  113757. var layer = new window.ol3Echarts(options, {
  113758. // hideOnMoving: true,
  113759. // hideOnZooming: true
  113760. //以下三个参数,如果不按照这样设置,会造成不可见图层时,缩放还会出现图层
  113761. hideOnMoving: false,
  113762. hideOnZooming: false,
  113763. forcedPrecomposeRerender: true
  113764. });
  113765. layer.type = 'ECHARTS';
  113766. return layer;
  113767. }
  113768. /**
  113769. * @private
  113770. * @function WebMap.prototype.createOptions
  113771. * @description 创建echarts的options
  113772. * @param {Object} layerInfo 图层信息
  113773. * @param {Array} lineData 线数据
  113774. * @param {Array} pointData 点数据
  113775. * @returns {Object} echarts参数
  113776. */
  113777. }, {
  113778. key: "createOptions",
  113779. value: function createOptions(layerInfo, lineData, pointData) {
  113780. var series;
  113781. var lineSeries = this.createLineSeries(layerInfo, lineData);
  113782. if (pointData && pointData.length) {
  113783. var pointSeries = this.createPointSeries(layerInfo, pointData);
  113784. series = lineSeries.concat(pointSeries);
  113785. } else {
  113786. series = lineSeries.slice();
  113787. }
  113788. var options = {
  113789. series: series
  113790. };
  113791. return options;
  113792. }
  113793. /**
  113794. * @private
  113795. * @function WebMap.prototype.createLineSeries
  113796. * @description 创建线系列
  113797. * @param {Object} layerInfo 图层参数
  113798. * @param {Array} lineData 线数据
  113799. * @returns {Object} 线系列
  113800. */
  113801. }, {
  113802. key: "createLineSeries",
  113803. value: function createLineSeries(layerInfo, lineData) {
  113804. var lineSetting = layerInfo.lineSetting;
  113805. var animationSetting = layerInfo.animationSetting;
  113806. var linesSeries = [
  113807. // 轨迹线样式
  113808. {
  113809. name: 'line-series',
  113810. type: 'lines',
  113811. zlevel: 1,
  113812. silent: true,
  113813. effect: {
  113814. show: animationSetting.show,
  113815. constantSpeed: animationSetting.constantSpeed,
  113816. trailLength: 0,
  113817. symbol: animationSetting.symbol,
  113818. symbolSize: animationSetting.symbolSize
  113819. },
  113820. lineStyle: {
  113821. normal: {
  113822. color: lineSetting.color,
  113823. type: lineSetting.type,
  113824. width: lineSetting.width,
  113825. opacity: lineSetting.opacity,
  113826. curveness: lineSetting.curveness
  113827. }
  113828. },
  113829. data: lineData
  113830. }];
  113831. if (lineData.length > MAX_MIGRATION_ANIMATION_COUNT) {
  113832. // linesSeries[0].large = true;
  113833. // linesSeries[0].largeThreshold = 100;
  113834. linesSeries[0].blendMode = 'lighter';
  113835. }
  113836. return linesSeries;
  113837. }
  113838. /**
  113839. * @private
  113840. * @function WebMap.prototype.createPointSeries
  113841. * @description 创建点系列
  113842. * @param {Object} layerInfo 图层参数
  113843. * @param {Array} pointData 点数据
  113844. * @returns {Object} 点系列
  113845. */
  113846. }, {
  113847. key: "createPointSeries",
  113848. value: function createPointSeries(layerInfo, pointData) {
  113849. var lineSetting = layerInfo.lineSetting;
  113850. var animationSetting = layerInfo.animationSetting;
  113851. var labelSetting = layerInfo.labelSetting;
  113852. var pointSeries = [{
  113853. name: 'point-series',
  113854. coordinateSystem: 'geo',
  113855. zlevel: 2,
  113856. silent: true,
  113857. label: {
  113858. normal: {
  113859. show: labelSetting.show,
  113860. position: 'right',
  113861. formatter: '{b}',
  113862. color: labelSetting.color,
  113863. fontFamily: labelSetting.fontFamily
  113864. }
  113865. },
  113866. itemStyle: {
  113867. normal: {
  113868. color: lineSetting.color || labelSetting.color
  113869. }
  113870. },
  113871. data: pointData
  113872. }];
  113873. if (animationSetting.show) {
  113874. // 开启动画
  113875. pointSeries[0].type = 'effectScatter';
  113876. pointSeries[0].rippleEffect = {
  113877. brushType: 'stroke'
  113878. };
  113879. } else {
  113880. // 关闭动画
  113881. pointSeries[0].type = 'scatter';
  113882. }
  113883. return pointSeries;
  113884. }
  113885. /**
  113886. * @private
  113887. * @function WebMap.prototype.createPointsData
  113888. * @param {Array} lineData 线数据
  113889. * @param {Object} layerInfo 图层信息
  113890. * @param {Array} properties 属性
  113891. * @returns {Array} 点数据
  113892. */
  113893. }, {
  113894. key: "createPointsData",
  113895. value: function createPointsData(lineData, layerInfo, properties) {
  113896. var data = [],
  113897. labelSetting = layerInfo.labelSetting;
  113898. // 标签隐藏则直接返回
  113899. if (!labelSetting.show || !lineData.length) {
  113900. return data;
  113901. }
  113902. var fromData = [],
  113903. toData = [];
  113904. lineData.forEach(function (item, idx) {
  113905. var coords = item.coords,
  113906. fromCoord = coords[0],
  113907. toCoord = coords[1],
  113908. fromProperty = properties[idx][labelSetting.from],
  113909. toProperty = properties[idx][labelSetting.to];
  113910. // 起始字段去重
  113911. var f = fromData.find(function (d) {
  113912. return d.value[0] === fromCoord[0] && d.value[1] === fromCoord[1];
  113913. });
  113914. !f && fromData.push({
  113915. name: fromProperty,
  113916. value: fromCoord
  113917. });
  113918. // 终点字段去重
  113919. var t = toData.find(function (d) {
  113920. return d.value[0] === toCoord[0] && d.value[1] === toCoord[1];
  113921. });
  113922. !t && toData.push({
  113923. name: toProperty,
  113924. value: toCoord
  113925. });
  113926. });
  113927. data = fromData.concat(toData);
  113928. return data;
  113929. }
  113930. /**
  113931. * @private
  113932. * @function WebMap.prototype.createLinesData
  113933. * @param {Object} layerInfo 图层信息
  113934. * @param {Array} properties 属性
  113935. * @returns {Array} 线数据
  113936. */
  113937. }, {
  113938. key: "createLinesData",
  113939. value: function createLinesData(layerInfo, properties) {
  113940. var data = [];
  113941. if (properties && properties.length) {
  113942. // 重新获取数据
  113943. var from = layerInfo.from,
  113944. to = layerInfo.to,
  113945. fromCoord,
  113946. toCoord;
  113947. if (from.type === 'XY_FIELD' && from['xField'] && from['yField'] && to['xField'] && to['yField']) {
  113948. properties.forEach(function (property) {
  113949. var fromX = property[from['xField']],
  113950. fromY = property[from['yField']],
  113951. toX = property[to['xField']],
  113952. toY = property[to['yField']];
  113953. if (!fromX || !fromY || !toX || !toY) {
  113954. return;
  113955. }
  113956. fromCoord = [property[from['xField']], property[from['yField']]];
  113957. toCoord = [property[to['xField']], property[to['yField']]];
  113958. data.push({
  113959. coords: [fromCoord, toCoord]
  113960. });
  113961. });
  113962. } else if (from.type === 'PLACE_FIELD' && from['field'] && to['field']) {
  113963. var centerDatas = ProvinceCenter_namespaceObject.concat(MunicipalCenter_namespaceObject);
  113964. properties.forEach(function (property) {
  113965. var fromField = property[from['field']],
  113966. toField = property[to['field']];
  113967. fromCoord = centerDatas.find(function (item) {
  113968. return core_Util_Util.isMatchAdministrativeName(item.name, fromField);
  113969. });
  113970. toCoord = centerDatas.find(function (item) {
  113971. return core_Util_Util.isMatchAdministrativeName(item.name, toField);
  113972. });
  113973. if (!fromCoord || !toCoord) {
  113974. return;
  113975. }
  113976. data.push({
  113977. coords: [fromCoord.coord, toCoord.coord]
  113978. });
  113979. });
  113980. }
  113981. }
  113982. return data;
  113983. }
  113984. /**
  113985. * @private
  113986. * @function WebMap.prototype.getService
  113987. * @description 获取当前数据发布的服务中的某种类型服务
  113988. * @param {Array.<Object>} services 服务集合
  113989. * @param {string} type 服务类型,RESTDATA, RESTMAP
  113990. * @returns {Object} 服务
  113991. */
  113992. }, {
  113993. key: "getService",
  113994. value: function getService(services, type) {
  113995. var service = services.filter(function (info) {
  113996. return info && info.serviceType === type;
  113997. });
  113998. return service[0];
  113999. }
  114000. /**
  114001. * @private
  114002. * @function WebMap.prototype.isMvt
  114003. * @description 判断当前能否使用数据服务的mvt上图方式
  114004. * @param {string} serviceUrl 数据服务的地址
  114005. * @param {string} datasetName 数据服务的数据集名称
  114006. * @returns {Object} 数据服务的信息
  114007. */
  114008. }, {
  114009. key: "isMvt",
  114010. value: function isMvt(serviceUrl, datasetName) {
  114011. var that = this;
  114012. return this.getDatasetsInfo(serviceUrl, datasetName).then(function (info) {
  114013. //判断是否和底图坐标系一直
  114014. if (info.epsgCode == that.baseProjection.split('EPSG:')[1]) {
  114015. return FetchRequest.get(that.getRequestUrl("".concat(info.url, "/tilefeature.mvt")), null, {
  114016. withCredentials: that.withCredentials
  114017. }).then(function (response) {
  114018. return response.json();
  114019. }).then(function (result) {
  114020. info.isMvt = result.error && result.error.code === 400;
  114021. return info;
  114022. })["catch"](function () {
  114023. return info;
  114024. });
  114025. }
  114026. return info;
  114027. });
  114028. }
  114029. /**
  114030. * @private
  114031. * @function WebMap.prototype.getDatasetsInfo
  114032. * @description 获取数据集信息
  114033. * @param {string} serviceUrl 数据服务的地址
  114034. * @param {string} datasetName 数据服务的数据集名称
  114035. * @returns {Object} 数据服务的信息
  114036. */
  114037. }, {
  114038. key: "getDatasetsInfo",
  114039. value: function getDatasetsInfo(serviceUrl, datasetName) {
  114040. var that = this;
  114041. return that.getDatasources(serviceUrl).then(function (datasourceName) {
  114042. //判断mvt服务是否可用
  114043. var url = "".concat(serviceUrl, "/data/datasources/").concat(datasourceName, "/datasets/").concat(datasetName, ".json");
  114044. return FetchRequest.get(that.getRequestUrl(url), null, {
  114045. withCredentials: that.withCredentials
  114046. }).then(function (response) {
  114047. return response.json();
  114048. }).then(function (datasetsInfo) {
  114049. return {
  114050. epsgCode: datasetsInfo.datasetInfo.prjCoordSys.epsgCode,
  114051. bounds: datasetsInfo.datasetInfo.bounds,
  114052. url: url //返回的是原始url,没有代理。因为用于请求mvt
  114053. };
  114054. });
  114055. });
  114056. }
  114057. /**
  114058. * @private
  114059. * @function WebMap.prototype.isRestMapMapboxStyle
  114060. * @description 仅判断是否为restmap mvt地图服务 rest-map服务的Mapbox Style资源地址是这样的: .../iserver/services/map-Population/rest/maps/PopulationDistribution/tileFeature/vectorstyles.json?type=MapBox_GL&styleonly=true
  114061. * @param {Object} layerInfo webmap中的MapStylerLayer
  114062. * @returns {boolean} 是否为restmap mvt地图服务
  114063. */
  114064. }, {
  114065. key: "isRestMapMapboxStyle",
  114066. value: function isRestMapMapboxStyle(layerInfo) {
  114067. var restMapMVTStr = '/tileFeature/vectorstyles.json?type=MapBox_GL&styleonly=true&tileURLTemplate=ZXY';
  114068. var dataSource = layerInfo.dataSource;
  114069. var layerType = layerInfo.layerType;
  114070. if (dataSource && dataSource.type === "EXTERNAL" && dataSource.url.indexOf(restMapMVTStr) > -1 && (layerType === "MAPBOXSTYLE" || layerType === "VECTOR_TILE")) {
  114071. return true;
  114072. }
  114073. return false;
  114074. }
  114075. /**
  114076. * @private
  114077. * @function WebMap.prototype.getMapboxStyleLayerInfo
  114078. * @description 获取mapboxstyle图层信息
  114079. * @param {Object} layerInfo 图层信息
  114080. * @returns {Object} 图层信息
  114081. */
  114082. }, {
  114083. key: "getMapboxStyleLayerInfo",
  114084. value: function getMapboxStyleLayerInfo(mapInfo, layerInfo) {
  114085. var _this = this;
  114086. return new Promise(function (resolve, reject) {
  114087. return _this.getMapLayerExtent(layerInfo).then(function (layer) {
  114088. return _this.getMapboxStyle(mapInfo, layer).then(function (styleLayer) {
  114089. Object.assign(layer, styleLayer);
  114090. resolve(layer);
  114091. })["catch"](function (error) {
  114092. reject(error);
  114093. });
  114094. })["catch"](function (error) {
  114095. reject(error);
  114096. });
  114097. });
  114098. }
  114099. /**
  114100. * @private
  114101. * @function WebMap.prototype.getMapLayerExtent
  114102. * @description 获取mapboxstyle图层信息
  114103. * @param {Object} layerInfo 图层信息
  114104. * @returns {Object} 图层信息
  114105. */
  114106. }, {
  114107. key: "getMapLayerExtent",
  114108. value: function getMapLayerExtent(layerInfo) {
  114109. var restMapMVTStr = '/tileFeature/vectorstyles.json?type=MapBox_GL&styleonly=true&tileURLTemplate=ZXY';
  114110. var dataSource = layerInfo.dataSource;
  114111. var url = dataSource.url;
  114112. if (this.isRestMapMapboxStyle(layerInfo)) {
  114113. url = url.replace(restMapMVTStr, '');
  114114. }
  114115. url = this.getRequestUrl(url + '.json');
  114116. var credential = layerInfo.credential;
  114117. var credentialValue, keyfix;
  114118. //携带令牌(restmap用的首字母大写,但是这里要用小写)
  114119. if (credential) {
  114120. keyfix = Object.keys(credential)[0];
  114121. credentialValue = credential[keyfix];
  114122. url = "".concat(url, "?").concat(keyfix, "=").concat(credentialValue);
  114123. }
  114124. return FetchRequest.get(url, null, {
  114125. withCredentials: this.withCredentials,
  114126. withoutFormatSuffix: true,
  114127. headers: {
  114128. 'Content-Type': 'application/json;chartset=uft-8'
  114129. }
  114130. }).then(function (response) {
  114131. return response.json();
  114132. }).then(function (result) {
  114133. layerInfo.visibleScales = result.visibleScales;
  114134. layerInfo.coordUnit = result.coordUnit;
  114135. layerInfo.scale = result.scale;
  114136. layerInfo.epsgCode = result.prjCoordSys.epsgCode;
  114137. layerInfo.bounds = result.bounds;
  114138. return layerInfo;
  114139. })["catch"](function (error) {
  114140. throw error;
  114141. });
  114142. }
  114143. /**
  114144. * @private
  114145. * @function WebMap.prototype.getMapboxStyle
  114146. * @description 获取mapboxstyle --- ipt中自定义底图请求mapboxstyle目前有两种url格式
  114147. * rest-map服务的Mapbox Style资源地址是这样的: .../iserver/services/map-Population/rest/maps/PopulationDistribution/tileFeature/vectorstyles.json?type=MapBox_GL&styleonly=true
  114148. * restjsr片服务的Mapbox Style资源地址是这样的:.../iserver/services/map-china400/restjsr/v1/vectortile/maps/China/style.json
  114149. * @param {Object} mapboxstyle图层信息
  114150. * @returns {Object} 图层信息
  114151. */
  114152. }, {
  114153. key: "getMapboxStyle",
  114154. value: function getMapboxStyle(mapInfo, layerInfo) {
  114155. var _this = this;
  114156. var url = layerInfo.url || layerInfo.dataSource.url;
  114157. var styleUrl = url;
  114158. if (styleUrl.indexOf('/restjsr/') > -1) {
  114159. styleUrl = "".concat(styleUrl, "/style.json");
  114160. }
  114161. styleUrl = this.getRequestUrl(styleUrl);
  114162. var credential = layerInfo.credential;
  114163. //携带令牌(restmap用的首字母大写,但是这里要用小写)
  114164. var credentialValue, keyfix;
  114165. if (credential) {
  114166. keyfix = Object.keys(credential)[0];
  114167. credentialValue = credential[keyfix];
  114168. styleUrl = "".concat(styleUrl, "?").concat(keyfix, "=").concat(credentialValue);
  114169. }
  114170. return FetchRequest.get(styleUrl, null, {
  114171. withCredentials: this.withCredentials,
  114172. withoutFormatSuffix: true,
  114173. headers: {
  114174. 'Content-Type': 'application/json;chartset=uft-8'
  114175. }
  114176. }).then(function (response) {
  114177. return response.json();
  114178. }).then(function (styles) {
  114179. _this._matchStyleObject(styles);
  114180. var bounds = layerInfo.bounds;
  114181. // 处理携带令牌的情况
  114182. if (credentialValue) {
  114183. styles.sprite = "".concat(styles.sprite, "?").concat(keyfix, "=").concat(credentialValue);
  114184. var sources = styles.sources;
  114185. var sourcesNames = Object.keys(sources);
  114186. sourcesNames.forEach(function (sourceName) {
  114187. styles.sources[sourceName].tiles.forEach(function (tiles, i) {
  114188. styles.sources[sourceName].tiles[i] = "".concat(tiles, "?").concat(keyfix, "=").concat(credentialValue);
  114189. });
  114190. });
  114191. }
  114192. var newLayerInfo = {
  114193. url: url,
  114194. sourceType: 'VECTOR_TILE',
  114195. layerType: 'VECTOR_TILE',
  114196. styles: styles,
  114197. extent: bounds && [bounds.left, bounds.bottom, bounds.right, bounds.top],
  114198. bounds: layerInfo.bounds,
  114199. projection: "EPSG:" + layerInfo.epsgCode,
  114200. epsgCode: layerInfo.epsgCode,
  114201. name: layerInfo.name
  114202. };
  114203. Object.assign(layerInfo, newLayerInfo);
  114204. if (layerInfo.zIndex > 0) {
  114205. // 过滤styles 非底图mapboxstyle图层才需此处理
  114206. _this.modifyMapboxstyleLayer(mapInfo, layerInfo);
  114207. }
  114208. return layerInfo;
  114209. })["catch"](function (error) {
  114210. return error;
  114211. });
  114212. }
  114213. /**
  114214. * @private
  114215. * @function WebMap.prototype.modifyMapboxstyleLayer
  114216. * @description mapboxstyle图层:1. layer id重复问题 2.叠加图层背景色问题
  114217. * @param {Object} mapInfo 地图信息
  114218. * @param {Object} layerInfo 当前要添加到地图的图层
  114219. */
  114220. }, {
  114221. key: "modifyMapboxstyleLayer",
  114222. value: function modifyMapboxstyleLayer(mapInfo, layerInfo) {
  114223. var that = this;
  114224. if (mapInfo.layers && mapInfo.layers.length === 0) {
  114225. return;
  114226. }
  114227. var curLayers = layerInfo.styles.layers;
  114228. if (!curLayers) {
  114229. return;
  114230. }
  114231. // 非底图,则移除"background"图层
  114232. curLayers = curLayers.filter(function (layer) {
  114233. return layer.type !== "background";
  114234. });
  114235. layerInfo.styles.layers = curLayers;
  114236. // 处理mapboxstyle图层layer id重复的情况
  114237. var addedLayersArr = mapInfo.layers.filter(function (layer) {
  114238. return layer.layerType === 'VECTOR_TILE' && layer.zIndex !== layerInfo.zIndex;
  114239. }).map(function (addLayer) {
  114240. return addLayer.styles && addLayer.styles.layers;
  114241. });
  114242. if (!addedLayersArr || addedLayersArr && addedLayersArr.length === 0) {
  114243. return;
  114244. }
  114245. addedLayersArr.forEach(function (layers) {
  114246. curLayers.forEach(function (curLayer) {
  114247. that.renameLayerId(layers, curLayer);
  114248. });
  114249. });
  114250. }
  114251. /**
  114252. * @private
  114253. * @function WebMap.prototype.renameLayerId
  114254. * @description mapboxstyle图层 id重复的layer添加后缀编码 (n)[参考mapstudio]
  114255. * @param {mapboxgl.Layer[]} layers 已添加到地图的图层组
  114256. * @param {mapboxgl.Layer} curLayer 当前图层
  114257. */
  114258. }, {
  114259. key: "renameLayerId",
  114260. value: function renameLayerId(layers, curLayer) {
  114261. if (layers.find(function (l) {
  114262. return l.id === curLayer.id;
  114263. })) {
  114264. var result = curLayer.id.match(/(.+)\((\w)\)$/);
  114265. if (result) {
  114266. curLayer.id = "".concat(result[1], "(").concat(+result[2] + 1, ")");
  114267. } else {
  114268. curLayer.id += '(1)';
  114269. }
  114270. if (layers.find(function (l) {
  114271. return l.id === curLayer.id;
  114272. })) {
  114273. this.renameLayerId(layers, curLayer);
  114274. }
  114275. }
  114276. }
  114277. /**
  114278. * @private
  114279. * @function mapboxgl.supermap.WebMap.prototype._matchStyleObject
  114280. * @description 恢复 style 为标准格式。
  114281. * @param {Object} style - mapbox 样式。
  114282. */
  114283. }, {
  114284. key: "_matchStyleObject",
  114285. value: function _matchStyleObject(style) {
  114286. var sprite = style.sprite,
  114287. glyphs = style.glyphs;
  114288. if (sprite && WebMap_typeof(sprite) === 'object') {
  114289. style.sprite = Object.values(sprite)[0];
  114290. }
  114291. if (glyphs && WebMap_typeof(glyphs) === 'object') {
  114292. style.glyphs = Object.values(glyphs)[0];
  114293. }
  114294. }
  114295. /**
  114296. * @private
  114297. * @function WebMap.prototype.renameLayerId
  114298. * @description 判断url是否是iportal的代理地址
  114299. * @param {*} serviceUrl
  114300. */
  114301. }, {
  114302. key: "isIportalProxyServiceUrl",
  114303. value: function isIportalProxyServiceUrl(serviceUrl) {
  114304. if (this.serviceProxy && this.serviceProxy.enable && serviceUrl) {
  114305. var proxyStr = '';
  114306. if (this.serviceProxy.proxyServerRootUrl) {
  114307. proxyStr = "".concat(this.serviceProxy.proxyServerRootUrl, "/");
  114308. } else if (this.serviceProxy.rootUrlPostfix) {
  114309. proxyStr = "".concat(this.serviceProxy.port, "/").concat(this.serviceProxy.rootUrlPostfix, "/");
  114310. } else if (!this.serviceProxy.rootUrlPostfix) {
  114311. proxyStr = "".concat(this.serviceProxy.port, "/");
  114312. }
  114313. if (this.serviceProxy.port !== 80) {
  114314. return serviceUrl.indexOf(proxyStr) >= 0;
  114315. } else {
  114316. // 代理端口为80,url中不一定有端口,满足一种情况即可
  114317. return serviceUrl.indexOf(proxyStr) >= 0 || serviceUrl.indexOf(proxyStr.replace(':80', '')) >= 0;
  114318. }
  114319. } else {
  114320. return false;
  114321. }
  114322. }
  114323. /**
  114324. * @private
  114325. * @function WebMap.prototype.getStyleResolutions
  114326. * @description 创建图层分辨率
  114327. * @param {Object} bounds 图层上下左右范围
  114328. * @returns {Array} styleResolutions 样式分辨率
  114329. */
  114330. }, {
  114331. key: "getStyleResolutions",
  114332. value: function getStyleResolutions(bounds) {
  114333. var minZoom = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  114334. var maxZoom = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 22;
  114335. var styleResolutions = [];
  114336. var TILE_SIZE = 512;
  114337. var temp = Math.abs(bounds.left - bounds.right) / TILE_SIZE;
  114338. for (var i = minZoom; i <= maxZoom; i++) {
  114339. if (i === 0) {
  114340. styleResolutions[i] = temp;
  114341. continue;
  114342. }
  114343. temp = temp / 2;
  114344. styleResolutions[i] = temp;
  114345. }
  114346. return styleResolutions;
  114347. }
  114348. /**
  114349. * @private
  114350. * @function WebMap.prototype.createVisibleResolution
  114351. * @description 创建图层可视分辨率
  114352. * @param {Array.<number>} visibleScales 可视比例尺范围
  114353. * @param {Array} indexbounds
  114354. * @param {Object} bounds 图层上下左右范围
  114355. * @param {string} coordUnit
  114356. * @returns {Array} visibleResolution
  114357. */
  114358. }, {
  114359. key: "createVisibleResolution",
  114360. value: function createVisibleResolution(visibleScales, indexbounds, bounds, coordUnit) {
  114361. var _this6 = this;
  114362. var visibleResolution = [];
  114363. // 1 设置了地图visibleScales的情况
  114364. if (visibleScales && visibleScales.length > 0) {
  114365. visibleResolution = visibleScales.map(function (scale) {
  114366. var value = 1 / scale;
  114367. var res = _this6.getResFromScale(value, coordUnit);
  114368. return res;
  114369. });
  114370. } else {
  114371. // 2 地图的bounds
  114372. var envelope = this.getEnvelope(indexbounds, bounds);
  114373. visibleResolution = this.getStyleResolutions(envelope);
  114374. }
  114375. return visibleResolution;
  114376. }
  114377. /**
  114378. * @private
  114379. * @function WebMap.prototype.createVisibleResolution
  114380. * @description 图层边界范围
  114381. * @param {Array} indexbounds
  114382. * @param {Object} bounds 图层上下左右范围
  114383. * @returns {Object} envelope
  114384. */
  114385. }, {
  114386. key: "getEnvelope",
  114387. value: function getEnvelope(indexbounds, bounds) {
  114388. var envelope = {};
  114389. if (indexbounds && indexbounds.length === 4) {
  114390. envelope.left = indexbounds[0];
  114391. envelope.bottom = indexbounds[1];
  114392. envelope.right = indexbounds[2];
  114393. envelope.top = indexbounds[3];
  114394. } else {
  114395. envelope = bounds;
  114396. }
  114397. return envelope;
  114398. }
  114399. /**
  114400. * @private
  114401. * @function WebMap.prototype.createMVTLayer
  114402. * @description 创建矢量瓦片图层
  114403. * @param {Object} layerInfo - 图层信息
  114404. */
  114405. }, {
  114406. key: "createMVTLayer",
  114407. value: function createMVTLayer(layerInfo) {
  114408. // let that = this;
  114409. var styles = layerInfo.styles;
  114410. var indexbounds = styles && styles.metadata && styles.metadata.indexbounds;
  114411. var visibleResolution = this.createVisibleResolution(layerInfo.visibleScales, indexbounds, layerInfo.bounds, layerInfo.coordUnit);
  114412. var envelope = this.getEnvelope(indexbounds, layerInfo.bounds);
  114413. var styleResolutions = this.getStyleResolutions(envelope);
  114414. // const origin = [envelope.left, envelope.top];
  114415. var withCredentials = this.isIportalProxyServiceUrl(styles.sprite);
  114416. // 创建MapBoxStyle样式
  114417. var mapboxStyles = new MapboxStyles({
  114418. style: styles,
  114419. source: styles.name,
  114420. resolutions: styleResolutions,
  114421. map: this.map,
  114422. withCredentials: withCredentials
  114423. });
  114424. return new Promise(function (resolve) {
  114425. mapboxStyles.on('styleloaded', function () {
  114426. var minResolution = visibleResolution[visibleResolution.length - 1];
  114427. var maxResolution = visibleResolution[0];
  114428. var layer = new external_ol_layer_namespaceObject.VectorTile({
  114429. //设置避让参数
  114430. declutter: true,
  114431. source: new VectorTileSuperMapRest({
  114432. style: styles,
  114433. withCredentials: withCredentials,
  114434. projection: layerInfo.projection,
  114435. format: new (external_ol_format_MVT_default())({
  114436. featureClass: (external_ol_render_Feature_default())
  114437. }),
  114438. wrapX: false
  114439. }),
  114440. style: mapboxStyles.featureStyleFuntion,
  114441. visible: layerInfo.visible,
  114442. zIndex: layerInfo.zIndex,
  114443. opacity: layerInfo.opacity,
  114444. minResolution: minResolution,
  114445. // The maximum resolution (exclusive) below which this layer will be visible.
  114446. maxResolution: maxResolution > 1 ? Math.ceil(maxResolution) : maxResolution * 1.1
  114447. });
  114448. resolve(layer);
  114449. });
  114450. });
  114451. }
  114452. /**
  114453. * @private
  114454. * @function WebMap.prototype.isSupportWebp
  114455. * @description 判断是否支持webP
  114456. * @param {*} url 服务地址
  114457. * @param {*} token 服务token
  114458. * @returns {boolean}
  114459. */
  114460. }, {
  114461. key: "isSupportWebp",
  114462. value: function isSupportWebp(url, token) {
  114463. // 还需要判断浏览器
  114464. var isIE = this.isIE();
  114465. if (isIE || this.isFirefox() && this.getFirefoxVersion() < 65 || this.isChrome() && this.getChromeVersion() < 32) {
  114466. return false;
  114467. }
  114468. url = token ? "".concat(url, "/tileImage.webp?token=").concat(token) : "".concat(url, "/tileImage.webp");
  114469. var isSameDomain = Util_Util.isInTheSameDomain(url),
  114470. excledeCreditial;
  114471. if (isSameDomain && !token) {
  114472. // online上服务域名一直,要用token值
  114473. excledeCreditial = false;
  114474. } else {
  114475. excledeCreditial = true;
  114476. }
  114477. url = this.getRequestUrl(url, excledeCreditial);
  114478. return FetchRequest.get(url, null, {
  114479. withCredentials: this.withCredentials,
  114480. withoutFormatSuffix: true
  114481. }).then(function (response) {
  114482. if (response.status !== 200) {
  114483. throw response.status;
  114484. }
  114485. return response;
  114486. }).then(function () {
  114487. return true;
  114488. })["catch"](function () {
  114489. return false;
  114490. });
  114491. }
  114492. /**
  114493. * @private
  114494. * @function WebMap.prototype.isIE
  114495. * @description 判断当前浏览器是否为IE
  114496. * @returns {boolean}
  114497. */
  114498. }, {
  114499. key: "isIE",
  114500. value: function isIE() {
  114501. if (!!window.ActiveXObject || "ActiveXObject" in window) {
  114502. return true;
  114503. }
  114504. return false;
  114505. }
  114506. /**
  114507. * @private
  114508. * @function WebMap.prototype.isFirefox
  114509. * @description 判断当前浏览器是否为 firefox
  114510. * @returns {boolean}
  114511. */
  114512. }, {
  114513. key: "isFirefox",
  114514. value: function isFirefox() {
  114515. var userAgent = navigator.userAgent;
  114516. return userAgent.indexOf("Firefox") > -1;
  114517. }
  114518. /**
  114519. * @private
  114520. * @function WebMap.prototype.isChrome
  114521. * @description 判断当前浏览器是否为谷歌
  114522. * @returns {boolean}
  114523. */
  114524. }, {
  114525. key: "isChrome",
  114526. value: function isChrome() {
  114527. var userAgent = navigator.userAgent;
  114528. return userAgent.indexOf("Chrome") > -1;
  114529. }
  114530. /**
  114531. * @private
  114532. * @function WebMap.prototype.getFirefoxVersion
  114533. * @description 获取火狐浏览器的版本号
  114534. * @returns {number}
  114535. */
  114536. }, {
  114537. key: "getFirefoxVersion",
  114538. value: function getFirefoxVersion() {
  114539. var userAgent = navigator.userAgent.toLowerCase(),
  114540. version = userAgent.match(/firefox\/([\d.]+)/);
  114541. return +version[1];
  114542. }
  114543. /**
  114544. * @private
  114545. * @function WebMap.prototype.getChromeVersion
  114546. * @description 获取谷歌浏览器版本号
  114547. * @returns {number}
  114548. */
  114549. }, {
  114550. key: "getChromeVersion",
  114551. value: function getChromeVersion() {
  114552. var userAgent = navigator.userAgent.toLowerCase(),
  114553. version = userAgent.match(/chrome\/([\d.]+)/);
  114554. return +version[1];
  114555. }
  114556. /**
  114557. * @private
  114558. * @function WebMap.prototype.addGraticule
  114559. * @description 创建经纬网
  114560. * @param {Object} mapInfo - 地图信息
  114561. */
  114562. }, {
  114563. key: "addGraticule",
  114564. value: function addGraticule(mapInfo) {
  114565. if (this.isHaveGraticule) {
  114566. this.createGraticuleLayer(mapInfo.grid.graticule);
  114567. this.layerAdded++;
  114568. var lens = mapInfo.layers ? mapInfo.layers.length : 0;
  114569. this.sendMapToUser(lens);
  114570. }
  114571. }
  114572. /**
  114573. * @private
  114574. * @function WebMap.prototype.createGraticuleLayer
  114575. * @description 创建经纬网图层
  114576. * @param {Object} layerInfo - 图层信息
  114577. * @returns {ol.layer.Vector} 矢量图层
  114578. */
  114579. }, {
  114580. key: "createGraticuleLayer",
  114581. value: function createGraticuleLayer(layerInfo) {
  114582. var strokeColor = layerInfo.strokeColor,
  114583. strokeWidth = layerInfo.strokeWidth,
  114584. lineDash = layerInfo.lineDash,
  114585. extent = layerInfo.extent,
  114586. visible = layerInfo.visible,
  114587. interval = layerInfo.interval,
  114588. lonLabelStyle = layerInfo.lonLabelStyle,
  114589. latLabelStyle = layerInfo.latLabelStyle;
  114590. var epsgCode = this.baseProjection;
  114591. // 添加经纬网需要设置extent、worldExtent
  114592. var projection = new external_ol_proj_namespaceObject.get(epsgCode);
  114593. projection.setExtent(extent);
  114594. projection.setWorldExtent(external_ol_proj_namespaceObject.transformExtent(extent, epsgCode, 'EPSG:4326'));
  114595. var graticuleOptions = {
  114596. layerID: 'graticule_layer',
  114597. strokeStyle: new (external_ol_style_Stroke_default())({
  114598. color: strokeColor,
  114599. width: strokeWidth,
  114600. lineDash: lineDash
  114601. }),
  114602. extent: extent,
  114603. visible: visible,
  114604. intervals: interval,
  114605. showLabels: true,
  114606. zIndex: 9999,
  114607. wrapX: false,
  114608. targetSize: 0
  114609. };
  114610. lonLabelStyle && (graticuleOptions.lonLabelStyle = new (external_ol_style_Text_default())({
  114611. font: "".concat(lonLabelStyle.fontSize, " ").concat(lonLabelStyle.fontFamily),
  114612. textBaseline: lonLabelStyle.textBaseline,
  114613. fill: new (external_ol_style_Fill_default())({
  114614. color: lonLabelStyle.fill
  114615. }),
  114616. stroke: new (external_ol_style_Stroke_default())({
  114617. color: lonLabelStyle.outlineColor,
  114618. width: lonLabelStyle.outlineWidth
  114619. })
  114620. }));
  114621. latLabelStyle && (graticuleOptions.latLabelStyle = new (external_ol_style_Text_default())({
  114622. font: "".concat(latLabelStyle.fontSize, " ").concat(latLabelStyle.fontFamily),
  114623. textBaseline: latLabelStyle.textBaseline,
  114624. fill: new (external_ol_style_Fill_default())({
  114625. color: latLabelStyle.fill
  114626. }),
  114627. stroke: new (external_ol_style_Stroke_default())({
  114628. color: latLabelStyle.outlineColor,
  114629. width: latLabelStyle.outlineWidth
  114630. })
  114631. }));
  114632. var layer = new external_ol_layer_namespaceObject.Graticule(graticuleOptions);
  114633. this.map.addLayer(layer);
  114634. }
  114635. /**
  114636. * @private
  114637. * @function WebMap.prototype.getLang
  114638. * @description 检测当前cookie中的语言或者浏览器所用语言
  114639. * @returns {string} 语言名称,如zh-CN
  114640. */
  114641. }, {
  114642. key: "getLang",
  114643. value: function getLang() {
  114644. if (this.getCookie('language')) {
  114645. var cookieLang = this.getCookie('language');
  114646. return this.formatCookieLang(cookieLang);
  114647. } else {
  114648. var browerLang = navigator.language || navigator.browserLanguage;
  114649. return browerLang;
  114650. }
  114651. }
  114652. /**
  114653. * @private
  114654. * @function WebMap.prototype.getCookie
  114655. * @description 获取cookie中某个key对应的值
  114656. * @returns {string} 某个key对应的值
  114657. */
  114658. }, {
  114659. key: "getCookie",
  114660. value: function getCookie(key) {
  114661. key = key.toLowerCase();
  114662. var value = null;
  114663. var cookies = document.cookie.split(';');
  114664. cookies.forEach(function (cookie) {
  114665. var arr = cookie.split('=');
  114666. if (arr[0].toLowerCase().trim() === key) {
  114667. value = arr[1].trim();
  114668. return;
  114669. }
  114670. });
  114671. return value;
  114672. }
  114673. /**
  114674. * @private
  114675. * @function WebMap.prototype.formatCookieLang
  114676. * @description 将从cookie中获取的lang,转换成全称,如zh=>zh-CN
  114677. * @returns {string} 转换后的语言名称
  114678. */
  114679. }, {
  114680. key: "formatCookieLang",
  114681. value: function formatCookieLang(cookieLang) {
  114682. var lang;
  114683. switch (cookieLang) {
  114684. case 'zh':
  114685. lang = 'zh-CN';
  114686. break;
  114687. case 'ar':
  114688. lang = 'ar-EG';
  114689. break;
  114690. case 'bg':
  114691. lang = 'bg-BG';
  114692. break;
  114693. case 'ca':
  114694. lang = 'ca-ES';
  114695. break;
  114696. case 'cs':
  114697. lang = 'cs-CZ';
  114698. break;
  114699. case 'da':
  114700. lang = 'da-DK';
  114701. break;
  114702. case 'de':
  114703. lang = 'de-DE';
  114704. break;
  114705. case 'el':
  114706. lang = 'el-GR';
  114707. break;
  114708. case 'es':
  114709. lang = 'es-ES';
  114710. break;
  114711. case 'et':
  114712. lang = 'et-EE';
  114713. break;
  114714. case 'fa':
  114715. lang = 'fa-IR';
  114716. break;
  114717. case 'fl':
  114718. lang = 'fi-FI';
  114719. break;
  114720. case 'fr':
  114721. lang = 'fr-FR';
  114722. break;
  114723. case 'he':
  114724. lang = 'he-IL';
  114725. break;
  114726. case 'hu':
  114727. lang = 'hu-HU';
  114728. break;
  114729. case 'id':
  114730. lang = 'id-ID';
  114731. break;
  114732. case 'is':
  114733. lang = 'is-IS';
  114734. break;
  114735. case 'it':
  114736. lang = 'it-IT';
  114737. break;
  114738. case 'ja':
  114739. lang = 'ja-JP';
  114740. break;
  114741. case 'ko':
  114742. lang = 'ko-KR';
  114743. break;
  114744. case 'ku':
  114745. lang = 'ku-IQ';
  114746. break;
  114747. case 'mn':
  114748. lang = 'mn-MN';
  114749. break;
  114750. case 'nb':
  114751. lang = 'nb-NO';
  114752. break;
  114753. case 'ne':
  114754. lang = 'ne-NP';
  114755. break;
  114756. case 'nl':
  114757. lang = 'nl-NL';
  114758. break;
  114759. case 'pl':
  114760. lang = 'pl-PL';
  114761. break;
  114762. case 'pt':
  114763. lang = 'pt-PT';
  114764. break;
  114765. case 'ru':
  114766. lang = 'ru-RU';
  114767. break;
  114768. case 'sk':
  114769. lang = 'sk-SK';
  114770. break;
  114771. case 'sl':
  114772. lang = 'sl-SI';
  114773. break;
  114774. case 'sr':
  114775. lang = 'sr-RS';
  114776. break;
  114777. case 'sv':
  114778. lang = 'sv-SE';
  114779. break;
  114780. case 'th':
  114781. lang = 'th-TH';
  114782. break;
  114783. case 'tr':
  114784. lang = 'tr-TR';
  114785. break;
  114786. case 'uk':
  114787. lang = 'uk-UA';
  114788. break;
  114789. case 'vi':
  114790. lang = 'vi-VN';
  114791. break;
  114792. default:
  114793. lang = 'en-US';
  114794. break;
  114795. }
  114796. return lang;
  114797. }
  114798. }, {
  114799. key: "isCustomProjection",
  114800. value: function isCustomProjection(projection) {
  114801. if (core_Util_Util.isNumber(projection)) {
  114802. return [-1000, -1].includes(+projection);
  114803. }
  114804. return ['EPSG:-1000', 'EPSG:-1'].includes(projection);
  114805. }
  114806. }, {
  114807. key: "handleJSONSuffix",
  114808. value: function handleJSONSuffix(url) {
  114809. if (!url.includes('.json')) {
  114810. if (url.includes('?')) {
  114811. var urlArr = url.split('?');
  114812. urlArr[0] = urlArr[0] + ".json";
  114813. url = urlArr.join('?');
  114814. } else {
  114815. url = url + ".json";
  114816. }
  114817. }
  114818. return url;
  114819. }
  114820. }]);
  114821. return WebMap;
  114822. }((external_ol_Observable_default()));
  114823. ;// CONCATENATED MODULE: ./src/openlayers/mapping/ImageTileSuperMapRest.js
  114824. function ImageTileSuperMapRest_typeof(obj) { "@babel/helpers - typeof"; return ImageTileSuperMapRest_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ImageTileSuperMapRest_typeof(obj); }
  114825. function ImageTileSuperMapRest_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  114826. function ImageTileSuperMapRest_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ImageTileSuperMapRest_ownKeys(Object(source), !0).forEach(function (key) { ImageTileSuperMapRest_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ImageTileSuperMapRest_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  114827. function ImageTileSuperMapRest_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  114828. function ImageTileSuperMapRest_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  114829. function ImageTileSuperMapRest_createClass(Constructor, protoProps, staticProps) { if (protoProps) ImageTileSuperMapRest_defineProperties(Constructor.prototype, protoProps); if (staticProps) ImageTileSuperMapRest_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  114830. function ImageTileSuperMapRest_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  114831. function ImageTileSuperMapRest_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) ImageTileSuperMapRest_setPrototypeOf(subClass, superClass); }
  114832. function ImageTileSuperMapRest_setPrototypeOf(o, p) { ImageTileSuperMapRest_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ImageTileSuperMapRest_setPrototypeOf(o, p); }
  114833. function ImageTileSuperMapRest_createSuper(Derived) { var hasNativeReflectConstruct = ImageTileSuperMapRest_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ImageTileSuperMapRest_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ImageTileSuperMapRest_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ImageTileSuperMapRest_possibleConstructorReturn(this, result); }; }
  114834. function ImageTileSuperMapRest_possibleConstructorReturn(self, call) { if (call && (ImageTileSuperMapRest_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return ImageTileSuperMapRest_assertThisInitialized(self); }
  114835. function ImageTileSuperMapRest_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  114836. function ImageTileSuperMapRest_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  114837. function ImageTileSuperMapRest_getPrototypeOf(o) { ImageTileSuperMapRest_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ImageTileSuperMapRest_getPrototypeOf(o); }
  114838. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  114839. * This program are made available under the terms of the Apache License, Version 2.0
  114840. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  114841. /**
  114842. * @class ImageTileSuperMapRest
  114843. * @browsernamespace ol.source
  114844. * @version 10.2.0
  114845. * @category iServer Image
  114846. * @classdesc iServer影像服务图层源。根据指定的请求参数,返回影像数据栅格瓦片并渲染。
  114847. * @param {Object} options - 参数。
  114848. * @param {string} options.url - 服务地址。例如: http://{ip}:{port}/iserver/{imageservice-imageserviceName}/restjsr/
  114849. * @param {string} options.collectionId - 影像集合(Collection)的ID,在一个影像服务中唯一标识影像集合。
  114850. * @param {string} [options.sqlFilter] 显示影像的过滤条件。相当于SQL查询中的where子句。支持st_geometry空间函数过滤。11.0版本暂不支持通过ECQL进行过滤。
  114851. * @param {ImageRenderingRule} [options.renderingRule] 指定影像显示的风格,包含拉伸显示方式、颜色表、波段组合以及应用栅格函数进行快速处理等。不指定时,使用发布服务时所配置的风格。
  114852. * @param {Array.<number>} [options.ids] 返回影像集合中指定ID的影像,该ID为系统维护的一个自增ID,为SuperMap SDX引擎的SmID字段内容。
  114853. * @param {Array.<string>} [options.names] 返回影像集合中指定名称影像的瓦片资源。影像名称包含文件后缀,如S-60-45.tif。
  114854. * @param {string} [options.format='png'] - 瓦片表述类型,瓦片格式目前支持png、jpg和webp三种格式。
  114855. * @param {boolean} [options.transparent=true] - 瓦片是否透明。默认透明。
  114856. * @param {boolean} [options.cacheEnabled=true] - 启用缓存。
  114857. * @param {string} [options.tileProxy] - 代理地址。
  114858. * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权信息。
  114859. * @extends {ol.source.XYZ}
  114860. * @usage
  114861. */
  114862. var ImageTileSuperMapRest = /*#__PURE__*/function (_XYZ) {
  114863. ImageTileSuperMapRest_inherits(ImageTileSuperMapRest, _XYZ);
  114864. var _super = ImageTileSuperMapRest_createSuper(ImageTileSuperMapRest);
  114865. function ImageTileSuperMapRest(options) {
  114866. var _this;
  114867. ImageTileSuperMapRest_classCallCheck(this, ImageTileSuperMapRest);
  114868. options = options || {};
  114869. options.format = options.format || 'png';
  114870. options.transparent = options.transparent === undefined ? true : options.transparent === true;
  114871. options.cacheEnabled = options.cacheEnabled === undefined ? true : options.cacheEnabled === true;
  114872. var attributions = options.attributions || "Map Data <span>© SuperMap iServer</span>";
  114873. var url = _createLayerUrl(options.url, options);
  114874. var superOptions = ImageTileSuperMapRest_objectSpread(ImageTileSuperMapRest_objectSpread({}, options), {}, {
  114875. attributions: attributions,
  114876. url: url
  114877. });
  114878. //需要代理时走自定义 tileLoadFunction,否则走默认的tileLoadFunction
  114879. if (!options.tileLoadFunction && options.tileProxy) {
  114880. superOptions.tileLoadFunction = tileLoadFunction;
  114881. }
  114882. _this = _super.call(this, superOptions);
  114883. var me = ImageTileSuperMapRest_assertThisInitialized(_this);
  114884. _this.options = options;
  114885. if (options.tileProxy) {
  114886. _this.tileProxy = options.tileProxy;
  114887. }
  114888. function tileLoadFunction(imageTile, src) {
  114889. imageTile.getImage().src = me.tileProxy + encodeURIComponent(src);
  114890. }
  114891. function _createLayerUrl(url, options) {
  114892. var layerUrl = Util_Util.urlPathAppend(url, "/collections/".concat(options.collectionId, "/tile.").concat(options.format, "?x={x}&y={y}&z={z}"));
  114893. var requestParams = _getAllRequestParams(options);
  114894. layerUrl = Util_Util.urlAppend(layerUrl, _getParamString(requestParams));
  114895. layerUrl = SecurityManager.appendCredential(layerUrl);
  114896. if (!options.cacheEnabled) {
  114897. layerUrl += '&_t=' + new Date().getTime();
  114898. }
  114899. return layerUrl;
  114900. }
  114901. function _getAllRequestParams(options) {
  114902. var params = {};
  114903. params['transparent'] = options.transparent;
  114904. params['cacheEnabled'] = !(options.cacheEnabled === false);
  114905. if (options.sqlFilter) {
  114906. params['sqlFilter'] = options.sqlFilter;
  114907. }
  114908. if (options.renderingRule) {
  114909. params['renderingRule'] = JSON.stringify(options.renderingRule);
  114910. }
  114911. if (options.ids) {
  114912. params['ids'] = options.ids.join(',');
  114913. }
  114914. if (options.names) {
  114915. params['names'] = options.names.join(',');
  114916. }
  114917. return params;
  114918. }
  114919. function _getParamString(obj) {
  114920. var params = [];
  114921. for (var i in obj) {
  114922. params.push(encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]));
  114923. }
  114924. return params.join('&');
  114925. }
  114926. return _this;
  114927. }
  114928. return ImageTileSuperMapRest_createClass(ImageTileSuperMapRest);
  114929. }((external_ol_source_XYZ_default()));
  114930. ;// CONCATENATED MODULE: external "ol.layer.Tile"
  114931. var external_ol_layer_Tile_namespaceObject = ol.layer.Tile;
  114932. var external_ol_layer_Tile_default = /*#__PURE__*/__webpack_require__.n(external_ol_layer_Tile_namespaceObject);
  114933. ;// CONCATENATED MODULE: ./src/openlayers/mapping/InitMap.js
  114934. function InitMap_typeof(obj) { "@babel/helpers - typeof"; return InitMap_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, InitMap_typeof(obj); }
  114935. function InitMap_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  114936. function InitMap_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? InitMap_ownKeys(Object(source), !0).forEach(function (key) { InitMap_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : InitMap_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  114937. function InitMap_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  114938. function InitMap_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ InitMap_regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == InitMap_typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
  114939. function InitMap_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
  114940. function InitMap_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { InitMap_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { InitMap_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
  114941. window.proj4 = (proj4_src_default());
  114942. /**
  114943. * @function initMap
  114944. * @description 根据 SuperMap iServer 服务参数,创建地图与图层。目前仅支持SuperMap iServer 地图服务,创建的图层为 ol.Tile。
  114945. * @category BaseTypes Util
  114946. * @version 11.0.1
  114947. * @param {number} url - 服务地址,例如: http://{ip}:{port}/iserver/services/map-world/rest/maps/World。
  114948. * @param {Object} options - 参数。
  114949. * @param {Object} [options.mapOptions] - 地图配置,参数设置参考 {@link https://openlayers.org/en/v6.15.1/apidoc/module-ol_Map-Map.html}。
  114950. * @param {Object} [options.viewOptions] - 视图配置,参数设置参考 {@link https://openlayers.org/en/v6.15.1/apidoc/module-ol_View-View.html} ,未设置的情况下,默认使用 SuperMap iServer 服务参数进行设置。
  114951. * @param {Object} [options.layerOptions] - 图层配置,参数设置参考 {@link https://openlayers.org/en/v6.15.1/apidoc/module-ol_layer_Tile-TileLayer.html} ,未设置的情况下,默认使用 SuperMap iServer 服务参数进行设置。
  114952. * @param {Object} [options.sourceOptions] - 数据源配置,参数设置参考 {@link TileSuperMapRest} ,未设置的情况下,默认使用 SuperMap iServer 服务参数进行设置。
  114953. * @returns {Object} 实例对象,对象包括地图实例,图层实例,数据源实例。
  114954. * @usage
  114955. * ```
  114956. * // 浏览器
  114957. * <script type="text/javascript" src="{cdn}"></script>
  114958. * <script>
  114959. * const initMap = {namespace}.initMap;
  114960. *
  114961. * </script>
  114962. * // ES6 Import
  114963. * import { initMap } from '{npm}';
  114964. *
  114965. * initMap(url, { mapOptions, viewOptions, layerOptions, sourceOptions })
  114966. * ```
  114967. * */
  114968. function initMap(url) {
  114969. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  114970. var mapOptions = options.mapOptions,
  114971. viewOptions = options.viewOptions,
  114972. layerOptions = options.layerOptions,
  114973. sourceOptions = options.sourceOptions;
  114974. return new Promise(function (resolve, reject) {
  114975. new MapService(url).getMapInfo( /*#__PURE__*/function () {
  114976. var _ref = InitMap_asyncToGenerator( /*#__PURE__*/InitMap_regeneratorRuntime().mark(function _callee(serviceResult) {
  114977. var _serviceResult$result, prjCoordSys, bounds, wkt, map, _createLayer, layer, source;
  114978. return InitMap_regeneratorRuntime().wrap(function _callee$(_context) {
  114979. while (1) switch (_context.prev = _context.next) {
  114980. case 0:
  114981. if (!serviceResult || !serviceResult.result) {
  114982. reject('service is not work!');
  114983. }
  114984. _serviceResult$result = serviceResult.result, prjCoordSys = _serviceResult$result.prjCoordSys, bounds = _serviceResult$result.bounds;
  114985. if (!(!(0,external_ol_proj_namespaceObject.get)("EPSG:".concat(prjCoordSys.epsgCode)) && prjCoordSys.type !== 'PCS_NON_EARTH')) {
  114986. _context.next = 7;
  114987. break;
  114988. }
  114989. _context.next = 5;
  114990. return getWkt(url);
  114991. case 5:
  114992. wkt = _context.sent;
  114993. registerProj(prjCoordSys.epsgCode, wkt, bounds);
  114994. case 7:
  114995. map = createMap(serviceResult.result, mapOptions, viewOptions);
  114996. _createLayer = createLayer(url, serviceResult.result, sourceOptions, layerOptions), layer = _createLayer.layer, source = _createLayer.source;
  114997. map.addLayer(layer);
  114998. resolve({
  114999. map: map,
  115000. source: source,
  115001. layer: layer
  115002. });
  115003. case 11:
  115004. case "end":
  115005. return _context.stop();
  115006. }
  115007. }, _callee);
  115008. }));
  115009. return function (_x) {
  115010. return _ref.apply(this, arguments);
  115011. };
  115012. }());
  115013. });
  115014. }
  115015. /**
  115016. * @function viewOptionsFromMapJSON
  115017. * @category BaseTypes Util
  115018. * @version 11.0.1
  115019. * @description 通过 iServer REST 地图参数构造 ol 视图对象。
  115020. * @param {Object} mapJSONObj - 地图 JSON 对象。
  115021. * @param {number} [level=22] - 地图最大级别。
  115022. * @returns {Object} ol视图参数,包括中心点、投影、级别、分辨率数组。
  115023. */
  115024. function viewOptionsFromMapJSON(mapJSONObj) {
  115025. var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 22;
  115026. var bounds = mapJSONObj.bounds,
  115027. dpi = mapJSONObj.dpi,
  115028. center = mapJSONObj.center,
  115029. visibleScales = mapJSONObj.visibleScales,
  115030. scale = mapJSONObj.scale,
  115031. coordUnit = mapJSONObj.coordUnit,
  115032. prjCoordSys = mapJSONObj.prjCoordSys;
  115033. var mapCenter = center.x && center.y ? [center.x, center.y] : [(bounds.left + bounds.right) / 2, (bounds.bottom + bounds.top) / 2];
  115034. var extent = [bounds.left, bounds.bottom, bounds.right, bounds.top];
  115035. var projection = core_Util_Util.getProjection(prjCoordSys, extent);
  115036. var resolutions = core_Util_Util.scalesToResolutions(visibleScales, bounds, dpi, coordUnit, level);
  115037. var zoom = core_Util_Util.getZoomByResolution(core_Util_Util.scaleToResolution(scale, dpi, coordUnit), resolutions);
  115038. return {
  115039. center: mapCenter,
  115040. projection: projection,
  115041. zoom: zoom,
  115042. resolutions: resolutions
  115043. };
  115044. }
  115045. function createMap(result, mapOptions, viewOptions) {
  115046. var view = viewOptionsFromMapJSON(result);
  115047. var map = new (external_ol_Map_default())(InitMap_objectSpread({
  115048. target: 'map',
  115049. view: new (external_ol_View_default())(InitMap_objectSpread(InitMap_objectSpread({}, view), viewOptions))
  115050. }, mapOptions));
  115051. return map;
  115052. }
  115053. function registerProj(epsgCode, wkt, bounds) {
  115054. var extent = [bounds.left, bounds.bottom, bounds.right, bounds.top];
  115055. var epsgCodeStr = "EPSG:".concat(epsgCode);
  115056. !(0,external_ol_proj_namespaceObject.get)(epsgCodeStr) && proj4_src_default().defs(epsgCodeStr, wkt);
  115057. if (external_ol_proj_proj4_namespaceObject && external_ol_proj_proj4_namespaceObject.register) {
  115058. external_ol_proj_proj4_namespaceObject.register((proj4_src_default()));
  115059. var prj = (0,external_ol_proj_namespaceObject.get)(epsgCodeStr);
  115060. prj.setExtent(extent);
  115061. }
  115062. }
  115063. function createLayer(url, result, sourceOptions, layerOptions) {
  115064. var options = TileSuperMapRest.optionsFromMapJSON(url, result, true);
  115065. options = InitMap_objectSpread(InitMap_objectSpread({}, options), sourceOptions);
  115066. var source = new TileSuperMapRest(options);
  115067. var layer = new (external_ol_layer_Tile_default())(InitMap_objectSpread({
  115068. source: source
  115069. }, layerOptions));
  115070. return {
  115071. layer: layer,
  115072. source: source
  115073. };
  115074. }
  115075. function getWkt(url) {
  115076. return new Promise(function (resolve) {
  115077. new MapService(url).getWkt(function (res) {
  115078. var wkt = res.result.data;
  115079. resolve(wkt);
  115080. });
  115081. });
  115082. }
  115083. ;// CONCATENATED MODULE: ./src/openlayers/mapping/index.js
  115084. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  115085. * This program are made available under the terms of the Apache License, Version 2.0
  115086. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  115087. ;// CONCATENATED MODULE: ./src/openlayers/index.js
  115088. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  115089. * This program are made available under the terms of the Apache License, Version 2.0
  115090. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  115091. ;// CONCATENATED MODULE: ./src/openlayers/namespace.js
  115092. function openlayers_namespace_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  115093. function openlayers_namespace_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? openlayers_namespace_ownKeys(Object(source), !0).forEach(function (key) { openlayers_namespace_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : openlayers_namespace_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  115094. function openlayers_namespace_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  115095. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  115096. * This program are made available under the terms of the Apache License, Version 2.0
  115097. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  115098. /* control */
  115099. /* core */
  115100. /* mapping */
  115101. /* overlay */
  115102. /* service */
  115103. if (window && window.ol) {
  115104. var namespace_ol = window.ol;
  115105. namespace_ol.supermap = openlayers_namespace_objectSpread(openlayers_namespace_objectSpread({}, SuperMap), namespace_ol.supermap);
  115106. namespace_ol.supermap.control = namespace_ol.supermap.control || {};
  115107. // control
  115108. namespace_ol.supermap.control.ChangeTileVersion = ChangeTileVersion;
  115109. namespace_ol.supermap.control.Logo = Logo;
  115110. namespace_ol.supermap.control.ScaleLine = ScaleLine;
  115111. // core
  115112. namespace_ol.supermap.StyleUtils = StyleUtils;
  115113. namespace_ol.supermap.Util = core_Util_Util;
  115114. // mapping
  115115. namespace_ol.source.BaiduMap = BaiduMap;
  115116. namespace_ol.source.ImageSuperMapRest = ImageSuperMapRest;
  115117. namespace_ol.source.SuperMapCloud = SuperMapCloud;
  115118. namespace_ol.source.ImageTileSuperMapRest = ImageTileSuperMapRest;
  115119. namespace_ol.source.Tianditu = Tianditu;
  115120. namespace_ol.source.TileSuperMapRest = TileSuperMapRest;
  115121. namespace_ol.supermap.WebMap = WebMap;
  115122. // overlay
  115123. namespace_ol.style.CloverShape = CloverShape;
  115124. namespace_ol.Graphic = Graphic_Graphic;
  115125. namespace_ol.style.HitCloverShape = HitCloverShape;
  115126. namespace_ol.source.GeoFeature = GeoFeature;
  115127. namespace_ol.source.Theme = theme_Theme_Theme;
  115128. namespace_ol.supermap.ThemeFeature = ThemeFeature;
  115129. namespace_ol.supermap.MapboxStyles = MapboxStyles;
  115130. namespace_ol.supermap.VectorTileStyles = VectorTileStyles;
  115131. namespace_ol.source.DataFlow = DataFlow;
  115132. namespace_ol.source.Graph = Graph_Graph;
  115133. namespace_ol.source.Graphic = Graphic;
  115134. namespace_ol.source.HeatMap = HeatMap;
  115135. namespace_ol.source.Label = Label_Label;
  115136. namespace_ol.source.Mapv = Mapv;
  115137. namespace_ol.source.Range = Range;
  115138. namespace_ol.source.RankSymbol = RankSymbol_RankSymbol;
  115139. namespace_ol.source.Turf = Turf;
  115140. namespace_ol.source.FGB = FGB;
  115141. namespace_ol.source.Unique = Unique;
  115142. namespace_ol.source.VectorTileSuperMapRest = VectorTileSuperMapRest;
  115143. namespace_ol.supermap.GraphMap = GraphMap;
  115144. // service
  115145. namespace_ol.supermap.AddressMatchService = AddressMatchService;
  115146. namespace_ol.supermap.ChartService = ChartService;
  115147. namespace_ol.supermap.DataFlowService = DataFlowService;
  115148. namespace_ol.supermap.DatasetService = DatasetService;
  115149. namespace_ol.supermap.DatasourceService = DatasourceService;
  115150. namespace_ol.supermap.FeatureService = FeatureService;
  115151. namespace_ol.supermap.FieldService = FieldService;
  115152. namespace_ol.supermap.GridCellInfosService = GridCellInfosService;
  115153. namespace_ol.supermap.GeoprocessingService = GeoprocessingService;
  115154. namespace_ol.supermap.LayerInfoService = LayerInfoService;
  115155. namespace_ol.supermap.MapService = MapService;
  115156. namespace_ol.supermap.MeasureService = MeasureService;
  115157. namespace_ol.supermap.NetworkAnalyst3DService = NetworkAnalyst3DService;
  115158. namespace_ol.supermap.NetworkAnalystService = NetworkAnalystService;
  115159. namespace_ol.supermap.ProcessingService = ProcessingService;
  115160. namespace_ol.supermap.QueryService = QueryService;
  115161. namespace_ol.supermap.ServiceBase = ServiceBase;
  115162. namespace_ol.supermap.SpatialAnalystService = SpatialAnalystService;
  115163. namespace_ol.supermap.ThemeService = ThemeService;
  115164. namespace_ol.supermap.TrafficTransferAnalystService = TrafficTransferAnalystService;
  115165. namespace_ol.supermap.WebPrintingJobService = WebPrintingJobService;
  115166. namespace_ol.supermap.ImageService = ImageService;
  115167. namespace_ol.supermap.ImageCollectionService = ImageCollectionService;
  115168. namespace_ol.supermap.KnowledgeGraphService = KnowledgeGraphService;
  115169. namespace_ol.supermap.initMap = initMap;
  115170. namespace_ol.supermap.viewOptionsFromMapJSON = viewOptionsFromMapJSON;
  115171. // 处理命名空间重名问题
  115172. namespace_ol.supermap.CommonUtil = Util_Util;
  115173. }
  115174. /***/ }),
  115175. /***/ 1351:
  115176. /***/ (function(__unused_webpack_module, exports) {
  115177. "use strict";
  115178. var __webpack_unused_export__;
  115179. __webpack_unused_export__ = ({
  115180. value: true
  115181. });
  115182. /*! *****************************************************************************
  115183. Copyright (c) Microsoft Corporation.
  115184. Permission to use, copy, modify, and/or distribute this software for any
  115185. purpose with or without fee is hereby granted.
  115186. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  115187. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  115188. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  115189. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  115190. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  115191. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  115192. PERFORMANCE OF THIS SOFTWARE.
  115193. ***************************************************************************** */
  115194. /* global Reflect, Promise */
  115195. var _extendStatics = function extendStatics(d, b) {
  115196. _extendStatics = Object.setPrototypeOf || {
  115197. __proto__: []
  115198. } instanceof Array && function (d, b) {
  115199. d.__proto__ = b;
  115200. } || function (d, b) {
  115201. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  115202. };
  115203. return _extendStatics(d, b);
  115204. };
  115205. function __extends(d, b) {
  115206. _extendStatics(d, b);
  115207. function __() {
  115208. this.constructor = d;
  115209. }
  115210. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  115211. }
  115212. function __awaiter(thisArg, _arguments, P, generator) {
  115213. function adopt(value) {
  115214. return value instanceof P ? value : new P(function (resolve) {
  115215. resolve(value);
  115216. });
  115217. }
  115218. return new (P || (P = Promise))(function (resolve, reject) {
  115219. function fulfilled(value) {
  115220. try {
  115221. step(generator.next(value));
  115222. } catch (e) {
  115223. reject(e);
  115224. }
  115225. }
  115226. function rejected(value) {
  115227. try {
  115228. step(generator["throw"](value));
  115229. } catch (e) {
  115230. reject(e);
  115231. }
  115232. }
  115233. function step(result) {
  115234. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  115235. }
  115236. step((generator = generator.apply(thisArg, _arguments || [])).next());
  115237. });
  115238. }
  115239. function __generator(thisArg, body) {
  115240. var _ = {
  115241. label: 0,
  115242. sent: function sent() {
  115243. if (t[0] & 1) throw t[1];
  115244. return t[1];
  115245. },
  115246. trys: [],
  115247. ops: []
  115248. },
  115249. f,
  115250. y,
  115251. t,
  115252. g;
  115253. return g = {
  115254. next: verb(0),
  115255. "throw": verb(1),
  115256. "return": verb(2)
  115257. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  115258. return this;
  115259. }), g;
  115260. function verb(n) {
  115261. return function (v) {
  115262. return step([n, v]);
  115263. };
  115264. }
  115265. function step(op) {
  115266. if (f) throw new TypeError("Generator is already executing.");
  115267. while (_) try {
  115268. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  115269. if (y = 0, t) op = [op[0] & 2, t.value];
  115270. switch (op[0]) {
  115271. case 0:
  115272. case 1:
  115273. t = op;
  115274. break;
  115275. case 4:
  115276. _.label++;
  115277. return {
  115278. value: op[1],
  115279. done: false
  115280. };
  115281. case 5:
  115282. _.label++;
  115283. y = op[1];
  115284. op = [0];
  115285. continue;
  115286. case 7:
  115287. op = _.ops.pop();
  115288. _.trys.pop();
  115289. continue;
  115290. default:
  115291. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  115292. _ = 0;
  115293. continue;
  115294. }
  115295. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  115296. _.label = op[1];
  115297. break;
  115298. }
  115299. if (op[0] === 6 && _.label < t[1]) {
  115300. _.label = t[1];
  115301. t = op;
  115302. break;
  115303. }
  115304. if (t && _.label < t[2]) {
  115305. _.label = t[2];
  115306. _.ops.push(op);
  115307. break;
  115308. }
  115309. if (t[2]) _.ops.pop();
  115310. _.trys.pop();
  115311. continue;
  115312. }
  115313. op = body.call(thisArg, _);
  115314. } catch (e) {
  115315. op = [6, e];
  115316. y = 0;
  115317. } finally {
  115318. f = t = 0;
  115319. }
  115320. if (op[0] & 5) throw op[1];
  115321. return {
  115322. value: op[0] ? op[1] : void 0,
  115323. done: true
  115324. };
  115325. }
  115326. }
  115327. function __values(o) {
  115328. var s = typeof Symbol === "function" && Symbol.iterator,
  115329. m = s && o[s],
  115330. i = 0;
  115331. if (m) return m.call(o);
  115332. if (o && typeof o.length === "number") return {
  115333. next: function next() {
  115334. if (o && i >= o.length) o = void 0;
  115335. return {
  115336. value: o && o[i++],
  115337. done: !o
  115338. };
  115339. }
  115340. };
  115341. throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
  115342. }
  115343. function __await(v) {
  115344. return this instanceof __await ? (this.v = v, this) : new __await(v);
  115345. }
  115346. function __asyncGenerator(thisArg, _arguments, generator) {
  115347. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  115348. var g = generator.apply(thisArg, _arguments || []),
  115349. i,
  115350. q = [];
  115351. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () {
  115352. return this;
  115353. }, i;
  115354. function verb(n) {
  115355. if (g[n]) i[n] = function (v) {
  115356. return new Promise(function (a, b) {
  115357. q.push([n, v, a, b]) > 1 || resume(n, v);
  115358. });
  115359. };
  115360. }
  115361. function resume(n, v) {
  115362. try {
  115363. step(g[n](v));
  115364. } catch (e) {
  115365. settle(q[0][3], e);
  115366. }
  115367. }
  115368. function step(r) {
  115369. r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
  115370. }
  115371. function fulfill(value) {
  115372. resume("next", value);
  115373. }
  115374. function reject(value) {
  115375. resume("throw", value);
  115376. }
  115377. function settle(f, v) {
  115378. if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
  115379. }
  115380. }
  115381. /** An error subclass which is thrown when there are too many pending push or next operations on a single repeater. */
  115382. var RepeaterOverflowError = /** @class */function (_super) {
  115383. __extends(RepeaterOverflowError, _super);
  115384. function RepeaterOverflowError(message) {
  115385. var _this = _super.call(this, message) || this;
  115386. Object.defineProperty(_this, "name", {
  115387. value: "RepeaterOverflowError",
  115388. enumerable: false
  115389. });
  115390. if (typeof Object.setPrototypeOf === "function") {
  115391. Object.setPrototypeOf(_this, _this.constructor.prototype);
  115392. } else {
  115393. _this.__proto__ = _this.constructor.prototype;
  115394. }
  115395. if (typeof Error.captureStackTrace === "function") {
  115396. Error.captureStackTrace(_this, _this.constructor);
  115397. }
  115398. return _this;
  115399. }
  115400. return RepeaterOverflowError;
  115401. }(Error);
  115402. /** A buffer which allows you to push a set amount of values to the repeater without pushes waiting or throwing errors. */
  115403. var FixedBuffer = /** @class */function () {
  115404. function FixedBuffer(capacity) {
  115405. if (capacity < 0) {
  115406. throw new RangeError("Capacity may not be less than 0");
  115407. }
  115408. this._c = capacity;
  115409. this._q = [];
  115410. }
  115411. Object.defineProperty(FixedBuffer.prototype, "empty", {
  115412. get: function get() {
  115413. return this._q.length === 0;
  115414. },
  115415. enumerable: false,
  115416. configurable: true
  115417. });
  115418. Object.defineProperty(FixedBuffer.prototype, "full", {
  115419. get: function get() {
  115420. return this._q.length >= this._c;
  115421. },
  115422. enumerable: false,
  115423. configurable: true
  115424. });
  115425. FixedBuffer.prototype.add = function (value) {
  115426. if (this.full) {
  115427. throw new Error("Buffer full");
  115428. } else {
  115429. this._q.push(value);
  115430. }
  115431. };
  115432. FixedBuffer.prototype.remove = function () {
  115433. if (this.empty) {
  115434. throw new Error("Buffer empty");
  115435. }
  115436. return this._q.shift();
  115437. };
  115438. return FixedBuffer;
  115439. }();
  115440. // TODO: Use a circular buffer here.
  115441. /** Sliding buffers allow you to push a set amount of values to the repeater without pushes waiting or throwing errors. If the number of values exceeds the capacity set in the constructor, the buffer will discard the earliest values added. */
  115442. var SlidingBuffer = /** @class */function () {
  115443. function SlidingBuffer(capacity) {
  115444. if (capacity < 1) {
  115445. throw new RangeError("Capacity may not be less than 1");
  115446. }
  115447. this._c = capacity;
  115448. this._q = [];
  115449. }
  115450. Object.defineProperty(SlidingBuffer.prototype, "empty", {
  115451. get: function get() {
  115452. return this._q.length === 0;
  115453. },
  115454. enumerable: false,
  115455. configurable: true
  115456. });
  115457. Object.defineProperty(SlidingBuffer.prototype, "full", {
  115458. get: function get() {
  115459. return false;
  115460. },
  115461. enumerable: false,
  115462. configurable: true
  115463. });
  115464. SlidingBuffer.prototype.add = function (value) {
  115465. while (this._q.length >= this._c) {
  115466. this._q.shift();
  115467. }
  115468. this._q.push(value);
  115469. };
  115470. SlidingBuffer.prototype.remove = function () {
  115471. if (this.empty) {
  115472. throw new Error("Buffer empty");
  115473. }
  115474. return this._q.shift();
  115475. };
  115476. return SlidingBuffer;
  115477. }();
  115478. /** Dropping buffers allow you to push a set amount of values to the repeater without the push function waiting or throwing errors. If the number of values exceeds the capacity set in the constructor, the buffer will discard the latest values added. */
  115479. var DroppingBuffer = /** @class */function () {
  115480. function DroppingBuffer(capacity) {
  115481. if (capacity < 1) {
  115482. throw new RangeError("Capacity may not be less than 1");
  115483. }
  115484. this._c = capacity;
  115485. this._q = [];
  115486. }
  115487. Object.defineProperty(DroppingBuffer.prototype, "empty", {
  115488. get: function get() {
  115489. return this._q.length === 0;
  115490. },
  115491. enumerable: false,
  115492. configurable: true
  115493. });
  115494. Object.defineProperty(DroppingBuffer.prototype, "full", {
  115495. get: function get() {
  115496. return false;
  115497. },
  115498. enumerable: false,
  115499. configurable: true
  115500. });
  115501. DroppingBuffer.prototype.add = function (value) {
  115502. if (this._q.length < this._c) {
  115503. this._q.push(value);
  115504. }
  115505. };
  115506. DroppingBuffer.prototype.remove = function () {
  115507. if (this.empty) {
  115508. throw new Error("Buffer empty");
  115509. }
  115510. return this._q.shift();
  115511. };
  115512. return DroppingBuffer;
  115513. }();
  115514. /** Makes sure promise-likes don’t cause unhandled rejections. */
  115515. function swallow(value) {
  115516. if (value != null && typeof value.then === "function") {
  115517. value.then(NOOP, NOOP);
  115518. }
  115519. }
  115520. /*** REPEATER STATES ***/
  115521. /** The following is an enumeration of all possible repeater states. These states are ordered, and a repeater may only advance to higher states. */
  115522. /** The initial state of the repeater. */
  115523. var Initial = 0;
  115524. /** Repeaters advance to this state the first time the next method is called on the repeater. */
  115525. var Started = 1;
  115526. /** Repeaters advance to this state when the stop function is called. */
  115527. var Stopped = 2;
  115528. /** Repeaters advance to this state when there are no values left to be pulled from the repeater. */
  115529. var Done = 3;
  115530. /** Repeaters advance to this state if an error is thrown into the repeater. */
  115531. var Rejected = 4;
  115532. /** The maximum number of push or next operations which may exist on a single repeater. */
  115533. var MAX_QUEUE_LENGTH = 1024;
  115534. var NOOP = function NOOP() {};
  115535. /** A helper function used to mimic the behavior of async generators where the final iteration is consumed. */
  115536. function consumeExecution(r) {
  115537. var err = r.err;
  115538. var execution = Promise.resolve(r.execution).then(function (value) {
  115539. if (err != null) {
  115540. throw err;
  115541. }
  115542. return value;
  115543. });
  115544. r.err = undefined;
  115545. r.execution = execution.then(function () {
  115546. return undefined;
  115547. }, function () {
  115548. return undefined;
  115549. });
  115550. return r.pending === undefined ? execution : r.pending.then(function () {
  115551. return execution;
  115552. });
  115553. }
  115554. /** A helper function for building iterations from values. Promises are unwrapped, so that iterations never have their value property set to a promise. */
  115555. function createIteration(r, value) {
  115556. var done = r.state >= Done;
  115557. return Promise.resolve(value).then(function (value) {
  115558. if (!done && r.state >= Rejected) {
  115559. return consumeExecution(r).then(function (value) {
  115560. return {
  115561. value: value,
  115562. done: true
  115563. };
  115564. });
  115565. }
  115566. return {
  115567. value: value,
  115568. done: done
  115569. };
  115570. });
  115571. }
  115572. /**
  115573. * This function is bound and passed to the executor as the stop argument.
  115574. *
  115575. * Advances state to Stopped.
  115576. */
  115577. function stop(r, err) {
  115578. var e_1, _a;
  115579. if (r.state >= Stopped) {
  115580. return;
  115581. }
  115582. r.state = Stopped;
  115583. r.onnext();
  115584. r.onstop();
  115585. if (r.err == null) {
  115586. r.err = err;
  115587. }
  115588. if (r.pushes.length === 0 && (typeof r.buffer === "undefined" || r.buffer.empty)) {
  115589. finish(r);
  115590. } else {
  115591. try {
  115592. for (var _b = __values(r.pushes), _d = _b.next(); !_d.done; _d = _b.next()) {
  115593. var push_1 = _d.value;
  115594. push_1.resolve();
  115595. }
  115596. } catch (e_1_1) {
  115597. e_1 = {
  115598. error: e_1_1
  115599. };
  115600. } finally {
  115601. try {
  115602. if (_d && !_d.done && (_a = _b["return"])) _a.call(_b);
  115603. } finally {
  115604. if (e_1) throw e_1.error;
  115605. }
  115606. }
  115607. }
  115608. }
  115609. /**
  115610. * The difference between stopping a repeater vs finishing a repeater is that stopping a repeater allows next to continue to drain values from the push queue and buffer, while finishing a repeater will clear all pending values and end iteration immediately. Once, a repeater is finished, all iterations will have the done property set to true.
  115611. *
  115612. * Advances state to Done.
  115613. */
  115614. function finish(r) {
  115615. var e_2, _a;
  115616. if (r.state >= Done) {
  115617. return;
  115618. }
  115619. if (r.state < Stopped) {
  115620. stop(r);
  115621. }
  115622. r.state = Done;
  115623. r.buffer = undefined;
  115624. try {
  115625. for (var _b = __values(r.nexts), _d = _b.next(); !_d.done; _d = _b.next()) {
  115626. var next = _d.value;
  115627. var execution = r.pending === undefined ? consumeExecution(r) : r.pending.then(function () {
  115628. return consumeExecution(r);
  115629. });
  115630. next.resolve(createIteration(r, execution));
  115631. }
  115632. } catch (e_2_1) {
  115633. e_2 = {
  115634. error: e_2_1
  115635. };
  115636. } finally {
  115637. try {
  115638. if (_d && !_d.done && (_a = _b["return"])) _a.call(_b);
  115639. } finally {
  115640. if (e_2) throw e_2.error;
  115641. }
  115642. }
  115643. r.pushes = [];
  115644. r.nexts = [];
  115645. }
  115646. /**
  115647. * Called when a promise passed to push rejects, or when a push call is unhandled.
  115648. *
  115649. * Advances state to Rejected.
  115650. */
  115651. function reject(r) {
  115652. if (r.state >= Rejected) {
  115653. return;
  115654. }
  115655. if (r.state < Done) {
  115656. finish(r);
  115657. }
  115658. r.state = Rejected;
  115659. }
  115660. /** This function is bound and passed to the executor as the push argument. */
  115661. function push(r, value) {
  115662. swallow(value);
  115663. if (r.pushes.length >= MAX_QUEUE_LENGTH) {
  115664. throw new RepeaterOverflowError("No more than " + MAX_QUEUE_LENGTH + " pending calls to push are allowed on a single repeater.");
  115665. } else if (r.state >= Stopped) {
  115666. return Promise.resolve(undefined);
  115667. }
  115668. var valueP = r.pending === undefined ? Promise.resolve(value) : r.pending.then(function () {
  115669. return value;
  115670. });
  115671. valueP = valueP["catch"](function (err) {
  115672. if (r.state < Stopped) {
  115673. r.err = err;
  115674. }
  115675. reject(r);
  115676. return undefined; // void :(
  115677. });
  115678. var nextP;
  115679. if (r.nexts.length) {
  115680. var next_1 = r.nexts.shift();
  115681. next_1.resolve(createIteration(r, valueP));
  115682. if (r.nexts.length) {
  115683. nextP = Promise.resolve(r.nexts[0].value);
  115684. } else {
  115685. nextP = new Promise(function (resolve) {
  115686. return r.onnext = resolve;
  115687. });
  115688. }
  115689. } else if (typeof r.buffer !== "undefined" && !r.buffer.full) {
  115690. r.buffer.add(valueP);
  115691. nextP = Promise.resolve(undefined);
  115692. } else {
  115693. nextP = new Promise(function (resolve) {
  115694. return r.pushes.push({
  115695. resolve: resolve,
  115696. value: valueP
  115697. });
  115698. });
  115699. }
  115700. // If an error is thrown into the repeater via the next or throw methods, we give the repeater a chance to handle this by rejecting the promise returned from push. If the push call is not immediately handled we throw the next iteration of the repeater.
  115701. // To check that the promise returned from push is floating, we modify the then and catch methods of the returned promise so that they flip the floating flag. The push function actually does not return a promise, because modern engines do not call the then and catch methods on native promises. By making next a plain old javascript object, we ensure that the then and catch methods will be called.
  115702. var floating = true;
  115703. var next = {};
  115704. var unhandled = nextP["catch"](function (err) {
  115705. if (floating) {
  115706. throw err;
  115707. }
  115708. return undefined; // void :(
  115709. });
  115710. next.then = function (onfulfilled, onrejected) {
  115711. floating = false;
  115712. return Promise.prototype.then.call(nextP, onfulfilled, onrejected);
  115713. };
  115714. next["catch"] = function (onrejected) {
  115715. floating = false;
  115716. return Promise.prototype["catch"].call(nextP, onrejected);
  115717. };
  115718. next["finally"] = nextP["finally"].bind(nextP);
  115719. r.pending = valueP.then(function () {
  115720. return unhandled;
  115721. })["catch"](function (err) {
  115722. r.err = err;
  115723. reject(r);
  115724. });
  115725. return next;
  115726. }
  115727. /**
  115728. * Creates the stop callable promise which is passed to the executor
  115729. */
  115730. function createStop(r) {
  115731. var stop1 = stop.bind(null, r);
  115732. var stopP = new Promise(function (resolve) {
  115733. return r.onstop = resolve;
  115734. });
  115735. stop1.then = stopP.then.bind(stopP);
  115736. stop1["catch"] = stopP["catch"].bind(stopP);
  115737. stop1["finally"] = stopP["finally"].bind(stopP);
  115738. return stop1;
  115739. }
  115740. /**
  115741. * Calls the executor passed into the constructor. This function is called the first time the next method is called on the repeater.
  115742. *
  115743. * Advances state to Started.
  115744. */
  115745. function execute(r) {
  115746. if (r.state >= Started) {
  115747. return;
  115748. }
  115749. r.state = Started;
  115750. var push1 = push.bind(null, r);
  115751. var stop1 = createStop(r);
  115752. r.execution = new Promise(function (resolve) {
  115753. return resolve(r.executor(push1, stop1));
  115754. });
  115755. // TODO: We should consider stopping all repeaters when the executor settles.
  115756. r.execution["catch"](function () {
  115757. return stop(r);
  115758. });
  115759. }
  115760. var records = new WeakMap();
  115761. // NOTE: While repeaters implement and are assignable to the AsyncGenerator interface, and you can use the types interchangeably, we don’t use typescript’s implements syntax here because this would make supporting earlier versions of typescript trickier. This is because TypeScript version 3.6 changed the iterator types by adding the TReturn and TNext type parameters.
  115762. var Repeater = /** @class */function () {
  115763. function Repeater(executor, buffer) {
  115764. records.set(this, {
  115765. executor: executor,
  115766. buffer: buffer,
  115767. err: undefined,
  115768. state: Initial,
  115769. pushes: [],
  115770. nexts: [],
  115771. pending: undefined,
  115772. execution: undefined,
  115773. onnext: NOOP,
  115774. onstop: NOOP
  115775. });
  115776. }
  115777. Repeater.prototype.next = function (value) {
  115778. swallow(value);
  115779. var r = records.get(this);
  115780. if (r === undefined) {
  115781. throw new Error("WeakMap error");
  115782. }
  115783. if (r.nexts.length >= MAX_QUEUE_LENGTH) {
  115784. throw new RepeaterOverflowError("No more than " + MAX_QUEUE_LENGTH + " pending calls to next are allowed on a single repeater.");
  115785. }
  115786. if (r.state <= Initial) {
  115787. execute(r);
  115788. }
  115789. r.onnext(value);
  115790. if (typeof r.buffer !== "undefined" && !r.buffer.empty) {
  115791. var result = createIteration(r, r.buffer.remove());
  115792. if (r.pushes.length) {
  115793. var push_2 = r.pushes.shift();
  115794. r.buffer.add(push_2.value);
  115795. r.onnext = push_2.resolve;
  115796. }
  115797. return result;
  115798. } else if (r.pushes.length) {
  115799. var push_3 = r.pushes.shift();
  115800. r.onnext = push_3.resolve;
  115801. return createIteration(r, push_3.value);
  115802. } else if (r.state >= Stopped) {
  115803. finish(r);
  115804. return createIteration(r, consumeExecution(r));
  115805. }
  115806. return new Promise(function (resolve) {
  115807. return r.nexts.push({
  115808. resolve: resolve,
  115809. value: value
  115810. });
  115811. });
  115812. };
  115813. Repeater.prototype["return"] = function (value) {
  115814. swallow(value);
  115815. var r = records.get(this);
  115816. if (r === undefined) {
  115817. throw new Error("WeakMap error");
  115818. }
  115819. finish(r);
  115820. // We override the execution because return should always return the value passed in.
  115821. r.execution = Promise.resolve(r.execution).then(function () {
  115822. return value;
  115823. });
  115824. return createIteration(r, consumeExecution(r));
  115825. };
  115826. Repeater.prototype["throw"] = function (err) {
  115827. var r = records.get(this);
  115828. if (r === undefined) {
  115829. throw new Error("WeakMap error");
  115830. }
  115831. if (r.state <= Initial || r.state >= Stopped || typeof r.buffer !== "undefined" && !r.buffer.empty) {
  115832. finish(r);
  115833. // If r.err is already set, that mean the repeater has already produced an error, so we throw that error rather than the error passed in, because doing so might be more informative for the caller.
  115834. if (r.err == null) {
  115835. r.err = err;
  115836. }
  115837. return createIteration(r, consumeExecution(r));
  115838. }
  115839. return this.next(Promise.reject(err));
  115840. };
  115841. Repeater.prototype[Symbol.asyncIterator] = function () {
  115842. return this;
  115843. };
  115844. // TODO: Remove these static methods from the class.
  115845. Repeater.race = race;
  115846. Repeater.merge = merge;
  115847. Repeater.zip = zip;
  115848. Repeater.latest = latest;
  115849. return Repeater;
  115850. }();
  115851. /*** COMBINATOR FUNCTIONS ***/
  115852. // TODO: move these combinators to their own file.
  115853. function getIterators(values, options) {
  115854. var e_3, _a;
  115855. var iters = [];
  115856. var _loop_1 = function _loop_1(value) {
  115857. if (value != null && typeof value[Symbol.asyncIterator] === "function") {
  115858. iters.push(value[Symbol.asyncIterator]());
  115859. } else if (value != null && typeof value[Symbol.iterator] === "function") {
  115860. iters.push(value[Symbol.iterator]());
  115861. } else {
  115862. iters.push(function valueToAsyncIterator() {
  115863. return __asyncGenerator(this, arguments, function valueToAsyncIterator_1() {
  115864. return __generator(this, function (_a) {
  115865. switch (_a.label) {
  115866. case 0:
  115867. if (!options.yieldValues) return [3 /*break*/, 3];
  115868. return [4 /*yield*/, __await(value)];
  115869. case 1:
  115870. return [4 /*yield*/, _a.sent()];
  115871. case 2:
  115872. _a.sent();
  115873. _a.label = 3;
  115874. case 3:
  115875. if (!options.returnValues) return [3 /*break*/, 5];
  115876. return [4 /*yield*/, __await(value)];
  115877. case 4:
  115878. return [2 /*return*/, _a.sent()];
  115879. case 5:
  115880. return [2 /*return*/];
  115881. }
  115882. });
  115883. });
  115884. }());
  115885. }
  115886. };
  115887. try {
  115888. for (var values_1 = __values(values), values_1_1 = values_1.next(); !values_1_1.done; values_1_1 = values_1.next()) {
  115889. var value = values_1_1.value;
  115890. _loop_1(value);
  115891. }
  115892. } catch (e_3_1) {
  115893. e_3 = {
  115894. error: e_3_1
  115895. };
  115896. } finally {
  115897. try {
  115898. if (values_1_1 && !values_1_1.done && (_a = values_1["return"])) _a.call(values_1);
  115899. } finally {
  115900. if (e_3) throw e_3.error;
  115901. }
  115902. }
  115903. return iters;
  115904. }
  115905. // NOTE: whenever you see any variables called `advance` or `advances`, know that it is a hack to get around the fact that `Promise.race` leaks memory. These variables are intended to be set to the resolve function of a promise which is constructed and awaited as an alternative to Promise.race. For more information, see this comment in the Node.js issue tracker: https://github.com/nodejs/node/issues/17469#issuecomment-685216777.
  115906. function race(contenders) {
  115907. var _this = this;
  115908. var iters = getIterators(contenders, {
  115909. returnValues: true
  115910. });
  115911. return new Repeater(function (push, stop) {
  115912. return __awaiter(_this, void 0, void 0, function () {
  115913. var advance, stopped, finalIteration, iteration, i_1, _loop_2;
  115914. return __generator(this, function (_a) {
  115915. switch (_a.label) {
  115916. case 0:
  115917. if (!iters.length) {
  115918. stop();
  115919. return [2 /*return*/];
  115920. }
  115921. stopped = false;
  115922. stop.then(function () {
  115923. advance();
  115924. stopped = true;
  115925. });
  115926. _a.label = 1;
  115927. case 1:
  115928. _a.trys.push([1,, 5, 7]);
  115929. iteration = void 0;
  115930. i_1 = 0;
  115931. _loop_2 = function _loop_2() {
  115932. var j, iters_1, iters_1_1, iter;
  115933. var e_4, _a;
  115934. return __generator(this, function (_b) {
  115935. switch (_b.label) {
  115936. case 0:
  115937. j = i_1;
  115938. try {
  115939. for (iters_1 = (e_4 = void 0, __values(iters)), iters_1_1 = iters_1.next(); !iters_1_1.done; iters_1_1 = iters_1.next()) {
  115940. iter = iters_1_1.value;
  115941. Promise.resolve(iter.next()).then(function (iteration) {
  115942. if (iteration.done) {
  115943. stop();
  115944. if (finalIteration === undefined) {
  115945. finalIteration = iteration;
  115946. }
  115947. } else if (i_1 === j) {
  115948. // This iterator has won, advance i and resolve the promise.
  115949. i_1++;
  115950. advance(iteration);
  115951. }
  115952. }, function (err) {
  115953. return stop(err);
  115954. });
  115955. }
  115956. } catch (e_4_1) {
  115957. e_4 = {
  115958. error: e_4_1
  115959. };
  115960. } finally {
  115961. try {
  115962. if (iters_1_1 && !iters_1_1.done && (_a = iters_1["return"])) _a.call(iters_1);
  115963. } finally {
  115964. if (e_4) throw e_4.error;
  115965. }
  115966. }
  115967. return [4 /*yield*/, new Promise(function (resolve) {
  115968. return advance = resolve;
  115969. })];
  115970. case 1:
  115971. iteration = _b.sent();
  115972. if (!(iteration !== undefined)) return [3 /*break*/, 3];
  115973. return [4 /*yield*/, push(iteration.value)];
  115974. case 2:
  115975. _b.sent();
  115976. _b.label = 3;
  115977. case 3:
  115978. return [2 /*return*/];
  115979. }
  115980. });
  115981. };
  115982. _a.label = 2;
  115983. case 2:
  115984. if (!!stopped) return [3 /*break*/, 4];
  115985. return [5 /*yield**/, _loop_2()];
  115986. case 3:
  115987. _a.sent();
  115988. return [3 /*break*/, 2];
  115989. case 4:
  115990. return [2 /*return*/, finalIteration && finalIteration.value];
  115991. case 5:
  115992. stop();
  115993. return [4 /*yield*/, Promise.race(iters.map(function (iter) {
  115994. return iter["return"] && iter["return"]();
  115995. }))];
  115996. case 6:
  115997. _a.sent();
  115998. return [7 /*endfinally*/];
  115999. case 7:
  116000. return [2 /*return*/];
  116001. }
  116002. });
  116003. });
  116004. });
  116005. }
  116006. function merge(contenders) {
  116007. var _this = this;
  116008. var iters = getIterators(contenders, {
  116009. yieldValues: true
  116010. });
  116011. return new Repeater(function (push, stop) {
  116012. return __awaiter(_this, void 0, void 0, function () {
  116013. var advances, stopped, finalIteration;
  116014. var _this = this;
  116015. return __generator(this, function (_a) {
  116016. switch (_a.label) {
  116017. case 0:
  116018. if (!iters.length) {
  116019. stop();
  116020. return [2 /*return*/];
  116021. }
  116022. advances = [];
  116023. stopped = false;
  116024. stop.then(function () {
  116025. var e_5, _a;
  116026. stopped = true;
  116027. try {
  116028. for (var advances_1 = __values(advances), advances_1_1 = advances_1.next(); !advances_1_1.done; advances_1_1 = advances_1.next()) {
  116029. var advance = advances_1_1.value;
  116030. advance();
  116031. }
  116032. } catch (e_5_1) {
  116033. e_5 = {
  116034. error: e_5_1
  116035. };
  116036. } finally {
  116037. try {
  116038. if (advances_1_1 && !advances_1_1.done && (_a = advances_1["return"])) _a.call(advances_1);
  116039. } finally {
  116040. if (e_5) throw e_5.error;
  116041. }
  116042. }
  116043. });
  116044. _a.label = 1;
  116045. case 1:
  116046. _a.trys.push([1,, 3, 4]);
  116047. return [4 /*yield*/, Promise.all(iters.map(function (iter, i) {
  116048. return __awaiter(_this, void 0, void 0, function () {
  116049. var iteration, _a;
  116050. return __generator(this, function (_b) {
  116051. switch (_b.label) {
  116052. case 0:
  116053. _b.trys.push([0,, 6, 9]);
  116054. _b.label = 1;
  116055. case 1:
  116056. if (!!stopped) return [3 /*break*/, 5];
  116057. Promise.resolve(iter.next()).then(function (iteration) {
  116058. return advances[i](iteration);
  116059. }, function (err) {
  116060. return stop(err);
  116061. });
  116062. return [4 /*yield*/, new Promise(function (resolve) {
  116063. advances[i] = resolve;
  116064. })];
  116065. case 2:
  116066. iteration = _b.sent();
  116067. if (!(iteration !== undefined)) return [3 /*break*/, 4];
  116068. if (iteration.done) {
  116069. finalIteration = iteration;
  116070. return [2 /*return*/];
  116071. }
  116072. return [4 /*yield*/, push(iteration.value)];
  116073. case 3:
  116074. _b.sent();
  116075. _b.label = 4;
  116076. case 4:
  116077. return [3 /*break*/, 1];
  116078. case 5:
  116079. return [3 /*break*/, 9];
  116080. case 6:
  116081. _a = iter["return"];
  116082. if (!_a) return [3 /*break*/, 8];
  116083. return [4 /*yield*/, iter["return"]()];
  116084. case 7:
  116085. _a = _b.sent();
  116086. _b.label = 8;
  116087. case 8:
  116088. return [7 /*endfinally*/];
  116089. case 9:
  116090. return [2 /*return*/];
  116091. }
  116092. });
  116093. });
  116094. }))];
  116095. case 2:
  116096. _a.sent();
  116097. return [2 /*return*/, finalIteration && finalIteration.value];
  116098. case 3:
  116099. stop();
  116100. return [7 /*endfinally*/];
  116101. case 4:
  116102. return [2 /*return*/];
  116103. }
  116104. });
  116105. });
  116106. });
  116107. }
  116108. function zip(contenders) {
  116109. var _this = this;
  116110. var iters = getIterators(contenders, {
  116111. returnValues: true
  116112. });
  116113. return new Repeater(function (push, stop) {
  116114. return __awaiter(_this, void 0, void 0, function () {
  116115. var advance, stopped, iterations, values;
  116116. return __generator(this, function (_a) {
  116117. switch (_a.label) {
  116118. case 0:
  116119. if (!iters.length) {
  116120. stop();
  116121. return [2 /*return*/, []];
  116122. }
  116123. stopped = false;
  116124. stop.then(function () {
  116125. advance();
  116126. stopped = true;
  116127. });
  116128. _a.label = 1;
  116129. case 1:
  116130. _a.trys.push([1,, 6, 8]);
  116131. _a.label = 2;
  116132. case 2:
  116133. if (!!stopped) return [3 /*break*/, 5];
  116134. Promise.all(iters.map(function (iter) {
  116135. return iter.next();
  116136. })).then(function (iterations) {
  116137. return advance(iterations);
  116138. }, function (err) {
  116139. return stop(err);
  116140. });
  116141. return [4 /*yield*/, new Promise(function (resolve) {
  116142. return advance = resolve;
  116143. })];
  116144. case 3:
  116145. iterations = _a.sent();
  116146. if (iterations === undefined) {
  116147. return [2 /*return*/];
  116148. }
  116149. values = iterations.map(function (iteration) {
  116150. return iteration.value;
  116151. });
  116152. if (iterations.some(function (iteration) {
  116153. return iteration.done;
  116154. })) {
  116155. return [2 /*return*/, values];
  116156. }
  116157. return [4 /*yield*/, push(values)];
  116158. case 4:
  116159. _a.sent();
  116160. return [3 /*break*/, 2];
  116161. case 5:
  116162. return [3 /*break*/, 8];
  116163. case 6:
  116164. stop();
  116165. return [4 /*yield*/, Promise.all(iters.map(function (iter) {
  116166. return iter["return"] && iter["return"]();
  116167. }))];
  116168. case 7:
  116169. _a.sent();
  116170. return [7 /*endfinally*/];
  116171. case 8:
  116172. return [2 /*return*/];
  116173. }
  116174. });
  116175. });
  116176. });
  116177. }
  116178. function latest(contenders) {
  116179. var _this = this;
  116180. var iters = getIterators(contenders, {
  116181. yieldValues: true,
  116182. returnValues: true
  116183. });
  116184. return new Repeater(function (push, stop) {
  116185. return __awaiter(_this, void 0, void 0, function () {
  116186. var advance, advances, stopped, iterations_1, values_2;
  116187. var _this = this;
  116188. return __generator(this, function (_a) {
  116189. switch (_a.label) {
  116190. case 0:
  116191. if (!iters.length) {
  116192. stop();
  116193. return [2 /*return*/, []];
  116194. }
  116195. advances = [];
  116196. stopped = false;
  116197. stop.then(function () {
  116198. var e_6, _a;
  116199. advance();
  116200. try {
  116201. for (var advances_2 = __values(advances), advances_2_1 = advances_2.next(); !advances_2_1.done; advances_2_1 = advances_2.next()) {
  116202. var advance1 = advances_2_1.value;
  116203. advance1();
  116204. }
  116205. } catch (e_6_1) {
  116206. e_6 = {
  116207. error: e_6_1
  116208. };
  116209. } finally {
  116210. try {
  116211. if (advances_2_1 && !advances_2_1.done && (_a = advances_2["return"])) _a.call(advances_2);
  116212. } finally {
  116213. if (e_6) throw e_6.error;
  116214. }
  116215. }
  116216. stopped = true;
  116217. });
  116218. _a.label = 1;
  116219. case 1:
  116220. _a.trys.push([1,, 5, 7]);
  116221. Promise.all(iters.map(function (iter) {
  116222. return iter.next();
  116223. })).then(function (iterations) {
  116224. return advance(iterations);
  116225. }, function (err) {
  116226. return stop(err);
  116227. });
  116228. return [4 /*yield*/, new Promise(function (resolve) {
  116229. return advance = resolve;
  116230. })];
  116231. case 2:
  116232. iterations_1 = _a.sent();
  116233. if (iterations_1 === undefined) {
  116234. return [2 /*return*/];
  116235. }
  116236. values_2 = iterations_1.map(function (iteration) {
  116237. return iteration.value;
  116238. });
  116239. if (iterations_1.every(function (iteration) {
  116240. return iteration.done;
  116241. })) {
  116242. return [2 /*return*/, values_2];
  116243. }
  116244. // We continuously yield and mutate the same values array so we shallow copy it each time it is pushed.
  116245. return [4 /*yield*/, push(values_2.slice())];
  116246. case 3:
  116247. // We continuously yield and mutate the same values array so we shallow copy it each time it is pushed.
  116248. _a.sent();
  116249. return [4 /*yield*/, Promise.all(iters.map(function (iter, i) {
  116250. return __awaiter(_this, void 0, void 0, function () {
  116251. var iteration;
  116252. return __generator(this, function (_a) {
  116253. switch (_a.label) {
  116254. case 0:
  116255. if (iterations_1[i].done) {
  116256. return [2 /*return*/, iterations_1[i].value];
  116257. }
  116258. _a.label = 1;
  116259. case 1:
  116260. if (!!stopped) return [3 /*break*/, 4];
  116261. Promise.resolve(iter.next()).then(function (iteration) {
  116262. return advances[i](iteration);
  116263. }, function (err) {
  116264. return stop(err);
  116265. });
  116266. return [4 /*yield*/, new Promise(function (resolve) {
  116267. return advances[i] = resolve;
  116268. })];
  116269. case 2:
  116270. iteration = _a.sent();
  116271. if (iteration === undefined) {
  116272. return [2 /*return*/, iterations_1[i].value];
  116273. } else if (iteration.done) {
  116274. return [2 /*return*/, iteration.value];
  116275. }
  116276. values_2[i] = iteration.value;
  116277. return [4 /*yield*/, push(values_2.slice())];
  116278. case 3:
  116279. _a.sent();
  116280. return [3 /*break*/, 1];
  116281. case 4:
  116282. return [2 /*return*/];
  116283. }
  116284. });
  116285. });
  116286. }))];
  116287. case 4:
  116288. return [2 /*return*/, _a.sent()];
  116289. case 5:
  116290. stop();
  116291. return [4 /*yield*/, Promise.all(iters.map(function (iter) {
  116292. return iter["return"] && iter["return"]();
  116293. }))];
  116294. case 6:
  116295. _a.sent();
  116296. return [7 /*endfinally*/];
  116297. case 7:
  116298. return [2 /*return*/];
  116299. }
  116300. });
  116301. });
  116302. });
  116303. }
  116304. __webpack_unused_export__ = DroppingBuffer;
  116305. __webpack_unused_export__ = FixedBuffer;
  116306. __webpack_unused_export__ = MAX_QUEUE_LENGTH;
  116307. exports.ZN = Repeater;
  116308. __webpack_unused_export__ = RepeaterOverflowError;
  116309. __webpack_unused_export__ = SlidingBuffer;
  116310. /***/ })
  116311. /******/ });
  116312. /************************************************************************/
  116313. /******/ // The module cache
  116314. /******/ var __webpack_module_cache__ = {};
  116315. /******/
  116316. /******/ // The require function
  116317. /******/ function __webpack_require__(moduleId) {
  116318. /******/ // Check if module is in cache
  116319. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  116320. /******/ if (cachedModule !== undefined) {
  116321. /******/ return cachedModule.exports;
  116322. /******/ }
  116323. /******/ // Create a new module (and put it into the cache)
  116324. /******/ var module = __webpack_module_cache__[moduleId] = {
  116325. /******/ id: moduleId,
  116326. /******/ loaded: false,
  116327. /******/ exports: {}
  116328. /******/ };
  116329. /******/
  116330. /******/ // Execute the module function
  116331. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  116332. /******/
  116333. /******/ // Flag the module as loaded
  116334. /******/ module.loaded = true;
  116335. /******/
  116336. /******/ // Return the exports of the module
  116337. /******/ return module.exports;
  116338. /******/ }
  116339. /******/
  116340. /************************************************************************/
  116341. /******/ /* webpack/runtime/compat get default export */
  116342. /******/ !function() {
  116343. /******/ // getDefaultExport function for compatibility with non-harmony modules
  116344. /******/ __webpack_require__.n = function(module) {
  116345. /******/ var getter = module && module.__esModule ?
  116346. /******/ function() { return module['default']; } :
  116347. /******/ function() { return module; };
  116348. /******/ __webpack_require__.d(getter, { a: getter });
  116349. /******/ return getter;
  116350. /******/ };
  116351. /******/ }();
  116352. /******/
  116353. /******/ /* webpack/runtime/define property getters */
  116354. /******/ !function() {
  116355. /******/ // define getter functions for harmony exports
  116356. /******/ __webpack_require__.d = function(exports, definition) {
  116357. /******/ for(var key in definition) {
  116358. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  116359. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  116360. /******/ }
  116361. /******/ }
  116362. /******/ };
  116363. /******/ }();
  116364. /******/
  116365. /******/ /* webpack/runtime/global */
  116366. /******/ !function() {
  116367. /******/ __webpack_require__.g = (function() {
  116368. /******/ if (typeof globalThis === 'object') return globalThis;
  116369. /******/ try {
  116370. /******/ return this || new Function('return this')();
  116371. /******/ } catch (e) {
  116372. /******/ if (typeof window === 'object') return window;
  116373. /******/ }
  116374. /******/ })();
  116375. /******/ }();
  116376. /******/
  116377. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  116378. /******/ !function() {
  116379. /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
  116380. /******/ }();
  116381. /******/
  116382. /******/ /* webpack/runtime/node module decorator */
  116383. /******/ !function() {
  116384. /******/ __webpack_require__.nmd = function(module) {
  116385. /******/ module.paths = [];
  116386. /******/ if (!module.children) module.children = [];
  116387. /******/ return module;
  116388. /******/ };
  116389. /******/ }();
  116390. /******/
  116391. /************************************************************************/
  116392. /******/
  116393. /******/ // startup
  116394. /******/ // Load entry module and return exports
  116395. /******/ // This entry module is referenced by other modules so it can't be inlined
  116396. /******/ __webpack_require__(3123);
  116397. /******/ __webpack_require__(5023);
  116398. /******/ __webpack_require__(4853);
  116399. /******/ var __webpack_exports__ = __webpack_require__(3884);
  116400. /******/
  116401. /******/ })()
  116402. ;